diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 8fe5e6c5db2815ff2c5fcbf28b6fedeec3e060c0..0c3626b2f576dae2135de2030c01ada133aa89d7 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -24,7 +24,7 @@ stages: include: #- local: '/manifests/.gitlab-ci.yml' - local: '/src/monitoring/.gitlab-ci.yml' - - local: '/src/compute/.gitlab-ci.yml' + - local: '/src/nbi/.gitlab-ci.yml' - local: '/src/context/.gitlab-ci.yml' - local: '/src/device/.gitlab-ci.yml' - local: '/src/service/.gitlab-ci.yml' @@ -32,8 +32,9 @@ include: - local: '/src/opticalattackmitigator/.gitlab-ci.yml' - local: '/src/opticalattackdetector/.gitlab-ci.yml' # - local: '/src/opticalattackmanager/.gitlab-ci.yml' - - local: '/src/automation/.gitlab-ci.yml' + - local: '/src/ztp/.gitlab-ci.yml' - local: '/src/policy/.gitlab-ci.yml' + - local: '/src/forecaster/.gitlab-ci.yml' #- local: '/src/webui/.gitlab-ci.yml' #- local: '/src/l3_distributedattackdetector/.gitlab-ci.yml' #- local: '/src/l3_centralizedattackdetector/.gitlab-ci.yml' diff --git a/.gitlab/issue_templates/new-feature-with-design.md b/.gitlab/issue_templates/new-feature-with-design.md index ec08771641bcf5193ea4db45581bc85eb1a0a5b9..b6ae943b64ebed5c64509737975fc5f302181806 100644 --- a/.gitlab/issue_templates/new-feature-with-design.md +++ b/.gitlab/issue_templates/new-feature-with-design.md @@ -40,7 +40,7 @@ components deployed. ## Impacted Components -List of impacted components: Context, Device, Service, PathComp, Slice, Monitoring, Automation, Policy, Compute, etc. +List of impacted components: Context, Device, Service, PathComp, Slice, Monitoring, ZTP, Policy, NBI, etc. Just an enumeration, elaboration of impacts is done below. ## Component1 Impact diff --git a/deploy/all.sh b/deploy/all.sh index 9584dd32d121b7f63e7c7f177bf7bee8c287b4c9..25d69b485daff4dd0307e6fa85d3a4d47d54b72a 100755 --- a/deploy/all.sh +++ b/deploy/all.sh @@ -27,7 +27,7 @@ export TFS_REGISTRY_IMAGES=${TFS_REGISTRY_IMAGES:-"http://localhost:32000/tfs/"} # If not already set, set the list of components, separated by spaces, you want to build images for, and deploy. # By default, only basic components are deployed -export TFS_COMPONENTS=${TFS_COMPONENTS:-"context device automation monitoring pathcomp service slice compute webui load_generator"} +export TFS_COMPONENTS=${TFS_COMPONENTS:-"context device ztp monitoring pathcomp service slice nbi webui load_generator"} # If not already set, set the tag you want to use for your images. export TFS_IMAGE_TAG=${TFS_IMAGE_TAG:-"dev"} diff --git a/deploy/component.sh b/deploy/component.sh index 922aa5e0ec77a2c6acd73db1195a9ec3d2b160fb..e2648818684f672c41cca19a7ac1281b797f4382 100755 --- a/deploy/component.sh +++ b/deploy/component.sh @@ -59,7 +59,7 @@ for COMPONENT in $TFS_COMPONENTS; do echo " Building Docker image..." BUILD_LOG="$TMP_LOGS_FOLDER/build_${COMPONENT}.log" - if [ "$COMPONENT" == "automation" ] || [ "$COMPONENT" == "policy" ]; then + if [ "$COMPONENT" == "ztp" ] || [ "$COMPONENT" == "policy" ]; then docker build -t "$IMAGE_NAME" -f ./src/"$COMPONENT"/Dockerfile ./src/"$COMPONENT"/ > "$BUILD_LOG" elif [ "$COMPONENT" == "pathcomp" ]; then BUILD_LOG="$TMP_LOGS_FOLDER/build_${COMPONENT}-frontend.log" diff --git a/deploy/expose_dashboard.sh b/deploy/expose_dashboard.sh index 60b41c7b75d4f96a22151b1d4d68ba53c75a265c..65f715cabe6d688eb01dc5ae6afe7a21261aca94 100755 --- a/deploy/expose_dashboard.sh +++ b/deploy/expose_dashboard.sh @@ -29,11 +29,13 @@ export GRAF_EXT_PORT_HTTP=${GRAF_EXT_PORT_HTTP:-"3000"} # Automated steps start here ######################################################################################################################## +MONITORING_NAMESPACE="monitoring" + function expose_dashboard() { echo "Prometheus Port Mapping" echo ">>> Expose Prometheus HTTP Mgmt GUI port (9090->${PROM_EXT_PORT_HTTP})" - PROM_PORT_HTTP=$(kubectl --namespace monitoring get service prometheus-k8s -o 'jsonpath={.spec.ports[?(@.name=="web")].port}') - PATCH='{"data": {"'${PROM_EXT_PORT_HTTP}'": "monitoring/prometheus-k8s:'${PROM_PORT_HTTP}'"}}' + PROM_PORT_HTTP=$(kubectl --namespace ${MONITORING_NAMESPACE} get service prometheus-k8s -o 'jsonpath={.spec.ports[?(@.name=="web")].port}') + PATCH='{"data": {"'${PROM_EXT_PORT_HTTP}'": "'${MONITORING_NAMESPACE}'/prometheus-k8s:'${PROM_PORT_HTTP}'"}}' kubectl patch configmap nginx-ingress-tcp-microk8s-conf --namespace ingress --patch "${PATCH}" PORT_MAP='{"containerPort": '${PROM_EXT_PORT_HTTP}', "hostPort": '${PROM_EXT_PORT_HTTP}'}' @@ -44,8 +46,8 @@ function expose_dashboard() { echo "Grafana Port Mapping" echo ">>> Expose Grafana HTTP Mgmt GUI port (3000->${GRAF_EXT_PORT_HTTP})" - GRAF_PORT_HTTP=$(kubectl --namespace monitoring get service grafana -o 'jsonpath={.spec.ports[?(@.name=="http")].port}') - PATCH='{"data": {"'${GRAF_EXT_PORT_HTTP}'": "monitoring/grafana:'${GRAF_PORT_HTTP}'"}}' + GRAF_PORT_HTTP=$(kubectl --namespace ${MONITORING_NAMESPACE} get service grafana -o 'jsonpath={.spec.ports[?(@.name=="http")].port}') + PATCH='{"data": {"'${GRAF_EXT_PORT_HTTP}'": "'${MONITORING_NAMESPACE}'/grafana:'${GRAF_PORT_HTTP}'"}}' kubectl patch configmap nginx-ingress-tcp-microk8s-conf --namespace ingress --patch "${PATCH}" PORT_MAP='{"containerPort": '${GRAF_EXT_PORT_HTTP}', "hostPort": '${GRAF_EXT_PORT_HTTP}'}' @@ -55,4 +57,9 @@ function expose_dashboard() { echo } -expose_dashboard +if kubectl get namespace ${MONITORING_NAMESPACE} &> /dev/null; then + echo ">>> Namespace ${MONITORING_NAMESPACE} is present, exposing dashboard..." + expose_dashboard +else + echo ">>> Namespace ${MONITORING_NAMESPACE} is NOT present, skipping expose dashboard..." +fi diff --git a/deploy/mock_blockchain.sh b/deploy/mock_blockchain.sh index ef7811c87eabdcb7cf95db2e4cf1a6eee52ef6ca..74d62cd526a38298c8f197fedf0c0169dbb8efca 100755 --- a/deploy/mock_blockchain.sh +++ b/deploy/mock_blockchain.sh @@ -38,20 +38,21 @@ 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_MANIFESTS_FOLDER="${TMP_FOLDER}/${K8S_NAMESPACE}/manifests" mkdir -p $TMP_MANIFESTS_FOLDER -TMP_LOGS_FOLDER="$TMP_FOLDER/logs" +TMP_LOGS_FOLDER="${TMP_FOLDER}/${K8S_NAMESPACE}/logs" mkdir -p $TMP_LOGS_FOLDER echo "Deleting and Creating a new namespace..." -kubectl delete namespace $K8S_NAMESPACE +kubectl delete namespace $K8S_NAMESPACE --ignore-not-found 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 +echo "# Environment variables for TeraFlowSDN Mock-Blockchain deployment" > $ENV_VARS_SCRIPT PYTHONPATH=$(pwd)/src +echo "export PYTHONPATH=${PYTHONPATH}" >> $ENV_VARS_SCRIPT echo "Processing '$COMPONENT' component..." IMAGE_NAME="$COMPONENT:$IMAGE_TAG" @@ -77,12 +78,12 @@ cp ./manifests/"${COMPONENT}".yaml "$MANIFEST" if [ -n "$REGISTRY_IMAGE" ]; then # Registry is set - VERSION=$(grep -i "${GITLAB_REPO_URL}/${COMPONENT}:" "$MANIFEST" | cut -d ":" -f3) + 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" 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) + VERSION=$(grep -i "${GITLAB_REPO_URL}/${COMPONENT}:" "$MANIFEST" | cut -d ":" -f4) 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 @@ -91,8 +92,8 @@ 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" +#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) diff --git a/deploy/nats.sh b/deploy/nats.sh index b730cec4af66920e5a7d8a2235e63beff70e8694..004f67c44986f776adaca34a9272aff264ec034c 100755 --- a/deploy/nats.sh +++ b/deploy/nats.sh @@ -47,6 +47,10 @@ function nats_deploy_single() { helm3 repo add nats https://nats-io.github.io/k8s/helm/charts/ echo + echo "Upgrade NATS Helm Chart" + helm3 repo update nats + echo + echo "Install NATS (single-node)" echo ">>> Checking if NATS is deployed..." if kubectl get --namespace ${NATS_NAMESPACE} statefulset/${NATS_NAMESPACE} &> /dev/null; then @@ -81,6 +85,10 @@ function nats_deploy_single() { echo "NATS Port Mapping" echo ">>> Expose NATS Client port (4222->${NATS_EXT_PORT_CLIENT})" NATS_PORT_CLIENT=$(kubectl --namespace ${NATS_NAMESPACE} get service ${NATS_NAMESPACE} -o 'jsonpath={.spec.ports[?(@.name=="client")].port}') + if [ -z "$NATS_PORT_CLIENT" ]; then + # NATS charts updated and port name changed from "client" to "nats"; fix to support new name and enable backward compatibility + NATS_PORT_CLIENT=$(kubectl --namespace ${NATS_NAMESPACE} get service ${NATS_NAMESPACE} -o 'jsonpath={.spec.ports[?(@.name=="nats")].port}') + fi PATCH='{"data": {"'${NATS_EXT_PORT_CLIENT}'": "'${NATS_NAMESPACE}'/'${NATS_NAMESPACE}':'${NATS_PORT_CLIENT}'"}}' kubectl patch configmap nginx-ingress-tcp-microk8s-conf --namespace ingress --patch "${PATCH}" diff --git a/deploy/tfs.sh b/deploy/tfs.sh index e6a0c0c1053b69462a0e60c6b6cebe28a7dc59af..3a01606ce32369d0f0968282569eaf4ed59d778c 100755 --- a/deploy/tfs.sh +++ b/deploy/tfs.sh @@ -27,7 +27,7 @@ export TFS_REGISTRY_IMAGES=${TFS_REGISTRY_IMAGES:-"http://localhost:32000/tfs/"} # If not already set, set the list of components, separated by spaces, you want to build images for, and deploy. # By default, only basic components are deployed -export TFS_COMPONENTS=${TFS_COMPONENTS:-"context device automation monitoring pathcomp service slice compute webui load_generator"} +export TFS_COMPONENTS=${TFS_COMPONENTS:-"context device ztp monitoring pathcomp service slice nbi webui load_generator"} # If not already set, set the tag you want to use for your images. export TFS_IMAGE_TAG=${TFS_IMAGE_TAG:-"dev"} @@ -148,6 +148,10 @@ printf "\n" echo "Create secret with NATS data" NATS_CLIENT_PORT=$(kubectl --namespace ${NATS_NAMESPACE} get service ${NATS_NAMESPACE} -o 'jsonpath={.spec.ports[?(@.name=="client")].port}') +if [ -z "$NATS_CLIENT_PORT" ]; then + # NATS charts updated and port name changed from "client" to "nats"; fix to support new name and enable backward compatibility + NATS_CLIENT_PORT=$(kubectl --namespace ${NATS_NAMESPACE} get service ${NATS_NAMESPACE} -o 'jsonpath={.spec.ports[?(@.name=="nats")].port}') +fi 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} @@ -183,6 +187,22 @@ REDIS_PASSWORD=`uuidgen` kubectl create secret generic redis-secrets --namespace=$TFS_K8S_NAMESPACE \ --from-literal=REDIS_PASSWORD=$REDIS_PASSWORD echo "export REDIS_PASSWORD=${REDIS_PASSWORD}" >> $ENV_VARS_SCRIPT +printf "\n" + +DOCKER_BUILD="docker build" +DOCKER_MAJOR_VERSION=$(docker --version | grep -o -E "Docker version [0-9]+\." | grep -o -E "[0-9]+" | cut -c 1-3) +if [[ $DOCKER_MAJOR_VERSION -ge 23 ]]; then + # If Docker version >= 23, build command was migrated to docker-buildx + # In Ubuntu, in practice, means to install package docker-buildx together with docker.io + # Check if docker-buildx plugin is installed + docker buildx version 1>/dev/null 2>/dev/null + if [[ $? -ne 0 ]]; then + echo "Docker buildx command is not installed. Check: https://docs.docker.com/build/architecture/#install-buildx" + echo "If you installed docker through APT package docker.io, consider installing also package docker-buildx" + exit 1; + fi + DOCKER_BUILD="docker buildx build" +fi for COMPONENT in $TFS_COMPONENTS; do echo "Processing '$COMPONENT' component..." @@ -191,25 +211,25 @@ for COMPONENT in $TFS_COMPONENTS; do echo " Building Docker image..." BUILD_LOG="$TMP_LOGS_FOLDER/build_${COMPONENT}.log" - if [ "$COMPONENT" == "automation" ] || [ "$COMPONENT" == "policy" ]; then - docker build -t "$COMPONENT:$TFS_IMAGE_TAG" -f ./src/"$COMPONENT"/Dockerfile ./src/"$COMPONENT"/ > "$BUILD_LOG" + if [ "$COMPONENT" == "ztp" ] || [ "$COMPONENT" == "policy" ]; then + $DOCKER_BUILD -t "$COMPONENT:$TFS_IMAGE_TAG" -f ./src/"$COMPONENT"/Dockerfile ./src/"$COMPONENT"/ > "$BUILD_LOG" elif [ "$COMPONENT" == "pathcomp" ]; then BUILD_LOG="$TMP_LOGS_FOLDER/build_${COMPONENT}-frontend.log" - docker build -t "$COMPONENT-frontend:$TFS_IMAGE_TAG" -f ./src/"$COMPONENT"/frontend/Dockerfile . > "$BUILD_LOG" + $DOCKER_BUILD -t "$COMPONENT-frontend:$TFS_IMAGE_TAG" -f ./src/"$COMPONENT"/frontend/Dockerfile . > "$BUILD_LOG" BUILD_LOG="$TMP_LOGS_FOLDER/build_${COMPONENT}-backend.log" - docker build -t "$COMPONENT-backend:$TFS_IMAGE_TAG" -f ./src/"$COMPONENT"/backend/Dockerfile . > "$BUILD_LOG" + $DOCKER_BUILD -t "$COMPONENT-backend:$TFS_IMAGE_TAG" -f ./src/"$COMPONENT"/backend/Dockerfile . > "$BUILD_LOG" # next command is redundant, but helpful to keep cache updated between rebuilds IMAGE_NAME="$COMPONENT-backend:$TFS_IMAGE_TAG-builder" - docker build -t "$IMAGE_NAME" --target builder -f ./src/"$COMPONENT"/backend/Dockerfile . >> "$BUILD_LOG" + $DOCKER_BUILD -t "$IMAGE_NAME" --target builder -f ./src/"$COMPONENT"/backend/Dockerfile . >> "$BUILD_LOG" elif [ "$COMPONENT" == "dlt" ]; then BUILD_LOG="$TMP_LOGS_FOLDER/build_${COMPONENT}-connector.log" - docker build -t "$COMPONENT-connector:$TFS_IMAGE_TAG" -f ./src/"$COMPONENT"/connector/Dockerfile . > "$BUILD_LOG" + $DOCKER_BUILD -t "$COMPONENT-connector:$TFS_IMAGE_TAG" -f ./src/"$COMPONENT"/connector/Dockerfile . > "$BUILD_LOG" BUILD_LOG="$TMP_LOGS_FOLDER/build_${COMPONENT}-gateway.log" - docker build -t "$COMPONENT-gateway:$TFS_IMAGE_TAG" -f ./src/"$COMPONENT"/gateway/Dockerfile . > "$BUILD_LOG" + $DOCKER_BUILD -t "$COMPONENT-gateway:$TFS_IMAGE_TAG" -f ./src/"$COMPONENT"/gateway/Dockerfile . > "$BUILD_LOG" else - docker build -t "$COMPONENT:$TFS_IMAGE_TAG" -f ./src/"$COMPONENT"/Dockerfile . > "$BUILD_LOG" + $DOCKER_BUILD -t "$COMPONENT:$TFS_IMAGE_TAG" -f ./src/"$COMPONENT"/Dockerfile . > "$BUILD_LOG" fi echo " Pushing Docker image to '$TFS_REGISTRY_IMAGES'..." @@ -327,7 +347,12 @@ 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 + if kubectl get namespace monitoring &> /dev/null; then + echo ">>> Namespace monitoring is present, applying service monitors..." + kubectl apply -f $EXTRA_MANIFEST + else + echo ">>> Namespace monitoring is NOT present, skipping service monitors..." + fi else kubectl --namespace $TFS_K8S_NAMESPACE apply -f $EXTRA_MANIFEST fi @@ -343,7 +368,7 @@ for COMPONENT in $TFS_COMPONENTS; do printf "\n" done -if [[ "$TFS_COMPONENTS" == *"webui"* ]]; then +if [[ "$TFS_COMPONENTS" == *"monitoring"* ]] && [[ "$TFS_COMPONENTS" == *"webui"* ]]; then echo "Configuring WebUI DataStores and Dashboards..." sleep 5 @@ -549,3 +574,9 @@ if [[ "$TFS_COMPONENTS" == *"webui"* ]]; then printf "\n\n" fi + +if [ "$DOCKER_BUILD" == "docker buildx build" ]; then + echo "Pruning Docker Buildx Cache..." + docker buildx prune --force + printf "\n\n" +fi diff --git a/expose_ingress_grpc.sh b/expose_ingress_grpc.sh index 2bc0fd64b60cafdfad92b3d8d031cd28d7d6a873..4fec2f219908cc4f8e496b781aaf62606033a291 100755 --- a/expose_ingress_grpc.sh +++ b/expose_ingress_grpc.sh @@ -21,7 +21,7 @@ export TFS_K8S_NAMESPACE=${TFS_K8S_NAMESPACE:-"tfs"} # If not already set, set the list of components you want to build images for, and deploy. -export TFS_COMPONENTS=${TFS_COMPONENTS:-"context device automation policy service compute monitoring dbscanserving opticalattackmitigator opticalcentralizedattackdetector l3_attackmitigator l3_centralizedattackdetector webui"} +export TFS_COMPONENTS=${TFS_COMPONENTS:-"context device ztp policy service nbi monitoring dbscanserving opticalattackmitigator opticalcentralizedattackdetector l3_attackmitigator l3_centralizedattackdetector webui"} ######################################################################################################################## # Automated steps start here diff --git a/hackfest/containerlab/commands.txt b/hackfest/containerlab/commands.txt index 18c629c0af2fe176a34f9b08a16405731c185243..df5fbc0ce0163f4ce06b862e90e29854dbae204a 100644 --- a/hackfest/containerlab/commands.txt +++ b/hackfest/containerlab/commands.txt @@ -60,22 +60,24 @@ docker exec -it clab-tfs-scenario-client2 bash $ sudo bash -c "$(curl -sL https://get-gnmic.kmrd.dev)" ## gNMI Capabilities request -$ gnmic -a clab-srlinux-srl1 -u admin -p NokiaSrl1! --skip-verify capabilities +$ gnmic -a clab-tfs-scenario-srl1 -u admin -p NokiaSrl1! --skip-verify capabilities ## gNMI Get request -$ gnmic -a clab-srlinux-srl1 -u admin -p NokiaSrl1! --skip-verify -e json_ietf get --path /system/name/host-name -$ gnmic -a clab-srlinux-srl1 -u admin -p NokiaSrl1! --skip-verify -e json_ietf get --path /interface[name=mgmt0] +$ gnmic -a clab-tfs-scenario-srl1 -u admin -p NokiaSrl1! --skip-verify -e json_ietf get --path /system/config/hostname +$ gnmic -a clab-tfs-scenario-srl1 -u admin -p NokiaSrl1! --skip-verify -e json_ietf get --path /interfaces/interface[name=mgmt0] + ## gNMI Set request -$ gnmic -a clab-srlinux-srl1 -u admin -p NokiaSrl1! --skip-verify -e json_ietf set --update-path /system/name/host-name --update-value slr11 +$ gnmic -a clab-tfs-scenario-srl1 -u admin -p NokiaSrl1! --skip-verify -e json_ietf set --update-path /system/config/hostname --update-value srl11 -(we check the changed value) -$ gnmic -a clab-srlinux-srl1 -u admin -p NokiaSrl1! --skip-verify -e json_ietf get --path /system/name/host-name +(we check the changed value) +$ gnmic -a clab-tfs-scenario-srl1 -u admin -p NokiaSrl1! --skip-verify -e json_ietf get --path /system/config/hostname ## Subscribe request -$ gnmic -a clab-srlinux-srl1 -u admin -p NokiaSrl1! --skip-verify -e json_ietf subscribe --path /interface[name=mgmt0]/statistics +$ gnmic -a clab-tfs-scenario-srl1 -u admin -p NokiaSrl1! --skip-verify -e json_ietf subscribe --path /interfaces/interface[name=mgmt0]/state/ + (In another terminal, you can generate traffic) -$ssh admin@clab-srlinux-srl1 +$ssh admin@clab-tfs-scenario-srl1 diff --git a/hackfest/p4/deploy_specs.sh b/hackfest/p4/deploy_specs.sh index b988123d5564684bd1bfcb776bab7f187fc628ca..fd3ac89efb33d8b719c73c33a89a416ada3398fd 100755 --- a/hackfest/p4/deploy_specs.sh +++ b/hackfest/p4/deploy_specs.sh @@ -16,7 +16,7 @@ export TFS_REGISTRY_IMAGE="http://localhost:32000/tfs/" # Set the list of components, separated by spaces, you want to build images for, and deploy. -export TFS_COMPONENTS="context device automation service compute monitoring webui" +export TFS_COMPONENTS="context device ztp service nbi monitoring webui" # Set the tag you want to use for your images. export TFS_IMAGE_TAG="dev" diff --git a/hackfest3 b/hackfest3 new file mode 120000 index 0000000000000000000000000000000000000000..2816e4af9a9b4f4b06651710e87d93f4d5db1f0b --- /dev/null +++ b/hackfest3 @@ -0,0 +1 @@ +src/tests/hackfest3/ \ No newline at end of file diff --git a/install_requirements.sh b/install_requirements.sh index 213edef5af3f6efc75b060f12972926aee2e5c5c..c59ea7f13909c789fef587192a56876187eb4195 100755 --- a/install_requirements.sh +++ b/install_requirements.sh @@ -16,14 +16,30 @@ # If not already set, set the list of components you want to install dependencies for. # By default, dependencies for all components are installed. # Components still not supported by this script: -# automation & policy : implemented in Java +# ztp & policy : implemented in Java # dlt : under design # pathcomp : under design -ALL_COMPONENTS="context device service compute monitoring webui interdomain slice" +ALL_COMPONENTS="context device service nbi monitoring webui interdomain slice" ALL_COMPONENTS="${ALL_COMPONENTS} dbscanserving opticalattackmitigator opticalattackdetector" ALL_COMPONENTS="${ALL_COMPONENTS} l3_attackmitigator l3_centralizedattackdetector l3_distributedattackdetector" TFS_COMPONENTS=${TFS_COMPONENTS:-$ALL_COMPONENTS} +# Some components require libyang built from source code +# - Ref: https://github.com/CESNET/libyang +# - Ref: https://github.com/CESNET/libyang-python/ +echo "Installing libyang..." +sudo apt-get --yes --quiet --quiet update +sudo apt-get --yes --quiet --quiet install build-essential cmake libpcre2-dev python3-dev python3-cffi +mkdir libyang +git clone https://github.com/CESNET/libyang.git libyang +mkdir libyang/build +cd libyang/build +cmake -D CMAKE_BUILD_TYPE:String="Release" .. +make +sudo make install +sudo ldconfig +cd ../.. + 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 @@ -38,7 +54,7 @@ printf "\n" echo "Collecting requirements from components..." for COMPONENT in $TFS_COMPONENTS do - if [ "$COMPONENT" == "automation" ] || [ "$COMPONENT" == "policy" ]; then continue; fi + if [ "$COMPONENT" == "ztp" ] || [ "$COMPONENT" == "policy" ]; then continue; fi diff requirements.in src/$COMPONENT/requirements.in | grep '^>' | sed 's/^>\ //' >> requirements.in done printf "\n" diff --git a/manifests/contextservice.yaml b/manifests/contextservice.yaml index 96735bf5f89f682f31131c123ee9884a1becbfdb..df06c86b58849762277f5d99788e36b1933e9a69 100644 --- a/manifests/contextservice.yaml +++ b/manifests/contextservice.yaml @@ -41,6 +41,10 @@ spec: value: "nats" - name: LOG_LEVEL value: "INFO" + - name: ALLOW_EXPLICIT_ADD_DEVICE_TO_TOPOLOGY + value: "FALSE" + - name: ALLOW_EXPLICIT_ADD_LINK_TO_TOPOLOGY + value: "FALSE" envFrom: - secretRef: name: crdb-data diff --git a/manifests/deviceservice.yaml b/manifests/deviceservice.yaml index a99e3e5884745aa1971e5ad7f914901e38f75d47..77e421f297fefc8979b9cd6e3415c58be611a53a 100644 --- a/manifests/deviceservice.yaml +++ b/manifests/deviceservice.yaml @@ -44,7 +44,7 @@ spec: exec: command: ["/bin/grpc_health_probe", "-addr=:2020"] failureThreshold: 30 - periodSeconds: 10 + periodSeconds: 1 readinessProbe: exec: command: ["/bin/grpc_health_probe", "-addr=:2020"] diff --git a/manifests/e2e_orchestratorservice.yaml b/manifests/e2e_orchestratorservice.yaml new file mode 100644 index 0000000000000000000000000000000000000000..899e17fff32e02473d7249eda937282d394efa4e --- /dev/null +++ b/manifests/e2e_orchestratorservice.yaml @@ -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. + +apiVersion: apps/v1 +kind: Deployment +metadata: + name: e2e-orchestratorservice +spec: + selector: + matchLabels: + app: e2e-orchestratorservice + template: + metadata: + labels: + app: e2e-orchestratorservice + spec: + terminationGracePeriodSeconds: 5 + containers: + - name: server + image: labs.etsi.org:5050/tfs/controller/e2e_orchestrator:latest + imagePullPolicy: Always + ports: + - containerPort: 10050 + - containerPort: 9192 + env: + - name: LOG_LEVEL + value: "INFO" + readinessProbe: + exec: + command: ["/bin/grpc_health_probe", "-addr=:10050"] + livenessProbe: + exec: + command: ["/bin/grpc_health_probe", "-addr=:10050"] + resources: + requests: + cpu: 250m + memory: 128Mi + limits: + cpu: 1000m + memory: 1024Mi +--- +apiVersion: v1 +kind: Service +metadata: + name: e2e-orchestratorservice + labels: + app: e2e-orchestratorservice +spec: + type: ClusterIP + selector: + app: e2e-orchestratorservice + ports: + - name: grpc + port: 10050 + targetPort: 10050 + - name: metrics + port: 9192 + targetPort: 9192 +--- +apiVersion: autoscaling/v2 +kind: HorizontalPodAutoscaler +metadata: + name: e2e-orchestratorservice-hpa +spec: + scaleTargetRef: + apiVersion: apps/v1 + kind: Deployment + name: e2e-orchestratorservice + minReplicas: 1 + maxReplicas: 20 + metrics: + - type: Resource + resource: + name: cpu + target: + type: Utilization + averageUtilization: 80 + #behavior: + # scaleDown: + # stabilizationWindowSeconds: 30 diff --git a/manifests/forecasterservice.yaml b/manifests/forecasterservice.yaml new file mode 100644 index 0000000000000000000000000000000000000000..55d4add88f6fc507e9a4271cb40b20c4742c5bc7 --- /dev/null +++ b/manifests/forecasterservice.yaml @@ -0,0 +1,101 @@ +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT 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: forecasterservice +spec: + selector: + matchLabels: + app: forecasterservice + #replicas: 1 + template: + metadata: + labels: + app: forecasterservice + spec: + terminationGracePeriodSeconds: 5 + containers: + - name: server + image: labs.etsi.org:5050/tfs/controller/forecaster:latest + imagePullPolicy: Always + ports: + - containerPort: 10040 + - containerPort: 9192 + env: + - name: LOG_LEVEL + value: "INFO" + - name: FORECAST_TO_HISTORY_RATIO + value: "10" + startupProbe: + exec: + command: ["/bin/grpc_health_probe", "-addr=:10040"] + failureThreshold: 30 + periodSeconds: 1 + readinessProbe: + exec: + command: ["/bin/grpc_health_probe", "-addr=:10040"] + livenessProbe: + exec: + command: ["/bin/grpc_health_probe", "-addr=:10040"] + resources: + requests: + cpu: 250m + memory: 128Mi + limits: + cpu: 1000m + memory: 1024Mi +--- +apiVersion: v1 +kind: Service +metadata: + name: forecasterservice + labels: + app: forecasterservice +spec: + type: ClusterIP + selector: + app: forecasterservice + ports: + - name: grpc + protocol: TCP + port: 10040 + targetPort: 10040 + - name: metrics + protocol: TCP + port: 9192 + targetPort: 9192 +--- +apiVersion: autoscaling/v2 +kind: HorizontalPodAutoscaler +metadata: + name: forecasterservice-hpa +spec: + scaleTargetRef: + apiVersion: apps/v1 + kind: Deployment + name: forecasterservice + minReplicas: 1 + maxReplicas: 20 + metrics: + - type: Resource + resource: + name: cpu + target: + type: Utilization + averageUtilization: 80 + #behavior: + # scaleDown: + # stabilizationWindowSeconds: 30 diff --git a/manifests/computeservice.yaml b/manifests/nbiservice.yaml similarity index 88% rename from manifests/computeservice.yaml rename to manifests/nbiservice.yaml index 3e3b041ab20968ad0010eb06f7900faa7b649dc9..de97ba364d71d2b5a7f55211867a0a5062c521a4 100644 --- a/manifests/computeservice.yaml +++ b/manifests/nbiservice.yaml @@ -15,21 +15,21 @@ apiVersion: apps/v1 kind: Deployment metadata: - name: computeservice + name: nbiservice spec: selector: matchLabels: - app: computeservice + app: nbiservice replicas: 1 template: metadata: labels: - app: computeservice + app: nbiservice spec: terminationGracePeriodSeconds: 5 containers: - name: server - image: labs.etsi.org:5050/tfs/controller/compute:latest + image: labs.etsi.org:5050/tfs/controller/nbi:latest imagePullPolicy: Always ports: - containerPort: 8080 @@ -55,13 +55,13 @@ spec: apiVersion: v1 kind: Service metadata: - name: computeservice + name: nbiservice labels: - app: computeservice + app: nbiservice spec: type: ClusterIP selector: - app: computeservice + app: nbiservice ports: - name: http protocol: TCP diff --git a/manifests/nginx_ingress_http.yaml b/manifests/nginx_ingress_http.yaml index 80caefa935d00d49cb311e586d2a6cc5206b8d02..e8e8a80e4d4325a28202070a463cda959e3ed634 100644 --- a/manifests/nginx_ingress_http.yaml +++ b/manifests/nginx_ingress_http.yaml @@ -40,6 +40,20 @@ spec: pathType: Prefix backend: service: - name: computeservice + name: nbiservice + port: + number: 8080 + - path: /()(debug-api/.*) + pathType: Prefix + backend: + service: + name: nbiservice + port: + number: 8080 + - path: /()(bmw/.*) + pathType: Prefix + backend: + service: + name: nbiservice port: number: 8080 diff --git a/manifests/pathcompservice.yaml b/manifests/pathcompservice.yaml index c85922d961ecc7b99e8fa2476b5e61db7ed52a9d..87d907a728d0b689dcedde730fad7a2e886a6659 100644 --- a/manifests/pathcompservice.yaml +++ b/manifests/pathcompservice.yaml @@ -37,6 +37,8 @@ spec: env: - name: LOG_LEVEL value: "INFO" + - name: ENABLE_FORECASTER + value: "YES" readinessProbe: exec: command: ["/bin/grpc_health_probe", "-addr=:10020"] diff --git a/manifests/servicemonitors.yaml b/manifests/servicemonitors.yaml index e77216af2a723cef8a4c5f468ef564625ea810f1..1f7f3322d77e3e06a0fd902baad4481e77e143ac 100644 --- a/manifests/servicemonitors.yaml +++ b/manifests/servicemonitors.yaml @@ -277,9 +277,9 @@ apiVersion: monitoring.coreos.com/v1 kind: ServiceMonitor metadata: namespace: monitoring # namespace where prometheus is running - name: tfs-automationservice-metric + name: tfs-ztpservice-metric labels: - app: automationservice + app: ztpservice #release: prometheus #release: prom # name of the release # ( VERY IMPORTANT: You need to know the correct release name by viewing @@ -290,7 +290,7 @@ spec: matchLabels: # Target app service #namespace: tfs - app: automationservice # same as above + app: ztpservice # same as above #release: prometheus # same as above endpoints: - port: metrics # named port in target app @@ -306,9 +306,9 @@ apiVersion: monitoring.coreos.com/v1 kind: ServiceMonitor metadata: namespace: monitoring # namespace where prometheus is running - name: tfs-computeservice-metric + name: tfs-nbiservice-metric labels: - app: computeservice + app: nbiservice #release: prometheus #release: prom # name of the release # ( VERY IMPORTANT: You need to know the correct release name by viewing @@ -319,7 +319,7 @@ spec: matchLabels: # Target app service #namespace: tfs - app: computeservice # same as above + app: nbiservice # same as above #release: prometheus # same as above endpoints: - port: metrics # named port in target app @@ -474,4 +474,4 @@ spec: namespaceSelector: any: false matchNames: - - tfs # namespace where the app is running \ No newline at end of file + - tfs # namespace where the app is running diff --git a/manifests/webuiservice.yaml b/manifests/webuiservice.yaml index ba408bb40d4af74e6be53300395735786b9c843d..43caa9f04b56d6477d82c5a5bb22cb292eec8a90 100644 --- a/manifests/webuiservice.yaml +++ b/manifests/webuiservice.yaml @@ -74,26 +74,27 @@ spec: - name: GF_SERVER_SERVE_FROM_SUB_PATH value: "true" readinessProbe: - failureThreshold: 3 + failureThreshold: 60 httpGet: - path: /robots.txt + #path: /robots.txt + path: /login port: 3000 scheme: HTTP - initialDelaySeconds: 10 - periodSeconds: 30 + initialDelaySeconds: 1 + periodSeconds: 1 successThreshold: 1 timeoutSeconds: 2 livenessProbe: - failureThreshold: 3 - initialDelaySeconds: 30 - periodSeconds: 10 + failureThreshold: 60 + initialDelaySeconds: 1 + periodSeconds: 1 successThreshold: 1 tcpSocket: port: 3000 timeoutSeconds: 1 resources: requests: - cpu: 150m + cpu: 250m memory: 512Mi limits: cpu: 500m diff --git a/manifests/automationservice.yaml b/manifests/ztpservice.yaml similarity index 84% rename from manifests/automationservice.yaml rename to manifests/ztpservice.yaml index f4a4def176cd2b9f89d7ee4f10c0af48a08b9733..e2be80cea7b1e779fdc9bb05110ddc0d6b144101 100644 --- a/manifests/automationservice.yaml +++ b/manifests/ztpservice.yaml @@ -19,9 +19,9 @@ metadata: annotations: app.quarkus.io/build-timestamp: 2022-09-19 - 10:48:18 +0000 labels: - app.kubernetes.io/name: automationservice - app: automationservice - name: automationservice + app.kubernetes.io/name: ztpservice + app: ztpservice + name: ztpservice spec: ports: - name: grpc @@ -32,7 +32,7 @@ spec: port: 9192 targetPort: 8080 selector: - app.kubernetes.io/name: automationservice + app.kubernetes.io/name: ztpservice type: ClusterIP --- apiVersion: apps/v1 @@ -41,21 +41,21 @@ metadata: annotations: app.quarkus.io/build-timestamp: 2022-09-19 - 10:48:18 +0000 labels: - app: automationservice - app.kubernetes.io/name: automationservice - name: automationservice + app: ztpservice + app.kubernetes.io/name: ztpservice + name: ztpservice spec: replicas: 1 selector: matchLabels: - app.kubernetes.io/name: automationservice + app.kubernetes.io/name: ztpservice template: metadata: annotations: app.quarkus.io/build-timestamp: 2022-09-19 - 10:48:18 +0000 labels: - app: automationservice - app.kubernetes.io/name: automationservice + app: ztpservice + app.kubernetes.io/name: ztpservice spec: containers: - env: @@ -67,7 +67,7 @@ spec: value: contextservice - name: DEVICE_SERVICE_HOST value: deviceservice - image: labs.etsi.org:5050/tfs/controller/automation:0.2.0 + image: labs.etsi.org:5050/tfs/controller/ztp:0.2.0 imagePullPolicy: Always livenessProbe: failureThreshold: 3 @@ -79,7 +79,7 @@ spec: periodSeconds: 10 successThreshold: 1 timeoutSeconds: 10 - name: automationservice + name: ztpservice ports: - containerPort: 5050 name: grpc @@ -108,12 +108,12 @@ spec: apiVersion: autoscaling/v2 kind: HorizontalPodAutoscaler metadata: - name: automationservice-hpa + name: ztpservice-hpa spec: scaleTargetRef: apiVersion: apps/v1 kind: Deployment - name: automationservice + name: ztpservice minReplicas: 1 maxReplicas: 10 metrics: diff --git a/my_deploy.sh b/my_deploy.sh index 888fc98903eb665729d7e0843cf9e9fc8b60741d..0fcb51f90509732452620126c9062597a17735ed 100755 --- a/my_deploy.sh +++ b/my_deploy.sh @@ -20,13 +20,16 @@ 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 pathcomp service slice compute webui load_generator" +export TFS_COMPONENTS="context device pathcomp service slice nbi webui load_generator" # Uncomment to activate Monitoring #export TFS_COMPONENTS="${TFS_COMPONENTS} monitoring" -# Uncomment to activate Automation and Policy Manager -#export TFS_COMPONENTS="${TFS_COMPONENTS} automation policy" +# Uncomment to activate ZTP +#export TFS_COMPONENTS="${TFS_COMPONENTS} ztp" + +# Uncomment to activate Policy Manager +#export TFS_COMPONENTS="${TFS_COMPONENTS} policy" # Uncomment to activate Optical CyberSecurity #export TFS_COMPONENTS="${TFS_COMPONENTS} dbscanserving opticalattackmitigator opticalattackdetector opticalattackmanager" @@ -37,6 +40,12 @@ export TFS_COMPONENTS="context device pathcomp service slice compute webui load_ # Uncomment to activate TE #export TFS_COMPONENTS="${TFS_COMPONENTS} te" +# Uncomment to activate Forecaster +#export TFS_COMPONENTS="${TFS_COMPONENTS} forecaster" + +# Uncomment to activate E2E Orchestrator +#export TFS_COMPONENTS="${TFS_COMPONENTS} e2e_orchestrator" + # Set the tag you want to use for your images. export TFS_IMAGE_TAG="dev" diff --git a/proto/context.proto b/proto/context.proto index 55a80470d40463742cc3e034ca9e933f4ff6c3f0..7570a4596a0abd254d93c77131f03fa432cf09c7 100644 --- a/proto/context.proto +++ b/proto/context.proto @@ -174,12 +174,17 @@ message Device { DeviceOperationalStatusEnum device_operational_status = 5; repeated DeviceDriverEnum device_drivers = 6; repeated EndPoint device_endpoints = 7; - repeated Component component = 8; // Used for inventory + repeated Component components = 8; // Used for inventory DeviceId controller_id = 9; // Identifier of node controlling the actual device } -message Component { - repeated string comp_string = 1; +message Component { //Defined previously to this section - Tested OK + Uuid component_uuid = 1; + string name = 2; + string type = 3; + + map attributes = 4; // dict[attr.name => json.dumps(attr.value)] + string parent = 5; } message DeviceConfig { @@ -192,10 +197,11 @@ enum DeviceDriverEnum { DEVICEDRIVER_TRANSPORT_API = 2; DEVICEDRIVER_P4 = 3; DEVICEDRIVER_IETF_NETWORK_TOPOLOGY = 4; - DEVICEDRIVER_ONF_TR_352 = 5; + DEVICEDRIVER_ONF_TR_532 = 5; DEVICEDRIVER_XR = 6; DEVICEDRIVER_IETF_L2VPN = 7; DEVICEDRIVER_GNMI_OPENCONFIG = 8; + DEVICEDRIVER_FLEXSCALE = 9; } enum DeviceOperationalStatusEnum { @@ -231,10 +237,16 @@ message LinkId { Uuid link_uuid = 1; } +message LinkAttributes { + float total_capacity_gbps = 1; + float used_capacity_gbps = 2; +} + message Link { LinkId link_id = 1; string name = 2; repeated EndPointId link_endpoint_ids = 3; + LinkAttributes attributes = 4; } message LinkIdList { @@ -274,6 +286,7 @@ enum ServiceTypeEnum { SERVICETYPE_L2NM = 2; SERVICETYPE_TAPI_CONNECTIVITY_SERVICE = 3; SERVICETYPE_TE = 4; + SERVICETYPE_E2E = 5; } enum ServiceStatusEnum { diff --git a/proto/e2eorchestrator.proto b/proto/e2eorchestrator.proto new file mode 100644 index 0000000000000000000000000000000000000000..9eed8523e52faa32d4397bb4635a1cf0c56aa4d5 --- /dev/null +++ b/proto/e2eorchestrator.proto @@ -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. + +// protocol buffers documentation: https://developers.google.com/protocol-buffers/docs/proto3 +syntax = "proto3"; +package orchestrator; + +import "context.proto"; + + +service E2EOrchestratorService { + rpc Compute(E2EOrchestratorRequest) returns (E2EOrchestratorReply) {} +} + +message E2EOrchestratorRequest { + context.Service service = 1; +} + +message E2EOrchestratorReply { + // Service requested completed with possible missing fields, and + // sub-services required for supporting requested service on the + // underlying layers. + repeated context.Service services = 1; + + // Connections supporting the requested service and sub-services + // required for the underlying layers. + repeated context.Connection connections = 2; +} \ No newline at end of file diff --git a/proto/forecaster.proto b/proto/forecaster.proto index 5a4403b01c7f85d6d5b33548d0eaf463e39558cc..45cf6967c40831bec5a073b7fabbe25b6b966268 100644 --- a/proto/forecaster.proto +++ b/proto/forecaster.proto @@ -18,28 +18,27 @@ 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) {} + rpc ForecastLinkCapacity (ForecastLinkCapacityRequest ) returns (ForecastLinkCapacityReply ) {} + rpc ForecastTopologyCapacity(ForecastTopologyCapacityRequest) returns (ForecastTopologyCapacityReply) {} } -message SingleForecast { - context.Timestamp timestamp= 1; - double value = 2; +message ForecastLinkCapacityRequest { + context.LinkId link_id = 1; + float forecast_window_seconds = 2; } -message Forecast { - oneof uuid { - context.TopologyId topologyId= 1; - context.LinkId linkId = 2; - } - repeated SingleForecast forecast = 3; +message ForecastLinkCapacityReply { + context.LinkId link_id = 1; + float total_capacity_gbps = 2; + float current_used_capacity_gbps = 3; + float forecast_used_capacity_gbps = 4; } -enum AvailabilityPredictionEnum { - FORECASTED_AVAILABILITY = 0; - FORECASTED_UNAVAILABILITY = 1; +message ForecastTopologyCapacityRequest { + context.TopologyId topology_id = 1; + float forecast_window_seconds = 2; } -message ForecastPrediction { - AvailabilityPredictionEnum prediction = 1; + +message ForecastTopologyCapacityReply { + repeated ForecastLinkCapacityReply link_capacities = 1; } diff --git a/proto/kpi_sample_types.proto b/proto/kpi_sample_types.proto index 1ade4d69bf5a6c23d993cd37ed731eee10d7374e..5b234a4e35197557f41770984f7c8f6603672411 100644 --- a/proto/kpi_sample_types.proto +++ b/proto/kpi_sample_types.proto @@ -17,18 +17,26 @@ package kpi_sample_types; enum KpiSampleType { 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_LINK_TOTAL_CAPACITY_GBPS = 301; + KPISAMPLETYPE_LINK_USED_CAPACITY_GBPS = 302; + 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/monitoring.proto b/proto/monitoring.proto index 3862973e056d6267d8defc68e77cbf3c8a10ebee..45ba48b0271c6e8890d7125ff44f62d2b6da6b58 100644 --- a/proto/monitoring.proto +++ b/proto/monitoring.proto @@ -49,6 +49,7 @@ message KpiDescriptor { context.ServiceId service_id = 7; context.SliceId slice_id = 8; context.ConnectionId connection_id = 9; + context.LinkId link_id = 10; } message MonitorKpiRequest { diff --git a/proto/compute.proto b/proto/nbi.proto similarity index 97% rename from proto/compute.proto rename to proto/nbi.proto index ecc9a075f19cef180423db350d2153638be94265..201e80744a8c4fc558df0a67e4965f0617071fb9 100644 --- a/proto/compute.proto +++ b/proto/nbi.proto @@ -13,11 +13,11 @@ // limitations under the License. syntax = "proto3"; -package compute; +package nbi; import "context.proto"; -service ComputeService { +service NbiService { rpc CheckCredentials (context.TeraFlowController) returns (context.AuthenticationResult) {} rpc GetConnectivityServiceStatus (context.ServiceId ) returns (context.ServiceStatus ) {} rpc CreateConnectivityService (context.Service ) returns (context.ServiceId ) {} diff --git a/proto/automation.proto b/proto/ztp.proto similarity index 97% rename from proto/automation.proto rename to proto/ztp.proto index e2dbe33223566c4065ecb0086fbd8231a56834d4..5c895900d8c8b379fc6e58a16bbf4dad3918276b 100644 --- a/proto/automation.proto +++ b/proto/ztp.proto @@ -13,11 +13,11 @@ // limitations under the License. syntax = "proto3"; -package automation; +package ztp; import "context.proto"; -service AutomationService { +service ZtpService { rpc ZtpGetDeviceRole(DeviceRoleId) returns (DeviceRole) {} rpc ZtpGetDeviceRolesByDeviceId(context.DeviceId) returns (DeviceRoleList) {} rpc ZtpAdd(DeviceRole) returns (DeviceRoleState) {} diff --git a/run_tests_docker.sh b/run_tests_docker.sh index d27c4e7d8a36f89b3b0b72e9c5725c80b520141f..b7d897d76654cb1b0a357fd0e867f4e9f42a29f5 100755 --- a/run_tests_docker.sh +++ b/run_tests_docker.sh @@ -24,7 +24,7 @@ REGISTRY_IMAGE="" #REGISTRY_IMAGE="http://my-container-registry.local/" # Set the list of components you want to build images for, and deploy. -COMPONENTS="context device automation policy service compute monitoring centralizedattackdetector" +COMPONENTS="context device ztp policy service nbi monitoring centralizedattackdetector" # Set the tag you want to use for your images. IMAGE_TAG="tf-dev" @@ -43,7 +43,7 @@ for COMPONENT in $COMPONENTS; do echo " Building Docker image..." BUILD_LOG="$TMP_LOGS_FOLDER/build_${COMPONENT}.log" - if [ "$COMPONENT" == "automation" ] || [ "$COMPONENT" == "policy" ]; then + if [ "$COMPONENT" == "ztp" ] || [ "$COMPONENT" == "policy" ]; then docker build -t "$IMAGE_NAME" -f ./src/"$COMPONENT"/Dockerfile ./src/"$COMPONENT"/ > "$BUILD_LOG" else docker build -t "$IMAGE_NAME" -f ./src/"$COMPONENT"/Dockerfile ./src/ > "$BUILD_LOG" diff --git a/scripts/old/deploy_in_kubernetes.sh b/scripts/old/deploy_in_kubernetes.sh index c13a236664bde370a323f1663095afd72f72aaec..29237d8c11995389a498ab7f2b7b874af33d7493 100755 --- a/scripts/old/deploy_in_kubernetes.sh +++ b/scripts/old/deploy_in_kubernetes.sh @@ -24,7 +24,7 @@ export REGISTRY_IMAGE=${REGISTRY_IMAGE:-""} #export REGISTRY_IMAGE="http://my-container-registry.local/" # If not already set, set the list of components you want to build images for, and deploy. -export COMPONENTS=${COMPONENTS:-"context device automation policy service compute monitoring dbscanserving opticalattackmitigator opticalcentralizedattackdetector webui"} +export COMPONENTS=${COMPONENTS:-"context device ztp policy service nbi monitoring dbscanserving opticalattackmitigator opticalcentralizedattackdetector webui"} # If not already set, set the tag you want to use for your images. export IMAGE_TAG=${IMAGE_TAG:-"tf-dev"} @@ -78,7 +78,7 @@ for COMPONENT in $COMPONENTS; do echo " Building Docker image..." BUILD_LOG="$TMP_LOGS_FOLDER/build_${COMPONENT}.log" - if [ "$COMPONENT" == "automation" ] || [ "$COMPONENT" == "policy" ]; then + if [ "$COMPONENT" == "ztp" ] || [ "$COMPONENT" == "policy" ]; then docker build -t "$IMAGE_NAME" -f ./src/"$COMPONENT"/Dockerfile ./src/"$COMPONENT"/ > "$BUILD_LOG" else docker build -t "$IMAGE_NAME" -f ./src/"$COMPONENT"/Dockerfile . > "$BUILD_LOG" diff --git a/scripts/report_coverage_compute.sh b/scripts/report_coverage_nbi.sh similarity index 90% rename from scripts/report_coverage_compute.sh rename to scripts/report_coverage_nbi.sh index 4d986b5c36e6fdc2b1360881d2120c881f468535..587e21e4ec46365865291c458ff77728130bbb01 100755 --- a/scripts/report_coverage_compute.sh +++ b/scripts/report_coverage_nbi.sh @@ -14,4 +14,4 @@ # limitations under the License. -./report_coverage_all.sh | grep --color -E -i "^compute/.*$|$" +./report_coverage_all.sh | grep --color -E -i "^nbi/.*$|$" diff --git a/scripts/run_tests_locally-forecaster.sh b/scripts/run_tests_locally-forecaster.sh new file mode 100755 index 0000000000000000000000000000000000000000..e5b9e3e7d249461d6421dd4050890d80757644ab --- /dev/null +++ b/scripts/run_tests_locally-forecaster.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 +# 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 \ + forecaster/tests/test_unitary.py diff --git a/scripts/run_tests_locally-nbi-all.sh b/scripts/run_tests_locally-nbi-all.sh new file mode 100755 index 0000000000000000000000000000000000000000..48961b0fe20ab4ac3658a6f35ce89ec659e52dc0 --- /dev/null +++ b/scripts/run_tests_locally-nbi-all.sh @@ -0,0 +1,35 @@ +#!/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 +# 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 \ + nbi/tests/test_etsi_bwm.py + +coverage run --rcfile=$RCFILE --append -m pytest --log-level=INFO --verbose \ + nbi/tests/test_ietf_l2vpn.py + +coverage run --rcfile=$RCFILE --append -m pytest --log-level=INFO --verbose \ + nbi/tests/test_ietf_l3vpn.py + +coverage run --rcfile=$RCFILE --append -m pytest --log-level=INFO --verbose \ + nbi/tests/test_ietf_network.py diff --git a/scripts/run_tests_locally-compute.sh b/scripts/run_tests_locally-nbi-etsi-bwm.sh similarity index 87% rename from scripts/run_tests_locally-compute.sh rename to scripts/run_tests_locally-nbi-etsi-bwm.sh index 3fed523e541e1cc9dabb0a55579f38a3338b30b9..dc5f79ffa96c853671b5a4cc41d2c69fbc89f350 100755 --- a/scripts/run_tests_locally-compute.sh +++ b/scripts/run_tests_locally-nbi-etsi-bwm.sh @@ -20,5 +20,6 @@ cd $PROJECTDIR/src RCFILE=$PROJECTDIR/coverage/.coveragerc # Run unitary tests and analyze coverage of code at same time +# 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 \ - compute/tests/test_unitary.py + nbi/tests/test_etsi_bwm.py diff --git a/scripts/run_tests_locally-nbi-ietf-l2vpn.sh b/scripts/run_tests_locally-nbi-ietf-l2vpn.sh new file mode 100755 index 0000000000000000000000000000000000000000..595606d1fbeeae105748d75e326427e47277b955 --- /dev/null +++ b/scripts/run_tests_locally-nbi-ietf-l2vpn.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 +# 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 \ + nbi/tests/test_ietf_l2vpn.py diff --git a/scripts/run_tests_locally-nbi-ietf-l3vpn.sh b/scripts/run_tests_locally-nbi-ietf-l3vpn.sh new file mode 100755 index 0000000000000000000000000000000000000000..0bd133e16caac438c8da1a5795fce89e99230c9a --- /dev/null +++ b/scripts/run_tests_locally-nbi-ietf-l3vpn.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 +# 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 \ + nbi/tests/test_ietf_l3vpn.py diff --git a/scripts/run_tests_locally-nbi-ietf-network.sh b/scripts/run_tests_locally-nbi-ietf-network.sh new file mode 100755 index 0000000000000000000000000000000000000000..a9fa030878e68789ffbfbe57eed76b933f897b5b --- /dev/null +++ b/scripts/run_tests_locally-nbi-ietf-network.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 +# 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 \ + nbi/tests/test_ietf_network.py diff --git a/scripts/run_tests_locally.sh b/scripts/run_tests_locally.sh index b609fbb391266702e6fc4be8c7a0aa7990596235..31ef4e737d5149ff773a65dafee72ebb52fdc09d 100755 --- a/scripts/run_tests_locally.sh +++ b/scripts/run_tests_locally.sh @@ -84,7 +84,7 @@ coverage run --rcfile=$RCFILE --append -m pytest --log-level=INFO --verbose \ service/tests/test_unitary.py coverage run --rcfile=$RCFILE --append -m pytest --log-level=INFO --verbose \ - compute/tests/test_unitary.py + nbi/tests/test_unitary.py coverage run --rcfile=$RCFILE --append -m pytest --log-level=INFO --verbose \ webui/tests/test_unitary.py diff --git a/scripts/show_logs_automation.sh b/scripts/show_logs_automation.sh index 46c0dbba9752b207b11136535403f0c009d0a377..5ee561f532a7e424326f38501906f78327c05559 100755 --- a/scripts/show_logs_automation.sh +++ b/scripts/show_logs_automation.sh @@ -24,4 +24,4 @@ export TFS_K8S_NAMESPACE=${TFS_K8S_NAMESPACE:-"tfs"} # Automated steps start here ######################################################################################################################## -kubectl --namespace $TFS_K8S_NAMESPACE logs deployment/automationservice +kubectl --namespace $TFS_K8S_NAMESPACE logs deployment/ztpservice diff --git a/scripts/show_logs_e2eorchestrator.sh b/scripts/show_logs_e2eorchestrator.sh new file mode 100644 index 0000000000000000000000000000000000000000..84951ed8dc24c145715c971b76cd22b79a920f98 --- /dev/null +++ b/scripts/show_logs_e2eorchestrator.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/e2eorchestratorservice -c server diff --git a/scripts/show_logs_forecaster.sh b/scripts/show_logs_forecaster.sh new file mode 100755 index 0000000000000000000000000000000000000000..6bb518fe5120db3620e5b25b3bb70b0483131ea3 --- /dev/null +++ b/scripts/show_logs_forecaster.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/forecasterservice -c server diff --git a/scripts/show_logs_compute.sh b/scripts/show_logs_nbi.sh similarity index 94% rename from scripts/show_logs_compute.sh rename to scripts/show_logs_nbi.sh index f0c24b63aa7b7e5c6678659c34dee34e8ce5b49e..076544f8f8c35f385e7387173e263e92dd91dd93 100755 --- a/scripts/show_logs_compute.sh +++ b/scripts/show_logs_nbi.sh @@ -24,4 +24,4 @@ export TFS_K8S_NAMESPACE=${TFS_K8S_NAMESPACE:-"tfs"} # Automated steps start here ######################################################################################################################## -kubectl --namespace $TFS_K8S_NAMESPACE logs deployment/computeservice -c server +kubectl --namespace $TFS_K8S_NAMESPACE logs deployment/nbiservice -c server diff --git a/scripts/update_license_headers.py b/scripts/update_license_headers.py index f721425f89b84fe76783cd2f26b923c0c9005e5a..45baf39e07ea1ea3dde800c2cefd1641620bb4aa 100644 --- a/scripts/update_license_headers.py +++ b/scripts/update_license_headers.py @@ -55,8 +55,8 @@ def skip_file(file_path : str) -> bool: if '/.mvn/' in file_path: return True if '/hackfest/kafka/kafka_2.13-2.8.0' in file_path: return True if '/src/device/service/drivers/openconfig/templates/' in file_path: return True - if '/automation/target/generated-sources/grpc/' in file_path: return True - if '/automation/target/kubernetes/' in file_path: return True + if '/ztp/target/generated-sources/grpc/' in file_path: return True + if '/ztp/target/kubernetes/' in file_path: return True if '/policy/target/generated-sources/grpc/' in file_path: return True if '/policy/target/kubernetes/' in file_path: return True if '/src/dlt/gateway/' in file_path: return True diff --git a/src/automation/src/main/java/eu/teraflow/automation/AutomationGateway.java b/src/automation/src/main/java/eu/teraflow/automation/AutomationGateway.java deleted file mode 100644 index 53803f51657d96475db8828f123cdefbb443f0ab..0000000000000000000000000000000000000000 --- a/src/automation/src/main/java/eu/teraflow/automation/AutomationGateway.java +++ /dev/null @@ -1,21 +0,0 @@ -/* -* Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -package eu.teraflow.automation; - -import automation.AutomationService; - -public interface AutomationGateway extends AutomationService {} diff --git a/src/automation/src/main/proto/automation.proto b/src/automation/src/main/proto/automation.proto deleted file mode 120000 index afef7a8e47ec5688ec46498c2197bc345e6c5e92..0000000000000000000000000000000000000000 --- a/src/automation/src/main/proto/automation.proto +++ /dev/null @@ -1 +0,0 @@ -../../../../../proto/automation.proto \ No newline at end of file diff --git a/src/automation/src/main/resources/teraflow-automation-banner.txt b/src/automation/src/main/resources/teraflow-automation-banner.txt deleted file mode 100644 index 3792524170f5b74de9add7340ab32940d7f65a64..0000000000000000000000000000000000000000 --- a/src/automation/src/main/resources/teraflow-automation-banner.txt +++ /dev/null @@ -1,9 +0,0 @@ - - _______ ______ _ _ _ _ - |__ __| | ____| | /\ | | | | (_) - | | ___ _ __ __ _| |__ | | _____ __ / \ _ _| |_ ___ _ __ ___ __ _| |_ _ ___ _ __ - | |/ _ \ '__/ _` | __| | |/ _ \ \ /\ / / / /\ \| | | | __/ _ \| '_ ` _ \ / _` | __| |/ _ \| '_ \ - | | __/ | | (_| | | | | (_) \ V V / / ____ \ |_| | || (_) | | | | | | (_| | |_| | (_) | | | | - |_|\___|_| \__,_|_| |_|\___/ \_/\_/ /_/ \_\__,_|\__\___/|_| |_| |_|\__,_|\__|_|\___/|_| |_| - - diff --git a/src/automation/target/generated-sources/grpc/automation/AutomationService.java b/src/automation/target/generated-sources/grpc/automation/AutomationService.java deleted file mode 100644 index 8ef5784815a7b8bb6d51b05f89f6ca3a4b23f2e5..0000000000000000000000000000000000000000 --- a/src/automation/target/generated-sources/grpc/automation/AutomationService.java +++ /dev/null @@ -1,26 +0,0 @@ -package automation; - -import io.quarkus.grpc.runtime.MutinyService; - -@javax.annotation.Generated( -value = "by Mutiny Grpc generator", -comments = "Source: automation.proto") -public interface AutomationService extends MutinyService { - - - io.smallrye.mutiny.Uni ztpGetDeviceRole(automation.Automation.DeviceRoleId request); - - io.smallrye.mutiny.Uni ztpGetDeviceRolesByDeviceId(context.ContextOuterClass.DeviceId request); - - io.smallrye.mutiny.Uni ztpAdd(automation.Automation.DeviceRole request); - - io.smallrye.mutiny.Uni ztpUpdate(automation.Automation.DeviceRoleConfig request); - - io.smallrye.mutiny.Uni ztpDelete(automation.Automation.DeviceRole request); - - io.smallrye.mutiny.Uni ztpDeleteAll(context.ContextOuterClass.Empty request); - - - - -} \ No newline at end of file diff --git a/src/automation/target/generated-sources/grpc/automation/AutomationServiceClient.java b/src/automation/target/generated-sources/grpc/automation/AutomationServiceClient.java deleted file mode 100644 index 13d13c431b63baebd22ed7fd566b6b25395977e3..0000000000000000000000000000000000000000 --- a/src/automation/target/generated-sources/grpc/automation/AutomationServiceClient.java +++ /dev/null @@ -1,48 +0,0 @@ -package automation; - -import java.util.function.BiFunction; - -import io.quarkus.grpc.runtime.MutinyClient; - -@javax.annotation.Generated( -value = "by Mutiny Grpc generator", -comments = "Source: automation.proto") -public class AutomationServiceClient implements AutomationService, MutinyClient { - - private final MutinyAutomationServiceGrpc.MutinyAutomationServiceStub stub; - - public AutomationServiceClient(String name, io.grpc.Channel channel, BiFunction stubConfigurator) { - this.stub = stubConfigurator.apply(name,MutinyAutomationServiceGrpc.newMutinyStub(channel)); - } - - @Override - public MutinyAutomationServiceGrpc.MutinyAutomationServiceStub getStub() { - return stub; - } - - @Override - public io.smallrye.mutiny.Uni ztpGetDeviceRole(automation.Automation.DeviceRoleId request) { - return stub.ztpGetDeviceRole(request); - } - @Override - public io.smallrye.mutiny.Uni ztpGetDeviceRolesByDeviceId(context.ContextOuterClass.DeviceId request) { - return stub.ztpGetDeviceRolesByDeviceId(request); - } - @Override - public io.smallrye.mutiny.Uni ztpAdd(automation.Automation.DeviceRole request) { - return stub.ztpAdd(request); - } - @Override - public io.smallrye.mutiny.Uni ztpUpdate(automation.Automation.DeviceRoleConfig request) { - return stub.ztpUpdate(request); - } - @Override - public io.smallrye.mutiny.Uni ztpDelete(automation.Automation.DeviceRole request) { - return stub.ztpDelete(request); - } - @Override - public io.smallrye.mutiny.Uni ztpDeleteAll(context.ContextOuterClass.Empty request) { - return stub.ztpDeleteAll(request); - } - -} \ No newline at end of file diff --git a/src/automation/target/generated-sources/grpc/automation/AutomationServiceGrpc.java b/src/automation/target/generated-sources/grpc/automation/AutomationServiceGrpc.java deleted file mode 100644 index 841994ea713bb9d1c0223689386d6cae35c6d014..0000000000000000000000000000000000000000 --- a/src/automation/target/generated-sources/grpc/automation/AutomationServiceGrpc.java +++ /dev/null @@ -1,645 +0,0 @@ -package automation; - -import static io.grpc.MethodDescriptor.generateFullMethodName; - -/** - */ -@javax.annotation.Generated( - value = "by gRPC proto compiler (version 1.38.1)", - comments = "Source: automation.proto") -public final class AutomationServiceGrpc { - - private AutomationServiceGrpc() {} - - public static final String SERVICE_NAME = "automation.AutomationService"; - - // Static method descriptors that strictly reflect the proto. - private static volatile io.grpc.MethodDescriptor getZtpGetDeviceRoleMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "ZtpGetDeviceRole", - requestType = automation.Automation.DeviceRoleId.class, - responseType = automation.Automation.DeviceRole.class, - methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor getZtpGetDeviceRoleMethod() { - io.grpc.MethodDescriptor getZtpGetDeviceRoleMethod; - if ((getZtpGetDeviceRoleMethod = AutomationServiceGrpc.getZtpGetDeviceRoleMethod) == null) { - synchronized (AutomationServiceGrpc.class) { - if ((getZtpGetDeviceRoleMethod = AutomationServiceGrpc.getZtpGetDeviceRoleMethod) == null) { - AutomationServiceGrpc.getZtpGetDeviceRoleMethod = getZtpGetDeviceRoleMethod = - io.grpc.MethodDescriptor.newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ZtpGetDeviceRole")) - .setSampledToLocalTracing(true) - .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - automation.Automation.DeviceRoleId.getDefaultInstance())) - .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - automation.Automation.DeviceRole.getDefaultInstance())) - .setSchemaDescriptor(new AutomationServiceMethodDescriptorSupplier("ZtpGetDeviceRole")) - .build(); - } - } - } - return getZtpGetDeviceRoleMethod; - } - - private static volatile io.grpc.MethodDescriptor getZtpGetDeviceRolesByDeviceIdMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "ZtpGetDeviceRolesByDeviceId", - requestType = context.ContextOuterClass.DeviceId.class, - responseType = automation.Automation.DeviceRoleList.class, - methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor getZtpGetDeviceRolesByDeviceIdMethod() { - io.grpc.MethodDescriptor getZtpGetDeviceRolesByDeviceIdMethod; - if ((getZtpGetDeviceRolesByDeviceIdMethod = AutomationServiceGrpc.getZtpGetDeviceRolesByDeviceIdMethod) == null) { - synchronized (AutomationServiceGrpc.class) { - if ((getZtpGetDeviceRolesByDeviceIdMethod = AutomationServiceGrpc.getZtpGetDeviceRolesByDeviceIdMethod) == null) { - AutomationServiceGrpc.getZtpGetDeviceRolesByDeviceIdMethod = getZtpGetDeviceRolesByDeviceIdMethod = - io.grpc.MethodDescriptor.newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ZtpGetDeviceRolesByDeviceId")) - .setSampledToLocalTracing(true) - .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - context.ContextOuterClass.DeviceId.getDefaultInstance())) - .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - automation.Automation.DeviceRoleList.getDefaultInstance())) - .setSchemaDescriptor(new AutomationServiceMethodDescriptorSupplier("ZtpGetDeviceRolesByDeviceId")) - .build(); - } - } - } - return getZtpGetDeviceRolesByDeviceIdMethod; - } - - private static volatile io.grpc.MethodDescriptor getZtpAddMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "ZtpAdd", - requestType = automation.Automation.DeviceRole.class, - responseType = automation.Automation.DeviceRoleState.class, - methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor getZtpAddMethod() { - io.grpc.MethodDescriptor getZtpAddMethod; - if ((getZtpAddMethod = AutomationServiceGrpc.getZtpAddMethod) == null) { - synchronized (AutomationServiceGrpc.class) { - if ((getZtpAddMethod = AutomationServiceGrpc.getZtpAddMethod) == null) { - AutomationServiceGrpc.getZtpAddMethod = getZtpAddMethod = - io.grpc.MethodDescriptor.newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ZtpAdd")) - .setSampledToLocalTracing(true) - .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - automation.Automation.DeviceRole.getDefaultInstance())) - .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - automation.Automation.DeviceRoleState.getDefaultInstance())) - .setSchemaDescriptor(new AutomationServiceMethodDescriptorSupplier("ZtpAdd")) - .build(); - } - } - } - return getZtpAddMethod; - } - - private static volatile io.grpc.MethodDescriptor getZtpUpdateMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "ZtpUpdate", - requestType = automation.Automation.DeviceRoleConfig.class, - responseType = automation.Automation.DeviceRoleState.class, - methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor getZtpUpdateMethod() { - io.grpc.MethodDescriptor getZtpUpdateMethod; - if ((getZtpUpdateMethod = AutomationServiceGrpc.getZtpUpdateMethod) == null) { - synchronized (AutomationServiceGrpc.class) { - if ((getZtpUpdateMethod = AutomationServiceGrpc.getZtpUpdateMethod) == null) { - AutomationServiceGrpc.getZtpUpdateMethod = getZtpUpdateMethod = - io.grpc.MethodDescriptor.newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ZtpUpdate")) - .setSampledToLocalTracing(true) - .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - automation.Automation.DeviceRoleConfig.getDefaultInstance())) - .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - automation.Automation.DeviceRoleState.getDefaultInstance())) - .setSchemaDescriptor(new AutomationServiceMethodDescriptorSupplier("ZtpUpdate")) - .build(); - } - } - } - return getZtpUpdateMethod; - } - - private static volatile io.grpc.MethodDescriptor getZtpDeleteMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "ZtpDelete", - requestType = automation.Automation.DeviceRole.class, - responseType = automation.Automation.DeviceRoleState.class, - methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor getZtpDeleteMethod() { - io.grpc.MethodDescriptor getZtpDeleteMethod; - if ((getZtpDeleteMethod = AutomationServiceGrpc.getZtpDeleteMethod) == null) { - synchronized (AutomationServiceGrpc.class) { - if ((getZtpDeleteMethod = AutomationServiceGrpc.getZtpDeleteMethod) == null) { - AutomationServiceGrpc.getZtpDeleteMethod = getZtpDeleteMethod = - io.grpc.MethodDescriptor.newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ZtpDelete")) - .setSampledToLocalTracing(true) - .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - automation.Automation.DeviceRole.getDefaultInstance())) - .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - automation.Automation.DeviceRoleState.getDefaultInstance())) - .setSchemaDescriptor(new AutomationServiceMethodDescriptorSupplier("ZtpDelete")) - .build(); - } - } - } - return getZtpDeleteMethod; - } - - private static volatile io.grpc.MethodDescriptor getZtpDeleteAllMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "ZtpDeleteAll", - requestType = context.ContextOuterClass.Empty.class, - responseType = automation.Automation.DeviceDeletionResult.class, - methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor getZtpDeleteAllMethod() { - io.grpc.MethodDescriptor getZtpDeleteAllMethod; - if ((getZtpDeleteAllMethod = AutomationServiceGrpc.getZtpDeleteAllMethod) == null) { - synchronized (AutomationServiceGrpc.class) { - if ((getZtpDeleteAllMethod = AutomationServiceGrpc.getZtpDeleteAllMethod) == null) { - AutomationServiceGrpc.getZtpDeleteAllMethod = getZtpDeleteAllMethod = - io.grpc.MethodDescriptor.newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ZtpDeleteAll")) - .setSampledToLocalTracing(true) - .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - context.ContextOuterClass.Empty.getDefaultInstance())) - .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - automation.Automation.DeviceDeletionResult.getDefaultInstance())) - .setSchemaDescriptor(new AutomationServiceMethodDescriptorSupplier("ZtpDeleteAll")) - .build(); - } - } - } - return getZtpDeleteAllMethod; - } - - /** - * Creates a new async stub that supports all call types for the service - */ - public static AutomationServiceStub newStub(io.grpc.Channel channel) { - io.grpc.stub.AbstractStub.StubFactory factory = - new io.grpc.stub.AbstractStub.StubFactory() { - @java.lang.Override - public AutomationServiceStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - return new AutomationServiceStub(channel, callOptions); - } - }; - return AutomationServiceStub.newStub(factory, channel); - } - - /** - * Creates a new blocking-style stub that supports unary and streaming output calls on the service - */ - public static AutomationServiceBlockingStub newBlockingStub( - io.grpc.Channel channel) { - io.grpc.stub.AbstractStub.StubFactory factory = - new io.grpc.stub.AbstractStub.StubFactory() { - @java.lang.Override - public AutomationServiceBlockingStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - return new AutomationServiceBlockingStub(channel, callOptions); - } - }; - return AutomationServiceBlockingStub.newStub(factory, channel); - } - - /** - * Creates a new ListenableFuture-style stub that supports unary calls on the service - */ - public static AutomationServiceFutureStub newFutureStub( - io.grpc.Channel channel) { - io.grpc.stub.AbstractStub.StubFactory factory = - new io.grpc.stub.AbstractStub.StubFactory() { - @java.lang.Override - public AutomationServiceFutureStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - return new AutomationServiceFutureStub(channel, callOptions); - } - }; - return AutomationServiceFutureStub.newStub(factory, channel); - } - - /** - */ - public static abstract class AutomationServiceImplBase implements io.grpc.BindableService { - - /** - */ - public void ztpGetDeviceRole(automation.Automation.DeviceRoleId request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getZtpGetDeviceRoleMethod(), responseObserver); - } - - /** - */ - public void ztpGetDeviceRolesByDeviceId(context.ContextOuterClass.DeviceId request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getZtpGetDeviceRolesByDeviceIdMethod(), responseObserver); - } - - /** - */ - public void ztpAdd(automation.Automation.DeviceRole request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getZtpAddMethod(), responseObserver); - } - - /** - */ - public void ztpUpdate(automation.Automation.DeviceRoleConfig request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getZtpUpdateMethod(), responseObserver); - } - - /** - */ - public void ztpDelete(automation.Automation.DeviceRole request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getZtpDeleteMethod(), responseObserver); - } - - /** - */ - public void ztpDeleteAll(context.ContextOuterClass.Empty request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getZtpDeleteAllMethod(), responseObserver); - } - - @java.lang.Override public final io.grpc.ServerServiceDefinition bindService() { - return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) - .addMethod( - getZtpGetDeviceRoleMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - automation.Automation.DeviceRoleId, - automation.Automation.DeviceRole>( - this, METHODID_ZTP_GET_DEVICE_ROLE))) - .addMethod( - getZtpGetDeviceRolesByDeviceIdMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - context.ContextOuterClass.DeviceId, - automation.Automation.DeviceRoleList>( - this, METHODID_ZTP_GET_DEVICE_ROLES_BY_DEVICE_ID))) - .addMethod( - getZtpAddMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - automation.Automation.DeviceRole, - automation.Automation.DeviceRoleState>( - this, METHODID_ZTP_ADD))) - .addMethod( - getZtpUpdateMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - automation.Automation.DeviceRoleConfig, - automation.Automation.DeviceRoleState>( - this, METHODID_ZTP_UPDATE))) - .addMethod( - getZtpDeleteMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - automation.Automation.DeviceRole, - automation.Automation.DeviceRoleState>( - this, METHODID_ZTP_DELETE))) - .addMethod( - getZtpDeleteAllMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - context.ContextOuterClass.Empty, - automation.Automation.DeviceDeletionResult>( - this, METHODID_ZTP_DELETE_ALL))) - .build(); - } - } - - /** - */ - public static final class AutomationServiceStub extends io.grpc.stub.AbstractAsyncStub { - private AutomationServiceStub( - io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - super(channel, callOptions); - } - - @java.lang.Override - protected AutomationServiceStub build( - io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - return new AutomationServiceStub(channel, callOptions); - } - - /** - */ - public void ztpGetDeviceRole(automation.Automation.DeviceRoleId request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getZtpGetDeviceRoleMethod(), getCallOptions()), request, responseObserver); - } - - /** - */ - public void ztpGetDeviceRolesByDeviceId(context.ContextOuterClass.DeviceId request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getZtpGetDeviceRolesByDeviceIdMethod(), getCallOptions()), request, responseObserver); - } - - /** - */ - public void ztpAdd(automation.Automation.DeviceRole request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getZtpAddMethod(), getCallOptions()), request, responseObserver); - } - - /** - */ - public void ztpUpdate(automation.Automation.DeviceRoleConfig request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getZtpUpdateMethod(), getCallOptions()), request, responseObserver); - } - - /** - */ - public void ztpDelete(automation.Automation.DeviceRole request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getZtpDeleteMethod(), getCallOptions()), request, responseObserver); - } - - /** - */ - public void ztpDeleteAll(context.ContextOuterClass.Empty request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getZtpDeleteAllMethod(), getCallOptions()), request, responseObserver); - } - } - - /** - */ - public static final class AutomationServiceBlockingStub extends io.grpc.stub.AbstractBlockingStub { - private AutomationServiceBlockingStub( - io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - super(channel, callOptions); - } - - @java.lang.Override - protected AutomationServiceBlockingStub build( - io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - return new AutomationServiceBlockingStub(channel, callOptions); - } - - /** - */ - public automation.Automation.DeviceRole ztpGetDeviceRole(automation.Automation.DeviceRoleId request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getZtpGetDeviceRoleMethod(), getCallOptions(), request); - } - - /** - */ - public automation.Automation.DeviceRoleList ztpGetDeviceRolesByDeviceId(context.ContextOuterClass.DeviceId request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getZtpGetDeviceRolesByDeviceIdMethod(), getCallOptions(), request); - } - - /** - */ - public automation.Automation.DeviceRoleState ztpAdd(automation.Automation.DeviceRole request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getZtpAddMethod(), getCallOptions(), request); - } - - /** - */ - public automation.Automation.DeviceRoleState ztpUpdate(automation.Automation.DeviceRoleConfig request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getZtpUpdateMethod(), getCallOptions(), request); - } - - /** - */ - public automation.Automation.DeviceRoleState ztpDelete(automation.Automation.DeviceRole request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getZtpDeleteMethod(), getCallOptions(), request); - } - - /** - */ - public automation.Automation.DeviceDeletionResult ztpDeleteAll(context.ContextOuterClass.Empty request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getZtpDeleteAllMethod(), getCallOptions(), request); - } - } - - /** - */ - public static final class AutomationServiceFutureStub extends io.grpc.stub.AbstractFutureStub { - private AutomationServiceFutureStub( - io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - super(channel, callOptions); - } - - @java.lang.Override - protected AutomationServiceFutureStub build( - io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - return new AutomationServiceFutureStub(channel, callOptions); - } - - /** - */ - public com.google.common.util.concurrent.ListenableFuture ztpGetDeviceRole( - automation.Automation.DeviceRoleId request) { - return io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getZtpGetDeviceRoleMethod(), getCallOptions()), request); - } - - /** - */ - public com.google.common.util.concurrent.ListenableFuture ztpGetDeviceRolesByDeviceId( - context.ContextOuterClass.DeviceId request) { - return io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getZtpGetDeviceRolesByDeviceIdMethod(), getCallOptions()), request); - } - - /** - */ - public com.google.common.util.concurrent.ListenableFuture ztpAdd( - automation.Automation.DeviceRole request) { - return io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getZtpAddMethod(), getCallOptions()), request); - } - - /** - */ - public com.google.common.util.concurrent.ListenableFuture ztpUpdate( - automation.Automation.DeviceRoleConfig request) { - return io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getZtpUpdateMethod(), getCallOptions()), request); - } - - /** - */ - public com.google.common.util.concurrent.ListenableFuture ztpDelete( - automation.Automation.DeviceRole request) { - return io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getZtpDeleteMethod(), getCallOptions()), request); - } - - /** - */ - public com.google.common.util.concurrent.ListenableFuture ztpDeleteAll( - context.ContextOuterClass.Empty request) { - return io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getZtpDeleteAllMethod(), getCallOptions()), request); - } - } - - private static final int METHODID_ZTP_GET_DEVICE_ROLE = 0; - private static final int METHODID_ZTP_GET_DEVICE_ROLES_BY_DEVICE_ID = 1; - private static final int METHODID_ZTP_ADD = 2; - private static final int METHODID_ZTP_UPDATE = 3; - private static final int METHODID_ZTP_DELETE = 4; - private static final int METHODID_ZTP_DELETE_ALL = 5; - - private static final class MethodHandlers implements - io.grpc.stub.ServerCalls.UnaryMethod, - io.grpc.stub.ServerCalls.ServerStreamingMethod, - io.grpc.stub.ServerCalls.ClientStreamingMethod, - io.grpc.stub.ServerCalls.BidiStreamingMethod { - private final AutomationServiceImplBase serviceImpl; - private final int methodId; - - MethodHandlers(AutomationServiceImplBase serviceImpl, int methodId) { - this.serviceImpl = serviceImpl; - this.methodId = methodId; - } - - @java.lang.Override - @java.lang.SuppressWarnings("unchecked") - public void invoke(Req request, io.grpc.stub.StreamObserver responseObserver) { - switch (methodId) { - case METHODID_ZTP_GET_DEVICE_ROLE: - serviceImpl.ztpGetDeviceRole((automation.Automation.DeviceRoleId) request, - (io.grpc.stub.StreamObserver) responseObserver); - break; - case METHODID_ZTP_GET_DEVICE_ROLES_BY_DEVICE_ID: - serviceImpl.ztpGetDeviceRolesByDeviceId((context.ContextOuterClass.DeviceId) request, - (io.grpc.stub.StreamObserver) responseObserver); - break; - case METHODID_ZTP_ADD: - serviceImpl.ztpAdd((automation.Automation.DeviceRole) request, - (io.grpc.stub.StreamObserver) responseObserver); - break; - case METHODID_ZTP_UPDATE: - serviceImpl.ztpUpdate((automation.Automation.DeviceRoleConfig) request, - (io.grpc.stub.StreamObserver) responseObserver); - break; - case METHODID_ZTP_DELETE: - serviceImpl.ztpDelete((automation.Automation.DeviceRole) request, - (io.grpc.stub.StreamObserver) responseObserver); - break; - case METHODID_ZTP_DELETE_ALL: - serviceImpl.ztpDeleteAll((context.ContextOuterClass.Empty) request, - (io.grpc.stub.StreamObserver) responseObserver); - break; - default: - throw new AssertionError(); - } - } - - @java.lang.Override - @java.lang.SuppressWarnings("unchecked") - public io.grpc.stub.StreamObserver invoke( - io.grpc.stub.StreamObserver responseObserver) { - switch (methodId) { - default: - throw new AssertionError(); - } - } - } - - private static abstract class AutomationServiceBaseDescriptorSupplier - implements io.grpc.protobuf.ProtoFileDescriptorSupplier, io.grpc.protobuf.ProtoServiceDescriptorSupplier { - AutomationServiceBaseDescriptorSupplier() {} - - @java.lang.Override - public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { - return automation.Automation.getDescriptor(); - } - - @java.lang.Override - public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { - return getFileDescriptor().findServiceByName("AutomationService"); - } - } - - private static final class AutomationServiceFileDescriptorSupplier - extends AutomationServiceBaseDescriptorSupplier { - AutomationServiceFileDescriptorSupplier() {} - } - - private static final class AutomationServiceMethodDescriptorSupplier - extends AutomationServiceBaseDescriptorSupplier - implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { - private final String methodName; - - AutomationServiceMethodDescriptorSupplier(String methodName) { - this.methodName = methodName; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.MethodDescriptor getMethodDescriptor() { - return getServiceDescriptor().findMethodByName(methodName); - } - } - - private static volatile io.grpc.ServiceDescriptor serviceDescriptor; - - public static io.grpc.ServiceDescriptor getServiceDescriptor() { - io.grpc.ServiceDescriptor result = serviceDescriptor; - if (result == null) { - synchronized (AutomationServiceGrpc.class) { - result = serviceDescriptor; - if (result == null) { - serviceDescriptor = result = io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) - .setSchemaDescriptor(new AutomationServiceFileDescriptorSupplier()) - .addMethod(getZtpGetDeviceRoleMethod()) - .addMethod(getZtpGetDeviceRolesByDeviceIdMethod()) - .addMethod(getZtpAddMethod()) - .addMethod(getZtpUpdateMethod()) - .addMethod(getZtpDeleteMethod()) - .addMethod(getZtpDeleteAllMethod()) - .build(); - } - } - } - return result; - } -} diff --git a/src/common/Constants.py b/src/common/Constants.py index 423f2558b71b189b9e771e5af94968d28f8777c0..30aa09b4caa34a54dd54126195b3f322c07c932e 100644 --- a/src/common/Constants.py +++ b/src/common/Constants.py @@ -40,11 +40,11 @@ class ServiceNameEnum(Enum): DEVICE = 'device' SERVICE = 'service' SLICE = 'slice' - AUTOMATION = 'automation' + ZTP = 'ztp' POLICY = 'policy' MONITORING = 'monitoring' DLT = 'dlt' - COMPUTE = 'compute' + NBI = 'nbi' CYBERSECURITY = 'cybersecurity' INTERDOMAIN = 'interdomain' PATHCOMP = 'pathcomp' @@ -57,6 +57,8 @@ class ServiceNameEnum(Enum): OPTICALATTACKMITIGATOR = 'opticalattackmitigator' CACHING = 'caching' TE = 'te' + FORECASTER = 'forecaster' + E2EORCHESTRATOR = 'e2eorchestrator' # Used for test and debugging only DLT_GATEWAY = 'dltgateway' @@ -68,11 +70,11 @@ DEFAULT_SERVICE_GRPC_PORTS = { ServiceNameEnum.DEVICE .value : 2020, ServiceNameEnum.SERVICE .value : 3030, ServiceNameEnum.SLICE .value : 4040, - ServiceNameEnum.AUTOMATION .value : 5050, + ServiceNameEnum.ZTP .value : 5050, ServiceNameEnum.POLICY .value : 6060, ServiceNameEnum.MONITORING .value : 7070, ServiceNameEnum.DLT .value : 8080, - ServiceNameEnum.COMPUTE .value : 9090, + ServiceNameEnum.NBI .value : 9090, ServiceNameEnum.L3_CAD .value : 10001, ServiceNameEnum.L3_AM .value : 10002, ServiceNameEnum.DBSCANSERVING .value : 10008, @@ -82,6 +84,8 @@ DEFAULT_SERVICE_GRPC_PORTS = { ServiceNameEnum.INTERDOMAIN .value : 10010, ServiceNameEnum.PATHCOMP .value : 10020, ServiceNameEnum.TE .value : 10030, + ServiceNameEnum.FORECASTER .value : 10040, + ServiceNameEnum.E2EORCHESTRATOR .value : 10050, # Used for test and debugging only ServiceNameEnum.DLT_GATEWAY .value : 50051, @@ -91,12 +95,12 @@ DEFAULT_SERVICE_GRPC_PORTS = { # Default HTTP/REST-API service ports DEFAULT_SERVICE_HTTP_PORTS = { ServiceNameEnum.CONTEXT .value : 8080, - ServiceNameEnum.COMPUTE .value : 8080, + ServiceNameEnum.NBI .value : 8080, ServiceNameEnum.WEBUI .value : 8004, } # Default HTTP/REST-API service base URLs DEFAULT_SERVICE_HTTP_BASEURLS = { - ServiceNameEnum.COMPUTE .value : '/restconf', + ServiceNameEnum.NBI .value : None, ServiceNameEnum.WEBUI .value : None, } diff --git a/src/common/DeviceTypes.py b/src/common/DeviceTypes.py index bb8948585f163aeb84ee758b8581bc6509d29799..f88f931d4c465349a37a92b5891fd0acd8fe6a48 100644 --- a/src/common/DeviceTypes.py +++ b/src/common/DeviceTypes.py @@ -20,6 +20,7 @@ class DeviceTypeEnum(Enum): NETWORK = 'network' # Emulated device types + EMULATED_CLIENT = 'emu-client' EMULATED_DATACENTER = 'emu-datacenter' EMULATED_MICROWAVE_RADIO_SYSTEM = 'emu-microwave-radio-system' EMULATED_OPEN_LINE_SYSTEM = 'emu-open-line-system' @@ -33,6 +34,7 @@ class DeviceTypeEnum(Enum): EMULATED_XR_CONSTELLATION = 'emu-xr-constellation' # Real device types + CLIENT = 'client' DATACENTER = 'datacenter' MICROWAVE_RADIO_SYSTEM = 'microwave-radio-system' OPEN_LINE_SYSTEM = 'open-line-system' diff --git a/src/common/message_broker/backend/nats/NatsBackendThread.py b/src/common/message_broker/backend/nats/NatsBackendThread.py index 0bedd2b242f7eeaa1585d0eb41c5a0bd9efe07e5..3ac32b0cb8f7b4be2d693753e39919b82ab3948f 100644 --- a/src/common/message_broker/backend/nats/NatsBackendThread.py +++ b/src/common/message_broker/backend/nats/NatsBackendThread.py @@ -49,29 +49,41 @@ class NatsBackendThread(threading.Thread): self._publish_queue.put_nowait(Message(topic_name, message_content)) async def _run_subscriber( - self, topic_name : str, timeout : float, out_queue : queue.Queue[Message], unsubscribe : threading.Event + self, topic_name : str, timeout : float, out_queue : queue.Queue[Message], unsubscribe : threading.Event, + ready_event : threading.Event ) -> None: - LOGGER.info('[_run_subscriber] NATS URI: {:s}'.format(str(self._nats_uri))) - client = await nats.connect(servers=[self._nats_uri]) - LOGGER.info('[_run_subscriber] Connected!') - subscription = await client.subscribe(topic_name) - LOGGER.info('[_run_subscriber] Subscribed!') - while not self._terminate.is_set() and not unsubscribe.is_set(): - try: - message = await subscription.next_msg(timeout) - except nats.errors.TimeoutError: - continue - except asyncio.CancelledError: - break - out_queue.put(Message(message.subject, message.data.decode('UTF-8'))) - await subscription.unsubscribe() - await client.drain() + try: + LOGGER.info('[_run_subscriber] NATS URI: {:s}'.format(str(self._nats_uri))) + client = await nats.connect(servers=[self._nats_uri]) + server_version = client.connected_server_version + LOGGER.info('[_run_subscriber] Connected! NATS Server version: {:s}'.format(str(repr(server_version)))) + subscription = await client.subscribe(topic_name) + LOGGER.info('[_run_subscriber] Subscribed!') + ready_event.set() + while not self._terminate.is_set() and not unsubscribe.is_set(): + try: + message = await subscription.next_msg(timeout) + except nats.errors.TimeoutError: + continue + except asyncio.CancelledError: + break + out_queue.put(Message(message.subject, message.data.decode('UTF-8'))) + await subscription.unsubscribe() + await client.drain() + except Exception: # pylint: disable=broad-exception-caught + LOGGER.exception('[_run_subscriber] Unhandled Exception') def subscribe( self, topic_name : str, timeout : float, out_queue : queue.Queue[Message], unsubscribe : threading.Event ) -> None: - task = self._event_loop.create_task(self._run_subscriber(topic_name, timeout, out_queue, unsubscribe)) + ready_event = threading.Event() + task = self._event_loop.create_task( + self._run_subscriber(topic_name, timeout, out_queue, unsubscribe, ready_event) + ) self._tasks.append(task) + LOGGER.info('[subscribe] Waiting for subscriber to be ready...') + is_ready = ready_event.wait(timeout=120) + LOGGER.info('[subscribe] Subscriber is Ready? {:s}'.format(str(is_ready))) def run(self) -> None: asyncio.set_event_loop(self._event_loop) diff --git a/src/common/tests/InMemoryObjectDatabase.py b/src/common/tests/InMemoryObjectDatabase.py new file mode 100644 index 0000000000000000000000000000000000000000..f5f98872a72efef1d4e01966efbac98a38e6a8e3 --- /dev/null +++ b/src/common/tests/InMemoryObjectDatabase.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 typing import Any, Dict, List, Set + +LOGGER = logging.getLogger(__name__) + +class InMemoryObjectDatabase: + def __init__(self) -> None: + self._database : Dict[str, Dict[str, Any]] = dict() + + def _get_container(self, container_name : str) -> Dict[str, Any]: + return self._database.setdefault(container_name, {}) + + def get_entries(self, container_name : str) -> List[Any]: + container = self._get_container(container_name) + return [container[entry_uuid] for entry_uuid in sorted(container.keys())] + + def has_entry(self, container_name : str, entry_uuid : str) -> Any: + LOGGER.debug('[has_entry] BEFORE database={:s}'.format(str(self._database))) + container = self._get_container(container_name) + return entry_uuid in container + + def get_entry(self, container_name : str, entry_uuid : str, context : grpc.ServicerContext) -> Any: + LOGGER.debug('[get_entry] BEFORE database={:s}'.format(str(self._database))) + container = self._get_container(container_name) + if entry_uuid not in container: + MSG = '{:s}({:s}) not found; available({:s})' + msg = str(MSG.format(container_name, entry_uuid, str(container.keys()))) + context.abort(grpc.StatusCode.NOT_FOUND, msg) + return container[entry_uuid] + + def set_entry(self, container_name : str, entry_uuid : str, entry : Any) -> Any: + container = self._get_container(container_name) + LOGGER.debug('[set_entry] BEFORE database={:s}'.format(str(self._database))) + container[entry_uuid] = entry + LOGGER.debug('[set_entry] AFTER database={:s}'.format(str(self._database))) + return entry + + def del_entry(self, container_name : str, entry_uuid : str, context : grpc.ServicerContext) -> None: + container = self._get_container(container_name) + LOGGER.debug('[del_entry] BEFORE database={:s}'.format(str(self._database))) + if entry_uuid not in container: + context.abort(grpc.StatusCode.NOT_FOUND, str('{:s}({:s}) not found'.format(container_name, entry_uuid))) + del container[entry_uuid] + LOGGER.debug('[del_entry] AFTER database={:s}'.format(str(self._database))) + + def select_entries(self, container_name : str, entry_uuids : Set[str]) -> List[Any]: + if len(entry_uuids) == 0: return self.get_entries(container_name) + container = self._get_container(container_name) + return [ + container[entry_uuid] + for entry_uuid in sorted(container.keys()) + if entry_uuid in entry_uuids + ] diff --git a/src/common/tests/InMemoryTimeSeriesDatabase.py b/src/common/tests/InMemoryTimeSeriesDatabase.py new file mode 100644 index 0000000000000000000000000000000000000000..1c4c86da88bfb3ca99ecd92e5baab7244bea414c --- /dev/null +++ b/src/common/tests/InMemoryTimeSeriesDatabase.py @@ -0,0 +1,41 @@ +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT 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, pandas +from typing import List, Optional + +LOGGER = logging.getLogger(__name__) + +class InMemoryTimeSeriesDatabase: + def __init__(self) -> None: + self._data = pandas.DataFrame(columns=['timestamp', 'kpi_uuid', 'value']) + + def filter( + self, kpi_uuids : List[str] = [], start_timestamp : Optional[float] = None, + end_timestamp : Optional[float] = None + ) -> pandas.DataFrame: + data = self._data + + if len(kpi_uuids) > 0: + data = data[data.kpi_uuid.isin(kpi_uuids)] + + if start_timestamp is not None: + start_datetime = pandas.to_datetime(start_timestamp, unit='s') + data = data[data.timestamp >= start_datetime] + + if end_timestamp is not None: + end_datetime = pandas.to_datetime(end_timestamp, unit='s') + data = data[data.timestamp <= end_datetime] + + return data diff --git a/src/common/tests/MockMessageBroker.py b/src/common/tests/MockMessageBroker.py index 2eeea74cfc85fd360180c77a2d5b7387d2ef092f..27613a64d3f63a55276bb1c1f82fdb6c20a8e534 100644 --- a/src/common/tests/MockMessageBroker.py +++ b/src/common/tests/MockMessageBroker.py @@ -28,10 +28,6 @@ TOPIC_SERVICE = 'service' TOPIC_SLICE = 'slice' TOPIC_TOPOLOGY = 'topology' -TOPICS = { - TOPIC_CONNECTION, TOPIC_CONTEXT, TOPIC_DEVICE, TOPIC_LINK, TOPIC_POLICY, TOPIC_SERVICE, TOPIC_SLICE, TOPIC_TOPOLOGY -} - CONSUME_TIMEOUT = 0.5 # seconds class Message(NamedTuple): diff --git a/src/common/tests/MockServicerImpl_Context.py b/src/common/tests/MockServicerImpl_Context.py index 667c9ed658cfbe648e345d691523375e1c5f8b79..98a216850a757e0c21c44d2e295cb4b93c538e05 100644 --- a/src/common/tests/MockServicerImpl_Context.py +++ b/src/common/tests/MockServicerImpl_Context.py @@ -13,7 +13,7 @@ # limitations under the License. import grpc, json, logging -from typing import Any, Dict, Iterator, List, Set +from typing import Any, Dict, Iterator, Set, Tuple from common.Constants import DEFAULT_CONTEXT_NAME, DEFAULT_TOPOLOGY_NAME from common.proto.context_pb2 import ( Connection, ConnectionEvent, ConnectionId, ConnectionIdList, ConnectionList, @@ -25,226 +25,266 @@ from common.proto.context_pb2 import ( Slice, SliceEvent, SliceFilter, SliceId, SliceIdList, SliceList, Topology, TopologyDetails, TopologyEvent, TopologyId, TopologyIdList, TopologyList) from common.proto.context_pb2_grpc import ContextServiceServicer -from common.tests.MockMessageBroker import ( +from common.tools.grpc.Tools import grpc_message_to_json, grpc_message_to_json_string +from common.tools.object_factory.Device import json_device_id +from common.tools.object_factory.Link import json_link_id +from .InMemoryObjectDatabase import InMemoryObjectDatabase +from .MockMessageBroker import ( TOPIC_CONNECTION, TOPIC_CONTEXT, TOPIC_DEVICE, TOPIC_LINK, TOPIC_SERVICE, TOPIC_SLICE, TOPIC_TOPOLOGY, MockMessageBroker, notify_event) -from common.tools.grpc.Tools import grpc_message_to_json, grpc_message_to_json_string LOGGER = logging.getLogger(__name__) -def get_container(database : Dict[str, Dict[str, Any]], container_name : str) -> Dict[str, Any]: - return database.setdefault(container_name, {}) - -def get_entries(database : Dict[str, Dict[str, Any]], container_name : str) -> List[Any]: - container = get_container(database, container_name) - return [container[entry_uuid] for entry_uuid in sorted(container.keys())] - -def has_entry(database : Dict[str, Dict[str, Any]], container_name : str, entry_uuid : str) -> Any: - LOGGER.debug('[has_entry] BEFORE database={:s}'.format(str(database))) - container = get_container(database, container_name) - return entry_uuid in container - -def get_entry( - context : grpc.ServicerContext, database : Dict[str, Dict[str, Any]], container_name : str, entry_uuid : str -) -> Any: - LOGGER.debug('[get_entry] BEFORE database={:s}'.format(str(database))) - container = get_container(database, container_name) - if entry_uuid not in container: - context.abort(grpc.StatusCode.NOT_FOUND, str('{:s}({:s}) not found'.format(container_name, entry_uuid))) - return container[entry_uuid] - -def set_entry(database : Dict[str, Dict[str, Any]], container_name : str, entry_uuid : str, entry : Any) -> Any: - container = get_container(database, container_name) - LOGGER.debug('[set_entry] BEFORE database={:s}'.format(str(database))) - container[entry_uuid] = entry - LOGGER.debug('[set_entry] AFTER database={:s}'.format(str(database))) - return entry - -def del_entry( - context : grpc.ServicerContext, database : Dict[str, Dict[str, Any]], container_name : str, entry_uuid : str -) -> Any: - container = get_container(database, container_name) - if entry_uuid not in container: - context.abort(grpc.StatusCode.NOT_FOUND, str('{:s}({:s}) not found'.format(container_name, entry_uuid))) - del container[entry_uuid] - return Empty() - -def select_entries(database : Dict[str, Dict[str, Any]], container_name : str, entry_uuids : Set[str]) -> List[Any]: - if len(entry_uuids) == 0: return get_entries(database, container_name) - container = get_container(database, container_name) - return [ - container[entry_uuid] - for entry_uuid in sorted(container.keys()) - if entry_uuid in entry_uuids - ] - class MockServicerImpl_Context(ContextServiceServicer): def __init__(self): - LOGGER.info('[__init__] Creating Servicer...') - self.database : Dict[str, Dict[str, Any]] = {} + LOGGER.debug('[__init__] Creating Servicer...') + self.obj_db = InMemoryObjectDatabase() self.msg_broker = MockMessageBroker() - LOGGER.info('[__init__] Servicer Created') + LOGGER.debug('[__init__] Servicer Created') # ----- Common ----------------------------------------------------------------------------------------------------- - def _set(self, request, container_name, entry_uuid, entry_id_field_name, topic_name): - exists = has_entry(self.database, container_name, entry_uuid) - entry = set_entry(self.database, container_name, entry_uuid, request) + def _set(self, request, container_name, entry_uuid, entry_id_field_name, topic_name) -> Tuple[Any, Any]: + exists = self.obj_db.has_entry(container_name, entry_uuid) + entry = self.obj_db.set_entry(container_name, entry_uuid, request) event_type = EventTypeEnum.EVENTTYPE_UPDATE if exists else EventTypeEnum.EVENTTYPE_CREATE entry_id = getattr(entry, entry_id_field_name) dict_entry_id = grpc_message_to_json(entry_id) notify_event(self.msg_broker, topic_name, event_type, {entry_id_field_name: dict_entry_id}) - return entry_id + return entry_id, entry - def _del(self, request, container_name, entry_uuid, entry_id_field_name, topic_name, grpc_context): - empty = del_entry(grpc_context, self.database, container_name, entry_uuid) + def _del(self, request, container_name, entry_uuid, entry_id_field_name, topic_name, context) -> Empty: + self.obj_db.del_entry(container_name, entry_uuid, context) event_type = EventTypeEnum.EVENTTYPE_REMOVE dict_entry_id = grpc_message_to_json(request) notify_event(self.msg_broker, topic_name, event_type, {entry_id_field_name: dict_entry_id}) - return empty + return Empty() # ----- Context ---------------------------------------------------------------------------------------------------- def ListContextIds(self, request: Empty, context : grpc.ServicerContext) -> ContextIdList: - LOGGER.info('[ListContextIds] request={:s}'.format(grpc_message_to_json_string(request))) - reply = ContextIdList(context_ids=[context.context_id for context in get_entries(self.database, 'context')]) - LOGGER.info('[ListContextIds] reply={:s}'.format(grpc_message_to_json_string(reply))) + LOGGER.debug('[ListContextIds] request={:s}'.format(grpc_message_to_json_string(request))) + reply = ContextIdList(context_ids=[context.context_id for context in self.obj_db.get_entries('context')]) + LOGGER.debug('[ListContextIds] reply={:s}'.format(grpc_message_to_json_string(reply))) return reply def ListContexts(self, request: Empty, context : grpc.ServicerContext) -> ContextList: - LOGGER.info('[ListContexts] request={:s}'.format(grpc_message_to_json_string(request))) - reply = ContextList(contexts=get_entries(self.database, 'context')) - LOGGER.info('[ListContexts] reply={:s}'.format(grpc_message_to_json_string(reply))) + LOGGER.debug('[ListContexts] request={:s}'.format(grpc_message_to_json_string(request))) + reply = ContextList(contexts=self.obj_db.get_entries('context')) + LOGGER.debug('[ListContexts] reply={:s}'.format(grpc_message_to_json_string(reply))) return reply def GetContext(self, request: ContextId, context : grpc.ServicerContext) -> Context: - LOGGER.info('[GetContext] request={:s}'.format(grpc_message_to_json_string(request))) - reply = get_entry(context, self.database, 'context', request.context_uuid.uuid) - LOGGER.info('[GetContext] reply={:s}'.format(grpc_message_to_json_string(reply))) + LOGGER.debug('[GetContext] request={:s}'.format(grpc_message_to_json_string(request))) + reply = self.obj_db.get_entry('context', request.context_uuid.uuid, context) + LOGGER.debug('[GetContext] reply={:s}'.format(grpc_message_to_json_string(reply))) return reply def SetContext(self, request: Context, context : grpc.ServicerContext) -> ContextId: - LOGGER.info('[SetContext] request={:s}'.format(grpc_message_to_json_string(request))) - reply = self._set(request, 'context', request.context_id.context_uuid.uuid, 'context_id', TOPIC_CONTEXT) - LOGGER.info('[SetContext] reply={:s}'.format(grpc_message_to_json_string(reply))) + LOGGER.debug('[SetContext] request={:s}'.format(grpc_message_to_json_string(request))) + reply,_ = self._set(request, 'context', request.context_id.context_uuid.uuid, 'context_id', TOPIC_CONTEXT) + LOGGER.debug('[SetContext] reply={:s}'.format(grpc_message_to_json_string(reply))) return reply def RemoveContext(self, request: ContextId, context : grpc.ServicerContext) -> Empty: - LOGGER.info('[RemoveContext] request={:s}'.format(grpc_message_to_json_string(request))) + LOGGER.debug('[RemoveContext] request={:s}'.format(grpc_message_to_json_string(request))) reply = self._del(request, 'context', request.context_uuid.uuid, 'context_id', TOPIC_CONTEXT, context) - LOGGER.info('[RemoveContext] reply={:s}'.format(grpc_message_to_json_string(reply))) + LOGGER.debug('[RemoveContext] reply={:s}'.format(grpc_message_to_json_string(reply))) return reply def GetContextEvents(self, request: Empty, context : grpc.ServicerContext) -> Iterator[ContextEvent]: - LOGGER.info('[GetContextEvents] request={:s}'.format(grpc_message_to_json_string(request))) + LOGGER.debug('[GetContextEvents] request={:s}'.format(grpc_message_to_json_string(request))) for message in self.msg_broker.consume({TOPIC_CONTEXT}): yield ContextEvent(**json.loads(message.content)) # ----- Topology --------------------------------------------------------------------------------------------------- def ListTopologyIds(self, request: ContextId, context : grpc.ServicerContext) -> TopologyIdList: - LOGGER.info('[ListTopologyIds] request={:s}'.format(grpc_message_to_json_string(request))) - topologies = get_entries(self.database, 'topology[{:s}]'.format(str(request.context_uuid.uuid))) + LOGGER.debug('[ListTopologyIds] request={:s}'.format(grpc_message_to_json_string(request))) + topologies = self.obj_db.get_entries('topology[{:s}]'.format(str(request.context_uuid.uuid))) reply = TopologyIdList(topology_ids=[topology.topology_id for topology in topologies]) - LOGGER.info('[ListTopologyIds] reply={:s}'.format(grpc_message_to_json_string(reply))) + LOGGER.debug('[ListTopologyIds] reply={:s}'.format(grpc_message_to_json_string(reply))) return reply def ListTopologies(self, request: ContextId, context : grpc.ServicerContext) -> TopologyList: - LOGGER.info('[ListTopologies] request={:s}'.format(grpc_message_to_json_string(request))) - topologies = get_entries(self.database, 'topology[{:s}]'.format(str(request.context_uuid.uuid))) + LOGGER.debug('[ListTopologies] request={:s}'.format(grpc_message_to_json_string(request))) + topologies = self.obj_db.get_entries('topology[{:s}]'.format(str(request.context_uuid.uuid))) reply = TopologyList(topologies=[topology for topology in topologies]) - LOGGER.info('[ListTopologies] reply={:s}'.format(grpc_message_to_json_string(reply))) + LOGGER.debug('[ListTopologies] reply={:s}'.format(grpc_message_to_json_string(reply))) return reply def GetTopology(self, request: TopologyId, context : grpc.ServicerContext) -> Topology: - LOGGER.info('[GetTopology] request={:s}'.format(grpc_message_to_json_string(request))) + LOGGER.debug('[GetTopology] request={:s}'.format(grpc_message_to_json_string(request))) container_name = 'topology[{:s}]'.format(str(request.context_id.context_uuid.uuid)) - reply = get_entry(context, self.database, container_name, request.topology_uuid.uuid) - LOGGER.info('[GetTopology] reply={:s}'.format(grpc_message_to_json_string(reply))) + reply = self.obj_db.get_entry(container_name, request.topology_uuid.uuid, context) + LOGGER.debug('[GetTopology] reply={:s}'.format(grpc_message_to_json_string(reply))) return reply def GetTopologyDetails(self, request : TopologyId, context : grpc.ServicerContext) -> TopologyDetails: - LOGGER.info('[GetTopologyDetails] request={:s}'.format(grpc_message_to_json_string(request))) + LOGGER.debug('[GetTopologyDetails] request={:s}'.format(grpc_message_to_json_string(request))) context_uuid = request.context_id.context_uuid.uuid container_name = 'topology[{:s}]'.format(str(context_uuid)) topology_uuid = request.topology_uuid.uuid - _reply = get_entry(context, self.database, container_name, topology_uuid) + _reply = self.obj_db.get_entry(container_name, topology_uuid, context) reply = TopologyDetails() - reply.topology_id.CopyFrom(_reply.topology_id) + reply.topology_id.CopyFrom(_reply.topology_id) # pylint: disable=no-member reply.name = _reply.name if context_uuid == DEFAULT_CONTEXT_NAME and topology_uuid == DEFAULT_TOPOLOGY_NAME: - for device in get_entries(self.database, 'device'): reply.devices.append(device) - for link in get_entries(self.database, 'link'): reply.links.append(link) + for device in self.obj_db.get_entries('device'): reply.devices.append(device) # pylint: disable=no-member + for link in self.obj_db.get_entries('link' ): reply.links .append(link ) # pylint: disable=no-member else: # TODO: to be improved; Mock does not associate devices/links to topologies automatically for device_id in _reply.device_ids: - device = get_entry(context, self.database, 'device', device_id.device_uuid.uuid) - reply.devices.append(device) + device = self.obj_db.get_entry('device', device_id.device_uuid.uuid, context) + reply.devices.append(device) # pylint: disable=no-member for link_id in _reply.link_ids: - link = get_entry(context, self.database, 'link', link_id.link_uuid.uuid) - reply.links.append(link) - LOGGER.info('[GetTopologyDetails] reply={:s}'.format(grpc_message_to_json_string(reply))) + link = self.obj_db.get_entry('link', link_id.link_uuid.uuid, context) + reply.links.append(link) # pylint: disable=no-member + LOGGER.debug('[GetTopologyDetails] reply={:s}'.format(grpc_message_to_json_string(reply))) return reply def SetTopology(self, request: Topology, context : grpc.ServicerContext) -> TopologyId: - LOGGER.info('[SetTopology] request={:s}'.format(grpc_message_to_json_string(request))) - container_name = 'topology[{:s}]'.format(str(request.topology_id.context_id.context_uuid.uuid)) + LOGGER.debug('[SetTopology] request={:s}'.format(grpc_message_to_json_string(request))) + context_uuid = str(request.topology_id.context_id.context_uuid.uuid) + container_name = 'topology[{:s}]'.format(context_uuid) topology_uuid = request.topology_id.topology_uuid.uuid - reply = self._set(request, container_name, topology_uuid, 'topology_id', TOPIC_TOPOLOGY) - LOGGER.info('[SetTopology] reply={:s}'.format(grpc_message_to_json_string(reply))) + + if self.obj_db.has_entry(container_name, topology_uuid): + # merge device_ids and link_ids from database and request, and update request + db_topology = self.obj_db.get_entry(container_name, topology_uuid, context) + + device_uuids = set() + for device_id in request.device_ids: device_uuids.add(device_id.device_uuid.uuid) + for device_id in db_topology.device_ids: device_uuids.add(device_id.device_uuid.uuid) + + link_uuids = set() + for link_id in request.link_ids: link_uuids.add(link_id.link_uuid.uuid) + for link_id in db_topology.link_ids: link_uuids.add(link_id.link_uuid.uuid) + + rw_request = Topology() + rw_request.CopyFrom(request) + + del rw_request.device_ids[:] + for device_uuid in sorted(device_uuids): + rw_request.device_ids.append(DeviceId(**json_device_id(device_uuid))) + + del rw_request.link_ids[:] + for link_uuid in sorted(link_uuids): + rw_request.link_ids.append(LinkId(**json_link_id(link_uuid))) + + request = rw_request + + reply,_ = self._set(request, container_name, topology_uuid, 'topology_id', TOPIC_TOPOLOGY) + + context_ = self.obj_db.get_entry('context', context_uuid, context) + for _topology_id in context_.topology_ids: + if _topology_id.topology_uuid.uuid == topology_uuid: break + else: + # topology not found, add it + context_.topology_ids.add().topology_uuid.uuid = topology_uuid + + LOGGER.debug('[SetTopology] reply={:s}'.format(grpc_message_to_json_string(reply))) return reply def RemoveTopology(self, request: TopologyId, context : grpc.ServicerContext) -> Empty: - LOGGER.info('[RemoveTopology] request={:s}'.format(grpc_message_to_json_string(request))) - container_name = 'topology[{:s}]'.format(str(request.context_id.context_uuid.uuid)) + LOGGER.debug('[RemoveTopology] request={:s}'.format(grpc_message_to_json_string(request))) + context_uuid = str(request.context_id.context_uuid.uuid) + container_name = 'topology[{:s}]'.format(context_uuid) topology_uuid = request.topology_uuid.uuid reply = self._del(request, container_name, topology_uuid, 'topology_id', TOPIC_TOPOLOGY, context) - LOGGER.info('[RemoveTopology] reply={:s}'.format(grpc_message_to_json_string(reply))) + + context_ = self.obj_db.get_entry('context', context_uuid, context) + for _topology_id in context_.topology_ids: + if _topology_id.topology_uuid.uuid == topology_uuid: + context_.topology_ids.remove(_topology_id) + break + + LOGGER.debug('[RemoveTopology] reply={:s}'.format(grpc_message_to_json_string(reply))) return reply def GetTopologyEvents(self, request: Empty, context : grpc.ServicerContext) -> Iterator[TopologyEvent]: - LOGGER.info('[GetTopologyEvents] request={:s}'.format(grpc_message_to_json_string(request))) + LOGGER.debug('[GetTopologyEvents] request={:s}'.format(grpc_message_to_json_string(request))) for message in self.msg_broker.consume({TOPIC_TOPOLOGY}): yield TopologyEvent(**json.loads(message.content)) # ----- Device ----------------------------------------------------------------------------------------------------- def ListDeviceIds(self, request: Empty, context : grpc.ServicerContext) -> DeviceIdList: - LOGGER.info('[ListDeviceIds] request={:s}'.format(grpc_message_to_json_string(request))) - reply = DeviceIdList(device_ids=[device.device_id for device in get_entries(self.database, 'device')]) - LOGGER.info('[ListDeviceIds] reply={:s}'.format(grpc_message_to_json_string(reply))) + LOGGER.debug('[ListDeviceIds] request={:s}'.format(grpc_message_to_json_string(request))) + reply = DeviceIdList(device_ids=[device.device_id for device in self.obj_db.get_entries('device')]) + LOGGER.debug('[ListDeviceIds] reply={:s}'.format(grpc_message_to_json_string(reply))) return reply def ListDevices(self, request: Empty, context : grpc.ServicerContext) -> DeviceList: - LOGGER.info('[ListDevices] request={:s}'.format(grpc_message_to_json_string(request))) - reply = DeviceList(devices=get_entries(self.database, 'device')) - LOGGER.info('[ListDevices] reply={:s}'.format(grpc_message_to_json_string(reply))) + LOGGER.debug('[ListDevices] request={:s}'.format(grpc_message_to_json_string(request))) + reply = DeviceList(devices=self.obj_db.get_entries('device')) + LOGGER.debug('[ListDevices] reply={:s}'.format(grpc_message_to_json_string(reply))) return reply def GetDevice(self, request: DeviceId, context : grpc.ServicerContext) -> Device: - LOGGER.info('[GetDevice] request={:s}'.format(grpc_message_to_json_string(request))) - reply = get_entry(context, self.database, 'device', request.device_uuid.uuid) - LOGGER.info('[GetDevice] reply={:s}'.format(grpc_message_to_json_string(reply))) + LOGGER.debug('[GetDevice] request={:s}'.format(grpc_message_to_json_string(request))) + reply = self.obj_db.get_entry('device', request.device_uuid.uuid, context) + LOGGER.debug('[GetDevice] reply={:s}'.format(grpc_message_to_json_string(reply))) return reply def SetDevice(self, request: Context, context : grpc.ServicerContext) -> DeviceId: - LOGGER.info('[SetDevice] request={:s}'.format(grpc_message_to_json_string(request))) - reply = self._set(request, 'device', request.device_id.device_uuid.uuid, 'device_id', TOPIC_DEVICE) - LOGGER.info('[SetDevice] reply={:s}'.format(grpc_message_to_json_string(reply))) + LOGGER.debug('[SetDevice] request={:s}'.format(grpc_message_to_json_string(request))) + device_uuid = request.device_id.device_uuid.uuid + reply, device = self._set(request, 'device', device_uuid, 'device_id', TOPIC_DEVICE) + + context_topology_uuids : Set[Tuple[str, str]] = set() + context_topology_uuids.add((DEFAULT_CONTEXT_NAME, DEFAULT_TOPOLOGY_NAME)) + for endpoint in device.device_endpoints: + endpoint_context_uuid = endpoint.endpoint_id.topology_id.context_id.context_uuid.uuid + if len(endpoint_context_uuid) == 0: endpoint_context_uuid = DEFAULT_CONTEXT_NAME + endpoint_topology_uuid = endpoint.endpoint_id.topology_id.topology_uuid.uuid + if len(endpoint_topology_uuid) == 0: endpoint_topology_uuid = DEFAULT_TOPOLOGY_NAME + context_topology_uuids.add((endpoint_context_uuid, endpoint_topology_uuid)) + + for context_uuid,topology_uuid in context_topology_uuids: + container_name = 'topology[{:s}]'.format(str(context_uuid)) + topology = self.obj_db.get_entry(container_name, topology_uuid, context) + for _device_id in topology.device_ids: + if _device_id.device_uuid.uuid == device_uuid: break + else: + # device not found, add it + topology.device_ids.add().device_uuid.uuid = device_uuid + + LOGGER.debug('[SetDevice] reply={:s}'.format(grpc_message_to_json_string(reply))) return reply def RemoveDevice(self, request: DeviceId, context : grpc.ServicerContext) -> Empty: - LOGGER.info('[RemoveDevice] request={:s}'.format(grpc_message_to_json_string(request))) - reply = self._del(request, 'device', request.device_uuid.uuid, 'device_id', TOPIC_DEVICE, context) - LOGGER.info('[RemoveDevice] reply={:s}'.format(grpc_message_to_json_string(reply))) + LOGGER.debug('[RemoveDevice] request={:s}'.format(grpc_message_to_json_string(request))) + device_uuid = request.device_uuid.uuid + device = self.obj_db.get_entry('device', device_uuid, context) + reply = self._del(request, 'device', device_uuid, 'device_id', TOPIC_DEVICE, context) + + context_topology_uuids : Set[Tuple[str, str]] = set() + context_topology_uuids.add((DEFAULT_CONTEXT_NAME, DEFAULT_TOPOLOGY_NAME)) + for endpoint in device.device_endpoints: + endpoint_context_uuid = endpoint.endpoint_id.topology_id.context_id.context_uuid.uuid + if len(endpoint_context_uuid) == 0: endpoint_context_uuid = DEFAULT_CONTEXT_NAME + endpoint_topology_uuid = endpoint.endpoint_id.topology_id.topology_uuid.uuid + if len(endpoint_topology_uuid) == 0: endpoint_topology_uuid = DEFAULT_TOPOLOGY_NAME + context_topology_uuids.add((endpoint_context_uuid, endpoint_topology_uuid)) + + for context_uuid,topology_uuid in context_topology_uuids: + container_name = 'topology[{:s}]'.format(str(context_uuid)) + topology = self.obj_db.get_entry(container_name, topology_uuid, context) + for device_id in topology.device_ids: + if device_id.device_uuid.uuid == device_uuid: + topology.device_ids.remove(device_id) + break + + LOGGER.debug('[RemoveDevice] reply={:s}'.format(grpc_message_to_json_string(reply))) return reply def GetDeviceEvents(self, request: Empty, context : grpc.ServicerContext) -> Iterator[DeviceEvent]: - LOGGER.info('[GetDeviceEvents] request={:s}'.format(grpc_message_to_json_string(request))) + LOGGER.debug('[GetDeviceEvents] request={:s}'.format(grpc_message_to_json_string(request))) for message in self.msg_broker.consume({TOPIC_DEVICE}): yield DeviceEvent(**json.loads(message.content)) def SelectDevice(self, request : DeviceFilter, context : grpc.ServicerContext) -> DeviceList: - LOGGER.info('[SelectDevice] request={:s}'.format(grpc_message_to_json_string(request))) + LOGGER.debug('[SelectDevice] request={:s}'.format(grpc_message_to_json_string(request))) container_entry_uuids : Dict[str, Set[str]] = {} container_name = 'device' for device_id in request.device_ids.device_ids: @@ -258,101 +298,158 @@ class MockServicerImpl_Context(ContextServiceServicer): devices = list() for container_name in sorted(container_entry_uuids.keys()): entry_uuids = container_entry_uuids[container_name] - for device in select_entries(self.database, container_name, entry_uuids): + for device in self.obj_db.select_entries(container_name, entry_uuids): reply_device = Device() reply_device.CopyFrom(device) if exclude_endpoints: del reply_device.device_endpoints [:] # pylint: disable=no-member if exclude_config_rules: del reply_device.device_config.config_rules[:] # pylint: disable=no-member - if exclude_components: del reply_device.component[:] # pylint: disable=no-member + if exclude_components: del reply_device.components[:] # pylint: disable=no-member devices.append(reply_device) reply = DeviceList(devices=devices) - LOGGER.info('[SelectDevice] reply={:s}'.format(grpc_message_to_json_string(reply))) + LOGGER.debug('[SelectDevice] reply={:s}'.format(grpc_message_to_json_string(reply))) return reply # ----- Link ------------------------------------------------------------------------------------------------------- def ListLinkIds(self, request: Empty, context : grpc.ServicerContext) -> LinkIdList: - LOGGER.info('[ListLinkIds] request={:s}'.format(grpc_message_to_json_string(request))) - reply = LinkIdList(link_ids=[link.link_id for link in get_entries(self.database, 'link')]) - LOGGER.info('[ListLinkIds] reply={:s}'.format(grpc_message_to_json_string(reply))) + LOGGER.debug('[ListLinkIds] request={:s}'.format(grpc_message_to_json_string(request))) + reply = LinkIdList(link_ids=[link.link_id for link in self.obj_db.get_entries('link')]) + LOGGER.debug('[ListLinkIds] reply={:s}'.format(grpc_message_to_json_string(reply))) return reply def ListLinks(self, request: Empty, context : grpc.ServicerContext) -> LinkList: - LOGGER.info('[ListLinks] request={:s}'.format(grpc_message_to_json_string(request))) - reply = LinkList(links=get_entries(self.database, 'link')) - LOGGER.info('[ListLinks] reply={:s}'.format(grpc_message_to_json_string(reply))) + LOGGER.debug('[ListLinks] request={:s}'.format(grpc_message_to_json_string(request))) + reply = LinkList(links=self.obj_db.get_entries('link')) + LOGGER.debug('[ListLinks] reply={:s}'.format(grpc_message_to_json_string(reply))) return reply def GetLink(self, request: LinkId, context : grpc.ServicerContext) -> Link: - LOGGER.info('[GetLink] request={:s}'.format(grpc_message_to_json_string(request))) - reply = get_entry(context, self.database, 'link', request.link_uuid.uuid) - LOGGER.info('[GetLink] reply={:s}'.format(grpc_message_to_json_string(reply))) + LOGGER.debug('[GetLink] request={:s}'.format(grpc_message_to_json_string(request))) + reply = self.obj_db.get_entry('link', request.link_uuid.uuid, context) + LOGGER.debug('[GetLink] reply={:s}'.format(grpc_message_to_json_string(reply))) return reply def SetLink(self, request: Context, context : grpc.ServicerContext) -> LinkId: - LOGGER.info('[SetLink] request={:s}'.format(grpc_message_to_json_string(request))) - reply = self._set(request, 'link', request.link_id.link_uuid.uuid, 'link_id', TOPIC_LINK) - LOGGER.info('[SetLink] reply={:s}'.format(grpc_message_to_json_string(reply))) + LOGGER.debug('[SetLink] request={:s}'.format(grpc_message_to_json_string(request))) + link_uuid = request.link_id.link_uuid.uuid + reply, link = self._set(request, 'link', link_uuid, 'link_id', TOPIC_LINK) + + context_topology_uuids : Set[Tuple[str, str]] = set() + context_topology_uuids.add((DEFAULT_CONTEXT_NAME, DEFAULT_TOPOLOGY_NAME)) + for endpoint_id in link.link_endpoint_ids: + endpoint_context_uuid = endpoint_id.topology_id.context_id.context_uuid.uuid + if len(endpoint_context_uuid) == 0: endpoint_context_uuid = DEFAULT_CONTEXT_NAME + endpoint_topology_uuid = endpoint_id.topology_id.topology_uuid.uuid + if len(endpoint_topology_uuid) == 0: endpoint_topology_uuid = DEFAULT_TOPOLOGY_NAME + context_topology_uuids.add((endpoint_context_uuid, endpoint_topology_uuid)) + + for context_uuid,topology_uuid in context_topology_uuids: + container_name = 'topology[{:s}]'.format(str(context_uuid)) + topology = self.obj_db.get_entry(container_name, topology_uuid, context) + for _link_id in topology.link_ids: + if _link_id.link_uuid.uuid == link_uuid: break + else: + # link not found, add it + topology.link_ids.add().link_uuid.uuid = link_uuid + + LOGGER.debug('[SetLink] reply={:s}'.format(grpc_message_to_json_string(reply))) return reply def RemoveLink(self, request: LinkId, context : grpc.ServicerContext) -> Empty: - LOGGER.info('[RemoveLink] request={:s}'.format(grpc_message_to_json_string(request))) - reply = self._del(request, 'link', request.link_uuid.uuid, 'link_id', TOPIC_LINK, context) - LOGGER.info('[RemoveLink] reply={:s}'.format(grpc_message_to_json_string(reply))) + LOGGER.debug('[RemoveLink] request={:s}'.format(grpc_message_to_json_string(request))) + link_uuid = request.link_uuid.uuid + link = self.obj_db.get_entry('link', link_uuid, context) + reply = self._del(request, 'link', link_uuid, 'link_id', TOPIC_LINK, context) + + context_topology_uuids : Set[Tuple[str, str]] = set() + context_topology_uuids.add((DEFAULT_CONTEXT_NAME, DEFAULT_TOPOLOGY_NAME)) + for endpoint_id in link.link_endpoint_ids: + endpoint_context_uuid = endpoint_id.topology_id.context_id.context_uuid.uuid + if len(endpoint_context_uuid) == 0: endpoint_context_uuid = DEFAULT_CONTEXT_NAME + endpoint_topology_uuid = endpoint_id.topology_id.topology_uuid.uuid + if len(endpoint_topology_uuid) == 0: endpoint_topology_uuid = DEFAULT_TOPOLOGY_NAME + context_topology_uuids.add((endpoint_context_uuid, endpoint_topology_uuid)) + + for context_uuid,topology_uuid in context_topology_uuids: + container_name = 'topology[{:s}]'.format(str(context_uuid)) + topology = self.obj_db.get_entry(container_name, topology_uuid, context) + for link_id in topology.link_ids: + if link_id.link_uuid.uuid == link_uuid: + topology.link_ids.remove(link_id) + break + + LOGGER.debug('[RemoveLink] reply={:s}'.format(grpc_message_to_json_string(reply))) return reply def GetLinkEvents(self, request: Empty, context : grpc.ServicerContext) -> Iterator[LinkEvent]: - LOGGER.info('[GetLinkEvents] request={:s}'.format(grpc_message_to_json_string(request))) + LOGGER.debug('[GetLinkEvents] request={:s}'.format(grpc_message_to_json_string(request))) for message in self.msg_broker.consume({TOPIC_LINK}): yield LinkEvent(**json.loads(message.content)) # ----- Slice ------------------------------------------------------------------------------------------------------ def ListSliceIds(self, request: ContextId, context : grpc.ServicerContext) -> SliceIdList: - LOGGER.info('[ListSliceIds] request={:s}'.format(grpc_message_to_json_string(request))) - slices = get_entries(self.database, 'slice[{:s}]'.format(str(request.context_uuid.uuid))) + LOGGER.debug('[ListSliceIds] request={:s}'.format(grpc_message_to_json_string(request))) + slices = self.obj_db.get_entries('slice[{:s}]'.format(str(request.context_uuid.uuid))) reply = SliceIdList(slice_ids=[slice.slice_id for slice in slices]) - LOGGER.info('[ListSliceIds] reply={:s}'.format(grpc_message_to_json_string(reply))) + LOGGER.debug('[ListSliceIds] reply={:s}'.format(grpc_message_to_json_string(reply))) return reply def ListSlices(self, request: ContextId, context : grpc.ServicerContext) -> SliceList: - LOGGER.info('[ListSlices] request={:s}'.format(grpc_message_to_json_string(request))) - slices = get_entries(self.database, 'slice[{:s}]'.format(str(request.context_uuid.uuid))) + LOGGER.debug('[ListSlices] request={:s}'.format(grpc_message_to_json_string(request))) + slices = self.obj_db.get_entries('slice[{:s}]'.format(str(request.context_uuid.uuid))) reply = SliceList(slices=[slice for slice in slices]) - LOGGER.info('[ListSlices] reply={:s}'.format(grpc_message_to_json_string(reply))) + LOGGER.debug('[ListSlices] reply={:s}'.format(grpc_message_to_json_string(reply))) return reply def GetSlice(self, request: SliceId, context : grpc.ServicerContext) -> Slice: - LOGGER.info('[GetSlice] request={:s}'.format(grpc_message_to_json_string(request))) + LOGGER.debug('[GetSlice] request={:s}'.format(grpc_message_to_json_string(request))) container_name = 'slice[{:s}]'.format(str(request.context_id.context_uuid.uuid)) - reply = get_entry(context, self.database, container_name, request.slice_uuid.uuid) - LOGGER.info('[GetSlice] reply={:s}'.format(grpc_message_to_json_string(reply))) + reply = self.obj_db.get_entry(container_name, request.slice_uuid.uuid, context) + LOGGER.debug('[GetSlice] reply={:s}'.format(grpc_message_to_json_string(reply))) return reply def SetSlice(self, request: Slice, context : grpc.ServicerContext) -> SliceId: - LOGGER.info('[SetSlice] request={:s}'.format(grpc_message_to_json_string(request))) - container_name = 'slice[{:s}]'.format(str(request.slice_id.context_id.context_uuid.uuid)) + LOGGER.debug('[SetSlice] request={:s}'.format(grpc_message_to_json_string(request))) + context_uuid = str(request.slice_id.context_id.context_uuid.uuid) + container_name = 'slice[{:s}]'.format(context_uuid) slice_uuid = request.slice_id.slice_uuid.uuid - reply = self._set(request, container_name, slice_uuid, 'slice_id', TOPIC_SLICE) - LOGGER.info('[SetSlice] reply={:s}'.format(grpc_message_to_json_string(reply))) + reply,_ = self._set(request, container_name, slice_uuid, 'slice_id', TOPIC_SLICE) + + context_ = self.obj_db.get_entry('context', context_uuid, context) + for _slice_id in context_.slice_ids: + if _slice_id.slice_uuid.uuid == slice_uuid: break + else: + # slice not found, add it + context_.slice_ids.add().slice_uuid.uuid = slice_uuid + + LOGGER.debug('[SetSlice] reply={:s}'.format(grpc_message_to_json_string(reply))) return reply def RemoveSlice(self, request: SliceId, context : grpc.ServicerContext) -> Empty: - LOGGER.info('[RemoveSlice] request={:s}'.format(grpc_message_to_json_string(request))) - container_name = 'slice[{:s}]'.format(str(request.context_id.context_uuid.uuid)) + LOGGER.debug('[RemoveSlice] request={:s}'.format(grpc_message_to_json_string(request))) + context_uuid = str(request.context_id.context_uuid.uuid) + container_name = 'slice[{:s}]'.format(context_uuid) slice_uuid = request.slice_uuid.uuid reply = self._del(request, container_name, slice_uuid, 'slice_id', TOPIC_SLICE, context) - LOGGER.info('[RemoveSlice] reply={:s}'.format(grpc_message_to_json_string(reply))) + + context_ = self.obj_db.get_entry('context', context_uuid, context) + for _slice_id in context_.slice_ids: + if _slice_id.slice_uuid.uuid == slice_uuid: + context_.slice_ids.remove(_slice_id) + break + + LOGGER.debug('[RemoveSlice] reply={:s}'.format(grpc_message_to_json_string(reply))) return reply def GetSliceEvents(self, request: Empty, context : grpc.ServicerContext) -> Iterator[SliceEvent]: - LOGGER.info('[GetSliceEvents] request={:s}'.format(grpc_message_to_json_string(request))) + LOGGER.debug('[GetSliceEvents] request={:s}'.format(grpc_message_to_json_string(request))) for message in self.msg_broker.consume({TOPIC_SLICE}): yield SliceEvent(**json.loads(message.content)) def SelectSlice(self, request : SliceFilter, context : grpc.ServicerContext) -> SliceList: - LOGGER.info('[SelectSlice] request={:s}'.format(grpc_message_to_json_string(request))) + LOGGER.debug('[SelectSlice] request={:s}'.format(grpc_message_to_json_string(request))) container_entry_uuids : Dict[str, Set[str]] = {} for slice_id in request.slice_ids.slice_ids: container_name = 'slice[{:s}]'.format(str(slice_id.context_id.context_uuid.uuid)) @@ -368,7 +465,7 @@ class MockServicerImpl_Context(ContextServiceServicer): slices = list() for container_name in sorted(container_entry_uuids.keys()): entry_uuids = container_entry_uuids[container_name] - for eslice in select_entries(self.database, container_name, entry_uuids): + for eslice in self.obj_db.select_entries(container_name, entry_uuids): reply_slice = Slice() reply_slice.CopyFrom(eslice) if exclude_endpoint_ids: del reply_slice.service_endpoint_ids[:] # pylint: disable=no-member @@ -379,55 +476,72 @@ class MockServicerImpl_Context(ContextServiceServicer): slices.append(reply_slice) reply = SliceList(slices=slices) - LOGGER.info('[SelectSlice] reply={:s}'.format(grpc_message_to_json_string(reply))) + LOGGER.debug('[SelectSlice] reply={:s}'.format(grpc_message_to_json_string(reply))) return reply # ----- Service ---------------------------------------------------------------------------------------------------- def ListServiceIds(self, request: ContextId, context : grpc.ServicerContext) -> ServiceIdList: - LOGGER.info('[ListServiceIds] request={:s}'.format(grpc_message_to_json_string(request))) - services = get_entries(self.database, 'service[{:s}]'.format(str(request.context_uuid.uuid))) + LOGGER.debug('[ListServiceIds] request={:s}'.format(grpc_message_to_json_string(request))) + services = self.obj_db.get_entries('service[{:s}]'.format(str(request.context_uuid.uuid))) reply = ServiceIdList(service_ids=[service.service_id for service in services]) - LOGGER.info('[ListServiceIds] reply={:s}'.format(grpc_message_to_json_string(reply))) + LOGGER.debug('[ListServiceIds] reply={:s}'.format(grpc_message_to_json_string(reply))) return reply def ListServices(self, request: ContextId, context : grpc.ServicerContext) -> ServiceList: - LOGGER.info('[ListServices] request={:s}'.format(grpc_message_to_json_string(request))) - services = get_entries(self.database, 'service[{:s}]'.format(str(request.context_uuid.uuid))) + LOGGER.debug('[ListServices] request={:s}'.format(grpc_message_to_json_string(request))) + services = self.obj_db.get_entries('service[{:s}]'.format(str(request.context_uuid.uuid))) reply = ServiceList(services=[service for service in services]) - LOGGER.info('[ListServices] reply={:s}'.format(grpc_message_to_json_string(reply))) + LOGGER.debug('[ListServices] reply={:s}'.format(grpc_message_to_json_string(reply))) return reply def GetService(self, request: ServiceId, context : grpc.ServicerContext) -> Service: - LOGGER.info('[GetService] request={:s}'.format(grpc_message_to_json_string(request))) + LOGGER.debug('[GetService] request={:s}'.format(grpc_message_to_json_string(request))) container_name = 'service[{:s}]'.format(str(request.context_id.context_uuid.uuid)) - reply = get_entry(context, self.database, container_name, request.service_uuid.uuid) - LOGGER.info('[GetService] reply={:s}'.format(grpc_message_to_json_string(reply))) + reply = self.obj_db.get_entry(container_name, request.service_uuid.uuid, context) + LOGGER.debug('[GetService] reply={:s}'.format(grpc_message_to_json_string(reply))) return reply def SetService(self, request: Service, context : grpc.ServicerContext) -> ServiceId: - LOGGER.info('[SetService] request={:s}'.format(grpc_message_to_json_string(request))) - container_name = 'service[{:s}]'.format(str(request.service_id.context_id.context_uuid.uuid)) + LOGGER.debug('[SetService] request={:s}'.format(grpc_message_to_json_string(request))) + context_uuid = str(request.service_id.context_id.context_uuid.uuid) + container_name = 'service[{:s}]'.format(context_uuid) service_uuid = request.service_id.service_uuid.uuid - reply = self._set(request, container_name, service_uuid, 'service_id', TOPIC_SERVICE) - LOGGER.info('[SetService] reply={:s}'.format(grpc_message_to_json_string(reply))) + reply,_ = self._set(request, container_name, service_uuid, 'service_id', TOPIC_SERVICE) + + context_ = self.obj_db.get_entry('context', context_uuid, context) + for _service_id in context_.service_ids: + if _service_id.service_uuid.uuid == service_uuid: break + else: + # service not found, add it + context_.service_ids.add().service_uuid.uuid = service_uuid + + LOGGER.debug('[SetService] reply={:s}'.format(grpc_message_to_json_string(reply))) return reply def RemoveService(self, request: ServiceId, context : grpc.ServicerContext) -> Empty: - LOGGER.info('[RemoveService] request={:s}'.format(grpc_message_to_json_string(request))) - container_name = 'service[{:s}]'.format(str(request.context_id.context_uuid.uuid)) + LOGGER.debug('[RemoveService] request={:s}'.format(grpc_message_to_json_string(request))) + context_uuid = str(request.context_id.context_uuid.uuid) + container_name = 'service[{:s}]'.format(context_uuid) service_uuid = request.service_uuid.uuid reply = self._del(request, container_name, service_uuid, 'service_id', TOPIC_SERVICE, context) - LOGGER.info('[RemoveService] reply={:s}'.format(grpc_message_to_json_string(reply))) + + context_ = self.obj_db.get_entry('context', context_uuid, context) + for _service_id in context_.service_ids: + if _service_id.service_uuid.uuid == service_uuid: + context_.service_ids.remove(_service_id) + break + + LOGGER.debug('[RemoveService] reply={:s}'.format(grpc_message_to_json_string(reply))) return reply def GetServiceEvents(self, request: Empty, context : grpc.ServicerContext) -> Iterator[ServiceEvent]: - LOGGER.info('[GetServiceEvents] request={:s}'.format(grpc_message_to_json_string(request))) + LOGGER.debug('[GetServiceEvents] request={:s}'.format(grpc_message_to_json_string(request))) for message in self.msg_broker.consume({TOPIC_SERVICE}): yield ServiceEvent(**json.loads(message.content)) def SelectService(self, request : ServiceFilter, context : grpc.ServicerContext) -> ServiceList: - LOGGER.info('[SelectService] request={:s}'.format(grpc_message_to_json_string(request))) + LOGGER.debug('[SelectService] request={:s}'.format(grpc_message_to_json_string(request))) container_entry_uuids : Dict[str, Set[str]] = {} for service_id in request.service_ids.service_ids: container_name = 'service[{:s}]'.format(str(service_id.context_id.context_uuid.uuid)) @@ -441,7 +555,7 @@ class MockServicerImpl_Context(ContextServiceServicer): services = list() for container_name in sorted(container_entry_uuids.keys()): entry_uuids = container_entry_uuids[container_name] - for service in select_entries(self.database, container_name, entry_uuids): + for service in self.obj_db.select_entries(container_name, entry_uuids): reply_service = Service() reply_service.CopyFrom(service) if exclude_endpoint_ids: del reply_service.service_endpoint_ids[:] # pylint: disable=no-member @@ -450,54 +564,54 @@ class MockServicerImpl_Context(ContextServiceServicer): services.append(reply_service) reply = ServiceList(services=services) - LOGGER.info('[SelectService] reply={:s}'.format(grpc_message_to_json_string(reply))) + LOGGER.debug('[SelectService] reply={:s}'.format(grpc_message_to_json_string(reply))) return reply # ----- Connection ------------------------------------------------------------------------------------------------- def ListConnectionIds(self, request: ServiceId, context : grpc.ServicerContext) -> ConnectionIdList: - LOGGER.info('[ListConnectionIds] request={:s}'.format(grpc_message_to_json_string(request))) + LOGGER.debug('[ListConnectionIds] request={:s}'.format(grpc_message_to_json_string(request))) container_name = 'service_connections[{:s}/{:s}]'.format( str(request.context_id.context_uuid.uuid), str(request.service_uuid.uuid)) - reply = ConnectionIdList(connection_ids=[c.connection_id for c in get_entries(self.database, container_name)]) - LOGGER.info('[ListConnectionIds] reply={:s}'.format(grpc_message_to_json_string(reply))) + reply = ConnectionIdList(connection_ids=[c.connection_id for c in self.obj_db.get_entries(container_name)]) + LOGGER.debug('[ListConnectionIds] reply={:s}'.format(grpc_message_to_json_string(reply))) return reply def ListConnections(self, request: ServiceId, context : grpc.ServicerContext) -> ConnectionList: - LOGGER.info('[ListConnections] request={:s}'.format(grpc_message_to_json_string(request))) + LOGGER.debug('[ListConnections] request={:s}'.format(grpc_message_to_json_string(request))) container_name = 'service_connections[{:s}/{:s}]'.format( str(request.context_id.context_uuid.uuid), str(request.service_uuid.uuid)) - reply = ConnectionList(connections=get_entries(self.database, container_name)) - LOGGER.info('[ListConnections] reply={:s}'.format(grpc_message_to_json_string(reply))) + reply = ConnectionList(connections=self.obj_db.get_entries(container_name)) + LOGGER.debug('[ListConnections] reply={:s}'.format(grpc_message_to_json_string(reply))) return reply def GetConnection(self, request: ConnectionId, context : grpc.ServicerContext) -> Connection: - LOGGER.info('[GetConnection] request={:s}'.format(grpc_message_to_json_string(request))) - reply = get_entry(context, self.database, 'connection', request.connection_uuid.uuid) - LOGGER.info('[GetConnection] reply={:s}'.format(grpc_message_to_json_string(reply))) + LOGGER.debug('[GetConnection] request={:s}'.format(grpc_message_to_json_string(request))) + reply = self.obj_db.get_entry('connection', request.connection_uuid.uuid, context) + LOGGER.debug('[GetConnection] reply={:s}'.format(grpc_message_to_json_string(reply))) return reply def SetConnection(self, request: Connection, context : grpc.ServicerContext) -> ConnectionId: - LOGGER.info('[SetConnection] request={:s}'.format(grpc_message_to_json_string(request))) + LOGGER.debug('[SetConnection] request={:s}'.format(grpc_message_to_json_string(request))) container_name = 'service_connection[{:s}/{:s}]'.format( str(request.service_id.context_id.context_uuid.uuid), str(request.service_id.service_uuid.uuid)) connection_uuid = request.connection_id.connection_uuid.uuid - set_entry(self.database, container_name, connection_uuid, request) - reply = self._set(request, 'connection', connection_uuid, 'connection_id', TOPIC_CONNECTION) - LOGGER.info('[SetConnection] reply={:s}'.format(grpc_message_to_json_string(reply))) + self.obj_db.set_entry(container_name, connection_uuid, request) + reply,_ = self._set(request, 'connection', connection_uuid, 'connection_id', TOPIC_CONNECTION) + LOGGER.debug('[SetConnection] reply={:s}'.format(grpc_message_to_json_string(reply))) return reply def RemoveConnection(self, request: ConnectionId, context : grpc.ServicerContext) -> Empty: - LOGGER.info('[RemoveConnection] request={:s}'.format(grpc_message_to_json_string(request))) - connection = get_entry(context, self.database, 'connection', request.connection_uuid.uuid) + LOGGER.debug('[RemoveConnection] request={:s}'.format(grpc_message_to_json_string(request))) + connection = self.obj_db.get_entry('connection', request.connection_uuid.uuid, context) container_name = 'service_connection[{:s}/{:s}]'.format( str(connection.service_id.context_id.context_uuid.uuid), str(connection.service_id.service_uuid.uuid)) connection_uuid = request.connection_uuid.uuid - del_entry(context, self.database, container_name, connection_uuid) + self.obj_db.del_entry(container_name, connection_uuid, context) reply = self._del(request, 'connection', connection_uuid, 'connection_id', TOPIC_CONNECTION, context) - LOGGER.info('[RemoveConnection] reply={:s}'.format(grpc_message_to_json_string(reply))) + LOGGER.debug('[RemoveConnection] reply={:s}'.format(grpc_message_to_json_string(reply))) return reply def GetConnectionEvents(self, request: Empty, context : grpc.ServicerContext) -> Iterator[ConnectionEvent]: - LOGGER.info('[GetConnectionEvents] request={:s}'.format(grpc_message_to_json_string(request))) + LOGGER.debug('[GetConnectionEvents] request={:s}'.format(grpc_message_to_json_string(request))) for message in self.msg_broker.consume({TOPIC_CONNECTION}): yield ConnectionEvent(**json.loads(message.content)) diff --git a/src/common/tests/MockServicerImpl_Monitoring.py b/src/common/tests/MockServicerImpl_Monitoring.py index 7bebf8732dece43fd6c0b5982ea93c70d3ce0bea..4aadb8e5e20575321df2003c69a5ab9fe2390af8 100644 --- a/src/common/tests/MockServicerImpl_Monitoring.py +++ b/src/common/tests/MockServicerImpl_Monitoring.py @@ -12,23 +12,107 @@ # See the License for the specific language governing permissions and # limitations under the License. - -import grpc, logging +import enum, grpc, logging from queue import Queue +from typing import Any, Optional from common.proto.context_pb2 import Empty -from common.proto.monitoring_pb2 import Kpi +from common.proto.monitoring_pb2 import Kpi, KpiDescriptor, KpiDescriptorList, KpiId, KpiQuery, RawKpiTable from common.proto.monitoring_pb2_grpc import MonitoringServiceServicer from common.tools.grpc.Tools import grpc_message_to_json_string +from .InMemoryObjectDatabase import InMemoryObjectDatabase +from .InMemoryTimeSeriesDatabase import InMemoryTimeSeriesDatabase LOGGER = logging.getLogger(__name__) +class IMDB_ContainersEnum(enum.Enum): + KPI_DESCRIPTORS = 'kpi_descriptor' + class MockServicerImpl_Monitoring(MonitoringServiceServicer): - def __init__(self, queue_samples : Queue): - LOGGER.info('[__init__] Creating Servicer...') + def __init__( + self, queue_samples : Optional[Queue] = None + ) -> None: + LOGGER.debug('[__init__] Creating Servicer...') + if queue_samples is None: queue_samples = Queue() self.queue_samples = queue_samples - LOGGER.info('[__init__] Servicer Created') + self.obj_db = InMemoryObjectDatabase() + self.ts_db = InMemoryTimeSeriesDatabase() + LOGGER.debug('[__init__] Servicer Created') + + # ----- Common ----------------------------------------------------------------------------------------------------- + + def _set(self, container_name, entry_uuid, entry_id_field_name, entry) -> Any: + entry = self.obj_db.set_entry(container_name, entry_uuid, entry) + return getattr(entry, entry_id_field_name) + + def _del(self, container_name, entry_uuid, grpc_context) -> Empty: + self.obj_db.del_entry(container_name, entry_uuid, grpc_context) + return Empty() + + # ----- KPI Descriptor --------------------------------------------------------------------------------------------- + + def GetKpiDescriptorList(self, request : Empty, context : grpc.ServicerContext) -> KpiDescriptorList: + LOGGER.debug('[GetKpiDescriptorList] request={:s}'.format(grpc_message_to_json_string(request))) + kpi_descriptor_list = self.obj_db.get_entries(IMDB_ContainersEnum.KPI_DESCRIPTORS.value) + reply = KpiDescriptorList(kpi_descriptor_list=kpi_descriptor_list) + LOGGER.debug('[GetKpiDescriptorList] reply={:s}'.format(grpc_message_to_json_string(reply))) + return reply + + def GetKpiDescriptor(self, request : KpiId, context : grpc.ServicerContext) -> KpiDescriptor: + LOGGER.debug('[GetKpiDescriptor] request={:s}'.format(grpc_message_to_json_string(request))) + reply = self.obj_db.get_entry(IMDB_ContainersEnum.KPI_DESCRIPTORS.value, request.kpi_id.uuid, context) + LOGGER.debug('[GetKpiDescriptor] reply={:s}'.format(grpc_message_to_json_string(reply))) + return reply + + def SetKpi(self, request : KpiDescriptor, context : grpc.ServicerContext) -> KpiId: + LOGGER.debug('[SetKpi] request={:s}'.format(grpc_message_to_json_string(request))) + reply = self._set(IMDB_ContainersEnum.KPI_DESCRIPTORS.value, request.kpi_id.kpi_id.uuid, 'kpi_id', request) + LOGGER.debug('[SetKpi] reply={:s}'.format(grpc_message_to_json_string(reply))) + return reply + + def DeleteKpi(self, request : KpiId, context : grpc.ServicerContext) -> Empty: + LOGGER.debug('[DeleteKpi] request={:s}'.format(grpc_message_to_json_string(request))) + reply = self._del(IMDB_ContainersEnum.KPI_DESCRIPTORS.value, request.kpi_id.kpi_id.uuid, context) + LOGGER.debug('[DeleteKpi] reply={:s}'.format(grpc_message_to_json_string(reply))) + return reply + + # ----- KPI Sample ------------------------------------------------------------------------------------------------- def IncludeKpi(self, request : Kpi, context : grpc.ServicerContext) -> Empty: - LOGGER.info('[IncludeKpi] request={:s}'.format(grpc_message_to_json_string(request))) + LOGGER.debug('[IncludeKpi] request={:s}'.format(grpc_message_to_json_string(request))) self.queue_samples.put(request) - return Empty() + reply = Empty() + LOGGER.debug('[IncludeKpi] reply={:s}'.format(grpc_message_to_json_string(reply))) + return reply + + def QueryKpiData(self, request : KpiQuery, context : grpc.ServicerContext) -> RawKpiTable: + LOGGER.debug('[QueryKpiData] request={:s}'.format(grpc_message_to_json_string(request))) + # TODO: add filters for request.monitoring_window_s + # TODO: add filters for request.last_n_samples + kpi_uuids = [kpi_id.kpi_id.uuid for kpi_id in request.kpi_ids] + + start_timestamp = request.start_timestamp.timestamp + if start_timestamp <= 0: start_timestamp = None + + end_timestamp = request.end_timestamp.timestamp + if end_timestamp <= 0: end_timestamp = None + + df_samples = self.ts_db.filter(kpi_uuids, start_timestamp=start_timestamp, end_timestamp=end_timestamp) + #LOGGER.debug('[QueryKpiData] df_samples={:s}'.format(df_samples.to_string())) + reply = RawKpiTable() + kpi_uuid__to__raw_kpi_list = dict() + + for df_sample in df_samples.itertuples(): + kpi_uuid = df_sample.kpi_uuid + if kpi_uuid in kpi_uuid__to__raw_kpi_list: + raw_kpi_list = kpi_uuid__to__raw_kpi_list[kpi_uuid] + else: + raw_kpi_list = reply.raw_kpi_lists.add() # pylint: disable=no-member + raw_kpi_list.kpi_id.kpi_id.uuid = kpi_uuid + kpi_uuid__to__raw_kpi_list[kpi_uuid] = raw_kpi_list + + raw_kpi = raw_kpi_list.raw_kpis.add() + raw_kpi.timestamp.timestamp = df_sample.timestamp.timestamp() + raw_kpi.kpi_value.floatVal = df_sample.value + + LOGGER.debug('[QueryKpiData] reply={:s}'.format(grpc_message_to_json_string(reply))) + return reply diff --git a/src/common/tools/context_queries/Topology.py b/src/common/tools/context_queries/Topology.py index 15217b8d14fec0137d94aa704e3cd8cb096f4a17..c90d59105ae6b0805a73e9a53c664e063703f73d 100644 --- a/src/common/tools/context_queries/Topology.py +++ b/src/common/tools/context_queries/Topology.py @@ -15,7 +15,7 @@ import grpc, logging from typing import List, Optional from common.Constants import DEFAULT_CONTEXT_NAME -from common.proto.context_pb2 import ContextId, Topology, TopologyId +from common.proto.context_pb2 import ContextId, Topology, TopologyDetails, TopologyId from common.tools.object_factory.Context import json_context_id from common.tools.object_factory.Topology import json_topology from context.client.ContextClient import ContextClient @@ -23,13 +23,13 @@ from context.client.ContextClient import ContextClient LOGGER = logging.getLogger(__name__) def create_topology( - context_client : ContextClient, context_uuid : str, topology_uuid : str + context_client : ContextClient, context_uuid : str, topology_uuid : str, name : Optional[str] = None ) -> None: context_id = ContextId(**json_context_id(context_uuid)) existing_topology_ids = context_client.ListTopologyIds(context_id) existing_topology_uuids = {topology_id.topology_uuid.uuid for topology_id in existing_topology_ids.topology_ids} if topology_uuid in existing_topology_uuids: return - context_client.SetTopology(Topology(**json_topology(topology_uuid, context_id=context_id))) + context_client.SetTopology(Topology(**json_topology(topology_uuid, context_id=context_id, name=name))) def create_missing_topologies( context_client : ContextClient, context_id : ContextId, topology_uuids : List[str] @@ -61,3 +61,21 @@ def get_topology( except grpc.RpcError: #LOGGER.exception('Unable to get topology({:s} / {:s})'.format(str(context_uuid), str(topology_uuid))) return None + +def get_topology_details( + context_client : ContextClient, topology_uuid : str, context_uuid : str = DEFAULT_CONTEXT_NAME, + rw_copy : bool = False + ) -> Optional[TopologyDetails]: + try: + # pylint: disable=no-member + topology_id = TopologyId() + topology_id.context_id.context_uuid.uuid = context_uuid + topology_id.topology_uuid.uuid = topology_uuid + ro_topology_details = context_client.GetTopologyDetails(topology_id) + if not rw_copy: return ro_topology_details + rw_topology_details = TopologyDetails() + rw_topology_details.CopyFrom(ro_topology_details) + return rw_topology_details + except grpc.RpcError: + #LOGGER.exception('Unable to get topology({:s} / {:s})'.format(str(context_uuid), str(topology_uuid))) + return None diff --git a/src/common/tools/descriptor/Loader.py b/src/common/tools/descriptor/Loader.py index 916a73d300011c62fc008fc7437df8a71f6a9838..c5468c19ccc063387460ed7f7b28ee70c5f1d907 100644 --- a/src/common/tools/descriptor/Loader.py +++ b/src/common/tools/descriptor/Loader.py @@ -240,11 +240,16 @@ class DescriptorLoader: self._process_descr('slice', 'add', self.__ctx_cli.SetSlice, Slice, self.__slices ) self._process_descr('connection', 'add', self.__ctx_cli.SetConnection, Connection, self.__connections ) - # Update context and topology is useless: - # - devices and links are assigned to topologies automatically by Context component - # - topologies, services, and slices are assigned to contexts automatically by Context component + # By default the Context component automatically assigns devices and links to topologies based on their + # endpoints, and assigns topologies, services, and slices to contexts based on their identifiers. + + # The following statement is useless; up to now, any use case requires assigning a topology, service, or + # slice to a different context. #self._process_descr('context', 'update', self.__ctx_cli.SetContext, Context, self.__contexts ) - #self._process_descr('topology', 'update', self.__ctx_cli.SetTopology, Topology, self.__topologies ) + + # In some cases, it might be needed to assign devices and links to multiple topologies; the + # following statement performs that assignment. + self._process_descr('topology', 'update', self.__ctx_cli.SetTopology, Topology, self.__topologies ) #self.__ctx_cli.close() @@ -271,12 +276,17 @@ class DescriptorLoader: self._process_descr('service', 'update', self.__svc_cli.UpdateService, Service, self.__services ) self._process_descr('slice', 'add', self.__slc_cli.CreateSlice, Slice, self.__slices_add ) self._process_descr('slice', 'update', self.__slc_cli.UpdateSlice, Slice, self.__slices ) - - # Update context and topology is useless: - # - devices and links are assigned to topologies automatically by Context component - # - topologies, services, and slices are assigned to contexts automatically by Context component + + # By default the Context component automatically assigns devices and links to topologies based on their + # endpoints, and assigns topologies, services, and slices to contexts based on their identifiers. + + # The following statement is useless; up to now, any use case requires assigning a topology, service, or + # slice to a different context. #self._process_descr('context', 'update', self.__ctx_cli.SetContext, Context, self.__contexts ) - #self._process_descr('topology', 'update', self.__ctx_cli.SetTopology, Topology, self.__topologies ) + + # In some cases, it might be needed to assign devices and links to multiple topologies; the + # following statement performs that assignment. + self._process_descr('topology', 'update', self.__ctx_cli.SetTopology, Topology, self.__topologies ) #self.__slc_cli.close() #self.__svc_cli.close() diff --git a/src/common/tools/descriptor/Tools.py b/src/common/tools/descriptor/Tools.py index f03c635b802e5c003a6ea80af46ef740b97e500b..3126f2bcedb1aaeeda660674d41a249af03679fe 100644 --- a/src/common/tools/descriptor/Tools.py +++ b/src/common/tools/descriptor/Tools.py @@ -57,6 +57,8 @@ def format_custom_config_rules(config_rules : List[Dict]) -> List[Dict]: if isinstance(custom_resource_value, (dict, list)): custom_resource_value = json.dumps(custom_resource_value, sort_keys=True, indent=0) config_rule['custom']['resource_value'] = custom_resource_value + elif not isinstance(custom_resource_value, str): + config_rule['custom']['resource_value'] = str(custom_resource_value) return config_rules def format_device_custom_config_rules(device : Dict) -> Dict: diff --git a/src/common/tools/object_factory/Constraint.py b/src/common/tools/object_factory/Constraint.py index ef00e3872343196f0a9f8de97d3b1ab6fc12d847..9fccd9d5f97d64cac2dea441bbbb374d638df114 100644 --- a/src/common/tools/object_factory/Constraint.py +++ b/src/common/tools/object_factory/Constraint.py @@ -19,6 +19,9 @@ def json_constraint_custom(constraint_type : str, constraint_value : Union[str, if not isinstance(constraint_value, str): constraint_value = json.dumps(constraint_value, sort_keys=True) return {'custom': {'constraint_type': constraint_type, 'constraint_value': constraint_value}} +def json_constraint_schedule(start_timestamp : float, duration_days : float) -> Dict: + return {'schedule': {'start_timestamp': start_timestamp, 'duration_days': duration_days}} + def json_constraint_endpoint_location_region(endpoint_id : Dict, region : str) -> Dict: return {'endpoint_location': {'endpoint_id': endpoint_id, 'location': {'region': region}}} @@ -29,16 +32,27 @@ def json_constraint_endpoint_location_gps(endpoint_id : Dict, latitude : float, def json_constraint_endpoint_priority(endpoint_id : Dict, priority : int) -> Dict: return {'endpoint_priority': {'endpoint_id': endpoint_id, 'priority': priority}} +def json_constraint_sla_capacity(capacity_gbps : float) -> Dict: + return {'sla_capacity': {'capacity_gbps': capacity_gbps}} + +def json_constraint_sla_latency(e2e_latency_ms : float) -> Dict: + return {'sla_latency': {'e2e_latency_ms': e2e_latency_ms}} + def json_constraint_sla_availability(num_disjoint_paths : int, all_active : bool, availability : float) -> Dict: return {'sla_availability': { 'num_disjoint_paths': num_disjoint_paths, 'all_active': all_active, 'availability': availability }} -def json_constraint_sla_capacity(capacity_gbps : float) -> Dict: - return {'sla_capacity': {'capacity_gbps': capacity_gbps}} - def json_constraint_sla_isolation(isolation_levels : List[int]) -> Dict: return {'sla_isolation': {'isolation_level': isolation_levels}} -def json_constraint_sla_latency(e2e_latency_ms : float) -> Dict: - return {'sla_latency': {'e2e_latency_ms': e2e_latency_ms}} +def json_constraint_exclusions( + is_permanent : bool = False, device_ids : List[Dict] = [], endpoint_ids : List[Dict] = [], + link_ids : List[Dict] = [] +) -> Dict: + return {'exclusions': { + 'is_permanent' : is_permanent, + 'device_ids' : device_ids, + 'endpoint_ids' : endpoint_ids, + 'link_ids' : link_ids, + }} diff --git a/src/common/tools/object_factory/Link.py b/src/common/tools/object_factory/Link.py index 5f8080d300d9d6d646b8d769ec5819b0bd26f789..c0a4c48d1beea64e6591e47441509fa2cc42c02b 100644 --- a/src/common/tools/object_factory/Link.py +++ b/src/common/tools/object_factory/Link.py @@ -23,13 +23,28 @@ def get_link_uuid(a_endpoint_id : Dict, z_endpoint_id : Dict) -> str: def json_link_id(link_uuid : str) -> Dict: return {'link_uuid': {'uuid': link_uuid}} -def json_link(link_uuid : str, endpoint_ids : List[Dict], name : Optional[str] = None) -> Dict: +def json_link( + link_uuid : str, endpoint_ids : List[Dict], name : Optional[str] = None, + total_capacity_gbps : Optional[float] = None, used_capacity_gbps : Optional[float] = None +) -> Dict: result = {'link_id': json_link_id(link_uuid), 'link_endpoint_ids': copy.deepcopy(endpoint_ids)} if name is not None: result['name'] = name + if total_capacity_gbps is not None: + attributes : Dict = result.setdefault('attributes', dict()) + attributes.setdefault('total_capacity_gbps', total_capacity_gbps) + if used_capacity_gbps is not None: + attributes : Dict = result.setdefault('attributes', dict()) + attributes.setdefault('used_capacity_gbps', used_capacity_gbps) return result -def compose_link(endpoint_a, endpoint_z) -> Tuple[Dict, Dict]: +def compose_link( + endpoint_a : Dict, endpoint_z : Dict, name : Optional[str] = None, + total_capacity_gbps : Optional[float] = None, used_capacity_gbps : Optional[float] = None +) -> Tuple[Dict, Dict]: 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']]) + link = json_link( + link_uuid, [endpoint_a['endpoint_id'], endpoint_z['endpoint_id']], name=name, + total_capacity_gbps=total_capacity_gbps, used_capacity_gbps=used_capacity_gbps + ) return link_id, link diff --git a/src/common/tools/service/GenericRestServer.py b/src/common/tools/service/GenericRestServer.py index 51d3f828fabea1a6d3b9a4d7da526750a50fcbf9..a5292e310abbf0335967cb94fdaed14c1ea3cd0e 100644 --- a/src/common/tools/service/GenericRestServer.py +++ b/src/common/tools/service/GenericRestServer.py @@ -37,7 +37,8 @@ class GenericRestServer(threading.Thread): self.bind_port = bind_port self.base_url = base_url self.bind_address = get_http_bind_address() if bind_address is None else bind_address - self.endpoint = 'http://{:s}:{:s}{:s}'.format(str(self.bind_address), str(self.bind_port), str(self.base_url)) + self.endpoint = 'http://{:s}:{:s}'.format(str(self.bind_address), str(self.bind_port)) + if self.base_url is not None: self.endpoint += str(self.base_url) self.srv = None self.ctx = None self.app = Flask(__name__) diff --git a/src/common/tools/timestamp/Converters.py b/src/common/tools/timestamp/Converters.py index 0ef8e0863b71b610602dfc0ee4fc7c72d25a1139..7918017390e60bd7830d3513216fc0b8f6cf83ef 100644 --- a/src/common/tools/timestamp/Converters.py +++ b/src/common/tools/timestamp/Converters.py @@ -13,14 +13,23 @@ # limitations under the License. -import dateutil.parser +import dateutil.parser, math from datetime import datetime, timezone +def timestamp_datetime_to_float(dt_timestamp : datetime) -> int: + return math.floor(dt_timestamp.timestamp()) + +def timestamp_datetime_to_int(dt_timestamp : datetime) -> int: + return math.floor(timestamp_datetime_to_float(dt_timestamp)) + def timestamp_string_to_float(str_timestamp : str) -> float: - return datetime.timestamp(dateutil.parser.isoparse(str_timestamp)) + return timestamp_datetime_to_float(dateutil.parser.isoparse(str_timestamp)) def timestamp_float_to_string(flt_timestamp : float) -> str: return datetime.utcfromtimestamp(flt_timestamp).isoformat() + 'Z' +def timestamp_utcnow_to_datetime() -> datetime: + return datetime.now(tz=timezone.utc) + def timestamp_utcnow_to_float() -> float: - return datetime.timestamp(datetime.now(tz=timezone.utc)) + return timestamp_datetime_to_float(timestamp_utcnow_to_datetime()) diff --git a/src/common/type_checkers/Assertions.py b/src/common/type_checkers/Assertions.py index 25eb42fabf9c670256e9079a060aa38deb3c0f3d..286ae179d325b6e70d6ebf509de92e354ba42bc8 100644 --- a/src/common/type_checkers/Assertions.py +++ b/src/common/type_checkers/Assertions.py @@ -31,7 +31,7 @@ def validate_device_driver_enum(message): 'DEVICEDRIVER_TRANSPORT_API', 'DEVICEDRIVER_P4', 'DEVICEDRIVER_IETF_NETWORK_TOPOLOGY', - 'DEVICEDRIVER_ONF_TR_352', + 'DEVICEDRIVER_ONF_TR_532', 'DEVICEDRIVER_XR', 'DEVICEDRIVER_IETF_L2VPN', 'DEVICEDRIVER_GNMI_OPENCONFIG', @@ -53,6 +53,8 @@ def validate_kpi_sample_types_enum(message): 'KPISAMPLETYPE_PACKETS_RECEIVED', 'KPISAMPLETYPE_BYTES_TRANSMITTED', 'KPISAMPLETYPE_BYTES_RECEIVED', + 'KPISAMPLETYPE_LINK_TOTAL_CAPACITY_GBPS', + 'KPISAMPLETYPE_LINK_USED_CAPACITY_GBPS', ] def validate_service_type_enum(message): diff --git a/src/compute/tests/PrepareTestScenario.py b/src/compute/tests/PrepareTestScenario.py deleted file mode 100644 index fbfdb91eebe5e17d51e9b83a9ccbca5c1913e1a9..0000000000000000000000000000000000000000 --- a/src/compute/tests/PrepareTestScenario.py +++ /dev/null @@ -1,54 +0,0 @@ -# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import os, pytest, time -from common.Constants import ServiceNameEnum -from common.Settings import ( - ENVVAR_SUFIX_SERVICE_HOST, ENVVAR_SUFIX_SERVICE_PORT_HTTP, get_env_var_name, get_service_port_http) -from compute.service.rest_server.RestServer import RestServer -from compute.service.rest_server.nbi_plugins.debug_api import register_debug_api -from compute.service.rest_server.nbi_plugins.ietf_l2vpn import register_ietf_l2vpn -from compute.tests.MockService_Dependencies import MockService_Dependencies -from tests.tools.mock_osm.MockOSM import MockOSM -from .Constants import WIM_MAPPING, WIM_USERNAME, WIM_PASSWORD - -LOCAL_HOST = '127.0.0.1' -MOCKSERVICE_PORT = 10000 -COMPUTE_SERVICE_PORT = MOCKSERVICE_PORT + get_service_port_http(ServiceNameEnum.COMPUTE) # avoid privileged ports -os.environ[get_env_var_name(ServiceNameEnum.COMPUTE, ENVVAR_SUFIX_SERVICE_HOST )] = str(LOCAL_HOST) -os.environ[get_env_var_name(ServiceNameEnum.COMPUTE, ENVVAR_SUFIX_SERVICE_PORT_HTTP)] = str(COMPUTE_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 compute_service_rest(mock_service): # pylint: disable=redefined-outer-name - _rest_server = RestServer() - register_debug_api(_rest_server) - register_ietf_l2vpn(_rest_server) - _rest_server.start() - time.sleep(1) # bring time for the server to start - yield _rest_server - _rest_server.shutdown() - _rest_server.join() - -@pytest.fixture(scope='session') -def osm_wim(compute_service_rest): # pylint: disable=redefined-outer-name - wim_url = 'http://{:s}:{:d}'.format(LOCAL_HOST, COMPUTE_SERVICE_PORT) - return MockOSM(wim_url, WIM_MAPPING, WIM_USERNAME, WIM_PASSWORD) diff --git a/src/compute/tests/test_unitary.py b/src/compute/tests/test_unitary.py deleted file mode 100644 index 5d98507c88721d4d7aefa94528bb59c0cdc0c130..0000000000000000000000000000000000000000 --- a/src/compute/tests/test_unitary.py +++ /dev/null @@ -1,39 +0,0 @@ -# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import logging -from tests.tools.mock_osm.MockOSM import MockOSM -from .Constants import SERVICE_CONNECTION_POINTS_1, SERVICE_CONNECTION_POINTS_2, SERVICE_TYPE -from .PrepareTestScenario import ( # pylint: disable=unused-import - # be careful, order of symbols is important here! - mock_service, compute_service_rest, osm_wim) - -LOGGER = logging.getLogger(__name__) -LOGGER.setLevel(logging.DEBUG) - - -def test_compute_create_connectivity_service_rest_api(osm_wim : MockOSM): # pylint: disable=redefined-outer-name - osm_wim.create_connectivity_service(SERVICE_TYPE, SERVICE_CONNECTION_POINTS_1) - -def test_compute_get_connectivity_service_status_rest_api(osm_wim : MockOSM): # pylint: disable=redefined-outer-name - service_uuid = list(osm_wim.conn_info.keys())[0] # this test adds a single service - osm_wim.get_connectivity_service_status(service_uuid) - -def test_compute_edit_connectivity_service_rest_api(osm_wim : MockOSM): # pylint: disable=redefined-outer-name - service_uuid = list(osm_wim.conn_info.keys())[0] # this test adds a single service - osm_wim.edit_connectivity_service(service_uuid, SERVICE_CONNECTION_POINTS_2) - -def test_compute_delete_connectivity_service_rest_api(osm_wim : MockOSM): # pylint: disable=redefined-outer-name - service_uuid = list(osm_wim.conn_info.keys())[0] # this test adds a single service - osm_wim.delete_connectivity_service(service_uuid) diff --git a/src/context/.gitlab-ci.yml b/src/context/.gitlab-ci.yml index 63fc2d94307f556140e15e984789b9495f2d8270..5de4bc1fcbb5bea98a7675253efe060df03a1237 100644 --- a/src/context/.gitlab-ci.yml +++ b/src/context/.gitlab-ci.yml @@ -53,6 +53,7 @@ unit_test context: - if docker volume ls | grep crdb; then docker volume rm -f crdb; else echo "CockroachDB volume is not in the system"; fi - if docker container ls | grep nats; then docker rm -f nats; else echo "NATS container is not in the system"; fi - if docker container ls | grep $IMAGE_NAME; then docker rm -f $IMAGE_NAME; else echo "$IMAGE_NAME container is not in the system"; fi + - docker container prune -f script: - docker pull "$CI_REGISTRY_IMAGE/$IMAGE_NAME:$IMAGE_TAG" - docker pull "cockroachdb/cockroach:latest-v22.2" diff --git a/src/context/Config.py b/src/context/Config.py index 1549d9811aa5d1c193a44ad45d0d7773236c0612..770b1f065b93718c5428e895fae948d8e6ee1466 100644 --- a/src/context/Config.py +++ b/src/context/Config.py @@ -12,3 +12,15 @@ # See the License for the specific language governing permissions and # limitations under the License. +from common.Settings import get_setting + +TRUE_VALUES = {'Y', 'YES', 'T', 'TRUE', 'E', 'ENABLE', 'ENABLED'} +def is_enabled(setting_name : str, default_value : bool) -> bool: + _is_enabled = get_setting(setting_name, default=None) + if _is_enabled is None: return default_value + str_is_enabled = str(_is_enabled).upper() + return str_is_enabled in TRUE_VALUES + +DEFAULT_VALUE = False +ALLOW_EXPLICIT_ADD_DEVICE_TO_TOPOLOGY = is_enabled('ALLOW_EXPLICIT_ADD_DEVICE_TO_TOPOLOGY', DEFAULT_VALUE) +ALLOW_EXPLICIT_ADD_LINK_TO_TOPOLOGY = is_enabled('ALLOW_EXPLICIT_ADD_LINK_TO_TOPOLOGY', DEFAULT_VALUE) diff --git a/src/context/Dockerfile b/src/context/Dockerfile index d6fa045c2afab7275dff9f34f6ab31f0ef84563b..18a7fbc54788d70724716b3f0b5b532de3e7054b 100644 --- a/src/context/Dockerfile +++ b/src/context/Dockerfile @@ -16,7 +16,7 @@ FROM python:3.9-slim # Install dependencies RUN apt-get --yes --quiet --quiet update && \ - apt-get --yes --quiet --quiet install wget g++ && \ + apt-get --yes --quiet --quiet install wget g++ git && \ rm -rf /var/lib/apt/lists/* # Set Python to show logs as they occur @@ -53,7 +53,7 @@ RUN python3 -m grpc_tools.protoc -I=. --python_out=. --grpc_python_out=. *.proto RUN rm *.proto RUN find . -type f -exec sed -i -E 's/(import\ .*)_pb2/from . \1_pb2/g' {} \; -# Create component sub-folder, get specific Python packages +# Create component sub-folders, get specific Python packages RUN mkdir -p /var/teraflow/context WORKDIR /var/teraflow/context COPY src/context/requirements.in requirements.in diff --git a/src/context/requirements.in b/src/context/requirements.in index 44794c14fdb86af3b4c78ac41f5e981e7075700f..7ea6622fb43f409c76b3362b7a3986a7a0c31aa6 100644 --- a/src/context/requirements.in +++ b/src/context/requirements.in @@ -12,8 +12,8 @@ # See the License for the specific language governing permissions and # limitations under the License. -nats-py==2.2.0 -psycopg2-binary==2.9.3 -SQLAlchemy==1.4.40 -sqlalchemy-cockroachdb==1.4.3 -SQLAlchemy-Utils==0.38.3 +nats-py==2.6.* +psycopg2-binary==2.9.* +SQLAlchemy==1.4.* +sqlalchemy-cockroachdb==1.4.* +SQLAlchemy-Utils==0.38.* diff --git a/src/context/service/ContextServiceServicerImpl.py b/src/context/service/ContextServiceServicerImpl.py index 6d540b4945df8516697c957316294a452186ddb1..93f078e75545c93a2cd312cf48e8f64cdeea87ac 100644 --- a/src/context/service/ContextServiceServicerImpl.py +++ b/src/context/service/ContextServiceServicerImpl.py @@ -12,14 +12,14 @@ # See the License for the specific language governing permissions and # limitations under the License. -import grpc, json, logging, sqlalchemy +import grpc, logging, sqlalchemy from typing import Iterator from common.message_broker.MessageBroker import MessageBroker from common.proto.context_pb2 import ( Connection, ConnectionEvent, ConnectionId, ConnectionIdList, ConnectionList, Context, ContextEvent, ContextId, ContextIdList, ContextList, Device, DeviceEvent, DeviceFilter, DeviceId, DeviceIdList, DeviceList, - Empty, EndPointIdList, EndPointNameList, EventTypeEnum, + Empty, EndPointIdList, EndPointNameList, Link, LinkEvent, LinkId, LinkIdList, LinkList, Service, ServiceEvent, ServiceFilter, ServiceId, ServiceIdList, ServiceList, Slice, SliceEvent, SliceFilter, SliceId, SliceIdList, SliceList, @@ -33,16 +33,16 @@ from .database.Connection import ( from .database.Context import context_delete, context_get, context_list_ids, context_list_objs, context_set from .database.Device import device_delete, device_get, device_list_ids, device_list_objs, device_select, device_set from .database.EndPoint import endpoint_list_names +from .database.Events import EventTopicEnum, consume_events from .database.Link import link_delete, link_get, link_list_ids, link_list_objs, link_set from .database.PolicyRule import ( policyrule_delete, policyrule_get, policyrule_list_ids, policyrule_list_objs, policyrule_set) -from .database.Service import service_delete, service_get, service_list_ids, service_list_objs, service_select, service_set, service_unset -from .database.Slice import slice_delete, slice_get, slice_list_ids, slice_list_objs, slice_select, slice_set, slice_unset +from .database.Service import ( + service_delete, service_get, service_list_ids, service_list_objs, service_select, service_set, service_unset) +from .database.Slice import ( + slice_delete, slice_get, slice_list_ids, slice_list_objs, slice_select, slice_set, slice_unset) from .database.Topology import ( topology_delete, topology_get, topology_get_details, topology_list_ids, topology_list_objs, topology_set) -from .Events import ( - CONSUME_TIMEOUT, TOPIC_CONNECTION, TOPIC_CONTEXT, TOPIC_DEVICE, TOPIC_LINK, TOPIC_POLICY, TOPIC_SERVICE, - TOPIC_SLICE, TOPIC_TOPOLOGY, notify_event) LOGGER = logging.getLogger(__name__) @@ -62,308 +62,237 @@ class ContextServiceServicerImpl(ContextServiceServicer, ContextPolicyServiceSer @safe_and_metered_rpc_method(METRICS_POOL, LOGGER) def ListContextIds(self, request : Empty, context : grpc.ServicerContext) -> ContextIdList: - return ContextIdList(context_ids=context_list_ids(self.db_engine)) + return context_list_ids(self.db_engine) @safe_and_metered_rpc_method(METRICS_POOL, LOGGER) def ListContexts(self, request : Empty, context : grpc.ServicerContext) -> ContextList: - return ContextList(contexts=context_list_objs(self.db_engine)) + return context_list_objs(self.db_engine) @safe_and_metered_rpc_method(METRICS_POOL, LOGGER) def GetContext(self, request : ContextId, context : grpc.ServicerContext) -> Context: - return Context(**context_get(self.db_engine, request)) + return context_get(self.db_engine, request) @safe_and_metered_rpc_method(METRICS_POOL, LOGGER) def SetContext(self, request : Context, context : grpc.ServicerContext) -> ContextId: - context_id,updated = context_set(self.db_engine, request) - event_type = EventTypeEnum.EVENTTYPE_UPDATE if updated else EventTypeEnum.EVENTTYPE_CREATE - notify_event(self.messagebroker, TOPIC_CONTEXT, event_type, {'context_id': context_id}) - return ContextId(**context_id) + return context_set(self.db_engine, self.messagebroker, request) @safe_and_metered_rpc_method(METRICS_POOL, LOGGER) def RemoveContext(self, request : ContextId, context : grpc.ServicerContext) -> Empty: - context_id,deleted = context_delete(self.db_engine, request) - if deleted: - event_type = EventTypeEnum.EVENTTYPE_REMOVE - notify_event(self.messagebroker, TOPIC_CONTEXT, event_type, {'context_id': context_id}) - return Empty() + return context_delete(self.db_engine, self.messagebroker, request) @safe_and_metered_rpc_method(METRICS_POOL, LOGGER) def GetContextEvents(self, request : Empty, context : grpc.ServicerContext) -> Iterator[ContextEvent]: - for message in self.messagebroker.consume({TOPIC_CONTEXT}, consume_timeout=CONSUME_TIMEOUT): - yield ContextEvent(**json.loads(message.content)) + for message in consume_events(self.messagebroker, {EventTopicEnum.CONTEXT}): yield message # ----- Topology --------------------------------------------------------------------------------------------------- @safe_and_metered_rpc_method(METRICS_POOL, LOGGER) def ListTopologyIds(self, request : ContextId, context : grpc.ServicerContext) -> TopologyIdList: - return TopologyIdList(topology_ids=topology_list_ids(self.db_engine, request)) + return topology_list_ids(self.db_engine, request) @safe_and_metered_rpc_method(METRICS_POOL, LOGGER) def ListTopologies(self, request : ContextId, context : grpc.ServicerContext) -> TopologyList: - return TopologyList(topologies=topology_list_objs(self.db_engine, request)) + return topology_list_objs(self.db_engine, request) @safe_and_metered_rpc_method(METRICS_POOL, LOGGER) def GetTopology(self, request : TopologyId, context : grpc.ServicerContext) -> Topology: - return Topology(**topology_get(self.db_engine, request)) + return topology_get(self.db_engine, request) @safe_and_metered_rpc_method(METRICS_POOL, LOGGER) def GetTopologyDetails(self, request : TopologyId, context : grpc.ServicerContext) -> TopologyDetails: - return TopologyDetails(**topology_get_details(self.db_engine, request)) + return topology_get_details(self.db_engine, request) @safe_and_metered_rpc_method(METRICS_POOL, LOGGER) def SetTopology(self, request : Topology, context : grpc.ServicerContext) -> TopologyId: - topology_id,updated = topology_set(self.db_engine, request) - event_type = EventTypeEnum.EVENTTYPE_UPDATE if updated else EventTypeEnum.EVENTTYPE_CREATE - notify_event(self.messagebroker, TOPIC_TOPOLOGY, event_type, {'topology_id': topology_id}) - return TopologyId(**topology_id) + return topology_set(self.db_engine, self.messagebroker, request) @safe_and_metered_rpc_method(METRICS_POOL, LOGGER) def RemoveTopology(self, request : TopologyId, context : grpc.ServicerContext) -> Empty: - topology_id,deleted = topology_delete(self.db_engine, request) - if deleted: - event_type = EventTypeEnum.EVENTTYPE_REMOVE - notify_event(self.messagebroker, TOPIC_TOPOLOGY, event_type, {'topology_id': topology_id}) - return Empty() + return topology_delete(self.db_engine, self.messagebroker, request) @safe_and_metered_rpc_method(METRICS_POOL, LOGGER) def GetTopologyEvents(self, request : Empty, context : grpc.ServicerContext) -> Iterator[TopologyEvent]: - for message in self.messagebroker.consume({TOPIC_TOPOLOGY}, consume_timeout=CONSUME_TIMEOUT): - yield TopologyEvent(**json.loads(message.content)) + for message in consume_events(self.messagebroker, {EventTopicEnum.TOPOLOGY}): yield message # ----- Device ----------------------------------------------------------------------------------------------------- @safe_and_metered_rpc_method(METRICS_POOL, LOGGER) def ListDeviceIds(self, request : Empty, context : grpc.ServicerContext) -> DeviceIdList: - return DeviceIdList(device_ids=device_list_ids(self.db_engine)) + return device_list_ids(self.db_engine) @safe_and_metered_rpc_method(METRICS_POOL, LOGGER) def ListDevices(self, request : Empty, context : grpc.ServicerContext) -> DeviceList: - return DeviceList(devices=device_list_objs(self.db_engine)) + return device_list_objs(self.db_engine) @safe_and_metered_rpc_method(METRICS_POOL, LOGGER) def GetDevice(self, request : ContextId, context : grpc.ServicerContext) -> Device: - return Device(**device_get(self.db_engine, request)) + return device_get(self.db_engine, request) @safe_and_metered_rpc_method(METRICS_POOL, LOGGER) def SetDevice(self, request : Device, context : grpc.ServicerContext) -> DeviceId: - device_id,updated = device_set(self.db_engine, request) - event_type = EventTypeEnum.EVENTTYPE_UPDATE if updated else EventTypeEnum.EVENTTYPE_CREATE - notify_event(self.messagebroker, TOPIC_DEVICE, event_type, {'device_id': device_id}) - return DeviceId(**device_id) + return device_set(self.db_engine, self.messagebroker, request) @safe_and_metered_rpc_method(METRICS_POOL, LOGGER) def RemoveDevice(self, request : DeviceId, context : grpc.ServicerContext) -> Empty: - device_id,deleted = device_delete(self.db_engine, request) - if deleted: - event_type = EventTypeEnum.EVENTTYPE_REMOVE - notify_event(self.messagebroker, TOPIC_DEVICE, event_type, {'device_id': device_id}) - return Empty() + return device_delete(self.db_engine, self.messagebroker, request) @safe_and_metered_rpc_method(METRICS_POOL, LOGGER) def SelectDevice(self, request : DeviceFilter, context : grpc.ServicerContext) -> DeviceList: - return DeviceList(devices=device_select(self.db_engine, request)) + return device_select(self.db_engine, request) @safe_and_metered_rpc_method(METRICS_POOL, LOGGER) def GetDeviceEvents(self, request : Empty, context : grpc.ServicerContext) -> Iterator[DeviceEvent]: - for message in self.messagebroker.consume({TOPIC_DEVICE}, consume_timeout=CONSUME_TIMEOUT): - yield DeviceEvent(**json.loads(message.content)) + for message in consume_events(self.messagebroker, {EventTopicEnum.DEVICE}): yield message @safe_and_metered_rpc_method(METRICS_POOL, LOGGER) def ListEndPointNames(self, request : EndPointIdList, context : grpc.ServicerContext) -> EndPointNameList: - return EndPointNameList(endpoint_names=endpoint_list_names(self.db_engine, request)) + return endpoint_list_names(self.db_engine, request) # ----- Link ------------------------------------------------------------------------------------------------------- @safe_and_metered_rpc_method(METRICS_POOL, LOGGER) def ListLinkIds(self, request : Empty, context : grpc.ServicerContext) -> LinkIdList: - return LinkIdList(link_ids=link_list_ids(self.db_engine)) + return link_list_ids(self.db_engine) @safe_and_metered_rpc_method(METRICS_POOL, LOGGER) def ListLinks(self, request : Empty, context : grpc.ServicerContext) -> LinkList: - return LinkList(links=link_list_objs(self.db_engine)) + return link_list_objs(self.db_engine) @safe_and_metered_rpc_method(METRICS_POOL, LOGGER) def GetLink(self, request : LinkId, context : grpc.ServicerContext) -> Link: - return Link(**link_get(self.db_engine, request)) + return link_get(self.db_engine, request) @safe_and_metered_rpc_method(METRICS_POOL, LOGGER) def SetLink(self, request : Link, context : grpc.ServicerContext) -> LinkId: - link_id,updated = link_set(self.db_engine, request) - event_type = EventTypeEnum.EVENTTYPE_UPDATE if updated else EventTypeEnum.EVENTTYPE_CREATE - notify_event(self.messagebroker, TOPIC_LINK, event_type, {'link_id': link_id}) - return LinkId(**link_id) + return link_set(self.db_engine, self.messagebroker, request) @safe_and_metered_rpc_method(METRICS_POOL, LOGGER) def RemoveLink(self, request : LinkId, context : grpc.ServicerContext) -> Empty: - link_id,deleted = link_delete(self.db_engine, request) - if deleted: - event_type = EventTypeEnum.EVENTTYPE_REMOVE - notify_event(self.messagebroker, TOPIC_LINK, event_type, {'link_id': link_id}) - return Empty() + return link_delete(self.db_engine, self.messagebroker, request) @safe_and_metered_rpc_method(METRICS_POOL, LOGGER) def GetLinkEvents(self, request : Empty, context : grpc.ServicerContext) -> Iterator[LinkEvent]: - for message in self.messagebroker.consume({TOPIC_LINK}, consume_timeout=CONSUME_TIMEOUT): - yield LinkEvent(**json.loads(message.content)) + for message in consume_events(self.messagebroker, {EventTopicEnum.LINK}): yield message # ----- Service ---------------------------------------------------------------------------------------------------- @safe_and_metered_rpc_method(METRICS_POOL, LOGGER) def ListServiceIds(self, request : ContextId, context : grpc.ServicerContext) -> ServiceIdList: - return ServiceIdList(service_ids=service_list_ids(self.db_engine, request)) + return service_list_ids(self.db_engine, request) @safe_and_metered_rpc_method(METRICS_POOL, LOGGER) def ListServices(self, request : ContextId, context : grpc.ServicerContext) -> ServiceList: - return ServiceList(services=service_list_objs(self.db_engine, request)) + return service_list_objs(self.db_engine, request) @safe_and_metered_rpc_method(METRICS_POOL, LOGGER) def GetService(self, request : ServiceId, context : grpc.ServicerContext) -> Service: - return Service(**service_get(self.db_engine, request)) + return service_get(self.db_engine, request) @safe_and_metered_rpc_method(METRICS_POOL, LOGGER) def SetService(self, request : Service, context : grpc.ServicerContext) -> ServiceId: - service_id,updated = service_set(self.db_engine, request) - event_type = EventTypeEnum.EVENTTYPE_UPDATE if updated else EventTypeEnum.EVENTTYPE_CREATE - notify_event(self.messagebroker, TOPIC_SERVICE, event_type, {'service_id': service_id}) - return ServiceId(**service_id) + return service_set(self.db_engine, self.messagebroker, request) @safe_and_metered_rpc_method(METRICS_POOL, LOGGER) def UnsetService(self, request : Service, context : grpc.ServicerContext) -> ServiceId: - service_id,updated = service_unset(self.db_engine, request) - if updated: - event_type = EventTypeEnum.EVENTTYPE_UPDATE - notify_event(self.messagebroker, TOPIC_SERVICE, event_type, {'service_id': service_id}) - return ServiceId(**service_id) + return service_unset(self.db_engine, self.messagebroker, request) @safe_and_metered_rpc_method(METRICS_POOL, LOGGER) def RemoveService(self, request : ServiceId, context : grpc.ServicerContext) -> Empty: - service_id,deleted = service_delete(self.db_engine, request) - if deleted: - event_type = EventTypeEnum.EVENTTYPE_REMOVE - notify_event(self.messagebroker, TOPIC_SERVICE, event_type, {'service_id': service_id}) - return Empty() + return service_delete(self.db_engine, self.messagebroker, request) @safe_and_metered_rpc_method(METRICS_POOL, LOGGER) def SelectService(self, request : ServiceFilter, context : grpc.ServicerContext) -> ServiceList: - return ServiceList(services=service_select(self.db_engine, request)) + return service_select(self.db_engine, request) @safe_and_metered_rpc_method(METRICS_POOL, LOGGER) def GetServiceEvents(self, request : Empty, context : grpc.ServicerContext) -> Iterator[ServiceEvent]: - for message in self.messagebroker.consume({TOPIC_SERVICE}, consume_timeout=CONSUME_TIMEOUT): - yield ServiceEvent(**json.loads(message.content)) + for message in consume_events(self.messagebroker, {EventTopicEnum.SERVICE}): yield message # ----- Slice ---------------------------------------------------------------------------------------------------- @safe_and_metered_rpc_method(METRICS_POOL, LOGGER) def ListSliceIds(self, request : ContextId, context : grpc.ServicerContext) -> SliceIdList: - return SliceIdList(slice_ids=slice_list_ids(self.db_engine, request)) + return slice_list_ids(self.db_engine, request) @safe_and_metered_rpc_method(METRICS_POOL, LOGGER) def ListSlices(self, request : ContextId, context : grpc.ServicerContext) -> SliceList: - return SliceList(slices=slice_list_objs(self.db_engine, request)) + return slice_list_objs(self.db_engine, request) @safe_and_metered_rpc_method(METRICS_POOL, LOGGER) def GetSlice(self, request : SliceId, context : grpc.ServicerContext) -> Slice: - return Slice(**slice_get(self.db_engine, request)) + return slice_get(self.db_engine, request) @safe_and_metered_rpc_method(METRICS_POOL, LOGGER) def SetSlice(self, request : Slice, context : grpc.ServicerContext) -> SliceId: - slice_id,updated = slice_set(self.db_engine, request) - event_type = EventTypeEnum.EVENTTYPE_UPDATE if updated else EventTypeEnum.EVENTTYPE_CREATE - notify_event(self.messagebroker, TOPIC_SLICE, event_type, {'slice_id': slice_id}) - return SliceId(**slice_id) + return slice_set(self.db_engine, self.messagebroker, request) @safe_and_metered_rpc_method(METRICS_POOL, LOGGER) def UnsetSlice(self, request : Slice, context : grpc.ServicerContext) -> SliceId: - slice_id,updated = slice_unset(self.db_engine, request) - if updated: - event_type = EventTypeEnum.EVENTTYPE_UPDATE - notify_event(self.messagebroker, TOPIC_SLICE, event_type, {'slice_id': slice_id}) - return SliceId(**slice_id) + return slice_unset(self.db_engine, self.messagebroker, request) @safe_and_metered_rpc_method(METRICS_POOL, LOGGER) def RemoveSlice(self, request : SliceId, context : grpc.ServicerContext) -> Empty: - slice_id,deleted = slice_delete(self.db_engine, request) - if deleted: - event_type = EventTypeEnum.EVENTTYPE_REMOVE - notify_event(self.messagebroker, TOPIC_SLICE, event_type, {'slice_id': slice_id}) - return Empty() + return slice_delete(self.db_engine, self.messagebroker, request) @safe_and_metered_rpc_method(METRICS_POOL, LOGGER) def SelectSlice(self, request : SliceFilter, context : grpc.ServicerContext) -> SliceList: - return SliceList(slices=slice_select(self.db_engine, request)) + return slice_select(self.db_engine, request) @safe_and_metered_rpc_method(METRICS_POOL, LOGGER) def GetSliceEvents(self, request : Empty, context : grpc.ServicerContext) -> Iterator[SliceEvent]: - for message in self.messagebroker.consume({TOPIC_SLICE}, consume_timeout=CONSUME_TIMEOUT): - yield SliceEvent(**json.loads(message.content)) + for message in consume_events(self.messagebroker, {EventTopicEnum.SLICE}): yield message # ----- Connection ------------------------------------------------------------------------------------------------- @safe_and_metered_rpc_method(METRICS_POOL, LOGGER) def ListConnectionIds(self, request : ServiceId, context : grpc.ServicerContext) -> ConnectionIdList: - return ConnectionIdList(connection_ids=connection_list_ids(self.db_engine, request)) + return connection_list_ids(self.db_engine, request) @safe_and_metered_rpc_method(METRICS_POOL, LOGGER) def ListConnections(self, request : ContextId, context : grpc.ServicerContext) -> ConnectionList: - return ConnectionList(connections=connection_list_objs(self.db_engine, request)) + return connection_list_objs(self.db_engine, request) @safe_and_metered_rpc_method(METRICS_POOL, LOGGER) def GetConnection(self, request : ConnectionId, context : grpc.ServicerContext) -> Connection: - return Connection(**connection_get(self.db_engine, request)) + return connection_get(self.db_engine, request) @safe_and_metered_rpc_method(METRICS_POOL, LOGGER) def SetConnection(self, request : Connection, context : grpc.ServicerContext) -> ConnectionId: - connection_id,updated = connection_set(self.db_engine, request) - event_type = EventTypeEnum.EVENTTYPE_UPDATE if updated else EventTypeEnum.EVENTTYPE_CREATE - notify_event(self.messagebroker, TOPIC_CONNECTION, event_type, {'connection_id': connection_id}) - return ConnectionId(**connection_id) + return connection_set(self.db_engine, self.messagebroker, request) @safe_and_metered_rpc_method(METRICS_POOL, LOGGER) def RemoveConnection(self, request : ConnectionId, context : grpc.ServicerContext) -> Empty: - connection_id,deleted = connection_delete(self.db_engine, request) - if deleted: - event_type = EventTypeEnum.EVENTTYPE_REMOVE - notify_event(self.messagebroker, TOPIC_CONNECTION, event_type, {'connection_id': connection_id}) - return Empty() + return connection_delete(self.db_engine, self.messagebroker, request) @safe_and_metered_rpc_method(METRICS_POOL, LOGGER) def GetConnectionEvents(self, request : Empty, context : grpc.ServicerContext) -> Iterator[ConnectionEvent]: - for message in self.messagebroker.consume({TOPIC_CONNECTION}, consume_timeout=CONSUME_TIMEOUT): - yield ConnectionEvent(**json.loads(message.content)) + for message in consume_events(self.messagebroker, {EventTopicEnum.CONNECTION}): yield message - # ----- Policy ----------------------------------------------------------------------------------------------------- + # ----- Policy Rule ------------------------------------------------------------------------------------------------ @safe_and_metered_rpc_method(METRICS_POOL, LOGGER) def ListPolicyRuleIds(self, request : Empty, context: grpc.ServicerContext) -> PolicyRuleIdList: - return PolicyRuleIdList(policyRuleIdList=policyrule_list_ids(self.db_engine)) + return policyrule_list_ids(self.db_engine) @safe_and_metered_rpc_method(METRICS_POOL, LOGGER) def ListPolicyRules(self, request : Empty, context: grpc.ServicerContext) -> PolicyRuleList: - return PolicyRuleList(policyRules=policyrule_list_objs(self.db_engine)) + return policyrule_list_objs(self.db_engine) @safe_and_metered_rpc_method(METRICS_POOL, LOGGER) def GetPolicyRule(self, request : PolicyRuleId, context: grpc.ServicerContext) -> PolicyRule: - return PolicyRule(**policyrule_get(self.db_engine, request)) + return policyrule_get(self.db_engine, request) @safe_and_metered_rpc_method(METRICS_POOL, LOGGER) def SetPolicyRule(self, request : PolicyRule, context: grpc.ServicerContext) -> PolicyRuleId: - policyrule_id,updated = policyrule_set(self.db_engine, request) - event_type = EventTypeEnum.EVENTTYPE_UPDATE if updated else EventTypeEnum.EVENTTYPE_CREATE - notify_event(self.messagebroker, TOPIC_POLICY, event_type, {'policyrule_id': policyrule_id}) - return PolicyRuleId(**policyrule_id) + return policyrule_set(self.db_engine, self.messagebroker, request) @safe_and_metered_rpc_method(METRICS_POOL, LOGGER) def RemovePolicyRule(self, request : PolicyRuleId, context: grpc.ServicerContext) -> Empty: - policyrule_id,deleted = policyrule_delete(self.db_engine, request) - if deleted: - event_type = EventTypeEnum.EVENTTYPE_REMOVE - notify_event(self.messagebroker, TOPIC_POLICY, event_type, {'policyrule_id': policyrule_id}) - return Empty() + return policyrule_delete(self.db_engine, self.messagebroker, request) diff --git a/src/context/service/Events.py b/src/context/service/Events.py deleted file mode 100644 index 5d20f144c93385c769dbd8526cb10b8088eee728..0000000000000000000000000000000000000000 --- a/src/context/service/Events.py +++ /dev/null @@ -1,42 +0,0 @@ -# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import json, time -from typing import Dict -from common.message_broker.Message import Message -from common.message_broker.MessageBroker import MessageBroker -from common.proto.context_pb2 import EventTypeEnum - -TOPIC_CONNECTION = 'connection' -TOPIC_CONTEXT = 'context' -TOPIC_DEVICE = 'device' -TOPIC_LINK = 'link' -TOPIC_POLICY = 'policy' -TOPIC_SERVICE = 'service' -TOPIC_SLICE = 'slice' -TOPIC_TOPOLOGY = 'topology' - -TOPICS = { - TOPIC_CONNECTION, TOPIC_CONTEXT, TOPIC_DEVICE, TOPIC_LINK, TOPIC_POLICY, TOPIC_SERVICE, TOPIC_SLICE, TOPIC_TOPOLOGY -} - -CONSUME_TIMEOUT = 0.5 # seconds - -def notify_event( - messagebroker : MessageBroker, topic_name : str, event_type : EventTypeEnum, fields : Dict[str, str] -) -> None: - event = {'event': {'timestamp': {'timestamp': time.time()}, 'event_type': event_type}} - for field_name, field_value in fields.items(): - event[field_name] = field_value - messagebroker.publish(Message(topic_name, json.dumps(event))) diff --git a/src/context/service/database/Component.py b/src/context/service/database/Component.py new file mode 100644 index 0000000000000000000000000000000000000000..ae873855b1c01c80c101eb4e97e3bf7688619fae --- /dev/null +++ b/src/context/service/database/Component.py @@ -0,0 +1,69 @@ +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import datetime, json, logging +from sqlalchemy import delete +from sqlalchemy.dialects.postgresql import insert +from sqlalchemy.orm import Session +from typing import Dict, List, Optional, Set +from common.proto.context_pb2 import Component +from common.proto.context_pb2 import ConfigRule +from common.tools.grpc.Tools import grpc_message_to_json_string +from .models.ComponentModel import ComponentModel +from .uuids._Builder import get_uuid_from_string +from .uuids.EndPoint import endpoint_get_uuid +from sqlalchemy.engine import Engine +from sqlalchemy.orm import Session, selectinload, sessionmaker +from sqlalchemy_cockroachdb import run_transaction +from .models.ComponentModel import ComponentModel + +LOGGER = logging.getLogger(__name__) + +def compose_components_data( + components : List[Component], now : datetime.datetime, + device_uuid : Optional[str] = None, service_uuid : Optional[str] = None, slice_uuid : Optional[str] = None +) -> List[Dict]: + dict_components : List[Dict] = list() + for position,component in enumerate(components): + str_kind = component.WhichOneof('config_rule') + message = (grpc_message_to_json_string(getattr(component, str_kind, {}))) + data = json.loads(message) + resource_key = data["resource_key"] + resource_value = data["resource_value"] + if '/inventory' in resource_key: + resource_value_data = json.loads(resource_value) + name = resource_value_data.pop('name', None) + type_ = resource_value_data.pop('class', None) + parent = resource_value_data.pop('parent-component-references', None) + attributes = resource_value_data.pop('attributes', {}) + if len(resource_value_data) > 0: + LOGGER.warning('Discarding Component Leftovers: {:s}'.format(str(resource_value_data))) + + attributes = { + attr_name:json.dumps(attr_value) + for attr_name,attr_value in attributes.items() + } + component_uuid = get_uuid_from_string(component.custom.resource_key, prefix_for_name=device_uuid) + dict_component = { + 'component_uuid': component_uuid, + 'device_uuid' : device_uuid, + 'name' : name, + 'type' : type_, + 'attributes' : json.dumps(attributes), + 'parent' : parent, + 'created_at' : now, + 'updated_at' : now, + } + dict_components.append(dict_component) + return dict_components diff --git a/src/context/service/database/Connection.py b/src/context/service/database/Connection.py index 80d3b3a6d437986741ee5308205d8a902e897c40..0a659f662c5ca4116211b7939afc3f5fe39b835c 100644 --- a/src/context/service/database/Connection.py +++ b/src/context/service/database/Connection.py @@ -19,7 +19,9 @@ from sqlalchemy.exc import IntegrityError from sqlalchemy.orm import Session, selectinload, sessionmaker from sqlalchemy_cockroachdb import run_transaction from typing import Dict, List, Optional, Tuple -from common.proto.context_pb2 import Connection, ConnectionId, ServiceId +from common.proto.context_pb2 import ( + Connection, ConnectionId, ConnectionIdList, ConnectionList, Empty, EventTypeEnum, ServiceId) +from common.message_broker.MessageBroker import MessageBroker from common.method_wrappers.ServiceExceptions import NotFoundException from common.tools.grpc.Tools import grpc_message_to_json_string from common.tools.object_factory.Connection import json_connection_id @@ -27,17 +29,19 @@ from .models.ConnectionModel import ConnectionEndPointModel, ConnectionModel, Co from .uuids.Connection import connection_get_uuid from .uuids.EndPoint import endpoint_get_uuid from .uuids.Service import service_get_uuid +from .Events import notify_event_connection LOGGER = logging.getLogger(__name__) -def connection_list_ids(db_engine : Engine, request : ServiceId) -> List[Dict]: +def connection_list_ids(db_engine : Engine, request : ServiceId) -> ConnectionIdList: _,service_uuid = service_get_uuid(request, allow_random=False) def callback(session : Session) -> List[Dict]: obj_list : List[ConnectionModel] = session.query(ConnectionModel).filter_by(service_uuid=service_uuid).all() return [obj.dump_id() for obj in obj_list] - return run_transaction(sessionmaker(bind=db_engine), callback) + connection_ids = run_transaction(sessionmaker(bind=db_engine), callback) + return ConnectionIdList(connection_ids=connection_ids) -def connection_list_objs(db_engine : Engine, request : ServiceId) -> List[Dict]: +def connection_list_objs(db_engine : Engine, request : ServiceId) -> ConnectionList: _,service_uuid = service_get_uuid(request, allow_random=False) def callback(session : Session) -> List[Dict]: obj_list : List[ConnectionModel] = session.query(ConnectionModel)\ @@ -46,9 +50,10 @@ def connection_list_objs(db_engine : Engine, request : ServiceId) -> List[Dict]: .options(selectinload(ConnectionModel.connection_subservices))\ .filter_by(service_uuid=service_uuid).all() return [obj.dump() for obj in obj_list] - return run_transaction(sessionmaker(bind=db_engine), callback) + connections = run_transaction(sessionmaker(bind=db_engine), callback) + return ConnectionList(connections=connections) -def connection_get(db_engine : Engine, request : ConnectionId) -> Dict: +def connection_get(db_engine : Engine, request : ConnectionId) -> Connection: connection_uuid = connection_get_uuid(request, allow_random=False) def callback(session : Session) -> Optional[Dict]: obj : Optional[ConnectionModel] = session.query(ConnectionModel)\ @@ -62,9 +67,9 @@ def connection_get(db_engine : Engine, request : ConnectionId) -> Dict: raise NotFoundException('Connection', request.connection_uuid.uuid, extra_details=[ 'connection_uuid generated was: {:s}'.format(connection_uuid), ]) - return obj + return Connection(**obj) -def connection_set(db_engine : Engine, request : Connection) -> Tuple[Dict, bool]: +def connection_set(db_engine : Engine, messagebroker : MessageBroker, request : Connection) -> ConnectionId: connection_uuid = connection_get_uuid(request.connection_id, allow_random=True) _,service_uuid = service_get_uuid(request.service_id, allow_random=False) settings = grpc_message_to_json_string(request.settings), @@ -143,12 +148,18 @@ def connection_set(db_engine : Engine, request : Connection) -> Tuple[Dict, bool return updated updated = run_transaction(sessionmaker(bind=db_engine), callback) - return json_connection_id(connection_uuid),updated + connection_id = json_connection_id(connection_uuid) + event_type = EventTypeEnum.EVENTTYPE_UPDATE if updated else EventTypeEnum.EVENTTYPE_CREATE + notify_event_connection(messagebroker, event_type, connection_id) + return ConnectionId(**connection_id) -def connection_delete(db_engine : Engine, request : ConnectionId) -> Tuple[Dict, bool]: +def connection_delete(db_engine : Engine, messagebroker : MessageBroker, request : ConnectionId) -> Tuple[Dict, bool]: connection_uuid = connection_get_uuid(request, allow_random=False) def callback(session : Session) -> bool: num_deleted = session.query(ConnectionModel).filter_by(connection_uuid=connection_uuid).delete() return num_deleted > 0 deleted = run_transaction(sessionmaker(bind=db_engine), callback) - return json_connection_id(connection_uuid),deleted + connection_id = json_connection_id(connection_uuid) + if deleted: + notify_event_connection(messagebroker, EventTypeEnum.EVENTTYPE_REMOVE, connection_id) + return Empty() diff --git a/src/context/service/database/Context.py b/src/context/service/database/Context.py index 4654095034749e1de985705b242ba9fa05a82f6a..403dcd2320d0ce925a95e92331a634785cfa2289 100644 --- a/src/context/service/database/Context.py +++ b/src/context/service/database/Context.py @@ -17,22 +17,25 @@ from sqlalchemy.dialects.postgresql import insert from sqlalchemy.engine import Engine from sqlalchemy.orm import Session, selectinload, sessionmaker from sqlalchemy_cockroachdb import run_transaction -from typing import Dict, List, Optional, Tuple -from common.proto.context_pb2 import Context, ContextId +from typing import Dict, List, Optional +from common.proto.context_pb2 import Context, ContextId, ContextIdList, ContextList, Empty, EventTypeEnum +from common.message_broker.MessageBroker import MessageBroker from common.method_wrappers.ServiceExceptions import NotFoundException from common.tools.object_factory.Context import json_context_id from .models.ContextModel import ContextModel from .uuids.Context import context_get_uuid +from .Events import notify_event_context LOGGER = logging.getLogger(__name__) -def context_list_ids(db_engine : Engine) -> List[Dict]: +def context_list_ids(db_engine : Engine) -> ContextIdList: def callback(session : Session) -> List[Dict]: obj_list : List[ContextModel] = session.query(ContextModel).all() return [obj.dump_id() for obj in obj_list] - return run_transaction(sessionmaker(bind=db_engine), callback) + context_ids = run_transaction(sessionmaker(bind=db_engine), callback) + return ContextIdList(context_ids=context_ids) -def context_list_objs(db_engine : Engine) -> List[Dict]: +def context_list_objs(db_engine : Engine) -> ContextList: def callback(session : Session) -> List[Dict]: obj_list : List[ContextModel] = session.query(ContextModel)\ .options(selectinload(ContextModel.topologies))\ @@ -40,9 +43,10 @@ def context_list_objs(db_engine : Engine) -> List[Dict]: .options(selectinload(ContextModel.slices))\ .all() return [obj.dump() for obj in obj_list] - return run_transaction(sessionmaker(bind=db_engine), callback) + contexts = run_transaction(sessionmaker(bind=db_engine), callback) + return ContextList(contexts=contexts) -def context_get(db_engine : Engine, request : ContextId) -> Dict: +def context_get(db_engine : Engine, request : ContextId) -> Context: context_uuid = context_get_uuid(request, allow_random=False) def callback(session : Session) -> Optional[Dict]: obj : Optional[ContextModel] = session.query(ContextModel)\ @@ -57,9 +61,9 @@ def context_get(db_engine : Engine, request : ContextId) -> Dict: raise NotFoundException('Context', raw_context_uuid, extra_details=[ 'context_uuid generated was: {:s}'.format(context_uuid) ]) - return obj + return Context(**obj) -def context_set(db_engine : Engine, request : Context) -> Tuple[Dict, bool]: +def context_set(db_engine : Engine, messagebroker : MessageBroker, request : Context) -> ContextId: context_name = request.name if len(context_name) == 0: context_name = request.context_id.context_uuid.uuid context_uuid = context_get_uuid(request.context_id, context_name=context_name, allow_random=True) @@ -100,12 +104,18 @@ def context_set(db_engine : Engine, request : Context) -> Tuple[Dict, bool]: return updated_at > created_at updated = run_transaction(sessionmaker(bind=db_engine), callback) - return json_context_id(context_uuid),updated + event_type = EventTypeEnum.EVENTTYPE_UPDATE if updated else EventTypeEnum.EVENTTYPE_CREATE + context_id = json_context_id(context_uuid) + notify_event_context(messagebroker, event_type, context_id) + return ContextId(**context_id) -def context_delete(db_engine : Engine, request : ContextId) -> Tuple[Dict, bool]: +def context_delete(db_engine : Engine, messagebroker : MessageBroker, request : ContextId) -> Empty: context_uuid = context_get_uuid(request, allow_random=False) def callback(session : Session) -> bool: num_deleted = session.query(ContextModel).filter_by(context_uuid=context_uuid).delete() return num_deleted > 0 deleted = run_transaction(sessionmaker(bind=db_engine), callback) - return json_context_id(context_uuid),deleted + context_id = json_context_id(context_uuid) + if deleted: + notify_event_context(messagebroker, EventTypeEnum.EVENTTYPE_REMOVE, context_id) + return Empty() diff --git a/src/context/service/database/Device.py b/src/context/service/database/Device.py index 8560399cc705729685cbaa7c10399a0ec7589015..3aff20ade14532dcb7fbf8ec1033c084aaeead3c 100644 --- a/src/context/service/database/Device.py +++ b/src/context/service/database/Device.py @@ -19,46 +19,53 @@ from sqlalchemy.orm import Session, selectinload, sessionmaker from sqlalchemy_cockroachdb import run_transaction from typing import Dict, List, Optional, Set, Tuple from common.method_wrappers.ServiceExceptions import InvalidArgumentException, NotFoundException -from common.proto.context_pb2 import Device, DeviceFilter, DeviceId, TopologyId +from common.message_broker.MessageBroker import MessageBroker +from common.proto.context_pb2 import ( + Device, DeviceFilter, DeviceId, DeviceIdList, DeviceList, Empty, EventTypeEnum, TopologyId) from common.tools.grpc.Tools import grpc_message_to_json_string from common.tools.object_factory.Device import json_device_id from context.service.database.uuids.Topology import topology_get_uuid from .models.DeviceModel import DeviceModel from .models.EndPointModel import EndPointModel -from .models.TopologyModel import TopologyDeviceModel +from .models.ComponentModel import ComponentModel +from .models.TopologyModel import TopologyDeviceModel, TopologyModel from .models.enums.DeviceDriver import grpc_to_enum__device_driver from .models.enums.DeviceOperationalStatus import grpc_to_enum__device_operational_status from .models.enums.KpiSampleType import grpc_to_enum__kpi_sample_type from .uuids.Device import device_get_uuid from .uuids.EndPoint import endpoint_get_uuid from .ConfigRule import compose_config_rules_data, upsert_config_rules +from .Component import compose_components_data +from .Events import notify_event_context, notify_event_device, notify_event_topology LOGGER = logging.getLogger(__name__) -def device_list_ids(db_engine : Engine) -> List[Dict]: +def device_list_ids(db_engine : Engine) -> DeviceIdList: def callback(session : Session) -> List[Dict]: obj_list : List[DeviceModel] = session.query(DeviceModel).all() return [obj.dump_id() for obj in obj_list] - return run_transaction(sessionmaker(bind=db_engine), callback) + device_ids = run_transaction(sessionmaker(bind=db_engine), callback) + return DeviceIdList(device_ids=device_ids) -def device_list_objs(db_engine : Engine) -> List[Dict]: +def device_list_objs(db_engine : Engine) -> DeviceList: def callback(session : Session) -> List[Dict]: obj_list : List[DeviceModel] = session.query(DeviceModel)\ .options(selectinload(DeviceModel.endpoints))\ .options(selectinload(DeviceModel.config_rules))\ + .options(selectinload(DeviceModel.components))\ .all() - #.options(selectinload(DeviceModel.components))\ return [obj.dump() for obj in obj_list] - return run_transaction(sessionmaker(bind=db_engine), callback) + devices = run_transaction(sessionmaker(bind=db_engine), callback) + return DeviceList(devices=devices) -def device_get(db_engine : Engine, request : DeviceId) -> Dict: +def device_get(db_engine : Engine, request : DeviceId) -> Device: device_uuid = device_get_uuid(request, allow_random=False) def callback(session : Session) -> Optional[Dict]: obj : Optional[DeviceModel] = session.query(DeviceModel)\ .options(selectinload(DeviceModel.endpoints))\ .options(selectinload(DeviceModel.config_rules))\ + .options(selectinload(DeviceModel.components))\ .filter_by(device_uuid=device_uuid).one_or_none() - #.options(selectinload(DeviceModel.components))\ return None if obj is None else obj.dump() obj = run_transaction(sessionmaker(bind=db_engine), callback) if obj is None: @@ -66,9 +73,9 @@ def device_get(db_engine : Engine, request : DeviceId) -> Dict: raise NotFoundException('Device', raw_device_uuid, extra_details=[ 'device_uuid generated was: {:s}'.format(device_uuid) ]) - return obj + return Device(**obj) -def device_set(db_engine : Engine, request : Device) -> Tuple[Dict, bool]: +def device_set(db_engine : Engine, messagebroker : MessageBroker, request : Device) -> DeviceId: raw_device_uuid = request.device_id.device_uuid.uuid raw_device_name = request.name device_name = raw_device_uuid if len(raw_device_name) == 0 else raw_device_name @@ -133,7 +140,8 @@ def device_set(db_engine : Engine, request : Device) -> Tuple[Dict, bool]: }) topology_uuids.add(endpoint_topology_uuid) - config_rules = compose_config_rules_data(request.device_config.config_rules, now, device_uuid=device_uuid) + components_data = compose_components_data(request.device_config.config_rules, now, device_uuid=device_uuid) + config_rules = compose_config_rules_data(request.device_config.config_rules, now, device_uuid=device_uuid) device_data = [{ 'device_uuid' : device_uuid, @@ -148,7 +156,7 @@ def device_set(db_engine : Engine, request : Device) -> Tuple[Dict, bool]: if controller_uuid is not None: device_data[0]['controller_uuid'] = controller_uuid - def callback(session : Session) -> bool: + def callback(session : Session) -> Tuple[bool, List[Dict]]: stmt = insert(DeviceModel).values(device_data) stmt = stmt.on_conflict_do_update( index_elements=[DeviceModel.device_uuid], @@ -180,29 +188,103 @@ def device_set(db_engine : Engine, request : Device) -> Tuple[Dict, bool]: endpoint_updates = session.execute(stmt).fetchall() updated_endpoints = any([(updated_at > created_at) for created_at,updated_at in endpoint_updates]) + device_topology_ids = [] if not updated or len(related_topologies) > 1: # Only update topology-device relations when device is created (not updated) or when endpoints are # modified (len(related_topologies) > 1). - session.execute(insert(TopologyDeviceModel).values(related_topologies).on_conflict_do_nothing( + stmt = insert(TopologyDeviceModel).values(related_topologies) + stmt = stmt.on_conflict_do_nothing( index_elements=[TopologyDeviceModel.topology_uuid, TopologyDeviceModel.device_uuid] - )) + ) + stmt = stmt.returning(TopologyDeviceModel.topology_uuid) + topology_uuids = session.execute(stmt).fetchall() + + LOGGER.warning('RAW topology_uuids={:s}'.format(str(topology_uuids))) + if len(topology_uuids) > 0: + topology_uuids = [topology_uuid[0] for topology_uuid in topology_uuids] + LOGGER.warning('NEW topology_uuids={:s}'.format(str(topology_uuids))) + query = session.query(TopologyModel) + query = query.filter(TopologyModel.topology_uuid.in_(topology_uuids)) + device_topologies : List[TopologyModel] = query.all() + device_topology_ids = [obj.dump_id() for obj in device_topologies] + LOGGER.warning('device_topology_ids={:s}'.format(str(device_topology_ids))) + updated_components = False + + if len(components_data) > 0: + stmt = insert(ComponentModel).values(components_data) + stmt = stmt.on_conflict_do_update( + index_elements=[ComponentModel.component_uuid], + set_=dict( + name = stmt.excluded.name, + type = stmt.excluded.type, + attributes = stmt.excluded.attributes, + parent = stmt.excluded.parent, + updated_at = stmt.excluded.updated_at, + ) + ) + stmt = stmt.returning(ComponentModel.created_at, ComponentModel.updated_at) + component_updates = session.execute(stmt).fetchall() + updated_components = any([(updated_at > created_at) for created_at,updated_at in component_updates]) + changed_config_rules = upsert_config_rules(session, config_rules, device_uuid=device_uuid) - return updated or updated_endpoints or changed_config_rules + return updated or updated_endpoints or changed_config_rules, device_topology_ids - updated = run_transaction(sessionmaker(bind=db_engine), callback) - return json_device_id(device_uuid),updated + updated, device_topology_ids = run_transaction(sessionmaker(bind=db_engine), callback) + device_id = json_device_id(device_uuid) + event_type = EventTypeEnum.EVENTTYPE_UPDATE if updated else EventTypeEnum.EVENTTYPE_CREATE + notify_event_device(messagebroker, event_type, device_id) -def device_delete(db_engine : Engine, request : DeviceId) -> Tuple[Dict, bool]: + context_ids : Dict[str, Dict] = dict() + topology_ids : Dict[str, Dict] = dict() + for topology_id in device_topology_ids: + topology_uuid = topology_id['topology_uuid']['uuid'] + topology_ids[topology_uuid] = topology_id + context_id = topology_id['context_id'] + context_uuid = context_id['context_uuid']['uuid'] + context_ids[context_uuid] = context_id + + for topology_id in topology_ids.values(): + notify_event_topology(messagebroker, EventTypeEnum.EVENTTYPE_UPDATE, topology_id) + + for context_id in context_ids.values(): + notify_event_context(messagebroker, EventTypeEnum.EVENTTYPE_UPDATE, context_id) + + return DeviceId(**device_id) + +def device_delete(db_engine : Engine, messagebroker : MessageBroker, request : DeviceId) -> Empty: device_uuid = device_get_uuid(request, allow_random=False) - def callback(session : Session) -> bool: + def callback(session : Session) -> Tuple[bool, List[Dict]]: + query = session.query(TopologyDeviceModel) + query = query.filter_by(device_uuid=device_uuid) + topology_device_list : List[TopologyDeviceModel] = query.all() + topology_ids = [obj.topology.dump_id() for obj in topology_device_list] num_deleted = session.query(DeviceModel).filter_by(device_uuid=device_uuid).delete() - return num_deleted > 0 - deleted = run_transaction(sessionmaker(bind=db_engine), callback) - return json_device_id(device_uuid),deleted + return num_deleted > 0, topology_ids + deleted, updated_topology_ids = run_transaction(sessionmaker(bind=db_engine), callback) + device_id = json_device_id(device_uuid) + if deleted: + notify_event_device(messagebroker, EventTypeEnum.EVENTTYPE_REMOVE, device_id) + + context_ids : Dict[str, Dict] = dict() + topology_ids : Dict[str, Dict] = dict() + for topology_id in updated_topology_ids: + topology_uuid = topology_id['topology_uuid']['uuid'] + topology_ids[topology_uuid] = topology_id + context_id = topology_id['context_id'] + context_uuid = context_id['context_uuid']['uuid'] + context_ids[context_uuid] = context_id + + for topology_id in topology_ids.values(): + notify_event_topology(messagebroker, EventTypeEnum.EVENTTYPE_UPDATE, topology_id) + + for context_id in context_ids.values(): + notify_event_context(messagebroker, EventTypeEnum.EVENTTYPE_UPDATE, context_id) + + return Empty() -def device_select(db_engine : Engine, request : DeviceFilter) -> List[Dict]: +def device_select(db_engine : Engine, request : DeviceFilter) -> DeviceList: device_uuids = [ device_get_uuid(device_id, allow_random=False) for device_id in request.device_ids.device_ids @@ -219,4 +301,5 @@ def device_select(db_engine : Engine, request : DeviceFilter) -> List[Dict]: #if request.include_components : query = query.options(selectinload(DeviceModel.components)) obj_list : List[DeviceModel] = query.filter(DeviceModel.device_uuid.in_(device_uuids)).all() return [obj.dump(**dump_params) for obj in obj_list] - return run_transaction(sessionmaker(bind=db_engine), callback) + devices = run_transaction(sessionmaker(bind=db_engine), callback) + return DeviceList(devices=devices) \ No newline at end of file diff --git a/src/context/service/database/EndPoint.py b/src/context/service/database/EndPoint.py index b0df3bb8101a7b64a148e916178b1c9a77d511af..d7445b951dbd2d846900c21799e2fc03164ae6c5 100644 --- a/src/context/service/database/EndPoint.py +++ b/src/context/service/database/EndPoint.py @@ -17,13 +17,13 @@ from sqlalchemy.engine import Engine from sqlalchemy.orm import Session, selectinload, sessionmaker from sqlalchemy_cockroachdb import run_transaction from typing import Dict, List -from common.proto.context_pb2 import EndPointIdList +from common.proto.context_pb2 import EndPointIdList, EndPointNameList from .models.EndPointModel import EndPointModel from .uuids.EndPoint import endpoint_get_uuid LOGGER = logging.getLogger(__name__) -def endpoint_list_names(db_engine : Engine, request : EndPointIdList) -> List[Dict]: +def endpoint_list_names(db_engine : Engine, request : EndPointIdList) -> EndPointNameList: endpoint_uuids = { endpoint_get_uuid(endpoint_id, allow_random=False)[-1] for endpoint_id in request.endpoint_ids @@ -33,4 +33,5 @@ def endpoint_list_names(db_engine : Engine, request : EndPointIdList) -> List[Di .options(selectinload(EndPointModel.device))\ .filter(EndPointModel.endpoint_uuid.in_(endpoint_uuids)).all() return [obj.dump_name() for obj in obj_list] - return run_transaction(sessionmaker(bind=db_engine), callback) + endpoint_names = run_transaction(sessionmaker(bind=db_engine), callback) + return EndPointNameList(endpoint_names=endpoint_names) diff --git a/src/context/service/database/Events.py b/src/context/service/database/Events.py new file mode 100644 index 0000000000000000000000000000000000000000..36774a5170ba20914555b0adc47a5c2faa592799 --- /dev/null +++ b/src/context/service/database/Events.py @@ -0,0 +1,89 @@ +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT 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 enum, json, logging, time +from typing import Dict, Iterator, Set +from common.message_broker.Message import Message +from common.message_broker.MessageBroker import MessageBroker +from common.proto.context_pb2 import ( + ConnectionEvent, ContextEvent, DeviceEvent, EventTypeEnum, LinkEvent, ServiceEvent, SliceEvent, TopologyEvent) + +class EventTopicEnum(enum.Enum): + CONNECTION = 'connection' + CONTEXT = 'context' + DEVICE = 'device' + LINK = 'link' + POLICY_RULE = 'policy-rule' + SERVICE = 'service' + SLICE = 'slice' + TOPOLOGY = 'topology' + +TOPIC_TO_EVENTCLASS = { + EventTopicEnum.CONNECTION.value : ConnectionEvent, + EventTopicEnum.CONTEXT.value : ContextEvent, + EventTopicEnum.DEVICE.value : DeviceEvent, + EventTopicEnum.LINK.value : LinkEvent, + #EventTopicEnum.POLICY_RULE.value : PolicyRuleEvent, # Not defined in proto files + EventTopicEnum.SERVICE.value : ServiceEvent, + EventTopicEnum.SLICE.value : SliceEvent, + EventTopicEnum.TOPOLOGY.value : TopologyEvent, +} + +CONSUME_TIMEOUT = 0.5 # seconds + +LOGGER = logging.getLogger(__name__) + +def notify_event( + messagebroker : MessageBroker, topic_enum : EventTopicEnum, event_type : EventTypeEnum, fields : Dict[str, str] +) -> None: + event = {'event': {'timestamp': {'timestamp': time.time()}, 'event_type': event_type}} + for field_name, field_value in fields.items(): + event[field_name] = field_value + messagebroker.publish(Message(topic_enum.value, json.dumps(event))) + +def notify_event_context(messagebroker : MessageBroker, event_type : EventTypeEnum, context_id : Dict) -> None: + notify_event(messagebroker, EventTopicEnum.CONTEXT, event_type, {'context_id': context_id}) + +def notify_event_topology(messagebroker : MessageBroker, event_type : EventTypeEnum, topology_id : Dict) -> None: + notify_event(messagebroker, EventTopicEnum.TOPOLOGY, event_type, {'topology_id': topology_id}) + +def notify_event_device(messagebroker : MessageBroker, event_type : EventTypeEnum, device_id : Dict) -> None: + notify_event(messagebroker, EventTopicEnum.DEVICE, event_type, {'device_id': device_id}) + +def notify_event_link(messagebroker : MessageBroker, event_type : EventTypeEnum, link_id : Dict) -> None: + notify_event(messagebroker, EventTopicEnum.LINK, event_type, {'link_id': link_id}) + +def notify_event_service(messagebroker : MessageBroker, event_type : EventTypeEnum, service_id : Dict) -> None: + notify_event(messagebroker, EventTopicEnum.SERVICE, event_type, {'service_id': service_id}) + +def notify_event_slice(messagebroker : MessageBroker, event_type : EventTypeEnum, slice_id : Dict) -> None: + notify_event(messagebroker, EventTopicEnum.SLICE, event_type, {'slice_id': slice_id}) + +def notify_event_connection(messagebroker : MessageBroker, event_type : EventTypeEnum, connection_id : Dict) -> None: + notify_event(messagebroker, EventTopicEnum.CONNECTION, event_type, {'connection_id': connection_id}) + +def notify_event_policy_rule(messagebroker : MessageBroker, event_type : EventTypeEnum, policyrule_id : Dict) -> None: + notify_event(messagebroker, EventTopicEnum.POLICY_RULE, event_type, {'policyrule_id': policyrule_id}) + +def consume_events( + messagebroker : MessageBroker, topic_enums : Set[EventTopicEnum], consume_timeout : float = CONSUME_TIMEOUT +) -> Iterator: + topic_names = [topic_enum.value for topic_enum in topic_enums] + for message in messagebroker.consume(topic_names, consume_timeout=consume_timeout): + event_class = TOPIC_TO_EVENTCLASS.get(message.topic) + if event_class is None: + MSG = 'No EventClass defined for Topic({:s}). Ignoring...' + LOGGER.warning(MSG.format(str(message.topic))) + continue + yield event_class(**json.loads(message.content)) diff --git a/src/context/service/database/Link.py b/src/context/service/database/Link.py index 76db07a9e30b4f62c4b51574ad95c222a1490f79..e2060c4542bebad82b1ed83dbcce612114862ae7 100644 --- a/src/context/service/database/Link.py +++ b/src/context/service/database/Link.py @@ -18,32 +18,36 @@ from sqlalchemy.engine import Engine from sqlalchemy.orm import Session, selectinload, sessionmaker from sqlalchemy_cockroachdb import run_transaction from typing import Dict, List, Optional, Set, Tuple -from common.proto.context_pb2 import Link, LinkId, TopologyId +from common.proto.context_pb2 import Empty, EventTypeEnum, Link, LinkId, LinkIdList, LinkList, TopologyId +from common.message_broker.MessageBroker import MessageBroker from common.method_wrappers.ServiceExceptions import NotFoundException from common.tools.object_factory.Link import json_link_id from context.service.database.uuids.Topology import topology_get_uuid from .models.LinkModel import LinkModel, LinkEndPointModel -from .models.TopologyModel import TopologyLinkModel +from .models.TopologyModel import TopologyLinkModel, TopologyModel from .uuids.EndPoint import endpoint_get_uuid from .uuids.Link import link_get_uuid +from .Events import notify_event_context, notify_event_link, notify_event_topology LOGGER = logging.getLogger(__name__) -def link_list_ids(db_engine : Engine) -> List[Dict]: +def link_list_ids(db_engine : Engine) -> LinkIdList: def callback(session : Session) -> List[Dict]: obj_list : List[LinkModel] = session.query(LinkModel).all() return [obj.dump_id() for obj in obj_list] - return run_transaction(sessionmaker(bind=db_engine), callback) + link_ids = run_transaction(sessionmaker(bind=db_engine), callback) + return LinkIdList(link_ids=link_ids) -def link_list_objs(db_engine : Engine) -> List[Dict]: +def link_list_objs(db_engine : Engine) -> LinkList: def callback(session : Session) -> List[Dict]: obj_list : List[LinkModel] = session.query(LinkModel)\ .options(selectinload(LinkModel.link_endpoints))\ .all() return [obj.dump() for obj in obj_list] - return run_transaction(sessionmaker(bind=db_engine), callback) + links = run_transaction(sessionmaker(bind=db_engine), callback) + return LinkList(links=links) -def link_get(db_engine : Engine, request : LinkId) -> Dict: +def link_get(db_engine : Engine, request : LinkId) -> Link: link_uuid = link_get_uuid(request, allow_random=False) def callback(session : Session) -> Optional[Dict]: obj : Optional[LinkModel] = session.query(LinkModel)\ @@ -56,9 +60,9 @@ def link_get(db_engine : Engine, request : LinkId) -> Dict: raise NotFoundException('Link', raw_link_uuid, extra_details=[ 'link_uuid generated was: {:s}'.format(link_uuid) ]) - return obj + return Link(**obj) -def link_set(db_engine : Engine, request : Link) -> Tuple[Dict, bool]: +def link_set(db_engine : Engine, messagebroker : MessageBroker, request : Link) -> LinkId: raw_link_uuid = request.link_id.link_uuid.uuid raw_link_name = request.name link_name = raw_link_uuid if len(raw_link_name) == 0 else raw_link_name @@ -95,48 +99,127 @@ def link_set(db_engine : Engine, request : Link) -> Tuple[Dict, bool]: }) topology_uuids.add(endpoint_topology_uuid) + total_capacity_gbps, used_capacity_gbps = None, None + if request.HasField('attributes'): + attributes = request.attributes + + # In proto3, HasField() does not work for scalar fields, using ListFields() instead. + attribute_names = set([field.name for field,_ in attributes.ListFields()]) + + if 'total_capacity_gbps' in attribute_names: + total_capacity_gbps = attributes.total_capacity_gbps + + if 'used_capacity_gbps' in attribute_names: + used_capacity_gbps = attributes.used_capacity_gbps + else: + used_capacity_gbps = 0.0 + link_data = [{ - 'link_uuid' : link_uuid, - 'link_name' : link_name, - 'created_at': now, - 'updated_at': now, + 'link_uuid' : link_uuid, + 'link_name' : link_name, + 'total_capacity_gbps' : total_capacity_gbps, + 'used_capacity_gbps' : used_capacity_gbps, + 'created_at' : now, + 'updated_at' : now, }] - def callback(session : Session) -> bool: + def callback(session : Session) -> Tuple[bool, List[Dict]]: stmt = insert(LinkModel).values(link_data) stmt = stmt.on_conflict_do_update( index_elements=[LinkModel.link_uuid], set_=dict( - link_name = stmt.excluded.link_name, - updated_at = stmt.excluded.updated_at, + link_name = stmt.excluded.link_name, + total_capacity_gbps = stmt.excluded.total_capacity_gbps, + used_capacity_gbps = stmt.excluded.used_capacity_gbps, + updated_at = stmt.excluded.updated_at, ) ) stmt = stmt.returning(LinkModel.created_at, LinkModel.updated_at) created_at,updated_at = session.execute(stmt).fetchone() updated = updated_at > created_at + updated_endpoints = False if len(link_endpoints_data) > 0: # TODO: manage add/remove of endpoints; manage changes in relations with topology stmt = insert(LinkEndPointModel).values(link_endpoints_data) stmt = stmt.on_conflict_do_nothing( index_elements=[LinkEndPointModel.link_uuid, LinkEndPointModel.endpoint_uuid] ) - session.execute(stmt) - - if len(related_topologies) > 0: - session.execute(insert(TopologyLinkModel).values(related_topologies).on_conflict_do_nothing( + link_endpoint_inserts = session.execute(stmt) + updated_endpoints = int(link_endpoint_inserts.rowcount) > 0 + + link_topology_ids = [] + if not updated or len(related_topologies) > 1: + # Only update topology-link relations when link is created (not updated) or when endpoint_ids are + # modified (len(related_topologies) > 1). + stmt = insert(TopologyLinkModel).values(related_topologies) + stmt = stmt.on_conflict_do_nothing( index_elements=[TopologyLinkModel.topology_uuid, TopologyLinkModel.link_uuid] - )) - - return updated - - updated = run_transaction(sessionmaker(bind=db_engine), callback) - return json_link_id(link_uuid),updated - -def link_delete(db_engine : Engine, request : LinkId) -> Tuple[Dict, bool]: + ) + stmt = stmt.returning(TopologyLinkModel.topology_uuid) + topology_uuids = session.execute(stmt).fetchall() + + LOGGER.warning('RAW topology_uuids={:s}'.format(str(topology_uuids))) + if len(topology_uuids) > 0: + topology_uuids = [topology_uuid[0] for topology_uuid in topology_uuids] + LOGGER.warning('NEW topology_uuids={:s}'.format(str(topology_uuids))) + query = session.query(TopologyModel) + query = query.filter(TopologyModel.topology_uuid.in_(topology_uuids)) + link_topologies : List[TopologyModel] = query.all() + link_topology_ids = [obj.dump_id() for obj in link_topologies] + LOGGER.warning('link_topology_ids={:s}'.format(str(link_topology_ids))) + + return updated or updated_endpoints, link_topology_ids + + updated, link_topology_ids = run_transaction(sessionmaker(bind=db_engine), callback) + link_id = json_link_id(link_uuid) + event_type = EventTypeEnum.EVENTTYPE_UPDATE if updated else EventTypeEnum.EVENTTYPE_CREATE + notify_event_link(messagebroker, event_type, link_id) + + context_ids : Dict[str, Dict] = dict() + topology_ids : Dict[str, Dict] = dict() + for topology_id in link_topology_ids: + topology_uuid = topology_id['topology_uuid']['uuid'] + topology_ids[topology_uuid] = topology_id + context_id = topology_id['context_id'] + context_uuid = context_id['context_uuid']['uuid'] + context_ids[context_uuid] = context_id + + for topology_id in topology_ids.values(): + notify_event_topology(messagebroker, EventTypeEnum.EVENTTYPE_UPDATE, topology_id) + + for context_id in context_ids.values(): + notify_event_context(messagebroker, EventTypeEnum.EVENTTYPE_UPDATE, context_id) + + return LinkId(**link_id) + +def link_delete(db_engine : Engine, messagebroker : MessageBroker, request : LinkId) -> Empty: link_uuid = link_get_uuid(request, allow_random=False) def callback(session : Session) -> bool: + query = session.query(TopologyLinkModel) + query = query.filter_by(link_uuid=link_uuid) + topology_link_list : List[TopologyLinkModel] = query.all() + topology_ids = [obj.topology.dump_id() for obj in topology_link_list] num_deleted = session.query(LinkModel).filter_by(link_uuid=link_uuid).delete() - return num_deleted > 0 - deleted = run_transaction(sessionmaker(bind=db_engine), callback) - return json_link_id(link_uuid),deleted + return num_deleted > 0, topology_ids + deleted, updated_topology_ids = run_transaction(sessionmaker(bind=db_engine), callback) + link_id = json_link_id(link_uuid) + if deleted: + notify_event_link(messagebroker, EventTypeEnum.EVENTTYPE_REMOVE, link_id) + + context_ids : Dict[str, Dict] = dict() + topology_ids : Dict[str, Dict] = dict() + for topology_id in updated_topology_ids: + topology_uuid = topology_id['topology_uuid']['uuid'] + topology_ids[topology_uuid] = topology_id + context_id = topology_id['context_id'] + context_uuid = context_id['context_uuid']['uuid'] + context_ids[context_uuid] = context_id + + for topology_id in topology_ids.values(): + notify_event_topology(messagebroker, EventTypeEnum.EVENTTYPE_UPDATE, topology_id) + + for context_id in context_ids.values(): + notify_event_context(messagebroker, EventTypeEnum.EVENTTYPE_UPDATE, context_id) + + return Empty() diff --git a/src/context/service/database/PolicyRule.py b/src/context/service/database/PolicyRule.py index 13f0a2698c17874e1e15f4d6a1d527d366141f56..3db0696a49cd851608d34797ce138ea0e63a1c51 100644 --- a/src/context/service/database/PolicyRule.py +++ b/src/context/service/database/PolicyRule.py @@ -12,13 +12,15 @@ # See the License for the specific language governing permissions and # limitations under the License. -import datetime, json +import datetime, json, logging from sqlalchemy.dialects.postgresql import insert from sqlalchemy.engine import Engine from sqlalchemy.orm import Session, selectinload, sessionmaker from sqlalchemy_cockroachdb import run_transaction -from typing import Dict, List, Optional, Set, Tuple +from typing import Dict, List, Optional, Set +from common.proto.context_pb2 import Empty, EventTypeEnum from common.proto.policy_pb2 import PolicyRule, PolicyRuleId, PolicyRuleIdList, PolicyRuleList +from common.message_broker.MessageBroker import MessageBroker from common.method_wrappers.ServiceExceptions import NotFoundException from common.tools.grpc.Tools import grpc_message_to_json from common.tools.object_factory.PolicyRule import json_policyrule_id @@ -27,21 +29,26 @@ from .models.enums.PolicyRuleState import grpc_to_enum__policyrule_state from .models.PolicyRuleModel import PolicyRuleDeviceModel, PolicyRuleKindEnum, PolicyRuleModel from .uuids.PolicuRule import policyrule_get_uuid from .uuids.Service import service_get_uuid +from .Events import notify_event_policy_rule -def policyrule_list_ids(db_engine : Engine) -> List[Dict]: +LOGGER = logging.getLogger(__name__) + +def policyrule_list_ids(db_engine : Engine) -> PolicyRuleIdList: def callback(session : Session) -> List[Dict]: obj_list : List[PolicyRuleModel] = session.query(PolicyRuleModel).all() return [obj.dump_id() for obj in obj_list] - return run_transaction(sessionmaker(bind=db_engine), callback) + policy_rule_ids = run_transaction(sessionmaker(bind=db_engine), callback) + return PolicyRuleIdList(policyRuleIdList=policy_rule_ids) -def policyrule_list_objs(db_engine : Engine) -> List[Dict]: +def policyrule_list_objs(db_engine : Engine) -> PolicyRuleList: def callback(session : Session) -> List[Dict]: obj_list : List[PolicyRuleModel] = session.query(PolicyRuleModel)\ .options(selectinload(PolicyRuleModel.policyrule_service))\ .options(selectinload(PolicyRuleModel.policyrule_devices))\ .all() return [obj.dump() for obj in obj_list] - return run_transaction(sessionmaker(bind=db_engine), callback) + policy_rules = run_transaction(sessionmaker(bind=db_engine), callback) + return PolicyRuleList(policyRules=policy_rules) def policyrule_get(db_engine : Engine, request : PolicyRuleId) -> PolicyRule: policyrule_uuid = policyrule_get_uuid(request, allow_random=False) @@ -57,9 +64,9 @@ def policyrule_get(db_engine : Engine, request : PolicyRuleId) -> PolicyRule: raise NotFoundException('PolicyRule', raw_policyrule_uuid, extra_details=[ 'policyrule_uuid generated was: {:s}'.format(policyrule_uuid) ]) - return obj + return PolicyRule(**obj) -def policyrule_set(db_engine : Engine, request : PolicyRule) -> Tuple[PolicyRuleId, bool]: +def policyrule_set(db_engine : Engine, messagebroker : MessageBroker, request : PolicyRule) -> PolicyRuleId: policyrule_kind = request.WhichOneof('policy_rule') policyrule_spec = getattr(request, policyrule_kind) policyrule_basic = policyrule_spec.policyRuleBasic @@ -130,12 +137,18 @@ def policyrule_set(db_engine : Engine, request : PolicyRule) -> Tuple[PolicyRule return updated updated = run_transaction(sessionmaker(bind=db_engine), callback) - return json_policyrule_id(policyrule_uuid),updated + policyrule_id = json_policyrule_id(policyrule_uuid) + event_type = EventTypeEnum.EVENTTYPE_UPDATE if updated else EventTypeEnum.EVENTTYPE_CREATE + notify_event_policy_rule(messagebroker, event_type, policyrule_id) + return PolicyRuleId(**policyrule_id) -def policyrule_delete(db_engine : Engine, request : PolicyRuleId) -> Tuple[Dict, bool]: +def policyrule_delete(db_engine : Engine, messagebroker : MessageBroker, request : PolicyRuleId) -> Empty: policyrule_uuid = policyrule_get_uuid(request, allow_random=False) def callback(session : Session) -> bool: num_deleted = session.query(PolicyRuleModel).filter_by(policyrule_uuid=policyrule_uuid).delete() return num_deleted > 0 deleted = run_transaction(sessionmaker(bind=db_engine), callback) - return json_policyrule_id(policyrule_uuid),deleted + policyrule_id = json_policyrule_id(policyrule_uuid) + if deleted: + notify_event_policy_rule(messagebroker, EventTypeEnum.EVENTTYPE_REMOVE, policyrule_id) + return Empty() diff --git a/src/context/service/database/Service.py b/src/context/service/database/Service.py index b6916dc3a19fef4bde3aff93300e63f360b362c0..fc196ddded291aa82c8f9df932c15611d13121e4 100644 --- a/src/context/service/database/Service.py +++ b/src/context/service/database/Service.py @@ -18,8 +18,10 @@ from sqlalchemy.dialects.postgresql import insert from sqlalchemy.engine import Engine from sqlalchemy.orm import Session, selectinload, sessionmaker from sqlalchemy_cockroachdb import run_transaction -from typing import Dict, List, Optional, Set, Tuple -from common.proto.context_pb2 import ContextId, Service, ServiceFilter, ServiceId +from typing import Dict, List, Optional, Set +from common.proto.context_pb2 import ( + ContextId, Empty, EventTypeEnum, Service, ServiceFilter, ServiceId, ServiceIdList, ServiceList) +from common.message_broker.MessageBroker import MessageBroker from common.method_wrappers.ServiceExceptions import InvalidArgumentException, NotFoundException from common.tools.object_factory.Context import json_context_id from common.tools.object_factory.Service import json_service_id @@ -31,17 +33,19 @@ from .models.ServiceModel import ServiceModel, ServiceEndPointModel from .uuids.Context import context_get_uuid from .uuids.EndPoint import endpoint_get_uuid from .uuids.Service import service_get_uuid +from .Events import notify_event_context, notify_event_service LOGGER = logging.getLogger(__name__) -def service_list_ids(db_engine : Engine, request : ContextId) -> List[Dict]: +def service_list_ids(db_engine : Engine, request : ContextId) -> ServiceIdList: context_uuid = context_get_uuid(request, allow_random=False) def callback(session : Session) -> List[Dict]: obj_list : List[ServiceModel] = session.query(ServiceModel).filter_by(context_uuid=context_uuid).all() return [obj.dump_id() for obj in obj_list] - return run_transaction(sessionmaker(bind=db_engine), callback) + service_ids = run_transaction(sessionmaker(bind=db_engine), callback) + return ServiceIdList(service_ids=service_ids) -def service_list_objs(db_engine : Engine, request : ContextId) -> List[Dict]: +def service_list_objs(db_engine : Engine, request : ContextId) -> ServiceList: context_uuid = context_get_uuid(request, allow_random=False) def callback(session : Session) -> List[Dict]: obj_list : List[ServiceModel] = session.query(ServiceModel)\ @@ -50,9 +54,10 @@ def service_list_objs(db_engine : Engine, request : ContextId) -> List[Dict]: .options(selectinload(ServiceModel.config_rules))\ .filter_by(context_uuid=context_uuid).all() return [obj.dump() for obj in obj_list] - return run_transaction(sessionmaker(bind=db_engine), callback) + services = run_transaction(sessionmaker(bind=db_engine), callback) + return ServiceList(services=services) -def service_get(db_engine : Engine, request : ServiceId) -> Dict: +def service_get(db_engine : Engine, request : ServiceId) -> Service: _,service_uuid = service_get_uuid(request, allow_random=False) def callback(session : Session) -> Optional[Dict]: obj : Optional[ServiceModel] = session.query(ServiceModel)\ @@ -69,9 +74,9 @@ def service_get(db_engine : Engine, request : ServiceId) -> Dict: 'context_uuid generated was: {:s}'.format(context_uuid), 'service_uuid generated was: {:s}'.format(service_uuid), ]) - return obj + return Service(**obj) -def service_set(db_engine : Engine, request : Service) -> Tuple[Dict, bool]: +def service_set(db_engine : Engine, messagebroker : MessageBroker, request : Service) -> ServiceId: raw_context_uuid = request.service_id.context_id.context_uuid.uuid raw_service_uuid = request.service_id.service_uuid.uuid raw_service_name = request.name @@ -145,9 +150,14 @@ def service_set(db_engine : Engine, request : Service) -> Tuple[Dict, bool]: return updated or changed_constraints or changed_config_rules updated = run_transaction(sessionmaker(bind=db_engine), callback) - return json_service_id(service_uuid, json_context_id(context_uuid)),updated - -def service_unset(db_engine : Engine, request : Service) -> Tuple[Dict, bool]: + context_id = json_context_id(context_uuid) + service_id = json_service_id(service_uuid, context_id=context_id) + event_type = EventTypeEnum.EVENTTYPE_UPDATE if updated else EventTypeEnum.EVENTTYPE_CREATE + notify_event_service(messagebroker, event_type, service_id) + notify_event_context(messagebroker, EventTypeEnum.EVENTTYPE_UPDATE, context_id) + return ServiceId(**service_id) + +def service_unset(db_engine : Engine, messagebroker : MessageBroker, request : Service) -> ServiceId: raw_context_uuid = request.service_id.context_id.context_uuid.uuid raw_service_uuid = request.service_id.service_uuid.uuid raw_service_name = request.name @@ -184,17 +194,25 @@ def service_unset(db_engine : Engine, request : Service) -> Tuple[Dict, bool]: return num_deletes > 0 or changed_constraints or changed_config_rules updated = run_transaction(sessionmaker(bind=db_engine), callback) - return json_service_id(service_uuid, json_context_id(context_uuid)),updated + service_id = json_service_id(service_uuid, json_context_id(context_uuid)) + if updated: + notify_event_service(messagebroker, EventTypeEnum.EVENTTYPE_UPDATE, service_id) + return ServiceId(**service_id) -def service_delete(db_engine : Engine, request : ServiceId) -> Tuple[Dict, bool]: +def service_delete(db_engine : Engine, messagebroker : MessageBroker, request : ServiceId) -> Empty: context_uuid,service_uuid = service_get_uuid(request, allow_random=False) def callback(session : Session) -> bool: num_deleted = session.query(ServiceModel).filter_by(service_uuid=service_uuid).delete() return num_deleted > 0 deleted = run_transaction(sessionmaker(bind=db_engine), callback) - return json_service_id(service_uuid, json_context_id(context_uuid)),deleted - -def service_select(db_engine : Engine, request : ServiceFilter) -> List[Dict]: + context_id = json_context_id(context_uuid) + service_id = json_service_id(service_uuid, context_id=context_id) + if deleted: + notify_event_service(messagebroker, EventTypeEnum.EVENTTYPE_REMOVE, service_id) + notify_event_context(messagebroker, EventTypeEnum.EVENTTYPE_UPDATE, context_id) + return Empty() + +def service_select(db_engine : Engine, request : ServiceFilter) -> ServiceList: service_uuids = [ service_get_uuid(service_id, allow_random=False)[1] for service_id in request.service_ids.service_ids @@ -211,4 +229,5 @@ def service_select(db_engine : Engine, request : ServiceFilter) -> List[Dict]: if request.include_config_rules: query = query.options(selectinload(ServiceModel.config_rules)) obj_list : List[ServiceModel] = query.filter(ServiceModel.service_uuid.in_(service_uuids)).all() return [obj.dump(**dump_params) for obj in obj_list] - return run_transaction(sessionmaker(bind=db_engine), callback) + services = run_transaction(sessionmaker(bind=db_engine), callback) + return ServiceList(services=services) diff --git a/src/context/service/database/Slice.py b/src/context/service/database/Slice.py index abd140024f2a13289c7af6a3bafe363a8247e053..98a5ef7a8dd5d6f489c11bc2798ea16fc5b9c128 100644 --- a/src/context/service/database/Slice.py +++ b/src/context/service/database/Slice.py @@ -18,8 +18,10 @@ from sqlalchemy.dialects.postgresql import insert from sqlalchemy.engine import Engine from sqlalchemy.orm import Session, selectinload, sessionmaker from sqlalchemy_cockroachdb import run_transaction -from typing import Dict, List, Optional, Set, Tuple -from common.proto.context_pb2 import ContextId, Slice, SliceFilter, SliceId +from typing import Dict, List, Optional, Set +from common.proto.context_pb2 import ( + ContextId, Empty, EventTypeEnum, Slice, SliceFilter, SliceId, SliceIdList, SliceList) +from common.message_broker.MessageBroker import MessageBroker from common.method_wrappers.ServiceExceptions import InvalidArgumentException, NotFoundException from common.tools.object_factory.Context import json_context_id from common.tools.object_factory.Slice import json_slice_id @@ -31,17 +33,19 @@ from .uuids.Context import context_get_uuid from .uuids.EndPoint import endpoint_get_uuid from .uuids.Service import service_get_uuid from .uuids.Slice import slice_get_uuid +from .Events import notify_event_context, notify_event_slice LOGGER = logging.getLogger(__name__) -def slice_list_ids(db_engine : Engine, request : ContextId) -> List[Dict]: +def slice_list_ids(db_engine : Engine, request : ContextId) -> SliceIdList: context_uuid = context_get_uuid(request, allow_random=False) def callback(session : Session) -> List[Dict]: obj_list : List[SliceModel] = session.query(SliceModel).filter_by(context_uuid=context_uuid).all() return [obj.dump_id() for obj in obj_list] - return run_transaction(sessionmaker(bind=db_engine), callback) + slice_ids = run_transaction(sessionmaker(bind=db_engine), callback) + return SliceIdList(slice_ids=slice_ids) -def slice_list_objs(db_engine : Engine, request : ContextId) -> List[Dict]: +def slice_list_objs(db_engine : Engine, request : ContextId) -> SliceList: context_uuid = context_get_uuid(request, allow_random=False) def callback(session : Session) -> List[Dict]: obj_list : List[SliceModel] = session.query(SliceModel)\ @@ -52,9 +56,10 @@ def slice_list_objs(db_engine : Engine, request : ContextId) -> List[Dict]: .options(selectinload(SliceModel.config_rules))\ .filter_by(context_uuid=context_uuid).all() return [obj.dump() for obj in obj_list] - return run_transaction(sessionmaker(bind=db_engine), callback) + slices = run_transaction(sessionmaker(bind=db_engine), callback) + return SliceList(slices=slices) -def slice_get(db_engine : Engine, request : SliceId) -> Dict: +def slice_get(db_engine : Engine, request : SliceId) -> Slice: _,slice_uuid = slice_get_uuid(request, allow_random=False) def callback(session : Session) -> Optional[Dict]: obj : Optional[SliceModel] = session.query(SliceModel)\ @@ -73,9 +78,9 @@ def slice_get(db_engine : Engine, request : SliceId) -> Dict: 'context_uuid generated was: {:s}'.format(context_uuid), 'slice_uuid generated was: {:s}'.format(slice_uuid), ]) - return obj + return Slice(**obj) -def slice_set(db_engine : Engine, request : Slice) -> Tuple[Dict, bool]: +def slice_set(db_engine : Engine, messagebroker : MessageBroker, request : Slice) -> SliceId: raw_context_uuid = request.slice_id.context_id.context_uuid.uuid raw_slice_uuid = request.slice_id.slice_uuid.uuid raw_slice_name = request.name @@ -182,9 +187,14 @@ def slice_set(db_engine : Engine, request : Slice) -> Tuple[Dict, bool]: return updated or changed_constraints or changed_config_rules updated = run_transaction(sessionmaker(bind=db_engine), callback) - return json_slice_id(slice_uuid, json_context_id(context_uuid)),updated - -def slice_unset(db_engine : Engine, request : Slice) -> Tuple[Dict, bool]: + context_id = json_context_id(context_uuid) + slice_id = json_slice_id(slice_uuid, context_id=context_id) + event_type = EventTypeEnum.EVENTTYPE_UPDATE if updated else EventTypeEnum.EVENTTYPE_CREATE + notify_event_slice(messagebroker, event_type, slice_id) + notify_event_context(messagebroker, EventTypeEnum.EVENTTYPE_UPDATE, context_id) + return SliceId(**slice_id) + +def slice_unset(db_engine : Engine, messagebroker : MessageBroker, request : Slice) -> SliceId: raw_context_uuid = request.slice_id.context_id.context_uuid.uuid raw_slice_uuid = request.slice_id.slice_uuid.uuid raw_slice_name = request.name @@ -243,17 +253,25 @@ def slice_unset(db_engine : Engine, request : Slice) -> Tuple[Dict, bool]: return num_deletes > 0 or changed_constraints or changed_config_rules updated = run_transaction(sessionmaker(bind=db_engine), callback) - return json_slice_id(slice_uuid, json_context_id(context_uuid)),updated + slice_id = json_slice_id(slice_uuid, json_context_id(context_uuid)) + if updated: + notify_event_slice(messagebroker, EventTypeEnum.EVENTTYPE_UPDATE, slice_id) + return SliceId(**slice_id) -def slice_delete(db_engine : Engine, request : SliceId) -> Tuple[Dict, bool]: +def slice_delete(db_engine : Engine, messagebroker : MessageBroker, request : SliceId) -> Empty: context_uuid,slice_uuid = slice_get_uuid(request, allow_random=False) def callback(session : Session) -> bool: num_deleted = session.query(SliceModel).filter_by(slice_uuid=slice_uuid).delete() return num_deleted > 0 deleted = run_transaction(sessionmaker(bind=db_engine), callback) - return json_slice_id(slice_uuid, json_context_id(context_uuid)),deleted - -def slice_select(db_engine : Engine, request : SliceFilter) -> List[Dict]: + context_id = json_context_id(context_uuid) + slice_id = json_slice_id(slice_uuid, context_id=context_id) + if deleted: + notify_event_slice(messagebroker, EventTypeEnum.EVENTTYPE_REMOVE, slice_id) + notify_event_context(messagebroker, EventTypeEnum.EVENTTYPE_UPDATE, context_id) + return Empty() + +def slice_select(db_engine : Engine, request : SliceFilter) -> SliceList: slice_uuids = [ slice_get_uuid(slice_id, allow_random=False)[1] for slice_id in request.slice_ids.slice_ids @@ -274,4 +292,5 @@ def slice_select(db_engine : Engine, request : SliceFilter) -> List[Dict]: if request.include_config_rules: query = query.options(selectinload(SliceModel.config_rules)) obj_list : List[SliceModel] = query.filter(SliceModel.slice_uuid.in_(slice_uuids)).all() return [obj.dump(**dump_params) for obj in obj_list] - return run_transaction(sessionmaker(bind=db_engine), callback) + slices = run_transaction(sessionmaker(bind=db_engine), callback) + return SliceList(slices=slices) diff --git a/src/context/service/database/Topology.py b/src/context/service/database/Topology.py index 4440299b63f68613854e79998270872389d385cb..e8f99415509ee16e359d4737a2f4f41fed7f09a8 100644 --- a/src/context/service/database/Topology.py +++ b/src/context/service/database/Topology.py @@ -17,27 +17,34 @@ from sqlalchemy.dialects.postgresql import insert from sqlalchemy.engine import Engine from sqlalchemy.orm import Session, selectinload, sessionmaker from sqlalchemy_cockroachdb import run_transaction -from typing import Dict, List, Optional, Tuple -from common.proto.context_pb2 import ContextId, Topology, TopologyId +from typing import Dict, List, Optional, Set +from common.proto.context_pb2 import ( + ContextId, Empty, EventTypeEnum, Topology, TopologyDetails, TopologyId, TopologyIdList, TopologyList) +from common.message_broker.MessageBroker import MessageBroker from common.method_wrappers.ServiceExceptions import NotFoundException from common.tools.object_factory.Context import json_context_id from common.tools.object_factory.Topology import json_topology_id +from context.Config import ALLOW_EXPLICIT_ADD_DEVICE_TO_TOPOLOGY, ALLOW_EXPLICIT_ADD_LINK_TO_TOPOLOGY from .models.DeviceModel import DeviceModel from .models.LinkModel import LinkModel from .models.TopologyModel import TopologyDeviceModel, TopologyLinkModel, TopologyModel from .uuids.Context import context_get_uuid +from .uuids.Device import device_get_uuid +from .uuids.Link import link_get_uuid from .uuids.Topology import topology_get_uuid +from .Events import notify_event_context, notify_event_topology LOGGER = logging.getLogger(__name__) -def topology_list_ids(db_engine : Engine, request : ContextId) -> List[Dict]: +def topology_list_ids(db_engine : Engine, request : ContextId) -> TopologyIdList: context_uuid = context_get_uuid(request, allow_random=False) def callback(session : Session) -> List[Dict]: obj_list : List[TopologyModel] = session.query(TopologyModel).filter_by(context_uuid=context_uuid).all() return [obj.dump_id() for obj in obj_list] - return run_transaction(sessionmaker(bind=db_engine), callback) + topology_ids = run_transaction(sessionmaker(bind=db_engine), callback) + return TopologyIdList(topology_ids=topology_ids) -def topology_list_objs(db_engine : Engine, request : ContextId) -> List[Dict]: +def topology_list_objs(db_engine : Engine, request : ContextId) -> TopologyList: context_uuid = context_get_uuid(request, allow_random=False) def callback(session : Session) -> List[Dict]: obj_list : List[TopologyModel] = session.query(TopologyModel)\ @@ -45,9 +52,10 @@ def topology_list_objs(db_engine : Engine, request : ContextId) -> List[Dict]: .options(selectinload(TopologyModel.topology_links))\ .filter_by(context_uuid=context_uuid).all() return [obj.dump() for obj in obj_list] - return run_transaction(sessionmaker(bind=db_engine), callback) + topologies = run_transaction(sessionmaker(bind=db_engine), callback) + return TopologyList(topologies=topologies) -def topology_get(db_engine : Engine, request : TopologyId) -> Dict: +def topology_get(db_engine : Engine, request : TopologyId) -> Topology: _,topology_uuid = topology_get_uuid(request, allow_random=False) def callback(session : Session) -> Optional[Dict]: obj : Optional[TopologyModel] = session.query(TopologyModel)\ @@ -63,9 +71,9 @@ def topology_get(db_engine : Engine, request : TopologyId) -> Dict: 'context_uuid generated was: {:s}'.format(context_uuid), 'topology_uuid generated was: {:s}'.format(topology_uuid), ]) - return obj + return Topology(**obj) -def topology_get_details(db_engine : Engine, request : TopologyId) -> Dict: +def topology_get_details(db_engine : Engine, request : TopologyId) -> TopologyDetails: _,topology_uuid = topology_get_uuid(request, allow_random=False) def callback(session : Session) -> Optional[Dict]: obj : Optional[TopologyModel] = session.query(TopologyModel)\ @@ -82,22 +90,47 @@ def topology_get_details(db_engine : Engine, request : TopologyId) -> Dict: 'context_uuid generated was: {:s}'.format(context_uuid), 'topology_uuid generated was: {:s}'.format(topology_uuid), ]) - return obj + return TopologyDetails(**obj) -def topology_set(db_engine : Engine, request : Topology) -> Tuple[Dict, bool]: +def topology_set(db_engine : Engine, messagebroker : MessageBroker, request : Topology) -> TopologyId: topology_name = request.name if len(topology_name) == 0: topology_name = request.topology_id.topology_uuid.uuid context_uuid,topology_uuid = topology_get_uuid(request.topology_id, topology_name=topology_name, allow_random=True) - # Ignore request.device_ids and request.link_ids. They are used for retrieving devices and links added into the - # topology. Explicit addition into the topology is done automatically when creating the devices and links, based - # on the topologies specified in the endpoints associated with the devices and links. + # By default, ignore request.device_ids and request.link_ids. They are used for retrieving + # devices and links added into the topology. Explicit addition into the topology is done + # automatically when creating the devices and links, based on the topologies specified in + # the endpoints associated with the devices and links. + # In some cases, it might be needed to add them explicitly; to allow that, activate flags + # ALLOW_EXPLICIT_ADD_DEVICE_TO_TOPOLOGY and/or ALLOW_EXPLICIT_ADD_LINK_TO_TOPOLOGY. - if len(request.device_ids) > 0: # pragma: no cover - LOGGER.warning('Items in field "device_ids" ignored. This field is used for retrieval purposes only.') + related_devices : List[Dict] = list() + if ALLOW_EXPLICIT_ADD_DEVICE_TO_TOPOLOGY: + device_uuids : Set[str] = set() + for device_id in request.device_ids: + device_uuid = device_get_uuid(device_id) + if device_uuid not in device_uuids: continue + related_devices.append({'topology_uuid': topology_uuid, 'device_uuid': device_uuid}) + device_uuids.add(device_uuid) + else: + if len(request.device_ids) > 0: # pragma: no cover + MSG = 'ALLOW_EXPLICIT_ADD_DEVICE_TO_TOPOLOGY={:s}; '.format(str(ALLOW_EXPLICIT_ADD_DEVICE_TO_TOPOLOGY)) + MSG += 'Items in field "device_ids" ignored. This field is used for retrieval purposes only.' + LOGGER.warning(MSG) - if len(request.link_ids) > 0: # pragma: no cover - LOGGER.warning('Items in field "link_ids" ignored. This field is used for retrieval purposes only.') + related_links : List[Dict] = list() + if ALLOW_EXPLICIT_ADD_LINK_TO_TOPOLOGY: + link_uuids : Set[str] = set() + for link_id in request.link_ids: + link_uuid = link_get_uuid(link_id) + if link_uuid not in link_uuids: continue + related_links.append({'topology_uuid': topology_uuid, 'link_uuid': link_uuid}) + link_uuids.add(link_uuid) + else: + if len(request.link_ids) > 0: # pragma: no cover + MSG = 'ALLOW_EXPLICIT_ADD_LINK_TO_TOPOLOGY={:s}; '.format(str(ALLOW_EXPLICIT_ADD_LINK_TO_TOPOLOGY)) + MSG += 'Items in field "link_ids" ignored. This field is used for retrieval purposes only.' + LOGGER.warning(MSG) now = datetime.datetime.utcnow() topology_data = [{ @@ -119,15 +152,46 @@ def topology_set(db_engine : Engine, request : Topology) -> Tuple[Dict, bool]: ) stmt = stmt.returning(TopologyModel.created_at, TopologyModel.updated_at) created_at,updated_at = session.execute(stmt).fetchone() - return updated_at > created_at - + + updated = updated_at > created_at + + updated_topology_device = False + if len(related_devices) > 0: + stmt = insert(TopologyDeviceModel).values(related_devices) + stmt = stmt.on_conflict_do_nothing( + index_elements=[TopologyDeviceModel.topology_uuid, TopologyDeviceModel.device_uuid] + ) + topology_device_inserts = session.execute(stmt) + updated_topology_device = int(topology_device_inserts.rowcount) > 0 + + updated_topology_link = False + if len(related_links) > 0: + stmt = insert(TopologyLinkModel).values(related_links) + stmt = stmt.on_conflict_do_nothing( + index_elements=[TopologyLinkModel.topology_uuid, TopologyLinkModel.link_uuid] + ) + topology_link_inserts = session.execute(stmt) + updated_topology_link = int(topology_link_inserts.rowcount) > 0 + + return updated or updated_topology_device or updated_topology_link + updated = run_transaction(sessionmaker(bind=db_engine), callback) - return json_topology_id(topology_uuid, context_id=json_context_id(context_uuid)),updated + context_id = json_context_id(context_uuid) + topology_id = json_topology_id(topology_uuid, context_id=context_id) + event_type = EventTypeEnum.EVENTTYPE_UPDATE if updated else EventTypeEnum.EVENTTYPE_CREATE + notify_event_topology(messagebroker, event_type, topology_id) + notify_event_context(messagebroker, EventTypeEnum.EVENTTYPE_UPDATE, context_id) + return TopologyId(**topology_id) -def topology_delete(db_engine : Engine, request : TopologyId) -> Tuple[Dict, bool]: +def topology_delete(db_engine : Engine, messagebroker : MessageBroker, request : TopologyId) -> Empty: context_uuid,topology_uuid = topology_get_uuid(request, allow_random=False) def callback(session : Session) -> bool: num_deleted = session.query(TopologyModel).filter_by(topology_uuid=topology_uuid).delete() return num_deleted > 0 deleted = run_transaction(sessionmaker(bind=db_engine), callback) - return json_topology_id(topology_uuid, context_id=json_context_id(context_uuid)),deleted + context_id = json_context_id(context_uuid) + topology_id = json_topology_id(topology_uuid, context_id=context_id) + if deleted: + notify_event_topology(messagebroker, EventTypeEnum.EVENTTYPE_REMOVE, topology_id) + notify_event_context(messagebroker, EventTypeEnum.EVENTTYPE_UPDATE, context_id) + return Empty() diff --git a/src/context/service/database/models/ComponentModel.py b/src/context/service/database/models/ComponentModel.py new file mode 100644 index 0000000000000000000000000000000000000000..c9acfaeabe95c55fc464732d54459d99f9b5b054 --- /dev/null +++ b/src/context/service/database/models/ComponentModel.py @@ -0,0 +1,55 @@ +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import json +from sqlalchemy import Column, DateTime, ForeignKey, String +from sqlalchemy.dialects.postgresql import UUID +from sqlalchemy.orm import relationship +from typing import Dict +from ._Base import _Base + +class ComponentModel(_Base): + __tablename__ = 'device_component' + + component_uuid = Column(UUID(as_uuid=False), primary_key=True) + device_uuid = Column(ForeignKey('device.device_uuid',ondelete='CASCADE' ), nullable=False, index=True) + name = Column(String, nullable=False) + type = Column(String, nullable=False) + attributes = Column(String, nullable=False) + parent = Column(String, nullable=False) + created_at = Column(DateTime, nullable=False) + updated_at = Column(DateTime, nullable=False) + + device = relationship('DeviceModel', back_populates='components') + def dump_id(self) -> Dict: + return{ + 'device_id' : self.device.dump_id(), + 'component_uuid': {'uuid': self.component_uuid}, + } + + def dump(self) -> Dict: + data = dict() + data['attributes'] = json.loads(self.attributes) + data['component_uuid'] = {'uuid': self.component_uuid} + data['name'] = self.name + data['type'] = self.type + data['parent'] = self.parent + return data + + def dump_name(self) -> Dict: + return { + 'component_id' : self.dump_id(), + 'device_name' : self.device.device_name, + 'component_name': self.name, + } diff --git a/src/context/service/database/models/DeviceModel.py b/src/context/service/database/models/DeviceModel.py index 1097d0b9ab47a86c47ce2ad8394d067ae9f9953e..376dc98c4053f68c511a8c717117d58d9eda1cca 100644 --- a/src/context/service/database/models/DeviceModel.py +++ b/src/context/service/database/models/DeviceModel.py @@ -36,6 +36,7 @@ class DeviceModel(_Base): #topology_devices = relationship('TopologyDeviceModel', back_populates='device') config_rules = relationship('DeviceConfigRuleModel', passive_deletes=True) # lazy='joined', back_populates='device' endpoints = relationship('EndPointModel', passive_deletes=True) # lazy='joined', back_populates='device' + components = relationship('ComponentModel', passive_deletes=True) # lazy='joined', back_populates='device' controller = relationship('DeviceModel', remote_side=[device_uuid], passive_deletes=True) # lazy='joined', back_populates='device' def dump_id(self) -> Dict: @@ -55,7 +56,7 @@ class DeviceModel(_Base): ]} def dump_components(self) -> List[Dict]: - return [] + return [component.dump() for component in self.components] def dump(self, include_endpoints : bool = True, include_config_rules : bool = True, include_components : bool = True, @@ -70,5 +71,5 @@ class DeviceModel(_Base): } if include_endpoints: result['device_endpoints'] = self.dump_endpoints() if include_config_rules: result['device_config'] = self.dump_config_rules() - if include_components: result['component'] = self.dump_components() + if include_components: result['components'] = self.dump_components() return result diff --git a/src/context/service/database/models/LinkModel.py b/src/context/service/database/models/LinkModel.py index 9c16da3c9146f28352e8b4f7a6f9ab85f870c8b7..d91666652e6b7e506b9718903d0fb095b4ea69c4 100644 --- a/src/context/service/database/models/LinkModel.py +++ b/src/context/service/database/models/LinkModel.py @@ -13,7 +13,7 @@ # limitations under the License. import operator -from sqlalchemy import CheckConstraint, Column, DateTime, ForeignKey, Integer, String +from sqlalchemy import CheckConstraint, Column, DateTime, Float, ForeignKey, Integer, String from sqlalchemy.dialects.postgresql import UUID from sqlalchemy.orm import relationship from typing import Dict @@ -22,19 +22,26 @@ from ._Base import _Base class LinkModel(_Base): __tablename__ = 'link' - link_uuid = Column(UUID(as_uuid=False), primary_key=True) - link_name = Column(String, nullable=False) - created_at = Column(DateTime, nullable=False) - updated_at = Column(DateTime, nullable=False) + link_uuid = Column(UUID(as_uuid=False), primary_key=True) + link_name = Column(String, nullable=False) + total_capacity_gbps = Column(Float, nullable=True) + used_capacity_gbps = Column(Float, nullable=True) + created_at = Column(DateTime, nullable=False) + updated_at = Column(DateTime, nullable=False) #topology_links = relationship('TopologyLinkModel', back_populates='link') link_endpoints = relationship('LinkEndPointModel') # lazy='joined', back_populates='link' + __table_args__ = ( + CheckConstraint(total_capacity_gbps >= 0, name='check_value_total_capacity_gbps'), + CheckConstraint(used_capacity_gbps >= 0, name='check_value_used_capacity_gbps' ), + ) + def dump_id(self) -> Dict: return {'link_uuid': {'uuid': self.link_uuid}} def dump(self) -> Dict: - return { + result = { 'link_id' : self.dump_id(), 'name' : self.link_name, 'link_endpoint_ids': [ @@ -42,6 +49,13 @@ class LinkModel(_Base): for link_endpoint in sorted(self.link_endpoints, key=operator.attrgetter('position')) ], } + if self.total_capacity_gbps is not None: + attributes : Dict = result.setdefault('attributes', dict()) + attributes.setdefault('total_capacity_gbps', self.total_capacity_gbps) + if self.used_capacity_gbps is not None: + attributes : Dict = result.setdefault('attributes', dict()) + attributes.setdefault('used_capacity_gbps', self.used_capacity_gbps) + return result class LinkEndPointModel(_Base): __tablename__ = 'link_endpoint' diff --git a/src/context/service/database/models/TopologyModel.py b/src/context/service/database/models/TopologyModel.py index 0ed4a038bcf4426f4cf112bd03c5cb36cb42c822..68d97edf36ee42c04948cc6782b86bce028cb76a 100644 --- a/src/context/service/database/models/TopologyModel.py +++ b/src/context/service/database/models/TopologyModel.py @@ -67,7 +67,7 @@ class TopologyDeviceModel(_Base): topology_uuid = Column(ForeignKey('topology.topology_uuid', ondelete='RESTRICT'), primary_key=True, index=True) device_uuid = Column(ForeignKey('device.device_uuid', ondelete='CASCADE' ), primary_key=True, index=True) - #topology = relationship('TopologyModel', lazy='selectin') # back_populates='topology_devices' + topology = relationship('TopologyModel', lazy='selectin', viewonly=True) # back_populates='topology_devices' device = relationship('DeviceModel', lazy='selectin') # back_populates='topology_devices' class TopologyLinkModel(_Base): @@ -76,5 +76,5 @@ class TopologyLinkModel(_Base): topology_uuid = Column(ForeignKey('topology.topology_uuid', ondelete='RESTRICT'), primary_key=True, index=True) link_uuid = Column(ForeignKey('link.link_uuid', ondelete='CASCADE' ), primary_key=True, index=True) - #topology = relationship('TopologyModel', lazy='selectin') # back_populates='topology_links' + topology = relationship('TopologyModel', lazy='selectin', viewonly=True) # back_populates='topology_links' link = relationship('LinkModel', lazy='selectin') # back_populates='topology_links' diff --git a/src/context/service/database/models/_Base.py b/src/context/service/database/models/_Base.py index b87b9b06d6adc5825ab5dd84cf64347eb9c26f66..52eb6b088210b8edc8d121221458ae11ece484a5 100644 --- a/src/context/service/database/models/_Base.py +++ b/src/context/service/database/models/_Base.py @@ -60,6 +60,9 @@ def create_performance_enhancers(db_engine : sqlalchemy.engine.Engine) -> None: index_storing('topology_context_uuid_rec_idx', 'topology', ['context_uuid'], [ 'topology_name', 'created_at', 'updated_at' ]), + index_storing('device_component_idx', 'device_component', ['device_uuid'], [ + 'name', 'type', 'attributes', 'created_at', 'updated_at' + ]), ] def callback(session : Session) -> bool: for stmt in statements: session.execute(stmt) diff --git a/src/context/service/database/models/enums/ConfigAction.py b/src/context/service/database/models/enums/ConfigAction.py index 5d7aa6b44ecb58f769a1c70a5cabdda98ba51bca..526024a1fedf3331ca45e3cb517ff9d58ce28c25 100644 --- a/src/context/service/database/models/enums/ConfigAction.py +++ b/src/context/service/database/models/enums/ConfigAction.py @@ -16,6 +16,11 @@ import enum, functools from common.proto.context_pb2 import ConfigActionEnum from ._GrpcToEnum import grpc_to_enum +# IMPORTANT: Entries of enum class ORM_ConfigActionEnum should be named +# as in the proto files removing the prefixes. For example, +# proto item ConfigActionEnum.CONFIGACTION_SET should be +# included as SET. If item name does not match, automatic +# mapping of proto enums to database enums will fail. class ORM_ConfigActionEnum(enum.Enum): UNDEFINED = ConfigActionEnum.CONFIGACTION_UNDEFINED SET = ConfigActionEnum.CONFIGACTION_SET diff --git a/src/context/service/database/models/enums/ConstraintAction.py b/src/context/service/database/models/enums/ConstraintAction.py index 65533b6f579ffe153b046dfcb39d37758f4c0577..2a53b8e1c5e97e48cbda9648c8473313bce6f4cd 100644 --- a/src/context/service/database/models/enums/ConstraintAction.py +++ b/src/context/service/database/models/enums/ConstraintAction.py @@ -16,6 +16,11 @@ import enum, functools from common.proto.context_pb2 import ConstraintActionEnum from ._GrpcToEnum import grpc_to_enum +# IMPORTANT: Entries of enum class ORM_ConstraintActionEnum should be named +# as in the proto files removing the prefixes. For example, proto +# item ConstraintActionEnum.CONFIGACTION_SET should be included +# as SET. If item name does not match, automatic mapping of proto +# enums to database enums will fail. class ORM_ConstraintActionEnum(enum.Enum): UNDEFINED = ConstraintActionEnum.CONSTRAINTACTION_UNDEFINED SET = ConstraintActionEnum.CONSTRAINTACTION_SET diff --git a/src/context/service/database/models/enums/DeviceDriver.py b/src/context/service/database/models/enums/DeviceDriver.py index 09be94b1d7ec041f2d3f50f832f15017fb62e63c..f8483360191dcea1a56cdc372b681ae2d03c9ef1 100644 --- a/src/context/service/database/models/enums/DeviceDriver.py +++ b/src/context/service/database/models/enums/DeviceDriver.py @@ -16,16 +16,22 @@ import enum, functools from common.proto.context_pb2 import DeviceDriverEnum from ._GrpcToEnum import grpc_to_enum +# IMPORTANT: Entries of enum class ORM_DeviceDriverEnum should be named as in +# the proto files removing the prefixes. For example, proto item +# DeviceDriverEnum.DEVICEDRIVER_OPENCONFIG should be included as +# OPENCONFIG. If item name does not match, automatic mapping of +# proto enums to database enums will fail. class ORM_DeviceDriverEnum(enum.Enum): UNDEFINED = DeviceDriverEnum.DEVICEDRIVER_UNDEFINED OPENCONFIG = DeviceDriverEnum.DEVICEDRIVER_OPENCONFIG TRANSPORT_API = DeviceDriverEnum.DEVICEDRIVER_TRANSPORT_API P4 = DeviceDriverEnum.DEVICEDRIVER_P4 IETF_NETWORK_TOPOLOGY = DeviceDriverEnum.DEVICEDRIVER_IETF_NETWORK_TOPOLOGY - ONF_TR_352 = DeviceDriverEnum.DEVICEDRIVER_ONF_TR_352 + ONF_TR_532 = DeviceDriverEnum.DEVICEDRIVER_ONF_TR_532 XR = DeviceDriverEnum.DEVICEDRIVER_XR IETF_L2VPN = DeviceDriverEnum.DEVICEDRIVER_IETF_L2VPN GNMI_OPENCONFIG = DeviceDriverEnum.DEVICEDRIVER_GNMI_OPENCONFIG + FLEXSCALE = DeviceDriverEnum.DEVICEDRIVER_FLEXSCALE grpc_to_enum__device_driver = functools.partial( grpc_to_enum, DeviceDriverEnum, ORM_DeviceDriverEnum) diff --git a/src/context/service/database/models/enums/DeviceOperationalStatus.py b/src/context/service/database/models/enums/DeviceOperationalStatus.py index a121fab86408493bf0b211f4fcc8423aafa969cf..9e98869dce025e51c20ff0aca0dcd78a9ab57fe1 100644 --- a/src/context/service/database/models/enums/DeviceOperationalStatus.py +++ b/src/context/service/database/models/enums/DeviceOperationalStatus.py @@ -16,6 +16,11 @@ import enum, functools from common.proto.context_pb2 import DeviceOperationalStatusEnum from ._GrpcToEnum import grpc_to_enum +# IMPORTANT: Entries of enum class ORM_DeviceOperationalStatusEnum should be +# named as in the proto files removing the prefixes. For example, +# proto item DeviceOperationalStatusEnum.DEVICEOPERATIONALSTATUS_ENABLED +# should be declared as ENABLED. If item name does not match, automatic +# mapping of proto enums to database enums will fail. class ORM_DeviceOperationalStatusEnum(enum.Enum): UNDEFINED = DeviceOperationalStatusEnum.DEVICEOPERATIONALSTATUS_UNDEFINED DISABLED = DeviceOperationalStatusEnum.DEVICEOPERATIONALSTATUS_DISABLED diff --git a/src/context/service/database/models/enums/KpiSampleType.py b/src/context/service/database/models/enums/KpiSampleType.py index 3bf5d06f047016af7167d0d59a315ac465abfd19..a229b5698ecc393afced41f885bf4c88ede4543f 100644 --- a/src/context/service/database/models/enums/KpiSampleType.py +++ b/src/context/service/database/models/enums/KpiSampleType.py @@ -16,12 +16,19 @@ import enum, functools from common.proto.kpi_sample_types_pb2 import KpiSampleType from ._GrpcToEnum import grpc_to_enum +# IMPORTANT: Entries of enum class ORM_KpiSampleTypeEnum should be named as in +# the proto files removing the prefixes. For example, proto item +# KpiSampleType.KPISAMPLETYPE_BYTES_RECEIVED should be declared as +# BYTES_RECEIVED. If item name does not match, automatic mapping of +# proto enums to database enums will fail. class ORM_KpiSampleTypeEnum(enum.Enum): - UNKNOWN = KpiSampleType.KPISAMPLETYPE_UNKNOWN - PACKETS_TRANSMITTED = KpiSampleType.KPISAMPLETYPE_PACKETS_TRANSMITTED - PACKETS_RECEIVED = KpiSampleType.KPISAMPLETYPE_PACKETS_RECEIVED - BYTES_TRANSMITTED = KpiSampleType.KPISAMPLETYPE_BYTES_TRANSMITTED - BYTES_RECEIVED = KpiSampleType.KPISAMPLETYPE_BYTES_RECEIVED + UNKNOWN = KpiSampleType.KPISAMPLETYPE_UNKNOWN + PACKETS_TRANSMITTED = KpiSampleType.KPISAMPLETYPE_PACKETS_TRANSMITTED + PACKETS_RECEIVED = KpiSampleType.KPISAMPLETYPE_PACKETS_RECEIVED + BYTES_TRANSMITTED = KpiSampleType.KPISAMPLETYPE_BYTES_TRANSMITTED + BYTES_RECEIVED = KpiSampleType.KPISAMPLETYPE_BYTES_RECEIVED + LINK_TOTAL_CAPACITY_GBPS = KpiSampleType.KPISAMPLETYPE_LINK_TOTAL_CAPACITY_GBPS + LINK_USED_CAPACITY_GBPS = KpiSampleType.KPISAMPLETYPE_LINK_USED_CAPACITY_GBPS grpc_to_enum__kpi_sample_type = functools.partial( grpc_to_enum, KpiSampleType, ORM_KpiSampleTypeEnum) diff --git a/src/context/service/database/models/enums/PolicyRuleState.py b/src/context/service/database/models/enums/PolicyRuleState.py index c4aa950a11605682f1c78e544767ea7e0a7b24b4..e16ee01e36b5e2ec2ad8e07f7cb6201ee091e76f 100644 --- a/src/context/service/database/models/enums/PolicyRuleState.py +++ b/src/context/service/database/models/enums/PolicyRuleState.py @@ -16,6 +16,13 @@ import enum, functools from common.proto.policy_pb2 import PolicyRuleStateEnum from ._GrpcToEnum import grpc_to_enum +# IMPORTANT: Entries of enum class ORM_PolicyRuleStateEnum should be named as in +# the proto files removing the prefixes. For example, proto item +# PolicyRuleStateEnum.POLICY_INSERTED should be declared as INSERTED. +# In this case, since the entries in the proto enum have a different prefix +# than that specified in class ORM_PolicyRuleStateEnum, we force the prefix +# using argument grpc_enum_prefix. If item name does not match, automatic +# mapping of proto enums to database enums will fail. class ORM_PolicyRuleStateEnum(enum.Enum): UNDEFINED = PolicyRuleStateEnum.POLICY_UNDEFINED # Undefined rule state FAILED = PolicyRuleStateEnum.POLICY_FAILED # Rule failed diff --git a/src/context/service/database/models/enums/ServiceStatus.py b/src/context/service/database/models/enums/ServiceStatus.py index cd2a183b825eff54a51a844ea6834263bbabbc31..ae0ad55bcfe327b981881bcd304124c9bb6576ab 100644 --- a/src/context/service/database/models/enums/ServiceStatus.py +++ b/src/context/service/database/models/enums/ServiceStatus.py @@ -16,6 +16,11 @@ import enum, functools from common.proto.context_pb2 import ServiceStatusEnum from ._GrpcToEnum import grpc_to_enum +# IMPORTANT: Entries of enum class ORM_ServiceStatusEnum should be named as in +# the proto files removing the prefixes. For example, proto item +# ServiceStatusEnum.SERVICESTATUS_PLANNED should be declared as PLANNED. +# If item name does not match, automatic mapping of proto enums to +# database enums will fail. class ORM_ServiceStatusEnum(enum.Enum): UNDEFINED = ServiceStatusEnum.SERVICESTATUS_UNDEFINED PLANNED = ServiceStatusEnum.SERVICESTATUS_PLANNED diff --git a/src/context/service/database/models/enums/ServiceType.py b/src/context/service/database/models/enums/ServiceType.py index 3937eaa114429ce9d004933a5d5baf1ae6137513..ce198f8c1f795f25da547e2d5974059062489709 100644 --- a/src/context/service/database/models/enums/ServiceType.py +++ b/src/context/service/database/models/enums/ServiceType.py @@ -16,12 +16,18 @@ import enum, functools from common.proto.context_pb2 import ServiceTypeEnum from ._GrpcToEnum import grpc_to_enum +# IMPORTANT: Entries of enum class ORM_ServiceTypeEnum should be named as in +# the proto files removing the prefixes. For example, proto item +# ConfigActionEnum.CONFIGACTION_SET should be declared as SET. +# If item name does not match, automatic mapping of proto enums to +# database enums will fail. class ORM_ServiceTypeEnum(enum.Enum): UNKNOWN = ServiceTypeEnum.SERVICETYPE_UNKNOWN L3NM = ServiceTypeEnum.SERVICETYPE_L3NM L2NM = ServiceTypeEnum.SERVICETYPE_L2NM TAPI_CONNECTIVITY_SERVICE = ServiceTypeEnum.SERVICETYPE_TAPI_CONNECTIVITY_SERVICE TE = ServiceTypeEnum.SERVICETYPE_TE + E2E = ServiceTypeEnum.SERVICETYPE_E2E grpc_to_enum__service_type = functools.partial( grpc_to_enum, ServiceTypeEnum, ORM_ServiceTypeEnum) diff --git a/src/context/service/database/models/enums/SliceStatus.py b/src/context/service/database/models/enums/SliceStatus.py index 5d77578b4cb4ee155981ede4395b1cafc3be4ef7..32ef0cc4a3d65aa96346b038534ca65bc3e4f95c 100644 --- a/src/context/service/database/models/enums/SliceStatus.py +++ b/src/context/service/database/models/enums/SliceStatus.py @@ -16,6 +16,11 @@ import enum, functools from common.proto.context_pb2 import SliceStatusEnum from ._GrpcToEnum import grpc_to_enum +# IMPORTANT: Entries of enum class ORM_SliceStatusEnum should be named as in +# the proto file but removing the prefixes. For example, proto item +# SliceStatusEnum.SLICESTATUS_PLANNED should be declared as PLANNED. +# If item name does not match, automatic mapping of proto enums to +# database enums will fail. class ORM_SliceStatusEnum(enum.Enum): UNDEFINED = SliceStatusEnum.SLICESTATUS_UNDEFINED PLANNED = SliceStatusEnum.SLICESTATUS_PLANNED diff --git a/src/context/tests/Objects.py b/src/context/tests/Objects.py index 6b52ef4c0f3583de628706ba79efffb9d5709820..785a50e1934269150381a1d6d3b08001574a0cee 100644 --- a/src/context/tests/Objects.py +++ b/src/context/tests/Objects.py @@ -71,18 +71,32 @@ DEVICE_R3_NAME, DEVICE_R3_ID, DEVICE_R3 = compose_device('R3', ['1.1', '1.2', '2 # ----- Link ----------------------------------------------------------------------------------------------------------- -def compose_link(name : str, endpoint_ids : List[Tuple[str, str]]) -> Tuple[str, Dict, Dict]: +def compose_link( + name : str, endpoint_ids : List[Tuple[str, str]], + total_capacity_gbps : Optional[float] = None, used_capacity_gbps : Optional[float] = None +) -> Tuple[str, Dict, Dict]: link_id = json_link_id(name) endpoint_ids = [ json_endpoint_id(device_id, endpoint_name, topology_id=TOPOLOGY_ID) for device_id, endpoint_name in endpoint_ids ] - link = json_link(name, endpoint_ids) + link = json_link( + name, endpoint_ids, total_capacity_gbps=total_capacity_gbps, used_capacity_gbps=used_capacity_gbps + ) return name, link_id, link -LINK_R1_R2_NAME, LINK_R1_R2_ID, LINK_R1_R2 = compose_link('R1==R2', [(DEVICE_R1_ID, '1.2'), (DEVICE_R2_ID, '1.1')]) -LINK_R2_R3_NAME, LINK_R2_R3_ID, LINK_R2_R3 = compose_link('R2==R3', [(DEVICE_R2_ID, '1.3'), (DEVICE_R3_ID, '1.2')]) -LINK_R1_R3_NAME, LINK_R1_R3_ID, LINK_R1_R3 = compose_link('R1==R3', [(DEVICE_R1_ID, '1.3'), (DEVICE_R3_ID, '1.1')]) +LINK_R1_R2_NAME, LINK_R1_R2_ID, LINK_R1_R2 = compose_link( + 'R1==R2', [(DEVICE_R1_ID, '1.2'), (DEVICE_R2_ID, '1.1')], + total_capacity_gbps=100, # used_capacity_gbps=None => used_capacity_gbps=total_capacity_gbps +) +LINK_R2_R3_NAME, LINK_R2_R3_ID, LINK_R2_R3 = compose_link( + 'R2==R3', [(DEVICE_R2_ID, '1.3'), (DEVICE_R3_ID, '1.2')], + total_capacity_gbps=100, # used_capacity_gbps=None => used_capacity_gbps=total_capacity_gbps +) +LINK_R1_R3_NAME, LINK_R1_R3_ID, LINK_R1_R3 = compose_link( + 'R1==R3', [(DEVICE_R1_ID, '1.3'), (DEVICE_R3_ID, '1.1')], + total_capacity_gbps=100, # used_capacity_gbps=None => used_capacity_gbps=total_capacity_gbps +) # ----- Service -------------------------------------------------------------------------------------------------------- diff --git a/src/context/tests/test_link.py b/src/context/tests/test_link.py index 894ef8ef1472e4b451314970883cb9467c63b02b..5b5abb0d53d25778c0e5cd11b7d97c4a35746a4e 100644 --- a/src/context/tests/test_link.py +++ b/src/context/tests/test_link.py @@ -95,6 +95,18 @@ def test_link(context_client : ContextClient) -> None: assert response.link_id.link_uuid.uuid == link_uuid assert response.name == LINK_R1_R2_NAME assert len(response.link_endpoint_ids) == 2 + assert response.HasField('attributes') + # In proto3, HasField() does not work for scalar fields, using ListFields() instead. + attribute_names = set([field.name for field,_ in response.attributes.ListFields()]) + assert 'total_capacity_gbps' in attribute_names + assert abs(response.attributes.total_capacity_gbps - 100) < 1.e-12 + assert ( + ('used_capacity_gbps' not in attribute_names) or ( + ('used_capacity_gbps' in attribute_names) and ( + abs(response.attributes.used_capacity_gbps - response.attributes.total_capacity_gbps) < 1.e-12 + ) + ) + ) # ----- List when the object exists -------------------------------------------------------------------------------- response = context_client.ListLinkIds(Empty()) @@ -111,6 +123,8 @@ def test_link(context_client : ContextClient) -> None: new_link_name = 'new' LINK_UPDATED = copy.deepcopy(LINK_R1_R2) LINK_UPDATED['name'] = new_link_name + LINK_UPDATED['attributes']['total_capacity_gbps'] = 200 + LINK_UPDATED['attributes']['used_capacity_gbps'] = 50 response = context_client.SetLink(Link(**LINK_UPDATED)) assert response.link_uuid.uuid == link_uuid @@ -125,6 +139,13 @@ def test_link(context_client : ContextClient) -> None: assert response.link_id.link_uuid.uuid == link_uuid assert response.name == new_link_name assert len(response.link_endpoint_ids) == 2 + assert response.HasField('attributes') + # In proto3, HasField() does not work for scalar fields, using ListFields() instead. + attribute_names = set([field.name for field,_ in response.attributes.ListFields()]) + assert 'total_capacity_gbps' in attribute_names + assert abs(response.attributes.total_capacity_gbps - 200) < 1.e-12 + assert 'used_capacity_gbps' in attribute_names + assert abs(response.attributes.used_capacity_gbps - 50) < 1.e-12 # ----- List when the object is modified --------------------------------------------------------------------------- response = context_client.ListLinkIds(Empty()) @@ -136,6 +157,14 @@ def test_link(context_client : ContextClient) -> None: assert response.links[0].link_id.link_uuid.uuid == link_uuid assert response.links[0].name == new_link_name assert len(response.links[0].link_endpoint_ids) == 2 + assert len(response.links[0].link_endpoint_ids) == 2 + assert response.links[0].HasField('attributes') + # In proto3, HasField() does not work for scalar fields, using ListFields() instead. + attribute_names = set([field.name for field,_ in response.links[0].attributes.ListFields()]) + assert 'total_capacity_gbps' in attribute_names + assert abs(response.links[0].attributes.total_capacity_gbps - 200) < 1.e-12 + assert 'used_capacity_gbps' in attribute_names + assert abs(response.links[0].attributes.used_capacity_gbps - 50) < 1.e-12 # ----- Check relation was created --------------------------------------------------------------------------------- response = context_client.GetTopology(TopologyId(**TOPOLOGY_ID)) diff --git a/src/dbscanserving/Dockerfile b/src/dbscanserving/Dockerfile index 81e3fb28a059faf92f793aa5bd76d1a744e65d9b..2f3f62d6b41e145a419fde54ef37aed47561da50 100644 --- a/src/dbscanserving/Dockerfile +++ b/src/dbscanserving/Dockerfile @@ -16,7 +16,7 @@ FROM python:3.9-slim # Install dependencies RUN apt-get --yes --quiet --quiet update && \ - apt-get --yes --quiet --quiet install wget g++ && \ + apt-get --yes --quiet --quiet install wget g++ git && \ rm -rf /var/lib/apt/lists/* # Set Python to show logs as they occur diff --git a/src/device/requirements.in b/src/device/requirements.in index c81e814603d4c84e0211e3b433fc916b616ecd04..ece761571ec2ff9c3376b1062787d76047d71e7c 100644 --- a/src/device/requirements.in +++ b/src/device/requirements.in @@ -20,6 +20,7 @@ cryptography==36.0.2 Jinja2==3.0.3 ncclient==0.6.13 p4runtime==1.3.0 +pandas==1.5.* paramiko==2.9.2 python-json-logger==2.0.2 #pytz==2021.3 diff --git a/src/device/service/DeviceServiceServicerImpl.py b/src/device/service/DeviceServiceServicerImpl.py index d29d469cb0812218030698284abbfc7551058411..eeffdd7b0592b5166c06c1597e17f79adcfd25bb 100644 --- a/src/device/service/DeviceServiceServicerImpl.py +++ b/src/device/service/DeviceServiceServicerImpl.py @@ -123,13 +123,13 @@ class DeviceServiceServicerImpl(DeviceServiceServicer): t9 = time.time() - automation_service_host = get_env_var_name(ServiceNameEnum.AUTOMATION, ENVVAR_SUFIX_SERVICE_HOST) + ztp_service_host = get_env_var_name(ServiceNameEnum.ZTP, ENVVAR_SUFIX_SERVICE_HOST) environment_variables = set(os.environ.keys()) - if automation_service_host in environment_variables: - # Automation component is deployed; leave devices disabled. Automation will enable them. + if ztp_service_host in environment_variables: + # ZTP component is deployed; leave devices disabled. ZTP will enable them. device.device_operational_status = DeviceOperationalStatusEnum.DEVICEOPERATIONALSTATUS_DISABLED else: - # Automation is not deployed; assume the device is ready while onboarding and set them as enabled. + # ZTP is not deployed; assume the device is ready while onboarding and set them as enabled. device.device_operational_status = DeviceOperationalStatusEnum.DEVICEOPERATIONALSTATUS_ENABLED device_id = context_client.SetDevice(device) diff --git a/src/device/service/driver_api/_Driver.py b/src/device/service/driver_api/_Driver.py index 7adaec79dc99f9b7c836acaec886b0d5bda97fb8..0aa1a6c5a8697d4c75f7044981221c6dd47e3aff 100644 --- a/src/device/service/driver_api/_Driver.py +++ b/src/device/service/driver_api/_Driver.py @@ -24,6 +24,7 @@ RESOURCE_NETWORK_INSTANCES = '__network_instances__' RESOURCE_ROUTING_POLICIES = '__routing_policies__' RESOURCE_SERVICES = '__services__' RESOURCE_ACL = '__acl__' +RESOURCE_INVENTORY = '__inventory__' class _Driver: diff --git a/src/device/service/drivers/__init__.py b/src/device/service/drivers/__init__.py index 4ae7128b0258536dae5fbed2ae86457d4f9f969f..442acf839c8e4615237d338d7b485be297d1a4ff 100644 --- a/src/device/service/drivers/__init__.py +++ b/src/device/service/drivers/__init__.py @@ -69,7 +69,7 @@ DRIVERS.append( # DeviceDriverEnum.DEVICEDRIVER_TRANSPORT_API, # DeviceDriverEnum.DEVICEDRIVER_P4, # DeviceDriverEnum.DEVICEDRIVER_IETF_NETWORK_TOPOLOGY, - # DeviceDriverEnum.DEVICEDRIVER_ONF_TR_352, + # DeviceDriverEnum.DEVICEDRIVER_ONF_TR_532, # DeviceDriverEnum.DEVICEDRIVER_GNMI_OPENCONFIG, # ], #} @@ -148,3 +148,13 @@ if LOAD_ALL_DEVICE_DRIVERS: FilterFieldEnum.DRIVER : DeviceDriverEnum.DEVICEDRIVER_XR, } ])) + +if LOAD_ALL_DEVICE_DRIVERS: + from .flexscale.FlexScaleDriver import FlexScaleDriver # pylint: disable=wrong-import-position + DRIVERS.append( + (FlexScaleDriver, [ + { + FilterFieldEnum.DEVICE_TYPE: DeviceTypeEnum.OPEN_LINE_SYSTEM, + FilterFieldEnum.DRIVER: DeviceDriverEnum.DEVICEDRIVER_FLEXSCALE, + } + ])) diff --git a/src/device/service/drivers/flexscale/FlexScaleDriver.py b/src/device/service/drivers/flexscale/FlexScaleDriver.py new file mode 100644 index 0000000000000000000000000000000000000000..f91ee1cebbd686cceed2370df98445aa247d5990 --- /dev/null +++ b/src/device/service/drivers/flexscale/FlexScaleDriver.py @@ -0,0 +1,151 @@ +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import json, logging, requests, threading +from requests.auth import HTTPBasicAuth +from typing import Any, Iterator, List, Optional, Tuple, Union +from common.method_wrappers.Decorator import MetricsPool, metered_subclass_method +from common.type_checkers.Checkers import chk_string, chk_type +from device.service.driver_api._Driver import _Driver +from . import ALL_RESOURCE_KEYS +from .Tools import find_key, add_lightpath, del_lightpath, get_lightpaths +from device.service.driver_api._Driver import _Driver, RESOURCE_ENDPOINTS +from device.service.drivers.ietf_l2vpn.TfsDebugApiClient import TfsDebugApiClient +from device.service.driver_api.ImportTopologyEnum import ImportTopologyEnum, get_import_topology + +LOGGER = logging.getLogger(__name__) + +DRIVER_NAME = 'flexscale' +METRICS_POOL = MetricsPool('Device', 'Driver', labels={'driver': DRIVER_NAME}) + + +class FlexScaleDriver(_Driver): + def __init__(self, address: str, port: int, **settings) -> None: + super().__init__(DRIVER_NAME, address, port, **settings) + self.__lock = threading.Lock() + self.__started = threading.Event() + self.__terminate = threading.Event() + username = self.settings.get('username') + password = self.settings.get('password') + self.__auth = HTTPBasicAuth(username, password) if username is not None and password is not None else None + scheme = self.settings.get('scheme', 'http') + self.dac = TfsDebugApiClient(self.address, int(self.port), scheme=scheme, username=username, password=password) + self.__flexscale_root = '{:s}://{:s}:{:d}'.format(scheme, self.address, int(self.port)) + self.__timeout = int(self.settings.get('timeout', 120)) + + # Options are: + # disabled --> just import endpoints as usual + # devices --> imports sub-devices but not links connecting them. + # (a remotely-controlled transport domain might exist between them) + # topology --> imports sub-devices and links connecting them. + # (not supported by XR driver) + self.__import_topology = get_import_topology(self.settings, default=ImportTopologyEnum.TOPOLOGY) + + + def Connect(self) -> bool: + url = self.__flexscale_root + '/OpticalTFS/GetLightpaths' + with self.__lock: + if self.__started.is_set(): return True + try: + requests.get(url, timeout=self.__timeout, verify=False, auth=self.__auth) + except requests.exceptions.Timeout: + LOGGER.exception('Timeout connecting {:s}'.format(str(self.__tapi_root))) + return False + except Exception: # pylint: disable=broad-except + LOGGER.exception('Exception connecting {:s}'.format(str(self.__tapi_root))) + return False + else: + self.__started.set() + return True + + def Disconnect(self) -> bool: + with self.__lock: + self.__terminate.set() + return True + + @metered_subclass_method(METRICS_POOL) + def GetInitialConfig(self) -> List[Tuple[str, Any]]: + with self.__lock: + return [] + + @metered_subclass_method(METRICS_POOL) + def GetConfig(self, resource_keys : List[str] = []) -> List[Tuple[str, Union[Any, None, Exception]]]: + chk_type('resources', resource_keys, list) + results = [] + with self.__lock: + if len(resource_keys) == 0: resource_keys = ALL_RESOURCE_KEYS + for i, resource_key in enumerate(resource_keys): + str_resource_name = 'resource_key[#{:d}]'.format(i) + chk_string(str_resource_name, resource_key, allow_empty=False) + + if resource_key == RESOURCE_ENDPOINTS: + # return endpoints through debug-api and list-devices method + results.extend(self.dac.get_devices_endpoints(self.__import_topology)) + + # results.extend(get_lightpaths( + # self.__flexscale_root, resource_key, timeout=self.__timeout, auth=self.__auth)) + return results + + @metered_subclass_method(METRICS_POOL) + def SetConfig(self, resources: List[Tuple[str, Any]]) -> List[Union[bool, Exception]]: + results = [] + if len(resources) == 0: + return results + with self.__lock: + for _, resource in resources: + LOGGER.info('resource = {:s}'.format(str(resource))) + + src_node = find_key(resource, 'src_node') + dst_node = find_key(resource, 'dst_node') + bitrate = find_key(resource, 'bitrate') + + response = add_lightpath(self.__flexscale_root, src_node, dst_node, bitrate, + auth=self.__auth, timeout=self.__timeout) + + results.extend(response) + return results + + @metered_subclass_method(METRICS_POOL) + def DeleteConfig(self, resources: List[Tuple[str, Any]]) -> List[Union[bool, Exception]]: + results = [] + if len(resources) == 0: + return results + with self.__lock: + for _, resource in resources: + LOGGER.info('resource = {:s}'.format(str(resource))) + flow_id = find_key(resource, 'flow_id') + src_node = find_key(resource, 'src_node') + dst_node = find_key(resource, 'dst_node') + bitrate = find_key(resource, 'bitrate') + + response = del_lightpath(self.__flexscale_root, flow_id, src_node, dst_node, bitrate) + results.extend(response) + + return results + + @metered_subclass_method(METRICS_POOL) + def SubscribeState(self, subscriptions : List[Tuple[str, float, float]]) -> List[Union[bool, Exception]]: + # FlexScale does not support monitoring by now + return [False for _ in subscriptions] + + @metered_subclass_method(METRICS_POOL) + def UnsubscribeState(self, subscriptions : List[Tuple[str, float, float]]) -> List[Union[bool, Exception]]: + # FlexScale does not support monitoring by now + return [False for _ in subscriptions] + + def GetState( + self, blocking=False, terminate : Optional[threading.Event] = None + ) -> Iterator[Tuple[float, str, Any]]: + # FlexScale does not support monitoring by now + return [] diff --git a/src/device/service/drivers/flexscale/Tools.py b/src/device/service/drivers/flexscale/Tools.py new file mode 100644 index 0000000000000000000000000000000000000000..2f74f36571e3918fdc6a963f4ab221ddbe3216e4 --- /dev/null +++ b/src/device/service/drivers/flexscale/Tools.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 json, logging, requests +from requests.auth import HTTPBasicAuth +from typing import Optional + +LOGGER = logging.getLogger(__name__) + +HTTP_OK_CODES = { + 200, # OK + 201, # Created + 202, # Accepted + 204, # No Content +} + +def find_key(resource, key): + return json.loads(resource[1])[key] + +def get_lightpaths(root_url : str, resource_key : str,auth : Optional[HTTPBasicAuth] = None, + timeout : Optional[int] = None): + headers = {'accept': 'application/json'} + url = '{:s}/OpticalTFS/GetLightpaths'.format(root_url) + + result = [] + try: + response = requests.get(url, timeout=timeout, headers=headers, verify=False, auth=auth) + except requests.exceptions.Timeout: + LOGGER.exception('Timeout connecting {:s}'.format(url)) + return result + except Exception as e: # pylint: disable=broad-except + LOGGER.exception('Exception retrieving {:s}'.format(resource_key)) + result.append((resource_key, e)) + return result + + try: + flows = json.loads(response.content) + except Exception as e: # pylint: disable=broad-except + LOGGER.warning('Unable to decode reply: {:s}'.format(str(response.content))) + result.append((resource_key, e)) + return result + + for flow in flows: + flow_id = flow.get('flow_id') + source = flow.get('src') + destination = flow.get('dst') + bitrate = flow.get('bitrate') + + endpoint_url = '/flows/flow[{:s}]'.format(flow_id) + endpoint_data = {'flow_id': flow_id, 'src': source, 'dst': destination, 'bitrate': bitrate} + result.append((endpoint_url, endpoint_data)) + + return result + + +def add_lightpath(root_url, src_node, dst_node, bitrate, + auth : Optional[HTTPBasicAuth] = None, timeout : Optional[int] = None): + + headers = {'accept': 'application/json'} + url = '{:s}/OpticalTFS/AddLightpath/{:s}/{:s}/{:s}'.format( + root_url, src_node, dst_node, bitrate) + + results = [] + try: + LOGGER.info('Lightpath request: {:s} <-> {:s} with {:s} bitrate'.format( + str(src_node), str(dst_node), str(bitrate))) + response = requests.put(url=url, timeout=timeout, headers=headers, verify=False, auth=auth) + results.append(response.json()) + LOGGER.info('Response: {:s}'.format(str(response))) + + except Exception as e: # pylint: disable=broad-except + LOGGER.exception('Exception requesting Lightpath: {:s} <-> {:s} with {:s} bitrate'.format( + str(src_node), str(dst_node), str(bitrate))) + results.append(e) + else: + if response.status_code not in HTTP_OK_CODES: + msg = 'Could not create Lightpath(status_code={:s} reply={:s}' + LOGGER.error(msg.format(str(response.status_code), str(response))) + results.append(response.status_code in HTTP_OK_CODES) + + return results + + + +def del_lightpath(root_url, flow_id, src_node, dst_node, bitrate, + auth : Optional[HTTPBasicAuth] = None, timeout : Optional[int] = None): + url = '{:s}/OpticalTFS/DelLightpath/{:s}/{:s}/{:s}/{:s}'.format( + root_url, flow_id, src_node, dst_node, bitrate) + headers = {'accept': 'application/json'} + + results = [] + + try: + response = requests.delete( + url=url, timeout=timeout, headers=headers, verify=False, auth=auth) + except Exception as e: # pylint: disable=broad-except + LOGGER.exception('Exception deleting Lightpath(uuid={:s})'.format(str(flow_id))) + results.append(e) + else: + if response.status_code not in HTTP_OK_CODES: + msg = 'Could not delete Lightpath(flow_id={:s}). status_code={:s} reply={:s}' + LOGGER.error(msg.format(str(flow_id), str(response.status_code), str(response))) + results.append(response.status_code in HTTP_OK_CODES) + + return results + + +def get_topology(root_url : str, resource_key : str,auth : Optional[HTTPBasicAuth] = None, + timeout : Optional[int] = None): + headers = {'accept': 'application/json'} + url = '{:s}/OpticalTFS/GetLinks'.format(root_url) + + result = [] + try: + response = requests.get(url, timeout=timeout, headers=headers, verify=False, auth=auth) + except requests.exceptions.Timeout: + LOGGER.exception('Timeout connecting {:s}'.format(url)) + return result + except Exception as e: # pylint: disable=broad-except + LOGGER.exception('Exception retrieving {:s}'.format(resource_key)) + result.append((resource_key, e)) + return result + + try: + response = json.loads(response.content) + except Exception as e: # pylint: disable=broad-except + LOGGER.warning('Unable to decode reply: {:s}'.format(str(response.content))) + result.append((resource_key, e)) + return result + + result.append(response) + return result diff --git a/src/device/service/drivers/flexscale/__init__.py b/src/device/service/drivers/flexscale/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..d5073c330b89bed63f08b0da86c4a7649c87b3dd --- /dev/null +++ b/src/device/service/drivers/flexscale/__init__.py @@ -0,0 +1,20 @@ +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT 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 device.service.driver_api._Driver import RESOURCE_ENDPOINTS, RESOURCE_SERVICES + +ALL_RESOURCE_KEYS = [ + RESOURCE_ENDPOINTS, + RESOURCE_SERVICES, +] diff --git a/src/device/service/drivers/ietf_l2vpn/IetfL2VpnDriver.py b/src/device/service/drivers/ietf_l2vpn/IetfL2VpnDriver.py index 9498dc84cc6991fd2295371842fa8508c961f1bc..c79dde99a4d3c48f2f27ff00451f50aa1af9bee2 100644 --- a/src/device/service/drivers/ietf_l2vpn/IetfL2VpnDriver.py +++ b/src/device/service/drivers/ietf_l2vpn/IetfL2VpnDriver.py @@ -19,6 +19,7 @@ from common.tools.object_factory.Device import json_device_id from common.tools.object_factory.EndPoint import json_endpoint_id from common.type_checkers.Checkers import chk_string, chk_type from device.service.driver_api._Driver import _Driver, RESOURCE_ENDPOINTS, RESOURCE_SERVICES +from device.service.driver_api.ImportTopologyEnum import ImportTopologyEnum, get_import_topology from device.service.drivers.ietf_l2vpn.TfsDebugApiClient import TfsDebugApiClient from .Tools import connection_point, wim_mapping from .WimconnectorIETFL2VPN import WimconnectorIETFL2VPN @@ -59,6 +60,14 @@ class IetfL2VpnDriver(_Driver): self.wim = WimconnectorIETFL2VPN(wim, wim_account, config=config) self.conn_info = {} # internal database emulating OSM storage provided to WIM Connectors + # Options are: + # disabled --> just import endpoints as usual + # devices --> imports sub-devices but not links connecting them. + # (a remotely-controlled transport domain might exist between them) + # topology --> imports sub-devices and links connecting them. + # (not supported by XR driver) + self.__import_topology = get_import_topology(self.settings, default=ImportTopologyEnum.DEVICES) + def Connect(self) -> bool: with self.__lock: try: @@ -93,7 +102,7 @@ class IetfL2VpnDriver(_Driver): chk_string(str_resource_name, resource_key, allow_empty=False) if resource_key == RESOURCE_ENDPOINTS: # return endpoints through debug-api and list-devices method - results.extend(self.dac.get_devices_endpoints()) + results.extend(self.dac.get_devices_endpoints(self.__import_topology)) elif resource_key == RESOURCE_SERVICES: # return all services through reply = self.wim.get_all_active_connectivity_services() diff --git a/src/device/service/drivers/ietf_l2vpn/TfsDebugApiClient.py b/src/device/service/drivers/ietf_l2vpn/TfsDebugApiClient.py index 4bf40af030fda990f96efe0ff8ab2ce54f82c312..06c55c5dc1b0feb77d817581ae5d735e1158e38d 100644 --- a/src/device/service/drivers/ietf_l2vpn/TfsDebugApiClient.py +++ b/src/device/service/drivers/ietf_l2vpn/TfsDebugApiClient.py @@ -15,8 +15,10 @@ import logging, requests from requests.auth import HTTPBasicAuth from typing import Dict, List, Optional +from device.service.driver_api.ImportTopologyEnum import ImportTopologyEnum GET_DEVICES_URL = '{:s}://{:s}:{:d}/restconf/debug-api/devices' +GET_LINKS_URL = '{:s}://{:s}:{:d}/restconf/debug-api/links' TIMEOUT = 30 HTTP_OK_CODES = { @@ -38,9 +40,11 @@ MAPPING_DRIVER = { 'DEVICEDRIVER_TRANSPORT_API' : 2, 'DEVICEDRIVER_P4' : 3, 'DEVICEDRIVER_IETF_NETWORK_TOPOLOGY': 4, - 'DEVICEDRIVER_ONF_TR_352' : 5, + 'DEVICEDRIVER_ONF_TR_532' : 5, 'DEVICEDRIVER_XR' : 6, 'DEVICEDRIVER_IETF_L2VPN' : 7, + 'DEVICEDRIVER_GNMI_OPENCONFIG' : 8, + 'DEVICEDRIVER_FLEXSCALE' : 9, } MSG_ERROR = 'Could not retrieve devices in remote TeraFlowSDN instance({:s}). status_code={:s} reply={:s}' @@ -52,16 +56,23 @@ class TfsDebugApiClient: self, address : str, port : int, scheme : str = 'http', username : Optional[str] = None, password : Optional[str] = None ) -> None: - self._url = GET_DEVICES_URL.format(scheme, address, port) + self._devices_url = GET_DEVICES_URL.format(scheme, address, port) + self._links_url = GET_LINKS_URL.format(scheme, address, port) self._auth = HTTPBasicAuth(username, password) if username is not None and password is not None else None - def get_devices_endpoints(self) -> List[Dict]: - reply = requests.get(self._url, timeout=TIMEOUT, verify=False, auth=self._auth) + def get_devices_endpoints(self, import_topology : ImportTopologyEnum = ImportTopologyEnum.DEVICES) -> List[Dict]: + LOGGER.debug('[get_devices_endpoints] begin') + LOGGER.debug('[get_devices_endpoints] import_topology={:s}'.format(str(import_topology))) + + reply = requests.get(self._devices_url, timeout=TIMEOUT, verify=False, auth=self._auth) if reply.status_code not in HTTP_OK_CODES: - msg = MSG_ERROR.format(str(self._url), str(reply.status_code), str(reply)) + msg = MSG_ERROR.format(str(self._devices_url), str(reply.status_code), str(reply)) LOGGER.error(msg) raise Exception(msg) + if import_topology == ImportTopologyEnum.DISABLED: + raise Exception('Unsupported import_topology mode: {:s}'.format(str(import_topology))) + result = list() for json_device in reply.json()['devices']: device_uuid : str = json_device['device_id']['device_uuid']['uuid'] @@ -89,4 +100,29 @@ class TfsDebugApiClient: } result.append((endpoint_url, endpoint_data)) + if import_topology == ImportTopologyEnum.DEVICES: + LOGGER.debug('[get_devices_endpoints] devices only; returning') + return result + + reply = requests.get(self._links_url, timeout=TIMEOUT, verify=False, auth=self._auth) + if reply.status_code not in HTTP_OK_CODES: + msg = MSG_ERROR.format(str(self._links_url), str(reply.status_code), str(reply)) + LOGGER.error(msg) + raise Exception(msg) + + for json_link in reply.json()['links']: + link_uuid : str = json_link['link_id']['link_uuid']['uuid'] + link_url = '/links/link[{:s}]'.format(link_uuid) + link_endpoint_ids = [ + (json_endpoint_id['device_id']['device_uuid']['uuid'], json_endpoint_id['endpoint_uuid']['uuid']) + for json_endpoint_id in json_link['link_endpoint_ids'] + ] + link_data = { + 'uuid': json_link['link_id']['link_uuid']['uuid'], + 'name': json_link['name'], + 'endpoints': link_endpoint_ids, + } + result.append((link_url, link_data)) + + LOGGER.debug('[get_devices_endpoints] topology; returning') return result diff --git a/src/device/service/drivers/openconfig/OpenConfigDriver.py b/src/device/service/drivers/openconfig/OpenConfigDriver.py index b34efbc8fbcc8e4a340e8c2282268b9f0246fddc..8c6e07b3f00a975a909161006e59e89de0ceaaf3 100644 --- a/src/device/service/drivers/openconfig/OpenConfigDriver.py +++ b/src/device/service/drivers/openconfig/OpenConfigDriver.py @@ -109,7 +109,10 @@ class NetconfSessionHandler: @RETRY_DECORATOR def get(self, filter=None, with_defaults=None): # pylint: disable=redefined-builtin with self.__lock: - return self.__manager.get(filter=filter, with_defaults=with_defaults) + if self.__vendor == 'JUNIPER'and not 'component' in str(filter): + return self.__manager.get_config(source="running", filter=filter, with_defaults=with_defaults) + else: + return self.__manager.get(filter=filter, with_defaults=with_defaults) @RETRY_DECORATOR def edit_config( diff --git a/src/device/service/drivers/openconfig/templates/Interfaces.py b/src/device/service/drivers/openconfig/templates/Interfaces.py index 3855db17b45505d4131089b2b9abd995fa221419..3d4c73fc11c686b4d4e181a1f98ed3f5922f7c15 100644 --- a/src/device/service/drivers/openconfig/templates/Interfaces.py +++ b/src/device/service/drivers/openconfig/templates/Interfaces.py @@ -22,6 +22,7 @@ LOGGER = logging.getLogger(__name__) XPATH_INTERFACES = "//oci:interfaces/oci:interface" XPATH_SUBINTERFACES = ".//oci:subinterfaces/oci:subinterface" XPATH_IPV4ADDRESSES = ".//ociip:ipv4/ociip:addresses/ociip:address" +XPATH_IPV6ADDRESSES = ".//ociip:ipv6/ociip:addresses/ociip:address" def parse(xml_data : ET.Element) -> List[Tuple[str, Dict[str, Any]]]: response = [] @@ -97,6 +98,15 @@ def parse(xml_data : ET.Element) -> List[Tuple[str, Dict[str, Any]]]: #add_value_from_collection(subinterface, 'ipv4_addresses', ipv4_addresses) + for xml_ipv6_address in xml_subinterface.xpath(XPATH_IPV6ADDRESSES, namespaces=NAMESPACES): + #LOGGER.info('xml_ipv6_address = {:s}'.format(str(ET.tostring(xml_ipv6_address)))) + + address = xml_ipv6_address.find('ociip:state/ociip:ip', namespaces=NAMESPACES) + add_value_from_tag(subinterface, 'address_ipv6', address) + + prefix = xml_ipv6_address.find('ociip:state/ociip:prefix-length', namespaces=NAMESPACES) + add_value_from_tag(subinterface, 'address_prefix_v6', prefix, cast=int) + if len(subinterface) == 0: continue resource_key = '/interface[{:s}]/subinterface[{:s}]'.format(interface['name'], str(subinterface['index'])) response.append((resource_key, subinterface)) diff --git a/src/device/service/drivers/openconfig/templates/Inventory.py b/src/device/service/drivers/openconfig/templates/Inventory.py new file mode 100644 index 0000000000000000000000000000000000000000..2ae67ba47dad162b8c8e4a15d3004b27359d4ca2 --- /dev/null +++ b/src/device/service/drivers/openconfig/templates/Inventory.py @@ -0,0 +1,157 @@ +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import logging, lxml.etree as ET +from typing import Any, Dict, List, Tuple +from .Namespace import NAMESPACES +from .Tools import add_value_from_tag + +LOGGER = logging.getLogger(__name__) + +XPATH_PORTS = "//ocp:components/ocp:component" + +""" +#Method Name: parse + +#Parameters: + + - xml_data: [ET.Element] Represents the XML data to be parsed. + +# Functionality: + + The parse function of the inventerio class has the functionality to parse + an XML document represented by the xml_data parameter and extract specific + information from the XML elements, namely the relevant characteristics of the + components. + + To generate the template the following steps are performed: + + 1) An empty list called response is created to store the results of the analysis. + + 2) Iterate over the XML elements that match the pattern specified by the XPATH_PORTS + expression. These elements represent components in the XML document. + + 3) For each component element: + A dictionary called inventory is initialized that will store the information extracted + from the component.The values of the relevant XML elements are extracted and added to + the dictionary. + +#Return: + List[Tuple[str, Dict[str, Any]]] The response list containing the tuples (path, dictionary) + with the information extracted from the XML document components is returned. +""" + +def parse(xml_data : ET.Element) -> List[Tuple[str, Dict[str, Any]]]: + response = [] + LOGGER.debug("InventoryPrueba") + parent_types = {} + for xml_component in xml_data.xpath(XPATH_PORTS, namespaces=NAMESPACES): + LOGGER.info('xml_component inventario = {:s}'.format(str(ET.tostring(xml_component)))) + inventory = {} + inventory['parent-component-references'] = '' + inventory['name'] = '' + inventory['class'] = '' + inventory['attributes'] = {} + component_reference = [] + + component_name = xml_component.find('ocp:name', namespaces=NAMESPACES) + if component_name is None or component_name.text is None: continue + add_value_from_tag(inventory, 'name', component_name) + + component_description = xml_component.find('ocp:state/ocp:description', namespaces=NAMESPACES) + if not component_description is None: + add_value_from_tag(inventory['attributes'], 'description', component_description) + + component_location = xml_component.find('ocp:state/ocp:location', namespaces=NAMESPACES) + if not component_location is None: + add_value_from_tag(inventory['attributes'], 'location', component_location) + + component_type = xml_component.find('ocp:state/ocp:type', namespaces=NAMESPACES) + component_type.text = component_type.text.replace('oc-platform-types:','') + if component_type is None: continue + add_value_from_tag(inventory, 'class', component_type) + + if inventory['class'] == 'CPU' or inventory['class'] == 'STORAGE': continue + + component_empty = xml_component.find('ocp:state/ocp:empty', namespaces=NAMESPACES) + if not component_empty is None: + add_value_from_tag(inventory['attributes'], 'empty', component_empty) + + component_parent = xml_component.find('ocp:state/ocp:parent', namespaces=NAMESPACES) + if not component_parent is None: + add_value_from_tag(inventory, 'parent-component-references', component_parent) + + component_HW = xml_component.find('ocp:state/ocp:hardware-version', namespaces=NAMESPACES) + if not component_HW is None: + add_value_from_tag(inventory['attributes'], 'hardware-rev', component_HW) + + component_firmware_version = xml_component.find('ocp:state/ocp:firmware-version', namespaces=NAMESPACES) + if not component_firmware_version is None: + add_value_from_tag(inventory['attributes'], 'firmware-rev', component_firmware_version) + + component_SW = xml_component.find('ocp:state/ocp:software-version', namespaces=NAMESPACES) + if not component_SW is None: + add_value_from_tag(inventory['attributes'], 'software-rev', component_SW) + + component_serial = xml_component.find('ocp:state/ocp:serial-no', namespaces=NAMESPACES) + if not component_serial is None: + add_value_from_tag(inventory['attributes'], 'serial-num', component_serial) + + component_mfg_name = xml_component.find('ocp:state/ocp:mfg-name', namespaces=NAMESPACES) + if not component_mfg_name is None: + add_value_from_tag(inventory['attributes'], 'manufacturer-name', component_mfg_name) + + component_removable = xml_component.find('ocp:state/ocp:removable', namespaces=NAMESPACES) + if not component_removable is None: + add_value_from_tag(inventory['attributes'], 'removable', component_removable) + + component_mfg_date = xml_component.find('ocp:state/ocp:mfg-date', namespaces=NAMESPACES) + if not component_mfg_date is None: + add_value_from_tag(inventory['attributes'], 'mfg-date', component_mfg_date) + + #Transceiver Information + component_serial_t = xml_component.find('ocptr:transceiver/ocptr:state/ocptr:serial-no', namespaces=NAMESPACES) + if not component_serial_t is None: + add_value_from_tag(inventory['attributes'], 'serial-num', component_serial_t) + + component_present = xml_component.find('ocptr:transceiver/ocptr:state/ocptr:present', namespaces=NAMESPACES) + if component_present is not None and 'NOT_PRESENT' in component_present.text: continue + + component_vendor = xml_component.find('ocptr:transceiver/ocptr:state/ocptr:vendor', namespaces=NAMESPACES) + if not component_vendor is None: + add_value_from_tag(inventory['attributes'], 'vendor', component_vendor) + component_connector = xml_component.find('ocptr:transceiver/ocptr:state/ocptr:connector-type', namespaces=NAMESPACES) + if not component_connector is None: + component_connector.text = component_connector.text.replace('oc-opt-types:','') + add_value_from_tag(inventory['attributes'], 'connector-type', component_connector) + + component_form = xml_component.find('ocptr:transceiver/ocptr:state/ocptr:form-factor', namespaces=NAMESPACES) + if not component_form is None: + component_form.text = component_form.text.replace('oc-opt-types:','') + add_value_from_tag(inventory['attributes'], 'form-factor', component_form) + + if inventory['parent-component-references'] not in parent_types: + parent_types[inventory['parent-component-references']] = len(parent_types) + 1 + + component_reference.extend([parent_types[inventory['parent-component-references']]]) + + response.append(('/inventory/{:s}'.format(inventory['name']), inventory)) + + for tupla in response: + if inventory['parent-component-references'] in tupla[0]: + component_reference.extend([tupla[1]['class']]) + + inventory['component-reference'] = component_reference + + return response diff --git a/src/device/service/drivers/openconfig/templates/Namespace.py b/src/device/service/drivers/openconfig/templates/Namespace.py index eede865502b043b7936d763c980be80a7ea817f8..bdc27a1ff30d5ac18b9233cdd420cd8493e7a419 100644 --- a/src/device/service/drivers/openconfig/templates/Namespace.py +++ b/src/device/service/drivers/openconfig/templates/Namespace.py @@ -28,6 +28,7 @@ NAMESPACE_POLICY_TYPES = 'http://openconfig.net/yang/policy-types' NAMESPACE_POLICY_TYPES_2 = 'http://openconfig.net/yang/policy_types' NAMESPACE_ROUTING_POLICY = 'http://openconfig.net/yang/routing-policy' NAMESPACE_VLAN = 'http://openconfig.net/yang/vlan' +NAMESPACE_PLATFORM_TRANSCEIVER = 'http://openconfig.net/yang/platform/transceiver' NAMESPACES = { 'nc' : NAMESPACE_NETCONF, @@ -44,4 +45,5 @@ NAMESPACES = { 'ocpt2': NAMESPACE_POLICY_TYPES_2, 'ocrp' : NAMESPACE_ROUTING_POLICY, 'ocv' : NAMESPACE_VLAN, + 'ocptr': NAMESPACE_PLATFORM_TRANSCEIVER, } diff --git a/src/device/service/drivers/openconfig/templates/__init__.py b/src/device/service/drivers/openconfig/templates/__init__.py index 1f86b719227f4def0bc18c45997925846defbc56..87eea1f0b6673c4bff3222598d81a16b383b4c3b 100644 --- a/src/device/service/drivers/openconfig/templates/__init__.py +++ b/src/device/service/drivers/openconfig/templates/__init__.py @@ -20,15 +20,17 @@ from jinja2 import Environment, PackageLoader, select_autoescape import paramiko from .Tools import generate_templates from device.service.driver_api._Driver import ( - RESOURCE_ENDPOINTS, RESOURCE_INTERFACES, RESOURCE_NETWORK_INSTANCES, RESOURCE_ROUTING_POLICIES, RESOURCE_ACL) + RESOURCE_ENDPOINTS, RESOURCE_INTERFACES, RESOURCE_NETWORK_INSTANCES, RESOURCE_ROUTING_POLICIES, RESOURCE_ACL, RESOURCE_INVENTORY) from .EndPoints import parse as parse_endpoints from .Interfaces import parse as parse_interfaces, parse_counters from .NetworkInstances import parse as parse_network_instances from .RoutingPolicy import parse as parse_routing_policy from .Acl import parse as parse_acl +from .Inventory import parse as parse_inventory LOGGER = logging.getLogger(__name__) ALL_RESOURCE_KEYS = [ + RESOURCE_INVENTORY, RESOURCE_ENDPOINTS, RESOURCE_INTERFACES, RESOURCE_ROUTING_POLICIES, # routing policies should come before network instances @@ -37,6 +39,7 @@ ALL_RESOURCE_KEYS = [ ] RESOURCE_KEY_MAPPINGS = { + RESOURCE_INVENTORY : 'inventory', RESOURCE_ENDPOINTS : 'component', RESOURCE_INTERFACES : 'interface', RESOURCE_NETWORK_INSTANCES: 'network_instance', @@ -45,6 +48,7 @@ RESOURCE_KEY_MAPPINGS = { } RESOURCE_PARSERS = { + 'inventory' : parse_inventory, 'component' : parse_endpoints, 'interface' : parse_interfaces, 'network_instance': parse_network_instances, diff --git a/src/device/service/drivers/openconfig/templates/inventory/get.xml b/src/device/service/drivers/openconfig/templates/inventory/get.xml new file mode 100644 index 0000000000000000000000000000000000000000..aa25ed1e3b11e0c324b361eb52d064dac87a64c5 --- /dev/null +++ b/src/device/service/drivers/openconfig/templates/inventory/get.xml @@ -0,0 +1,3 @@ + + + diff --git a/src/device/service/drivers/p4/p4_driver.py b/src/device/service/drivers/p4/p4_driver.py index 9577b9dad436929d9d9ee1804bcac47cf5c26f91..6bb5fbe41b02ec07a86422ab79afce1bc40c01cd 100644 --- a/src/device/service/drivers/p4/p4_driver.py +++ b/src/device/service/drivers/p4/p4_driver.py @@ -74,14 +74,13 @@ class P4Driver(_Driver): """ def __init__(self, address: str, port: int, **settings) -> None: - # pylint: disable=super-init-not-called + super().__init__(settings.pop('name', DRIVER_NAME), address, port, **settings) self.__manager = None self.__address = address self.__port = int(port) self.__endpoint = None self.__settings = settings self.__id = None - self.__name = DRIVER_NAME self.__vendor = P4_VAL_DEF_VENDOR self.__hw_version = P4_VAL_DEF_HW_VER self.__sw_version = P4_VAL_DEF_SW_VER diff --git a/src/device/service/drivers/xr/README_XR.md b/src/device/service/drivers/xr/README_XR.md index 9c64cdef1b773e84153c0d27a58e71af8bdf238f..1255002ac1aa13cfe4c9240305431f7070333668 100644 --- a/src/device/service/drivers/xr/README_XR.md +++ b/src/device/service/drivers/xr/README_XR.md @@ -52,7 +52,7 @@ Script requires more variables than before as of February 2023. # See https://labs.etsi.org/rep/tfs/controller/-/blob/develop/my_deploy.sh # Use docker run -d -p 32000:5000 --restart=always --name registry registry:2 export TFS_REGISTRY_IMAGE="http://localhost:32000/tfs/" -export TFS_COMPONENTS="context device automation monitoring pathcomp service slice compute webui load_generator" +export TFS_COMPONENTS="context device ztp monitoring pathcomp service slice nbi webui load_generator" export TFS_IMAGE_TAG="dev" export TFS_K8S_NAMESPACE="tfs" export TFS_EXTRA_MANIFESTS="manifests/nginx_ingress_http.yaml" @@ -113,14 +113,14 @@ Run deploy script to build in docker containers and then instantiate to configur If protobuf definitions have changed, regenerate version controlled Java files manually (it is a horrifying bug in build system that this is not automated!). ``` -cd automation +cd ztp # In case Java is not already installed sudo apt-get install openjdk-11-jdk -y export MAVEN_OPTS='--add-exports=java.base/jdk.internal.module=ALL-UNNAMED --add-exports jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED --add-exports jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED --add-exports jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED --add-exports jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED --add-exports jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED --add-exports jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED' cd src/policy ./mvnw compile cd - -cd src/automation +cd src/ztp ./mvnw compile ``` diff --git a/src/device/service/drivers/xr/service-cli.py b/src/device/service/drivers/xr/service-cli.py index 7ab9606cef7bd7d3cca4f414cbd704ab150c8f52..88631682b66a38e0e6bbc23216890cb0da2f5b94 100755 --- a/src/device/service/drivers/xr/service-cli.py +++ b/src/device/service/drivers/xr/service-cli.py @@ -70,7 +70,7 @@ def make_service_client(): def make_osm_wim(): wim_url = 'http://{:s}:{:s}'.format( - get_setting('COMPUTESERVICE_SERVICE_HOST'), str(get_setting('COMPUTESERVICE_SERVICE_PORT_HTTP'))) + get_setting('NBISERVICE_SERVICE_HOST'), str(get_setting('NBISERVICE_SERVICE_PORT_HTTP'))) return MockOSM(wim_url, WIM_MAPPING, WIM_USERNAME, WIM_PASSWORD) @dataclass diff --git a/src/device/service/drivers/xr/setup_test_env.sh b/src/device/service/drivers/xr/setup_test_env.sh index bd5463cd4f9d08c903fc601cfcb7241b672e7681..f0573e5d11813c7830436a018e47daf24cded986 100755 --- a/src/device/service/drivers/xr/setup_test_env.sh +++ b/src/device/service/drivers/xr/setup_test_env.sh @@ -15,13 +15,13 @@ 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}') +export NBISERVICE_SERVICE_HOST=$(kubectl get service/nbiservice --namespace tfs --template '{{.spec.clusterIP}}') +export NBISERVICE_SERVICE_PORT_HTTP=$(kubectl get service/nbiservice --namespace tfs -o jsonpath='{.spec.ports[?(@.name=="http")].port}') export SERVICESERVICE_SERVICE_HOST=$(kubectl get service/serviceservice --namespace tfs --template '{{.spec.clusterIP}}') export SERVICESERVICE_SERVICE_PORT_GRPC=$(kubectl get service/serviceservice --namespace tfs -o jsonpath='{.spec.ports[?(@.name=="grpc")].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" +echo "NBISERVICE_SERVICE_HOST=$NBISERVICE_SERVICE_HOST" +echo "NBISERVICE_SERVICE_PORT_HTTP=$NBISERVICE_SERVICE_PORT_HTTP" echo "SERVICESERVICE_SERVICE_HOST=$SERVICESERVICE_SERVICE_HOST" echo "SERVICESERVICE_SERVICE_PORT_GRPC=$SERVICESERVICE_SERVICE_PORT_GRPC" diff --git a/src/dlt/connector/Dockerfile b/src/dlt/connector/Dockerfile index f4d85ec8c591041e920c7404acc862c3d5a4a560..8e3a2f95380237cfd64508fc2f0a6c0e9be91333 100644 --- a/src/dlt/connector/Dockerfile +++ b/src/dlt/connector/Dockerfile @@ -16,7 +16,7 @@ FROM python:3.9-slim # Install dependencies RUN apt-get --yes --quiet --quiet update && \ - apt-get --yes --quiet --quiet install wget g++ && \ + apt-get --yes --quiet --quiet install wget g++ git && \ rm -rf /var/lib/apt/lists/* # Set Python to show logs as they occur diff --git a/src/dlt/mock_blockchain/Dockerfile b/src/dlt/mock_blockchain/Dockerfile index 09fe5d399c8455f8fd898d6b4c9eb992c8c9d469..af1edb3d52f419c31274d24226f9e9b7e9a29f7b 100644 --- a/src/dlt/mock_blockchain/Dockerfile +++ b/src/dlt/mock_blockchain/Dockerfile @@ -16,7 +16,7 @@ FROM python:3.9-slim # Install dependencies RUN apt-get --yes --quiet --quiet update && \ - apt-get --yes --quiet --quiet install wget g++ && \ + apt-get --yes --quiet --quiet install wget g++ git && \ rm -rf /var/lib/apt/lists/* # Set Python to show logs as they occur diff --git a/src/e2e_orchestrator/.gitlab-ci.yml b/src/e2e_orchestrator/.gitlab-ci.yml new file mode 100644 index 0000000000000000000000000000000000000000..a14a215afc33067e923a7064b8f4617c61f4de9d --- /dev/null +++ b/src/e2e_orchestrator/.gitlab-ci.yml @@ -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. + +# build, tag and push the Docker image to the gitlab registry +build e2eorchestrator: + variables: + IMAGE_NAME: 'e2eorchestrator' # name of the microservice + IMAGE_TAG: 'latest' # tag of the container image (production, development, etc) + stage: build + before_script: + - docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY + script: + - docker build -t "$IMAGE_NAME:$IMAGE_TAG" -f ./src/$IMAGE_NAME/Dockerfile . + - docker tag "$IMAGE_NAME:$IMAGE_TAG" "$CI_REGISTRY_IMAGE/$IMAGE_NAME:$IMAGE_TAG" + - docker push "$CI_REGISTRY_IMAGE/$IMAGE_NAME:$IMAGE_TAG" + after_script: + - docker images --filter="dangling=true" --quiet | xargs -r docker rmi + rules: + - if: '$CI_PIPELINE_SOURCE == "merge_request_event" && ($CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "develop" || $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == $CI_DEFAULT_BRANCH)' + - if: '$CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_BRANCH == "develop"' + - changes: + - src/$IMAGE_NAME/**/*.{py,in,yml} + - src/$IMAGE_NAME/Dockerfile + - src/$IMAGE_NAME/tests/*.py + - src/$IMAGE_NAME/tests/Dockerfile + - manifests/${IMAGE_NAME}service.yaml + - .gitlab-ci.yml diff --git a/src/e2e_orchestrator/Config.py b/src/e2e_orchestrator/Config.py new file mode 100644 index 0000000000000000000000000000000000000000..38d04994fb0fa1951fb465bc127eb72659dc2eaf --- /dev/null +++ b/src/e2e_orchestrator/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/e2e_orchestrator/Dockerfile b/src/e2e_orchestrator/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..85b7f1666bf9c49318da441eeb6bf6050def8db7 --- /dev/null +++ b/src/e2e_orchestrator/Dockerfile @@ -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. + +FROM python:3.9-slim + +# Install dependencies +RUN apt-get --yes --quiet --quiet update && \ + apt-get --yes --quiet --quiet install wget g++ && \ + rm -rf /var/lib/apt/lists/* + +# Set Python to show logs as they occur +ENV PYTHONUNBUFFERED=0 +ENV PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=python + +# Download the gRPC health probe +RUN GRPC_HEALTH_PROBE_VERSION=v0.2.0 && \ + wget -qO/bin/grpc_health_probe https://github.com/grpc-ecosystem/grpc-health-probe/releases/download/${GRPC_HEALTH_PROBE_VERSION}/grpc_health_probe-linux-amd64 && \ + chmod +x /bin/grpc_health_probe + +# Creating a user for security reasons +RUN groupadd -r teraflow && useradd -u 1001 --no-log-init -r -m -g teraflow teraflow +USER teraflow + +# set working directory +RUN mkdir -p /home/teraflow/controller/common/ +WORKDIR /home/teraflow/controller + +# Get Python packages per module +ENV VIRTUAL_ENV=/home/teraflow/venv +RUN python3 -m venv ${VIRTUAL_ENV} +ENV PATH="${VIRTUAL_ENV}/bin:${PATH}" + +# Get generic Python packages +RUN python3 -m pip install --upgrade pip +RUN python3 -m pip install --upgrade setuptools wheel +RUN python3 -m pip install --upgrade pip-tools + +# Get common Python packages +# Note: this step enables sharing the previous Docker build steps among all the Python components +COPY --chown=teraflow:teraflow common_requirements.in common_requirements.in +RUN pip-compile --quiet --output-file=common_requirements.txt common_requirements.in +RUN python3 -m pip install -r common_requirements.txt + +# Add common files into working directory +WORKDIR /home/teraflow/controller/common +COPY --chown=teraflow:teraflow src/common/. ./ +RUN rm -rf proto + +# Create proto sub-folder, copy .proto files, and generate Python code +RUN mkdir -p /home/teraflow/controller/common/proto +WORKDIR /home/teraflow/controller/common/proto +RUN touch __init__.py +COPY --chown=teraflow:teraflow proto/*.proto ./ +RUN python3 -m grpc_tools.protoc -I=. --python_out=. --grpc_python_out=. *.proto +RUN rm *.proto +RUN find . -type f -exec sed -i -E 's/(import\ .*)_pb2/from . \1_pb2/g' {} \; + +# Create module sub-folders +RUN mkdir -p /home/teraflow/controller/e2e_orchestrator +WORKDIR /home/teraflow/controller + +# Get Python packages per module +COPY --chown=teraflow:teraflow ./src/e2e_orchestrator/requirements.in e2e_orchestrator/requirements.in +# consider common and specific requirements to avoid inconsistencies with dependencies +RUN pip-compile --quiet --output-file=e2e_orchestrator/requirements.txt e2e_orchestrator/requirements.in common_requirements.in +RUN python3 -m pip install -r e2e_orchestrator/requirements.txt + +# Add component files into working directory +COPY --chown=teraflow:teraflow ./src/context/. context +COPY --chown=teraflow:teraflow ./src/e2e_orchestrator/. e2e_orchestrator + +# Start the service +ENTRYPOINT ["python", "-m", "e2e_orchestrator.service"] diff --git a/src/e2e_orchestrator/__init__.py b/src/e2e_orchestrator/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..38d04994fb0fa1951fb465bc127eb72659dc2eaf --- /dev/null +++ b/src/e2e_orchestrator/__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/e2e_orchestrator/client/E2EOrchestratorClient.py b/src/e2e_orchestrator/client/E2EOrchestratorClient.py new file mode 100644 index 0000000000000000000000000000000000000000..10f183a51a64671a3cc97cc2c13d23ffd55c03fb --- /dev/null +++ b/src/e2e_orchestrator/client/E2EOrchestratorClient.py @@ -0,0 +1,69 @@ +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import logging + +import grpc + +from common.Constants import ServiceNameEnum +from common.proto.context_pb2 import Empty +from common.proto.e2eorchestrator_pb2_grpc import E2EOrchestratorServiceStub +from common.Settings import get_service_host, get_service_port_grpc +from common.tools.client.RetryDecorator import delay_exponential, retry +from common.tools.grpc.Tools import grpc_message_to_json +from common.proto.e2eorchestrator_pb2 import E2EOrchestratorRequest, E2EOrchestratorReply + +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 E2EOrchestratorClient: + def __init__(self, host=None, port=None): + if not host: + host = get_service_host(ServiceNameEnum.E2EORCHESTRATOR) + if not port: + port = get_service_port_grpc(ServiceNameEnum.E2EORCHESTRATOR) + 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 = E2EOrchestratorServiceStub(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: E2EOrchestratorRequest) -> E2EOrchestratorReply: + LOGGER.info( + "Compute request: {:s}".format(str(grpc_message_to_json(request))) + ) + response = self.stub.Compute(request) + LOGGER.info( + "Compute result: {:s}".format(str(grpc_message_to_json(response))) + ) + return response diff --git a/src/e2e_orchestrator/client/__init__.py b/src/e2e_orchestrator/client/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..38d04994fb0fa1951fb465bc127eb72659dc2eaf --- /dev/null +++ b/src/e2e_orchestrator/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/compute/requirements.in b/src/e2e_orchestrator/requirements.in similarity index 87% rename from src/compute/requirements.in rename to src/e2e_orchestrator/requirements.in index 08bbf281a385652013adda02a97e64df7a366c43..4c4720a2df4482faeda1ad99f9d383ebb5c0f848 100644 --- a/src/compute/requirements.in +++ b/src/e2e_orchestrator/requirements.in @@ -12,8 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -Flask==2.1.3 -Flask-HTTPAuth==4.5.0 -Flask-RESTful==0.3.9 -jsonschema==4.4.0 -requests==2.27.1 +networkx \ No newline at end of file diff --git a/src/e2e_orchestrator/service/E2EOrchestratorService.py b/src/e2e_orchestrator/service/E2EOrchestratorService.py new file mode 100644 index 0000000000000000000000000000000000000000..4d6125d4a11210786de5cb83970743f480d4c8cf --- /dev/null +++ b/src/e2e_orchestrator/service/E2EOrchestratorService.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 logging + +from common.Constants import ServiceNameEnum +from common.proto.e2eorchestrator_pb2_grpc import add_E2EOrchestratorServiceServicer_to_server +from common.Settings import get_service_port_grpc +from common.tools.service.GenericGrpcService import GenericGrpcService +from .E2EOrchestratorServiceServicerImpl import E2EOrchestratorServiceServicerImpl + +LOGGER = logging.getLogger(__name__) + + +class E2EOrchestratorService(GenericGrpcService): + def __init__(self, cls_name: str = __name__): + port = get_service_port_grpc(ServiceNameEnum.E2EORCHESTRATOR) + super().__init__(port, cls_name=cls_name) + self.e2eorchestrator_servicer = E2EOrchestratorServiceServicerImpl() + + def install_servicers(self): + add_E2EOrchestratorServiceServicer_to_server( + self.e2eorchestrator_servicer, self.server + ) diff --git a/src/e2e_orchestrator/service/E2EOrchestratorServiceServicerImpl.py b/src/e2e_orchestrator/service/E2EOrchestratorServiceServicerImpl.py new file mode 100644 index 0000000000000000000000000000000000000000..d233f2e17a6485d425013ab4064501bc0bad84bf --- /dev/null +++ b/src/e2e_orchestrator/service/E2EOrchestratorServiceServicerImpl.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 logging + +import networkx as nx +import grpc +import copy + +from common.Constants import ServiceNameEnum +from common.method_wrappers.Decorator import (MetricsPool, MetricTypeEnum, safe_and_metered_rpc_method) +from common.proto.e2eorchestrator_pb2 import E2EOrchestratorRequest, E2EOrchestratorReply +from common.proto.context_pb2 import Empty, Connection, EndPointId +from common.proto.e2eorchestrator_pb2_grpc import E2EOrchestratorServiceServicer +from context.client.ContextClient import ContextClient +from context.service.database.uuids.EndPoint import endpoint_get_uuid + + +LOGGER = logging.getLogger(__name__) + +METRICS_POOL = MetricsPool("E2EOrchestrator", "RPC") + +context_client: ContextClient = ContextClient() + + +class E2EOrchestratorServiceServicerImpl(E2EOrchestratorServiceServicer): + def __init__(self): + LOGGER.debug("Creating Servicer...") + LOGGER.debug("Servicer Created") + + @safe_and_metered_rpc_method(METRICS_POOL, LOGGER) + def Compute(self, request: E2EOrchestratorRequest, context: grpc.ServicerContext) -> E2EOrchestratorReply: + endpoints_ids = [] + for endpoint_id in request.service.service_endpoint_ids: + endpoints_ids.append(endpoint_get_uuid(endpoint_id)[2]) + + graph = nx.Graph() + + devices = context_client.ListDevices(Empty()).devices + + for device in devices: + endpoints_uuids = [endpoint.endpoint_id.endpoint_uuid.uuid + for endpoint in device.device_endpoints] + for ep in endpoints_uuids: + graph.add_node(ep) + + for ep in endpoints_uuids: + for ep_i in endpoints_uuids: + if ep == ep_i: + continue + graph.add_edge(ep, ep_i) + + links = context_client.ListLinks(Empty()).links + for link in links: + eps = [] + for endpoint_id in link.link_endpoint_ids: + eps.append(endpoint_id.endpoint_uuid.uuid) + graph.add_edge(eps[0], eps[1]) + + + shortest = nx.shortest_path(graph, endpoints_ids[0], endpoints_ids[1]) + + path = E2EOrchestratorReply() + path.services.append(copy.deepcopy(request.service)) + for i in range(0, int(len(shortest)/2)): + conn = Connection() + ep_a_uuid = str(shortest[i*2]) + ep_z_uuid = str(shortest[i*2+1]) + + conn.connection_id.connection_uuid.uuid = str(ep_a_uuid) + '_->_' + str(ep_z_uuid) + + ep_a_id = EndPointId() + ep_a_id.endpoint_uuid.uuid = ep_a_uuid + conn.path_hops_endpoint_ids.append(ep_a_id) + + ep_z_id = EndPointId() + ep_z_id.endpoint_uuid.uuid = ep_z_uuid + conn.path_hops_endpoint_ids.append(ep_z_id) + + path.connections.append(conn) + + return path diff --git a/src/e2e_orchestrator/service/__init__.py b/src/e2e_orchestrator/service/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..38d04994fb0fa1951fb465bc127eb72659dc2eaf --- /dev/null +++ b/src/e2e_orchestrator/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/e2e_orchestrator/service/__main__.py b/src/e2e_orchestrator/service/__main__.py new file mode 100644 index 0000000000000000000000000000000000000000..a586543a7078d9b7f868967ad7eea7d228985086 --- /dev/null +++ b/src/e2e_orchestrator/service/__main__.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 +import signal +import sys +import threading + +from prometheus_client import start_http_server + +from common.Constants import ServiceNameEnum +from common.Settings import (ENVVAR_SUFIX_SERVICE_HOST, + ENVVAR_SUFIX_SERVICE_PORT_GRPC, get_env_var_name, + get_log_level, get_metrics_port, + wait_for_environment_variables) + +from .E2EOrchestratorService import E2EOrchestratorService + +terminate = threading.Event() +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) + LOGGER = logging.getLogger(__name__) + + wait_for_environment_variables( + [ + get_env_var_name(ServiceNameEnum.E2EORCHESTRATOR, ENVVAR_SUFIX_SERVICE_HOST), + get_env_var_name(ServiceNameEnum.E2EORCHESTRATOR, ENVVAR_SUFIX_SERVICE_PORT_GRPC), + ] + ) + + signal.signal(signal.SIGINT, signal_handler) + signal.signal(signal.SIGTERM, signal_handler) + + LOGGER.info("Starting...") + + # Start metrics server + metrics_port = get_metrics_port() + start_http_server(metrics_port) + + # Starting CentralizedCybersecurity service + grpc_service = E2EOrchestratorService() + grpc_service.start() + LOGGER.info("Started...") + # Wait for Ctrl+C or termination signal + + while not terminate.wait(timeout=1): + pass + + + LOGGER.info("Terminating...") + grpc_service.stop() + + LOGGER.info("Bye") + return 0 + + +if __name__ == "__main__": + sys.exit(main()) diff --git a/src/compute/__init__.py b/src/e2e_orchestrator/tests/__init__.py similarity index 100% rename from src/compute/__init__.py rename to src/e2e_orchestrator/tests/__init__.py diff --git a/src/e2e_orchestrator/tests/deploy_specs.sh b/src/e2e_orchestrator/tests/deploy_specs.sh new file mode 100755 index 0000000000000000000000000000000000000000..67aed976a4f89d13e28470491a6260d5d5ea3a35 --- /dev/null +++ b/src/e2e_orchestrator/tests/deploy_specs.sh @@ -0,0 +1,154 @@ +#!/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 pathcomp service slice nbi webui load_generator" +export TFS_COMPONENTS="context device pathcomp service slice nbi webui" + +# Uncomment to activate Monitoring +# export TFS_COMPONENTS="${TFS_COMPONENTS} monitoring" + +# Uncomment to activate ZTP and Policy Manager +#export TFS_COMPONENTS="${TFS_COMPONENTS} ztp policy" +# export TFS_COMPONENTS="${TFS_COMPONENTS} ztp" + +# Uncomment to activate Optical CyberSecurity +#export TFS_COMPONENTS="${TFS_COMPONENTS} dbscanserving opticalattackmitigator opticalattackdetector opticalattackmanager" + +# Uncomment to activate L3 CyberSecurity +#export TFS_COMPONENTS="${TFS_COMPONENTS} l3_attackmitigator l3_centralizedattackdetector" + +# Uncomment to activate TE +#export TFS_COMPONENTS="${TFS_COMPONENTS} te" + +# Uncomment to activate E2E_Orchestrator +export TFS_COMPONENTS="${TFS_COMPONENTS} e2e_orchestrator" + + + +# 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" + +# Uncomment to monitor performance of components +export TFS_EXTRA_MANIFESTS="${TFS_EXTRA_MANIFESTS} manifests/servicemonitors.yaml" + +# Uncomment when deploying Optical CyberSecurity +#export TFS_EXTRA_MANIFESTS="${TFS_EXTRA_MANIFESTS} manifests/cachingservice.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 external port CockroackDB Postgre SQL interface will be exposed to. +export CRDB_EXT_PORT_SQL="26257" + +# Set the external port CockroackDB HTTP Mgmt GUI interface will be exposed to. +export CRDB_EXT_PORT_HTTP="8081" + +# 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 it exists. +export CRDB_DROP_DATABASE_IF_EXISTS="YES" + +# Disable flag for re-deploying CockroachDB from scratch. +export CRDB_REDEPLOY="" + + +# ----- NATS ------------------------------------------------------------------- + +# Set the namespace where NATS will be deployed. +export NATS_NAMESPACE="nats" + +# Set the external port NATS Client interface will be exposed to. +export NATS_EXT_PORT_CLIENT="4222" + +# Set the external port NATS HTTP Mgmt GUI interface will be exposed to. +export NATS_EXT_PORT_HTTP="8222" + +# Disable flag for re-deploying NATS from scratch. +export NATS_REDEPLOY="" + + +# ----- QuestDB ---------------------------------------------------------------- + +# Set the namespace where QuestDB will be deployed. +export QDB_NAMESPACE="qdb" + +# Set the external port QuestDB Postgre SQL interface will be exposed to. +export QDB_EXT_PORT_SQL="8812" + +# Set the external port QuestDB Influx Line Protocol interface will be exposed to. +export QDB_EXT_PORT_ILP="9009" + +# Set the external port QuestDB HTTP Mgmt GUI interface will be exposed to. +export QDB_EXT_PORT_HTTP="9000" + +# Set the database username to be used for QuestDB. +export QDB_USERNAME="admin" + +# Set the database user's password to be used for QuestDB. +export QDB_PASSWORD="quest" + +# Set the table name to be used by Monitoring for KPIs. +export QDB_TABLE_MONITORING_KPIS="tfs_monitoring_kpis" + +# Set the table name to be used by Slice for plotting groups. +export QDB_TABLE_SLICE_GROUPS="tfs_slice_groups" + +# Disable flag for dropping tables if they exist. +export QDB_DROP_TABLES_IF_EXIST="YES" + +# Disable flag for re-deploying QuestDB from scratch. +export QDB_REDEPLOY="" + + +# ----- K8s Observability ------------------------------------------------------ + +# Set the external port Prometheus Mgmt HTTP GUI interface will be exposed to. +export PROM_EXT_PORT_HTTP="9090" + +# Set the external port Grafana HTTP Dashboards will be exposed to. +export GRAF_EXT_PORT_HTTP="3000" diff --git a/src/e2e_orchestrator/tests/descriptors_emulated.json b/src/e2e_orchestrator/tests/descriptors_emulated.json new file mode 100644 index 0000000000000000000000000000000000000000..a2918ace990550cac63d5eb7cd0cf69bf5da5538 --- /dev/null +++ b/src/e2e_orchestrator/tests/descriptors_emulated.json @@ -0,0 +1,250 @@ +{ + "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": "T1"}}, + {"device_uuid": {"uuid": "T2"}}, + {"device_uuid": {"uuid": "M1"}}, + {"device_uuid": {"uuid": "M2"}} + ], + "link_ids": [ + {"link_uuid": {"uuid": "R1==T1"}}, + {"link_uuid": {"uuid": "T1==R1"}}, + {"link_uuid": {"uuid": "R2==T2"}}, + {"link_uuid": {"uuid": "T2==R2"}}, + + {"link_uuid": {"uuid": "T1==M1"}}, + {"link_uuid": {"uuid": "M1==T1"}}, + {"link_uuid": {"uuid": "T2==M2"}}, + {"link_uuid": {"uuid": "M2==T2"}}, + + {"link_uuid": {"uuid": "M1==M2"}}, + {"link_uuid": {"uuid": "M2==M1"}} + + + ] + } + ], + "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": "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": "3/1"}, + {"sample_types": [], "type": "copper", "uuid": "3/2"}, + {"sample_types": [], "type": "copper", "uuid": "3/3"}, + {"sample_types": [], "type": "copper", "uuid": "3/4"} + ]}}} + ]} + }, + { + "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": "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": "3/1"}, + {"sample_types": [], "type": "copper", "uuid": "3/2"}, + {"sample_types": [], "type": "copper", "uuid": "3/3"}, + {"sample_types": [], "type": "copper", "uuid": "3/4"} + ]}}} + ]} + }, + { + "device_id": {"device_uuid": {"uuid": "T1"}}, "device_type": "emu-optical-transponder", "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": "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": "3/1"}, + {"sample_types": [], "type": "copper", "uuid": "3/2"}, + {"sample_types": [], "type": "copper", "uuid": "3/3"}, + {"sample_types": [], "type": "copper", "uuid": "3/4"} + ]}}} + ]} + }, + { + "device_id": {"device_uuid": {"uuid": "T2"}}, "device_type": "emu-optical-transponder", "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": "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": "3/1"}, + {"sample_types": [], "type": "copper", "uuid": "3/2"}, + {"sample_types": [], "type": "copper", "uuid": "3/3"}, + {"sample_types": [], "type": "copper", "uuid": "3/4"} + ]}}} + ]} + }, + + { + "device_id": {"device_uuid": {"uuid": "M1"}}, "device_type": "emu-optical-roadm", "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": "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": "3/1"}, + {"sample_types": [], "type": "copper", "uuid": "3/2"}, + {"sample_types": [], "type": "copper", "uuid": "3/3"}, + {"sample_types": [], "type": "copper", "uuid": "3/4"} + ]}}} + ]} + }, + + + { + "device_id": {"device_uuid": {"uuid": "M2"}}, "device_type": "emu-optical-roadm", "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": "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": "3/1"}, + {"sample_types": [], "type": "copper", "uuid": "3/2"}, + {"sample_types": [], "type": "copper", "uuid": "3/3"}, + {"sample_types": [], "type": "copper", "uuid": "3/4"} + ]}}} + ]} + } + + + ], + "links": [ + { + "link_id": {"link_uuid": {"uuid": "R1==T1"}}, + "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "R1"}}, "endpoint_uuid": {"uuid": "1/1"}}, + {"device_id": {"device_uuid": {"uuid": "T1"}}, "endpoint_uuid": {"uuid": "1/1"}} + ] + }, + { + "link_id": {"link_uuid": {"uuid": "T1==R1"}}, + "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "T1"}}, "endpoint_uuid": {"uuid": "1/1"}}, + {"device_id": {"device_uuid": {"uuid": "R1"}}, "endpoint_uuid": {"uuid": "1/1"}} + ] + }, + { + "link_id": {"link_uuid": {"uuid": "R2==T2"}}, + "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "R2"}}, "endpoint_uuid": {"uuid": "1/2"}}, + {"device_id": {"device_uuid": {"uuid": "T2"}}, "endpoint_uuid": {"uuid": "1/2"}} + ] + }, + { + "link_id": {"link_uuid": {"uuid": "T2==R2"}}, + "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "T2"}}, "endpoint_uuid": {"uuid": "1/2"}}, + {"device_id": {"device_uuid": {"uuid": "R2"}}, "endpoint_uuid": {"uuid": "1/2"}} + ] + }, + + + { + "link_id": {"link_uuid": {"uuid": "T1==M1"}}, + "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "T1"}}, "endpoint_uuid": {"uuid": "2/1"}}, + {"device_id": {"device_uuid": {"uuid": "M1"}}, "endpoint_uuid": {"uuid": "2/1"}} + ] + }, + { + "link_id": {"link_uuid": {"uuid": "M1==T1"}}, + "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "M1"}}, "endpoint_uuid": {"uuid": "2/1"}}, + {"device_id": {"device_uuid": {"uuid": "T1"}}, "endpoint_uuid": {"uuid": "2/1"}} + ] + }, + + { + "link_id": {"link_uuid": {"uuid": "T2==M2"}}, + "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "T2"}}, "endpoint_uuid": {"uuid": "2/2"}}, + {"device_id": {"device_uuid": {"uuid": "M2"}}, "endpoint_uuid": {"uuid": "2/2"}} + ] + }, + { + "link_id": {"link_uuid": {"uuid": "M2==T2"}}, + "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "M2"}}, "endpoint_uuid": {"uuid": "2/2"}}, + {"device_id": {"device_uuid": {"uuid": "T2"}}, "endpoint_uuid": {"uuid": "2/2"}} + ] + }, + + { + "link_id": {"link_uuid": {"uuid": "M1==M2"}}, + "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "M1"}}, "endpoint_uuid": {"uuid": "3/1"}}, + {"device_id": {"device_uuid": {"uuid": "M2"}}, "endpoint_uuid": {"uuid": "3/1"}} + ] + }, + { + "link_id": {"link_uuid": {"uuid": "M2==M1"}}, + "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "M2"}}, "endpoint_uuid": {"uuid": "3/1"}}, + {"device_id": {"device_uuid": {"uuid": "M1"}}, "endpoint_uuid": {"uuid": "3/1"}} + ] + } + + ] +} \ No newline at end of file diff --git a/src/e2e_orchestrator/tests/functional_tests/Fixtures.py b/src/e2e_orchestrator/tests/functional_tests/Fixtures.py new file mode 100644 index 0000000000000000000000000000000000000000..0f7b4b0d428768fa35d77a8c30ed5fc3e1a2b8d2 --- /dev/null +++ b/src/e2e_orchestrator/tests/functional_tests/Fixtures.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. + +import pytest +from context.client.ContextClient import ContextClient +from device.client.DeviceClient import DeviceClient +from monitoring.client.MonitoringClient import MonitoringClient +from e2e_orchestrator.client.E2EOrchestratorClient import E2EOrchestratorClient +from service.client.ServiceClient import ServiceClient + + +@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 e2eorchestrator_client(): + _client = E2EOrchestratorClient() + yield _client + _client.close() diff --git a/src/e2e_orchestrator/tests/functional_tests/Objects.py b/src/e2e_orchestrator/tests/functional_tests/Objects.py new file mode 100644 index 0000000000000000000000000000000000000000..1748efec9325e0651ee7fc8dcfa62454aa29e385 --- /dev/null +++ b/src/e2e_orchestrator/tests/functional_tests/Objects.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 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.EndPoint import json_endpoint_descriptor + + + +DEVICE_R1_UUID = 'R1' +DEVICE_R2_UUID = 'R2' + +DEVICE_R1_ID = json_device_id(DEVICE_R1_UUID) +DEVICE_R1_ENDPOINT_DEFS = [json_endpoint_descriptor('2/2', 'port')] +DEVICE_R2_ID = json_device_id(DEVICE_R2_UUID) +DEVICE_R2_ENDPOINT_DEFS = [json_endpoint_descriptor('2/2', 'port')] + +DEVICE_R1_ENDPOINTS = json_endpoints(DEVICE_R1_ID, DEVICE_R1_ENDPOINT_DEFS) +DEVICE_R2_ENDPOINTS = json_endpoints(DEVICE_R2_ID, DEVICE_R2_ENDPOINT_DEFS) + + +DEVICE_R1_ENDPOINT_IDS = json_endpoint_ids(DEVICE_R1_ID, DEVICE_R1_ENDPOINT_DEFS) +ENDPOINT_ID_R1 = DEVICE_R1_ENDPOINTS[0]['endpoint_id'] +DEVICE_R2_ENDPOINT_IDS = json_endpoint_ids(DEVICE_R2_ID, DEVICE_R2_ENDPOINT_DEFS) +ENDPOINT_ID_R2 = DEVICE_R2_ENDPOINTS[0]['endpoint_id'] + + +# ----- Service ---------------------------------------------------------------------------------------------------------- + + +SERVICE_R1_R2_UUID = get_service_uuid(ENDPOINT_ID_R1, ENDPOINT_ID_R2) +SERVICE_R1_R2 = json_service_p4_planned(SERVICE_R1_R2_UUID) +SERVICE_R1_R2_ENDPOINT_IDS = [DEVICE_R1_ENDPOINT_IDS[0], DEVICE_R2_ENDPOINT_IDS[0]] + + +SERVICES = [ + (SERVICE_R1_R2, SERVICE_R1_R2_ENDPOINT_IDS) +] diff --git a/src/compute/client/__init__.py b/src/e2e_orchestrator/tests/functional_tests/__init__.py similarity index 100% rename from src/compute/client/__init__.py rename to src/e2e_orchestrator/tests/functional_tests/__init__.py diff --git a/src/e2e_orchestrator/tests/functional_tests/test_functional_bootstrap.py b/src/e2e_orchestrator/tests/functional_tests/test_functional_bootstrap.py new file mode 100644 index 0000000000000000000000000000000000000000..d0e85e4e33c2253e5def8b093b84d0e027eee3f3 --- /dev/null +++ b/src/e2e_orchestrator/tests/functional_tests/test_functional_bootstrap.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. + +import logging, time +from common.Constants import DEFAULT_CONTEXT_NAME +from common.proto.context_pb2 import ContextId, DeviceOperationalStatusEnum, Empty +from common.proto.monitoring_pb2 import KpiDescriptorList +from common.tools.descriptor.Loader import DescriptorLoader, check_descriptor_load_results, validate_empty_scenario +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 .Fixtures import context_client, device_client # pylint: disable=unused-import + +LOGGER = logging.getLogger(__name__) +LOGGER.setLevel(logging.DEBUG) + +DESCRIPTOR_FILE = 'src/e2e_orchestrator/tests/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: + validate_empty_scenario(context_client) + + descriptor_loader = DescriptorLoader( + descriptors_file=DESCRIPTOR_FILE, context_client=context_client, device_client=device_client) + results = descriptor_loader.process() + check_descriptor_load_results(results, descriptor_loader) + descriptor_loader.validate() + + # Verify the scenario has no services/slices + response = context_client.GetContext(ADMIN_CONTEXT_ID) + assert len(response.service_ids) == 0 + assert len(response.slice_ids) == 0 + +def test_scenario_devices_enabled( + context_client : ContextClient, # pylint: disable=redefined-outer-name +) -> None: + """ + This test validates that the devices are enabled. + """ + DEVICE_OP_STATUS_ENABLED = DeviceOperationalStatusEnum.DEVICEOPERATIONALSTATUS_ENABLED + + num_devices = -1 + num_devices_enabled, num_retry = 0, 0 + while (num_devices != num_devices_enabled) and (num_retry < 1): + time.sleep(1.0) + response = context_client.ListDevices(Empty()) + num_devices = len(response.devices) + num_devices_enabled = 0 + for device in response.devices: + if device.device_operational_status != DEVICE_OP_STATUS_ENABLED: continue + num_devices_enabled += 1 + LOGGER.info('Num Devices enabled: {:d}/{:d}'.format(num_devices_enabled, num_devices)) + num_retry += 1 + assert num_devices_enabled == num_devices + + diff --git a/src/e2e_orchestrator/tests/functional_tests/test_functional_cleanup.py b/src/e2e_orchestrator/tests/functional_tests/test_functional_cleanup.py new file mode 100644 index 0000000000000000000000000000000000000000..9c88b3b3886b6208062d0cae5d7e40eba1b89dc6 --- /dev/null +++ b/src/e2e_orchestrator/tests/functional_tests/test_functional_cleanup.py @@ -0,0 +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. + +import logging +from common.Constants import DEFAULT_CONTEXT_NAME +from common.proto.context_pb2 import ContextId +from common.tools.descriptor.Loader import DescriptorLoader, validate_empty_scenario +from common.tools.object_factory.Context import json_context_id +from context.client.ContextClient import ContextClient +from device.client.DeviceClient import DeviceClient +from .Fixtures import context_client, device_client # pylint: disable=unused-import + +LOGGER = logging.getLogger(__name__) +LOGGER.setLevel(logging.DEBUG) + +DESCRIPTOR_FILE = 'src/e2e_orchestrator/tests/descriptors_emulated.json' +ADMIN_CONTEXT_ID = ContextId(**json_context_id(DEFAULT_CONTEXT_NAME)) + +def test_scenario_cleanup( + context_client : ContextClient, # pylint: disable=redefined-outer-name + device_client : DeviceClient, # pylint: disable=redefined-outer-name +) -> None: + # Verify the scenario has no services/slices + response = context_client.GetContext(ADMIN_CONTEXT_ID) + assert len(response.service_ids) == 0 + assert len(response.slice_ids) == 0 + + # Load descriptors and validate the base scenario + descriptor_loader = DescriptorLoader( + descriptors_file=DESCRIPTOR_FILE, context_client=context_client, device_client=device_client) + descriptor_loader.validate() + descriptor_loader.unload() + validate_empty_scenario(context_client) diff --git a/src/e2e_orchestrator/tests/functional_tests/test_functional_compute_path.py b/src/e2e_orchestrator/tests/functional_tests/test_functional_compute_path.py new file mode 100644 index 0000000000000000000000000000000000000000..91a928e6ab82cf096479b1dbec3d203721372136 --- /dev/null +++ b/src/e2e_orchestrator/tests/functional_tests/test_functional_compute_path.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, random +from common.Constants import DEFAULT_CONTEXT_NAME +from common.proto.context_pb2 import ContextId, Empty, ServiceTypeEnum, Service +from common.proto.e2eorchestrator_pb2 import E2EOrchestratorRequest +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 service.client.ServiceClient import ServiceClient +from .Fixtures import context_client, device_client, e2eorchestrator_client # pylint: disable=unused-import +from e2e_orchestrator.client.E2EOrchestratorClient import E2EOrchestratorClient +from .Objects import SERVICES +import copy + +LOGGER = logging.getLogger(__name__) +LOGGER.setLevel(logging.DEBUG) + +DESCRIPTOR_FILE = 'src/e2e_orchestrator/tests/descriptors_emulated.json' +ADMIN_CONTEXT_ID = ContextId(**json_context_id(DEFAULT_CONTEXT_NAME)) + + +def test_orchestration(context_client : ContextClient, e2eorchestrator_client : E2EOrchestratorClient): # pylint: disable=redefined-outer-name + # Load descriptors and validate the base scenario + descriptor_loader = DescriptorLoader(descriptors_file=DESCRIPTOR_FILE, context_client=context_client) + descriptor_loader.validate() + + # Verify the scenario has no services/slices + response = context_client.GetContext(ADMIN_CONTEXT_ID) + assert len(response.service_ids) == 0 + assert len(response.slice_ids) == 0 + + + + # ----- Compute E2E path --------------------------------------------------------------- + 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) + service_p4['service_endpoint_ids'].extend(endpoints) + + request = E2EOrchestratorRequest() + request.service.MergeFrom(Service(**service_p4)) + reply = e2eorchestrator_client.Compute(request) + LOGGER.info(reply) + assert len(reply.connections) == 6 + diff --git a/src/e2e_orchestrator/tests/redeploy.sh b/src/e2e_orchestrator/tests/redeploy.sh new file mode 100755 index 0000000000000000000000000000000000000000..bd995709b8065cd2860e003197ad18cd2b93cdc8 --- /dev/null +++ b/src/e2e_orchestrator/tests/redeploy.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. + +source src/e2e_orchestrator/tests/deploy_specs.sh +./deploy/all.sh +source tfs_runtime_env_vars.sh diff --git a/src/e2e_orchestrator/tests/run_test_01_bootstrap.sh b/src/e2e_orchestrator/tests/run_test_01_bootstrap.sh new file mode 100755 index 0000000000000000000000000000000000000000..e875cf9aee09ed5818eb6a5c004ec77cb0ed5eec --- /dev/null +++ b/src/e2e_orchestrator/tests/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/e2e_orchestrator/tests/functional_tests/test_functional_bootstrap.py diff --git a/src/e2e_orchestrator/tests/run_test_02_compute_path.sh b/src/e2e_orchestrator/tests/run_test_02_compute_path.sh new file mode 100755 index 0000000000000000000000000000000000000000..be61e70e44e0a11e76cb6afb787c8e1c85ed4e09 --- /dev/null +++ b/src/e2e_orchestrator/tests/run_test_02_compute_path.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/e2e_orchestrator/tests/functional_tests/test_functional_compute_path.py diff --git a/src/e2e_orchestrator/tests/run_test_03_cleanup.sh b/src/e2e_orchestrator/tests/run_test_03_cleanup.sh new file mode 100755 index 0000000000000000000000000000000000000000..78ed3e1d164aa0e45db77c366b2787e0a13836be --- /dev/null +++ b/src/e2e_orchestrator/tests/run_test_03_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/e2e_orchestrator/tests/functional_tests/test_functional_cleanup.py diff --git a/src/e2e_orchestrator/tests/run_tests.sh b/src/e2e_orchestrator/tests/run_tests.sh new file mode 100755 index 0000000000000000000000000000000000000000..9f19bb43801f6354e5c670374c3669ecf9a2bea6 --- /dev/null +++ b/src/e2e_orchestrator/tests/run_tests.sh @@ -0,0 +1,20 @@ +#!/bin/bash +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Run functional tests +source tfs_runtime_env_vars.sh +pytest --verbose --log-level=INFO src/e2e_orchestrator/tests/functional_tests/test_functional_bootstrap.py +pytest --verbose --log-level=INFO src/e2e_orchestrator/tests/functional_tests/test_functional_compute_path.py +pytest --verbose --log-level=INFO src/e2e_orchestrator/tests/functional_tests/test_functional_cleanup.py diff --git a/src/compute/.gitlab-ci.yml b/src/forecaster/.gitlab-ci.yml similarity index 90% rename from src/compute/.gitlab-ci.yml rename to src/forecaster/.gitlab-ci.yml index 865fd89c418b0a80c38a2b0f5fd9603fe3fa32e8..09b2f8f4e67db6ce152da608baff6f51279a1dc8 100644 --- a/src/compute/.gitlab-ci.yml +++ b/src/forecaster/.gitlab-ci.yml @@ -13,9 +13,9 @@ # limitations under the License. # Build, tag, and push the Docker image to the GitLab Docker registry -build compute: +build forecaster: variables: - IMAGE_NAME: 'compute' # name of the microservice + IMAGE_NAME: 'forecaster' # name of the microservice IMAGE_TAG: 'latest' # tag of the container image (production, development, etc) stage: build before_script: @@ -39,20 +39,21 @@ build compute: - .gitlab-ci.yml # Apply unit test to the component -unit_test compute: +unit_test forecaster: variables: - IMAGE_NAME: 'compute' # name of the microservice + IMAGE_NAME: 'forecaster' # name of the microservice IMAGE_TAG: 'latest' # tag of the container image (production, development, etc) stage: unit_test needs: - - build compute + - build forecaster 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 + - docker container prune -f script: - docker pull "$CI_REGISTRY_IMAGE/$IMAGE_NAME:$IMAGE_TAG" - - docker run --name $IMAGE_NAME -d -p 9090:9090 -v "$PWD/src/$IMAGE_NAME/tests:/opt/results" --network=teraflowbridge $CI_REGISTRY_IMAGE/$IMAGE_NAME:$IMAGE_TAG + - docker run --name $IMAGE_NAME -d -p 10040:10040 -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 @@ -80,13 +81,13 @@ unit_test compute: junit: src/$IMAGE_NAME/tests/${IMAGE_NAME}_report.xml ## Deployment of the service in Kubernetes Cluster -#deploy compute: +#deploy forecaster: # variables: -# IMAGE_NAME: 'compute' # name of the microservice +# IMAGE_NAME: 'forecaster' # name of the microservice # IMAGE_TAG: 'latest' # tag of the container image (production, development, etc) # stage: deploy # needs: -# - unit test compute +# - unit test forecaster # # - integ_test execute # script: # - 'sed -i "s/$IMAGE_NAME:.*/$IMAGE_NAME:$IMAGE_TAG/" manifests/${IMAGE_NAME}service.yaml' diff --git a/src/forecaster/Config.py b/src/forecaster/Config.py new file mode 100644 index 0000000000000000000000000000000000000000..0d80b8fe62ff2e8313ec6a7b1b0278fea7c16950 --- /dev/null +++ b/src/forecaster/Config.py @@ -0,0 +1,21 @@ +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT 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 + +# FORECAST_TO_HISTORY_RATIO indicates the size of the trainset. +# For example a history ratio of 10 would imply that the train-set will be 10 times bigger +# than the forecast period and the test-set. +DEFAULT_FORECAST_TO_HISTORY_RATIO = 10 +FORECAST_TO_HISTORY_RATIO = int(os.environ.get('FORECAST_TO_HISTORY_RATIO', DEFAULT_FORECAST_TO_HISTORY_RATIO)) diff --git a/src/compute/Dockerfile b/src/forecaster/Dockerfile similarity index 74% rename from src/compute/Dockerfile rename to src/forecaster/Dockerfile index 7a0c9bf6d81c261c76c63fe32abea47026209c9f..c09ab8007396895df0a9e4a07cf5984b9d662b3e 100644 --- a/src/compute/Dockerfile +++ b/src/forecaster/Dockerfile @@ -16,7 +16,7 @@ FROM python:3.9-slim # Install dependencies RUN apt-get --yes --quiet --quiet update && \ - apt-get --yes --quiet --quiet install wget g++ && \ + apt-get --yes --quiet --quiet install wget g++ git && \ rm -rf /var/lib/apt/lists/* # Set Python to show logs as they occur @@ -53,21 +53,26 @@ RUN python3 -m grpc_tools.protoc -I=. --python_out=. --grpc_python_out=. *.proto RUN rm *.proto RUN find . -type f -exec sed -i -E 's/(import\ .*)_pb2/from . \1_pb2/g' {} \; -# Create component sub-folder, get specific Python packages -RUN mkdir -p /var/teraflow/compute -WORKDIR /var/teraflow/compute -COPY src/compute/requirements.in requirements.in +# Create component sub-folders, get specific Python packages +RUN mkdir -p /var/teraflow/forecaster +WORKDIR /var/teraflow/forecaster +COPY src/forecaster/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/compute/. compute/ -COPY src/context/. context/ -COPY src/service/. service/ -COPY src/slice/. slice/ -RUN mkdir -p /var/teraflow/tests/tools -COPY src/tests/tools/mock_osm/. tests/tools/mock_osm/ +COPY src/context/__init__.py context/__init__.py +COPY src/context/client/. context/client/ +COPY src/device/__init__.py device/__init__.py +COPY src/device/client/. device/client/ +COPY src/monitoring/__init__.py monitoring/__init__.py +COPY src/monitoring/client/. monitoring/client/ +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/ +COPY src/forecaster/. forecaster/ # Start the service -ENTRYPOINT ["python", "-m", "compute.service"] +ENTRYPOINT ["python", "-m", "forecaster.service"] diff --git a/src/forecaster/__init__.py b/src/forecaster/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..38d04994fb0fa1951fb465bc127eb72659dc2eaf --- /dev/null +++ b/src/forecaster/__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/forecaster/client/ForecasterClient.py b/src/forecaster/client/ForecasterClient.py new file mode 100644 index 0000000000000000000000000000000000000000..17e0beb339f5dbe748a211c4286a98a376ed6084 --- /dev/null +++ b/src/forecaster/client/ForecasterClient.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. + +import grpc, logging +from common.Constants import ServiceNameEnum +from common.Settings import get_service_host, get_service_port_grpc +from common.proto.forecaster_pb2 import ( + ForecastLinkCapacityReply, ForecastLinkCapacityRequest, + ForecastTopologyCapacityReply, ForecastTopologyCapacityRequest +) +from common.proto.forecaster_pb2_grpc import ForecasterServiceStub +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 ForecasterClient: + def __init__(self, host=None, port=None): + if not host: host = get_service_host(ServiceNameEnum.FORECASTER) + if not port: port = get_service_port_grpc(ServiceNameEnum.FORECASTER) + 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 = ForecasterServiceStub(self.channel) + + def close(self): + if self.channel is not None: self.channel.close() + self.channel = None + self.stub = None + + @RETRY_DECORATOR + def ForecastLinkCapacity(self, request : ForecastLinkCapacityRequest) -> ForecastLinkCapacityReply: + LOGGER.debug('ForecastLinkCapacity request: {:s}'.format(grpc_message_to_json_string(request))) + response = self.stub.ForecastLinkCapacity(request) + LOGGER.debug('ForecastLinkCapacity result: {:s}'.format(grpc_message_to_json_string(response))) + return response + + @RETRY_DECORATOR + def ForecastTopologyCapacity(self, request : ForecastTopologyCapacityRequest) -> ForecastTopologyCapacityReply: + LOGGER.debug('ForecastTopologyCapacity request: {:s}'.format(grpc_message_to_json_string(request))) + response = self.stub.ForecastTopologyCapacity(request) + LOGGER.debug('ForecastTopologyCapacity result: {:s}'.format(grpc_message_to_json_string(response))) + return response diff --git a/src/compute/service/__init__.py b/src/forecaster/client/__init__.py similarity index 100% rename from src/compute/service/__init__.py rename to src/forecaster/client/__init__.py diff --git a/src/forecaster/requirements.in b/src/forecaster/requirements.in new file mode 100644 index 0000000000000000000000000000000000000000..3ed37c5998a550427f987d881e5ce4455b5e1649 --- /dev/null +++ b/src/forecaster/requirements.in @@ -0,0 +1,18 @@ +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT 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.* +pandas==1.5.* +#prophet==1.1.* +scikit-learn==1.1.* diff --git a/src/forecaster/service/Forecaster.py b/src/forecaster/service/Forecaster.py new file mode 100644 index 0000000000000000000000000000000000000000..d2b5b4d09af35752ffa221eabaf40b1d22515d32 --- /dev/null +++ b/src/forecaster/service/Forecaster.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. + +import math, pandas +from datetime import datetime, timezone +from statistics import mean +from sklearn.ensemble import RandomForestRegressor +from common.proto.monitoring_pb2 import KpiId +from forecaster.Config import FORECAST_TO_HISTORY_RATIO + +def compute_forecast(samples : pandas.DataFrame, kpi_id : KpiId) -> float: + kpi_uuid = kpi_id.kpi_id.uuid + samples = samples[samples.kpi_id == kpi_uuid].copy() + + num_samples = samples.shape[0] + if num_samples <= 0: + MSG = 'KpiId({:s}): Wrong number of samples: {:d}' + raise Exception(MSG.format(kpi_uuid, num_samples)) + + num_samples_test = math.ceil(num_samples / FORECAST_TO_HISTORY_RATIO) + if num_samples_test <= 0: + MSG = 'KpiId({:s}): Wrong number of test samples: {:d}' + raise Exception(MSG.format(kpi_uuid, num_samples_test )) + + num_samples_train = num_samples - num_samples_test + if num_samples_train <= 0: + MSG = 'KpiId({:s}): Wrong number of train samples: {:d}' + raise Exception(MSG.format(kpi_uuid, num_samples_train)) + + samples['timestamp'] = pandas.to_datetime(samples['timestamp']) - datetime(1970, 1, 1, tzinfo=timezone.utc) + samples['timestamp'] = samples['timestamp'].dt.total_seconds() + + train_set = samples[0:num_samples_train] + test_set = samples[num_samples_train:num_samples] + + rfr = RandomForestRegressor(n_estimators=600, random_state=42) + rfr.fit(train_set.drop(['kpi_id', 'value'], axis=1), train_set['value']) + forecast = rfr.predict(test_set.drop(['kpi_id', 'value'], axis=1)) + avg_forecast = round(mean(forecast), 2) + return avg_forecast diff --git a/src/forecaster/service/ForecasterService.py b/src/forecaster/service/ForecasterService.py new file mode 100644 index 0000000000000000000000000000000000000000..944ceb01e1429df4e124d28993cf001bb683aeb5 --- /dev/null +++ b/src/forecaster/service/ForecasterService.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.forecaster_pb2_grpc import add_ForecasterServiceServicer_to_server +from common.tools.service.GenericGrpcService import GenericGrpcService +from .ForecasterServiceServicerImpl import ForecasterServiceServicerImpl + +class ForecasterService(GenericGrpcService): + def __init__(self, cls_name: str = __name__) -> None: + port = get_service_port_grpc(ServiceNameEnum.FORECASTER) + super().__init__(port, cls_name=cls_name) + self.forecaster_servicer = ForecasterServiceServicerImpl() + + def install_servicers(self): + add_ForecasterServiceServicer_to_server(self.forecaster_servicer, self.server) diff --git a/src/forecaster/service/ForecasterServiceServicerImpl.py b/src/forecaster/service/ForecasterServiceServicerImpl.py new file mode 100644 index 0000000000000000000000000000000000000000..41f6a59fd1e99f1ca336b65139eb9399d1aeec1a --- /dev/null +++ b/src/forecaster/service/ForecasterServiceServicerImpl.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. + +from typing import Dict, List +import grpc, logging +from common.method_wrappers.Decorator import MetricsPool, safe_and_metered_rpc_method +from common.method_wrappers.ServiceExceptions import NotFoundException +from common.proto.context_pb2 import LinkAttributes, LinkId +from common.proto.forecaster_pb2 import ( + ForecastLinkCapacityReply, ForecastLinkCapacityRequest, + ForecastTopologyCapacityReply, ForecastTopologyCapacityRequest +) +from common.proto.forecaster_pb2_grpc import ForecasterServiceServicer +from common.proto.kpi_sample_types_pb2 import KpiSampleType +from common.tools.context_queries.Link import get_link +from common.tools.context_queries.Topology import get_topology_details +from common.tools.timestamp.Converters import timestamp_utcnow_to_float +from context.client.ContextClient import ContextClient +from forecaster.Config import FORECAST_TO_HISTORY_RATIO +from forecaster.service.Forecaster import compute_forecast +from forecaster.service.KpiManager import KpiManager + +LOGGER = logging.getLogger(__name__) + +METRICS_POOL = MetricsPool('Forecaster', 'RPC') + +class ForecasterServiceServicerImpl(ForecasterServiceServicer): + def __init__(self) -> None: + LOGGER.debug('Creating Servicer...') + self._kpi_manager = KpiManager() + LOGGER.debug('Servicer Created') + + @safe_and_metered_rpc_method(METRICS_POOL, LOGGER) + def ForecastLinkCapacity( + self, request : ForecastLinkCapacityRequest, context : grpc.ServicerContext + ) -> ForecastLinkCapacityReply: + forecast_window_seconds = request.forecast_window_seconds + + # history_window_seconds indicates the size of the train-set based on the + # requested size of the test-set and the configured history ratio + history_window_seconds = FORECAST_TO_HISTORY_RATIO * forecast_window_seconds + + link_id = request.link_id + link_uuid = link_id.link_uuid.uuid + + context_client = ContextClient() + link = get_link(context_client, link_uuid) + if link is None: raise NotFoundException('Link', link_uuid) + + kpi_id_map = self._kpi_manager.get_kpi_ids_from_link_ids([link_id]) + link_uuid__to__kpi_id = { + _link_uuid : _kpi_id + for (_link_uuid, _kpi_sample_type), _kpi_id in kpi_id_map.items() + if _kpi_sample_type == KpiSampleType.KPISAMPLETYPE_LINK_USED_CAPACITY_GBPS + } + kpi_id = link_uuid__to__kpi_id[link_uuid] + + end_timestamp = timestamp_utcnow_to_float() + start_timestamp = end_timestamp - history_window_seconds + df_historical_data = self._kpi_manager.get_kpi_id_samples([kpi_id], start_timestamp, end_timestamp) + forecast_used_capacity_gbps = compute_forecast(df_historical_data, kpi_id) + + reply = ForecastLinkCapacityReply() + reply.link_id.link_uuid.uuid = link_uuid + reply.total_capacity_gbps = link.attributes.total_capacity_gbps + reply.current_used_capacity_gbps = link.attributes.used_capacity_gbps + reply.forecast_used_capacity_gbps = forecast_used_capacity_gbps + return reply + + @safe_and_metered_rpc_method(METRICS_POOL, LOGGER) + def ForecastTopologyCapacity( + self, request : ForecastTopologyCapacityRequest, context : grpc.ServicerContext + ) -> ForecastTopologyCapacityReply: + forecast_window_seconds = request.forecast_window_seconds + + # history_window_seconds indicates the size of the train-set based on the + # requested size of the test-set and the configured history ratio + history_window_seconds = FORECAST_TO_HISTORY_RATIO * forecast_window_seconds + + context_uuid = request.topology_id.context_id.context_uuid.uuid + topology_uuid = request.topology_id.topology_uuid.uuid + context_client = ContextClient() + topology_details = get_topology_details(context_client, topology_uuid, context_uuid=context_uuid) + if topology_details is None: + topology_uuid = '{:s}/{:s}'.format(context_uuid, topology_uuid) + raise NotFoundException('Topology', topology_uuid) + + link_ids : List[LinkId] = list() + link_capacities : Dict[str, LinkAttributes] = dict() + for link in topology_details.links: + link_ids.append(link.link_id) + link_capacities[link.link_id.link_uuid.uuid] = link.attributes + + kpi_id_map = self._kpi_manager.get_kpi_ids_from_link_ids(link_ids) + link_uuid__to__kpi_id = { + _link_id : _kpi_id + for (_link_id, _kpi_sample_type), _kpi_id in kpi_id_map.items() + if _kpi_sample_type == KpiSampleType.KPISAMPLETYPE_LINK_USED_CAPACITY_GBPS + } + + kpi_ids = list(link_uuid__to__kpi_id.values()) + end_timestamp = timestamp_utcnow_to_float() + start_timestamp = end_timestamp - history_window_seconds + df_historical_data = self._kpi_manager.get_kpi_id_samples(kpi_ids, start_timestamp, end_timestamp) + + reply = ForecastTopologyCapacityReply() + for link_uuid, kpi_id in link_uuid__to__kpi_id.items(): + link_attributes = link_capacities[link_uuid] + forecast_used_capacity_gbps = compute_forecast(df_historical_data, kpi_id) + link_capacity : ForecastLinkCapacityReply = reply.link_capacities.add() # pylint: disable=no-member + link_capacity.link_id.link_uuid.uuid = link_uuid + link_capacity.total_capacity_gbps = link_attributes.total_capacity_gbps + link_capacity.current_used_capacity_gbps = link_attributes.used_capacity_gbps + link_capacity.forecast_used_capacity_gbps = forecast_used_capacity_gbps + return reply diff --git a/src/forecaster/service/KpiManager.py b/src/forecaster/service/KpiManager.py new file mode 100644 index 0000000000000000000000000000000000000000..15864c5936b00b792e83c78934c8cc84286662eb --- /dev/null +++ b/src/forecaster/service/KpiManager.py @@ -0,0 +1,57 @@ +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT 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 pandas +from typing import Dict, List, Tuple +from common.proto.context_pb2 import Empty, LinkId +from common.proto.monitoring_pb2 import KpiId, KpiQuery +from monitoring.client.MonitoringClient import MonitoringClient + +class KpiManager: + def __init__(self) -> None: + self._monitoring_client = MonitoringClient() + + def get_kpi_ids_from_link_ids( + self, link_ids : List[LinkId] + ) -> Dict[Tuple[str, int], KpiId]: + link_uuids = {link_id.link_uuid.uuid for link_id in link_ids} + kpi_descriptors = self._monitoring_client.GetKpiDescriptorList(Empty()) + kpi_ids : Dict[Tuple[str, int], KpiId] = { + (kpi_descriptor.link_id.link_uuid.uuid, kpi_descriptor.kpi_sample_type) : kpi_descriptor.kpi_id + for kpi_descriptor in kpi_descriptors.kpi_descriptor_list + if kpi_descriptor.link_id.link_uuid.uuid in link_uuids + } + return kpi_ids + + def get_kpi_id_samples( + self, kpi_ids : List[KpiId], start_timestamp : float, end_timestamp : float + ) -> pandas.DataFrame: + kpi_query = KpiQuery() + for kpi_id in kpi_ids: kpi_query.kpi_ids.add().kpi_id.uuid = kpi_id.kpi_id.uuid + kpi_query.start_timestamp.timestamp = start_timestamp # pylint: disable=no-member + kpi_query.end_timestamp.timestamp = end_timestamp # pylint: disable=no-member + raw_kpi_table = self._monitoring_client.QueryKpiData(kpi_query) + + data : List[Tuple[str, float, float]] = list() + for raw_kpi_list in raw_kpi_table.raw_kpi_lists: + kpi_uuid = raw_kpi_list.kpi_id.kpi_id.uuid + for raw_kpi in raw_kpi_list.raw_kpis: + timestamp = raw_kpi.timestamp.timestamp + value = float(getattr(raw_kpi.kpi_value, raw_kpi.kpi_value.WhichOneof('value'))) + data.append((timestamp, kpi_uuid, value)) + + df = pandas.DataFrame(data, columns=['timestamp', 'kpi_id', 'value']) + df['timestamp'] = pandas.to_datetime(df['timestamp'].astype('int'), unit='s', utc=True) + df.sort_values('timestamp', ascending=True, inplace=True) + return df diff --git a/src/compute/service/rest_server/__init__.py b/src/forecaster/service/__init__.py similarity index 100% rename from src/compute/service/rest_server/__init__.py rename to src/forecaster/service/__init__.py diff --git a/src/forecaster/service/__main__.py b/src/forecaster/service/__main__.py new file mode 100644 index 0000000000000000000000000000000000000000..780fe5f8f3386b571c37ce64a0b95578e9641110 --- /dev/null +++ b/src/forecaster/service/__main__.py @@ -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. + +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 .ForecasterService import ForecasterService + +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") + 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__) + + wait_for_environment_variables([ + get_env_var_name(ServiceNameEnum.CONTEXT, ENVVAR_SUFIX_SERVICE_HOST ), + get_env_var_name(ServiceNameEnum.CONTEXT, ENVVAR_SUFIX_SERVICE_PORT_GRPC), + get_env_var_name(ServiceNameEnum.MONITORING, ENVVAR_SUFIX_SERVICE_HOST ), + get_env_var_name(ServiceNameEnum.MONITORING, ENVVAR_SUFIX_SERVICE_PORT_GRPC), + ]) + + 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 Forecaster service + grpc_service = ForecasterService() + grpc_service.start() + + # Wait for Ctrl+C or termination signal + while not terminate.wait(timeout=1.0): pass + + LOGGER.info('Terminating...') + grpc_service.stop() + + LOGGER.info('Bye') + return 0 + +if __name__ == '__main__': + sys.exit(main()) diff --git a/src/forecaster/tests/MockService_Dependencies.py b/src/forecaster/tests/MockService_Dependencies.py new file mode 100644 index 0000000000000000000000000000000000000000..858db17a9e35e30ea93c965815b39a068c696b4b --- /dev/null +++ b/src/forecaster/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.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, 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) + + self.monitoring_servicer = MockServicerImpl_Monitoring() + 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/forecaster/tests/PrepareTestScenario.py b/src/forecaster/tests/PrepareTestScenario.py new file mode 100644 index 0000000000000000000000000000000000000000..7d383f616cce90532228efad515ef5a12509403e --- /dev/null +++ b/src/forecaster/tests/PrepareTestScenario.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. + +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 forecaster.client.ForecasterClient import ForecasterClient +from forecaster.service.ForecasterService import ForecasterService +from monitoring.client.MonitoringClient import MonitoringClient +from .MockService_Dependencies import MockService_Dependencies + +LOCAL_HOST = '127.0.0.1' +MOCKSERVICE_PORT = 10000 +# avoid privileged ports +FORECASTER_SERVICE_PORT = MOCKSERVICE_PORT + int(get_service_port_grpc(ServiceNameEnum.FORECASTER)) +os.environ[get_env_var_name(ServiceNameEnum.FORECASTER, ENVVAR_SUFIX_SERVICE_HOST )] = str(LOCAL_HOST) +os.environ[get_env_var_name(ServiceNameEnum.FORECASTER, ENVVAR_SUFIX_SERVICE_PORT_GRPC)] = str(FORECASTER_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 forecaster_service( + context_client : ContextClient, # pylint: disable=redefined-outer-name + monitoring_client : MonitoringClient, # pylint: disable=redefined-outer-name +): + _service = ForecasterService() + _service.start() + yield _service + _service.stop() + +@pytest.fixture(scope='session') +def forecaster_client(forecaster_service : ForecasterService): # pylint: disable=redefined-outer-name + _client = ForecasterClient() + yield _client + _client.close() diff --git a/src/forecaster/tests/Tools.py b/src/forecaster/tests/Tools.py new file mode 100644 index 0000000000000000000000000000000000000000..2fd05f100f1b488aea4e4e1db9502675ac6e9a9f --- /dev/null +++ b/src/forecaster/tests/Tools.py @@ -0,0 +1,125 @@ +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT 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, math, pandas +from typing import Dict +from common.tools.object_factory.Context import json_context +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.EndPoint import json_endpoint, json_endpoint_id +from common.tools.object_factory.Link import json_link +from common.tools.object_factory.Topology import json_topology +from common.tools.timestamp.Converters import timestamp_datetime_to_int, timestamp_utcnow_to_float + +LOGGER = logging.getLogger(__name__) + +def read_csv(csv_file : str) -> pandas.DataFrame: + LOGGER.info('Using Data File "{:s}"...'.format(csv_file)) + + LOGGER.info('Loading...') + df = pandas.read_csv(csv_file) + LOGGER.info(' DONE') + + LOGGER.info('Parsing and Adapting columns...') + if 'dataset.csv' in csv_file: + df.rename(columns={'linkid': 'link_id', 'ds': 'timestamp', 'y': 'used_capacity_gbps'}, inplace=True) + df[['source', 'destination']] = df['link_id'].str.split('_', expand=True) + #elif 'dataset2.csv' in csv_file: + # df.drop(columns=['Unnamed: 0'], inplace=True) + # df.rename(columns={ + # 'target': 'destination', 'id': 'link_id', 'ds': 'timestamp', 'demandValue': 'used_capacity_gbps' + # }, inplace=True) + LOGGER.info(' DONE') + + LOGGER.info('Updating timestamps...') + df['timestamp'] = pandas.to_datetime(df['timestamp']) + max_timestamp = timestamp_datetime_to_int(df['timestamp'].max()) + now_timestamp = timestamp_utcnow_to_float() + df['timestamp'] = df['timestamp'] + pandas.offsets.Second(now_timestamp - max_timestamp) + LOGGER.info(' DONE') + + LOGGER.info('Sorting...') + df.sort_values('timestamp', ascending=True, inplace=True) + LOGGER.info(' DONE') + + return df + +def compose_descriptors(df : pandas.DataFrame, num_client_endpoints : int = 0) -> Dict: + devices = dict() + links = dict() + + LOGGER.info('Discovering Devices and Links...') + #df1.groupby(['A','B']).size().reset_index().rename(columns={0:'count'}) + df_links = df[['link_id', 'source', 'destination']].drop_duplicates() + for row in df_links.itertuples(index=False): + #print(row) + link_uuid = row.link_id + src_device_uuid = row.source + dst_device_uuid = row.destination + src_port_uuid = row.destination + dst_port_uuid = row.source + + if src_device_uuid not in devices: + endpoints = set() + for num_client_endpoint in range(num_client_endpoints): + endpoints.add('client:{:d}'.format(num_client_endpoint)) + devices[src_device_uuid] = {'id': src_device_uuid, 'endpoints': endpoints} + devices[src_device_uuid]['endpoints'].add(src_port_uuid) + + if dst_device_uuid not in devices: + endpoints = set() + for num_client_endpoint in range(num_client_endpoints): + endpoints.add('client:{:d}'.format(num_client_endpoint)) + devices[dst_device_uuid] = {'id': dst_device_uuid, 'endpoints': endpoints} + devices[dst_device_uuid]['endpoints'].add(dst_port_uuid) + + if link_uuid not in links: + total_capacity_gbps = df[df.link_id==link_uuid]['used_capacity_gbps'].max() + total_capacity_gbps = math.ceil(total_capacity_gbps / 100) * 100 # round up in steps of 100 + used_capacity_gbps = df[df.link_id==link_uuid].used_capacity_gbps.iat[-1] # get last value + links[link_uuid] = { + 'id': link_uuid, + 'src_dev': src_device_uuid, 'src_port': src_port_uuid, + 'dst_dev': dst_device_uuid, 'dst_port': dst_port_uuid, + 'total_capacity_gbps': total_capacity_gbps, 'used_capacity_gbps': used_capacity_gbps, + } + LOGGER.info(' Found {:d} devices and {:d} links...'.format(len(devices), len(links))) + + LOGGER.info('Composing Descriptors...') + _context = json_context('admin', name='admin') + _topology = json_topology('admin', name='admin', context_id=_context['context_id']) + descriptor = { + 'dummy_mode': True, # inject the descriptors directly into the Context component + 'contexts': [_context], + 'topologies': [_topology], + 'devices': [ + json_device_emulated_packet_router_disabled( + device_uuid, name=device_uuid, endpoints=[ + json_endpoint(json_device_id(device_uuid), endpoint_uuid, 'copper') + for endpoint_uuid in device_data['endpoints'] + ], config_rules=json_device_emulated_connect_rules([])) + for device_uuid,device_data in devices.items() + ], + 'links': [ + json_link(link_uuid, [ + json_endpoint_id(json_device_id(link_data['src_dev']), link_data['src_port']), + json_endpoint_id(json_device_id(link_data['dst_dev']), link_data['dst_port']), + ], name=link_uuid, total_capacity_gbps=link_data['total_capacity_gbps'], + used_capacity_gbps=link_data['used_capacity_gbps']) + for link_uuid,link_data in links.items() + ], + } + LOGGER.info(' DONE') + return descriptor diff --git a/src/compute/service/rest_server/nbi_plugins/__init__.py b/src/forecaster/tests/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/__init__.py rename to src/forecaster/tests/__init__.py diff --git a/src/forecaster/tests/data/README.md b/src/forecaster/tests/data/README.md new file mode 100644 index 0000000000000000000000000000000000000000..eaf303847b745e0663e76f300d602cbc048ff599 --- /dev/null +++ b/src/forecaster/tests/data/README.md @@ -0,0 +1,33 @@ +# Manual Forecaster test: + +- Move to root folder: +```bash +cd ~/tfs-ctrl +``` + +- Edit `my_deploy.sh` and enable the `monitoring` and the `forecaster` components: +```bash +export TFS_COMPONENTS="context device monitoring forecaster pathcomp service slice compute webui load_generator" +``` + +- Edit `deploy/tfs.sh` and disable linkerd injection to capture unencrypted traffic. +```bash +cp ./manifests/"${COMPONENT}"service.yaml "$MANIFEST" +#cat ./manifests/"${COMPONENT}"service.yaml | linkerd inject - --proxy-cpu-request "10m" --proxy-cpu-limit "1" --proxy-memory-request "64Mi" --proxy-memory-limit "256Mi" > "$MANIFEST" +``` + +- Deploy TeraFlowSDN controller: +```bash +source my_deploy.sh +./deploy/all.sh +``` + +- Onboard the topology descriptor `topology.json` through the WebUI. + +- Source the runtime environment variables and inject the link utilization KPI values into the Monitoring database: +```bash +source tfs_runtime_env_vars.sh +python src/forecaster/tests/data/inject_samples.py +``` + +- Onboard the service descriptor `service.json` through the WebUI. diff --git a/src/forecaster/tests/data/dataset.csv b/src/forecaster/tests/data/dataset.csv new file mode 100644 index 0000000000000000000000000000000000000000..476bfccb53f2903a22f709b30c83d404b52c41d1 --- /dev/null +++ b/src/forecaster/tests/data/dataset.csv @@ -0,0 +1,328 @@ +"linkid","ds","y" +"be1.be_de1.de","2005-07-29 11:30:00",13.633721 +"be1.be_fr1.fr","2005-07-29 11:30:00",37.369276 +"be1.be_gr1.gr","2005-07-29 11:30:00",0.023673 +"be1.be_it1.it","2005-07-29 11:30:00",0.251916 +"be1.be_uk1.uk","2005-07-29 11:30:00",26.126846 +"de1.de_be1.be","2005-07-29 11:30:00",41.771397 +"de1.de_gr1.gr","2005-07-29 11:30:00",137.840494 +"de1.de_uk1.uk","2005-07-29 11:30:00",187.909209 +"es1.es_fr1.fr","2005-07-29 11:30:00",9.989878 +"es1.es_it1.it","2005-07-29 11:30:00",15.279216 +"es1.es_pt1.pt","2005-07-29 11:30:00",18.024652 +"fr1.fr_be1.be","2005-07-29 11:30:00",3.491062 +"fr1.fr_es1.es","2005-07-29 11:30:00",27.289934 +"fr1.fr_it1.it","2005-07-29 11:30:00",5.19262 +"fr1.fr_pt1.pt","2005-07-29 11:30:00",2.075046 +"fr1.fr_uk1.uk","2005-07-29 11:30:00",171.856756 +"gr1.gr_be1.be","2005-07-29 11:30:00",0.463852 +"gr1.gr_de1.de","2005-07-29 11:30:00",4070.266255 +"gr1.gr_it1.it","2005-07-29 11:30:00",6.49398 +"it1.it_be1.be","2005-07-29 11:30:00",26.771257 +"it1.it_es1.es","2005-07-29 11:30:00",209.799198 +"it1.it_fr1.fr","2005-07-29 11:30:00",7.919724 +"it1.it_gr1.gr","2005-07-29 11:30:00",4.624628 +"pt1.pt_es1.es","2005-07-29 11:30:00",89.292105 +"pt1.pt_fr1.fr","2005-07-29 11:30:00",0.978255 +"pt1.pt_uk1.uk","2005-07-29 11:30:00",62.342932 +"uk1.uk_be1.be","2005-07-29 11:30:00",11.812727 +"uk1.uk_de1.de","2005-07-29 11:30:00",255.863122 +"uk1.uk_fr1.fr","2005-07-29 11:30:00",233.412507 +"uk1.uk_pt1.pt","2005-07-29 11:30:00",502.236205 +"be1.be_de1.de","2005-06-20 18:15:00",46.947486 +"be1.be_fr1.fr","2005-06-20 18:15:00",73.202652 +"be1.be_gr1.gr","2005-06-20 18:15:00",0.084347 +"be1.be_it1.it","2005-06-20 18:15:00",0.386309 +"be1.be_uk1.uk","2005-06-20 18:15:00",181.377554 +"de1.de_be1.be","2005-06-20 18:15:00",12.337703 +"de1.de_gr1.gr","2005-06-20 18:15:00",166.013822 +"de1.de_uk1.uk","2005-06-20 18:15:00",196.713395 +"es1.es_fr1.fr","2005-06-20 18:15:00",10.50535 +"es1.es_it1.it","2005-06-20 18:15:00",8.637348 +"es1.es_pt1.pt","2005-06-20 18:15:00",20.493486 +"fr1.fr_be1.be","2005-06-20 18:15:00",15.280566 +"fr1.fr_es1.es","2005-06-20 18:15:00",41.105169 +"fr1.fr_it1.it","2005-06-20 18:15:00",6.188476 +"fr1.fr_pt1.pt","2005-06-20 18:15:00",7.292464 +"fr1.fr_uk1.uk","2005-06-20 18:15:00",39.916047 +"gr1.gr_be1.be","2005-06-20 18:15:00",0.987871 +"gr1.gr_de1.de","2005-06-20 18:15:00",3761.528535 +"gr1.gr_it1.it","2005-06-20 18:15:00",0.762946 +"it1.it_be1.be","2005-06-20 18:15:00",11.693967 +"it1.it_es1.es","2005-06-20 18:15:00",20.093962 +"it1.it_fr1.fr","2005-06-20 18:15:00",25.279273 +"it1.it_gr1.gr","2005-06-20 18:15:00",54.110787 +"pt1.pt_es1.es","2005-06-20 18:15:00",12.870606 +"pt1.pt_fr1.fr","2005-06-20 18:15:00",1.294275 +"pt1.pt_uk1.uk","2005-06-20 18:15:00",335.570213 +"uk1.uk_be1.be","2005-06-20 18:15:00",7.096555 +"uk1.uk_de1.de","2005-06-20 18:15:00",356.532161 +"uk1.uk_fr1.fr","2005-06-20 18:15:00",20.45373 +"uk1.uk_pt1.pt","2005-06-20 18:15:00",791.04219 +"be1.be_de1.de","2005-08-29 16:45:00",20.400142 +"be1.be_fr1.fr","2005-08-29 16:45:00",31.346514 +"be1.be_gr1.gr","2005-08-29 16:45:00",0.026822 +"be1.be_it1.it","2005-08-29 16:45:00",0.357069 +"be1.be_uk1.uk","2005-08-29 16:45:00",8.252107 +"de1.de_be1.be","2005-08-29 16:45:00",57.709307 +"de1.de_gr1.gr","2005-08-29 16:45:00",110.602237 +"de1.de_uk1.uk","2005-08-29 16:45:00",239.446965 +"es1.es_fr1.fr","2005-08-29 16:45:00",20.517778 +"es1.es_it1.it","2005-08-29 16:45:00",15.353667 +"es1.es_pt1.pt","2005-08-29 16:45:00",5.643483 +"fr1.fr_be1.be","2005-08-29 16:45:00",4.804849 +"fr1.fr_es1.es","2005-08-29 16:45:00",96.682749 +"fr1.fr_it1.it","2005-08-29 16:45:00",3.330747 +"fr1.fr_pt1.pt","2005-08-29 16:45:00",1.916587 +"fr1.fr_uk1.uk","2005-08-29 16:45:00",28.144199 +"gr1.gr_be1.be","2005-08-29 16:45:00",0.895539 +"gr1.gr_de1.de","2005-08-29 16:45:00",4930.897339 +"gr1.gr_it1.it","2005-08-29 16:45:00",7.983659 +"it1.it_be1.be","2005-08-29 16:45:00",10.327772 +"it1.it_es1.es","2005-08-29 16:45:00",18.97108 +"it1.it_fr1.fr","2005-08-29 16:45:00",98.574706 +"it1.it_gr1.gr","2005-08-29 16:45:00",1.593313 +"pt1.pt_es1.es","2005-08-29 16:45:00",13.32428 +"pt1.pt_fr1.fr","2005-08-29 16:45:00",3.733925 +"pt1.pt_uk1.uk","2005-08-29 16:45:00",51.415678 +"uk1.uk_be1.be","2005-08-29 16:45:00",14.334868 +"uk1.uk_de1.de","2005-08-29 16:45:00",199.272255 +"uk1.uk_fr1.fr","2005-08-29 16:45:00",55.182499 +"uk1.uk_pt1.pt","2005-08-29 16:45:00",652.70225 +"be1.be_de1.de","2005-08-16 07:30:00",27.712568 +"be1.be_fr1.fr","2005-08-16 07:30:00",3.889573 +"be1.be_gr1.gr","2005-08-16 07:30:00",0.086821 +"be1.be_it1.it","2005-08-16 07:30:00",0.005398 +"be1.be_uk1.uk","2005-08-16 07:30:00",4.136991 +"de1.de_be1.be","2005-08-16 07:30:00",41.662646 +"de1.de_gr1.gr","2005-08-16 07:30:00",83.698837 +"de1.de_uk1.uk","2005-08-16 07:30:00",75.24126 +"es1.es_fr1.fr","2005-08-16 07:30:00",2.219729 +"es1.es_it1.it","2005-08-16 07:30:00",7.145139 +"es1.es_pt1.pt","2005-08-16 07:30:00",1.677266 +"fr1.fr_be1.be","2005-08-16 07:30:00",7.666459 +"fr1.fr_es1.es","2005-08-16 07:30:00",13.062805 +"fr1.fr_it1.it","2005-08-16 07:30:00",0.266986 +"fr1.fr_pt1.pt","2005-08-16 07:30:00",0.883506 +"fr1.fr_uk1.uk","2005-08-16 07:30:00",11.742382 +"gr1.gr_be1.be","2005-08-16 07:30:00",0.61562 +"gr1.gr_de1.de","2005-08-16 07:30:00",2001.396054 +"gr1.gr_it1.it","2005-08-16 07:30:00",2.294517 +"it1.it_be1.be","2005-08-16 07:30:00",3.148501 +"it1.it_es1.es","2005-08-16 07:30:00",5.216237 +"it1.it_fr1.fr","2005-08-16 07:30:00",3.382423 +"it1.it_gr1.gr","2005-08-16 07:30:00",4.762001 +"pt1.pt_es1.es","2005-08-16 07:30:00",0.328222 +"pt1.pt_fr1.fr","2005-08-16 07:30:00",0.544094 +"pt1.pt_uk1.uk","2005-08-16 07:30:00",6.946024 +"uk1.uk_be1.be","2005-08-16 07:30:00",14.723145 +"uk1.uk_de1.de","2005-08-16 07:30:00",101.817113 +"uk1.uk_fr1.fr","2005-08-16 07:30:00",13.165427 +"uk1.uk_pt1.pt","2005-08-16 07:30:00",59.307456 +"be1.be_de1.de","2005-05-07 23:45:00",3.00826 +"be1.be_fr1.fr","2005-05-07 23:45:00",18.221967 +"be1.be_gr1.gr","2005-05-07 23:45:00",0.173417 +"be1.be_it1.it","2005-05-07 23:45:00",0.00523 +"be1.be_uk1.uk","2005-05-07 23:45:00",1.61097 +"de1.de_be1.be","2005-05-07 23:45:00",56.899745 +"de1.de_gr1.gr","2005-05-07 23:45:00",631.542367 +"de1.de_uk1.uk","2005-05-07 23:45:00",210.597064 +"es1.es_fr1.fr","2005-05-07 23:45:00",4.532915 +"es1.es_it1.it","2005-05-07 23:45:00",3.393107 +"es1.es_pt1.pt","2005-05-07 23:45:00",12.377514 +"fr1.fr_be1.be","2005-05-07 23:45:00",0.414987 +"fr1.fr_es1.es","2005-05-07 23:45:00",6.300601 +"fr1.fr_it1.it","2005-05-07 23:45:00",3.127358 +"fr1.fr_pt1.pt","2005-05-07 23:45:00",0.651608 +"fr1.fr_uk1.uk","2005-05-07 23:45:00",33.277552 +"gr1.gr_be1.be","2005-05-07 23:45:00",0.199733 +"gr1.gr_de1.de","2005-05-07 23:45:00",933.371627 +"gr1.gr_it1.it","2005-05-07 23:45:00",1.692505 +"it1.it_be1.be","2005-05-07 23:45:00",27.93755 +"it1.it_es1.es","2005-05-07 23:45:00",46.131064 +"it1.it_fr1.fr","2005-05-07 23:45:00",16.271473 +"it1.it_gr1.gr","2005-05-07 23:45:00",739.540984 +"pt1.pt_es1.es","2005-05-07 23:45:00",0.777791 +"pt1.pt_fr1.fr","2005-05-07 23:45:00",0.319394 +"pt1.pt_uk1.uk","2005-05-07 23:45:00",176.696919 +"uk1.uk_be1.be","2005-05-07 23:45:00",1.521 +"uk1.uk_de1.de","2005-05-07 23:45:00",153.659587 +"uk1.uk_fr1.fr","2005-05-07 23:45:00",16.592104 +"uk1.uk_pt1.pt","2005-05-07 23:45:00",292.931055 +"be1.be_de1.de","2005-06-07 00:15:00",11.527804 +"be1.be_fr1.fr","2005-06-07 00:15:00",22.142524 +"be1.be_gr1.gr","2005-06-07 00:15:00",0.005173 +"be1.be_it1.it","2005-06-07 00:15:00",1.885266 +"be1.be_uk1.uk","2005-06-07 00:15:00",1.226966 +"de1.de_be1.be","2005-06-07 00:15:00",82.949555 +"de1.de_gr1.gr","2005-06-07 00:15:00",214.578575 +"de1.de_uk1.uk","2005-06-07 00:15:00",173.876359 +"es1.es_fr1.fr","2005-06-07 00:15:00",19.262246 +"es1.es_it1.it","2005-06-07 00:15:00",3.708902 +"es1.es_pt1.pt","2005-06-07 00:15:00",27.095824 +"fr1.fr_be1.be","2005-06-07 00:15:00",4.848429 +"fr1.fr_es1.es","2005-06-07 00:15:00",20.620681 +"fr1.fr_it1.it","2005-06-07 00:15:00",7.290271 +"fr1.fr_pt1.pt","2005-06-07 00:15:00",4.311982 +"fr1.fr_uk1.uk","2005-06-07 00:15:00",70.120616 +"gr1.gr_be1.be","2005-06-07 00:15:00",1.011151 +"gr1.gr_de1.de","2005-06-07 00:15:00",4235.315598 +"gr1.gr_it1.it","2005-06-07 00:15:00",2.605588 +"it1.it_be1.be","2005-06-07 00:15:00",29.244533 +"it1.it_es1.es","2005-06-07 00:15:00",18.239399 +"it1.it_fr1.fr","2005-06-07 00:15:00",38.556206 +"it1.it_gr1.gr","2005-06-07 00:15:00",25.842485 +"pt1.pt_es1.es","2005-06-07 00:15:00",3.852742 +"pt1.pt_fr1.fr","2005-06-07 00:15:00",0.065172 +"pt1.pt_uk1.uk","2005-06-07 00:15:00",367.749119 +"uk1.uk_be1.be","2005-06-07 00:15:00",12.040352 +"uk1.uk_de1.de","2005-06-07 00:15:00",162.255549 +"uk1.uk_fr1.fr","2005-06-07 00:15:00",58.607545 +"uk1.uk_pt1.pt","2005-06-07 00:15:00",433.376631 +"be1.be_de1.de","2005-06-22 20:30:00",20.497253 +"be1.be_fr1.fr","2005-06-22 20:30:00",20.782852 +"be1.be_gr1.gr","2005-06-22 20:30:00",0.005848 +"be1.be_it1.it","2005-06-22 20:30:00",0.090026 +"be1.be_uk1.uk","2005-06-22 20:30:00",2.056996 +"de1.de_be1.be","2005-06-22 20:30:00",27.225774 +"de1.de_gr1.gr","2005-06-22 20:30:00",272.761011 +"de1.de_uk1.uk","2005-06-22 20:30:00",199.828438 +"es1.es_fr1.fr","2005-06-22 20:30:00",22.522197 +"es1.es_it1.it","2005-06-22 20:30:00",13.393051 +"es1.es_pt1.pt","2005-06-22 20:30:00",5.932286 +"fr1.fr_be1.be","2005-06-22 20:30:00",15.616435 +"fr1.fr_es1.es","2005-06-22 20:30:00",29.365936 +"fr1.fr_it1.it","2005-06-22 20:30:00",2.797562 +"fr1.fr_pt1.pt","2005-06-22 20:30:00",10.604824 +"fr1.fr_uk1.uk","2005-06-22 20:30:00",45.283715 +"gr1.gr_be1.be","2005-06-22 20:30:00",1.087738 +"gr1.gr_de1.de","2005-06-22 20:30:00",4865.371323 +"gr1.gr_it1.it","2005-06-22 20:30:00",3.528006 +"it1.it_be1.be","2005-06-22 20:30:00",11.366813 +"it1.it_es1.es","2005-06-22 20:30:00",7.02441 +"it1.it_fr1.fr","2005-06-22 20:30:00",22.716083 +"it1.it_gr1.gr","2005-06-22 20:30:00",25.769665 +"pt1.pt_es1.es","2005-06-22 20:30:00",8.340278 +"pt1.pt_fr1.fr","2005-06-22 20:30:00",0.860282 +"pt1.pt_uk1.uk","2005-06-22 20:30:00",293.90633 +"uk1.uk_be1.be","2005-06-22 20:30:00",13.314889 +"uk1.uk_de1.de","2005-06-22 20:30:00",168.266278 +"uk1.uk_fr1.fr","2005-06-22 20:30:00",7.017269 +"uk1.uk_pt1.pt","2005-06-22 20:30:00",575.047825 +"be1.be_de1.de","2005-06-12 04:45:00",48.027576 +"be1.be_fr1.fr","2005-06-12 04:45:00",58.392573 +"be1.be_gr1.gr","2005-06-12 04:45:00",0.115611 +"be1.be_it1.it","2005-06-12 04:45:00",0.011134 +"be1.be_uk1.uk","2005-06-12 04:45:00",1.715897 +"de1.de_be1.be","2005-06-12 04:45:00",84.910002 +"de1.de_gr1.gr","2005-06-12 04:45:00",120.996306 +"de1.de_uk1.uk","2005-06-12 04:45:00",155.065369 +"es1.es_fr1.fr","2005-06-12 04:45:00",7.534709 +"es1.es_it1.it","2005-06-12 04:45:00",12.081569 +"es1.es_pt1.pt","2005-06-12 04:45:00",7.131193 +"fr1.fr_be1.be","2005-06-12 04:45:00",2.231369 +"fr1.fr_es1.es","2005-06-12 04:45:00",3.40216 +"fr1.fr_it1.it","2005-06-12 04:45:00",0.943786 +"fr1.fr_pt1.pt","2005-06-12 04:45:00",17.078504 +"fr1.fr_uk1.uk","2005-06-12 04:45:00",35.828258 +"gr1.gr_be1.be","2005-06-12 04:45:00",3.374157 +"gr1.gr_de1.de","2005-06-12 04:45:00",3976.311229 +"gr1.gr_it1.it","2005-06-12 04:45:00",0.046784 +"it1.it_be1.be","2005-06-12 04:45:00",12.296485 +"it1.it_es1.es","2005-06-12 04:45:00",18.296193 +"it1.it_fr1.fr","2005-06-12 04:45:00",4.634694 +"it1.it_gr1.gr","2005-06-12 04:45:00",0.255965 +"pt1.pt_es1.es","2005-06-12 04:45:00",1.012388 +"pt1.pt_fr1.fr","2005-06-12 04:45:00",0.612415 +"pt1.pt_uk1.uk","2005-06-12 04:45:00",254.932438 +"uk1.uk_be1.be","2005-06-12 04:45:00",0.815578 +"uk1.uk_de1.de","2005-06-12 04:45:00",83.263213 +"uk1.uk_fr1.fr","2005-06-12 04:45:00",16.271979 +"uk1.uk_pt1.pt","2005-06-12 04:45:00",324.332057 +"be1.be_de1.de","2005-07-30 02:00:00",40.205525 +"be1.be_fr1.fr","2005-07-30 02:00:00",17.725783 +"be1.be_gr1.gr","2005-07-30 02:00:00",0.013102 +"be1.be_uk1.uk","2005-07-30 02:00:00",8.324196 +"de1.de_be1.be","2005-07-30 02:00:00",29.881858 +"de1.de_gr1.gr","2005-07-30 02:00:00",62.722043 +"de1.de_uk1.uk","2005-07-30 02:00:00",216.185439 +"es1.es_fr1.fr","2005-07-30 02:00:00",22.856548 +"es1.es_it1.it","2005-07-30 02:00:00",11.847197 +"es1.es_pt1.pt","2005-07-30 02:00:00",15.523204 +"fr1.fr_be1.be","2005-07-30 02:00:00",7.983659 +"fr1.fr_es1.es","2005-07-30 02:00:00",3.740785 +"fr1.fr_it1.it","2005-07-30 02:00:00",0.502595 +"fr1.fr_pt1.pt","2005-07-30 02:00:00",0.199565 +"fr1.fr_uk1.uk","2005-07-30 02:00:00",12.856717 +"gr1.gr_be1.be","2005-07-30 02:00:00",1.1077 +"gr1.gr_de1.de","2005-07-30 02:00:00",3570.000337 +"gr1.gr_it1.it","2005-07-30 02:00:00",4.323903 +"it1.it_be1.be","2005-07-30 02:00:00",5.286414 +"it1.it_es1.es","2005-07-30 02:00:00",121.213021 +"it1.it_fr1.fr","2005-07-30 02:00:00",6.819559 +"it1.it_gr1.gr","2005-07-30 02:00:00",1.487767 +"pt1.pt_es1.es","2005-07-30 02:00:00",1.189291 +"pt1.pt_fr1.fr","2005-07-30 02:00:00",1.43311 +"pt1.pt_uk1.uk","2005-07-30 02:00:00",54.263399 +"uk1.uk_be1.be","2005-07-30 02:00:00",2.675709 +"uk1.uk_de1.de","2005-07-30 02:00:00",117.714986 +"uk1.uk_fr1.fr","2005-07-30 02:00:00",35.445042 +"uk1.uk_pt1.pt","2005-07-30 02:00:00",232.448872 +"be1.be_de1.de","2005-05-24 00:00:00",7.462676 +"be1.be_fr1.fr","2005-05-24 00:00:00",46.305493 +"be1.be_gr1.gr","2005-05-24 00:00:00",0.260969 +"be1.be_it1.it","2005-05-24 00:00:00",0.002643 +"be1.be_uk1.uk","2005-05-24 00:00:00",21.759308 +"de1.de_be1.be","2005-05-24 00:00:00",15.698308 +"de1.de_gr1.gr","2005-05-24 00:00:00",2032.807459 +"de1.de_uk1.uk","2005-05-24 00:00:00",550.498265 +"es1.es_fr1.fr","2005-05-24 00:00:00",20.892334 +"es1.es_it1.it","2005-05-24 00:00:00",99.741955 +"es1.es_pt1.pt","2005-05-24 00:00:00",16.16261 +"fr1.fr_be1.be","2005-05-24 00:00:00",2.836755 +"fr1.fr_es1.es","2005-05-24 00:00:00",10.259564 +"fr1.fr_it1.it","2005-05-24 00:00:00",2.967943 +"fr1.fr_pt1.pt","2005-05-24 00:00:00",2.573705 +"fr1.fr_uk1.uk","2005-05-24 00:00:00",40.368708 +"gr1.gr_be1.be","2005-05-24 00:00:00",2.010099 +"gr1.gr_de1.de","2005-05-24 00:00:00",4563.719698 +"gr1.gr_it1.it","2005-05-24 00:00:00",3.384785 +"it1.it_be1.be","2005-05-24 00:00:00",24.598593 +"it1.it_es1.es","2005-05-24 00:00:00",123.836434 +"it1.it_fr1.fr","2005-05-24 00:00:00",113.240327 +"it1.it_gr1.gr","2005-05-24 00:00:00",23.121173 +"pt1.pt_es1.es","2005-05-24 00:00:00",5.621496 +"pt1.pt_fr1.fr","2005-05-24 00:00:00",0.128713 +"pt1.pt_uk1.uk","2005-05-24 00:00:00",382.279278 +"uk1.uk_be1.be","2005-05-24 00:00:00",2.423005 +"uk1.uk_de1.de","2005-05-24 00:00:00",225.272469 +"uk1.uk_fr1.fr","2005-05-24 00:00:00",29.664524 +"uk1.uk_pt1.pt","2005-05-24 00:00:00",515.544459 +"be1.be_de1.de","2005-07-08 22:45:00",41.721914 +"be1.be_fr1.fr","2005-07-08 22:45:00",22.271518 +"be1.be_uk1.uk","2005-07-08 22:45:00",0.565237 +"de1.de_be1.be","2005-07-08 22:45:00",18.116253 +"de1.de_gr1.gr","2005-07-08 22:45:00",84.363659 +"de1.de_uk1.uk","2005-07-08 22:45:00",198.657985 +"es1.es_fr1.fr","2005-07-08 22:45:00",26.077588 +"es1.es_it1.it","2005-07-08 22:45:00",10.734268 +"es1.es_pt1.pt","2005-07-08 22:45:00",3.212886 +"fr1.fr_be1.be","2005-07-08 22:45:00",2.165579 +"fr1.fr_es1.es","2005-07-08 22:45:00",49.61386 +"fr1.fr_it1.it","2005-07-08 22:45:00",7.861918 +"fr1.fr_pt1.pt","2005-07-08 22:45:00",1.42833 +"fr1.fr_uk1.uk","2005-07-08 22:45:00",175.702188 +"gr1.gr_be1.be","2005-07-08 22:45:00",2.705961 +"gr1.gr_de1.de","2005-07-08 22:45:00",4139.070272 +"gr1.gr_it1.it","2005-07-08 22:45:00",2.765173 +"it1.it_be1.be","2005-07-08 22:45:00",22.960183 +"it1.it_es1.es","2005-07-08 22:45:00",191.877562 +"it1.it_fr1.fr","2005-07-08 22:45:00",10.385578 +"it1.it_gr1.gr","2005-07-08 22:45:00",0.905886 +"pt1.pt_es1.es","2005-07-08 22:45:00",6.78166 +"pt1.pt_fr1.fr","2005-07-08 22:45:00",0.162677 +"pt1.pt_uk1.uk","2005-07-08 22:45:00",131.320816 +"uk1.uk_be1.be","2005-07-08 22:45:00",0.836384 +"uk1.uk_de1.de","2005-07-08 22:45:00",547.487643 +"uk1.uk_fr1.fr","2005-07-08 22:45:00",102.387861 +"uk1.uk_pt1.pt","2005-07-08 22:45:00",381.91698 diff --git a/src/forecaster/tests/data/inject_samples.py b/src/forecaster/tests/data/inject_samples.py new file mode 100644 index 0000000000000000000000000000000000000000..e77cd950828f27e5557ea575d7e9c9b55aabb315 --- /dev/null +++ b/src/forecaster/tests/data/inject_samples.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. + + +import logging, sys +from common.proto.kpi_sample_types_pb2 import KpiSampleType +from common.proto.monitoring_pb2 import Kpi, KpiDescriptor +from common.tools.timestamp.Converters import timestamp_datetime_to_float +from forecaster.tests.Tools import read_csv +from monitoring.client.MonitoringClient import MonitoringClient + +LOGGER = logging.getLogger(__name__) +LOGGER.setLevel(logging.DEBUG) +logging.getLogger('monitoring.client.MonitoringClient').setLevel(logging.INFO) + +CSV_DATA_FILE = 'src/forecaster/tests/data/dataset.csv' + +def main() -> int: + monitoring_client = MonitoringClient() + link_uuid_to_kpi_kpi_uuid = dict() + + df = read_csv(CSV_DATA_FILE) + for row in df.itertuples(index=False): + link_uuid = row.link_id + timestamp = timestamp_datetime_to_float(row.timestamp) + used_capacity_gbps = row.used_capacity_gbps + + if link_uuid in link_uuid_to_kpi_kpi_uuid: + kpi_uuid = link_uuid_to_kpi_kpi_uuid[link_uuid] + else: + kpi_descriptor = KpiDescriptor() + kpi_descriptor.kpi_description = 'Used Capacity in Link: {:s}'.format(link_uuid) + kpi_descriptor.kpi_sample_type = KpiSampleType.KPISAMPLETYPE_LINK_USED_CAPACITY_GBPS + kpi_descriptor.link_id.link_uuid.uuid = link_uuid # pylint: disable=no-member + kpi_id = monitoring_client.SetKpi(kpi_descriptor) + kpi_uuid = kpi_id.kpi_id.uuid + link_uuid_to_kpi_kpi_uuid[link_uuid] = kpi_uuid + + kpi = Kpi() + kpi.kpi_id.kpi_id.uuid = kpi_uuid # pylint: disable=no-member + kpi.timestamp.timestamp = timestamp # pylint: disable=no-member + kpi.kpi_value.floatVal = used_capacity_gbps # pylint: disable=no-member + monitoring_client.IncludeKpi(kpi) + + return 0 + +if __name__ == '__main__': + sys.exit(main()) diff --git a/src/forecaster/tests/data/service.json b/src/forecaster/tests/data/service.json new file mode 100644 index 0000000000000000000000000000000000000000..f4482f44eab4ccb43907015cc351c5e44304cf4e --- /dev/null +++ b/src/forecaster/tests/data/service.json @@ -0,0 +1,22 @@ +{ + "services": [ + { + "service_id": { + "context_id": {"context_uuid": {"uuid": "admin"}}, + "service_uuid": {"uuid": "svc:pt1.pt/client:1==gr1.gr/client:3"} + }, + "service_type": 1, + "service_status": {"service_status": 1}, + "service_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "pt1.pt"}}, "endpoint_uuid": {"uuid": "client:1"}}, + {"device_id": {"device_uuid": {"uuid": "gr1.gr"}}, "endpoint_uuid": {"uuid": "client:3"}} + ], + "service_constraints": [ + {"sla_capacity": {"capacity_gbps": 25.0}}, + {"sla_latency": {"e2e_latency_ms": 20.0}}, + {"schedule": {"start_timestamp": 1700053997, "duration_days": 1.5}} + ], + "service_config": {"config_rules": []} + } + ] +} diff --git a/src/forecaster/tests/data/topology.json b/src/forecaster/tests/data/topology.json new file mode 100644 index 0000000000000000000000000000000000000000..f36fbd7d03a93db61a7233e084f60e7680a54606 --- /dev/null +++ b/src/forecaster/tests/data/topology.json @@ -0,0 +1,200 @@ +{ + "contexts": [ + {"context_id": {"context_uuid": {"uuid": "admin"}}, "name": "admin"} + ], + "topologies": [ + {"topology_id": {"topology_uuid": {"uuid": "admin"}, "context_id": {"context_uuid": {"uuid": "admin"}}}, "name": "admin"} + ], + "devices": [ + {"device_id": {"device_uuid": {"uuid": "fr1.fr"}}, "device_type": "emu-packet-router", "device_operational_status": 1, "device_drivers": [0], "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": "client:1", "type": "copper"}, {"uuid": "client:2", "type": "copper"}, {"uuid": "client:3", "type": "copper"}, + {"uuid": "be1.be", "type": "copper"}, {"uuid": "pt1.pt", "type": "copper"}, {"uuid": "uk1.uk", "type": "copper"}, + {"uuid": "es1.es", "type": "copper"}, {"uuid": "it1.it", "type": "copper"} + ]}}} + ]}}, + {"device_id": {"device_uuid": {"uuid": "be1.be"}}, "device_type": "emu-packet-router", "device_operational_status": 1, "device_drivers": [0], "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": "client:1", "type": "copper"}, {"uuid": "client:2", "type": "copper"}, {"uuid": "client:3", "type": "copper"}, + {"uuid": "de1.de", "type": "copper"}, {"uuid": "gr1.gr", "type": "copper"}, {"uuid": "uk1.uk", "type": "copper"}, + {"uuid": "fr1.fr", "type": "copper"}, {"uuid": "it1.it", "type": "copper"} + ]}}} + ]}}, + {"device_id": {"device_uuid": {"uuid": "uk1.uk"}}, "device_type": "emu-packet-router", "device_operational_status": 1, "device_drivers": [0], "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": "client:1", "type": "copper"}, {"uuid": "client:2", "type": "copper"}, {"uuid": "client:3", "type": "copper"}, + {"uuid": "de1.de", "type": "copper"}, {"uuid": "fr1.fr", "type": "copper"}, {"uuid": "be1.be", "type": "copper"}, + {"uuid": "pt1.pt", "type": "copper"} + ]}}} + ]}}, + {"device_id": {"device_uuid": {"uuid": "de1.de"}}, "device_type": "emu-packet-router", "device_operational_status": 1, "device_drivers": [0], "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": "client:1", "type": "copper"}, {"uuid": "client:2", "type": "copper"}, {"uuid": "client:3", "type": "copper"}, + {"uuid": "uk1.uk", "type": "copper"}, {"uuid": "be1.be", "type": "copper"}, {"uuid": "gr1.gr", "type": "copper"} + ]}}} + ]}}, + {"device_id": {"device_uuid": {"uuid": "pt1.pt"}}, "device_type": "emu-packet-router", "device_operational_status": 1, "device_drivers": [0], "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": "client:1", "type": "copper"}, {"uuid": "client:2", "type": "copper"}, {"uuid": "client:3", "type": "copper"}, + {"uuid": "uk1.uk", "type": "copper"}, {"uuid": "fr1.fr", "type": "copper"}, {"uuid": "es1.es", "type": "copper"} + ]}}} + ]}}, + {"device_id": {"device_uuid": {"uuid": "es1.es"}}, "device_type": "emu-packet-router", "device_operational_status": 1, "device_drivers": [0], "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": "client:1", "type": "copper"}, {"uuid": "client:2", "type": "copper"}, {"uuid": "client:3", "type": "copper"}, + {"uuid": "it1.it", "type": "copper"}, {"uuid": "fr1.fr", "type": "copper"}, {"uuid": "pt1.pt", "type": "copper"} + ]}}} + ]}}, + {"device_id": {"device_uuid": {"uuid": "it1.it"}}, "device_type": "emu-packet-router", "device_operational_status": 1, "device_drivers": [0], "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": "client:1", "type": "copper"}, {"uuid": "client:2", "type": "copper"}, {"uuid": "client:3", "type": "copper"}, + {"uuid": "es1.es", "type": "copper"}, {"uuid": "fr1.fr", "type": "copper"}, {"uuid": "be1.be", "type": "copper"}, + {"uuid": "gr1.gr", "type": "copper"} + ]}}} + ]}}, + {"device_id": {"device_uuid": {"uuid": "gr1.gr"}}, "device_type": "emu-packet-router", "device_operational_status": 1, "device_drivers": [0], "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": "client:1", "type": "copper"}, {"uuid": "client:2", "type": "copper"}, {"uuid": "client:3", "type": "copper"}, + {"uuid": "it1.it", "type": "copper"}, {"uuid": "de1.de", "type": "copper"}, {"uuid": "be1.be", "type": "copper"} + ]}}} + ]}} + ], + "links": [ + {"link_id": {"link_uuid": {"uuid": "fr1.fr_be1.be"}}, "attributes": {"total_capacity_gbps": 100, "used_capacity_gbps": 4.804849}, "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "fr1.fr"}}, "endpoint_uuid": {"uuid": "be1.be"}}, + {"device_id": {"device_uuid": {"uuid": "be1.be"}}, "endpoint_uuid": {"uuid": "fr1.fr"}} + ]}, + {"link_id": {"link_uuid": {"uuid": "uk1.uk_fr1.fr"}}, "attributes": {"total_capacity_gbps": 300, "used_capacity_gbps": 55.182499}, "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "uk1.uk"}}, "endpoint_uuid": {"uuid": "fr1.fr"}}, + {"device_id": {"device_uuid": {"uuid": "fr1.fr"}}, "endpoint_uuid": {"uuid": "uk1.uk"}} + ]}, + {"link_id": {"link_uuid": {"uuid": "uk1.uk_de1.de"}}, "attributes": {"total_capacity_gbps": 600, "used_capacity_gbps": 199.272255}, "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "uk1.uk"}}, "endpoint_uuid": {"uuid": "de1.de"}}, + {"device_id": {"device_uuid": {"uuid": "de1.de"}}, "endpoint_uuid": {"uuid": "uk1.uk"}} + ]}, + {"link_id": {"link_uuid": {"uuid": "uk1.uk_be1.be"}}, "attributes": {"total_capacity_gbps": 100, "used_capacity_gbps": 14.334868}, "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "uk1.uk"}}, "endpoint_uuid": {"uuid": "be1.be"}}, + {"device_id": {"device_uuid": {"uuid": "be1.be"}}, "endpoint_uuid": {"uuid": "uk1.uk"}} + ]}, + {"link_id": {"link_uuid": {"uuid": "pt1.pt_uk1.uk"}}, "attributes": {"total_capacity_gbps": 400, "used_capacity_gbps": 51.415678}, "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "pt1.pt"}}, "endpoint_uuid": {"uuid": "uk1.uk"}}, + {"device_id": {"device_uuid": {"uuid": "uk1.uk"}}, "endpoint_uuid": {"uuid": "pt1.pt"}} + ]}, + {"link_id": {"link_uuid": {"uuid": "pt1.pt_fr1.fr"}}, "attributes": {"total_capacity_gbps": 100, "used_capacity_gbps": 3.733925}, "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "pt1.pt"}}, "endpoint_uuid": {"uuid": "fr1.fr"}}, + {"device_id": {"device_uuid": {"uuid": "fr1.fr"}}, "endpoint_uuid": {"uuid": "pt1.pt"}} + ]}, + {"link_id": {"link_uuid": {"uuid": "pt1.pt_es1.es"}}, "attributes": {"total_capacity_gbps": 100, "used_capacity_gbps": 13.32428}, "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "pt1.pt"}}, "endpoint_uuid": {"uuid": "es1.es"}}, + {"device_id": {"device_uuid": {"uuid": "es1.es"}}, "endpoint_uuid": {"uuid": "pt1.pt"}} + ]}, + {"link_id": {"link_uuid": {"uuid": "it1.it_gr1.gr"}}, "attributes": {"total_capacity_gbps": 800, "used_capacity_gbps": 1.593313}, "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "it1.it"}}, "endpoint_uuid": {"uuid": "gr1.gr"}}, + {"device_id": {"device_uuid": {"uuid": "gr1.gr"}}, "endpoint_uuid": {"uuid": "it1.it"}} + ]}, + {"link_id": {"link_uuid": {"uuid": "it1.it_fr1.fr"}}, "attributes": {"total_capacity_gbps": 200, "used_capacity_gbps": 98.574706}, "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "it1.it"}}, "endpoint_uuid": {"uuid": "fr1.fr"}}, + {"device_id": {"device_uuid": {"uuid": "fr1.fr"}}, "endpoint_uuid": {"uuid": "it1.it"}} + ]}, + {"link_id": {"link_uuid": {"uuid": "it1.it_es1.es"}}, "attributes": {"total_capacity_gbps": 300, "used_capacity_gbps": 18.97108}, "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "it1.it"}}, "endpoint_uuid": {"uuid": "es1.es"}}, + {"device_id": {"device_uuid": {"uuid": "es1.es"}}, "endpoint_uuid": {"uuid": "it1.it"}} + ]}, + {"link_id": {"link_uuid": {"uuid": "it1.it_be1.be"}}, "attributes": {"total_capacity_gbps": 100, "used_capacity_gbps": 10.327772}, "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "it1.it"}}, "endpoint_uuid": {"uuid": "be1.be"}}, + {"device_id": {"device_uuid": {"uuid": "be1.be"}}, "endpoint_uuid": {"uuid": "it1.it"}} + ]}, + {"link_id": {"link_uuid": {"uuid": "gr1.gr_it1.it"}}, "attributes": {"total_capacity_gbps": 100, "used_capacity_gbps": 7.983659}, "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "gr1.gr"}}, "endpoint_uuid": {"uuid": "it1.it"}}, + {"device_id": {"device_uuid": {"uuid": "it1.it"}}, "endpoint_uuid": {"uuid": "gr1.gr"}} + ]}, + {"link_id": {"link_uuid": {"uuid": "gr1.gr_de1.de"}}, "attributes": {"total_capacity_gbps": 5000, "used_capacity_gbps": 4930.897339}, "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "gr1.gr"}}, "endpoint_uuid": {"uuid": "de1.de"}}, + {"device_id": {"device_uuid": {"uuid": "de1.de"}}, "endpoint_uuid": {"uuid": "gr1.gr"}} + ]}, + {"link_id": {"link_uuid": {"uuid": "gr1.gr_be1.be"}}, "attributes": {"total_capacity_gbps": 100, "used_capacity_gbps": 0.895539}, "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "gr1.gr"}}, "endpoint_uuid": {"uuid": "be1.be"}}, + {"device_id": {"device_uuid": {"uuid": "be1.be"}}, "endpoint_uuid": {"uuid": "gr1.gr"}} + ]}, + {"link_id": {"link_uuid": {"uuid": "fr1.fr_uk1.uk"}}, "attributes": {"total_capacity_gbps": 200, "used_capacity_gbps": 28.144199}, "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "fr1.fr"}}, "endpoint_uuid": {"uuid": "uk1.uk"}}, + {"device_id": {"device_uuid": {"uuid": "uk1.uk"}}, "endpoint_uuid": {"uuid": "fr1.fr"}} + ]}, + {"link_id": {"link_uuid": {"uuid": "fr1.fr_pt1.pt"}}, "attributes": {"total_capacity_gbps": 100, "used_capacity_gbps": 1.916587}, "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "fr1.fr"}}, "endpoint_uuid": {"uuid": "pt1.pt"}}, + {"device_id": {"device_uuid": {"uuid": "pt1.pt"}}, "endpoint_uuid": {"uuid": "fr1.fr"}} + ]}, + {"link_id": {"link_uuid": {"uuid": "fr1.fr_it1.it"}}, "attributes": {"total_capacity_gbps": 100, "used_capacity_gbps": 3.330747}, "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "fr1.fr"}}, "endpoint_uuid": {"uuid": "it1.it"}}, + {"device_id": {"device_uuid": {"uuid": "it1.it"}}, "endpoint_uuid": {"uuid": "fr1.fr"}} + ]}, + {"link_id": {"link_uuid": {"uuid": "fr1.fr_es1.es"}}, "attributes": {"total_capacity_gbps": 100, "used_capacity_gbps": 96.682749}, "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "fr1.fr"}}, "endpoint_uuid": {"uuid": "es1.es"}}, + {"device_id": {"device_uuid": {"uuid": "es1.es"}}, "endpoint_uuid": {"uuid": "fr1.fr"}} + ]}, + {"link_id": {"link_uuid": {"uuid": "es1.es_pt1.pt"}}, "attributes": {"total_capacity_gbps": 100, "used_capacity_gbps": 5.643483}, "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "es1.es"}}, "endpoint_uuid": {"uuid": "pt1.pt"}}, + {"device_id": {"device_uuid": {"uuid": "pt1.pt"}}, "endpoint_uuid": {"uuid": "es1.es"}} + ]}, + {"link_id": {"link_uuid": {"uuid": "es1.es_it1.it"}}, "attributes": {"total_capacity_gbps": 100, "used_capacity_gbps": 15.353667}, "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "es1.es"}}, "endpoint_uuid": {"uuid": "it1.it"}}, + {"device_id": {"device_uuid": {"uuid": "it1.it"}}, "endpoint_uuid": {"uuid": "es1.es"}} + ]}, + {"link_id": {"link_uuid": {"uuid": "es1.es_fr1.fr"}}, "attributes": {"total_capacity_gbps": 100, "used_capacity_gbps": 20.517778}, "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "es1.es"}}, "endpoint_uuid": {"uuid": "fr1.fr"}}, + {"device_id": {"device_uuid": {"uuid": "fr1.fr"}}, "endpoint_uuid": {"uuid": "es1.es"}} + ]}, + {"link_id": {"link_uuid": {"uuid": "de1.de_uk1.uk"}}, "attributes": {"total_capacity_gbps": 600, "used_capacity_gbps": 239.446965}, "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "de1.de"}}, "endpoint_uuid": {"uuid": "uk1.uk"}}, + {"device_id": {"device_uuid": {"uuid": "uk1.uk"}}, "endpoint_uuid": {"uuid": "de1.de"}} + ]}, + {"link_id": {"link_uuid": {"uuid": "de1.de_gr1.gr"}}, "attributes": {"total_capacity_gbps": 2100, "used_capacity_gbps": 110.602237}, "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "de1.de"}}, "endpoint_uuid": {"uuid": "gr1.gr"}}, + {"device_id": {"device_uuid": {"uuid": "gr1.gr"}}, "endpoint_uuid": {"uuid": "de1.de"}} + ]}, + {"link_id": {"link_uuid": {"uuid": "de1.de_be1.be"}}, "attributes": {"total_capacity_gbps": 100, "used_capacity_gbps": 57.709307}, "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "de1.de"}}, "endpoint_uuid": {"uuid": "be1.be"}}, + {"device_id": {"device_uuid": {"uuid": "be1.be"}}, "endpoint_uuid": {"uuid": "de1.de"}} + ]}, + {"link_id": {"link_uuid": {"uuid": "uk1.uk_pt1.pt"}}, "attributes": {"total_capacity_gbps": 800, "used_capacity_gbps": 652.70225}, "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "uk1.uk"}}, "endpoint_uuid": {"uuid": "pt1.pt"}}, + {"device_id": {"device_uuid": {"uuid": "pt1.pt"}}, "endpoint_uuid": {"uuid": "uk1.uk"}} + ]}, + {"link_id": {"link_uuid": {"uuid": "be1.be_uk1.uk"}}, "attributes": {"total_capacity_gbps": 200, "used_capacity_gbps": 8.252107}, "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "be1.be"}}, "endpoint_uuid": {"uuid": "uk1.uk"}}, + {"device_id": {"device_uuid": {"uuid": "uk1.uk"}}, "endpoint_uuid": {"uuid": "be1.be"}} + ]}, + {"link_id": {"link_uuid": {"uuid": "be1.be_it1.it"}}, "attributes": {"total_capacity_gbps": 100, "used_capacity_gbps": 0.357069}, "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "be1.be"}}, "endpoint_uuid": {"uuid": "it1.it"}}, + {"device_id": {"device_uuid": {"uuid": "it1.it"}}, "endpoint_uuid": {"uuid": "be1.be"}} + ]}, + {"link_id": {"link_uuid": {"uuid": "be1.be_de1.de"}}, "attributes": {"total_capacity_gbps": 100, "used_capacity_gbps": 20.400142}, "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "be1.be"}}, "endpoint_uuid": {"uuid": "de1.de"}}, + {"device_id": {"device_uuid": {"uuid": "de1.de"}}, "endpoint_uuid": {"uuid": "be1.be"}} + ]}, + {"link_id": {"link_uuid": {"uuid": "be1.be_fr1.fr"}}, "attributes": {"total_capacity_gbps": 100, "used_capacity_gbps": 31.346514}, "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "be1.be"}}, "endpoint_uuid": {"uuid": "fr1.fr"}}, + {"device_id": {"device_uuid": {"uuid": "fr1.fr"}}, "endpoint_uuid": {"uuid": "be1.be"}} + ]}, + {"link_id": {"link_uuid": {"uuid": "be1.be_gr1.gr"}}, "attributes": {"total_capacity_gbps": 100, "used_capacity_gbps": 0.026822}, "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "be1.be"}}, "endpoint_uuid": {"uuid": "gr1.gr"}}, + {"device_id": {"device_uuid": {"uuid": "gr1.gr"}}, "endpoint_uuid": {"uuid": "be1.be"}} + ]} + ] +} diff --git a/src/forecaster/tests/test_unitary.py b/src/forecaster/tests/test_unitary.py new file mode 100644 index 0000000000000000000000000000000000000000..4d53e68df369113610f414d58664bf67e2e5d0b9 --- /dev/null +++ b/src/forecaster/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, pandas, pytest #, json +from typing import Dict, Tuple +from common.Constants import DEFAULT_CONTEXT_NAME, DEFAULT_TOPOLOGY_NAME +from common.proto.context_pb2 import ContextId, TopologyId +from common.proto.forecaster_pb2 import ForecastLinkCapacityRequest, ForecastTopologyCapacityRequest +from common.proto.kpi_sample_types_pb2 import KpiSampleType +from common.proto.monitoring_pb2 import KpiDescriptor +from common.tools.descriptor.Loader import DescriptorLoader, check_descriptor_load_results, validate_empty_scenario +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 forecaster.client.ForecasterClient import ForecasterClient +from forecaster.tests.Tools import compose_descriptors, read_csv +from monitoring.client.MonitoringClient import MonitoringClient +from .MockService_Dependencies import MockService_Dependencies +from .PrepareTestScenario import ( # pylint: disable=unused-import + # be careful, order of symbols is important here! + mock_service, forecaster_service, context_client, monitoring_client, forecaster_client) + +LOGGER = logging.getLogger(__name__) +LOGGER.setLevel(logging.DEBUG) +logging.getLogger('common.tests.InMemoryObjectDatabase').setLevel(logging.INFO) +logging.getLogger('common.tests.InMemoryTimeSeriesDatabase').setLevel(logging.INFO) +logging.getLogger('common.tests.MockServicerImpl_Context').setLevel(logging.INFO) +logging.getLogger('common.tests.MockServicerImpl_Monitoring').setLevel(logging.INFO) +logging.getLogger('context.client.ContextClient').setLevel(logging.INFO) +logging.getLogger('monitoring.client.MonitoringClient').setLevel(logging.INFO) + +JSON_ADMIN_CONTEXT_ID = json_context_id(DEFAULT_CONTEXT_NAME) +ADMIN_CONTEXT_ID = ContextId(**JSON_ADMIN_CONTEXT_ID) +ADMIN_TOPOLOGY_ID = TopologyId(**json_topology_id(DEFAULT_TOPOLOGY_NAME, context_id=JSON_ADMIN_CONTEXT_ID)) + +CSV_DATA_FILE = 'forecaster/tests/data/dataset.csv' +#DESC_DATS_FILE = 'forecaster/tests/data/descriptor.json' + +@pytest.fixture(scope='session') +def scenario() -> Tuple[pandas.DataFrame, Dict]: + df = read_csv(CSV_DATA_FILE) + descriptors = compose_descriptors(df) + #with open(DESC_DATS_FILE, 'w', encoding='UTF-8') as f: + # f.write(json.dumps(descriptors)) + yield df, descriptors + +def test_prepare_environment( + context_client : ContextClient, # pylint: disable=redefined-outer-name + monitoring_client : MonitoringClient, # pylint: disable=redefined-outer-name + mock_service : MockService_Dependencies, # pylint: disable=redefined-outer-name + scenario : Tuple[pandas.DataFrame, Dict] # pylint: disable=redefined-outer-name +) -> None: + df, descriptors = scenario + + validate_empty_scenario(context_client) + descriptor_loader = DescriptorLoader(descriptors=descriptors, context_client=context_client) + results = descriptor_loader.process() + check_descriptor_load_results(results, descriptor_loader) + descriptor_loader.validate() + + # Verify the scenario has no services/slices + response = context_client.GetContext(ADMIN_CONTEXT_ID) + assert len(response.service_ids) == 0 + assert len(response.slice_ids) == 0 + + for link in descriptors['links']: + link_uuid = link['link_id']['link_uuid']['uuid'] + kpi_descriptor = KpiDescriptor() + kpi_descriptor.kpi_id.kpi_id.uuid = link_uuid # pylint: disable=no-member + kpi_descriptor.kpi_description = 'Used Capacity in Link: {:s}'.format(link_uuid) + kpi_descriptor.kpi_sample_type = KpiSampleType.KPISAMPLETYPE_LINK_USED_CAPACITY_GBPS + kpi_descriptor.link_id.link_uuid.uuid = link_uuid # pylint: disable=no-member + monitoring_client.SetKpi(kpi_descriptor) + + mock_service.monitoring_servicer.ts_db._data = df.rename(columns={ + 'link_id': 'kpi_uuid', + 'used_capacity_gbps': 'value' + }) + +def test_forecast_link( + context_client : ContextClient, + forecaster_client : ForecasterClient, +): # pylint: disable=redefined-outer-name + topology = context_client.GetTopology(ADMIN_TOPOLOGY_ID) + link_id = topology.link_ids[0] + forecast_request = ForecastLinkCapacityRequest() + forecast_request.link_id.CopyFrom(link_id) # pylint: disable=no-member + forecast_request.forecast_window_seconds = 10 * 24 * 60 * 60 # 10 days in seconds + forecast_reply = forecaster_client.ForecastLinkCapacity(forecast_request) + assert forecast_reply.link_id == link_id + assert forecast_reply.total_capacity_gbps >= forecast_reply.current_used_capacity_gbps + # TODO: validate forecasted values; might be increasing or decreasing + +def test_forecast_topology( + context_client : ContextClient, + forecaster_client : ForecasterClient, +): # pylint: disable=redefined-outer-name + forecast_request = ForecastTopologyCapacityRequest() + forecast_request.topology_id.CopyFrom(ADMIN_TOPOLOGY_ID) # pylint: disable=no-member + forecast_request.forecast_window_seconds = 10 * 24 * 60 * 60 # 10 days in seconds + forecast_reply = forecaster_client.ForecastTopologyCapacity(forecast_request) + + topology = context_client.GetTopology(ADMIN_TOPOLOGY_ID) + assert len(forecast_reply.link_capacities) == len(topology.link_ids) + reply_link_uuid__to__link_capacity = { + link_capacity.link_id.link_uuid.uuid : link_capacity + for link_capacity in forecast_reply.link_capacities + } + for link_id in topology.link_ids: + link_uuid = link_id.link_uuid.uuid + assert link_uuid in reply_link_uuid__to__link_capacity + link_capacity_forecast = reply_link_uuid__to__link_capacity[link_uuid] + assert link_capacity_forecast.link_id == link_id + assert link_capacity_forecast.total_capacity_gbps >= link_capacity_forecast.current_used_capacity_gbps + # TODO: validate forecasted values; might be increasing or decreasing + +def test_cleanup_environment( + context_client : ContextClient, # pylint: disable=redefined-outer-name + scenario : Tuple[pandas.DataFrame, Dict] # pylint: disable=redefined-outer-name +) -> None: + _, descriptors = scenario + + # Verify the scenario has no services/slices + response = context_client.GetContext(ADMIN_CONTEXT_ID) + assert len(response.service_ids) == 0 + assert len(response.slice_ids) == 0 + + # Load descriptors and validate the base scenario + descriptor_loader = DescriptorLoader(descriptors=descriptors, context_client=context_client) + descriptor_loader.validate() + descriptor_loader.unload() + validate_empty_scenario(context_client) diff --git a/src/interdomain/Dockerfile b/src/interdomain/Dockerfile index 66c6e938d7adf5bd985fc0b4f87fe284c1370be4..c10fd8220adae8100fa15fd5d33d833d30d189a9 100644 --- a/src/interdomain/Dockerfile +++ b/src/interdomain/Dockerfile @@ -16,7 +16,7 @@ FROM python:3.9-slim # Install dependencies RUN apt-get --yes --quiet --quiet update && \ - apt-get --yes --quiet --quiet install wget g++ && \ + apt-get --yes --quiet --quiet install wget g++ git && \ rm -rf /var/lib/apt/lists/* # Set Python to show logs as they occur diff --git a/src/l3_attackmitigator/Dockerfile b/src/l3_attackmitigator/Dockerfile index 99b7e7a9435ca4172e4ec38f8f8d13c20ebdce57..2333bfa30773dcfe49b550d65fb3aa45376d9e03 100644 --- a/src/l3_attackmitigator/Dockerfile +++ b/src/l3_attackmitigator/Dockerfile @@ -16,7 +16,7 @@ FROM python:3.9-slim # Install dependencies RUN apt-get --yes --quiet --quiet update && \ - apt-get --yes --quiet --quiet install wget g++ && \ + apt-get --yes --quiet --quiet install wget g++ git && \ rm -rf /var/lib/apt/lists/* # Set Python to show logs as they occur diff --git a/src/l3_centralizedattackdetector/Dockerfile b/src/l3_centralizedattackdetector/Dockerfile index 377ecd21b0ad553512797ce7a31f1ce520462a13..376d8904dfc58efd2e1963806d0d07179647b54f 100644 --- a/src/l3_centralizedattackdetector/Dockerfile +++ b/src/l3_centralizedattackdetector/Dockerfile @@ -16,7 +16,7 @@ FROM python:3.9-slim # Install dependencies RUN apt-get --yes --quiet --quiet update && \ - apt-get --yes --quiet --quiet install wget g++ && \ + apt-get --yes --quiet --quiet install wget g++ git && \ rm -rf /var/lib/apt/lists/* # Set Python to show logs as they occur diff --git a/src/l3_centralizedattackdetector/service/l3_centralizedattackdetectorServiceServicerImpl.py b/src/l3_centralizedattackdetector/service/l3_centralizedattackdetectorServiceServicerImpl.py index 91793230d0626d9a8dc112c6442a7364b6beb1a1..a5c38151c0f44534b96c550860deac495d442c4d 100644 --- a/src/l3_centralizedattackdetector/service/l3_centralizedattackdetectorServiceServicerImpl.py +++ b/src/l3_centralizedattackdetector/service/l3_centralizedattackdetectorServiceServicerImpl.py @@ -28,7 +28,7 @@ from common.method_wrappers.Decorator import MetricsPool, safe_and_metered_rpc_m from common.proto.context_pb2 import Empty, Timestamp from common.proto.kpi_sample_types_pb2 import KpiSampleType from common.proto.l3_attackmitigator_pb2 import L3AttackmitigatorOutput -from common.proto.l3_centralizedattackdetector_pb2 import AttackIPs, AutoFeatures, L3CentralizedattackdetectorMetrics, StatusMessage +from common.proto.l3_centralizedattackdetector_pb2 import AttackIPs, AutoFeatures, L3CentralizedattackdetectorMetrics, L3CentralizedattackdetectorBatchInput, StatusMessage from common.proto.l3_centralizedattackdetector_pb2_grpc import L3CentralizedattackdetectorServicer from common.proto.monitoring_pb2 import Kpi, KpiDescriptor from common.tools.timestamp.Converters import timestamp_utcnow_to_float diff --git a/src/l3_distributedattackdetector/Dockerfile b/src/l3_distributedattackdetector/Dockerfile index e78c41803f4b80a129ad9537265f68885f0a6d3b..37fb71fbab0ed22b8f2ff6a4281e3cea8dc32684 100644 --- a/src/l3_distributedattackdetector/Dockerfile +++ b/src/l3_distributedattackdetector/Dockerfile @@ -16,7 +16,7 @@ FROM python:3.9-slim # Install dependencies RUN apt-get --yes --quiet --quiet update && \ - apt-get --yes --quiet --quiet install wget g++ libpcap-dev libtool && \ + apt-get --yes --quiet --quiet install wget g++ git libpcap-dev libtool && \ rm -rf /var/lib/apt/lists/* # Set Python to show logs as they occur diff --git a/src/l3_distributedattackdetector/service/known_attack_ips.csv b/src/l3_distributedattackdetector/service/known_attack_ips.csv new file mode 100644 index 0000000000000000000000000000000000000000..254dad83da9342581186335ca63c6ea1e8b2a219 --- /dev/null +++ b/src/l3_distributedattackdetector/service/known_attack_ips.csv @@ -0,0 +1 @@ +37.187.95.110,91.121.140.167,94.23.23.52,94.23.247.226,149.202.83.171 \ No newline at end of file diff --git a/src/l3_distributedattackdetector/service/l3_distributedattackdetector.py b/src/l3_distributedattackdetector/service/l3_distributedattackdetector.py index 357f44a9ab2037438252fb0ca40b1a7dc3c74c54..6c9d09dc57d2966538dbe804117e330e06b10bd4 100644 --- a/src/l3_distributedattackdetector/service/l3_distributedattackdetector.py +++ b/src/l3_distributedattackdetector/service/l3_distributedattackdetector.py @@ -13,28 +13,26 @@ # limitations under the License. import asyncio -import grpc import logging -import numpy as np import os import signal import time from sys import stdout -from common.proto.context_pb2 import ( - Empty, - ServiceTypeEnum, - ContextId, -) + +import grpc +import numpy as np + +from common.proto.context_pb2 import ContextId, Empty, ServiceTypeEnum from common.proto.context_pb2_grpc import ContextServiceStub from common.proto.l3_centralizedattackdetector_pb2 import ( - L3CentralizedattackdetectorMetrics, - L3CentralizedattackdetectorBatchInput, ConnectionMetadata, Feature, + L3CentralizedattackdetectorBatchInput, + L3CentralizedattackdetectorMetrics, ) from common.proto.l3_centralizedattackdetector_pb2_grpc import L3CentralizedattackdetectorStub -# Setup LOGGER +# Setup LOGGER LOGGER = logging.getLogger("dad_LOGGER") LOGGER.setLevel(logging.INFO) logFormatter = logging.Formatter(fmt="%(levelname)-8s %(message)s") @@ -42,112 +40,202 @@ consoleHandler = logging.StreamHandler(stdout) consoleHandler.setFormatter(logFormatter) LOGGER.addHandler(consoleHandler) +# Define constants TSTAT_DIR_NAME = "piped/" -CENTRALIZED_ATTACK_DETECTOR = "192.168.165.78:10001" +CONTROLLER_IP = "192.168.165.78" # Change this to the IP of the controller +CONTEXT_ID = "admin" # Change this to the context ID to be used +CONTEXT_CHANNEL = f"{CONTROLLER_IP}:1010" +CENTRALIZED_ATTACK_DETECTOR = f"{CONTROLLER_IP}:10001" JSON_BLANK = { "ip_o": "", # Client IP "port_o": "", # Client port "ip_d": "", # Server ip "port_d": "", # Server port - "flow_id": "", # Identifier:c_ip,c_port,s_ip,s_port,time_start + "flow_id": "", # Identifier: c_ip,c_port, s_ip,s_port, time_start "protocol": "", # Connection protocol "time_start": 0.0, # Start of connection "time_end": 0.0, # Time of last packet } - STOP = False IGNORE_FIRST_LINE_TSTAT = True - -CONTEXT_ID = "admin" -CONTEXT_CHANNEL = "192.168.165.78:1010" PROFILING = False SEND_DATA_IN_BATCHES = False BATCH_SIZE = 10 -ATTACK_IPS = ["37.187.95.110", "91.121.140.167", "94.23.23.52", "94.23.247.226", "149.202.83.171"] -class l3_distributedattackdetector(): + +class l3_distributedattackdetector: def __init__(self): + """ + Initializes a Distributed Attack Detector. + + This method initializes a Distributed Attack Detector by setting up instance variables, connecting to the Centralized Attack Detector, obtaining feature IDs, and starting the process traffic loop. It also sets up a signal handler for handling keyboard interrupts. + + Args: + None. + + Returns: + None. + """ + LOGGER.info("Creating Distributed Attack Detector") - + self.feature_ids = [] - + self.cad_features = {} self.conn_id = () - - self.connections_dict = {} # Dict for storing ALL data - self.new_connections = {} # Dict for storing NEW data - + + self.connections_dict = {} # Dictionary for storing all connections data + self.new_connections = {} # Dictionary for storing new connections data + + self.known_attack_ips = self.read_kwnown_attack_ips() + signal.signal(signal.SIGINT, self.handler) - + with grpc.insecure_channel(CENTRALIZED_ATTACK_DETECTOR) as channel: self.cad = L3CentralizedattackdetectorStub(channel) - LOGGER.info("Connected to the centralized attack detector") + LOGGER.info("Connected to the Centralized Attack Detector") - LOGGER.info("Obtaining features...") + LOGGER.info("Obtaining features Ids. from the Centralized Attack Detector...") self.feature_ids = self.get_features_ids() LOGGER.info("Features Ids.: {:s}".format(str(self.feature_ids))) - + asyncio.run(self.process_traffic()) - + + def read_kwnown_attack_ips(self): + """ + Reads a list of known attack IPs from a CSV file. + + This method reads a list of known attack IPs from a CSV file named "known_attack_ips.csv". The method returns a list of strings containing the IP addresses. + + Args: + None. + + Returns: + List[str]: A list of strings containing the IP addresses of known attack sources. + """ + + # Initialize an empty list to store the known attack IPs + known_attack_ips = [] + + # Open the known attack IPs CSV file + with open("known_attack_ips.csv", "r") as f: + # Read the contents of the file and split it into a list of strings + known_attack_ips = f.read().split(",") + + # Return the list of known attack IPs + return known_attack_ips def handler(self): + """ + Handles a keyboard interrupt signal. + + This method handles a keyboard interrupt signal by setting the `STOP` flag to `True` and logging a message indicating that the program is stopping gracefully. + + Args: + None. + + Returns: + None. + """ + + # Set the STOP flag to True if STOP: exit() - STOP = True + # Log a message indicating that the program is stopping gracefully LOGGER.info("Gracefully stopping...") - - def follow(self, thefile, time_sleep): + + def follow(self, logfile, time_sleep): """ - Generator function that yields new lines in a file - It reads the logfie (the opened file) + Generator function that yields new lines in a log file. + + This method reads a file object and yields new lines as they are added to the file. The method uses an infinite loop to continuously read the last line of the file. If the file hasn't been updated, the method sleeps for the specified `time_sleep` interval. If the last line of the file doesn't end with a newline character, the method appends the line to a `chunk` variable. When a newline character is encountered, the method yields the line, possibly appending the `chunk` variable to the line if it contains a partial line. The method returns an iterator that yields lines from the file. + + Args: + file (TextIO): The file object to read from. + time_sleep (float): The time to sleep if the file hasn't been updated. + + Yields: + str: The next line in the file. + + Returns: + None. """ + # seek the end of the file - # thefile.seek(0, os.SEEK_END) + # logfile.seek(0, os.SEEK_END) - trozo = "" + chunk = "" - # start infinite loop + # start an infinite loop while True: - # read last line of file - line = thefile.readline() + # read last line of the file + line = logfile.readline() - # sleep if file hasn't been updated + # sleep if the file hasn't been updated if not line: time.sleep(time_sleep) continue + if line[-1] != "\n": - trozo += line + chunk += line else: - if trozo != "": - line = trozo + line - trozo = "" + if chunk != "": + line = chunk + line + chunk = "" + yield line + def load_file(self, dirname=TSTAT_DIR_NAME): + """ + Loads the latest Tstat log file. + + This method loads the latest Tstat log file by searching for the most recent directory in the specified `dirname` directory. If a directory is found, the method returns the path to the `log_tcp_temp_complete` file in that directory. If no directory is found, the method logs a message and waits for 5 seconds before trying again. - def load_file(self, dirname=TSTAT_DIR_NAME): # - Client side - + Args: + dirname (str): The name of the directory to search for Tstat log files. Defaults to `TSTAT_DIR_NAME`. + + Returns: + str: The path to the latest Tstat log file. + """ + while True: + # Get the path to the Tstat directory here = os.path.dirname(os.path.abspath(__file__)) tstat_piped = os.path.join(here, dirname) + + # Get a list of all directories in the Tstat directory tstat_dirs = os.listdir(tstat_piped) + + # If there are directories in the Tstat directory, find the most recent one and return the path to the log file if len(tstat_dirs) > 0: tstat_dirs.sort() new_dir = tstat_dirs[-1] tstat_file = tstat_piped + new_dir + "/log_tcp_temp_complete" + LOGGER.info("Following: {:s}".format(str(tstat_file))) + return tstat_file + # If there are no directories in the Tstat directory, log a message and wait for 5 seconds before trying again else: - LOGGER.info("No Tstat directory!") + LOGGER.info("No Tstat directory found. Waiting...") time.sleep(5) - def process_line(self, line): """ - - Preprocessing before a message per line - - Avoids crash when nan are found by generating a 0s array - - Returns a list of values + Processes a single line of input data and returns a list of feature values. + + Args: + line (str): A single line of input data containing feature values separated by spaces. + + Returns: + List[float]: A list of feature values extracted from the input line. + + Raises: + IndexError: If the input line does not contain enough feature values. """ + line = line.split(" ") try: @@ -157,67 +245,106 @@ class l3_distributedattackdetector(): feature = feature_id - 1 values.append(float(line[feature])) except IndexError: - print("IndexError: {0}".format(line)) + LOGGER.error("IndexError: {0}".format(line)) return values + def get_services(self, context_id_str): + """ + Gets the services for a given context ID. - def get_service_ids(self, context_id_str): - with grpc.insecure_channel(CONTEXT_CHANNEL) as channel: - stub = ContextServiceStub(channel) - context_id = ContextId() - context_id.context_uuid.uuid = context_id_str - return stub.ListServiceIds(context_id) + This method gets the services for a given context ID by calling the ListServices method of the ContextService gRPC stub. + Args: + context_id_str (str): The context ID to get services for. - def get_services(self, context_id_str): + Returns: + ListServicesResponse: A response object containing the services. + """ + with grpc.insecure_channel(CONTEXT_CHANNEL) as channel: stub = ContextServiceStub(channel) context_id = ContextId() context_id.context_uuid.uuid = context_id_str - return stub.ListServices(context_id) + return stub.ListServices(context_id) def get_service_id(self, context_id): - service_id_list = self.get_service_ids(context_id) - service_id = None - for s_id in service_id_list.service_ids: - if ( - s_id.service_uuid.uuid == "0eaa0752-c7b6-4c2e-97da-317fbfee5112" - ): # TODO: Change this identifier to the L3VPN service identifier with the real router for the demo v2 - service_id = s_id - break + """ + Gets the service ID for a given context ID. - return service_id + This method gets the service ID for a given context ID by calling the get_services method and searching for the first service in the list with the service type of SERVICETYPE_L3NM. + Args: + context_id (str): The context ID to get the service ID for. - def get_service_id2(self, context_id): + Returns: + str: The service ID. + """ + service_list = self.get_services(context_id) service_id = None + for s in service_list.services: if s.service_type == ServiceTypeEnum.SERVICETYPE_L3NM: service_id = s.service_id break else: pass - return service_id + return service_id def get_endpoint_id(self, context_id): + """ + Gets the endpoint ID for a given context ID. + + This method gets the endpoint ID for a given context ID by calling the get_services method and searching for the first service in the list with the service type of SERVICETYPE_L3NM. + + Args: + context_id (str): The context ID to get the endpoint ID for. + + Returns: + str: The endpoint ID. + """ + service_list = self.get_services(context_id) endpoint_id = None + for s in service_list.services: if s.service_type == ServiceTypeEnum.SERVICETYPE_L3NM: endpoint_id = s.service_endpoint_ids[0] break - return endpoint_id + return endpoint_id def get_features_ids(self): - return self.cad.GetFeaturesIds(Empty()).auto_features + """ + Gets the feature IDs used by the Centralized Attack Detector model. + + This method gets the feature IDs used by the Centralized Attack Detector model by calling the GetFeaturesIds method of the Centralized Attack Detector gRPC stub. + Args: + None. + + Returns: + list: A list of feature IDs. + """ + + return self.cad.GetFeaturesIds(Empty()).auto_features def check_types(self): + """ + Checks the types of the features that will be sent to the Centralized Attack Detector. + + This method checks the types of the Centralized Attack Detector features to ensure that they are of the correct type. If any of the types are incorrect, the method raises an AssertionError. + + Args: + None. + + Returns: + None. + """ + for feature in self.cad_features["features"]: assert isinstance(feature, float) @@ -230,8 +357,29 @@ class l3_distributedattackdetector(): assert isinstance(self.cad_features["connection_metadata"]["time_start"], float) assert isinstance(self.cad_features["connection_metadata"]["time_end"], float) - def insert_connection(self): + """ + Inserts a new connection into the `connections_dict` instance variable. + + This method inserts a new connection into the `connections_dict` instance variable. The method uses the `conn_id` instance variable to create a new dictionary entry for the connection. If the connection already exists in the dictionary, the method updates the `time_end` value of the existing entry. If the connection doesn't exist in the dictionary, the method creates a new entry with the following keys: + - "ip_o": The source IP address of the connection. + - "port_o": The source port of the connection. + - "ip_d": The destination IP address of the connection. + - "port_d": The destination port of the connection. + - "flow_id": The flow ID of the connection. + - "service_id": The service ID of the connection. + - "endpoint_id": The endpoint ID of the connection. + - "protocol": The protocol of the connection. + - "time_start": The start time of the connection. + - "time_end": The end time of the connection. + + Args: + None. + + Returns: + None. + """ + try: self.connections_dict[self.conn_id]["time_end"] = time.time() except KeyError: @@ -241,19 +389,53 @@ class l3_distributedattackdetector(): self.connections_dict[self.conn_id]["ip_o"] = self.conn_id[0] self.connections_dict[self.conn_id]["port_o"] = self.conn_id[1] self.connections_dict[self.conn_id]["flow_id"] = ":".join(self.conn_id) - self.connections_dict[self.conn_id]["service_id"] = self.get_service_id2(CONTEXT_ID) + self.connections_dict[self.conn_id]["service_id"] = self.get_service_id(CONTEXT_ID) self.connections_dict[self.conn_id]["endpoint_id"] = self.get_endpoint_id(CONTEXT_ID) self.connections_dict[self.conn_id]["protocol"] = "TCP" self.connections_dict[self.conn_id]["ip_d"] = self.conn_id[2] self.connections_dict[self.conn_id]["port_d"] = self.conn_id[3] - def check_if_connection_is_attack(self): - if self.conn_id[0] in ATTACK_IPS or self.conn_id[2] in ATTACK_IPS: - LOGGER.info("Attack detected. Origin: {0}, destination: {1}".format(self.conn_id[0], self.conn_id[2])) + """ + Checks if a connection is an attack based on known attack IP addresses. + + This method checks if a connection is an attack based on known attack IP addresses. The method uses the `conn_id` and `known_attack_ips` instance variables to determine if the source or destination IP address of the connection is in the list of known attack IP addresses. If either IP address is in the list, the method logs a message indicating that an attack has been detected. + Args: + None. + + Returns: + None. + """ + + if self.conn_id[0] in self.known_attack_ips or self.conn_id[2] in self.known_attack_ips: + LOGGER.info("Attack detected. Origin IP address: {0}, destination IP address: {1}".format(self.conn_id[0], self.conn_id[2])) def create_cad_features(self): + """ + Creates a dictionary of features and connection metadata for the Centralized Attack Detector. + + This method creates a dictionary of features and connection metadata for the Centralized Attack Detector. The method uses the `new_connections` and `connections_dict` instance variables to obtain the necessary data. The resulting dictionary contains the following keys: + - "features": A list of the first 10 features of the connection. + - "connection_metadata": A dictionary containing the following keys: + - "ip_o": The source IP address of the connection. + - "port_o": The source port of the connection. + - "ip_d": The destination IP address of the connection. + - "port_d": The destination port of the connection. + - "flow_id": The flow ID of the connection. + - "service_id": The service ID of the connection. + - "endpoint_id": The endpoint ID of the connection. + - "protocol": The protocol of the connection. + - "time_start": The start time of the connection. + - "time_end": The end time of the connection. + + Args: + None. + + Returns: + None. + """ + self.cad_features = { "features": self.new_connections[self.conn_id][0:10], "connection_metadata": { @@ -270,8 +452,19 @@ class l3_distributedattackdetector(): }, } - async def send_batch_async(self, metrics_list_pb): + """ + Sends a batch of traffic data to a Centralized Attack Detector. + + This method sends a batch of traffic data to a Centralized Attack Detector for analysis. The method creates a `L3CentralizedattackdetectorBatchInput` object from the provided `metrics_list_pb`, and sends the batch using an executor to run the `AnalyzeBatchConnectionStatistics` method in a separate thread. The method returns `None`. + + Args: + metrics_list_pb (List[L3CentralizedattackdetectorMetrics]): A list of traffic metrics to send to the Centralized Attack Detector. + + Returns: + None. + """ + loop = asyncio.get_running_loop() # Create metrics batch @@ -279,18 +472,27 @@ class l3_distributedattackdetector(): metrics_batch.metrics.extend(metrics_list_pb) # Send batch - future = loop.run_in_executor( - None, self.cad.AnalyzeBatchConnectionStatistics, metrics_batch - ) + future = loop.run_in_executor(None, self.cad.AnalyzeBatchConnectionStatistics, metrics_batch) try: await future except Exception as e: LOGGER.error(f"Error sending batch: {e}") - async def send_data(self, metrics_list_pb, send_data_times): - # Send to CAD + """ + Sends traffic data to a Centralized Attack Detector. + + This method sends traffic data to a Centralized Attack Detector for analysis. If the `SEND_DATA_IN_BATCHES` flag is set to `True`, the data is sent in batches of size `BATCH_SIZE`. Otherwise, the data is sent one metric at a time. The method returns the updated `metrics_list_pb` and `send_data_times` arrays. + + Args: + metrics_list_pb (List[L3CentralizedattackdetectorMetrics]): A list of traffic metrics to send to the Centralized Attack Detector. + send_data_times (np.ndarray): An array of times it took to send each batch of data. + + Returns: + Tuple[List[L3CentralizedattackdetectorMetrics], np.ndarray]: A tuple containing the updated `metrics_list_pb` and `send_data_times` arrays. + """ + if SEND_DATA_IN_BATCHES: if len(metrics_list_pb) == BATCH_SIZE: send_data_time_start = time.time() @@ -311,8 +513,16 @@ class l3_distributedattackdetector(): return metrics_list_pb, send_data_times - async def process_traffic(self): + """ Processes traffic data from a Tstat log file. + This method reads traffic data from a Tstat log file, processes each line of data, and sends the resulting metrics to a Centralized Attack Detector. It runs indefinitely until the `STOP` flag is set to `True`. + + Args: + None. + Returns: + None. + """ + LOGGER.info("Loading Tstat log file...") logfile = open(self.load_file(), "r") @@ -326,35 +536,36 @@ class l3_distributedattackdetector(): metrics_list_pb = [] LOGGER.info("Starting to process data...") - + index = 0 while True: line = next(loglines, None) while line is None: LOGGER.info("Waiting for new data...") + time.sleep(1 / 100) line = next(loglines, None) + if index == 0 and IGNORE_FIRST_LINE_TSTAT: index = index + 1 continue + if STOP: break num_lines += 1 start = time.time() line_id = line.split(" ") + self.conn_id = (line_id[0], line_id[1], line_id[14], line_id[15]) self.new_connections[self.conn_id] = self.process_line(line) self.check_if_connection_is_attack() - self.insert_connection() - self.create_cad_features() - self.check_types() - + connection_metadata = ConnectionMetadata(**self.cad_features["connection_metadata"]) metrics = L3CentralizedattackdetectorMetrics() @@ -368,9 +579,9 @@ class l3_distributedattackdetector(): metrics_list_pb, send_data_times = await self.send_data(metrics_list_pb, send_data_times) - index = index + 1 - + index += 1 + process_time.append(time.time() - start) - + if num_lines % 10 == 0: - LOGGER.info(f"Number of lines: {num_lines} - Average processing time: {sum(process_time) / num_lines}") \ No newline at end of file + LOGGER.info(f"Number of lines: {num_lines} - Average processing time: {sum(process_time) / num_lines}") diff --git a/src/load_generator/Dockerfile b/src/load_generator/Dockerfile index c9297eb2fa08047ff1883f8c350ebbd1d0b5dd8c..6f7bb0eace4cc3e8561df9e07ce6ef25ebf43855 100644 --- a/src/load_generator/Dockerfile +++ b/src/load_generator/Dockerfile @@ -16,7 +16,7 @@ FROM python:3.9-slim # Install dependencies RUN apt-get --yes --quiet --quiet update && \ - apt-get --yes --quiet --quiet install wget g++ && \ + apt-get --yes --quiet --quiet install wget g++ git && \ rm -rf /var/lib/apt/lists/* # Set Python to show logs as they occur diff --git a/src/load_generator/tests/deploy_specs.sh b/src/load_generator/tests/deploy_specs.sh index 571990ecabfbf120b517f44fd99b4550a4b8a9a1..05623fd626531fc9568fb484f3002b00e171e376 100755 --- a/src/load_generator/tests/deploy_specs.sh +++ b/src/load_generator/tests/deploy_specs.sh @@ -17,11 +17,11 @@ export TFS_REGISTRY_IMAGE="http://localhost:32000/tfs/" # Set the list of components, separated by spaces, you want to build images for, and deploy. # Supported components are: -# context device automation policy service compute monitoring webui +# context device ztp policy service nbi monitoring webui # interdomain slice pathcomp dlt # dbscanserving opticalattackmitigator opticalattackdetector # l3_attackmitigator l3_centralizedattackdetector l3_distributedattackdetector -export TFS_COMPONENTS="context device pathcomp service slice webui load_generator" # automation monitoring compute dlt +export TFS_COMPONENTS="context device pathcomp service slice webui load_generator" # ztp monitoring nbi dlt # Set the tag you want to use for your images. export TFS_IMAGE_TAG="dev" diff --git a/src/monitoring/Dockerfile b/src/monitoring/Dockerfile index 946f2cd1b5d16923aa1509948c759135c7f78eef..36aa7eb0967619202dfbcb18271f646657a58125 100644 --- a/src/monitoring/Dockerfile +++ b/src/monitoring/Dockerfile @@ -16,7 +16,7 @@ FROM python:3.9-slim # Install dependencies RUN apt-get --yes --quiet --quiet update && \ - apt-get --yes --quiet --quiet install wget g++ && \ + apt-get --yes --quiet --quiet install wget g++ git && \ rm -rf /var/lib/apt/lists/* # Set Python to show logs as they occur diff --git a/src/monitoring/service/EventTools.py b/src/monitoring/service/EventTools.py index a840cde455fd37599bc02e8802c9cf41b4515428..468e0c58cc43d1c3ecf1232ebf2a9ed46a91e93b 100644 --- a/src/monitoring/service/EventTools.py +++ b/src/monitoring/service/EventTools.py @@ -18,6 +18,7 @@ from common.method_wrappers.ServiceExceptions import ServiceException from common.proto import monitoring_pb2 from common.proto.context_pb2 import ConfigActionEnum, DeviceOperationalStatusEnum, Empty, EventTypeEnum from common.proto.kpi_sample_types_pb2 import KpiSampleType +from common.tools.grpc.Tools import grpc_message_to_json_string from context.client.ContextClient import ContextClient from monitoring.client.MonitoringClient import MonitoringClient from monitoring.service.MonitoringServiceServicerImpl import LOGGER @@ -43,7 +44,8 @@ class EventsDeviceCollector: self._device_thread = threading.Thread(target=self._collect, args=(self._device_stream,), daemon=False) - self._device_to_state : Dict[str, DeviceOperationalStatusEnum] = dict() + #self._device_to_state : Dict[str, DeviceOperationalStatusEnum] = dict() + self._device_endpoint_monitored : Dict[str, Dict[str, bool]] = dict() self._name_mapping = name_mapping def grpc_server_on(self): @@ -79,33 +81,26 @@ class EventsDeviceCollector: kpi_id_list = [] 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) + LOGGER.debug('Ignoring REMOVE event: {:s}'.format(grpc_message_to_json_string(event))) + self._device_endpoint_monitored.pop(device_uuid, None) continue if event_type not in {EventTypeEnum.EVENTTYPE_CREATE, EventTypeEnum.EVENTTYPE_UPDATE}: - # Unknown event type + LOGGER.debug('Ignoring UNKNOWN event type: {:s}'.format(grpc_message_to_json_string(event))) continue device = self._context_client.GetDevice(event.device_id) self._name_mapping.set_device_name(device_uuid, device.name) - 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 - - activate_monitoring = device_was_not_enabled and device_is_enabled - if not activate_monitoring: - # device is not ready for monitoring + device_op_status = device.device_operational_status + if device_op_status != DEVICE_OP_STATUS_ENABLED: + LOGGER.debug('Ignoring Device not enabled: {:s}'.format(grpc_message_to_json_string(device))) continue enabled_endpoint_names = set() @@ -120,26 +115,41 @@ class EventsDeviceCollector: if not json_resource_value['enabled']: continue enabled_endpoint_names.add(json_resource_value['name']) + endpoints_monitored = self._device_endpoint_monitored.setdefault(device_uuid, dict()) for endpoint in device.device_endpoints: endpoint_uuid = endpoint.endpoint_id.endpoint_uuid.uuid endpoint_name_or_uuid = endpoint.name if endpoint_name_or_uuid is None or len(endpoint_name_or_uuid) == 0: endpoint_name_or_uuid = endpoint_uuid - if endpoint_name_or_uuid not in enabled_endpoint_names: continue 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 + endpoint_was_monitored = endpoints_monitored.get(endpoint_uuid, False) + endpoint_is_enabled = (endpoint_name_or_uuid in enabled_endpoint_names) + + if not endpoint_was_monitored and endpoint_is_enabled: + # activate + 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) + endpoints_monitored[endpoint_uuid] = True + else: + MSG = 'Not implemented condition: event={:s} device={:s} endpoint={:s}' + \ + ' endpoint_was_monitored={:s} endpoint_is_enabled={:s}' + LOGGER.warning(MSG.format( + grpc_message_to_json_string(event), grpc_message_to_json_string(device), + grpc_message_to_json_string(endpoint), str(endpoint_was_monitored), + str(endpoint_is_enabled) + )) - kpi_id = self._monitoring_client.SetKpi(kpi_descriptor) - kpi_id_list.append(kpi_id) except queue.Empty: break diff --git a/src/monitoring/service/ManagementDBTools.py b/src/monitoring/service/ManagementDBTools.py index 6c0a69e0ec6ec22a9fff24a1de073f2df03e2115..d2a63685f17b58c0f92acb4ef9606f3df929b9e0 100644 --- a/src/monitoring/service/ManagementDBTools.py +++ b/src/monitoring/service/ManagementDBTools.py @@ -36,12 +36,13 @@ class ManagementDB(): 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 + device_id STRING, + endpoint_id STRING, + service_id STRING, + slice_id STRING, + connection_id STRING, + link_id STRING, + monitor_flag STRING ); """) LOGGER.debug("KPI table created in the ManagementDB") @@ -87,13 +88,13 @@ class ManagementDB(): 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): + def insert_KPI(self,kpi_description,kpi_sample_type,device_id,endpoint_id,service_id,slice_id,connection_id,link_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)) + 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 ? AND link_id is ?",(device_id,kpi_sample_type,endpoint_id,service_id,slice_id,connection_id,link_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)) + c.execute("INSERT INTO kpi (kpi_description,kpi_sample_type,device_id,endpoint_id,service_id,slice_id,connection_id,link_id) VALUES (?,?,?,?,?,?,?,?)", (kpi_description,kpi_sample_type,device_id,endpoint_id,service_id,slice_id,connection_id,link_id)) self.client.commit() kpi_id = c.lastrowid LOGGER.debug(f"KPI {kpi_id} succesfully inserted in the ManagementDB") diff --git a/src/monitoring/service/MetricsDBTools.py b/src/monitoring/service/MetricsDBTools.py index fd9c092b2d061865cb8c3d625eef8b5d2ef0eab7..ad20b5afaa6d8510e0e39267ef6e1d71782e3e22 100644 --- a/src/monitoring/service/MetricsDBTools.py +++ b/src/monitoring/service/MetricsDBTools.py @@ -96,6 +96,7 @@ class MetricsDB(): 'service_id SYMBOL,' \ 'slice_id SYMBOL,' \ 'connection_id SYMBOL,' \ + 'link_id SYMBOL,' \ 'timestamp TIMESTAMP,' \ 'kpi_value DOUBLE)' \ 'TIMESTAMP(timestamp);' @@ -106,7 +107,7 @@ class MetricsDB(): 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): + def write_KPI(self, time, kpi_id, kpi_sample_type, device_id, endpoint_id, service_id, slice_id, connection_id, link_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 '' @@ -125,7 +126,9 @@ class MetricsDB(): 'endpoint_name': endpoint_name, 'service_id': service_id, 'slice_id': slice_id, - 'connection_id': connection_id,}, + 'connection_id': connection_id, + 'link_id': link_id, + }, columns={ 'kpi_value': kpi_value}, at=datetime.datetime.fromtimestamp(time)) diff --git a/src/monitoring/service/MonitoringServiceServicerImpl.py b/src/monitoring/service/MonitoringServiceServicerImpl.py index 3bfef65ff0c52f110b9a091e96b6f6b97dfa79cf..608b0bad9d5869cde35be60157fec9e0a6d34c90 100644 --- a/src/monitoring/service/MonitoringServiceServicerImpl.py +++ b/src/monitoring/service/MonitoringServiceServicerImpl.py @@ -65,13 +65,14 @@ class MonitoringServiceServicerImpl(MonitoringServiceServicer): 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 + kpi_link_id = request.link_id.link_uuid.uuid 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) + kpi_connection_id, kpi_link_id) response.kpi_id.uuid = str(data) return response @@ -100,6 +101,7 @@ class MonitoringServiceServicerImpl(MonitoringServiceServicer): 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]) + kpiDescriptor.link_id.link_uuid.uuid = str(kpi_db[8]) return kpiDescriptor @safe_and_metered_rpc_method(METRICS_POOL, LOGGER) @@ -117,6 +119,7 @@ class MonitoringServiceServicerImpl(MonitoringServiceServicer): 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.link_id.link_uuid.uuid = str(item[8]) kpi_descriptor_list.kpi_descriptor_list.append(kpi_descriptor) return kpi_descriptor_list @@ -135,11 +138,12 @@ class MonitoringServiceServicerImpl(MonitoringServiceServicer): serviceId = kpiDescriptor.service_id.service_uuid.uuid sliceId = kpiDescriptor.slice_id.slice_uuid.uuid connectionId = kpiDescriptor.connection_id.connection_uuid.uuid + linkId = kpiDescriptor.link_id.link_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) + self.metrics_db.write_KPI(time_stamp, kpiId, kpiSampleType, deviceId, endpointId, serviceId, sliceId, connectionId, linkId, kpi_value) return Empty() @safe_and_metered_rpc_method(METRICS_POOL, LOGGER) diff --git a/src/monitoring/tests/test_unitary.py b/src/monitoring/tests/test_unitary.py index ff19e231e1e6dfee78d5bc1ae71f170990d11609..f2c2215970545e1f6583598bdc5ef88299ba76d2 100644 --- a/src/monitoring/tests/test_unitary.py +++ b/src/monitoring/tests/test_unitary.py @@ -22,16 +22,18 @@ 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.Constants import DEFAULT_CONTEXT_NAME, DEFAULT_TOPOLOGY_NAME, 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 ConfigActionEnum, DeviceOperationalStatusEnum, EventTypeEnum, DeviceEvent, Device, Empty +from common.proto.context_pb2 import ConfigActionEnum, Context, ContextId, DeviceOperationalStatusEnum, EventTypeEnum, DeviceEvent, Device, Empty, Topology, TopologyId 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.object_factory.ConfigRule import json_config_rule_set +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 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 @@ -224,6 +226,18 @@ def ingestion_data(kpi_id_int): kpi_value) sleep(0.1) +################################################## +# Prepare Environment, should be the first test +################################################## + +def test_prepare_environment( + context_client : ContextClient, # pylint: disable=redefined-outer-name,unused-argument +): + context_id = json_context_id(DEFAULT_CONTEXT_NAME) + context_client.SetContext(Context(**json_context(DEFAULT_CONTEXT_NAME))) + context_client.SetTopology(Topology(**json_topology(DEFAULT_TOPOLOGY_NAME, context_id=context_id))) + + ########################### # Tests Implementation ########################### @@ -428,10 +442,11 @@ def test_managementdb_tools_kpis(management_db): # pylint: disable=redefined-out 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 + link_id = _create_kpi_request.link_id.link_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) + kpi_slice_id, kpi_connection_id, link_id) assert isinstance(_kpi_id, int) response = management_db.get_KPI(_kpi_id) @@ -626,3 +641,14 @@ def test_listen_events( events_collector.stop() LOGGER.warning('test_listen_events end') + + +################################################## +# Cleanup Environment, should be the last test +################################################## +def test_cleanup_environment( + context_client : ContextClient, # pylint: disable=redefined-outer-name,unused-argument +): + context_id = json_context_id(DEFAULT_CONTEXT_NAME) + context_client.RemoveTopology(TopologyId(**json_topology_id(DEFAULT_TOPOLOGY_NAME, context_id=context_id))) + context_client.RemoveContext(ContextId(**context_id)) diff --git a/src/nbi/.gitlab-ci.yml b/src/nbi/.gitlab-ci.yml new file mode 100644 index 0000000000000000000000000000000000000000..d9d790803a5cb0387d2d3447ef700154879bb615 --- /dev/null +++ b/src/nbi/.gitlab-ci.yml @@ -0,0 +1,119 @@ +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT 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 nbi: + variables: + IMAGE_NAME: 'nbi' # 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 nbi: + variables: + IMAGE_NAME: 'nbi' # name of the microservice + IMAGE_TAG: 'latest' # tag of the container image (production, development, etc) + stage: unit_test + needs: + - build nbi + 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 9090:9090 -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 --append -m pytest --log-level=INFO --verbose $IMAGE_NAME/tests/test_ietf_l2vpn.py --junitxml=/opt/results/${IMAGE_NAME}_report_ietf_l2vpn.xml" + - docker exec -i $IMAGE_NAME bash -c "coverage run --append -m pytest --log-level=INFO --verbose $IMAGE_NAME/tests/test_ietf_network.py --junitxml=/opt/results/${IMAGE_NAME}_report_ietf_network.xml" + - docker exec -i $IMAGE_NAME bash -c "coverage run --append -m pytest --log-level=INFO --verbose $IMAGE_NAME/tests/test_ietf_l3vpn.py --junitxml=/opt/results/${IMAGE_NAME}_report_ietf_l3vpn.xml" + - docker exec -i $IMAGE_NAME bash -c "coverage run --append -m pytest --log-level=INFO --verbose $IMAGE_NAME/tests/test_etsi_bwm.py --junitxml=/opt/results/${IMAGE_NAME}_report_etsi_bwm.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 nbi: +# variables: +# IMAGE_NAME: 'nbi' # name of the microservice +# IMAGE_TAG: 'latest' # tag of the container image (production, development, etc) +# stage: deploy +# needs: +# - unit test nbi +# # - 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/compute/Config.py b/src/nbi/Config.py similarity index 100% rename from src/compute/Config.py rename to src/nbi/Config.py diff --git a/src/nbi/Dockerfile b/src/nbi/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..eda4d295697e94b659f67d75025d1944db703afc --- /dev/null +++ b/src/nbi/Dockerfile @@ -0,0 +1,93 @@ +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +FROM python:3.9-slim + +# Install dependencies +RUN apt-get --yes --quiet --quiet update && \ + apt-get --yes --quiet --quiet install wget g++ git && \ + 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' {} \; + +# Download, build and install libyang. Note that APT package is outdated +# - Ref: https://github.com/CESNET/libyang +# - Ref: https://github.com/CESNET/libyang-python/ +RUN apt-get --yes --quiet --quiet update && \ + apt-get --yes --quiet --quiet install build-essential cmake libpcre2-dev python3-dev python3-cffi && \ + rm -rf /var/lib/apt/lists/* +RUN mkdir -p /var/libyang +RUN git clone https://github.com/CESNET/libyang.git /var/libyang +RUN mkdir -p /var/libyang/build +WORKDIR /var/libyang/build +RUN cmake -D CMAKE_BUILD_TYPE:String="Release" .. +RUN make +RUN make install +RUN ldconfig + +# Create component sub-folders, get specific Python packages +RUN mkdir -p /var/teraflow/nbi +WORKDIR /var/teraflow/nbi +COPY src/nbi/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/nbi/. nbi/ +COPY src/context/__init__.py context/__init__.py +COPY src/context/client/. context/client/ +COPY src/device/__init__.py device/__init__.py +COPY src/device/client/. device/client/ +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/ +RUN mkdir -p /var/teraflow/tests/tools +COPY src/tests/tools/mock_osm/. tests/tools/mock_osm/ + +# Start the service +ENTRYPOINT ["python", "-m", "nbi.service"] diff --git a/src/nbi/README.md b/src/nbi/README.md new file mode 100644 index 0000000000000000000000000000000000000000..c5ed72704b7d6048d3829eb8f77710e51753b000 --- /dev/null +++ b/src/nbi/README.md @@ -0,0 +1,32 @@ +# NBI Component + +The NBI component uses libyang to validate and process messages. Follow instructions below to install it. + +## Install libyang +- Ref: https://github.com/CESNET/libyang +- Ref: https://github.com/CESNET/libyang-python/ + +__NOTE__: APT package is extremely outdated and does not work for our purposes. + +### Build Requisites +```bash +sudo apt-get install build-essential cmake libpcre2-dev +sudo apt-get install python3-dev gcc python3-cffi +``` + +### Build from source +```bash +mkdir ~/tfs-ctrl/libyang +git clone https://github.com/CESNET/libyang.git ~/tfs-ctrl/libyang +mkdir ~/tfs-ctrl/libyang/build +cd ~/tfs-ctrl/libyang/build +cmake -D CMAKE_BUILD_TYPE:String="Release" .. +make +sudo make install +sudo ldconfig +``` + +### Install Python bindings +```bash +pip install libyang==2.8.0 +``` diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_l2vpn/schemas/__init__.py b/src/nbi/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_l2vpn/schemas/__init__.py rename to src/nbi/__init__.py diff --git a/src/compute/client/ComputeClient.py b/src/nbi/client/NbiClient.py similarity index 95% rename from src/compute/client/ComputeClient.py rename to src/nbi/client/NbiClient.py index 6a6c3fc17a13ccd41b685125a4f0b48011582076..a2fba1cd540c0f8a2e3580f8c894ff9fdb1b94ce 100644 --- a/src/compute/client/ComputeClient.py +++ b/src/nbi/client/NbiClient.py @@ -15,7 +15,7 @@ import grpc, logging from common.Constants import ServiceNameEnum from common.Settings import get_service_host, get_service_port_grpc -from common.proto.compute_pb2_grpc import ComputeServiceStub +from common.proto.nbi_pb2_grpc import NbiServiceStub from common.proto.context_pb2 import ( AuthenticationResult, Empty, Service, ServiceId, ServiceIdList, ServiceStatus, TeraFlowController) from common.tools.client.RetryDecorator import retry, delay_exponential @@ -26,10 +26,10 @@ 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 ComputeClient: +class NbiClient: def __init__(self, host=None, port=None): - if not host: host = get_service_host(ServiceNameEnum.COMPUTE) - if not port: port = get_service_port_grpc(ServiceNameEnum.COMPUTE) + if not host: host = get_service_host(ServiceNameEnum.NBI) + if not port: port = get_service_port_grpc(ServiceNameEnum.NBI) self.endpoint = '{:s}:{:s}'.format(str(host), str(port)) LOGGER.debug('Creating channel to {:s}...'.format(str(self.endpoint))) self.channel = None @@ -39,7 +39,7 @@ class ComputeClient: def connect(self): self.channel = grpc.insecure_channel(self.endpoint) - self.stub = ComputeServiceStub(self.channel) + self.stub = NbiServiceStub(self.channel) def close(self): if self.channel is not None: self.channel.close() diff --git a/src/compute/service/rest_server/nbi_plugins/tools/__init__.py b/src/nbi/client/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/tools/__init__.py rename to src/nbi/client/__init__.py diff --git a/src/nbi/requirements.in b/src/nbi/requirements.in new file mode 100644 index 0000000000000000000000000000000000000000..6e3eb94404f9d12431c715080cf210a02c7c82f4 --- /dev/null +++ b/src/nbi/requirements.in @@ -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. + +deepdiff==6.7.* +deepmerge==1.1.* +Flask==2.1.3 +Flask-HTTPAuth==4.5.0 +Flask-RESTful==0.3.9 +jsonschema==4.4.0 +libyang==2.8.0 +netaddr==0.9.0 +pyang==2.6.0 +git+https://github.com/robshakir/pyangbind.git +requests==2.27.1 +werkzeug==2.3.7 diff --git a/src/compute/service/ComputeService.py b/src/nbi/service/NbiService.py similarity index 69% rename from src/compute/service/ComputeService.py rename to src/nbi/service/NbiService.py index 5970e987ef700207d2522f67b827e6646511782f..8d8236f8e91b257de8d2ee108064562075bc03f2 100644 --- a/src/compute/service/ComputeService.py +++ b/src/nbi/service/NbiService.py @@ -14,15 +14,15 @@ from common.Constants import ServiceNameEnum from common.Settings import get_service_port_grpc -from common.proto.compute_pb2_grpc import add_ComputeServiceServicer_to_server +from common.proto.nbi_pb2_grpc import add_NbiServiceServicer_to_server from common.tools.service.GenericGrpcService import GenericGrpcService -from compute.service.ComputeServiceServicerImpl import ComputeServiceServicerImpl +from nbi.service.NbiServiceServicerImpl import NbiServiceServicerImpl -class ComputeService(GenericGrpcService): +class NbiService(GenericGrpcService): def __init__(self, cls_name: str = __name__) -> None: - port = get_service_port_grpc(ServiceNameEnum.COMPUTE) + port = get_service_port_grpc(ServiceNameEnum.NBI) super().__init__(port, cls_name=cls_name) - self.compute_servicer = ComputeServiceServicerImpl() + self.nbi_servicer = NbiServiceServicerImpl() def install_servicers(self): - add_ComputeServiceServicer_to_server(self.compute_servicer, self.server) + add_NbiServiceServicer_to_server(self.nbi_servicer, self.server) diff --git a/src/compute/service/ComputeServiceServicerImpl.py b/src/nbi/service/NbiServiceServicerImpl.py similarity index 95% rename from src/compute/service/ComputeServiceServicerImpl.py rename to src/nbi/service/NbiServiceServicerImpl.py index 3de1f635cc1380bff7eeb05304a96e834b230f6d..d454a4df92dce719acac0cb6d2a39052c3c66e06 100644 --- a/src/compute/service/ComputeServiceServicerImpl.py +++ b/src/nbi/service/NbiServiceServicerImpl.py @@ -16,13 +16,13 @@ import grpc, logging from common.method_wrappers.Decorator import MetricsPool, safe_and_metered_rpc_method from common.proto.context_pb2 import ( AuthenticationResult, Empty, Service, ServiceId, ServiceIdList, ServiceStatus, TeraFlowController) -from common.proto.compute_pb2_grpc import ComputeServiceServicer +from common.proto.nbi_pb2_grpc import NbiServiceServicer LOGGER = logging.getLogger(__name__) METRICS_POOL = MetricsPool('Compute', 'RPC') -class ComputeServiceServicerImpl(ComputeServiceServicer): +class NbiServiceServicerImpl(NbiServiceServicer): def __init__(self): LOGGER.info('Creating Servicer...') LOGGER.info('Servicer Created') diff --git a/src/compute/tests/__init__.py b/src/nbi/service/__init__.py similarity index 100% rename from src/compute/tests/__init__.py rename to src/nbi/service/__init__.py diff --git a/src/compute/service/__main__.py b/src/nbi/service/__main__.py similarity index 85% rename from src/compute/service/__main__.py rename to src/nbi/service/__main__.py index 6c744d0dcef67fef1d8ac719eaba9420b530fe58..8834e45a2779c8d422ba1f9878c435f14a2f43db 100644 --- a/src/compute/service/__main__.py +++ b/src/nbi/service/__main__.py @@ -18,10 +18,13 @@ 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 .ComputeService import ComputeService +from .NbiService import NbiService from .rest_server.RestServer import RestServer from .rest_server.nbi_plugins.debug_api import register_debug_api +from .rest_server.nbi_plugins.etsi_bwm import register_etsi_bwm_api from .rest_server.nbi_plugins.ietf_l2vpn import register_ietf_l2vpn +from .rest_server.nbi_plugins.ietf_l3vpn import register_ietf_l3vpn +from .rest_server.nbi_plugins.ietf_network import register_ietf_network from .rest_server.nbi_plugins.ietf_network_slice import register_ietf_nss terminate = threading.Event() @@ -54,14 +57,17 @@ def main(): metrics_port = get_metrics_port() start_http_server(metrics_port) - # Starting compute service - grpc_service = ComputeService() + # Starting NBI service + grpc_service = NbiService() grpc_service.start() rest_server = RestServer() + register_debug_api(rest_server) + register_etsi_bwm_api(rest_server) register_ietf_l2vpn(rest_server) # Registering L2VPN entrypoint + register_ietf_l3vpn(rest_server) # Registering L3VPN entrypoint + register_ietf_network(rest_server) register_ietf_nss(rest_server) # Registering NSS entrypoint - register_debug_api(rest_server) rest_server.start() # Wait for Ctrl+C or termination signal diff --git a/src/compute/service/rest_server/RestServer.py b/src/nbi/service/rest_server/RestServer.py similarity index 87% rename from src/compute/service/rest_server/RestServer.py rename to src/nbi/service/rest_server/RestServer.py index f6472fbdbca24cc0ad70ffdb094110699addf61a..33eb457179d53f95d733f6572b41da6df14b3a55 100644 --- a/src/compute/service/rest_server/RestServer.py +++ b/src/nbi/service/rest_server/RestServer.py @@ -18,6 +18,6 @@ from common.tools.service.GenericRestServer import GenericRestServer class RestServer(GenericRestServer): def __init__(self, cls_name: str = __name__) -> None: - bind_port = get_service_port_http(ServiceNameEnum.COMPUTE) - base_url = get_service_baseurl_http(ServiceNameEnum.COMPUTE) + bind_port = get_service_port_http(ServiceNameEnum.NBI) + base_url = get_service_baseurl_http(ServiceNameEnum.NBI) super().__init__(bind_port, base_url, cls_name=cls_name) diff --git a/src/tests/benchmark/automation/__init__.py b/src/nbi/service/rest_server/__init__.py similarity index 100% rename from src/tests/benchmark/automation/__init__.py rename to src/nbi/service/rest_server/__init__.py diff --git a/src/tests/benchmark/automation/tests/__init__.py b/src/nbi/service/rest_server/nbi_plugins/__init__.py similarity index 100% rename from src/tests/benchmark/automation/tests/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/debug_api/Resources.py b/src/nbi/service/rest_server/nbi_plugins/debug_api/Resources.py similarity index 51% rename from src/compute/service/rest_server/nbi_plugins/debug_api/Resources.py rename to src/nbi/service/rest_server/nbi_plugins/debug_api/Resources.py index ffdbba88f077f6490261372f7048b2e2526d8196..5fb46a30294eeec4e07de2ec1ce8387775726c23 100644 --- a/src/compute/service/rest_server/nbi_plugins/debug_api/Resources.py +++ b/src/nbi/service/rest_server/nbi_plugins/debug_api/Resources.py @@ -12,17 +12,22 @@ # See the License for the specific language governing permissions and # limitations under the License. -from flask_restful import Resource +import json +from flask.json import jsonify +from flask_restful import Resource, request from common.proto.context_pb2 import Empty +from common.tools.grpc.Tools import grpc_message_to_json from context.client.ContextClient import ContextClient +from service.client.ServiceClient import ServiceClient from .Tools import ( format_grpc_to_json, grpc_connection_id, grpc_context_id, grpc_device_id, grpc_link_id, grpc_policy_rule_id, - grpc_service_id, grpc_slice_id, grpc_topology_id) + grpc_service_id, grpc_service, grpc_slice_id, grpc_topology_id) class _Resource(Resource): def __init__(self) -> None: super().__init__() self.client = ContextClient() + self.service_client = ServiceClient() class ContextIds(_Resource): def get(self): @@ -32,6 +37,66 @@ class Contexts(_Resource): def get(self): return format_grpc_to_json(self.client.ListContexts(Empty())) +class DummyContexts(_Resource): + def get(self): + contexts = grpc_message_to_json(self.client.ListContexts(Empty()), use_integers_for_enums=True)['contexts'] + devices = grpc_message_to_json(self.client.ListDevices(Empty()), use_integers_for_enums=True)['devices'] + links = grpc_message_to_json(self.client.ListLinks(Empty()), use_integers_for_enums=True)['links'] + + topologies = list() + slices = list() + services = list() + connections = list() + + for context in contexts: + context_uuid = context['context_id']['context_uuid']['uuid'] + context_id = grpc_context_id(context_uuid) + + topologies.extend(grpc_message_to_json( + self.client.ListTopologies(context_id), + use_integers_for_enums=True + )['topologies']) + + slices.extend(grpc_message_to_json( + self.client.ListSlices(context_id), + use_integers_for_enums=True + )['slices']) + + context_services = grpc_message_to_json( + self.client.ListServices(context_id), + use_integers_for_enums=True + )['services'] + services.extend(context_services) + + for service in context_services: + service_uuid = service['service_id']['service_uuid']['uuid'] + service_id = grpc_service_id(context_uuid, service_uuid) + connections.extend(grpc_message_to_json( + self.client.ListConnections(service_id), + use_integers_for_enums=True + )['connections']) + + for device in devices: + for config_rule in device['device_config']['config_rules']: + if 'custom' not in config_rule: continue + resource_value = config_rule['custom']['resource_value'] + if not isinstance(resource_value, str): continue + try: + resource_value = json.loads(resource_value) + except: # pylint: disable=bare-except + pass + config_rule['custom']['resource_value'] = resource_value + + dummy_context = {'dummy_mode': True} + if len(contexts ) > 0: dummy_context['contexts' ] = contexts + if len(topologies ) > 0: dummy_context['topologies' ] = topologies + if len(devices ) > 0: dummy_context['devices' ] = devices + if len(links ) > 0: dummy_context['links' ] = links + if len(slices ) > 0: dummy_context['slices' ] = slices + if len(services ) > 0: dummy_context['services' ] = services + if len(connections) > 0: dummy_context['connections'] = connections + return jsonify(dummy_context) + class Context(_Resource): def get(self, context_uuid : str): return format_grpc_to_json(self.client.GetContext(grpc_context_id(context_uuid))) @@ -60,6 +125,31 @@ class Service(_Resource): def get(self, context_uuid : str, service_uuid : str): return format_grpc_to_json(self.client.GetService(grpc_service_id(context_uuid, service_uuid))) + def post(self, context_uuid : str, service_uuid : str): # pylint: disable=unused-argument + service = request.get_json()['services'][0] + return format_grpc_to_json(self.service_client.CreateService(grpc_service( + service_uuid = service['service_id']['service_uuid']['uuid'], + service_type = service['service_type'], + context_uuid = service['service_id']['context_id']['context_uuid']['uuid'], + ))) + + def put(self, context_uuid : str, service_uuid : str): # pylint: disable=unused-argument + service = request.get_json()['services'][0] + return format_grpc_to_json(self.service_client.UpdateService(grpc_service( + service_uuid = service['service_id']['service_uuid']['uuid'], + service_type = service['service_type'], + context_uuid = service['service_id']['context_id']['context_uuid']['uuid'], + status = service['service_status']['service_status'], + endpoint_ids = service['service_endpoint_ids'], + constraints = service['service_constraints'], + config_rules = service['service_config']['config_rules'] + ))) + + def delete(self, context_uuid : str, service_uuid : str): + return format_grpc_to_json(self.service_client.DeleteService(grpc_service_id( + context_uuid, service_uuid, + ))) + class SliceIds(_Resource): def get(self, context_uuid : str): return format_grpc_to_json(self.client.ListSliceIds(grpc_context_id(context_uuid))) diff --git a/src/compute/service/rest_server/nbi_plugins/debug_api/Tools.py b/src/nbi/service/rest_server/nbi_plugins/debug_api/Tools.py similarity index 57% rename from src/compute/service/rest_server/nbi_plugins/debug_api/Tools.py rename to src/nbi/service/rest_server/nbi_plugins/debug_api/Tools.py index f3dff545ba9812ff3f4e13c3da53774af7626014..fd5eb2316d44f4f13e6d8bedef7411beee80c46a 100644 --- a/src/compute/service/rest_server/nbi_plugins/debug_api/Tools.py +++ b/src/nbi/service/rest_server/nbi_plugins/debug_api/Tools.py @@ -13,15 +13,20 @@ # limitations under the License. from flask.json import jsonify -from common.proto.context_pb2 import ConnectionId, ContextId, DeviceId, LinkId, ServiceId, SliceId, TopologyId +from common.proto.context_pb2 import ( + ConnectionId, ContextId, DeviceId, LinkId, ServiceId, SliceId, TopologyId, Service, ServiceStatusEnum +) from common.proto.policy_pb2 import PolicyRuleId from common.tools.grpc.Tools import grpc_message_to_json from common.tools.object_factory.Connection import json_connection_id from common.tools.object_factory.Context import json_context_id +from common.tools.object_factory.ConfigRule import json_config_rule +from common.tools.object_factory.Constraint import json_constraint_custom +from common.tools.object_factory.EndPoint import json_endpoint_id from common.tools.object_factory.Device import json_device_id from common.tools.object_factory.Link import json_link_id from common.tools.object_factory.PolicyRule import json_policyrule_id -from common.tools.object_factory.Service import json_service_id +from common.tools.object_factory.Service import json_service_id, json_service from common.tools.object_factory.Slice import json_slice_id from common.tools.object_factory.Topology import json_topology_id @@ -44,6 +49,37 @@ def grpc_link_id(link_uuid): def grpc_service_id(context_uuid, service_uuid): return ServiceId(**json_service_id(service_uuid, context_id=json_context_id(context_uuid))) +def grpc_service( + service_uuid, service_type, context_uuid, status=None, endpoint_ids=None, constraints=None, config_rules=None +): + json_context = json_context_id(context_uuid) + json_status = status if status else ServiceStatusEnum.SERVICESTATUS_PLANNED + json_endpoints_ids = [ + json_endpoint_id( + json_device_id(endpoint_id['device_id']['device_uuid']['uuid']), + endpoint_id['endpoint_uuid']['uuid'] + ) + for endpoint_id in endpoint_ids + ] if endpoint_ids else [] + json_constraints = [ + json_constraint_custom( + constraint['custom']['constraint_type'], + constraint['custom']['constraint_value'] + ) + for constraint in constraints + ] if constraints else [] + json_config_rules = [ + json_config_rule( + config_rule['action'], + config_rule['custom']['resource_key'], + config_rule['custom']['resource_value'] + ) + for config_rule in config_rules + ] if config_rules else [] + return Service(**json_service( + service_uuid, service_type, json_context, json_status, + json_endpoints_ids, json_constraints, json_config_rules)) + def grpc_slice_id(context_uuid, slice_uuid): return SliceId(**json_slice_id(slice_uuid, context_id=json_context_id(context_uuid))) diff --git a/src/compute/service/rest_server/nbi_plugins/debug_api/__init__.py b/src/nbi/service/rest_server/nbi_plugins/debug_api/__init__.py similarity index 87% rename from src/compute/service/rest_server/nbi_plugins/debug_api/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/debug_api/__init__.py index d1309353c412a738e2f2238d0bb4fff07765b825..1ccf93144eca4017bc41d6e62aa76260a4ce69f5 100644 --- a/src/compute/service/rest_server/nbi_plugins/debug_api/__init__.py +++ b/src/nbi/service/rest_server/nbi_plugins/debug_api/__init__.py @@ -12,11 +12,18 @@ # See the License for the specific language governing permissions and # limitations under the License. -from compute.service.rest_server.RestServer import RestServer +from nbi.service.rest_server.RestServer import RestServer from .Resources import ( - Connection, ConnectionIds, Connections, Context, ContextIds, Contexts, Device, DeviceIds, Devices, Link, LinkIds, - Links, PolicyRule, PolicyRuleIds, PolicyRules, Service, ServiceIds, Services, Slice, SliceIds, Slices, Topologies, - Topology, TopologyIds) + Connection, ConnectionIds, Connections, + Context, ContextIds, Contexts, + Device, DeviceIds, Devices, + DummyContexts, + Link, LinkIds, Links, + PolicyRule, PolicyRuleIds, PolicyRules, + Service, ServiceIds, Services, + Slice, SliceIds, Slices, + Topologies, Topology, TopologyIds +) URL_PREFIX = '/debug-api' @@ -25,6 +32,7 @@ RESOURCES = [ # (endpoint_name, resource_class, resource_url) ('api.context_ids', ContextIds, '/context_ids'), ('api.contexts', Contexts, '/contexts'), + ('api.dummy_contexts', DummyContexts, '/dummy_contexts'), ('api.context', Context, '/context/'), ('api.topology_ids', TopologyIds, '/context//topology_ids'), diff --git a/src/nbi/service/rest_server/nbi_plugins/etsi_bwm/Resources.py b/src/nbi/service/rest_server/nbi_plugins/etsi_bwm/Resources.py new file mode 100644 index 0000000000000000000000000000000000000000..3fccbbb55c8959ae0c478526d2ea24882ebfef1f --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/etsi_bwm/Resources.py @@ -0,0 +1,86 @@ +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import copy, deepmerge, json, logging +from common.Constants import DEFAULT_CONTEXT_NAME +from context.client.ContextClient import ContextClient +from flask_restful import Resource, request +from service.client.ServiceClient import ServiceClient +from .Tools import ( + format_grpc_to_json, grpc_context_id, grpc_service_id, bwInfo_2_service, service_2_bwInfo) + +LOGGER = logging.getLogger(__name__) + + +class _Resource(Resource): + def __init__(self) -> None: + super().__init__() + self.client = ContextClient() + self.service_client = ServiceClient() + + +class BwInfo(_Resource): + def get(self): + service_list = self.client.ListServices(grpc_context_id(DEFAULT_CONTEXT_NAME)) + bw_allocations = [service_2_bwInfo(service) for service in service_list.services] + return bw_allocations + + def post(self): + bwinfo = request.get_json() + service = bwInfo_2_service(self.client, bwinfo) + stripped_service = copy.deepcopy(service) + stripped_service.ClearField('service_endpoint_ids') + stripped_service.ClearField('service_constraints') + stripped_service.ClearField('service_config') + + response = format_grpc_to_json(self.service_client.CreateService(stripped_service)) + response = format_grpc_to_json(self.service_client.UpdateService(service)) + + return response + + +class BwInfoId(_Resource): + + def get(self, allocationId: str): + service = self.client.GetService(grpc_service_id(DEFAULT_CONTEXT_NAME, allocationId)) + return service_2_bwInfo(service) + + def put(self, allocationId: str): + json_data = json.loads(request.get_json()) + service = bwInfo_2_service(self.client, json_data) + self.service_client.UpdateService(service) + service = self.client.GetService(grpc_service_id(DEFAULT_CONTEXT_NAME, json_data['appInsId'])) + response_bwm = service_2_bwInfo(service) + + return response_bwm + + def patch(self, allocationId: str): + json_data = request.get_json() + if not 'appInsId' in json_data: + json_data['appInsId'] = allocationId + + service = self.client.GetService(grpc_service_id(DEFAULT_CONTEXT_NAME, json_data['appInsId'])) + current_bwm = service_2_bwInfo(service) + new_bmw = deepmerge.always_merger.merge(current_bwm, json_data) + + service = bwInfo_2_service(self.client, new_bmw) + self.service_client.UpdateService(service) + + service = self.client.GetService(grpc_service_id(DEFAULT_CONTEXT_NAME, json_data['appInsId'])) + response_bwm = service_2_bwInfo(service) + + return response_bwm + + def delete(self, allocationId: str): + self.service_client.DeleteService(grpc_service_id(DEFAULT_CONTEXT_NAME, allocationId)) diff --git a/src/nbi/service/rest_server/nbi_plugins/etsi_bwm/Tools.py b/src/nbi/service/rest_server/nbi_plugins/etsi_bwm/Tools.py new file mode 100644 index 0000000000000000000000000000000000000000..a78d2819317623b9ccaaec62e808f6435c88b630 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/etsi_bwm/Tools.py @@ -0,0 +1,113 @@ +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import json +import logging +import time +from decimal import ROUND_HALF_EVEN, Decimal +from flask.json import jsonify +from common.proto.context_pb2 import ( + ContextId, Empty, EndPointId, ServiceId, ServiceTypeEnum, Service, Constraint, Constraint_SLA_Capacity, + ConfigRule, ConfigRule_Custom, ConfigActionEnum) +from common.tools.grpc.Tools import grpc_message_to_json +from common.tools.object_factory.Context import json_context_id +from common.tools.object_factory.Service import json_service_id + +LOGGER = logging.getLogger(__name__) + + +def service_2_bwInfo(service: Service) -> dict: + response = {} + # allocationDirection = '??' # String: 00 = Downlink (towards the UE); 01 = Uplink (towards the application/session); 10 = Symmetrical + response['appInsId'] = service.service_id.service_uuid.uuid # String: Application instance identifier + for constraint in service.service_constraints: + if constraint.WhichOneof('constraint') == 'sla_capacity': + # String: Size of requested fixed BW allocation in [bps] + fixed_allocation = Decimal(constraint.sla_capacity.capacity_gbps * 1.e9) + fixed_allocation = fixed_allocation.quantize(Decimal('0.1'), rounding=ROUND_HALF_EVEN) + response['fixedAllocation'] = str(fixed_allocation) + break + + for config_rule in service.service_config.config_rules: + for key in ['allocationDirection', 'fixedBWPriority', 'requestType', 'sourceIp', 'sourcePort', 'dstPort', 'protocol', 'sessionFilter']: + if config_rule.custom.resource_key == key: + if key != 'sessionFilter': + response[key] = config_rule.custom.resource_value + else: + response[key] = json.loads(config_rule.custom.resource_value) + + unixtime = time.time() + response['timeStamp'] = { # Time stamp to indicate when the corresponding information elements are sent + "seconds": int(unixtime), + "nanoseconds": int(unixtime%1*1e9) + } + + return response + +def bwInfo_2_service(client, bwInfo: dict) -> Service: + service = Service() + for key in ['allocationDirection', 'fixedBWPriority', 'requestType', 'timeStamp', 'sessionFilter']: + if key not in bwInfo: + continue + config_rule = ConfigRule() + config_rule.action = ConfigActionEnum.CONFIGACTION_SET + config_rule_custom = ConfigRule_Custom() + config_rule_custom.resource_key = key + if key != 'sessionFilter': + config_rule_custom.resource_value = str(bwInfo[key]) + else: + config_rule_custom.resource_value = json.dumps(bwInfo[key]) + config_rule.custom.CopyFrom(config_rule_custom) + service.service_config.config_rules.append(config_rule) + + if 'sessionFilter' in bwInfo: + a_ip = bwInfo['sessionFilter'][0]['sourceIp'] + z_ip = bwInfo['sessionFilter'][0]['dstAddress'] + + devices = client.ListDevices(Empty()).devices + for device in devices: + for cr in device.device_config.config_rules: + if cr.WhichOneof('config_rule') == 'custom' and cr.custom.resource_key == '_connect/settings': + for ep in json.loads(cr.custom.resource_value)['endpoints']: + if 'ip' in ep and (ep['ip'] == a_ip or ep['ip'] == z_ip): + ep_id = EndPointId() + ep_id.endpoint_uuid.uuid = ep['uuid'] + ep_id.device_id.device_uuid.uuid = device.device_id.device_uuid.uuid + service.service_endpoint_ids.append(ep_id) + + service.service_type = ServiceTypeEnum.SERVICETYPE_L3NM + + if 'appInsId' in bwInfo: + service.service_id.service_uuid.uuid = bwInfo['appInsId'] + service.service_id.context_id.context_uuid.uuid = 'admin' + service.name = bwInfo['appInsId'] + + if 'fixedAllocation' in bwInfo: + capacity = Constraint_SLA_Capacity() + capacity.capacity_gbps = float(bwInfo['fixedAllocation']) / 1.e9 + constraint = Constraint() + constraint.sla_capacity.CopyFrom(capacity) + service.service_constraints.append(constraint) + + return service + + +def format_grpc_to_json(grpc_reply): + return jsonify(grpc_message_to_json(grpc_reply)) + +def grpc_context_id(context_uuid): + return ContextId(**json_context_id(context_uuid)) + +def grpc_service_id(context_uuid, service_uuid): + return ServiceId(**json_service_id(service_uuid, context_id=json_context_id(context_uuid))) diff --git a/src/nbi/service/rest_server/nbi_plugins/etsi_bwm/__init__.py b/src/nbi/service/rest_server/nbi_plugins/etsi_bwm/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..f34432d82ee302d97cb2caaf3ed1628dc6e9f005 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/etsi_bwm/__init__.py @@ -0,0 +1,29 @@ +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +from nbi.service.rest_server.RestServer import RestServer +from .Resources import BwInfo, BwInfoId + +URL_PREFIX = '/restconf/bwm/v1' + +# Use 'path' type since some identifiers might contain char '/' and Flask is unable to recognize them in 'string' type. +RESOURCES = [ + # (endpoint_name, resource_class, resource_url) + ('api.bw_info', BwInfo, '/bw_allocations'), + ('api.bw_info_id', BwInfoId, '/bw_allocations/'), +] + +def register_etsi_bwm_api(rest_server : RestServer): + for endpoint_name, resource_class, resource_url in RESOURCES: + rest_server.add_resource(resource_class, URL_PREFIX + resource_url, endpoint=endpoint_name) diff --git a/src/nbi/service/rest_server/nbi_plugins/etsi_bwm/tests_etsi_bwm.txt b/src/nbi/service/rest_server/nbi_plugins/etsi_bwm/tests_etsi_bwm.txt new file mode 100644 index 0000000000000000000000000000000000000000..9cfbe5625de45a044e68a8af8ec8f440423da966 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/etsi_bwm/tests_etsi_bwm.txt @@ -0,0 +1,81 @@ +-----------------------GET----------------------- + +curl --request GET \ + --url http://10.1.7.203:80/restconf/bwm/v1/bw_allocations + + +-----------------------POST----------------------- +curl --request POST \ + --url http://10.1.7.203:80/restconf/bwm/v1/bw_allocations \ + --header 'Content-Type: application/json' \ + --data '{ + "allocationDirection": "string", + "appInsId": "service_uuid", + "fixedAllocation": "123", + "fixedBWPriority": "SEE_DESCRIPTION", + "requestType": 0, + "sessionFilter": [ + { + "dstAddress": "192.168.3.2", + "dstPort": [ + "b" + ], + "protocol": "string", + "sourceIp": "192.168.1.2", + "sourcePort": [ + "a" + ] + } + ], + "timeStamp": { + "nanoSeconds": 1, + "seconds": 1 + } +}' + + +-----------------------GET2----------------------- +curl --request GET \ + --url http://10.1.7.203:80/restconf/bwm/v1/bw_allocations/service_uuid + +-----------------------PUT----------------------- + curl --request PUT \ + --url http://10.1.7.203:80/restconf/bwm/v1/bw_allocations/service_uuid \ + --header 'Content-Type: application/json' \ + --data '{ + "allocationDirection": "string", + "appInsId": "service_uuid", + "fixedAllocation": "123", + "fixedBWPriority": "efefe", + "requestType": 0, + "sessionFilter": [ + { + "dstAddress": "192.168.3.2", + "dstPort": [ + "b" + ], + "protocol": "string", + "sourceIp": "192.168.1.2", + "sourcePort": [ + "a" + ] + } + ], + "timeStamp": { + "nanoSeconds": 1, + "seconds": 1 + } +}' + +-----------------------PATCH----------------------- +curl --request PATCH \ + --url http://10.1.7.203:80/restconf/bwm/v1/bw_allocations/service_uuid \ + --header 'Content-Type: application/json' \ + --data '{ + "fixedBWPriority": "uuuuuuuuuuuuuu" +}' + + +-----------------------DELETE----------------------- +curl --request DELETE \ + --url http://10.1.7.203:80/restconf/bwm/v1/bw_allocations/service_uuid \ No newline at end of file diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_l2vpn/Constants.py b/src/nbi/service/rest_server/nbi_plugins/ietf_l2vpn/Constants.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_l2vpn/Constants.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_l2vpn/Constants.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_l2vpn/L2VPN_Service.py b/src/nbi/service/rest_server/nbi_plugins/ietf_l2vpn/L2VPN_Service.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_l2vpn/L2VPN_Service.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_l2vpn/L2VPN_Service.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_l2vpn/L2VPN_Services.py b/src/nbi/service/rest_server/nbi_plugins/ietf_l2vpn/L2VPN_Services.py similarity index 89% rename from src/compute/service/rest_server/nbi_plugins/ietf_l2vpn/L2VPN_Services.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_l2vpn/L2VPN_Services.py index 69676bd0d0165160da4e64c515d04b5a3252102c..a329bc9e4adcd57a98e6eb0ee60da82705598aae 100644 --- a/src/compute/service/rest_server/nbi_plugins/ietf_l2vpn/L2VPN_Services.py +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_l2vpn/L2VPN_Services.py @@ -22,9 +22,9 @@ from common.Constants import DEFAULT_CONTEXT_NAME from common.proto.context_pb2 import SliceStatusEnum, Slice from slice.client.SliceClient import SliceClient from .schemas.vpn_service import SCHEMA_VPN_SERVICE -from compute.service.rest_server.nbi_plugins.tools.HttpStatusCodes import HTTP_CREATED, HTTP_SERVERERROR -from compute.service.rest_server.nbi_plugins.tools.Validator import validate_message -from compute.service.rest_server.nbi_plugins.tools.Authentication import HTTP_AUTH +from nbi.service.rest_server.nbi_plugins.tools.HttpStatusCodes import HTTP_CREATED, HTTP_SERVERERROR +from nbi.service.rest_server.nbi_plugins.tools.Validator import validate_message +from nbi.service.rest_server.nbi_plugins.tools.Authentication import HTTP_AUTH LOGGER = logging.getLogger(__name__) diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_l2vpn/L2VPN_SiteNetworkAccesses.py b/src/nbi/service/rest_server/nbi_plugins/ietf_l2vpn/L2VPN_SiteNetworkAccesses.py similarity index 96% rename from src/compute/service/rest_server/nbi_plugins/ietf_l2vpn/L2VPN_SiteNetworkAccesses.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_l2vpn/L2VPN_SiteNetworkAccesses.py index d74276b75275d1fe4711e10f848d9b9b94c33c38..c4fdea311a1d7f73617ff9ca959bf22d08c304f1 100644 --- a/src/compute/service/rest_server/nbi_plugins/ietf_l2vpn/L2VPN_SiteNetworkAccesses.py +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_l2vpn/L2VPN_SiteNetworkAccesses.py @@ -30,9 +30,9 @@ from common.tools.grpc.Tools import grpc_message_to_json_string from context.client.ContextClient import ContextClient from slice.client.SliceClient import SliceClient from .schemas.site_network_access import SCHEMA_SITE_NETWORK_ACCESS -from compute.service.rest_server.nbi_plugins.tools.Authentication import HTTP_AUTH -from compute.service.rest_server.nbi_plugins.tools.HttpStatusCodes import HTTP_NOCONTENT, HTTP_SERVERERROR -from compute.service.rest_server.nbi_plugins.tools.Validator import validate_message +from nbi.service.rest_server.nbi_plugins.tools.Authentication import HTTP_AUTH +from nbi.service.rest_server.nbi_plugins.tools.HttpStatusCodes import HTTP_NOCONTENT, HTTP_SERVERERROR +from nbi.service.rest_server.nbi_plugins.tools.Validator import validate_message from .Constants import BEARER_MAPPINGS, DEFAULT_ADDRESS_FAMILIES, DEFAULT_BGP_AS, DEFAULT_BGP_ROUTE_TARGET, DEFAULT_MTU LOGGER = logging.getLogger(__name__) diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_l2vpn/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_l2vpn/__init__.py similarity index 93% rename from src/compute/service/rest_server/nbi_plugins/ietf_l2vpn/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_l2vpn/__init__.py index 110c51af5fe0e4cd8e012fd4105712ed176dd12a..11a554313b8b96feae56782187fc3100663a5dce 100644 --- a/src/compute/service/rest_server/nbi_plugins/ietf_l2vpn/__init__.py +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_l2vpn/__init__.py @@ -16,12 +16,12 @@ # Ref: https://datatracker.ietf.org/doc/html/rfc8466 from flask_restful import Resource -from compute.service.rest_server.RestServer import RestServer +from nbi.service.rest_server.RestServer import RestServer from .L2VPN_Services import L2VPN_Services from .L2VPN_Service import L2VPN_Service from .L2VPN_SiteNetworkAccesses import L2VPN_SiteNetworkAccesses -URL_PREFIX = '/data/ietf-l2vpn-svc:l2vpn-svc' +URL_PREFIX = '/restconf/data/ietf-l2vpn-svc:l2vpn-svc' def _add_resource(rest_server : RestServer, resource : Resource, *urls, **kwargs): urls = [(URL_PREFIX + url) for url in urls] diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_l2vpn/schemas/Common.py b/src/nbi/service/rest_server/nbi_plugins/ietf_l2vpn/schemas/Common.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_l2vpn/schemas/Common.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_l2vpn/schemas/Common.py diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_l2vpn/schemas/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_l2vpn/schemas/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..1549d9811aa5d1c193a44ad45d0d7773236c0612 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_l2vpn/schemas/__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/compute/service/rest_server/nbi_plugins/ietf_l2vpn/schemas/site_network_access.py b/src/nbi/service/rest_server/nbi_plugins/ietf_l2vpn/schemas/site_network_access.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_l2vpn/schemas/site_network_access.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_l2vpn/schemas/site_network_access.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_l2vpn/schemas/vpn_service.py b/src/nbi/service/rest_server/nbi_plugins/ietf_l2vpn/schemas/vpn_service.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_l2vpn/schemas/vpn_service.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_l2vpn/schemas/vpn_service.py diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_l3vpn/Handlers.py b/src/nbi/service/rest_server/nbi_plugins/ietf_l3vpn/Handlers.py new file mode 100644 index 0000000000000000000000000000000000000000..2192ea94214201697d196ca7546a906a13197a93 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_l3vpn/Handlers.py @@ -0,0 +1,207 @@ +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT 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, netaddr +from typing import Dict, List, Optional, Tuple +from common.Constants import DEFAULT_CONTEXT_NAME +from common.proto.context_pb2 import Service, ServiceStatusEnum, ServiceTypeEnum +from common.tools.context_queries.Service import get_service_by_uuid +from common.tools.grpc.ConfigRules import update_config_rule_custom +from common.tools.grpc.Constraints import ( + update_constraint_endpoint_location, update_constraint_sla_availability, update_constraint_sla_capacity, + update_constraint_sla_latency +) +from common.tools.grpc.EndPointIds import update_endpoint_ids +from context.client.ContextClient import ContextClient +from service.client.ServiceClient import ServiceClient + +LOGGER = logging.getLogger(__name__) + +def create_service( + service_uuid : str, context_uuid : Optional[str] = DEFAULT_CONTEXT_NAME +) -> Optional[Exception]: + # pylint: disable=no-member + service_request = Service() + service_request.service_id.context_id.context_uuid.uuid = context_uuid + service_request.service_id.service_uuid.uuid = service_uuid + service_request.service_type = ServiceTypeEnum.SERVICETYPE_L3NM + service_request.service_status.service_status = ServiceStatusEnum.SERVICESTATUS_PLANNED + + try: + service_client = ServiceClient() + service_client.CreateService(service_request) + return None + except Exception as e: # pylint: disable=broad-except + LOGGER.exception('Unhandled exception creating Service') + return e + +def process_vpn_service( + vpn_service : Dict, errors : List[Dict] +) -> None: + vpn_id = vpn_service['vpn-id'] + exc = create_service(vpn_id) + if exc is not None: errors.append({'error': str(exc)}) + +def update_service_endpoint( + service_uuid : str, site_id : str, device_uuid : str, endpoint_uuid : str, + vlan_tag : int, ipv4_address : str, ipv4_prefix_length : int, + capacity_gbps : Optional[float] = None, e2e_latency_ms : Optional[float] = None, + availability : Optional[float] = None, mtu : Optional[int] = None, + static_routing : Optional[Dict[Tuple[str, str], str]] = None, + context_uuid : Optional[str] = DEFAULT_CONTEXT_NAME, +) -> Optional[Exception]: + context_client = ContextClient() + service = get_service_by_uuid(context_client, service_uuid, context_uuid=context_uuid, rw_copy=True) + if service is None: raise Exception('VPN({:s}) not found in database'.format(str(service_uuid))) + + endpoint_ids = service.service_endpoint_ids + endpoint_id = update_endpoint_ids(endpoint_ids, device_uuid, endpoint_uuid) + + constraints = service.service_constraints + update_constraint_endpoint_location(constraints, endpoint_id, region=site_id) + if capacity_gbps is not None: update_constraint_sla_capacity (constraints, capacity_gbps) + if e2e_latency_ms is not None: update_constraint_sla_latency (constraints, e2e_latency_ms) + if availability is not None: update_constraint_sla_availability(constraints, 1, True, availability) + + config_rules = service.service_config.config_rules + + service_settings_key = '/settings' + service_settings = {'address_families': (['IPV4'], True)} + if mtu is not None: service_settings['mtu'] = (mtu, True) + update_config_rule_custom(config_rules, service_settings_key, service_settings) + + if static_routing is not None: + service_static_routing_key = '/static_routing' + update_config_rule_custom(config_rules, service_static_routing_key, { + '{:d}-{:s}/{:d}'.format(lan_tag, ip_range, ip_prefix_len): ( + {'vlan-id': lan_tag, 'ip-network': '{:s}/{:d}'.format(ip_range, ip_prefix_len), 'next-hop': next_hop}, + True + ) + for (ip_range, ip_prefix_len, lan_tag), next_hop in static_routing.items() + }) + + ENDPOINT_SETTINGS_KEY = '/device[{:s}]/endpoint[{:s}]/vlan[{:d}]/settings' + endpoint_settings_key = ENDPOINT_SETTINGS_KEY.format(device_uuid, endpoint_uuid, vlan_tag) + field_updates = {} + if vlan_tag is not None: field_updates['vlan_tag' ] = (vlan_tag, True) + if ipv4_address is not None: field_updates['ip_address' ] = (ipv4_address, True) + if ipv4_prefix_length is not None: field_updates['prefix_length'] = (ipv4_prefix_length, True) + update_config_rule_custom(config_rules, endpoint_settings_key, field_updates) + + try: + service_client = ServiceClient() + service_client.UpdateService(service) + return None + except Exception as e: # pylint: disable=broad-except + LOGGER.exception('Unhandled exception updating Service') + return e + +def process_site_network_access( + site_id : str, network_access : Dict, site_static_routing : Dict[Tuple[str, str], str], errors : List[Dict] +) -> None: + endpoint_uuid = network_access['site-network-access-id'] + + if network_access['site-network-access-type'] != 'ietf-l3vpn-svc:multipoint': + MSG = 'Site Network Access Type: {:s}' + raise NotImplementedError(MSG.format(str(network_access['site-network-access-type']))) + + device_uuid = network_access['device-reference'] + service_uuid = network_access['vpn-attachment']['vpn-id'] + + access_role : str = network_access['vpn-attachment']['site-role'] + access_role = access_role.replace('ietf-l3vpn-svc:', '').replace('-role', '') # hub/spoke + if access_role not in {'hub', 'spoke'}: + MSG = 'Site VPN Attackment Role: {:s}' + raise NotImplementedError(MSG.format(str(network_access['site-network-access-type']))) + + ipv4_allocation = network_access['ip-connection']['ipv4'] + if ipv4_allocation['address-allocation-type'] != 'ietf-l3vpn-svc:static-address': + MSG = 'Site Network Access IPv4 Allocation Type: {:s}' + raise NotImplementedError(MSG.format(str(ipv4_allocation['address-allocation-type']))) + ipv4_allocation_addresses = ipv4_allocation['addresses'] + ipv4_provider_address = ipv4_allocation_addresses['provider-address'] + #ipv4_customer_address = ipv4_allocation_addresses['customer-address'] + ipv4_prefix_length = ipv4_allocation_addresses['prefix-length' ] + + vlan_tag = None + ipv4_provider_range = netaddr.IPNetwork('{:s}/{:d}'.format(ipv4_provider_address, ipv4_prefix_length)) + for (_, _, lan_tag), next_hop in site_static_routing.items(): + ip_next_hop = netaddr.IPAddress(next_hop) + if ip_next_hop not in ipv4_provider_range: continue + vlan_tag = lan_tag + break + + ## network_access_static_routing: (lan-range, lan-prefix-len, lan-tag) => next-hop + #network_access_static_routing : Dict[Tuple[str, str], str] = {} + #for rt_proto in network_access['routing-protocols']['routing-protocol']: + # if rt_proto['type'] != 'ietf-l3vpn-svc:static': + # MSG = 'Site Network Access Routing Protocol Type: {:s}' + # raise NotImplementedError(MSG.format(str(rt_proto['type']))) + # for ipv4_rt in rt_proto['static']['cascaded-lan-prefixes']['ipv4-lan-prefixes']: + # lan_range, lan_prefix = ipv4_rt['lan'].split('/') + # lan_prefix = int(lan_prefix) + # lan_tag = int(ipv4_rt['lan-tag'].replace('vlan', '')) + # next_hop = ipv4_rt['next-hop'] + # network_access_static_routing[(lan_range, lan_prefix, lan_tag)] = next_hop + + service_mtu = network_access['service']['svc-mtu'] + service_input_bandwidth = network_access['service']['svc-input-bandwidth'] + service_output_bandwidth = network_access['service']['svc-output-bandwidth'] + service_bandwidth_bps = max(service_input_bandwidth, service_output_bandwidth) + service_bandwidth_gbps = service_bandwidth_bps / 1.e9 + + max_e2e_latency_ms = None + availability = None + for qos_profile_class in network_access['service']['qos']['qos-profile']['classes']['class']: + if qos_profile_class['class-id'] != 'qos-realtime': + MSG = 'Site Network Access QoS Class Id: {:s}' + raise NotImplementedError(MSG.format(str(qos_profile_class['class-id']))) + + if qos_profile_class['direction'] != 'ietf-l3vpn-svc:both': + MSG = 'Site Network Access QoS Class Direction: {:s}' + raise NotImplementedError(MSG.format(str(qos_profile_class['direction']))) + + max_e2e_latency_ms = qos_profile_class['latency']['latency-boundary'] + availability = qos_profile_class['bandwidth']['guaranteed-bw-percent'] + + exc = update_service_endpoint( + service_uuid, site_id, device_uuid, endpoint_uuid, vlan_tag, ipv4_provider_address, ipv4_prefix_length, + capacity_gbps=service_bandwidth_gbps, e2e_latency_ms=max_e2e_latency_ms, availability=availability, + mtu=service_mtu, static_routing=site_static_routing + ) + if exc is not None: errors.append({'error': str(exc)}) + +def process_site(site : Dict, errors : List[Dict]) -> None: + site_id = site['site-id'] + + if site['management']['type'] != 'ietf-l3vpn-svc:provider-managed': + MSG = 'Site Management Type: {:s}' + raise NotImplementedError(MSG.format(str(site['management']['type']))) + + # site_static_routing: (lan-range, lan-prefix-len, lan-tag) => next-hop + site_static_routing : Dict[Tuple[str, str], str] = {} + for rt_proto in site['routing-protocols']['routing-protocol']: + if rt_proto['type'] != 'ietf-l3vpn-svc:static': + MSG = 'Site Routing Protocol Type: {:s}' + raise NotImplementedError(MSG.format(str(rt_proto['type']))) + for ipv4_rt in rt_proto['static']['cascaded-lan-prefixes']['ipv4-lan-prefixes']: + lan_range, lan_prefix = ipv4_rt['lan'].split('/') + lan_prefix = int(lan_prefix) + lan_tag = int(ipv4_rt['lan-tag'].replace('vlan', '')) + next_hop = ipv4_rt['next-hop'] + site_static_routing[(lan_range, lan_prefix, lan_tag)] = next_hop + + network_accesses : List[Dict] = site['site-network-accesses']['site-network-access'] + for network_access in network_accesses: + process_site_network_access(site_id, network_access, site_static_routing, errors) diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_l3vpn/L3VPN_Service.py b/src/nbi/service/rest_server/nbi_plugins/ietf_l3vpn/L3VPN_Service.py new file mode 100644 index 0000000000000000000000000000000000000000..470ff0add7a42ff027f3c6fe95426653aee214a4 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_l3vpn/L3VPN_Service.py @@ -0,0 +1,78 @@ +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT 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 flask import request +from flask.json import jsonify +from flask_restful import Resource +from common.proto.context_pb2 import ServiceStatusEnum +from common.tools.context_queries.Service import get_service_by_uuid +from context.client.ContextClient import ContextClient +from service.client.ServiceClient import ServiceClient +from ..tools.Authentication import HTTP_AUTH +from ..tools.HttpStatusCodes import HTTP_GATEWAYTIMEOUT, HTTP_NOCONTENT, HTTP_OK, HTTP_SERVERERROR + +LOGGER = logging.getLogger(__name__) + +class L3VPN_Service(Resource): + @HTTP_AUTH.login_required + def get(self, vpn_id : str): + LOGGER.debug('VPN_Id: {:s}'.format(str(vpn_id))) + LOGGER.debug('Request: {:s}'.format(str(request))) + + try: + context_client = ContextClient() + + target = get_service_by_uuid(context_client, vpn_id, rw_copy=True) + if target is None: + raise Exception('VPN({:s}) not found in database'.format(str(vpn_id))) + + service_ids = {target.service_id.service_uuid.uuid, target.name} # pylint: disable=no-member + if vpn_id not in service_ids: + raise Exception('Service retrieval failed. Wrong Service Id was returned') + + service_ready_status = ServiceStatusEnum.SERVICESTATUS_ACTIVE + service_status = target.service_status.service_status # pylint: disable=no-member + response = jsonify({}) + response.status_code = HTTP_OK if service_status == service_ready_status else HTTP_GATEWAYTIMEOUT + except Exception as e: # pylint: disable=broad-except + LOGGER.exception('Something went wrong Retrieving VPN({:s})'.format(str(vpn_id))) + response = jsonify({'error': str(e)}) + response.status_code = HTTP_SERVERERROR + return response + + @HTTP_AUTH.login_required + def delete(self, vpn_id : str): + LOGGER.debug('VPN_Id: {:s}'.format(str(vpn_id))) + LOGGER.debug('Request: {:s}'.format(str(request))) + + try: + context_client = ContextClient() + + target = get_service_by_uuid(context_client, vpn_id) + if target is None: + LOGGER.warning('VPN({:s}) not found in database. Nothing done.'.format(str(vpn_id))) + else: + service_ids = {target.service_id.service_uuid.uuid, target.name} # pylint: disable=no-member + if vpn_id not in service_ids: + raise Exception('Service retrieval failed. Wrong Service Id was returned') + service_client = ServiceClient() + service_client.DeleteService(target.service_id) + response = jsonify({}) + response.status_code = HTTP_NOCONTENT + except Exception as e: # pylint: disable=broad-except + LOGGER.exception('Something went wrong Deleting VPN({:s})'.format(str(vpn_id))) + response = jsonify({'error': str(e)}) + response.status_code = HTTP_SERVERERROR + return response diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_l3vpn/L3VPN_Services.py b/src/nbi/service/rest_server/nbi_plugins/ietf_l3vpn/L3VPN_Services.py new file mode 100644 index 0000000000000000000000000000000000000000..13d5c532478e93ef1bd3b1c644d7f3c3ba927af5 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_l3vpn/L3VPN_Services.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 +from typing import Dict +from flask import request +from flask.json import jsonify +from flask_restful import Resource +from werkzeug.exceptions import UnsupportedMediaType +from nbi.service.rest_server.nbi_plugins.tools.HttpStatusCodes import HTTP_CREATED, HTTP_SERVERERROR +from nbi.service.rest_server.nbi_plugins.tools.Authentication import HTTP_AUTH +from .Handlers import process_site, process_vpn_service +from .YangValidator import YangValidator + +LOGGER = logging.getLogger(__name__) + +class L3VPN_Services(Resource): + @HTTP_AUTH.login_required + def get(self): + return {} + + @HTTP_AUTH.login_required + def post(self): + if not request.is_json: raise UnsupportedMediaType('JSON payload is required') + request_data : Dict = request.json + LOGGER.debug('Request: {:s}'.format(str(request_data))) + + yang_validator = YangValidator('ietf-l3vpn-svc') + request_data = yang_validator.parse_to_dict(request_data) + yang_validator.destroy() + + errors = [] + + for vpn_service in request_data['l3vpn-svc']['vpn-services']['vpn-service']: + process_vpn_service(vpn_service, errors) + + for site in request_data['l3vpn-svc']['sites']['site']: + process_site(site, errors) + + response = jsonify(errors) + response.status_code = HTTP_CREATED if len(errors) == 0 else HTTP_SERVERERROR + return response diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_l3vpn/L3VPN_SiteNetworkAccesses.py b/src/nbi/service/rest_server/nbi_plugins/ietf_l3vpn/L3VPN_SiteNetworkAccesses.py new file mode 100644 index 0000000000000000000000000000000000000000..cd0334789af67bb2b9e7083a3794dbd3a7c948df --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_l3vpn/L3VPN_SiteNetworkAccesses.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 logging +from typing import Dict +from flask import request +from flask.json import jsonify +from flask.wrappers import Response +from flask_restful import Resource +from werkzeug.exceptions import UnsupportedMediaType +from nbi.service.rest_server.nbi_plugins.tools.Authentication import HTTP_AUTH +from nbi.service.rest_server.nbi_plugins.tools.HttpStatusCodes import HTTP_CREATED, HTTP_SERVERERROR +from .Handlers import process_site_network_access +from .YangValidator import YangValidator + +LOGGER = logging.getLogger(__name__) + +def process_site_network_accesses(site_id : str) -> Response: + if not request.is_json: raise UnsupportedMediaType('JSON payload is required') + request_data : Dict = request.json + LOGGER.debug('Site_Id: {:s}'.format(str(site_id))) + LOGGER.debug('Request: {:s}'.format(str(request_data))) + + yang_validator = YangValidator('ietf-l3vpn-svc') + request_data = yang_validator.parse_to_dict(request_data) + yang_validator.destroy() + + # TODO: retrieve site static routing from service + site_static_routing = dict() + + errors = [] + for network_access in request_data['site-network-accesses']['site-network-access']: + exc = process_site_network_access(site_id, network_access, site_static_routing, errors) + if exc is not None: errors.append({'error': str(exc)}) + + response = jsonify(errors) + response.status_code = HTTP_CREATED if len(errors) == 0 else HTTP_SERVERERROR + return response + +class L3VPN_SiteNetworkAccesses(Resource): + @HTTP_AUTH.login_required + def post(self, site_id : str): + return process_site_network_accesses(site_id) + + @HTTP_AUTH.login_required + def put(self, site_id : str): + return process_site_network_accesses(site_id) diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_l3vpn/YangValidator.py b/src/nbi/service/rest_server/nbi_plugins/ietf_l3vpn/YangValidator.py new file mode 100644 index 0000000000000000000000000000000000000000..d267640dd43d3400517c488c65ae786422c073bc --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_l3vpn/YangValidator.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 libyang, os +from typing import Dict, Optional + +YANG_DIR = os.path.join(os.path.dirname(__file__), 'yang') + +class YangValidator: + def __init__(self, module_name : str) -> None: + self._yang_context = libyang.Context(YANG_DIR) + self._yang_module = self._yang_context.load_module(module_name) + self._yang_module.feature_enable_all() + + def parse_to_dict(self, message : Dict) -> Dict: + dnode : Optional[libyang.DNode] = self._yang_module.parse_data_dict( + message, validate_present=True, validate=True, strict=True + ) + if dnode is None: raise Exception('Unable to parse Message({:s})'.format(str(message))) + message = dnode.print_dict() + dnode.free() + return message + + def destroy(self) -> None: + self._yang_context.destroy() diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_l3vpn/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_l3vpn/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..454e10b841eed19a1837762825b4fd61ae21e4c4 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_l3vpn/__init__.py @@ -0,0 +1,41 @@ +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# RFC 8299 - YANG Data Model for L3VPN Service Delivery +# Ref: https://datatracker.ietf.org/doc/rfc8299 + +from flask_restful import Resource +from nbi.service.rest_server.RestServer import RestServer +from .L3VPN_Services import L3VPN_Services +from .L3VPN_Service import L3VPN_Service +from .L3VPN_SiteNetworkAccesses import L3VPN_SiteNetworkAccesses + +URL_PREFIX = '/restconf/data/ietf-l3vpn-svc:l3vpn-svc' + +def _add_resource(rest_server : RestServer, resource : Resource, *urls, **kwargs): + urls = [(URL_PREFIX + url) for url in urls] + rest_server.add_resource(resource, *urls, **kwargs) + +def register_ietf_l3vpn(rest_server : RestServer): + _add_resource(rest_server, L3VPN_Services, + '/vpn-services', + ) + _add_resource(rest_server, L3VPN_Service, + '/vpn-services/vpn-service=', + '/vpn-services/vpn-service=/', + ) + _add_resource(rest_server, L3VPN_SiteNetworkAccesses, + '/sites/site=/site-network-accesses', + '/sites/site=/site-network-accesses/', + ) diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_l3vpn/yang/ietf-inet-types@2013-07-15.yang b/src/nbi/service/rest_server/nbi_plugins/ietf_l3vpn/yang/ietf-inet-types@2013-07-15.yang new file mode 100644 index 0000000000000000000000000000000000000000..790bafc31dd7dc3582ef1c765fe104145b8a6016 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_l3vpn/yang/ietf-inet-types@2013-07-15.yang @@ -0,0 +1,459 @@ + module ietf-inet-types { + + namespace "urn:ietf:params:xml:ns:yang:ietf-inet-types"; + prefix "inet"; + + organization + "IETF NETMOD (NETCONF Data Modeling Language) Working Group"; + + contact + "WG Web: + WG List: + + WG Chair: David Kessens + + + WG Chair: Juergen Schoenwaelder + + + Editor: Juergen Schoenwaelder + "; + + description + "This module contains a collection of generally useful derived + YANG data types for Internet addresses and related things. + + Copyright (c) 2013 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). + + This version of this YANG module is part of RFC 6991; see + the RFC itself for full legal notices."; + + revision 2013-07-15 { + description + "This revision adds the following new data types: + - ip-address-no-zone + - ipv4-address-no-zone + - ipv6-address-no-zone"; + reference + "RFC 6991: Common YANG Data Types"; + } + + revision 2010-09-24 { + description + "Initial revision."; + reference + "RFC 6021: Common YANG Data Types"; + } + + /*** collection of types related to protocol fields ***/ + + typedef ip-version { + type enumeration { + enum unknown { + value "0"; + description + "An unknown or unspecified version of the Internet + protocol."; + } + enum ipv4 { + value "1"; + description + "The IPv4 protocol as defined in RFC 791."; + } + enum ipv6 { + value "2"; + description + "The IPv6 protocol as defined in RFC 2460."; + } + } + description + "This value represents the version of the IP protocol. + + In the value set and its semantics, this type is equivalent + to the InetVersion textual convention of the SMIv2."; + reference + "RFC 791: Internet Protocol + RFC 2460: Internet Protocol, Version 6 (IPv6) Specification + RFC 4001: Textual Conventions for Internet Network Addresses"; + } + + typedef dscp { + type uint8 { + range "0..63"; + } + description + "The dscp type represents a Differentiated Services Code Point + that may be used for marking packets in a traffic stream. + + In the value set and its semantics, this type is equivalent + to the Dscp textual convention of the SMIv2."; + reference + "RFC 3289: Management Information Base for the Differentiated + Services Architecture + RFC 2474: Definition of the Differentiated Services Field + (DS Field) in the IPv4 and IPv6 Headers + RFC 2780: IANA Allocation Guidelines For Values In + the Internet Protocol and Related Headers"; + } + + typedef ipv6-flow-label { + type uint32 { + range "0..1048575"; + } + description + "The ipv6-flow-label type represents the flow identifier or Flow + Label in an IPv6 packet header that may be used to + discriminate traffic flows. + + In the value set and its semantics, this type is equivalent + to the IPv6FlowLabel textual convention of the SMIv2."; + reference + "RFC 3595: Textual Conventions for IPv6 Flow Label + RFC 2460: Internet Protocol, Version 6 (IPv6) Specification"; + } + + typedef port-number { + type uint16 { + range "0..65535"; + } + description + "The port-number type represents a 16-bit port number of an + Internet transport-layer protocol such as UDP, TCP, DCCP, or + SCTP. Port numbers are assigned by IANA. A current list of + all assignments is available from . + + Note that the port number value zero is reserved by IANA. In + situations where the value zero does not make sense, it can + be excluded by subtyping the port-number type. + In the value set and its semantics, this type is equivalent + to the InetPortNumber textual convention of the SMIv2."; + reference + "RFC 768: User Datagram Protocol + RFC 793: Transmission Control Protocol + RFC 4960: Stream Control Transmission Protocol + RFC 4340: Datagram Congestion Control Protocol (DCCP) + RFC 4001: Textual Conventions for Internet Network Addresses"; + } + + /*** collection of types related to autonomous systems ***/ + + typedef as-number { + type uint32; + description + "The as-number type represents autonomous system numbers + which identify an Autonomous System (AS). An AS is a set + of routers under a single technical administration, using + an interior gateway protocol and common metrics to route + packets within the AS, and using an exterior gateway + protocol to route packets to other ASes. IANA maintains + the AS number space and has delegated large parts to the + regional registries. + + Autonomous system numbers were originally limited to 16 + bits. BGP extensions have enlarged the autonomous system + number space to 32 bits. This type therefore uses an uint32 + base type without a range restriction in order to support + a larger autonomous system number space. + + In the value set and its semantics, this type is equivalent + to the InetAutonomousSystemNumber textual convention of + the SMIv2."; + reference + "RFC 1930: Guidelines for creation, selection, and registration + of an Autonomous System (AS) + RFC 4271: A Border Gateway Protocol 4 (BGP-4) + RFC 4001: Textual Conventions for Internet Network Addresses + RFC 6793: BGP Support for Four-Octet Autonomous System (AS) + Number Space"; + } + + /*** collection of types related to IP addresses and hostnames ***/ + + typedef ip-address { + type union { + type inet:ipv4-address; + type inet:ipv6-address; + } + description + "The ip-address type represents an IP address and is IP + version neutral. The format of the textual representation + implies the IP version. This type supports scoped addresses + by allowing zone identifiers in the address format."; + reference + "RFC 4007: IPv6 Scoped Address Architecture"; + } + + typedef ipv4-address { + type string { + pattern + '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.){3}' + + '([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])' + + '(%[\p{N}\p{L}]+)?'; + } + description + "The ipv4-address type represents an IPv4 address in + dotted-quad notation. The IPv4 address may include a zone + index, separated by a % sign. + + The zone index is used to disambiguate identical address + values. For link-local addresses, the zone index will + typically be the interface index number or the name of an + interface. If the zone index is not present, the default + zone of the device will be used. + + The canonical format for the zone index is the numerical + format"; + } + + typedef ipv6-address { + type string { + pattern '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}' + + '((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|' + + '(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\.){3}' + + '(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))' + + '(%[\p{N}\p{L}]+)?'; + pattern '(([^:]+:){6}(([^:]+:[^:]+)|(.*\..*)))|' + + '((([^:]+:)*[^:]+)?::(([^:]+:)*[^:]+)?)' + + '(%.+)?'; + } + description + "The ipv6-address type represents an IPv6 address in full, + mixed, shortened, and shortened-mixed notation. The IPv6 + address may include a zone index, separated by a % sign. + + The zone index is used to disambiguate identical address + values. For link-local addresses, the zone index will + typically be the interface index number or the name of an + interface. If the zone index is not present, the default + zone of the device will be used. + + The canonical format of IPv6 addresses uses the textual + representation defined in Section 4 of RFC 5952. The + canonical format for the zone index is the numerical + format as described in Section 11.2 of RFC 4007."; + reference + "RFC 4291: IP Version 6 Addressing Architecture + RFC 4007: IPv6 Scoped Address Architecture + RFC 5952: A Recommendation for IPv6 Address Text + Representation"; + } + + typedef ip-address-no-zone { + type union { + type inet:ipv4-address-no-zone; + type inet:ipv6-address-no-zone; + } + description + "The ip-address-no-zone type represents an IP address and is + IP version neutral. The format of the textual representation + implies the IP version. This type does not support scoped + addresses since it does not allow zone identifiers in the + address format."; + reference + "RFC 4007: IPv6 Scoped Address Architecture"; + } + + typedef ipv4-address-no-zone { + type inet:ipv4-address { + pattern '[0-9\.]*'; + } + description + "An IPv4 address without a zone index. This type, derived from + ipv4-address, may be used in situations where the zone is + known from the context and hence no zone index is needed."; + } + + typedef ipv6-address-no-zone { + type inet:ipv6-address { + pattern '[0-9a-fA-F:\.]*'; + } + description + "An IPv6 address without a zone index. This type, derived from + ipv6-address, may be used in situations where the zone is + known from the context and hence no zone index is needed."; + reference + "RFC 4291: IP Version 6 Addressing Architecture + RFC 4007: IPv6 Scoped Address Architecture + RFC 5952: A Recommendation for IPv6 Address Text + Representation"; + } + + typedef ip-prefix { + type union { + type inet:ipv4-prefix; + type inet:ipv6-prefix; + } + description + "The ip-prefix type represents an IP prefix and is IP + version neutral. The format of the textual representations + implies the IP version."; + } + + typedef ipv4-prefix { + type string { + pattern + '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.){3}' + + '([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])' + + '/(([0-9])|([1-2][0-9])|(3[0-2]))'; + } + description + "The ipv4-prefix type represents an IPv4 address prefix. + The prefix length is given by the number following the + slash character and must be less than or equal to 32. + + A prefix length value of n corresponds to an IP address + mask that has n contiguous 1-bits from the most + significant bit (MSB) and all other bits set to 0. + + The canonical format of an IPv4 prefix has all bits of + the IPv4 address set to zero that are not part of the + IPv4 prefix."; + } + + typedef ipv6-prefix { + type string { + pattern '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}' + + '((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|' + + '(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\.){3}' + + '(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))' + + '(/(([0-9])|([0-9]{2})|(1[0-1][0-9])|(12[0-8])))'; + pattern '(([^:]+:){6}(([^:]+:[^:]+)|(.*\..*)))|' + + '((([^:]+:)*[^:]+)?::(([^:]+:)*[^:]+)?)' + + '(/.+)'; + } + + description + "The ipv6-prefix type represents an IPv6 address prefix. + The prefix length is given by the number following the + slash character and must be less than or equal to 128. + + A prefix length value of n corresponds to an IP address + mask that has n contiguous 1-bits from the most + significant bit (MSB) and all other bits set to 0. + + The IPv6 address should have all bits that do not belong + to the prefix set to zero. + + The canonical format of an IPv6 prefix has all bits of + the IPv6 address set to zero that are not part of the + IPv6 prefix. Furthermore, the IPv6 address is represented + as defined in Section 4 of RFC 5952."; + reference + "RFC 5952: A Recommendation for IPv6 Address Text + Representation"; + } + + /*** collection of domain name and URI types ***/ + + typedef domain-name { + type string { + pattern + '((([a-zA-Z0-9_]([a-zA-Z0-9\-_]){0,61})?[a-zA-Z0-9]\.)*' + + '([a-zA-Z0-9_]([a-zA-Z0-9\-_]){0,61})?[a-zA-Z0-9]\.?)' + + '|\.'; + length "1..253"; + } + description + "The domain-name type represents a DNS domain name. The + name SHOULD be fully qualified whenever possible. + + Internet domain names are only loosely specified. Section + 3.5 of RFC 1034 recommends a syntax (modified in Section + 2.1 of RFC 1123). The pattern above is intended to allow + for current practice in domain name use, and some possible + future expansion. It is designed to hold various types of + domain names, including names used for A or AAAA records + (host names) and other records, such as SRV records. Note + that Internet host names have a stricter syntax (described + in RFC 952) than the DNS recommendations in RFCs 1034 and + 1123, and that systems that want to store host names in + schema nodes using the domain-name type are recommended to + adhere to this stricter standard to ensure interoperability. + + The encoding of DNS names in the DNS protocol is limited + to 255 characters. Since the encoding consists of labels + prefixed by a length bytes and there is a trailing NULL + byte, only 253 characters can appear in the textual dotted + notation. + + The description clause of schema nodes using the domain-name + type MUST describe when and how these names are resolved to + IP addresses. Note that the resolution of a domain-name value + may require to query multiple DNS records (e.g., A for IPv4 + and AAAA for IPv6). The order of the resolution process and + which DNS record takes precedence can either be defined + explicitly or may depend on the configuration of the + resolver. + + Domain-name values use the US-ASCII encoding. Their canonical + format uses lowercase US-ASCII characters. Internationalized + domain names MUST be A-labels as per RFC 5890."; + reference + "RFC 952: DoD Internet Host Table Specification + RFC 1034: Domain Names - Concepts and Facilities + RFC 1123: Requirements for Internet Hosts -- Application + and Support + RFC 2782: A DNS RR for specifying the location of services + (DNS SRV) + RFC 5890: Internationalized Domain Names in Applications + (IDNA): Definitions and Document Framework"; + } + + typedef host { + type union { + type inet:ip-address; + type inet:domain-name; + } + description + "The host type represents either an IP address or a DNS + domain name."; + } + + typedef uri { + type string; + description + "The uri type represents a Uniform Resource Identifier + (URI) as defined by STD 66. + + Objects using the uri type MUST be in US-ASCII encoding, + and MUST be normalized as described by RFC 3986 Sections + 6.2.1, 6.2.2.1, and 6.2.2.2. All unnecessary + percent-encoding is removed, and all case-insensitive + characters are set to lowercase except for hexadecimal + digits, which are normalized to uppercase as described in + Section 6.2.2.1. + + The purpose of this normalization is to help provide + unique URIs. Note that this normalization is not + sufficient to provide uniqueness. Two URIs that are + textually distinct after this normalization may still be + equivalent. + + Objects using the uri type may restrict the schemes that + they permit. For example, 'data:' and 'urn:' schemes + might not be appropriate. + + A zero-length URI is not a valid URI. This can be used to + express 'URI absent' where required. + + In the value set and its semantics, this type is equivalent + to the Uri SMIv2 textual convention defined in RFC 5017."; + reference + "RFC 3986: Uniform Resource Identifier (URI): Generic Syntax + RFC 3305: Report from the Joint W3C/IETF URI Planning Interest + Group: Uniform Resource Identifiers (URIs), URLs, + and Uniform Resource Names (URNs): Clarifications + and Recommendations + RFC 5017: MIB Textual Conventions for Uniform Resource + Identifiers (URIs)"; + } + + } diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_l3vpn/yang/ietf-l3vpn-svc@2018-01-19.yang b/src/nbi/service/rest_server/nbi_plugins/ietf_l3vpn/yang/ietf-l3vpn-svc@2018-01-19.yang new file mode 100644 index 0000000000000000000000000000000000000000..e05e33722f01fc9af9cbeb07092dc6287e8dc6c4 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_l3vpn/yang/ietf-l3vpn-svc@2018-01-19.yang @@ -0,0 +1,2856 @@ + module ietf-l3vpn-svc { + yang-version 1.1; + namespace "urn:ietf:params:xml:ns:yang:ietf-l3vpn-svc"; + prefix l3vpn-svc; + import ietf-inet-types { + prefix inet; + } + import ietf-yang-types { + prefix yang; + } + import ietf-netconf-acm { + prefix nacm; + } + organization + "IETF L3SM Working Group"; + contact + "WG List: + Editor: + L3SM WG + Chairs: + Adrian Farrel, Qin Wu + "; + description + "This YANG module defines a generic service configuration + model for Layer 3 VPNs. This model is common across all + vendor implementations. + + + + + Copyright (c) 2018 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 + (https://trustee.ietf.org/license-info). + + This version of this YANG module is part of RFC 8299; see + the RFC itself for full legal notices."; + + revision 2018-01-19 { + description + "Revision of RFC 8049 to fix implementation issues."; + reference + "RFC 8299"; + } + revision 2017-01-27 { + description + "Initial document."; + reference + "RFC 8049."; + } + /* Features */ + feature cloud-access { + description + "Allows the VPN to connect to a CSP."; + } + feature multicast { + description + "Enables multicast capabilities in a VPN."; + } + feature ipv4 { + description + "Enables IPv4 support in a VPN."; + } + feature ipv6 { + description + "Enables IPv6 support in a VPN."; + } + feature lan-tag { + description + "Enables LAN Tag support in a VPN Policy filter."; + } + feature carrierscarrier { + description + + "Enables support of CsC."; + } + feature extranet-vpn { + description + "Enables support of extranet VPNs."; + } + feature site-diversity { + description + "Enables support of site diversity constraints."; + } + feature encryption { + description + "Enables support of encryption."; + } + feature qos { + description + "Enables support of classes of services."; + } + feature qos-custom { + description + "Enables support of the custom QoS profile."; + } + feature rtg-bgp { + description + "Enables support of the BGP routing protocol."; + } + feature rtg-rip { + description + "Enables support of the RIP routing protocol."; + } + feature rtg-ospf { + description + "Enables support of the OSPF routing protocol."; + } + feature rtg-ospf-sham-link { + description + "Enables support of OSPF sham links."; + } + feature rtg-vrrp { + description + "Enables support of the VRRP routing protocol."; + } + feature fast-reroute { + description + "Enables support of Fast Reroute."; + } + feature bfd { + description + + "Enables support of BFD."; + } + feature always-on { + description + "Enables support of the 'always-on' access constraint."; + } + feature requested-type { + description + "Enables support of the 'requested-type' access constraint."; + } + feature bearer-reference { + description + "Enables support of the 'bearer-reference' access constraint."; + } + feature target-sites { + description + "Enables support of the 'target-sites' match flow parameter."; + } + /* Typedefs */ + typedef svc-id { + type string; + description + "Defines a type of service component identifier."; + } + typedef template-id { + type string; + description + "Defines a type of service template identifier."; + } + typedef address-family { + type enumeration { + enum ipv4 { + description + "IPv4 address family."; + } + enum ipv6 { + description + "IPv6 address family."; + } + } + description + "Defines a type for the address family."; + } + /* Identities */ + identity site-network-access-type { + description + "Base identity for site-network-access type."; + } + + identity point-to-point { + base site-network-access-type; + description + "Identity for point-to-point connection."; + } + identity multipoint { + base site-network-access-type; + description + "Identity for multipoint connection. + Example: Ethernet broadcast segment."; + } + identity placement-diversity { + description + "Base identity for site placement constraints."; + } + identity bearer-diverse { + base placement-diversity; + description + "Identity for bearer diversity. + The bearers should not use common elements."; + } + identity pe-diverse { + base placement-diversity; + description + "Identity for PE diversity."; + } + identity pop-diverse { + base placement-diversity; + description + "Identity for POP diversity."; + } + identity linecard-diverse { + base placement-diversity; + description + "Identity for linecard diversity."; + } + identity same-pe { + base placement-diversity; + description + "Identity for having sites connected on the same PE."; + } + identity same-bearer { + base placement-diversity; + description + "Identity for having sites connected using the same bearer."; + } + identity customer-application { + description + + "Base identity for customer application."; + } + identity web { + base customer-application; + description + "Identity for Web application (e.g., HTTP, HTTPS)."; + } + identity mail { + base customer-application; + description + "Identity for mail application."; + } + identity file-transfer { + base customer-application; + description + "Identity for file transfer application (e.g., FTP, SFTP)."; + } + identity database { + base customer-application; + description + "Identity for database application."; + } + identity social { + base customer-application; + description + "Identity for social-network application."; + } + identity games { + base customer-application; + description + "Identity for gaming application."; + } + identity p2p { + base customer-application; + description + "Identity for peer-to-peer application."; + } + identity network-management { + base customer-application; + description + "Identity for management application + (e.g., Telnet, syslog, SNMP)."; + } + identity voice { + base customer-application; + description + "Identity for voice application."; + } + + identity video { + base customer-application; + description + "Identity for video conference application."; + } + identity embb { + base customer-application; + description + "Identity for an enhanced Mobile Broadband (eMBB) + application. Note that an eMBB application demands + network performance with a wide variety of + characteristics, such as data rate, latency, + loss rate, reliability, and many other parameters."; + } + identity urllc { + base customer-application; + description + "Identity for an Ultra-Reliable and Low Latency + Communications (URLLC) application. Note that a + URLLC application demands network performance + with a wide variety of characteristics, such as latency, + reliability, and many other parameters."; + } + identity mmtc { + base customer-application; + description + "Identity for a massive Machine Type + Communications (mMTC) application. Note that an + mMTC application demands network performance + with a wide variety of characteristics, such as data + rate, latency, loss rate, reliability, and many + other parameters."; + } + identity site-vpn-flavor { + description + "Base identity for the site VPN service flavor."; + } + identity site-vpn-flavor-single { + base site-vpn-flavor; + description + "Base identity for the site VPN service flavor. + Used when the site belongs to only one VPN."; + } + identity site-vpn-flavor-multi { + base site-vpn-flavor; + description + "Base identity for the site VPN service flavor. + Used when a logical connection of a site + + belongs to multiple VPNs."; + } + identity site-vpn-flavor-sub { + base site-vpn-flavor; + description + "Base identity for the site VPN service flavor. + Used when a site has multiple logical connections. + Each connection may belong to different multiple VPNs."; + } + identity site-vpn-flavor-nni { + base site-vpn-flavor; + description + "Base identity for the site VPN service flavor. + Used to describe an NNI option A connection."; + } + identity management { + description + "Base identity for site management scheme."; + } + identity co-managed { + base management; + description + "Base identity for co-managed site."; + } + identity customer-managed { + base management; + description + "Base identity for customer-managed site."; + } + identity provider-managed { + base management; + description + "Base identity for provider-managed site."; + } + identity address-allocation-type { + description + "Base identity for address-allocation-type for PE-CE link."; + } + identity provider-dhcp { + base address-allocation-type; + description + "Provider network provides DHCP service to customer."; + } + identity provider-dhcp-relay { + base address-allocation-type; + description + "Provider network provides DHCP relay service to customer."; + } + + identity provider-dhcp-slaac { + base address-allocation-type; + description + "Provider network provides DHCP service to customer, + as well as SLAAC."; + } + identity static-address { + base address-allocation-type; + description + "Provider-to-customer addressing is static."; + } + identity slaac { + base address-allocation-type; + description + "Use IPv6 SLAAC."; + } + identity site-role { + description + "Base identity for site type."; + } + identity any-to-any-role { + base site-role; + description + "Site in an any-to-any IP VPN."; + } + identity spoke-role { + base site-role; + description + "Spoke site in a Hub-and-Spoke IP VPN."; + } + identity hub-role { + base site-role; + description + "Hub site in a Hub-and-Spoke IP VPN."; + } + identity vpn-topology { + description + "Base identity for VPN topology."; + } + identity any-to-any { + base vpn-topology; + description + "Identity for any-to-any VPN topology."; + } + identity hub-spoke { + base vpn-topology; + description + "Identity for Hub-and-Spoke VPN topology."; + + } + identity hub-spoke-disjoint { + base vpn-topology; + description + "Identity for Hub-and-Spoke VPN topology + where Hubs cannot communicate with each other."; + } + identity multicast-tree-type { + description + "Base identity for multicast tree type."; + } + identity ssm-tree-type { + base multicast-tree-type; + description + "Identity for SSM tree type."; + } + identity asm-tree-type { + base multicast-tree-type; + description + "Identity for ASM tree type."; + } + identity bidir-tree-type { + base multicast-tree-type; + description + "Identity for bidirectional tree type."; + } + identity multicast-rp-discovery-type { + description + "Base identity for RP discovery type."; + } + identity auto-rp { + base multicast-rp-discovery-type; + description + "Base identity for Auto-RP discovery type."; + } + identity static-rp { + base multicast-rp-discovery-type; + description + "Base identity for static type."; + } + identity bsr-rp { + base multicast-rp-discovery-type; + description + "Base identity for BSR discovery type."; + } + identity routing-protocol-type { + description + "Base identity for routing protocol type."; + + } + identity ospf { + base routing-protocol-type; + description + "Identity for OSPF protocol type."; + } + identity bgp { + base routing-protocol-type; + description + "Identity for BGP protocol type."; + } + identity static { + base routing-protocol-type; + description + "Identity for static routing protocol type."; + } + identity rip { + base routing-protocol-type; + description + "Identity for RIP protocol type."; + } + identity vrrp { + base routing-protocol-type; + description + "Identity for VRRP protocol type. + This is to be used when LANs are directly connected + to PE routers."; + } + identity direct { + base routing-protocol-type; + description + "Identity for direct protocol type."; + } + identity protocol-type { + description + "Base identity for protocol field type."; + } + identity tcp { + base protocol-type; + description + "TCP protocol type."; + } + identity udp { + base protocol-type; + description + "UDP protocol type."; + } + + + identity icmp { + base protocol-type; + description + "ICMP protocol type."; + } + identity icmp6 { + base protocol-type; + description + "ICMPv6 protocol type."; + } + identity gre { + base protocol-type; + description + "GRE protocol type."; + } + identity ipip { + base protocol-type; + description + "IP-in-IP protocol type."; + } + identity hop-by-hop { + base protocol-type; + description + "Hop-by-Hop IPv6 header type."; + } + identity routing { + base protocol-type; + description + "Routing IPv6 header type."; + } + identity esp { + base protocol-type; + description + "ESP header type."; + } + identity ah { + base protocol-type; + description + "AH header type."; + } + identity vpn-policy-filter-type { + description + "Base identity for VPN Policy filter type."; + } + identity ipv4 { + base vpn-policy-filter-type; + description + "Identity for IPv4 Prefix filter type."; + + } + identity ipv6 { + base vpn-policy-filter-type; + description + "Identity for IPv6 Prefix filter type."; + } + identity lan { + base vpn-policy-filter-type; + description + "Identity for LAN Tag filter type."; + } + + identity qos-profile-direction { + description + "Base identity for QoS profile direction."; + } + + identity site-to-wan { + base qos-profile-direction; + description + "Identity for Site-to-WAN direction."; + } + identity wan-to-site { + base qos-profile-direction; + description + "Identity for WAN-to-Site direction."; + } + identity both { + base qos-profile-direction; + description + "Identity for both WAN-to-Site direction + and Site-to-WAN direction."; + } + /* Groupings */ + grouping vpn-service-cloud-access { + container cloud-accesses { + if-feature cloud-access; + list cloud-access { + key cloud-identifier; + leaf cloud-identifier { + type leafref { + path "/l3vpn-svc/vpn-profiles/"+ + "valid-provider-identifiers/cloud-identifier/id"; + } + description + "Identification of cloud service. + Local administration meaning."; + } + + choice list-flavor { + case permit-any { + leaf permit-any { + type empty; + description + "Allows all sites."; + } + } + case deny-any-except { + leaf-list permit-site { + type leafref { + path "/l3vpn-svc/sites/site/site-id"; + } + description + "Site ID to be authorized."; + } + } + case permit-any-except { + leaf-list deny-site { + type leafref { + path "/l3vpn-svc/sites/site/site-id"; + } + description + "Site ID to be denied."; + } + } + description + "Choice for cloud access policy. By + default, all sites in the IP VPN MUST + be authorized to access the cloud."; + } + container address-translation { + container nat44 { + leaf enabled { + type boolean; + default false; + description + "Controls whether or not Network address + translation from IPv4 to IPv4 (NAT44) + [RFC3022] is required."; + } + leaf nat44-customer-address { + type inet:ipv4-address; + description + "Address to be used for network address + translation from IPv4 to IPv4. This is + to be used if the customer is providing + the IPv4 address. If the customer address + + is not set, the model assumes that the + provider will allocate the address."; + } + description + "IPv4-to-IPv4 translation."; + } + description + "Container for NAT."; + } + description + "Cloud access configuration."; + } + description + "Container for cloud access configurations."; + } + description + "Grouping for VPN cloud definition."; + } + grouping multicast-rp-group-cfg { + choice group-format { + mandatory true; + case singleaddress { + leaf group-address { + type inet:ip-address; + description + "A single multicast group address."; + } + } + case startend { + leaf group-start { + type inet:ip-address; + description + "The first multicast group address in + the multicast group address range."; + } + leaf group-end { + type inet:ip-address; + description + "The last multicast group address in + the multicast group address range."; + } + } + description + "Choice for multicast group format."; + } + description + "This grouping defines multicast group or + multicast groups for RP-to-group mapping."; + + } + grouping vpn-service-multicast { + container multicast { + if-feature multicast; + leaf enabled { + type boolean; + default false; + description + "Enables multicast."; + } + container customer-tree-flavors { + leaf-list tree-flavor { + type identityref { + base multicast-tree-type; + } + description + "Type of tree to be used."; + } + description + "Type of trees used by customer."; + } + container rp { + container rp-group-mappings { + list rp-group-mapping { + key id; + leaf id { + type uint16; + description + "Unique identifier for the mapping."; + } + container provider-managed { + leaf enabled { + type boolean; + default false; + description + "Set to true if the Rendezvous Point (RP) + must be a provider-managed node. Set to false + if it is a customer-managed node."; + } + leaf rp-redundancy { + type boolean; + default false; + description + "If true, a redundancy mechanism for the RP + is required."; + } + leaf optimal-traffic-delivery { + type boolean; + + default false; + description + "If true, the SP must ensure that + traffic uses an optimal path. An SP may use + Anycast RP or RP-tree-to-SPT switchover + architectures."; + } + description + "Parameters for a provider-managed RP."; + } + leaf rp-address { + when "../provider-managed/enabled = 'false'" { + description + "Relevant when the RP is not provider-managed."; + } + type inet:ip-address; + mandatory true; + description + "Defines the address of the RP. + Used if the RP is customer-managed."; + } + container groups { + list group { + key id; + leaf id { + type uint16; + description + "Identifier for the group."; + } + uses multicast-rp-group-cfg; + description + "List of multicast groups."; + } + description + "Multicast groups associated with the RP."; + } + description + "List of RP-to-group mappings."; + } + description + "RP-to-group mappings parameters."; + } + container rp-discovery { + leaf rp-discovery-type { + type identityref { + base multicast-rp-discovery-type; + } + default static-rp; + + description + "Type of RP discovery used."; + } + container bsr-candidates { + when "derived-from-or-self(../rp-discovery-type, "+ + "'l3vpn-svc:bsr-rp')" { + description + "Only applicable if discovery type + is BSR-RP."; + } + leaf-list bsr-candidate-address { + type inet:ip-address; + description + "Address of BSR candidate."; + } + description + "Container for List of Customer + BSR candidate's addresses."; + } + description + "RP discovery parameters."; + } + description + "RP parameters."; + } + description + "Multicast global parameters for the VPN service."; + } + description + "Grouping for multicast VPN definition."; + } + grouping vpn-service-mpls { + leaf carrierscarrier { + if-feature carrierscarrier; + type boolean; + default false; + description + "The VPN is using CsC, and so MPLS is required."; + } + description + "Grouping for MPLS CsC definition."; + } + grouping customer-location-info { + container locations { + list location { + key location-id; + leaf location-id { + type svc-id; + + description + "Identifier for a particular location."; + } + leaf address { + type string; + description + "Address (number and street) of the site."; + } + leaf postal-code { + type string; + description + "Postal code of the site."; + } + leaf state { + type string; + description + "State of the site. This leaf can also be + used to describe a region for a country that + does not have states."; + } + leaf city { + type string; + description + "City of the site."; + } + leaf country-code { + type string { + pattern '[A-Z]{2}'; + } + description + "Country of the site. + Expressed as ISO ALPHA-2 code."; + } + description + "Location of the site."; + } + description + "List of locations for the site."; + } + description + "This grouping defines customer location parameters."; + } + grouping site-group { + container groups { + list group { + key group-id; + leaf group-id { + type string; + + description + "Group-id the site belongs to."; + } + description + "List of group-ids."; + } + description + "Groups the site or site-network-access belongs to."; + } + description + "Grouping definition to assign + group-ids to site or site-network-access."; + } + grouping site-diversity { + container site-diversity { + if-feature site-diversity; + uses site-group; + description + "Diversity constraint type. All + site-network-accesses will inherit + the group values defined here."; + } + description + "This grouping defines site + diversity parameters."; + } + grouping access-diversity { + container access-diversity { + if-feature site-diversity; + uses site-group; + container constraints { + list constraint { + key constraint-type; + leaf constraint-type { + type identityref { + base placement-diversity; + } + description + "Diversity constraint type."; + } + container target { + choice target-flavor { + default id; + case id { + list group { + key group-id; + leaf group-id { + type string; + + description + "The constraint will be applied against + this particular group-id for this site + network access level."; + } + description + "List of group-ids associated with one specific + constraint for this site network access level."; + } + } + case all-accesses { + leaf all-other-accesses { + type empty; + description + "The constraint will be applied against + all other site network accesses of this site."; + } + } + case all-groups { + leaf all-other-groups { + type empty; + description + "The constraint will be applied against + all other groups managed by the customer."; + } + } + description + "Choice for the target flavor definition."; + } + description + "The constraint will be applied against a + Specific target, and the target can be a list + of group-ids,all other site network accesses of + this site, or all other groups managed by the + customer."; + } + description + "List of constraints."; + } + description + "Placement constraints for this site network access."; + } + description + "Diversity parameters."; + } + description + "This grouping defines access diversity parameters."; + } + + grouping operational-requirements { + leaf requested-site-start { + type yang:date-and-time; + description + "Optional leaf indicating requested date and + time when the service at a particular site is + expected to start."; + } + + leaf requested-site-stop { + type yang:date-and-time; + description + "Optional leaf indicating requested date and + time when the service at a particular site is + expected to stop."; + } + description + "This grouping defines some operational + parameters."; + } + grouping operational-requirements-ops { + leaf actual-site-start { + type yang:date-and-time; + config false; + description + "Optional leaf indicating actual date and + time when the service at a particular site + actually started."; + } + leaf actual-site-stop { + type yang:date-and-time; + config false; + description + "Optional leaf indicating actual date and + time when the service at a particular site + actually stopped."; + } + description + "This grouping defines some operational + parameters."; + } + grouping flow-definition { + container match-flow { + leaf dscp { + type inet:dscp; + description + "DSCP value."; + } + + leaf dot1p { + type uint8 { + range "0..7"; + } + description + "802.1p matching."; + } + leaf ipv4-src-prefix { + type inet:ipv4-prefix; + description + "Match on IPv4 src address."; + } + leaf ipv6-src-prefix { + type inet:ipv6-prefix; + description + "Match on IPv6 src address."; + } + leaf ipv4-dst-prefix { + type inet:ipv4-prefix; + description + "Match on IPv4 dst address."; + } + leaf ipv6-dst-prefix { + type inet:ipv6-prefix; + description + "Match on IPv6 dst address."; + } + leaf l4-src-port { + type inet:port-number; + must "current() < ../l4-src-port-range/lower-port or "+ + "current() > ../l4-src-port-range/upper-port" { + description + "If l4-src-port and l4-src-port-range/lower-port and + upper-port are set at the same time, l4-src-port + should not overlap with l4-src-port-range."; + } + description + "Match on Layer 4 src port."; + } + leaf-list target-sites { + if-feature target-sites; + type svc-id; + description + "Identify a site as traffic destination."; + } + container l4-src-port-range { + leaf lower-port { + type inet:port-number; + + description + "Lower boundary for port."; + } + leaf upper-port { + type inet:port-number; + must ". >= ../lower-port" { + description + "Upper boundary for port. If it + exists, the upper boundary must be + higher than the lower boundary."; + } + description + "Upper boundary for port."; + } + description + "Match on Layer 4 src port range. When + only the lower-port is present, it represents + a single port. When both the lower-port and + upper-port are specified, it implies + a range inclusive of both values."; + } + leaf l4-dst-port { + type inet:port-number; + must "current() < ../l4-dst-port-range/lower-port or "+ + "current() > ../l4-dst-port-range/upper-port" { + description + "If l4-dst-port and l4-dst-port-range/lower-port + and upper-port are set at the same time, + l4-dst-port should not overlap with + l4-src-port-range."; + } + description + "Match on Layer 4 dst port."; + } + container l4-dst-port-range { + leaf lower-port { + type inet:port-number; + description + "Lower boundary for port."; + } + leaf upper-port { + type inet:port-number; + must ". >= ../lower-port" { + description + "Upper boundary must be + higher than lower boundary."; + } + description + + "Upper boundary for port. If it exists, + upper boundary must be higher than lower + boundary."; + } + description + "Match on Layer 4 dst port range. When only + lower-port is present, it represents a single + port. When both lower-port and upper-port are + specified, it implies a range inclusive of both + values."; + } + leaf protocol-field { + type union { + type uint8; + type identityref { + base protocol-type; + } + } + description + "Match on IPv4 protocol or IPv6 Next Header field."; + } + description + "Describes flow-matching criteria."; + } + description + "Flow definition based on criteria."; + } + grouping site-service-basic { + leaf svc-input-bandwidth { + type uint64; + units bps; + mandatory true; + description + "From the customer site's perspective, the service + input bandwidth of the connection or download + bandwidth from the SP to the site."; + } + leaf svc-output-bandwidth { + type uint64; + units bps; + mandatory true; + description + "From the customer site's perspective, the service + output bandwidth of the connection or upload + bandwidth from the site to the SP."; + } + leaf svc-mtu { + type uint16; + + units bytes; + mandatory true; + description + "MTU at service level. If the service is IP, + it refers to the IP MTU. If CsC is enabled, + the requested 'svc-mtu' leaf will refer to the + MPLS MTU and not to the IP MTU."; + } + description + "Defines basic service parameters for a site."; + } + grouping site-protection { + container traffic-protection { + if-feature fast-reroute; + leaf enabled { + type boolean; + default false; + description + "Enables traffic protection of access link."; + } + description + "Fast Reroute service parameters for the site."; + } + description + "Defines protection service parameters for a site."; + } + grouping site-service-mpls { + container carrierscarrier { + if-feature carrierscarrier; + leaf signalling-type { + type enumeration { + enum ldp { + description + "Use LDP as the signalling protocol + between the PE and the CE. In this case, + an IGP routing protocol must also be activated."; + } + enum bgp { + description + "Use BGP (as per RFC 8277) as the signalling protocol + between the PE and the CE. + In this case, BGP must also be configured as + the routing protocol."; + } + } + default bgp; + description + "MPLS signalling type."; + + } + description + "This container is used when the customer provides + MPLS-based services. This is only used in the case + of CsC (i.e., a customer builds an MPLS service using + an IP VPN to carry its traffic)."; + } + description + "Defines MPLS service parameters for a site."; + } + grouping site-service-qos-profile { + container qos { + if-feature qos; + container qos-classification-policy { + list rule { + key id; + ordered-by user; + leaf id { + type string; + description + "A description identifying the + qos-classification-policy rule."; + } + choice match-type { + default match-flow; + case match-flow { + uses flow-definition; + } + case match-application { + leaf match-application { + type identityref { + base customer-application; + } + description + "Defines the application to match."; + } + } + description + "Choice for classification."; + } + leaf target-class-id { + type string; + description + "Identification of the class of service. + This identifier is internal to the administration."; + } + description + "List of marking rules."; + + } + description + "Configuration of the traffic classification policy."; + } + container qos-profile { + choice qos-profile { + description + "Choice for QoS profile. + Can be standard profile or customized profile."; + case standard { + description + "Standard QoS profile."; + leaf profile { + type leafref { + path "/l3vpn-svc/vpn-profiles/valid-provider-identifiers"+ + "/qos-profile-identifier/id"; + } + description + "QoS profile to be used."; + } + } + case custom { + description + "Customized QoS profile."; + container classes { + if-feature qos-custom; + list class { + key class-id; + leaf class-id { + type string; + description + "Identification of the class of service. + This identifier is internal to the + administration."; + } + leaf direction { + type identityref { + base qos-profile-direction; + } + default both; + description + "The direction to which the QoS profile + is applied."; + } + leaf rate-limit { + type decimal64 { + fraction-digits 5; + range "0..100"; + + } + units percent; + description + "To be used if the class must be rate-limited. + Expressed as percentage of the service + bandwidth."; + } + container latency { + choice flavor { + case lowest { + leaf use-lowest-latency { + type empty; + description + "The traffic class should use the path with the + lowest latency."; + } + } + case boundary { + leaf latency-boundary { + type uint16; + units msec; + default 400; + description + "The traffic class should use a path with a + defined maximum latency."; + } + } + description + "Latency constraint on the traffic class."; + } + description + "Latency constraint on the traffic class."; + } + container jitter { + choice flavor { + case lowest { + leaf use-lowest-jitter { + type empty; + description + "The traffic class should use the path with the + lowest jitter."; + } + } + case boundary { + leaf latency-boundary { + type uint32; + units usec; + default 40000; + + description + "The traffic class should use a path with a + defined maximum jitter."; + } + } + description + "Jitter constraint on the traffic class."; + } + description + "Jitter constraint on the traffic class."; + } + container bandwidth { + leaf guaranteed-bw-percent { + type decimal64 { + fraction-digits 5; + range "0..100"; + } + units percent; + mandatory true; + description + "To be used to define the guaranteed bandwidth + as a percentage of the available service bandwidth."; + } + leaf end-to-end { + type empty; + description + "Used if the bandwidth reservation + must be done on the MPLS network too."; + } + description + "Bandwidth constraint on the traffic class."; + } + description + "List of classes of services."; + } + description + "Container for list of classes of services."; + } + } + } + description + "QoS profile configuration."; + } + description + "QoS configuration."; + } + description + "This grouping defines QoS parameters for a site."; + + } + grouping site-security-authentication { + container authentication { + description + "Authentication parameters."; + } + description + "This grouping defines authentication parameters for a site."; + } + grouping site-security-encryption { + container encryption { + if-feature encryption; + leaf enabled { + type boolean; + default false; + description + "If true, traffic encryption on the connection is required."; + } + leaf layer { + when "../enabled = 'true'" { + description + "Require a value for layer when enabled is true."; + } + type enumeration { + enum layer2 { + description + "Encryption will occur at Layer 2."; + } + enum layer3 { + description + "Encryption will occur at Layer 3. + For example, IPsec may be used when + a customer requests Layer 3 encryption."; + } + } + description + "Layer on which encryption is applied."; + } + container encryption-profile { + choice profile { + case provider-profile { + leaf profile-name { + type leafref { + path "/l3vpn-svc/vpn-profiles/valid-provider-identifiers"+ + "/encryption-profile-identifier/id"; + } + description + "Name of the SP profile to be applied."; + + } + } + case customer-profile { + leaf algorithm { + type string; + description + "Encryption algorithm to be used."; + } + choice key-type { + default psk; + case psk { + leaf preshared-key { + type string; + description + "Pre-Shared Key (PSK) coming from the customer."; + } + } + description + "Type of keys to be used."; + } + } + description + "Choice of encryption profile. The encryption + profile can be the provider profile or customer profile."; + } + description + "Profile of encryption to be applied."; + } + description + "Encryption parameters."; + } + description + "This grouping defines encryption parameters for a site."; + } + grouping site-attachment-bearer { + container bearer { + container requested-type { + if-feature requested-type; + leaf requested-type { + type string; + description + "Type of requested bearer: Ethernet, DSL, + Wireless, etc. Operator specific."; + } + leaf strict { + type boolean; + default false; + description + + "Defines whether requested-type is a preference + or a strict requirement."; + } + description + "Container for requested-type."; + } + leaf always-on { + if-feature always-on; + type boolean; + default true; + description + "Request for an always-on access type. + For example, this could mean no dial access type."; + } + leaf bearer-reference { + if-feature bearer-reference; + type string; + description + "This is an internal reference for the SP."; + } + description + "Bearer-specific parameters. + To be augmented."; + } + description + "Defines physical properties of a site attachment."; + } + grouping site-routing { + container routing-protocols { + list routing-protocol { + key type; + leaf type { + type identityref { + base routing-protocol-type; + } + description + "Type of routing protocol."; + } + container ospf { + when "derived-from-or-self(../type, 'l3vpn-svc:ospf')" { + description + "Only applies when protocol is OSPF."; + } + if-feature rtg-ospf; + leaf-list address-family { + type address-family; + min-elements "1"; + description + + "If OSPF is used on this site, this node + contains a configured value. This node + contains at least one address family + to be activated."; + } + leaf area-address { + type yang:dotted-quad; + mandatory true; + description + "Area address."; + } + leaf metric { + type uint16; + default 1; + description + "Metric of the PE-CE link. It is used + in the routing state calculation and + path selection."; + } + container sham-links { + if-feature rtg-ospf-sham-link; + list sham-link { + key target-site; + leaf target-site { + type svc-id; + description + "Target site for the sham link connection. + The site is referred to by its ID."; + } + leaf metric { + type uint16; + default 1; + description + "Metric of the sham link. It is used in + the routing state calculation and path + selection. The default value is set + to 1."; + } + description + "Creates a sham link with another site."; + } + description + "List of sham links."; + } + description + "OSPF-specific configuration."; + } + container bgp { + + when "derived-from-or-self(../type, 'l3vpn-svc:bgp')" { + description + "Only applies when protocol is BGP."; + } + if-feature rtg-bgp; + leaf autonomous-system { + type uint32; + mandatory true; + description + "Customer AS number in case the customer + requests BGP routing."; + } + leaf-list address-family { + type address-family; + min-elements "1"; + description + "If BGP is used on this site, this node + contains a configured value. This node + contains at least one address family + to be activated."; + } + description + "BGP-specific configuration."; + } + container static { + when "derived-from-or-self(../type, 'l3vpn-svc:static')" { + description + "Only applies when protocol is static. + BGP activation requires the SP to know + the address of the customer peer. When + BGP is enabled, the 'static-address' + allocation type for the IP connection + MUST be used."; + } + container cascaded-lan-prefixes { + list ipv4-lan-prefixes { + if-feature ipv4; + key "lan next-hop"; + leaf lan { + type inet:ipv4-prefix; + description + "LAN prefixes."; + } + leaf lan-tag { + type string; + description + "Internal tag to be used in VPN policies."; + } + + leaf next-hop { + type inet:ipv4-address; + description + "Next-hop address to use on the customer side."; + } + description + "List of LAN prefixes for the site."; + } + list ipv6-lan-prefixes { + if-feature ipv6; + key "lan next-hop"; + leaf lan { + type inet:ipv6-prefix; + description + "LAN prefixes."; + } + leaf lan-tag { + type string; + description + "Internal tag to be used in VPN policies."; + } + leaf next-hop { + type inet:ipv6-address; + description + "Next-hop address to use on the customer side."; + } + description + "List of LAN prefixes for the site."; + } + description + "LAN prefixes from the customer."; + } + description + "Configuration specific to static routing."; + } + container rip { + when "derived-from-or-self(../type, 'l3vpn-svc:rip')" { + description + "Only applies when the protocol is RIP. For IPv4, + the model assumes that RIP version 2 is used."; + } + if-feature rtg-rip; + leaf-list address-family { + type address-family; + min-elements "1"; + description + "If RIP is used on this site, this node + contains a configured value. This node + + contains at least one address family + to be activated."; + } + description + "Configuration specific to RIP routing."; + } + container vrrp { + when "derived-from-or-self(../type, 'l3vpn-svc:vrrp')" { + description + "Only applies when protocol is VRRP."; + } + if-feature rtg-vrrp; + leaf-list address-family { + type address-family; + min-elements "1"; + description + "If VRRP is used on this site, this node + contains a configured value. This node contains + at least one address family to be activated."; + } + description + "Configuration specific to VRRP routing."; + } + description + "List of routing protocols used on + the site. This list can be augmented."; + } + description + "Defines routing protocols."; + } + description + "Grouping for routing protocols."; + } + grouping site-attachment-ip-connection { + container ip-connection { + container ipv4 { + if-feature ipv4; + leaf address-allocation-type { + type identityref { + base address-allocation-type; + } + must "not(derived-from-or-self(current(), 'l3vpn-svc:slaac') or "+ + "derived-from-or-self(current(), "+ + "'l3vpn-svc:provider-dhcp-slaac'))" { + error-message "SLAAC is only applicable to IPv6"; + } + description + "Defines how addresses are allocated. + + If there is no value for the address + allocation type, then IPv4 is not enabled."; + } + container provider-dhcp { + when "derived-from-or-self(../address-allocation-type, "+ + "'l3vpn-svc:provider-dhcp')" { + description + "Only applies when addresses are allocated by DHCP."; + } + leaf provider-address { + type inet:ipv4-address; + description + "Address of provider side. If provider-address is not + specified, then prefix length should not be specified + either. It also implies provider-dhcp allocation is + not enabled. If provider-address is specified, then + the prefix length may or may not be specified."; + } + leaf prefix-length { + type uint8 { + range "0..32"; + } + must "(../provider-address)" { + error-message + "If the prefix length is specified, provider-address + must also be specified."; + description + "If the prefix length is specified, provider-address + must also be specified."; + } + description + "Subnet prefix length expressed in bits. + If not specified, or specified as zero, + this means the customer leaves the actual + prefix length value to the provider."; + } + choice address-assign { + default number; + case number { + leaf number-of-dynamic-address { + type uint16; + default 1; + description + "Describes the number of IP addresses + the customer requires."; + } + } + case explicit { + + container customer-addresses { + list address-group { + key "group-id"; + leaf group-id { + type string; + description + "Group-id for the address range from + start-address to end-address."; + } + leaf start-address { + type inet:ipv4-address; + description + "First address."; + } + leaf end-address { + type inet:ipv4-address; + description + "Last address."; + } + description + "Describes IP addresses allocated by DHCP. + When only start-address or only end-address + is present, it represents a single address. + When both start-address and end-address are + specified, it implies a range inclusive of both + addresses. If no address is specified, it implies + customer addresses group is not supported."; + } + description + "Container for customer addresses is allocated by DHCP."; + } + } + description + "Choice for the way to assign addresses."; + } + description + "DHCP allocated addresses related parameters."; + } + container dhcp-relay { + when "derived-from-or-self(../address-allocation-type, "+ + "'l3vpn-svc:provider-dhcp-relay')" { + description + "Only applies when provider is required to implement + DHCP relay function."; + } + leaf provider-address { + type inet:ipv4-address; + description + + "Address of provider side. If provider-address is not + specified, then prefix length should not be specified + either. It also implies provider-dhcp allocation is + not enabled. If provider-address is specified, then + prefix length may or may not be specified."; + } + leaf prefix-length { + type uint8 { + range "0..32"; + } + must "(../provider-address)" { + error-message + "If prefix length is specified, provider-address + must also be specified."; + description + "If prefix length is specified, provider-address + must also be specified."; + } + description + "Subnet prefix length expressed in bits. If not + specified, or specified as zero, this means the + customer leaves the actual prefix length value + to the provider."; + } + container customer-dhcp-servers { + leaf-list server-ip-address { + type inet:ipv4-address; + description + "IP address of customer DHCP server."; + } + description + "Container for list of customer DHCP servers."; + } + description + "DHCP relay provided by operator."; + } + container addresses { + when "derived-from-or-self(../address-allocation-type, "+ + "'l3vpn-svc:static-address')" { + description + "Only applies when protocol allocation type is static."; + } + leaf provider-address { + type inet:ipv4-address; + description + "IPv4 Address List of the provider side. + When the protocol allocation type is static, + the provider address must be configured."; + + } + leaf customer-address { + type inet:ipv4-address; + description + "IPv4 Address of customer side."; + } + leaf prefix-length { + type uint8 { + range "0..32"; + } + description + "Subnet prefix length expressed in bits. + It is applied to both provider-address + and customer-address."; + } + description + "Describes IPv4 addresses used."; + } + description + "IPv4-specific parameters."; + } + container ipv6 { + if-feature ipv6; + leaf address-allocation-type { + type identityref { + base address-allocation-type; + } + description + "Defines how addresses are allocated. + If there is no value for the address + allocation type, then IPv6 is + not enabled."; + } + + container provider-dhcp { + when "derived-from-or-self(../address-allocation-type, "+ + "'l3vpn-svc:provider-dhcp') "+ + "or derived-from-or-self(../address-allocation-type, "+ + "'l3vpn-svc:provider-dhcp-slaac')" { + description + "Only applies when addresses are allocated by DHCP."; + } + leaf provider-address { + type inet:ipv6-address; + description + "Address of the provider side. If provider-address + is not specified, then prefix length should not be + specified either. It also implies provider-dhcp + + allocation is not enabled. If provider-address is + specified, then prefix length may or may + not be specified."; + } + leaf prefix-length { + type uint8 { + range "0..128"; + } + must "(../provider-address)" { + error-message + "If prefix length is specified, provider-address + must also be specified."; + description + "If prefix length is specified, provider-address + must also be specified."; + } + description + "Subnet prefix length expressed in bits. If not + specified, or specified as zero, this means the + customer leaves the actual prefix length value + to the provider."; + } + choice address-assign { + default number; + case number { + leaf number-of-dynamic-address { + type uint16; + default 1; + description + "Describes the number of IP addresses the customer + requires."; + } + } + case explicit { + container customer-addresses { + list address-group { + key "group-id"; + leaf group-id { + type string; + description + "Group-id for the address range from + start-address to end-address."; + } + leaf start-address { + type inet:ipv6-address; + description + "First address."; + } + + leaf end-address { + type inet:ipv6-address; + description + "Last address."; + } + description + "Describes IP addresses allocated by DHCP. When only + start-address or only end-address is present, it + represents a single address. When both start-address + and end-address are specified, it implies a range + inclusive of both addresses. If no address is + specified, it implies customer addresses group is + not supported."; + } + description + "Container for customer addresses allocated by DHCP."; + } + } + description + "Choice for the way to assign addresses."; + } + description + "DHCP allocated addresses related parameters."; + } + container dhcp-relay { + when "derived-from-or-self(../address-allocation-type, "+ + "'l3vpn-svc:provider-dhcp-relay')" { + description + "Only applies when the provider is required + to implement DHCP relay function."; + } + leaf provider-address { + type inet:ipv6-address; + description + "Address of the provider side. If provider-address is + not specified, then prefix length should not be + specified either. It also implies provider-dhcp + allocation is not enabled. If provider address + is specified, then prefix length may or may + not be specified."; + } + leaf prefix-length { + type uint8 { + range "0..128"; + } + must "(../provider-address)" { + error-message + "If prefix length is specified, provider-address + + must also be specified."; + description + "If prefix length is specified, provider-address + must also be specified."; + } + description + "Subnet prefix length expressed in bits. If not + specified, or specified as zero, this means the + customer leaves the actual prefix length value + to the provider."; + } + container customer-dhcp-servers { + leaf-list server-ip-address { + type inet:ipv6-address; + description + "This node contains the IP address of + the customer DHCP server. If the DHCP relay + function is implemented by the + provider, this node contains the + configured value."; + } + description + "Container for list of customer DHCP servers."; + } + description + "DHCP relay provided by operator."; + } + container addresses { + when "derived-from-or-self(../address-allocation-type, "+ + "'l3vpn-svc:static-address')" { + description + "Only applies when protocol allocation type is static."; + } + leaf provider-address { + type inet:ipv6-address; + description + "IPv6 Address of the provider side. When the protocol + allocation type is static, the provider address + must be configured."; + } + leaf customer-address { + type inet:ipv6-address; + description + "The IPv6 Address of the customer side."; + } + leaf prefix-length { + type uint8 { + range "0..128"; + + } + description + "Subnet prefix length expressed in bits. + It is applied to both provider-address and + customer-address."; + } + description + "Describes IPv6 addresses used."; + } + description + "IPv6-specific parameters."; + } + container oam { + container bfd { + if-feature bfd; + leaf enabled { + type boolean; + default false; + description + "If true, BFD activation is required."; + } + choice holdtime { + default fixed; + case fixed { + leaf fixed-value { + type uint32; + units msec; + description + "Expected BFD holdtime expressed in msec. The customer + may impose some fixed values for the holdtime period + if the provider allows the customer use this function. + If the provider doesn't allow the customer to use this + function, the fixed-value will not be set."; + } + } + case profile { + leaf profile-name { + type leafref { + path "/l3vpn-svc/vpn-profiles/valid-provider-identifiers/"+ + "bfd-profile-identifier/id"; + } + description + "Well-known SP profile name. The provider can propose + some profiles to the customer, depending on the service + level the customer wants to achieve. Profile names + must be communicated to the customer."; + } + description + + "Well-known SP profile."; + } + description + "Choice for holdtime flavor."; + } + description + "Container for BFD."; + } + description + "Defines the Operations, Administration, and Maintenance (OAM) + mechanisms used on the connection. BFD is set as a fault + detection mechanism, but the 'oam' container can easily + be augmented by other mechanisms"; + } + description + "Defines connection parameters."; + } + description + "This grouping defines IP connection parameters."; + } + grouping site-service-multicast { + container multicast { + if-feature multicast; + leaf multicast-site-type { + type enumeration { + enum receiver-only { + description + "The site only has receivers."; + } + enum source-only { + description + "The site only has sources."; + } + enum source-receiver { + description + "The site has both sources and receivers."; + } + } + default source-receiver; + description + "Type of multicast site."; + } + container multicast-address-family { + leaf ipv4 { + if-feature ipv4; + type boolean; + default false; + description + + "Enables IPv4 multicast."; + } + leaf ipv6 { + if-feature ipv6; + type boolean; + default false; + description + "Enables IPv6 multicast."; + } + description + "Defines protocol to carry multicast."; + } + leaf protocol-type { + type enumeration { + enum host { + description + "Hosts are directly connected to the provider network. + Host protocols such as IGMP or MLD are required."; + } + enum router { + description + "Hosts are behind a customer router. + PIM will be implemented."; + } + enum both { + description + "Some hosts are behind a customer router, and + some others are directly connected to the + provider network. Both host and routing protocols + must be used. Typically, IGMP and PIM will be + implemented."; + } + } + default "both"; + description + "Multicast protocol type to be used with the customer site."; + } + description + "Multicast parameters for the site."; + } + description + "Multicast parameters for the site."; + } + grouping site-management { + container management { + leaf type { + type identityref { + base management; + + } + mandatory true; + description + "Management type of the connection."; + } + description + "Management configuration."; + } + description + "Management parameters for the site."; + } + grouping site-devices { + container devices { + when "derived-from-or-self(../management/type, "+ + "'l3vpn-svc:provider-managed') or "+ + "derived-from-or-self(../management/type, 'l3vpn-svc:co-managed')" { + description + "Applicable only for provider-managed or + co-managed device."; + } + list device { + key device-id; + leaf device-id { + type svc-id; + description + "Identifier for the device."; + } + leaf location { + type leafref { + path "../../../locations/"+ + "location/location-id"; + } + mandatory true; + description + "Location of the device."; + } + container management { + when "derived-from-or-self(../../../management/type,"+ + "'l3vpn-svc:co-managed')" { + description + "Applicable only for co-managed device."; + } + leaf address-family { + type address-family; + description + "Address family used for management."; + } + leaf address { + + when "(../address-family)" { + description + "If address-family is specified, then address should + also be specified. If address-family is not specified, + then address should also not be specified."; + } + type inet:ip-address; + mandatory true; + description + "Management address."; + } + description + "Management configuration. Applicable only for + co-managed device."; + } + description + "List of devices requested by customer."; + } + description + "Device configuration."; + } + description + "Grouping for device allocation."; + } + grouping site-vpn-flavor { + leaf site-vpn-flavor { + type identityref { + base site-vpn-flavor; + } + default site-vpn-flavor-single; + description + "Defines the way the VPN multiplexing is done, e.g., whether + the site belongs to a single VPN site or a multiVPN; or, in the case + of a multiVPN, whether the logical accesses of the sites belong + to the same set of VPNs or each logical access maps to + different VPNs."; + } + description + "Grouping for site VPN flavor."; + } + grouping site-vpn-policy { + container vpn-policies { + list vpn-policy { + key vpn-policy-id; + leaf vpn-policy-id { + type svc-id; + description + "Unique identifier for the VPN policy."; + + } + list entries { + key id; + leaf id { + type svc-id; + description + "Unique identifier for the policy entry."; + } + container filters { + list filter { + key type; + ordered-by user; + leaf type { + type identityref { + base vpn-policy-filter-type; + } + description + "Type of VPN Policy filter."; + } + leaf-list lan-tag { + when "derived-from-or-self(../type, 'l3vpn-svc:lan')" { + description + "Only applies when the VPN Policy filter is a + LAN Tag filter."; + } + if-feature lan-tag; + type string; + description + "List of 'lan-tag' items to be matched. LAN Tag + is an Internal tag to be used in VPN policies "; + } + leaf-list ipv4-lan-prefix { + when "derived-from-or-self(../type, 'l3vpn-svc:ipv4')" { + description + "Only applies when VPN Policy filter is IPv4 Prefix filter."; + } + if-feature ipv4; + type inet:ipv4-prefix; + description + "List of IPv4 prefixes as LAN Prefixes to be matched."; + } + leaf-list ipv6-lan-prefix { + when "derived-from-or-self(../type, 'l3vpn-svc:ipv6')" { + description + "Only applies when VPN Policy filter is IPv6 Prefix filter."; + } + if-feature ipv6; + type inet:ipv6-prefix; + + description + "List of IPv6 prefixes as LAN prefixes to be matched."; + } + description + "List of filters used on the site. This list can + be augmented."; + } + description + "If a more-granular VPN attachment is necessary, filtering can + be used. If used, it permits the splitting of site LANs among + multiple VPNs. The Site LAN can be split based on either LAN + Tag or LAN prefix. If no filter is used, all the LANs will be + part of the same VPNs with the same role."; + } + list vpn { + key vpn-id; + leaf vpn-id { + type leafref { + path "/l3vpn-svc/vpn-services/"+ + "vpn-service/vpn-id"; + } + mandatory true; + description + "Reference to an IP VPN."; + } + leaf site-role { + type identityref { + base site-role; + } + default any-to-any-role; + description + "Role of the site in the IP VPN."; + } + description + "List of VPNs the LAN is associated with."; + } + description + "List of entries for export policy."; + } + description + "List of VPN policies."; + } + description + "VPN policy."; + } + description + "VPN policy parameters for the site."; + } + + grouping site-maximum-routes { + container maximum-routes { + list address-family { + key af; + leaf af { + type address-family; + description + "Address family."; + } + leaf maximum-routes { + type uint32; + description + "Maximum prefixes the VRF can accept + for this address family."; + } + description + "List of address families."; + } + description + "Defines 'maximum-routes' for the VRF."; + } + description + "Defines 'maximum-routes' for the site."; + } + grouping site-security { + container security { + uses site-security-authentication; + uses site-security-encryption; + description + "Site-specific security parameters."; + } + description + "Grouping for security parameters."; + } + grouping site-service { + container service { + uses site-service-qos-profile; + uses site-service-mpls; + uses site-service-multicast; + description + "Service parameters on the attachment."; + } + description + "Grouping for service parameters."; + } + grouping site-network-access-service { + container service { + uses site-service-basic; + + uses site-service-qos-profile; + uses site-service-mpls; + uses site-service-multicast; + description + "Service parameters on the attachment."; + } + description + "Grouping for service parameters."; + } + grouping vpn-extranet { + container extranet-vpns { + if-feature extranet-vpn; + list extranet-vpn { + key vpn-id; + leaf vpn-id { + type svc-id; + description + "Identifies the target VPN the local VPN want to access."; + } + leaf local-sites-role { + type identityref { + base site-role; + } + default any-to-any-role; + description + "This describes the role of the + local sites in the target VPN topology. In the any-to-any VPN + service topology, the local sites must have the same role, which + will be 'any-to-any-role'. In the Hub-and-Spoke VPN service + topology or the Hub-and-Spoke disjoint VPN service topology, + the local sites must have a Hub role or a Spoke role."; + } + description + "List of extranet VPNs or target VPNs the local VPN is + attached to."; + } + description + "Container for extranet VPN configuration."; + } + description + "Grouping for extranet VPN configuration. + This provides an easy way to interconnect + all sites from two VPNs."; + } + grouping site-attachment-availability { + container availability { + leaf access-priority { + type uint32; + + default 100; + description + "Defines the priority for the access. + The higher the access-priority value, + the higher the preference of the + access will be."; + } + description + "Availability parameters (used for multihoming)."; + } + description + "Defines availability parameters for a site."; + } + grouping access-vpn-policy { + container vpn-attachment { + choice attachment-flavor { + case vpn-policy-id { + leaf vpn-policy-id { + type leafref { + path "../../../../"+ + "vpn-policies/vpn-policy/"+ + "vpn-policy-id"; + } + description + "Reference to a VPN policy. When referencing VPN + policy for attachment, the vpn-policy-id must be + configured."; + } + } + case vpn-id { + leaf vpn-id { + type leafref { + path "/l3vpn-svc/vpn-services"+ + "/vpn-service/vpn-id"; + } + description + "Reference to an IP VPN. Referencing a vpn-id provides + an easy way to attach a particular logical access to + a VPN. In this case, vpn-id must be configured."; + } + leaf site-role { + type identityref { + base site-role; + } + default any-to-any-role; + description + "Role of the site in the IP VPN. When referencing a vpn-id, + the site-role setting must be added to express the role of + + the site in the target VPN service topology."; + } + } + mandatory true; + description + "Choice for VPN attachment flavor. A choice is implemented + to allow the user to choose the flavor that provides the + best fit."; + } + description + "Defines VPN attachment of a site."; + } + description + "Defines the VPN attachment rules for + a site's logical access."; + } + grouping vpn-profile-cfg { + container valid-provider-identifiers { + list cloud-identifier { + if-feature cloud-access; + key id; + leaf id { + type string; + description + "Identification of cloud service. + Local administration meaning."; + } + description + "List for Cloud Identifiers."; + } + list encryption-profile-identifier { + key id; + leaf id { + type string; + description + "Identification of the SP encryption profile + to be used. Local administration meaning."; + } + description + "List for encryption profile identifiers."; + } + list qos-profile-identifier { + key id; + leaf id { + type string; + description + "Identification of the QoS Profile to be used. + Local administration meaning."; + + } + description + "List for QoS Profile Identifiers."; + } + list bfd-profile-identifier { + key id; + leaf id { + type string; + description + "Identification of the SP BFD Profile to be used. + Local administration meaning."; + } + description + "List for BFD Profile identifiers."; + } + nacm:default-deny-write; + description + "Container for Valid Provider Identifies."; + } + description + "Grouping for VPN Profile configuration."; + } + grouping vpn-svc-cfg { + leaf vpn-id { + type svc-id; + description + "VPN identifier. Local administration meaning."; + } + leaf customer-name { + type string; + description + "Name of the customer that actually uses the VPN service. + In the case that any intermediary (e.g., Tier-2 provider + or partner) sells the VPN service to their end user + on behalf of the original service provider (e.g., Tier-1 + provider), the original service provider may require the + customer name to provide smooth activation/commissioning + and operation for the service."; + } + leaf vpn-service-topology { + type identityref { + base vpn-topology; + } + default any-to-any; + description + "VPN service topology."; + } + uses vpn-service-cloud-access; + + uses vpn-service-multicast; + uses vpn-service-mpls; + uses vpn-extranet; + description + "Grouping for VPN service configuration."; + } + grouping site-top-level-cfg { + uses operational-requirements; + uses customer-location-info; + uses site-devices; + uses site-diversity; + uses site-management; + uses site-vpn-policy; + uses site-vpn-flavor; + uses site-maximum-routes; + uses site-security; + uses site-service; + uses site-protection; + uses site-routing; + description + "Grouping for site top-level configuration."; + } + grouping site-network-access-top-level-cfg { + leaf site-network-access-type { + type identityref { + base site-network-access-type; + } + default point-to-point; + description + "Describes the type of connection, e.g., + point-to-point or multipoint."; + } + choice location-flavor { + case location { + when "derived-from-or-self(../../management/type, "+ + "'l3vpn-svc:customer-managed')" { + description + "Applicable only for customer-managed device."; + } + leaf location-reference { + type leafref { + path "../../../locations/location/location-id"; + } + description + "Location of the site-network-access."; + } + } + case device { + + when "derived-from-or-self(../../management/type, "+ + "'l3vpn-svc:provider-managed') or "+ + "derived-from-or-self(../../management/type, "+ + "'l3vpn-svc:co-managed')" { + description + "Applicable only for provider-managed or co-managed device."; + } + leaf device-reference { + type leafref { + path "../../../devices/device/device-id"; + } + description + "Identifier of CE to use."; + } + } + mandatory true; + description + "Choice of how to describe the site's location."; + } + uses access-diversity; + uses site-attachment-bearer; + uses site-attachment-ip-connection; + uses site-security; + uses site-network-access-service; + uses site-routing; + uses site-attachment-availability; + uses access-vpn-policy; + description + "Grouping for site network access top-level configuration."; + } + /* Main blocks */ + container l3vpn-svc { + container vpn-profiles { + uses vpn-profile-cfg; + description + "Container for VPN Profiles."; + } + container vpn-services { + list vpn-service { + key vpn-id; + uses vpn-svc-cfg; + description + "List of VPN services."; + } + description + "Top-level container for the VPN services."; + } + container sites { + list site { + key site-id; + leaf site-id { + type svc-id; + description + "Identifier of the site."; + } + uses site-top-level-cfg; + uses operational-requirements-ops; + container site-network-accesses { + list site-network-access { + key site-network-access-id; + leaf site-network-access-id { + type svc-id; + description + "Identifier for the access."; + } + uses site-network-access-top-level-cfg; + description + "List of accesses for a site."; + } + description + "List of accesses for a site."; + } + description + "List of sites."; + } + description + "Container for sites."; + } + description + "Main container for L3VPN service configuration."; + } + } diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_l3vpn/yang/ietf-netconf-acm@2018-02-14.yang b/src/nbi/service/rest_server/nbi_plugins/ietf_l3vpn/yang/ietf-netconf-acm@2018-02-14.yang new file mode 100644 index 0000000000000000000000000000000000000000..dc0deb8ffd29791ad80b9e3ad8244502126f2d44 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_l3vpn/yang/ietf-netconf-acm@2018-02-14.yang @@ -0,0 +1,468 @@ +module ietf-netconf-acm { + + namespace "urn:ietf:params:xml:ns:yang:ietf-netconf-acm"; + + prefix nacm; + + import ietf-yang-types { + prefix yang; + } + + organization + "IETF NETCONF (Network Configuration) Working Group"; + + contact + "WG Web: + WG List: + + Author: Andy Bierman + + + Author: Martin Bjorklund + "; + + description + "Network Configuration Access Control Model. + + Copyright (c) 2012 - 2018 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 + (https://trustee.ietf.org/license-info). + + This version of this YANG module is part of RFC 8341; see + the RFC itself for full legal notices."; + + revision "2018-02-14" { + description + "Added support for YANG 1.1 actions and notifications tied to + data nodes. Clarified how NACM extensions can be used by + other data models."; + reference + "RFC 8341: Network Configuration Access Control Model"; + } + + revision "2012-02-22" { + description + "Initial version."; + reference + "RFC 6536: Network Configuration Protocol (NETCONF) + Access Control Model"; + } + + /* + * Extension statements + */ + + extension default-deny-write { + description + "Used to indicate that the data model node + represents a sensitive security system parameter. + + If present, the NETCONF server will only allow the designated + 'recovery session' to have write access to the node. An + explicit access control rule is required for all other users. + + If the NACM module is used, then it must be enabled (i.e., + /nacm/enable-nacm object equals 'true'), or this extension + is ignored. + + The 'default-deny-write' extension MAY appear within a data + definition statement. It is ignored otherwise."; + } + + extension default-deny-all { + description + "Used to indicate that the data model node + controls a very sensitive security system parameter. + + If present, the NETCONF server will only allow the designated + 'recovery session' to have read, write, or execute access to + the node. An explicit access control rule is required for all + other users. + + If the NACM module is used, then it must be enabled (i.e., + /nacm/enable-nacm object equals 'true'), or this extension + is ignored. + + The 'default-deny-all' extension MAY appear within a data + definition statement, 'rpc' statement, or 'notification' + statement. It is ignored otherwise."; + } + + /* + * Derived types + */ + + typedef user-name-type { + type string { + length "1..max"; + } + description + "General-purpose username string."; + } + + typedef matchall-string-type { + type string { + pattern '\*'; + } + description + "The string containing a single asterisk '*' is used + to conceptually represent all possible values + for the particular leaf using this data type."; + } + + typedef access-operations-type { + type bits { + bit create { + description + "Any protocol operation that creates a + new data node."; + position 0; + } + bit read { + description + "Any protocol operation or notification that + returns the value of a data node."; + position 1; + } + bit update { + description + "Any protocol operation that alters an existing + data node."; + position 2; + } + bit delete { + description + "Any protocol operation that removes a data node."; + position 3; + } + bit exec { + description + "Execution access to the specified protocol operation."; + position 4; + } + } + description + "Access operation."; + } + + typedef group-name-type { + type string { + length "1..max"; + pattern '[^\*].*'; + } + description + "Name of administrative group to which + users can be assigned."; + } + + typedef action-type { + type enumeration { + enum permit { + description + "Requested action is permitted."; + } + enum deny { + description + "Requested action is denied."; + } + } + description + "Action taken by the server when a particular + rule matches."; + } + + typedef node-instance-identifier { + type yang:xpath1.0; + description + "Path expression used to represent a special + data node, action, or notification instance-identifier + string. + + A node-instance-identifier value is an + unrestricted YANG instance-identifier expression. + All the same rules as an instance-identifier apply, + except that predicates for keys are optional. If a key + predicate is missing, then the node-instance-identifier + represents all possible server instances for that key. + + This XML Path Language (XPath) expression is evaluated in the + following context: + + o The set of namespace declarations are those in scope on + the leaf element where this type is used. + + o The set of variable bindings contains one variable, + 'USER', which contains the name of the user of the + current session. + + o The function library is the core function library, but + note that due to the syntax restrictions of an + instance-identifier, no functions are allowed. + + o The context node is the root node in the data tree. + + The accessible tree includes actions and notifications tied + to data nodes."; + } + + /* + * Data definition statements + */ + + container nacm { + nacm:default-deny-all; + + description + "Parameters for NETCONF access control model."; + + leaf enable-nacm { + type boolean; + default "true"; + description + "Enables or disables all NETCONF access control + enforcement. If 'true', then enforcement + is enabled. If 'false', then enforcement + is disabled."; + } + + leaf read-default { + type action-type; + default "permit"; + description + "Controls whether read access is granted if + no appropriate rule is found for a + particular read request."; + } + + leaf write-default { + type action-type; + default "deny"; + description + "Controls whether create, update, or delete access + is granted if no appropriate rule is found for a + particular write request."; + } + + leaf exec-default { + type action-type; + default "permit"; + description + "Controls whether exec access is granted if no appropriate + rule is found for a particular protocol operation request."; + } + + leaf enable-external-groups { + type boolean; + default "true"; + description + "Controls whether the server uses the groups reported by the + NETCONF transport layer when it assigns the user to a set of + NACM groups. If this leaf has the value 'false', any group + names reported by the transport layer are ignored by the + server."; + } + + leaf denied-operations { + type yang:zero-based-counter32; + config false; + mandatory true; + description + "Number of times since the server last restarted that a + protocol operation request was denied."; + } + + leaf denied-data-writes { + type yang:zero-based-counter32; + config false; + mandatory true; + description + "Number of times since the server last restarted that a + protocol operation request to alter + a configuration datastore was denied."; + } + + leaf denied-notifications { + type yang:zero-based-counter32; + config false; + mandatory true; + description + "Number of times since the server last restarted that + a notification was dropped for a subscription because + access to the event type was denied."; + } + + container groups { + description + "NETCONF access control groups."; + + list group { + key name; + + description + "One NACM group entry. This list will only contain + configured entries, not any entries learned from + any transport protocols."; + + leaf name { + type group-name-type; + description + "Group name associated with this entry."; + } + + leaf-list user-name { + type user-name-type; + description + "Each entry identifies the username of + a member of the group associated with + this entry."; + } + } + } + + list rule-list { + key name; + ordered-by user; + description + "An ordered collection of access control rules."; + + leaf name { + type string { + length "1..max"; + } + description + "Arbitrary name assigned to the rule-list."; + } + leaf-list group { + type union { + type matchall-string-type; + type group-name-type; + } + description + "List of administrative groups that will be + assigned the associated access rights + defined by the 'rule' list. + + The string '*' indicates that all groups apply to the + entry."; + } + + list rule { + key name; + ordered-by user; + description + "One access control rule. + + Rules are processed in user-defined order until a match is + found. A rule matches if 'module-name', 'rule-type', and + 'access-operations' match the request. If a rule + matches, the 'action' leaf determines whether or not + access is granted."; + + leaf name { + type string { + length "1..max"; + } + description + "Arbitrary name assigned to the rule."; + } + + leaf module-name { + type union { + type matchall-string-type; + type string; + } + default "*"; + description + "Name of the module associated with this rule. + + This leaf matches if it has the value '*' or if the + object being accessed is defined in the module with the + specified module name."; + } + choice rule-type { + description + "This choice matches if all leafs present in the rule + match the request. If no leafs are present, the + choice matches all requests."; + case protocol-operation { + leaf rpc-name { + type union { + type matchall-string-type; + type string; + } + description + "This leaf matches if it has the value '*' or if + its value equals the requested protocol operation + name."; + } + } + case notification { + leaf notification-name { + type union { + type matchall-string-type; + type string; + } + description + "This leaf matches if it has the value '*' or if its + value equals the requested notification name."; + } + } + case data-node { + leaf path { + type node-instance-identifier; + mandatory true; + description + "Data node instance-identifier associated with the + data node, action, or notification controlled by + this rule. + + Configuration data or state data + instance-identifiers start with a top-level + data node. A complete instance-identifier is + required for this type of path value. + + The special value '/' refers to all possible + datastore contents."; + } + } + } + + leaf access-operations { + type union { + type matchall-string-type; + type access-operations-type; + } + default "*"; + description + "Access operations associated with this rule. + + This leaf matches if it has the value '*' or if the + bit corresponding to the requested operation is set."; + } + + leaf action { + type action-type; + mandatory true; + description + "The access control action associated with the + rule. If a rule has been determined to match a + particular request, then this object is used + to determine whether to permit or deny the + request."; + } + + leaf comment { + type string; + description + "A textual description of the access rule."; + } + } + } + } +} diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_l3vpn/yang/ietf-yang-types@2013-07-15.yang b/src/nbi/service/rest_server/nbi_plugins/ietf_l3vpn/yang/ietf-yang-types@2013-07-15.yang new file mode 100644 index 0000000000000000000000000000000000000000..956562a7b342055127961732d8bde4be21c80d7d --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_l3vpn/yang/ietf-yang-types@2013-07-15.yang @@ -0,0 +1,475 @@ + module ietf-yang-types { + + namespace "urn:ietf:params:xml:ns:yang:ietf-yang-types"; + prefix "yang"; + + organization + "IETF NETMOD (NETCONF Data Modeling Language) Working Group"; + + contact + "WG Web: + WG List: + + WG Chair: David Kessens + + + WG Chair: Juergen Schoenwaelder + + + Editor: Juergen Schoenwaelder + "; + + description + "This module contains a collection of generally useful derived + YANG data types. + + Copyright (c) 2013 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). + + This version of this YANG module is part of RFC 6991; see + the RFC itself for full legal notices."; + + revision 2013-07-15 { + description + "This revision adds the following new data types: + - yang-identifier + - hex-string + - uuid + - dotted-quad"; + reference + "RFC 6991: Common YANG Data Types"; + } + + revision 2010-09-24 { + description + "Initial revision."; + reference + "RFC 6021: Common YANG Data Types"; + } + + /*** collection of counter and gauge types ***/ + + typedef counter32 { + type uint32; + description + "The counter32 type represents a non-negative integer + that monotonically increases until it reaches a + maximum value of 2^32-1 (4294967295 decimal), when it + wraps around and starts increasing again from zero. + + Counters have no defined 'initial' value, and thus, a + single value of a counter has (in general) no information + content. Discontinuities in the monotonically increasing + value normally occur at re-initialization of the + management system, and at other times as specified in the + description of a schema node using this type. If such + other times can occur, for example, the creation of + a schema node of type counter32 at times other than + re-initialization, then a corresponding schema node + should be defined, with an appropriate type, to indicate + the last discontinuity. + + The counter32 type should not be used for configuration + schema nodes. A default statement SHOULD NOT be used in + combination with the type counter32. + + In the value set and its semantics, this type is equivalent + to the Counter32 type of the SMIv2."; + reference + "RFC 2578: Structure of Management Information Version 2 + (SMIv2)"; + } + + typedef zero-based-counter32 { + type yang:counter32; + default "0"; + description + "The zero-based-counter32 type represents a counter32 + that has the defined 'initial' value zero. + + A schema node of this type will be set to zero (0) on creation + and will thereafter increase monotonically until it reaches + a maximum value of 2^32-1 (4294967295 decimal), when it + wraps around and starts increasing again from zero. + + Provided that an application discovers a new schema node + of this type within the minimum time to wrap, it can use the + 'initial' value as a delta. It is important for a management + station to be aware of this minimum time and the actual time + between polls, and to discard data if the actual time is too + long or there is no defined minimum time. + + In the value set and its semantics, this type is equivalent + to the ZeroBasedCounter32 textual convention of the SMIv2."; + reference + "RFC 4502: Remote Network Monitoring Management Information + Base Version 2"; + } + + typedef counter64 { + type uint64; + description + "The counter64 type represents a non-negative integer + that monotonically increases until it reaches a + maximum value of 2^64-1 (18446744073709551615 decimal), + when it wraps around and starts increasing again from zero. + + Counters have no defined 'initial' value, and thus, a + single value of a counter has (in general) no information + content. Discontinuities in the monotonically increasing + value normally occur at re-initialization of the + management system, and at other times as specified in the + description of a schema node using this type. If such + other times can occur, for example, the creation of + a schema node of type counter64 at times other than + re-initialization, then a corresponding schema node + should be defined, with an appropriate type, to indicate + the last discontinuity. + + The counter64 type should not be used for configuration + schema nodes. A default statement SHOULD NOT be used in + combination with the type counter64. + + In the value set and its semantics, this type is equivalent + to the Counter64 type of the SMIv2."; + reference + "RFC 2578: Structure of Management Information Version 2 + (SMIv2)"; + } + + typedef zero-based-counter64 { + type yang:counter64; + default "0"; + description + "The zero-based-counter64 type represents a counter64 that + has the defined 'initial' value zero. + + A schema node of this type will be set to zero (0) on creation + and will thereafter increase monotonically until it reaches + a maximum value of 2^64-1 (18446744073709551615 decimal), + when it wraps around and starts increasing again from zero. + + Provided that an application discovers a new schema node + of this type within the minimum time to wrap, it can use the + 'initial' value as a delta. It is important for a management + station to be aware of this minimum time and the actual time + between polls, and to discard data if the actual time is too + long or there is no defined minimum time. + + In the value set and its semantics, this type is equivalent + to the ZeroBasedCounter64 textual convention of the SMIv2."; + reference + "RFC 2856: Textual Conventions for Additional High Capacity + Data Types"; + } + + typedef gauge32 { + type uint32; + description + "The gauge32 type represents a non-negative integer, which + may increase or decrease, but shall never exceed a maximum + value, nor fall below a minimum value. The maximum value + cannot be greater than 2^32-1 (4294967295 decimal), and + the minimum value cannot be smaller than 0. The value of + a gauge32 has its maximum value whenever the information + being modeled is greater than or equal to its maximum + value, and has its minimum value whenever the information + being modeled is smaller than or equal to its minimum value. + If the information being modeled subsequently decreases + below (increases above) the maximum (minimum) value, the + gauge32 also decreases (increases). + + In the value set and its semantics, this type is equivalent + to the Gauge32 type of the SMIv2."; + reference + "RFC 2578: Structure of Management Information Version 2 + (SMIv2)"; + } + + typedef gauge64 { + type uint64; + description + "The gauge64 type represents a non-negative integer, which + may increase or decrease, but shall never exceed a maximum + value, nor fall below a minimum value. The maximum value + cannot be greater than 2^64-1 (18446744073709551615), and + the minimum value cannot be smaller than 0. The value of + a gauge64 has its maximum value whenever the information + being modeled is greater than or equal to its maximum + value, and has its minimum value whenever the information + being modeled is smaller than or equal to its minimum value. + If the information being modeled subsequently decreases + below (increases above) the maximum (minimum) value, the + gauge64 also decreases (increases). + + In the value set and its semantics, this type is equivalent + to the CounterBasedGauge64 SMIv2 textual convention defined + in RFC 2856"; + reference + "RFC 2856: Textual Conventions for Additional High Capacity + Data Types"; + } + + /*** collection of identifier-related types ***/ + + typedef object-identifier { + type string { + pattern '(([0-1](\.[1-3]?[0-9]))|(2\.(0|([1-9]\d*))))' + + '(\.(0|([1-9]\d*)))*'; + } + description + "The object-identifier type represents administratively + assigned names in a registration-hierarchical-name tree. + + Values of this type are denoted as a sequence of numerical + non-negative sub-identifier values. Each sub-identifier + value MUST NOT exceed 2^32-1 (4294967295). Sub-identifiers + are separated by single dots and without any intermediate + whitespace. + + The ASN.1 standard restricts the value space of the first + sub-identifier to 0, 1, or 2. Furthermore, the value space + of the second sub-identifier is restricted to the range + 0 to 39 if the first sub-identifier is 0 or 1. Finally, + the ASN.1 standard requires that an object identifier + has always at least two sub-identifiers. The pattern + captures these restrictions. + + Although the number of sub-identifiers is not limited, + module designers should realize that there may be + implementations that stick with the SMIv2 limit of 128 + sub-identifiers. + + This type is a superset of the SMIv2 OBJECT IDENTIFIER type + since it is not restricted to 128 sub-identifiers. Hence, + this type SHOULD NOT be used to represent the SMIv2 OBJECT + IDENTIFIER type; the object-identifier-128 type SHOULD be + used instead."; + reference + "ISO9834-1: Information technology -- Open Systems + Interconnection -- Procedures for the operation of OSI + Registration Authorities: General procedures and top + arcs of the ASN.1 Object Identifier tree"; + } + + typedef object-identifier-128 { + type object-identifier { + pattern '\d*(\.\d*){1,127}'; + } + description + "This type represents object-identifiers restricted to 128 + sub-identifiers. + + In the value set and its semantics, this type is equivalent + to the OBJECT IDENTIFIER type of the SMIv2."; + reference + "RFC 2578: Structure of Management Information Version 2 + (SMIv2)"; + } + + typedef yang-identifier { + type string { + length "1..max"; + pattern '[a-zA-Z_][a-zA-Z0-9\-_.]*'; + pattern '.|..|[^xX].*|.[^mM].*|..[^lL].*'; + } + description + "A YANG identifier string as defined by the 'identifier' + rule in Section 12 of RFC 6020. An identifier must + start with an alphabetic character or an underscore + followed by an arbitrary sequence of alphabetic or + numeric characters, underscores, hyphens, or dots. + + A YANG identifier MUST NOT start with any possible + combination of the lowercase or uppercase character + sequence 'xml'."; + reference + "RFC 6020: YANG - A Data Modeling Language for the Network + Configuration Protocol (NETCONF)"; + } + + /*** collection of types related to date and time***/ + + typedef date-and-time { + type string { + pattern '\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\.\d+)?' + + '(Z|[\+\-]\d{2}:\d{2})'; + } + description + "The date-and-time type is a profile of the ISO 8601 + standard for representation of dates and times using the + Gregorian calendar. The profile is defined by the + date-time production in Section 5.6 of RFC 3339. + + The date-and-time type is compatible with the dateTime XML + schema type with the following notable exceptions: + + (a) The date-and-time type does not allow negative years. + + (b) The date-and-time time-offset -00:00 indicates an unknown + time zone (see RFC 3339) while -00:00 and +00:00 and Z + all represent the same time zone in dateTime. + + (c) The canonical format (see below) of data-and-time values + differs from the canonical format used by the dateTime XML + schema type, which requires all times to be in UTC using + the time-offset 'Z'. + + This type is not equivalent to the DateAndTime textual + convention of the SMIv2 since RFC 3339 uses a different + separator between full-date and full-time and provides + higher resolution of time-secfrac. + + The canonical format for date-and-time values with a known time + zone uses a numeric time zone offset that is calculated using + the device's configured known offset to UTC time. A change of + the device's offset to UTC time will cause date-and-time values + to change accordingly. Such changes might happen periodically + in case a server follows automatically daylight saving time + (DST) time zone offset changes. The canonical format for + date-and-time values with an unknown time zone (usually + referring to the notion of local time) uses the time-offset + -00:00."; + reference + "RFC 3339: Date and Time on the Internet: Timestamps + RFC 2579: Textual Conventions for SMIv2 + XSD-TYPES: XML Schema Part 2: Datatypes Second Edition"; + } + + typedef timeticks { + type uint32; + description + "The timeticks type represents a non-negative integer that + represents the time, modulo 2^32 (4294967296 decimal), in + hundredths of a second between two epochs. When a schema + node is defined that uses this type, the description of + the schema node identifies both of the reference epochs. + + In the value set and its semantics, this type is equivalent + to the TimeTicks type of the SMIv2."; + reference + "RFC 2578: Structure of Management Information Version 2 + (SMIv2)"; + } + + typedef timestamp { + type yang:timeticks; + description + "The timestamp type represents the value of an associated + timeticks schema node at which a specific occurrence + happened. The specific occurrence must be defined in the + description of any schema node defined using this type. When + the specific occurrence occurred prior to the last time the + associated timeticks attribute was zero, then the timestamp + value is zero. Note that this requires all timestamp values + to be reset to zero when the value of the associated timeticks + attribute reaches 497+ days and wraps around to zero. + + The associated timeticks schema node must be specified + in the description of any schema node using this type. + + In the value set and its semantics, this type is equivalent + to the TimeStamp textual convention of the SMIv2."; + reference + "RFC 2579: Textual Conventions for SMIv2"; + } + + /*** collection of generic address types ***/ + + typedef phys-address { + type string { + pattern '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'; + } + + description + "Represents media- or physical-level addresses represented + as a sequence octets, each octet represented by two hexadecimal + numbers. Octets are separated by colons. The canonical + representation uses lowercase characters. + + In the value set and its semantics, this type is equivalent + to the PhysAddress textual convention of the SMIv2."; + reference + "RFC 2579: Textual Conventions for SMIv2"; + } + + typedef mac-address { + type string { + pattern '[0-9a-fA-F]{2}(:[0-9a-fA-F]{2}){5}'; + } + description + "The mac-address type represents an IEEE 802 MAC address. + The canonical representation uses lowercase characters. + + In the value set and its semantics, this type is equivalent + to the MacAddress textual convention of the SMIv2."; + reference + "IEEE 802: IEEE Standard for Local and Metropolitan Area + Networks: Overview and Architecture + RFC 2579: Textual Conventions for SMIv2"; + } + + /*** collection of XML-specific types ***/ + + typedef xpath1.0 { + type string; + description + "This type represents an XPATH 1.0 expression. + + When a schema node is defined that uses this type, the + description of the schema node MUST specify the XPath + context in which the XPath expression is evaluated."; + reference + "XPATH: XML Path Language (XPath) Version 1.0"; + } + + /*** collection of string types ***/ + + typedef hex-string { + type string { + pattern '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'; + } + + description + "A hexadecimal string with octets represented as hex digits + separated by colons. The canonical representation uses + lowercase characters."; + } + + typedef uuid { + type string { + 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}'; + } + description + "A Universally Unique IDentifier in the string representation + defined in RFC 4122. The canonical representation uses + lowercase characters. + + The following is an example of a UUID in string representation: + f81d4fae-7dec-11d0-a765-00a0c91e6bf6 + "; + reference + "RFC 4122: A Universally Unique IDentifier (UUID) URN + Namespace"; + } + + typedef dotted-quad { + type string { + pattern + '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.){3}' + + '([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'; + } + description + "An unsigned 32-bit number expressed in the dotted-quad + notation, i.e., four octets written as decimal numbers + and separated with the '.' (full stop) character."; + } + } diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/ComposeLink.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/ComposeLink.py new file mode 100644 index 0000000000000000000000000000000000000000..2cc116a63506abcbd2d8e1377bbda453b1541bce --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/ComposeLink.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 common.proto.context_pb2 import Link +from .bindings.networks.network.link import link +from .NameMapping import NameMappings +from .NetworkTypeEnum import NetworkTypeEnum + +def compose_link( + ietf_link_obj : link, link_specs : Link, name_mappings : NameMappings, network_type : NetworkTypeEnum +) -> None: + src_endpoint_id = link_specs.link_endpoint_ids[0] + ietf_link_obj.source.source_node = name_mappings.get_device_name(src_endpoint_id.device_id) + ietf_link_obj.source.source_tp = name_mappings.get_endpoint_name(src_endpoint_id) + + dst_endpoint_id = link_specs.link_endpoint_ids[-1] + ietf_link_obj.destination.dest_node = name_mappings.get_device_name(dst_endpoint_id.device_id) + ietf_link_obj.destination.dest_tp = name_mappings.get_endpoint_name(dst_endpoint_id) + + ietf_link_obj.te._set_oper_status('up') + + te_link_attrs = ietf_link_obj.te.te_link_attributes + te_link_attrs.access_type = 'point-to-point' + te_link_attrs.admin_status = 'up' + te_link_attrs.name = link_specs.name + + if network_type == NetworkTypeEnum.TE_ETH_TRAN_TOPOLOGY: + link_total_cap_kbps = link_specs.attributes.total_capacity_gbps * 1e6 + link_used_cap_kbps = link_specs.attributes.used_capacity_gbps * 1e6 + link_avail_cap_kbps = link_total_cap_kbps - link_used_cap_kbps + + te_link_attrs.max_link_bandwidth.te_bandwidth.eth_bandwidth = link_total_cap_kbps + unresv_bw = te_link_attrs.unreserved_bandwidth.add(7) + unresv_bw.te_bandwidth.eth_bandwidth = link_avail_cap_kbps + elif network_type == NetworkTypeEnum.TE_OTN_TOPOLOGY: + te_link_attrs.te_delay_metric = 1 + oduitem = te_link_attrs.max_link_bandwidth.te_bandwidth.otn.odulist.add('ietf-layer1-types:ODU0') + oduitem.ts_number = 80 + + unresv_bw = te_link_attrs.unreserved_bandwidth.add(7) + oduitem = unresv_bw.te_bandwidth.otn.odulist.add('ietf-layer1-types:ODU0') + oduitem.ts_number = 80 diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/ComposeNetwork.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/ComposeNetwork.py new file mode 100644 index 0000000000000000000000000000000000000000..6ffc85e387ce4f4691cdc9757d6bd60068bef991 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/ComposeNetwork.py @@ -0,0 +1,113 @@ +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT 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, re +from common.DeviceTypes import DeviceTypeEnum +from common.proto.context_pb2 import TopologyDetails +from .bindings.networks.network import network +from .ComposeLink import compose_link +from .ComposeNode import compose_node +from .NameMapping import NameMappings +from .NetworkTypeEnum import NetworkTypeEnum, get_network_topology_type + +LOGGER = logging.getLogger(__name__) + +IGNORE_DEVICE_TYPES = { + DeviceTypeEnum.CLIENT.value, + DeviceTypeEnum.DATACENTER.value, + DeviceTypeEnum.EMULATED_CLIENT.value, + DeviceTypeEnum.EMULATED_DATACENTER.value, + DeviceTypeEnum.EMULATED_MICROWAVE_RADIO_SYSTEM.value, + DeviceTypeEnum.EMULATED_OPEN_LINE_SYSTEM.value, + DeviceTypeEnum.EMULATED_XR_CONSTELLATION.value, + DeviceTypeEnum.MICROWAVE_RADIO_SYSTEM.value, + DeviceTypeEnum.NETWORK.value, + DeviceTypeEnum.OPEN_LINE_SYSTEM.value, + DeviceTypeEnum.XR_CONSTELLATION.value, +} + +IGNORE_DEVICE_NAMES = { + NetworkTypeEnum.TE_OTN_TOPOLOGY: { + '128.32.10.1', '128.32.33.5', '128.32.20.5', '128.32.20.1', '128.32.10.5', 'nce-t' + }, + NetworkTypeEnum.TE_ETH_TRAN_TOPOLOGY: { + + }, +} + +TE_TOPOLOGY_NAME = 'Huawei-Network' + +def compose_network(ietf_network_obj : network, te_topology_name : str, topology_details : TopologyDetails) -> None: + ietf_network_obj.te.name = TE_TOPOLOGY_NAME + + #te_topology_name = topology_details.name + match = re.match(r'providerId\-([^\-]*)-clientId-([^\-]*)-topologyId-([^\-]*)', te_topology_name) + if match is not None: + provider_id, client_id, topology_id = match.groups() + ietf_network_obj.te_topology_identifier.provider_id = int(provider_id) + ietf_network_obj.te_topology_identifier.client_id = int(client_id) + ietf_network_obj.te_topology_identifier.topology_id = str(topology_id) + else: + ietf_network_obj.te_topology_identifier.provider_id = 10 + ietf_network_obj.te_topology_identifier.client_id = 0 + ietf_network_obj.te_topology_identifier.topology_id = '0' + + ietf_network_obj.network_types.te_topology._set_present() + # TODO: resolve setting of otn_topology/eth_tran_topology network type; not working in bindings. + # See "../ManualFixes.py". + topology_id = ietf_network_obj.te_topology_identifier.topology_id + topology_id = { + '1': NetworkTypeEnum.TE_OTN_TOPOLOGY.value, + '2': NetworkTypeEnum.TE_ETH_TRAN_TOPOLOGY.value, + }.get(topology_id, topology_id) + network_type = get_network_topology_type(topology_id) + if network_type == NetworkTypeEnum.TE_OTN_TOPOLOGY: + #ietf_network_obj.network_types.te_topology.otn_topology._set_present() + pass + elif network_type == NetworkTypeEnum.TE_ETH_TRAN_TOPOLOGY: + #ietf_network_obj.network_types.te_topology.eth_tran_topology._set_present() + pass + else: + raise Exception('Unsupported TopologyId({:s})'.format(str(topology_id))) + + name_mappings = NameMappings() + + ignore_device_uuids = set() + + for device in topology_details.devices: + device_uuid = device.device_id.device_uuid.uuid + + device_type = device.device_type + if device_type in IGNORE_DEVICE_TYPES: + ignore_device_uuids.add(device_uuid) + continue + + device_name = device.name + if device_name in IGNORE_DEVICE_NAMES.get(network_type, set()): + ignore_device_uuids.add(device_uuid) + continue + + ietf_node_obj = ietf_network_obj.node.add(device_name) + compose_node(ietf_node_obj, device, name_mappings, network_type) + + for link in topology_details.links: + link_device_uuids = { + endpoint_id.device_id.device_uuid.uuid + for endpoint_id in link.link_endpoint_ids + } + if len(ignore_device_uuids.intersection(link_device_uuids)) > 0: + continue + link_name = link.name + ietf_link_obj = ietf_network_obj.link.add(link_name) + compose_link(ietf_link_obj, link, name_mappings, network_type) diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/ComposeNode.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/ComposeNode.py new file mode 100644 index 0000000000000000000000000000000000000000..a4b29d41d7c27d588ce39b49c28746be47ad31f3 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/ComposeNode.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 logging +from common.proto.context_pb2 import Device +from .bindings.networks.network.node import node +from .ComposeTermPoint import compose_term_point +from .NameMapping import NameMappings +from .NetworkTypeEnum import NetworkTypeEnum + +LOGGER = logging.getLogger(__name__) + +MAPPINGS_TE_NODE_NAME = { + '10.0.10.1' : 'OA', + '10.0.20.1' : 'P', + '10.0.30.1' : 'OE', + '10.0.40.1' : 'P', + + '128.32.10.1': 'ONT1', + '128.32.20.1': 'ONT2', + '128.32.33.5': 'OLT', +} + +IGNORE_ENDPOINT_NAMES = {'mgmt', 'eth1'} + +def compose_node( + ietf_node_obj : node, device : Device, name_mappings : NameMappings, network_type : NetworkTypeEnum +) -> None: + device_name = device.name + + name_mappings.store_device_name(device) + + ietf_node_obj.te_node_id = device_name + + ietf_node_obj.te._set_oper_status('up') + ietf_node_obj.te.te_node_attributes.admin_status = 'up' + ietf_node_obj.te.te_node_attributes.name = MAPPINGS_TE_NODE_NAME.get(device_name, device_name) + + for endpoint in device.device_endpoints: + endpoint_name = endpoint.name + if endpoint_name in IGNORE_ENDPOINT_NAMES: continue + if network_type == NetworkTypeEnum.TE_OTN_TOPOLOGY and endpoint.endpoint_type != 'optical': continue + + ietf_tp_obj = ietf_node_obj.termination_point.add(endpoint_name) + compose_term_point(ietf_tp_obj, device, endpoint, name_mappings, network_type) + + if network_type == NetworkTypeEnum.TE_OTN_TOPOLOGY: + if device_name in {'10.0.30.1', '10.0.40.1'}: + ntaw = ietf_node_obj.te.tunnel_termination_point.add('NTAw') + ntaw.admin_status = 'up' + ntaw.encoding = 'ietf-te-types:lsp-encoding-oduk' + ntaw_llc = ntaw.local_link_connectivities.local_link_connectivity.add('500') + ntaw_llc.is_allowed = True + ntaw.name = '1-1-1-1-1' + ntaw._set_oper_status('up') + ntaw.protection_type = 'ietf-te-types:lsp-protection-unprotected' + ntaw.switching_capability = 'ietf-te-types:switching-otn' + + ntax = ietf_node_obj.te.tunnel_termination_point.add('NTAx') + ntax.admin_status = 'up' + ntax.encoding = 'ietf-te-types:lsp-encoding-oduk' + ntax_llc = ntax.local_link_connectivities.local_link_connectivity.add('501') + ntax_llc.is_allowed = True + ntax.name = '1-1-1-1-1' + ntax._set_oper_status('up') + ntax.protection_type = 'ietf-te-types:lsp-protection-unprotected' + ntax.switching_capability = 'ietf-te-types:switching-otn' + elif device_name in {'10.0.10.1', '10.0.20.1'}: + ntax = ietf_node_obj.te.tunnel_termination_point.add('NTAx') + ntax.admin_status = 'up' + ntax.encoding = 'ietf-te-types:lsp-encoding-oduk' + ntax_llc = ntax.local_link_connectivities.local_link_connectivity.add('501') + ntax_llc.is_allowed = True + ntax.name = '1-1-1-1-1' + ntax._set_oper_status('up') + ntax.protection_type = 'ietf-te-types:lsp-protection-unprotected' + ntax.switching_capability = 'ietf-te-types:switching-otn' + + ntaw = ietf_node_obj.te.tunnel_termination_point.add('NTAw') + ntaw.admin_status = 'up' + ntaw.encoding = 'ietf-te-types:lsp-encoding-oduk' + ntaw_llc = ntaw.local_link_connectivities.local_link_connectivity.add('500') + ntaw_llc.is_allowed = True + ntaw.name = '1-1-1-1-1' + ntaw._set_oper_status('up') + ntaw.protection_type = 'ietf-te-types:lsp-protection-unprotected' + ntaw.switching_capability = 'ietf-te-types:switching-otn' + elif network_type == NetworkTypeEnum.TE_ETH_TRAN_TOPOLOGY: + if device_name in {'128.32.33.5'}: + connectivity_matrices = ietf_node_obj.te.te_node_attributes.connectivity_matrices + lr0 = connectivity_matrices.label_restrictions.label_restriction.add(0) + lr0.label_start.te_label.vlanid = 21 + lr0.label_end.te_label.vlanid = 21 + lr1 = connectivity_matrices.label_restrictions.label_restriction.add(1) + lr1.label_start.te_label.vlanid = 31 + lr1.label_end.te_label.vlanid = 31 diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/ComposeTermPoint.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/ComposeTermPoint.py new file mode 100644 index 0000000000000000000000000000000000000000..9b65782a79c900cd3de8ec29fefd29036e2c014f --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/ComposeTermPoint.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.proto.context_pb2 import Device, EndPoint +from .bindings.networks.network.node.termination_point import termination_point +from .NameMapping import NameMappings +from .NetworkTypeEnum import NetworkTypeEnum + +MAPPINGS_TE_NAME = { + (NetworkTypeEnum.TE_OTN_TOPOLOGY, '10.0.10.1', '200'): '1-1-1-1-1', + (NetworkTypeEnum.TE_OTN_TOPOLOGY, '10.0.10.1', '500'): '1-1-1-1-1', + (NetworkTypeEnum.TE_OTN_TOPOLOGY, '10.0.10.1', '501'): '1-1-1-1-1', + + (NetworkTypeEnum.TE_OTN_TOPOLOGY, '10.0.20.1', '500'): '1-1-1-1-1', + (NetworkTypeEnum.TE_OTN_TOPOLOGY, '10.0.20.1', '501'): '1-1-1-1-1', + + (NetworkTypeEnum.TE_OTN_TOPOLOGY, '10.0.30.1', '200'): '1-1-1-1-1', + (NetworkTypeEnum.TE_OTN_TOPOLOGY, '10.0.30.1', '500'): '1-1-1-1-1', + (NetworkTypeEnum.TE_OTN_TOPOLOGY, '10.0.30.1', '501'): '1-1-1-1-1', + + (NetworkTypeEnum.TE_OTN_TOPOLOGY, '10.0.40.1', '500'): '1-1-1-1-1', + (NetworkTypeEnum.TE_OTN_TOPOLOGY, '10.0.40.1', '501'): '1-1-1-1-1', + + (NetworkTypeEnum.TE_ETH_TRAN_TOPOLOGY, '10.0.10.1', '200'): 'endpoint:111', + (NetworkTypeEnum.TE_ETH_TRAN_TOPOLOGY, '10.0.10.1', '500'): 'endpoint:111', + (NetworkTypeEnum.TE_ETH_TRAN_TOPOLOGY, '10.0.10.1', '501'): 'endpoint:111', + + (NetworkTypeEnum.TE_ETH_TRAN_TOPOLOGY, '10.0.20.1', '500'): 'endpoint:111', + (NetworkTypeEnum.TE_ETH_TRAN_TOPOLOGY, '10.0.20.1', '501'): 'endpoint:111', + + (NetworkTypeEnum.TE_ETH_TRAN_TOPOLOGY, '10.0.30.1', '200'): 'endpoint:111', + (NetworkTypeEnum.TE_ETH_TRAN_TOPOLOGY, '10.0.30.1', '500'): 'endpoint:111', + (NetworkTypeEnum.TE_ETH_TRAN_TOPOLOGY, '10.0.30.1', '501'): 'endpoint:111', + + (NetworkTypeEnum.TE_ETH_TRAN_TOPOLOGY, '10.0.40.1', '500'): 'endpoint:111', + (NetworkTypeEnum.TE_ETH_TRAN_TOPOLOGY, '10.0.40.1', '501'): 'endpoint:111', + + (NetworkTypeEnum.TE_ETH_TRAN_TOPOLOGY, '128.32.33.5', '500') : 'endpoint:111', +} + +MAPPINGS_TE_TP_ID = { + (NetworkTypeEnum.TE_ETH_TRAN_TOPOLOGY, '10.0.10.1', '200'): '128.32.33.254', + (NetworkTypeEnum.TE_ETH_TRAN_TOPOLOGY, '10.0.30.1', '200'): '172.10.33.254', + + (NetworkTypeEnum.TE_ETH_TRAN_TOPOLOGY, '128.32.33.5', '500') : '128.32.33.2', +} + +LOGGER = logging.getLogger(__name__) + +def compose_term_point( + ietf_tp_obj : termination_point, device : Device, endpoint : EndPoint, name_mappings : NameMappings, + network_type : NetworkTypeEnum +) -> None: + name_mappings.store_endpoint_name(device, endpoint) + + device_name = device.name + endpoint_name = endpoint.name + + ietf_tp_obj.te_tp_id = MAPPINGS_TE_TP_ID.get((network_type, device_name, endpoint_name), endpoint_name) + + if (network_type, device_name, endpoint_name) in MAPPINGS_TE_NAME: + ietf_tp_obj.te._set_oper_status('up') + ietf_tp_obj.te.admin_status = 'up' + ietf_tp_obj.te.name = MAPPINGS_TE_NAME.get((network_type, device_name, endpoint_name), endpoint_name) + + if network_type == NetworkTypeEnum.TE_ETH_TRAN_TOPOLOGY: + if (network_type, device_name, endpoint_name) in MAPPINGS_TE_NAME: + ietf_if_sw_cap = ietf_tp_obj.te.interface_switching_capability.add( + 'ietf-te-types:switching-l2sc ietf-te-types:lsp-encoding-ethernet' + ) + ietf_max_lsp_bw = ietf_if_sw_cap.max_lsp_bandwidth.add('7') + ietf_max_lsp_bw.te_bandwidth.eth_bandwidth = 10_000_000 # Kbps + + #ietf_tp_obj.eth_svc.client_facing = True + + ietf_tp_obj.eth_svc.supported_classification.port_classification = True + outer_tag = ietf_tp_obj.eth_svc.supported_classification.vlan_classification.outer_tag + outer_tag.supported_tag_types.append('ietf-eth-tran-types:classify-c-vlan') + outer_tag.supported_tag_types.append('ietf-eth-tran-types:classify-s-vlan') + outer_tag.vlan_bundling = False + outer_tag.vlan_range = '1-4094' + + elif network_type == NetworkTypeEnum.TE_OTN_TOPOLOGY: + #ietf_tp_obj.te.client_svc.client_facing = False + + ietf_if_sw_cap = ietf_tp_obj.te.interface_switching_capability.add( + 'ietf-te-types:switching-otn ietf-te-types:lsp-encoding-oduk' + ) + ietf_max_lsp_bw = ietf_if_sw_cap.max_lsp_bandwidth.add('7') + ietf_max_lsp_bw.te_bandwidth.otn.odu_type = 'ietf-layer1-types:ODU4' diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/ManualFixes.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/ManualFixes.py new file mode 100644 index 0000000000000000000000000000000000000000..ec95ee77fc3cfefc54365977ed17f2218cbc2ec4 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/ManualFixes.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. + +from typing import Dict + +from .NetworkTypeEnum import NetworkTypeEnum + +def manual_fixes(json_response : Dict) -> None: + # TODO: workaround to set network types manually. Currently does not work; refine bindings. + # Seems limitation of pyangbind using multiple augmentations and nested empty containers. + for json_network in json_response['ietf-network:networks']['network']: + net_te_topo_id = json_network.get('ietf-te-topology:te-topology-identifier', {}).get('topology-id') + if net_te_topo_id is None: continue + net_te_topo_type = json_network['network-types']['ietf-te-topology:te-topology'] + if net_te_topo_id == '1': + network_type = NetworkTypeEnum.TE_OTN_TOPOLOGY + net_te_topo_type['ietf-otn-topology:otn-topology'] = {} + elif net_te_topo_id == '2': + network_type = NetworkTypeEnum.TE_ETH_TRAN_TOPOLOGY + net_te_topo_type['ietf-eth-te-topology:eth-tran-topology'] = {} + else: + network_type = None + + for json_node in json_network.get('node', []): + for json_tp in json_node.get('ietf-network-topology:termination-point', []): + json_tp_te = json_tp.get('ietf-te-topology:te', {}) + + if network_type == NetworkTypeEnum.TE_OTN_TOPOLOGY: + json_tp_te_cs = json_tp_te.setdefault('ietf-otn-topology:client-svc', {}) + json_tp_te_cs['client-facing'] = False + elif network_type == NetworkTypeEnum.TE_ETH_TRAN_TOPOLOGY: + if 'ietf-eth-te-topology:eth-svc' in json_tp: + client_facing = json_tp['tp-id'] in {'200', '201'} + json_tp['ietf-eth-te-topology:eth-svc']['client-facing'] = client_facing + + # Fix value type of bandwidth + for json_if_sw_cap in json_tp_te.get('interface-switching-capability', []): + for json_max_lsp_bandwidth in json_if_sw_cap.get('max-lsp-bandwidth', []): + json_te_bw = json_max_lsp_bandwidth.get('te-bandwidth', {}) + if network_type == NetworkTypeEnum.TE_ETH_TRAN_TOPOLOGY: + if 'ietf-eth-te-topology:eth-bandwidth' in json_te_bw: + eth_bw = json_te_bw['ietf-eth-te-topology:eth-bandwidth'] + if isinstance(eth_bw, str): + json_te_bw['ietf-eth-te-topology:eth-bandwidth'] = int(eth_bw) + + for json_link in json_network.get('ietf-network-topology:link', []): + json_link_te_attributes = json_link.get('ietf-te-topology:te', {}).get('te-link-attributes', {}) + + # Fix value type of bandwidth + json_te_bw = json_link_te_attributes.get('max-link-bandwidth', {}).get('te-bandwidth', {}) + if network_type == NetworkTypeEnum.TE_ETH_TRAN_TOPOLOGY: + if 'ietf-eth-te-topology:eth-bandwidth' in json_te_bw: + eth_bw = json_te_bw['ietf-eth-te-topology:eth-bandwidth'] + if isinstance(eth_bw, str): + json_te_bw['ietf-eth-te-topology:eth-bandwidth'] = int(eth_bw) + + for json_unresv_bandwidth in json_link_te_attributes.get('unreserved-bandwidth', []): + json_te_bw = json_unresv_bandwidth.get('te-bandwidth', {}) + if 'ietf-eth-te-topology:eth-bandwidth' in json_te_bw: + eth_bw = json_te_bw['ietf-eth-te-topology:eth-bandwidth'] + if isinstance(eth_bw, str): + json_te_bw['ietf-eth-te-topology:eth-bandwidth'] = int(eth_bw) diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/NameMapping.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/NameMapping.py new file mode 100644 index 0000000000000000000000000000000000000000..f5f9ca5f8748f4ba7e835430d057cc000278fbd1 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/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. + +from typing import Dict, Tuple +from common.proto.context_pb2 import Device, DeviceId, EndPoint, EndPointId + +class NameMappings: + def __init__(self) -> None: + self._device_uuid_to_name : Dict[str, str] = dict() + self._endpoint_uuid_to_name : Dict[Tuple[str, str], str] = dict() + + def store_device_name(self, device : Device) -> None: + device_uuid = device.device_id.device_uuid.uuid + device_name = device.name + self._device_uuid_to_name[device_uuid] = device_name + self._device_uuid_to_name[device_name] = device_name + + def store_endpoint_name(self, device : Device, endpoint : EndPoint) -> None: + device_uuid = device.device_id.device_uuid.uuid + device_name = device.name + endpoint_uuid = endpoint.endpoint_id.endpoint_uuid.uuid + endpoint_name = endpoint.name + self._endpoint_uuid_to_name[(device_uuid, endpoint_uuid)] = endpoint_name + self._endpoint_uuid_to_name[(device_name, endpoint_uuid)] = endpoint_name + self._endpoint_uuid_to_name[(device_uuid, endpoint_name)] = endpoint_name + self._endpoint_uuid_to_name[(device_name, endpoint_name)] = endpoint_name + + def get_device_name(self, device_id : DeviceId) -> str: + device_uuid = device_id.device_uuid.uuid + return self._device_uuid_to_name.get(device_uuid, device_uuid) + + def get_endpoint_name(self, endpoint_id : EndPointId) -> str: + device_uuid = endpoint_id.device_id.device_uuid.uuid + endpoint_uuid = endpoint_id.endpoint_uuid.uuid + return self._endpoint_uuid_to_name.get((device_uuid, endpoint_uuid), endpoint_uuid) diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/NetworkTypeEnum.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/NetworkTypeEnum.py new file mode 100644 index 0000000000000000000000000000000000000000..62cc74219c1e0d47231db76e73f1b960f26f4abe --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/NetworkTypeEnum.py @@ -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. + +from enum import Enum +from typing import Optional + +class NetworkTypeEnum(Enum): + TE_OTN_TOPOLOGY = 'otn' + TE_ETH_TRAN_TOPOLOGY = 'eth-tran' + +def get_network_topology_type(topology_id : str) -> Optional[NetworkTypeEnum]: + return NetworkTypeEnum._value2member_map_.get(topology_id) diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/Networks.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/Networks.py new file mode 100644 index 0000000000000000000000000000000000000000..47a126ec886b2b4102aab470bcca27bc52d35ab7 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/Networks.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 json, logging +import pyangbind.lib.pybindJSON as pybindJSON +from flask import request +from flask.json import jsonify +from flask_restful import Resource +from common.Constants import DEFAULT_CONTEXT_NAME, DEFAULT_TOPOLOGY_NAME +from common.tools.context_queries.Topology import get_topology_details +from context.client.ContextClient import ContextClient +from nbi.service.rest_server.nbi_plugins.tools.Authentication import HTTP_AUTH +from nbi.service.rest_server.nbi_plugins.tools.HttpStatusCodes import HTTP_OK, HTTP_SERVERERROR +from .bindings import ietf_network +from .ComposeNetwork import compose_network +from .ManualFixes import manual_fixes + +LOGGER = logging.getLogger(__name__) + +TE_TOPOLOGY_NAMES = [ + 'providerId-10-clientId-0-topologyId-1', + 'providerId-10-clientId-0-topologyId-2' +] + +class Networks(Resource): + @HTTP_AUTH.login_required + def get(self): + LOGGER.info('Request: {:s}'.format(str(request))) + topology_id = '' + try: + context_client = ContextClient() + #target = get_slice_by_uuid(context_client, vpn_id, rw_copy=True) + #if target is None: + # raise Exception('VPN({:s}) not found in database'.format(str(vpn_id))) + + ietf_nets = ietf_network() + + topology_details = get_topology_details( + context_client, DEFAULT_TOPOLOGY_NAME, context_uuid=DEFAULT_CONTEXT_NAME, #rw_copy=True + ) + if topology_details is None: + MSG = 'Topology({:s}/{:s}) not found' + raise Exception(MSG.format(DEFAULT_CONTEXT_NAME, DEFAULT_TOPOLOGY_NAME)) + + for te_topology_name in TE_TOPOLOGY_NAMES: + ietf_net = ietf_nets.networks.network.add(te_topology_name) + compose_network(ietf_net, te_topology_name, topology_details) + + # TODO: improve these workarounds to enhance performance + json_response = json.loads(pybindJSON.dumps(ietf_nets, mode='ietf')) + + # Workaround; pyangbind does not allow to set otn_topology / eth-tran-topology + manual_fixes(json_response) + + response = jsonify(json_response) + response.status_code = HTTP_OK + except Exception as e: # pylint: disable=broad-except + LOGGER.exception('Something went wrong Retrieving Topology({:s})'.format(str(topology_id))) + response = jsonify({'error': str(e)}) + response.status_code = HTTP_SERVERERROR + return response diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/README.md b/src/nbi/service/rest_server/nbi_plugins/ietf_network/README.md new file mode 100644 index 0000000000000000000000000000000000000000..8d808a45b54efa3126c408bda97b51659b511cee --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/README.md @@ -0,0 +1,14 @@ +# IETF Network + +This NBI plugin implements a basic skeleton for the IETF Network data model. + +## DISCLAIMER +__USE WITH CARE! This plugin is NOT production ready, it contains many hardcodings based on ongoing tests.__ + +## IETF RFCs/drafts: +- RFC 8795 - YANG Data Model for Traffic Engineering (TE) Topologies (https://datatracker.ietf.org/doc/html/rfc8795) +- RFC 8776 - Common YANG Data Types for Traffic Engineering (https://datatracker.ietf.org/doc/html/rfc8776) +- RFC 8345 - A YANG Data Model for Network Topologies (https://datatracker.ietf.org/doc/html/rfc8345) +- RFC 6991 - Common YANG Data Types (https://datatracker.ietf.org/doc/html/rfc6991) +- RFC draft-ietf-ccamp-eth-client-te-topo-yang-05 - A YANG Data Model for Ethernet TE Topology (https://datatracker.ietf.org/doc/draft-ietf-ccamp-eth-client-te-topo-yang/) +- RFC draft-ietf-ccamp-client-signal-yang-10 - A YANG Data Model for Transport Network Client Signals (https://datatracker.ietf.org/doc/draft-ietf-ccamp-client-signal-yang/) diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e637c6719b927b7b53550ae68618859cf5976cc9 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/__init__.py @@ -0,0 +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. + +# RFC 8795 - YANG Data Model for Traffic Engineering (TE) Topologies +# Ref: https://datatracker.ietf.org/doc/html/rfc8795 + +# RFC 8776 - Common YANG Data Types for Traffic Engineering +# Ref: https://datatracker.ietf.org/doc/html/rfc8776 + +# RFC 8345 - A YANG Data Model for Network Topologies +# Ref: https://datatracker.ietf.org/doc/html/rfc8345 + +# RFC 6991 - Common YANG Data Types +# Ref: https://datatracker.ietf.org/doc/html/rfc6991 + +# RFC draft-ietf-ccamp-eth-client-te-topo-yang-05 - A YANG Data Model for Ethernet TE Topology +# Ref: https://datatracker.ietf.org/doc/draft-ietf-ccamp-eth-client-te-topo-yang/ + +# RFC draft-ietf-ccamp-client-signal-yang-10 - A YANG Data Model for Transport Network Client Signals +# Ref: https://datatracker.ietf.org/doc/draft-ietf-ccamp-client-signal-yang/ + +from flask_restful import Resource +from nbi.service.rest_server.RestServer import RestServer +from .Networks import Networks + +URL_PREFIX = '/restconf/data/ietf-network:networks' + +def _add_resource(rest_server : RestServer, resource : Resource, *urls, **kwargs): + urls = [(URL_PREFIX + url) for url in urls] + rest_server.add_resource(resource, *urls, **kwargs) + +def register_ietf_network(rest_server : RestServer): + _add_resource(rest_server, Networks, '/') diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/_docs/test_commands.txt b/src/nbi/service/rest_server/nbi_plugins/ietf_network/_docs/test_commands.txt new file mode 100644 index 0000000000000000000000000000000000000000..78b2dd24686b6dbecae67cf09bef38f38b97d401 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/_docs/test_commands.txt @@ -0,0 +1,26 @@ +cd ~/tfs-ctrl/src/nbi/service/rest_server/nbi_plugins/ietf_network + +python + +from bindings import ietf_network +import pyangbind.lib.pybindJSON as pybindJSON + +ietf_nets_obj = ietf_network() +ietf_net_obj = ietf_nets_obj.networks.network.add('my-topo') + +ietf_node_obj = ietf_net_obj.node.add('my-node') +ietf_tp_obj = ietf_node_obj.termination_point.add('my-tp') + +ietf_link_obj = ietf_net_obj.link.add('my-link') + +ietf_link_obj.te._set_oper_status('up') +print(pybindJSON.dumps(ietf_nets_obj, mode='ietf')) + +ietf_link_obj.te.te_link_attributes.admin_status = 'down' +print(pybindJSON.dumps(ietf_nets_obj, mode='ietf')) + + +ietf_link_obj.te.te_link_attributes.max_link_bandwidth.te_bandwidth.eth_bandwidth = 10_000_000 # Kbps +unresv_bw = ietf_link_obj.te.te_link_attributes.unreserved_bandwidth.add(7) +unresv_bw.te_bandwidth.eth_bandwidth = 10_000_000 # Kbps +print(pybindJSON.dumps(ietf_link_obj, mode='ietf')) diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..6df50e1a6aff3868ecb25323b33f4b48bf92901f --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/__init__.py @@ -0,0 +1,256 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 ietf_network_topology(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network-topology - based on the path /ietf-network-topology. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: This module defines a common base model for a network topology, +augmenting the base network data model with links to connect +nodes, as well as termination points to terminate links +on nodes. + +Copyright (c) 2018 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 +(https://trustee.ietf.org/license-info). + +This version of this YANG module is part of RFC 8345; +see the RFC itself for full legal notices. + """ + _pyangbind_elements = {} + + + +from . import networks +class ietf_network(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /ietf-network. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: This module defines a common base data model for a collection +of nodes in a network. Node definitions are further used +in network topologies and inventories. + +Copyright (c) 2018 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 +(https://trustee.ietf.org/license-info). + +This version of this YANG module is part of RFC 8345; +see the RFC itself for full legal notices. + """ + __slots__ = ('_path_helper', '_extmethods', '__networks',) + + _yang_name = 'ietf-network' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__networks = YANGDynClass(base=networks.networks, is_container='container', yang_name="networks", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-network', defining_module='ietf-network', 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_networks(self): + """ + Getter method for networks, mapped from YANG variable /networks (container) + + YANG Description: Serves as a top-level container for a list of networks. + """ + return self.__networks + + def _set_networks(self, v, load=False): + """ + Setter method for networks, mapped from YANG variable /networks (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_networks is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_networks() directly. + + YANG Description: Serves as a top-level container for a list of networks. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=networks.networks, is_container='container', yang_name="networks", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-network', defining_module='ietf-network', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """networks must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=networks.networks, is_container='container', yang_name="networks", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-network', defining_module='ietf-network', yang_type='container', is_config=True)""", + }) + + self.__networks = t + if hasattr(self, '_set'): + self._set() + + def _unset_networks(self): + self.__networks = YANGDynClass(base=networks.networks, is_container='container', yang_name="networks", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-network', defining_module='ietf-network', yang_type='container', is_config=True) + + networks = __builtin__.property(_get_networks, _set_networks) + + + _pyangbind_elements = OrderedDict([('networks', networks), ]) + + +class ietf_te_topology(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-te-topology - based on the path /ietf-te-topology. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: This YANG module defines a TE topology model for representing, +retrieving, and manipulating technology-agnostic TE topologies. + +Copyright (c) 2020 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 +(https://trustee.ietf.org/license-info). + +This version of this YANG module is part of RFC 8795; see the +RFC itself for full legal notices. + """ + _pyangbind_elements = {} + + + +class ietf_otn_topology(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-otn-topology - based on the path /ietf-otn-topology. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: This module defines a protocol independent Layer 1/ODU topology +data model. The model fully conforms +to the Network Management Datastore Architecture (NMDA). + +Copyright (c) 2023 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. + +The key words 'MUST', 'MUST NOT', 'REQUIRED', 'SHALL', 'SHALL +NOT', 'SHOULD', 'SHOULD NOT', 'RECOMMENDED', 'NOT RECOMMENDED', +'MAY', and 'OPTIONAL' in this document are to be interpreted as +described in BCP 14 (RFC 2119) (RFC 8174) when, and only when, +they appear in all capitals, as shown here. + """ + _pyangbind_elements = {} + + + +class ietf_eth_te_topology(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-eth-te-topology - based on the path /ietf-eth-te-topology. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: This module defines a YANG data model for describing +layer-2 Ethernet transport topologies. The model fully +conforms to the Network Management Datastore +Architecture (NMDA). + +Copyright (c) 2023 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. + +The key words 'MUST', 'MUST NOT', 'REQUIRED', 'SHALL', 'SHALL +NOT', 'SHOULD', 'SHOULD NOT', 'RECOMMENDED', 'NOT RECOMMENDED', +'MAY', and 'OPTIONAL' in this document are to be interpreted as +described in BCP 14 (RFC 2119) (RFC 8174) when, and only when, +they appear in all capitals, as shown here. + """ + _pyangbind_elements = {} + + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..0c52044ebfd602a81ac0b8be69eed96d15fd9261 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/__init__.py @@ -0,0 +1,162 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 network +from . import te +class networks(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Serves as a top-level container for a list of networks. + """ + __slots__ = ('_path_helper', '_extmethods', '__network','__te',) + + _yang_name = 'networks' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__network = YANGDynClass(base=YANGListType("network_id",network.network, yang_name="network", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='network-id', extensions=None), is_container='list', yang_name="network", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-network', defining_module='ietf-network', yang_type='list', is_config=True) + self.__te = YANGDynClass(base=te.te, is_container='container', yang_name="te", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-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 ['networks'] + + def _get_network(self): + """ + Getter method for network, mapped from YANG variable /networks/network (list) + + YANG Description: Describes a network. +A network typically contains an inventory of nodes, +topological information (augmented through the +network-topology data model), and layering information. + """ + return self.__network + + def _set_network(self, v, load=False): + """ + Setter method for network, mapped from YANG variable /networks/network (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_network is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_network() directly. + + YANG Description: Describes a network. +A network typically contains an inventory of nodes, +topological information (augmented through the +network-topology data model), and layering information. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("network_id",network.network, yang_name="network", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='network-id', extensions=None), is_container='list', yang_name="network", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-network', defining_module='ietf-network', yang_type='list', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """network must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("network_id",network.network, yang_name="network", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='network-id', extensions=None), is_container='list', yang_name="network", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-network', defining_module='ietf-network', yang_type='list', is_config=True)""", + }) + + self.__network = t + if hasattr(self, '_set'): + self._set() + + def _unset_network(self): + self.__network = YANGDynClass(base=YANGListType("network_id",network.network, yang_name="network", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='network-id', extensions=None), is_container='list', yang_name="network", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-network', defining_module='ietf-network', yang_type='list', is_config=True) + + + def _get_te(self): + """ + Getter method for te, mapped from YANG variable /networks/te (container) + + YANG Description: Indicates TE support. + """ + return self.__te + + def _set_te(self, v, load=False): + """ + Setter method for te, mapped from YANG variable /networks/te (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_te is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_te() directly. + + YANG Description: Indicates TE support. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=te.te, is_container='container', yang_name="te", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """te must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=te.te, is_container='container', yang_name="te", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__te = t + if hasattr(self, '_set'): + self._set() + + def _unset_te(self): + self.__te = YANGDynClass(base=te.te, is_container='container', yang_name="te", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + network = __builtin__.property(_get_network, _set_network) + te = __builtin__.property(_get_te, _set_te) + + + _pyangbind_elements = OrderedDict([('network', network), ('te', te), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..302af85c96e588326bdbef9c9c796da1c6998c16 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/__init__.py @@ -0,0 +1,385 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 network_types +from . import supporting_network +from . import node +from . import link +from . import te_topology_identifier +from . import te +class network(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Describes a network. +A network typically contains an inventory of nodes, +topological information (augmented through the +network-topology data model), and layering information. + """ + __slots__ = ('_path_helper', '_extmethods', '__network_id','__network_types','__supporting_network','__node','__link','__te_topology_identifier','__te',) + + _yang_name = 'network' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__network_id = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="network-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-network', defining_module='ietf-network', yang_type='network-id', is_config=True) + self.__network_types = YANGDynClass(base=network_types.network_types, is_container='container', yang_name="network-types", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-network', defining_module='ietf-network', yang_type='container', is_config=True) + self.__supporting_network = YANGDynClass(base=YANGListType("network_ref",supporting_network.supporting_network, yang_name="supporting-network", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='network-ref', extensions=None), is_container='list', yang_name="supporting-network", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-network', defining_module='ietf-network', yang_type='list', is_config=True) + self.__node = YANGDynClass(base=YANGListType("node_id",node.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:ietf:params:xml:ns:yang:ietf-network', defining_module='ietf-network', yang_type='list', is_config=True) + self.__link = YANGDynClass(base=YANGListType("link_id",link.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:ietf:params:xml:ns:yang:ietf-network-topology', defining_module='ietf-network-topology', yang_type='list', is_config=True) + self.__te_topology_identifier = YANGDynClass(base=te_topology_identifier.te_topology_identifier, is_container='container', yang_name="te-topology-identifier", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__te = YANGDynClass(base=te.te, is_container='container', yang_name="te", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-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 ['networks', 'network'] + + def _get_network_id(self): + """ + Getter method for network_id, mapped from YANG variable /networks/network/network_id (network-id) + + YANG Description: Identifies a network. + """ + return self.__network_id + + def _set_network_id(self, v, load=False): + """ + Setter method for network_id, mapped from YANG variable /networks/network/network_id (network-id) + If this variable is read-only (config: false) in the + source YANG file, then _set_network_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_network_id() directly. + + YANG Description: Identifies a network. + """ + 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="network-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-network', defining_module='ietf-network', yang_type='network-id', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """network_id must be of a type compatible with network-id""", + 'defined-type': "ietf-network:network-id", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="network-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-network', defining_module='ietf-network', yang_type='network-id', is_config=True)""", + }) + + self.__network_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_network_id(self): + self.__network_id = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="network-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-network', defining_module='ietf-network', yang_type='network-id', is_config=True) + + + def _get_network_types(self): + """ + Getter method for network_types, mapped from YANG variable /networks/network/network_types (container) + + YANG Description: Serves as an augmentation target. +The network type is indicated through corresponding +presence containers augmented into this container. + """ + return self.__network_types + + def _set_network_types(self, v, load=False): + """ + Setter method for network_types, mapped from YANG variable /networks/network/network_types (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_network_types is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_network_types() directly. + + YANG Description: Serves as an augmentation target. +The network type is indicated through corresponding +presence containers augmented into this container. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=network_types.network_types, is_container='container', yang_name="network-types", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-network', defining_module='ietf-network', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """network_types must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=network_types.network_types, is_container='container', yang_name="network-types", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-network', defining_module='ietf-network', yang_type='container', is_config=True)""", + }) + + self.__network_types = t + if hasattr(self, '_set'): + self._set() + + def _unset_network_types(self): + self.__network_types = YANGDynClass(base=network_types.network_types, is_container='container', yang_name="network-types", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-network', defining_module='ietf-network', yang_type='container', is_config=True) + + + def _get_supporting_network(self): + """ + Getter method for supporting_network, mapped from YANG variable /networks/network/supporting_network (list) + + YANG Description: An underlay network, used to represent layered network +topologies. + """ + return self.__supporting_network + + def _set_supporting_network(self, v, load=False): + """ + Setter method for supporting_network, mapped from YANG variable /networks/network/supporting_network (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_supporting_network is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_supporting_network() directly. + + YANG Description: An underlay network, used to represent layered network +topologies. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("network_ref",supporting_network.supporting_network, yang_name="supporting-network", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='network-ref', extensions=None), is_container='list', yang_name="supporting-network", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-network', defining_module='ietf-network', yang_type='list', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """supporting_network must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("network_ref",supporting_network.supporting_network, yang_name="supporting-network", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='network-ref', extensions=None), is_container='list', yang_name="supporting-network", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-network', defining_module='ietf-network', yang_type='list', is_config=True)""", + }) + + self.__supporting_network = t + if hasattr(self, '_set'): + self._set() + + def _unset_supporting_network(self): + self.__supporting_network = YANGDynClass(base=YANGListType("network_ref",supporting_network.supporting_network, yang_name="supporting-network", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='network-ref', extensions=None), is_container='list', yang_name="supporting-network", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-network', defining_module='ietf-network', yang_type='list', is_config=True) + + + def _get_node(self): + """ + Getter method for node, mapped from YANG variable /networks/network/node (list) + + YANG Description: The inventory of nodes of this network. + """ + return self.__node + + def _set_node(self, v, load=False): + """ + Setter method for node, mapped from YANG variable /networks/network/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. + + YANG Description: The inventory of nodes of this network. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("node_id",node.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:ietf:params:xml:ns:yang:ietf-network', defining_module='ietf-network', 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",node.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:ietf:params:xml:ns:yang:ietf-network', defining_module='ietf-network', 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",node.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:ietf:params:xml:ns:yang:ietf-network', defining_module='ietf-network', yang_type='list', is_config=True) + + + def _get_link(self): + """ + Getter method for link, mapped from YANG variable /networks/network/link (list) + + YANG Description: A network link connects a local (source) node and +a remote (destination) node via a set of the respective +node's termination points. It is possible to have several +links between the same source and destination nodes. +Likewise, a link could potentially be re-homed between +termination points. Therefore, in order to ensure that we +would always know to distinguish between links, every link +is identified by a dedicated link identifier. Note that a +link models a point-to-point link, not a multipoint link. + """ + return self.__link + + def _set_link(self, v, load=False): + """ + Setter method for link, mapped from YANG variable /networks/network/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. + + YANG Description: A network link connects a local (source) node and +a remote (destination) node via a set of the respective +node's termination points. It is possible to have several +links between the same source and destination nodes. +Likewise, a link could potentially be re-homed between +termination points. Therefore, in order to ensure that we +would always know to distinguish between links, every link +is identified by a dedicated link identifier. Note that a +link models a point-to-point link, not a multipoint link. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("link_id",link.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:ietf:params:xml:ns:yang:ietf-network-topology', defining_module='ietf-network-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",link.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:ietf:params:xml:ns:yang:ietf-network-topology', defining_module='ietf-network-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",link.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:ietf:params:xml:ns:yang:ietf-network-topology', defining_module='ietf-network-topology', yang_type='list', is_config=True) + + + def _get_te_topology_identifier(self): + """ + Getter method for te_topology_identifier, mapped from YANG variable /networks/network/te_topology_identifier (container) + + YANG Description: TE topology identifier container. + """ + return self.__te_topology_identifier + + def _set_te_topology_identifier(self, v, load=False): + """ + Setter method for te_topology_identifier, mapped from YANG variable /networks/network/te_topology_identifier (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_te_topology_identifier is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_te_topology_identifier() directly. + + YANG Description: TE topology identifier container. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=te_topology_identifier.te_topology_identifier, is_container='container', yang_name="te-topology-identifier", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """te_topology_identifier must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=te_topology_identifier.te_topology_identifier, is_container='container', yang_name="te-topology-identifier", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__te_topology_identifier = t + if hasattr(self, '_set'): + self._set() + + def _unset_te_topology_identifier(self): + self.__te_topology_identifier = YANGDynClass(base=te_topology_identifier.te_topology_identifier, is_container='container', yang_name="te-topology-identifier", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_te(self): + """ + Getter method for te, mapped from YANG variable /networks/network/te (container) + + YANG Description: Indicates TE support. + """ + return self.__te + + def _set_te(self, v, load=False): + """ + Setter method for te, mapped from YANG variable /networks/network/te (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_te is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_te() directly. + + YANG Description: Indicates TE support. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=te.te, is_container='container', yang_name="te", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """te must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=te.te, is_container='container', yang_name="te", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__te = t + if hasattr(self, '_set'): + self._set() + + def _unset_te(self): + self.__te = YANGDynClass(base=te.te, is_container='container', yang_name="te", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + network_id = __builtin__.property(_get_network_id, _set_network_id) + network_types = __builtin__.property(_get_network_types, _set_network_types) + supporting_network = __builtin__.property(_get_supporting_network, _set_supporting_network) + node = __builtin__.property(_get_node, _set_node) + link = __builtin__.property(_get_link, _set_link) + te_topology_identifier = __builtin__.property(_get_te_topology_identifier, _set_te_topology_identifier) + te = __builtin__.property(_get_te, _set_te) + + + _pyangbind_elements = OrderedDict([('network_id', network_id), ('network_types', network_types), ('supporting_network', supporting_network), ('node', node), ('link', link), ('te_topology_identifier', te_topology_identifier), ('te', te), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..91937b156636c7db81427131959b4bc1ca33201c --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/__init__.py @@ -0,0 +1,294 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 source +from . import destination +from . import supporting_link +from . import te +class link(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/link. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: A network link connects a local (source) node and +a remote (destination) node via a set of the respective +node's termination points. It is possible to have several +links between the same source and destination nodes. +Likewise, a link could potentially be re-homed between +termination points. Therefore, in order to ensure that we +would always know to distinguish between links, every link +is identified by a dedicated link identifier. Note that a +link models a point-to-point link, not a multipoint link. + """ + __slots__ = ('_path_helper', '_extmethods', '__link_id','__source','__destination','__supporting_link','__te',) + + _yang_name = 'link' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _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:ietf:params:xml:ns:yang:ietf-network-topology', defining_module='ietf-network-topology', yang_type='link-id', is_config=True) + self.__source = YANGDynClass(base=source.source, is_container='container', yang_name="source", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-network-topology', defining_module='ietf-network-topology', yang_type='container', is_config=True) + self.__destination = YANGDynClass(base=destination.destination, is_container='container', yang_name="destination", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-network-topology', defining_module='ietf-network-topology', yang_type='container', is_config=True) + self.__supporting_link = YANGDynClass(base=YANGListType("network_ref link_ref",supporting_link.supporting_link, yang_name="supporting-link", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='network-ref link-ref', extensions=None), is_container='list', yang_name="supporting-link", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-network-topology', defining_module='ietf-network-topology', yang_type='list', is_config=True) + self.__te = YANGDynClass(base=te.te, is_container='container', yang_name="te", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-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 ['networks', 'network', 'link'] + + def _get_link_id(self): + """ + Getter method for link_id, mapped from YANG variable /networks/network/link/link_id (link-id) + + YANG Description: The identifier of a link in the topology. +A link is specific to a topology to which it belongs. + """ + return self.__link_id + + def _set_link_id(self, v, load=False): + """ + Setter method for link_id, mapped from YANG variable /networks/network/link/link_id (link-id) + 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. + + YANG Description: The identifier of a link in the topology. +A link is specific to a topology to which it belongs. + """ + 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:ietf:params:xml:ns:yang:ietf-network-topology', defining_module='ietf-network-topology', yang_type='link-id', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """link_id must be of a type compatible with link-id""", + 'defined-type': "ietf-network-topology:link-id", + '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:ietf:params:xml:ns:yang:ietf-network-topology', defining_module='ietf-network-topology', yang_type='link-id', 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:ietf:params:xml:ns:yang:ietf-network-topology', defining_module='ietf-network-topology', yang_type='link-id', is_config=True) + + + def _get_source(self): + """ + Getter method for source, mapped from YANG variable /networks/network/link/source (container) + + YANG Description: This container holds the logical source of a particular +link. + """ + return self.__source + + def _set_source(self, v, load=False): + """ + Setter method for source, mapped from YANG variable /networks/network/link/source (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_source is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_source() directly. + + YANG Description: This container holds the logical source of a particular +link. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=source.source, is_container='container', yang_name="source", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-network-topology', defining_module='ietf-network-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """source must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=source.source, is_container='container', yang_name="source", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-network-topology', defining_module='ietf-network-topology', yang_type='container', is_config=True)""", + }) + + self.__source = t + if hasattr(self, '_set'): + self._set() + + def _unset_source(self): + self.__source = YANGDynClass(base=source.source, is_container='container', yang_name="source", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-network-topology', defining_module='ietf-network-topology', yang_type='container', is_config=True) + + + def _get_destination(self): + """ + Getter method for destination, mapped from YANG variable /networks/network/link/destination (container) + + YANG Description: This container holds the logical destination of a +particular link. + """ + return self.__destination + + def _set_destination(self, v, load=False): + """ + Setter method for destination, mapped from YANG variable /networks/network/link/destination (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_destination is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_destination() directly. + + YANG Description: This container holds the logical destination of a +particular link. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=destination.destination, is_container='container', yang_name="destination", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-network-topology', defining_module='ietf-network-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """destination must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=destination.destination, is_container='container', yang_name="destination", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-network-topology', defining_module='ietf-network-topology', yang_type='container', is_config=True)""", + }) + + self.__destination = t + if hasattr(self, '_set'): + self._set() + + def _unset_destination(self): + self.__destination = YANGDynClass(base=destination.destination, is_container='container', yang_name="destination", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-network-topology', defining_module='ietf-network-topology', yang_type='container', is_config=True) + + + def _get_supporting_link(self): + """ + Getter method for supporting_link, mapped from YANG variable /networks/network/link/supporting_link (list) + + YANG Description: Identifies the link or links on which this link depends. + """ + return self.__supporting_link + + def _set_supporting_link(self, v, load=False): + """ + Setter method for supporting_link, mapped from YANG variable /networks/network/link/supporting_link (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_supporting_link is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_supporting_link() directly. + + YANG Description: Identifies the link or links on which this link depends. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("network_ref link_ref",supporting_link.supporting_link, yang_name="supporting-link", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='network-ref link-ref', extensions=None), is_container='list', yang_name="supporting-link", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-network-topology', defining_module='ietf-network-topology', yang_type='list', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """supporting_link must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("network_ref link_ref",supporting_link.supporting_link, yang_name="supporting-link", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='network-ref link-ref', extensions=None), is_container='list', yang_name="supporting-link", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-network-topology', defining_module='ietf-network-topology', yang_type='list', is_config=True)""", + }) + + self.__supporting_link = t + if hasattr(self, '_set'): + self._set() + + def _unset_supporting_link(self): + self.__supporting_link = YANGDynClass(base=YANGListType("network_ref link_ref",supporting_link.supporting_link, yang_name="supporting-link", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='network-ref link-ref', extensions=None), is_container='list', yang_name="supporting-link", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-network-topology', defining_module='ietf-network-topology', yang_type='list', is_config=True) + + + def _get_te(self): + """ + Getter method for te, mapped from YANG variable /networks/network/link/te (container) + + YANG Description: Indicates TE support. + """ + return self.__te + + def _set_te(self, v, load=False): + """ + Setter method for te, mapped from YANG variable /networks/network/link/te (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_te is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_te() directly. + + YANG Description: Indicates TE support. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=te.te, is_container='container', yang_name="te", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """te must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=te.te, is_container='container', yang_name="te", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__te = t + if hasattr(self, '_set'): + self._set() + + def _unset_te(self): + self.__te = YANGDynClass(base=te.te, is_container='container', yang_name="te", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + link_id = __builtin__.property(_get_link_id, _set_link_id) + source = __builtin__.property(_get_source, _set_source) + destination = __builtin__.property(_get_destination, _set_destination) + supporting_link = __builtin__.property(_get_supporting_link, _set_supporting_link) + te = __builtin__.property(_get_te, _set_te) + + + _pyangbind_elements = OrderedDict([('link_id', link_id), ('source', source), ('destination', destination), ('supporting_link', supporting_link), ('te', te), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/destination/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/destination/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..ddab21c3e6976fac05cbe57124d8e58cc506539e --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/destination/__init__.py @@ -0,0 +1,159 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 destination(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/link/destination. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: This container holds the logical destination of a +particular link. + """ + __slots__ = ('_path_helper', '_extmethods', '__dest_node','__dest_tp',) + + _yang_name = 'destination' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__dest_node = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="dest-node", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-network-topology', defining_module='ietf-network-topology', yang_type='leafref', is_config=True) + self.__dest_tp = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="dest-tp", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-network-topology', defining_module='ietf-network-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 ['networks', 'network', 'link', 'destination'] + + def _get_dest_node(self): + """ + Getter method for dest_node, mapped from YANG variable /networks/network/link/destination/dest_node (leafref) + + YANG Description: Destination node identifier. Must be in the same +network. + """ + return self.__dest_node + + def _set_dest_node(self, v, load=False): + """ + Setter method for dest_node, mapped from YANG variable /networks/network/link/destination/dest_node (leafref) + If this variable is read-only (config: false) in the + source YANG file, then _set_dest_node is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_dest_node() directly. + + YANG Description: Destination node identifier. Must be in the same +network. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="dest-node", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-network-topology', defining_module='ietf-network-topology', yang_type='leafref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """dest_node must be of a type compatible with leafref""", + 'defined-type': "leafref", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="dest-node", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-network-topology', defining_module='ietf-network-topology', yang_type='leafref', is_config=True)""", + }) + + self.__dest_node = t + if hasattr(self, '_set'): + self._set() + + def _unset_dest_node(self): + self.__dest_node = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="dest-node", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-network-topology', defining_module='ietf-network-topology', yang_type='leafref', is_config=True) + + + def _get_dest_tp(self): + """ + Getter method for dest_tp, mapped from YANG variable /networks/network/link/destination/dest_tp (leafref) + + YANG Description: This termination point is located within the +destination node and terminates the link. + """ + return self.__dest_tp + + def _set_dest_tp(self, v, load=False): + """ + Setter method for dest_tp, mapped from YANG variable /networks/network/link/destination/dest_tp (leafref) + If this variable is read-only (config: false) in the + source YANG file, then _set_dest_tp is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_dest_tp() directly. + + YANG Description: This termination point is located within the +destination node and terminates the link. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="dest-tp", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-network-topology', defining_module='ietf-network-topology', yang_type='leafref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """dest_tp must be of a type compatible with leafref""", + 'defined-type': "leafref", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="dest-tp", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-network-topology', defining_module='ietf-network-topology', yang_type='leafref', is_config=True)""", + }) + + self.__dest_tp = t + if hasattr(self, '_set'): + self._set() + + def _unset_dest_tp(self): + self.__dest_tp = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="dest-tp", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-network-topology', defining_module='ietf-network-topology', yang_type='leafref', is_config=True) + + dest_node = __builtin__.property(_get_dest_node, _set_dest_node) + dest_tp = __builtin__.property(_get_dest_tp, _set_dest_tp) + + + _pyangbind_elements = OrderedDict([('dest_node', dest_node), ('dest_tp', dest_tp), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/source/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/source/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..7538dfd44c5128d120b01b5018d9dd59cb97609c --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/source/__init__.py @@ -0,0 +1,157 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 source(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/link/source. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: This container holds the logical source of a particular +link. + """ + __slots__ = ('_path_helper', '_extmethods', '__source_node','__source_tp',) + + _yang_name = 'source' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + 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:ietf:params:xml:ns:yang:ietf-network-topology', defining_module='ietf-network-topology', yang_type='leafref', is_config=True) + self.__source_tp = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="source-tp", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-network-topology', defining_module='ietf-network-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 ['networks', 'network', 'link', 'source'] + + def _get_source_node(self): + """ + Getter method for source_node, mapped from YANG variable /networks/network/link/source/source_node (leafref) + + YANG Description: Source node identifier. Must be in the same topology. + """ + return self.__source_node + + def _set_source_node(self, v, load=False): + """ + Setter method for source_node, mapped from YANG variable /networks/network/link/source/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. + + YANG Description: Source node identifier. Must be in the same topology. + """ + 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:ietf:params:xml:ns:yang:ietf-network-topology', defining_module='ietf-network-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:ietf:params:xml:ns:yang:ietf-network-topology', defining_module='ietf-network-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:ietf:params:xml:ns:yang:ietf-network-topology', defining_module='ietf-network-topology', yang_type='leafref', is_config=True) + + + def _get_source_tp(self): + """ + Getter method for source_tp, mapped from YANG variable /networks/network/link/source/source_tp (leafref) + + YANG Description: This termination point is located within the source node +and terminates the link. + """ + return self.__source_tp + + def _set_source_tp(self, v, load=False): + """ + Setter method for source_tp, mapped from YANG variable /networks/network/link/source/source_tp (leafref) + If this variable is read-only (config: false) in the + source YANG file, then _set_source_tp is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_source_tp() directly. + + YANG Description: This termination point is located within the source node +and terminates the link. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="source-tp", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-network-topology', defining_module='ietf-network-topology', yang_type='leafref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """source_tp must be of a type compatible with leafref""", + 'defined-type': "leafref", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="source-tp", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-network-topology', defining_module='ietf-network-topology', yang_type='leafref', is_config=True)""", + }) + + self.__source_tp = t + if hasattr(self, '_set'): + self._set() + + def _unset_source_tp(self): + self.__source_tp = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="source-tp", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-network-topology', defining_module='ietf-network-topology', yang_type='leafref', is_config=True) + + source_node = __builtin__.property(_get_source_node, _set_source_node) + source_tp = __builtin__.property(_get_source_tp, _set_source_tp) + + + _pyangbind_elements = OrderedDict([('source_node', source_node), ('source_tp', source_tp), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/supporting_link/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/supporting_link/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..28a780f5f61dfda6d026768a54c11b75e3d7fdb3 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/supporting_link/__init__.py @@ -0,0 +1,172 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 supporting_link(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/link/supporting-link. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Identifies the link or links on which this link depends. + """ + __slots__ = ('_path_helper', '_extmethods', '__network_ref','__link_ref',) + + _yang_name = 'supporting-link' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__network_ref = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="network-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-network-topology', defining_module='ietf-network-topology', yang_type='leafref', is_config=True) + self.__link_ref = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="link-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-network-topology', defining_module='ietf-network-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 ['networks', 'network', 'link', 'supporting-link'] + + def _get_network_ref(self): + """ + Getter method for network_ref, mapped from YANG variable /networks/network/link/supporting_link/network_ref (leafref) + + YANG Description: This leaf identifies in which underlay topology +the supporting link is present. + """ + return self.__network_ref + + def _set_network_ref(self, v, load=False): + """ + Setter method for network_ref, mapped from YANG variable /networks/network/link/supporting_link/network_ref (leafref) + If this variable is read-only (config: false) in the + source YANG file, then _set_network_ref is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_network_ref() directly. + + YANG Description: This leaf identifies in which underlay topology +the supporting link is present. + """ + 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="network-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-network-topology', defining_module='ietf-network-topology', yang_type='leafref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """network_ref must be of a type compatible with leafref""", + 'defined-type': "leafref", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="network-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-network-topology', defining_module='ietf-network-topology', yang_type='leafref', is_config=True)""", + }) + + self.__network_ref = t + if hasattr(self, '_set'): + self._set() + + def _unset_network_ref(self): + self.__network_ref = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="network-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-network-topology', defining_module='ietf-network-topology', yang_type='leafref', is_config=True) + + + def _get_link_ref(self): + """ + Getter method for link_ref, mapped from YANG variable /networks/network/link/supporting_link/link_ref (leafref) + + YANG Description: This leaf identifies a link that is a part +of this link's underlay. Reference loops in which +a link identifies itself as its underlay, either +directly or transitively, are not allowed. + """ + return self.__link_ref + + def _set_link_ref(self, v, load=False): + """ + Setter method for link_ref, mapped from YANG variable /networks/network/link/supporting_link/link_ref (leafref) + If this variable is read-only (config: false) in the + source YANG file, then _set_link_ref is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_link_ref() directly. + + YANG Description: This leaf identifies a link that is a part +of this link's underlay. Reference loops in which +a link identifies itself as its underlay, either +directly or transitively, are not allowed. + """ + 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-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-network-topology', defining_module='ietf-network-topology', yang_type='leafref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """link_ref must be of a type compatible with leafref""", + 'defined-type': "leafref", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="link-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-network-topology', defining_module='ietf-network-topology', yang_type='leafref', is_config=True)""", + }) + + self.__link_ref = t + if hasattr(self, '_set'): + self._set() + + def _unset_link_ref(self): + self.__link_ref = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="link-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-network-topology', defining_module='ietf-network-topology', yang_type='leafref', is_config=True) + + network_ref = __builtin__.property(_get_network_ref, _set_network_ref) + link_ref = __builtin__.property(_get_link_ref, _set_link_ref) + + + _pyangbind_elements = OrderedDict([('network_ref', network_ref), ('link_ref', link_ref), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..666d9718184c72f0d99ec5ed6e28adf8eed72cf4 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/__init__.py @@ -0,0 +1,603 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 bundled_links +from . import component_links +from . import te_link_attributes +from . import information_source_state +from . import information_source_entry +from . import recovery +from . import underlay +from . import statistics +class te(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/link/te. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Indicates TE support. + """ + __slots__ = ('_path_helper', '_extmethods', '__bundled_links','__component_links','__te_link_template','__te_link_attributes','__oper_status','__is_transitional','__information_source','__information_source_instance','__information_source_state','__information_source_entry','__recovery','__underlay','__statistics',) + + _yang_name = 'te' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__bundled_links = YANGDynClass(base=bundled_links.bundled_links, is_container='container', yang_name="bundled-links", parent=self, choice=('bundle-stack-level', 'bundle'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__component_links = YANGDynClass(base=component_links.component_links, is_container='container', yang_name="component-links", parent=self, choice=('bundle-stack-level', 'component'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__te_link_template = YANGDynClass(unique=True, base=TypedListType(allowed_type=six.text_type), is_leaf=False, yang_name="te-link-template", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=True) + self.__te_link_attributes = YANGDynClass(base=te_link_attributes.te_link_attributes, is_container='container', yang_name="te-link-attributes", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__oper_status = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'up': {}, 'down': {}, 'testing': {}, 'preparing-maintenance': {}, 'maintenance': {}, 'unknown': {}},), is_leaf=True, yang_name="oper-status", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-types:te-oper-status', is_config=False) + self.__is_transitional = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="is-transitional", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='empty', is_config=False) + self.__information_source = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'unknown': {}, 'locally-configured': {}, 'ospfv2': {}, 'ospfv3': {}, 'isis': {}, 'bgp-ls': {}, 'system-processed': {}, 'other': {}},), is_leaf=True, yang_name="information-source", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-info-source', is_config=False) + self.__information_source_instance = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="information-source-instance", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=False) + self.__information_source_state = YANGDynClass(base=information_source_state.information_source_state, is_container='container', yang_name="information-source-state", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__information_source_entry = YANGDynClass(base=YANGListType("information_source information_source_instance",information_source_entry.information_source_entry, yang_name="information-source-entry", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='information-source information-source-instance', extensions=None), is_container='list', yang_name="information-source-entry", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + self.__recovery = YANGDynClass(base=recovery.recovery, is_container='container', yang_name="recovery", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__underlay = YANGDynClass(base=underlay.underlay, is_container='container', yang_name="underlay", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__statistics = YANGDynClass(base=statistics.statistics, is_container='container', yang_name="statistics", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', 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 ['networks', 'network', 'link', 'te'] + + def _get_bundled_links(self): + """ + Getter method for bundled_links, mapped from YANG variable /networks/network/link/te/bundled_links (container) + + YANG Description: A set of bundled links. + """ + return self.__bundled_links + + def _set_bundled_links(self, v, load=False): + """ + Setter method for bundled_links, mapped from YANG variable /networks/network/link/te/bundled_links (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_bundled_links is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_bundled_links() directly. + + YANG Description: A set of bundled links. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=bundled_links.bundled_links, is_container='container', yang_name="bundled-links", parent=self, choice=('bundle-stack-level', 'bundle'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """bundled_links must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=bundled_links.bundled_links, is_container='container', yang_name="bundled-links", parent=self, choice=('bundle-stack-level', 'bundle'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__bundled_links = t + if hasattr(self, '_set'): + self._set() + + def _unset_bundled_links(self): + self.__bundled_links = YANGDynClass(base=bundled_links.bundled_links, is_container='container', yang_name="bundled-links", parent=self, choice=('bundle-stack-level', 'bundle'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_component_links(self): + """ + Getter method for component_links, mapped from YANG variable /networks/network/link/te/component_links (container) + + YANG Description: A set of component links. + """ + return self.__component_links + + def _set_component_links(self, v, load=False): + """ + Setter method for component_links, mapped from YANG variable /networks/network/link/te/component_links (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_component_links is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_component_links() directly. + + YANG Description: A set of component links. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=component_links.component_links, is_container='container', yang_name="component-links", parent=self, choice=('bundle-stack-level', 'component'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """component_links must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=component_links.component_links, is_container='container', yang_name="component-links", parent=self, choice=('bundle-stack-level', 'component'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__component_links = t + if hasattr(self, '_set'): + self._set() + + def _unset_component_links(self): + self.__component_links = YANGDynClass(base=component_links.component_links, is_container='container', yang_name="component-links", parent=self, choice=('bundle-stack-level', 'component'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_te_link_template(self): + """ + Getter method for te_link_template, mapped from YANG variable /networks/network/link/te/te_link_template (leafref) + + YANG Description: The reference to a TE link template. + """ + return self.__te_link_template + + def _set_te_link_template(self, v, load=False): + """ + Setter method for te_link_template, mapped from YANG variable /networks/network/link/te/te_link_template (leafref) + If this variable is read-only (config: false) in the + source YANG file, then _set_te_link_template is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_te_link_template() directly. + + YANG Description: The reference to a TE link template. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,unique=True, base=TypedListType(allowed_type=six.text_type), is_leaf=False, yang_name="te-link-template", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """te_link_template must be of a type compatible with leafref""", + 'defined-type': "leafref", + 'generated-type': """YANGDynClass(unique=True, base=TypedListType(allowed_type=six.text_type), is_leaf=False, yang_name="te-link-template", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=True)""", + }) + + self.__te_link_template = t + if hasattr(self, '_set'): + self._set() + + def _unset_te_link_template(self): + self.__te_link_template = YANGDynClass(unique=True, base=TypedListType(allowed_type=six.text_type), is_leaf=False, yang_name="te-link-template", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=True) + + + def _get_te_link_attributes(self): + """ + Getter method for te_link_attributes, mapped from YANG variable /networks/network/link/te/te_link_attributes (container) + + YANG Description: Link attributes in a TE topology. + """ + return self.__te_link_attributes + + def _set_te_link_attributes(self, v, load=False): + """ + Setter method for te_link_attributes, mapped from YANG variable /networks/network/link/te/te_link_attributes (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_te_link_attributes is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_te_link_attributes() directly. + + YANG Description: Link attributes in a TE topology. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=te_link_attributes.te_link_attributes, is_container='container', yang_name="te-link-attributes", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """te_link_attributes must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=te_link_attributes.te_link_attributes, is_container='container', yang_name="te-link-attributes", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__te_link_attributes = t + if hasattr(self, '_set'): + self._set() + + def _unset_te_link_attributes(self): + self.__te_link_attributes = YANGDynClass(base=te_link_attributes.te_link_attributes, is_container='container', yang_name="te-link-attributes", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_oper_status(self): + """ + Getter method for oper_status, mapped from YANG variable /networks/network/link/te/oper_status (te-types:te-oper-status) + + YANG Description: The current operational state of the link. + """ + return self.__oper_status + + def _set_oper_status(self, v, load=False): + """ + Setter method for oper_status, mapped from YANG variable /networks/network/link/te/oper_status (te-types:te-oper-status) + 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 link. + """ + 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': {}, 'preparing-maintenance': {}, 'maintenance': {}, 'unknown': {}},), is_leaf=True, yang_name="oper-status", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-types:te-oper-status', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """oper_status must be of a type compatible with te-types:te-oper-status""", + 'defined-type': "te-types:te-oper-status", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'up': {}, 'down': {}, 'testing': {}, 'preparing-maintenance': {}, 'maintenance': {}, 'unknown': {}},), is_leaf=True, yang_name="oper-status", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-types:te-oper-status', 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': {}, 'down': {}, 'testing': {}, 'preparing-maintenance': {}, 'maintenance': {}, 'unknown': {}},), is_leaf=True, yang_name="oper-status", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-types:te-oper-status', is_config=False) + + + def _get_is_transitional(self): + """ + Getter method for is_transitional, mapped from YANG variable /networks/network/link/te/is_transitional (empty) + + YANG Description: Present if the link is transitional; used as an +alternative approach in lieu of 'inter-layer-lock-id' +for path computation in a TE topology covering multiple +layers or multiple regions. + """ + return self.__is_transitional + + def _set_is_transitional(self, v, load=False): + """ + Setter method for is_transitional, mapped from YANG variable /networks/network/link/te/is_transitional (empty) + If this variable is read-only (config: false) in the + source YANG file, then _set_is_transitional is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_is_transitional() directly. + + YANG Description: Present if the link is transitional; used as an +alternative approach in lieu of 'inter-layer-lock-id' +for path computation in a TE topology covering multiple +layers or multiple regions. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBool, is_leaf=True, yang_name="is-transitional", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='empty', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """is_transitional must be of a type compatible with empty""", + 'defined-type': "empty", + 'generated-type': """YANGDynClass(base=YANGBool, is_leaf=True, yang_name="is-transitional", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='empty', is_config=False)""", + }) + + self.__is_transitional = t + if hasattr(self, '_set'): + self._set() + + def _unset_is_transitional(self): + self.__is_transitional = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="is-transitional", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='empty', is_config=False) + + + def _get_information_source(self): + """ + Getter method for information_source, mapped from YANG variable /networks/network/link/te/information_source (te-info-source) + + YANG Description: Indicates the type of information source. + """ + return self.__information_source + + def _set_information_source(self, v, load=False): + """ + Setter method for information_source, mapped from YANG variable /networks/network/link/te/information_source (te-info-source) + If this variable is read-only (config: false) in the + source YANG file, then _set_information_source is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_information_source() directly. + + YANG Description: Indicates the type of information source. + """ + 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': {}, 'locally-configured': {}, 'ospfv2': {}, 'ospfv3': {}, 'isis': {}, 'bgp-ls': {}, 'system-processed': {}, 'other': {}},), is_leaf=True, yang_name="information-source", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-info-source', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """information_source must be of a type compatible with te-info-source""", + 'defined-type': "ietf-te-topology:te-info-source", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'unknown': {}, 'locally-configured': {}, 'ospfv2': {}, 'ospfv3': {}, 'isis': {}, 'bgp-ls': {}, 'system-processed': {}, 'other': {}},), is_leaf=True, yang_name="information-source", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-info-source', is_config=False)""", + }) + + self.__information_source = t + if hasattr(self, '_set'): + self._set() + + def _unset_information_source(self): + self.__information_source = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'unknown': {}, 'locally-configured': {}, 'ospfv2': {}, 'ospfv3': {}, 'isis': {}, 'bgp-ls': {}, 'system-processed': {}, 'other': {}},), is_leaf=True, yang_name="information-source", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-info-source', is_config=False) + + + def _get_information_source_instance(self): + """ + Getter method for information_source_instance, mapped from YANG variable /networks/network/link/te/information_source_instance (string) + + YANG Description: The name indicating the instance of the information +source. + """ + return self.__information_source_instance + + def _set_information_source_instance(self, v, load=False): + """ + Setter method for information_source_instance, mapped from YANG variable /networks/network/link/te/information_source_instance (string) + If this variable is read-only (config: false) in the + source YANG file, then _set_information_source_instance is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_information_source_instance() directly. + + YANG Description: The name indicating the instance of the information +source. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="information-source-instance", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """information_source_instance must be of a type compatible with string""", + 'defined-type': "string", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="information-source-instance", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=False)""", + }) + + self.__information_source_instance = t + if hasattr(self, '_set'): + self._set() + + def _unset_information_source_instance(self): + self.__information_source_instance = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="information-source-instance", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=False) + + + def _get_information_source_state(self): + """ + Getter method for information_source_state, mapped from YANG variable /networks/network/link/te/information_source_state (container) + + YANG Description: Contains state attributes related to the information +source. + """ + return self.__information_source_state + + def _set_information_source_state(self, v, load=False): + """ + Setter method for information_source_state, mapped from YANG variable /networks/network/link/te/information_source_state (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_information_source_state is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_information_source_state() directly. + + YANG Description: Contains state attributes related to the information +source. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=information_source_state.information_source_state, is_container='container', yang_name="information-source-state", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """information_source_state must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=information_source_state.information_source_state, is_container='container', yang_name="information-source-state", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__information_source_state = t + if hasattr(self, '_set'): + self._set() + + def _unset_information_source_state(self): + self.__information_source_state = YANGDynClass(base=information_source_state.information_source_state, is_container='container', yang_name="information-source-state", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_information_source_entry(self): + """ + Getter method for information_source_entry, mapped from YANG variable /networks/network/link/te/information_source_entry (list) + + YANG Description: A list of information sources learned, including the source +that is used. + """ + return self.__information_source_entry + + def _set_information_source_entry(self, v, load=False): + """ + Setter method for information_source_entry, mapped from YANG variable /networks/network/link/te/information_source_entry (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_information_source_entry is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_information_source_entry() directly. + + YANG Description: A list of information sources learned, including the source +that is used. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("information_source information_source_instance",information_source_entry.information_source_entry, yang_name="information-source-entry", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='information-source information-source-instance', extensions=None), is_container='list', yang_name="information-source-entry", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """information_source_entry must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("information_source information_source_instance",information_source_entry.information_source_entry, yang_name="information-source-entry", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='information-source information-source-instance', extensions=None), is_container='list', yang_name="information-source-entry", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False)""", + }) + + self.__information_source_entry = t + if hasattr(self, '_set'): + self._set() + + def _unset_information_source_entry(self): + self.__information_source_entry = YANGDynClass(base=YANGListType("information_source information_source_instance",information_source_entry.information_source_entry, yang_name="information-source-entry", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='information-source information-source-instance', extensions=None), is_container='list', yang_name="information-source-entry", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + + + def _get_recovery(self): + """ + Getter method for recovery, mapped from YANG variable /networks/network/link/te/recovery (container) + + YANG Description: Status of the recovery process. + """ + return self.__recovery + + def _set_recovery(self, v, load=False): + """ + Setter method for recovery, mapped from YANG variable /networks/network/link/te/recovery (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_recovery is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_recovery() directly. + + YANG Description: Status of the recovery process. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=recovery.recovery, is_container='container', yang_name="recovery", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """recovery must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=recovery.recovery, is_container='container', yang_name="recovery", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__recovery = t + if hasattr(self, '_set'): + self._set() + + def _unset_recovery(self): + self.__recovery = YANGDynClass(base=recovery.recovery, is_container='container', yang_name="recovery", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_underlay(self): + """ + Getter method for underlay, mapped from YANG variable /networks/network/link/te/underlay (container) + + YANG Description: State attributes for the TE link underlay. + """ + return self.__underlay + + def _set_underlay(self, v, load=False): + """ + Setter method for underlay, mapped from YANG variable /networks/network/link/te/underlay (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_underlay is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_underlay() directly. + + YANG Description: State attributes for the TE link underlay. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=underlay.underlay, is_container='container', yang_name="underlay", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """underlay must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=underlay.underlay, is_container='container', yang_name="underlay", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__underlay = t + if hasattr(self, '_set'): + self._set() + + def _unset_underlay(self): + self.__underlay = YANGDynClass(base=underlay.underlay, is_container='container', yang_name="underlay", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_statistics(self): + """ + Getter method for statistics, mapped from YANG variable /networks/network/link/te/statistics (container) + + YANG Description: Statistics data. + """ + return self.__statistics + + def _set_statistics(self, v, load=False): + """ + Setter method for statistics, mapped from YANG variable /networks/network/link/te/statistics (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_statistics is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_statistics() directly. + + YANG Description: Statistics data. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=statistics.statistics, is_container='container', yang_name="statistics", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """statistics must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=statistics.statistics, is_container='container', yang_name="statistics", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__statistics = t + if hasattr(self, '_set'): + self._set() + + def _unset_statistics(self): + self.__statistics = YANGDynClass(base=statistics.statistics, is_container='container', yang_name="statistics", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + bundled_links = __builtin__.property(_get_bundled_links, _set_bundled_links) + component_links = __builtin__.property(_get_component_links, _set_component_links) + te_link_template = __builtin__.property(_get_te_link_template, _set_te_link_template) + te_link_attributes = __builtin__.property(_get_te_link_attributes, _set_te_link_attributes) + oper_status = __builtin__.property(_get_oper_status) + is_transitional = __builtin__.property(_get_is_transitional) + information_source = __builtin__.property(_get_information_source) + information_source_instance = __builtin__.property(_get_information_source_instance) + information_source_state = __builtin__.property(_get_information_source_state) + information_source_entry = __builtin__.property(_get_information_source_entry) + recovery = __builtin__.property(_get_recovery) + underlay = __builtin__.property(_get_underlay) + statistics = __builtin__.property(_get_statistics) + + __choices__ = {'bundle-stack-level': {'bundle': ['bundled_links'], 'component': ['component_links']}} + _pyangbind_elements = OrderedDict([('bundled_links', bundled_links), ('component_links', component_links), ('te_link_template', te_link_template), ('te_link_attributes', te_link_attributes), ('oper_status', oper_status), ('is_transitional', is_transitional), ('information_source', information_source), ('information_source_instance', information_source_instance), ('information_source_state', information_source_state), ('information_source_entry', information_source_entry), ('recovery', recovery), ('underlay', underlay), ('statistics', statistics), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/bundled_links/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/bundled_links/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..890484652415def2558181690b85a15e6a71258a --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/bundled_links/__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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 bundled_link +class bundled_links(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/link/te/bundled-links. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: A set of bundled links. + """ + __slots__ = ('_path_helper', '_extmethods', '__bundled_link',) + + _yang_name = 'bundled-links' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__bundled_link = YANGDynClass(base=YANGListType("sequence",bundled_link.bundled_link, yang_name="bundled-link", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='sequence', extensions=None, choice=('bundle-stack-level', 'bundle')), is_container='list', yang_name="bundled-link", parent=self, choice=('bundle-stack-level', 'bundle'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-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 ['networks', 'network', 'link', 'te', 'bundled-links'] + + def _get_bundled_link(self): + """ + Getter method for bundled_link, mapped from YANG variable /networks/network/link/te/bundled_links/bundled_link (list) + + YANG Description: Specifies a bundled interface that is +further partitioned. + """ + return self.__bundled_link + + def _set_bundled_link(self, v, load=False): + """ + Setter method for bundled_link, mapped from YANG variable /networks/network/link/te/bundled_links/bundled_link (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_bundled_link is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_bundled_link() directly. + + YANG Description: Specifies a bundled interface that is +further partitioned. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("sequence",bundled_link.bundled_link, yang_name="bundled-link", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='sequence', extensions=None, choice=('bundle-stack-level', 'bundle')), is_container='list', yang_name="bundled-link", parent=self, choice=('bundle-stack-level', 'bundle'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """bundled_link must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("sequence",bundled_link.bundled_link, yang_name="bundled-link", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='sequence', extensions=None, choice=('bundle-stack-level', 'bundle')), is_container='list', yang_name="bundled-link", parent=self, choice=('bundle-stack-level', 'bundle'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True)""", + }) + + self.__bundled_link = t + if hasattr(self, '_set'): + self._set() + + def _unset_bundled_link(self): + self.__bundled_link = YANGDynClass(base=YANGListType("sequence",bundled_link.bundled_link, yang_name="bundled-link", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='sequence', extensions=None, choice=('bundle-stack-level', 'bundle')), is_container='list', yang_name="bundled-link", parent=self, choice=('bundle-stack-level', 'bundle'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + + bundled_link = __builtin__.property(_get_bundled_link, _set_bundled_link) + + __choices__ = {'bundle-stack-level': {'bundle': ['bundled_link']}} + _pyangbind_elements = OrderedDict([('bundled_link', bundled_link), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/bundled_links/bundled_link/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/bundled_links/bundled_link/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..99c0b71fe3c0da96681858df66cd8771b0ffb326 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/bundled_links/bundled_link/__init__.py @@ -0,0 +1,203 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 bundled_link(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/link/te/bundled-links/bundled-link. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Specifies a bundled interface that is +further partitioned. + """ + __slots__ = ('_path_helper', '_extmethods', '__sequence','__src_tp_ref','__des_tp_ref',) + + _yang_name = 'bundled-link' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__sequence = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="sequence", parent=self, choice=('bundle-stack-level', 'bundle'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + self.__src_tp_ref = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="src-tp-ref", parent=self, choice=('bundle-stack-level', 'bundle'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=True) + self.__des_tp_ref = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="des-tp-ref", parent=self, choice=('bundle-stack-level', 'bundle'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-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 ['networks', 'network', 'link', 'te', 'bundled-links', 'bundled-link'] + + def _get_sequence(self): + """ + Getter method for sequence, mapped from YANG variable /networks/network/link/te/bundled_links/bundled_link/sequence (uint32) + + YANG Description: Identifies the sequence in the bundle. + """ + return self.__sequence + + def _set_sequence(self, v, load=False): + """ + Setter method for sequence, mapped from YANG variable /networks/network/link/te/bundled_links/bundled_link/sequence (uint32) + If this variable is read-only (config: false) in the + source YANG file, then _set_sequence is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_sequence() directly. + + YANG Description: Identifies the sequence in the bundle. + """ + 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=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="sequence", parent=self, choice=('bundle-stack-level', 'bundle'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """sequence 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="sequence", parent=self, choice=('bundle-stack-level', 'bundle'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True)""", + }) + + self.__sequence = t + if hasattr(self, '_set'): + self._set() + + def _unset_sequence(self): + self.__sequence = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="sequence", parent=self, choice=('bundle-stack-level', 'bundle'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + + + def _get_src_tp_ref(self): + """ + Getter method for src_tp_ref, mapped from YANG variable /networks/network/link/te/bundled_links/bundled_link/src_tp_ref (leafref) + + YANG Description: Reference to another TE termination point on the +same source node. + """ + return self.__src_tp_ref + + def _set_src_tp_ref(self, v, load=False): + """ + Setter method for src_tp_ref, mapped from YANG variable /networks/network/link/te/bundled_links/bundled_link/src_tp_ref (leafref) + If this variable is read-only (config: false) in the + source YANG file, then _set_src_tp_ref is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_src_tp_ref() directly. + + YANG Description: Reference to another TE termination point on the +same source node. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="src-tp-ref", parent=self, choice=('bundle-stack-level', 'bundle'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """src_tp_ref must be of a type compatible with leafref""", + 'defined-type': "leafref", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="src-tp-ref", parent=self, choice=('bundle-stack-level', 'bundle'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=True)""", + }) + + self.__src_tp_ref = t + if hasattr(self, '_set'): + self._set() + + def _unset_src_tp_ref(self): + self.__src_tp_ref = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="src-tp-ref", parent=self, choice=('bundle-stack-level', 'bundle'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=True) + + + def _get_des_tp_ref(self): + """ + Getter method for des_tp_ref, mapped from YANG variable /networks/network/link/te/bundled_links/bundled_link/des_tp_ref (leafref) + + YANG Description: Reference to another TE termination point on the +same destination node. + """ + return self.__des_tp_ref + + def _set_des_tp_ref(self, v, load=False): + """ + Setter method for des_tp_ref, mapped from YANG variable /networks/network/link/te/bundled_links/bundled_link/des_tp_ref (leafref) + If this variable is read-only (config: false) in the + source YANG file, then _set_des_tp_ref is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_des_tp_ref() directly. + + YANG Description: Reference to another TE termination point on the +same destination node. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="des-tp-ref", parent=self, choice=('bundle-stack-level', 'bundle'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """des_tp_ref must be of a type compatible with leafref""", + 'defined-type': "leafref", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="des-tp-ref", parent=self, choice=('bundle-stack-level', 'bundle'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=True)""", + }) + + self.__des_tp_ref = t + if hasattr(self, '_set'): + self._set() + + def _unset_des_tp_ref(self): + self.__des_tp_ref = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="des-tp-ref", parent=self, choice=('bundle-stack-level', 'bundle'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=True) + + sequence = __builtin__.property(_get_sequence, _set_sequence) + src_tp_ref = __builtin__.property(_get_src_tp_ref, _set_src_tp_ref) + des_tp_ref = __builtin__.property(_get_des_tp_ref, _set_des_tp_ref) + + __choices__ = {'bundle-stack-level': {'bundle': ['sequence', 'src_tp_ref', 'des_tp_ref']}} + _pyangbind_elements = OrderedDict([('sequence', sequence), ('src_tp_ref', src_tp_ref), ('des_tp_ref', des_tp_ref), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/component_links/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/component_links/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..2207417bc3b9a0271d4b08634647ae9d538f9724 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/component_links/__init__.py @@ -0,0 +1,120 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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_link +class component_links(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/link/te/component-links. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: A set of component links. + """ + __slots__ = ('_path_helper', '_extmethods', '__component_link',) + + _yang_name = 'component-links' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__component_link = YANGDynClass(base=YANGListType("sequence",component_link.component_link, yang_name="component-link", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='sequence', extensions=None, choice=('bundle-stack-level', 'component')), is_container='list', yang_name="component-link", parent=self, choice=('bundle-stack-level', 'component'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-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 ['networks', 'network', 'link', 'te', 'component-links'] + + def _get_component_link(self): + """ + Getter method for component_link, mapped from YANG variable /networks/network/link/te/component_links/component_link (list) + + YANG Description: Specifies a component interface that is +sufficient to unambiguously identify the +appropriate resources. + """ + return self.__component_link + + def _set_component_link(self, v, load=False): + """ + Setter method for component_link, mapped from YANG variable /networks/network/link/te/component_links/component_link (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_component_link is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_component_link() directly. + + YANG Description: Specifies a component interface that is +sufficient to unambiguously identify the +appropriate resources. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("sequence",component_link.component_link, yang_name="component-link", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='sequence', extensions=None, choice=('bundle-stack-level', 'component')), is_container='list', yang_name="component-link", parent=self, choice=('bundle-stack-level', 'component'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """component_link must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("sequence",component_link.component_link, yang_name="component-link", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='sequence', extensions=None, choice=('bundle-stack-level', 'component')), is_container='list', yang_name="component-link", parent=self, choice=('bundle-stack-level', 'component'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True)""", + }) + + self.__component_link = t + if hasattr(self, '_set'): + self._set() + + def _unset_component_link(self): + self.__component_link = YANGDynClass(base=YANGListType("sequence",component_link.component_link, yang_name="component-link", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='sequence', extensions=None, choice=('bundle-stack-level', 'component')), is_container='list', yang_name="component-link", parent=self, choice=('bundle-stack-level', 'component'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + + component_link = __builtin__.property(_get_component_link, _set_component_link) + + __choices__ = {'bundle-stack-level': {'component': ['component_link']}} + _pyangbind_elements = OrderedDict([('component_link', component_link), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/component_links/component_link/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/component_links/component_link/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..5995318d715c909846c2ed74a6ddb881cbb7689f --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/component_links/component_link/__init__.py @@ -0,0 +1,204 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 component_link(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/link/te/component-links/component-link. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Specifies a component interface that is +sufficient to unambiguously identify the +appropriate resources. + """ + __slots__ = ('_path_helper', '_extmethods', '__sequence','__src_interface_ref','__des_interface_ref',) + + _yang_name = 'component-link' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__sequence = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="sequence", parent=self, choice=('bundle-stack-level', 'component'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + self.__src_interface_ref = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="src-interface-ref", parent=self, choice=('bundle-stack-level', 'component'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=True) + self.__des_interface_ref = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="des-interface-ref", parent=self, choice=('bundle-stack-level', 'component'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-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 ['networks', 'network', 'link', 'te', 'component-links', 'component-link'] + + def _get_sequence(self): + """ + Getter method for sequence, mapped from YANG variable /networks/network/link/te/component_links/component_link/sequence (uint32) + + YANG Description: Identifies the sequence in the bundle. + """ + return self.__sequence + + def _set_sequence(self, v, load=False): + """ + Setter method for sequence, mapped from YANG variable /networks/network/link/te/component_links/component_link/sequence (uint32) + If this variable is read-only (config: false) in the + source YANG file, then _set_sequence is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_sequence() directly. + + YANG Description: Identifies the sequence in the bundle. + """ + 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=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="sequence", parent=self, choice=('bundle-stack-level', 'component'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """sequence 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="sequence", parent=self, choice=('bundle-stack-level', 'component'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True)""", + }) + + self.__sequence = t + if hasattr(self, '_set'): + self._set() + + def _unset_sequence(self): + self.__sequence = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="sequence", parent=self, choice=('bundle-stack-level', 'component'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + + + def _get_src_interface_ref(self): + """ + Getter method for src_interface_ref, mapped from YANG variable /networks/network/link/te/component_links/component_link/src_interface_ref (string) + + YANG Description: Reference to a component link interface on the +source node. + """ + return self.__src_interface_ref + + def _set_src_interface_ref(self, v, load=False): + """ + Setter method for src_interface_ref, mapped from YANG variable /networks/network/link/te/component_links/component_link/src_interface_ref (string) + If this variable is read-only (config: false) in the + source YANG file, then _set_src_interface_ref is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_src_interface_ref() directly. + + YANG Description: Reference to a component link interface on the +source node. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="src-interface-ref", parent=self, choice=('bundle-stack-level', 'component'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """src_interface_ref must be of a type compatible with string""", + 'defined-type': "string", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="src-interface-ref", parent=self, choice=('bundle-stack-level', 'component'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=True)""", + }) + + self.__src_interface_ref = t + if hasattr(self, '_set'): + self._set() + + def _unset_src_interface_ref(self): + self.__src_interface_ref = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="src-interface-ref", parent=self, choice=('bundle-stack-level', 'component'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=True) + + + def _get_des_interface_ref(self): + """ + Getter method for des_interface_ref, mapped from YANG variable /networks/network/link/te/component_links/component_link/des_interface_ref (string) + + YANG Description: Reference to a component link interface on the +destination node. + """ + return self.__des_interface_ref + + def _set_des_interface_ref(self, v, load=False): + """ + Setter method for des_interface_ref, mapped from YANG variable /networks/network/link/te/component_links/component_link/des_interface_ref (string) + If this variable is read-only (config: false) in the + source YANG file, then _set_des_interface_ref is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_des_interface_ref() directly. + + YANG Description: Reference to a component link interface on the +destination node. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="des-interface-ref", parent=self, choice=('bundle-stack-level', 'component'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """des_interface_ref must be of a type compatible with string""", + 'defined-type': "string", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="des-interface-ref", parent=self, choice=('bundle-stack-level', 'component'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=True)""", + }) + + self.__des_interface_ref = t + if hasattr(self, '_set'): + self._set() + + def _unset_des_interface_ref(self): + self.__des_interface_ref = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="des-interface-ref", parent=self, choice=('bundle-stack-level', 'component'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=True) + + sequence = __builtin__.property(_get_sequence, _set_sequence) + src_interface_ref = __builtin__.property(_get_src_interface_ref, _set_src_interface_ref) + des_interface_ref = __builtin__.property(_get_des_interface_ref, _set_des_interface_ref) + + __choices__ = {'bundle-stack-level': {'component': ['sequence', 'src_interface_ref', 'des_interface_ref']}} + _pyangbind_elements = OrderedDict([('sequence', sequence), ('src_interface_ref', src_interface_ref), ('des_interface_ref', des_interface_ref), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/information_source_entry/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/information_source_entry/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..d331b67df85fe3f0c3173f74307de38fa5bc5d0b --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/information_source_entry/__init__.py @@ -0,0 +1,749 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 information_source_state +from . import interface_switching_capability +from . import label_restrictions +from . import max_link_bandwidth +from . import max_resv_link_bandwidth +from . import unreserved_bandwidth +from . import te_srlgs +from . import te_nsrlgs +class information_source_entry(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/link/te/information-source-entry. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: A list of information sources learned, including the source +that is used. + """ + __slots__ = ('_path_helper', '_extmethods', '__information_source','__information_source_instance','__information_source_state','__link_index','__administrative_group','__interface_switching_capability','__label_restrictions','__link_protection_type','__max_link_bandwidth','__max_resv_link_bandwidth','__unreserved_bandwidth','__te_default_metric','__te_delay_metric','__te_igp_metric','__te_srlgs','__te_nsrlgs',) + + _yang_name = 'information-source-entry' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__information_source = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'unknown': {}, 'locally-configured': {}, 'ospfv2': {}, 'ospfv3': {}, 'isis': {}, 'bgp-ls': {}, 'system-processed': {}, 'other': {}},), is_leaf=True, yang_name="information-source", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-info-source', is_config=False) + self.__information_source_instance = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="information-source-instance", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=False) + self.__information_source_state = YANGDynClass(base=information_source_state.information_source_state, is_container='container', yang_name="information-source-state", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__link_index = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="link-index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint64', is_config=False) + self.__administrative_group = YANGDynClass(base=[RestrictedClassType(base_type=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}), restriction_dict={'length': ['1..11']}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}),], is_leaf=True, yang_name="administrative-group", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-types:admin-groups', is_config=False) + self.__interface_switching_capability = YANGDynClass(base=YANGListType("switching_capability encoding",interface_switching_capability.interface_switching_capability, yang_name="interface-switching-capability", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='switching-capability encoding', extensions=None), is_container='list', yang_name="interface-switching-capability", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + self.__label_restrictions = YANGDynClass(base=label_restrictions.label_restrictions, is_container='container', yang_name="label-restrictions", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__link_protection_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'link-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-shared': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-shared': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-shared': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-enhanced': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-enhanced': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-enhanced': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="link-protection-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + self.__max_link_bandwidth = YANGDynClass(base=max_link_bandwidth.max_link_bandwidth, is_container='container', yang_name="max-link-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__max_resv_link_bandwidth = YANGDynClass(base=max_resv_link_bandwidth.max_resv_link_bandwidth, is_container='container', yang_name="max-resv-link-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__unreserved_bandwidth = YANGDynClass(base=YANGListType("priority",unreserved_bandwidth.unreserved_bandwidth, yang_name="unreserved-bandwidth", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='priority', extensions=None), is_container='list', yang_name="unreserved-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + self.__te_default_metric = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="te-default-metric", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=False) + self.__te_delay_metric = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="te-delay-metric", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=False) + self.__te_igp_metric = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="te-igp-metric", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=False) + self.__te_srlgs = YANGDynClass(base=te_srlgs.te_srlgs, is_container='container', yang_name="te-srlgs", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__te_nsrlgs = YANGDynClass(base=te_nsrlgs.te_nsrlgs, is_container='container', yang_name="te-nsrlgs", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', 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 ['networks', 'network', 'link', 'te', 'information-source-entry'] + + def _get_information_source(self): + """ + Getter method for information_source, mapped from YANG variable /networks/network/link/te/information_source_entry/information_source (te-info-source) + + YANG Description: Indicates the type of information source. + """ + return self.__information_source + + def _set_information_source(self, v, load=False): + """ + Setter method for information_source, mapped from YANG variable /networks/network/link/te/information_source_entry/information_source (te-info-source) + If this variable is read-only (config: false) in the + source YANG file, then _set_information_source is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_information_source() directly. + + YANG Description: Indicates the type of information source. + """ + 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=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'unknown': {}, 'locally-configured': {}, 'ospfv2': {}, 'ospfv3': {}, 'isis': {}, 'bgp-ls': {}, 'system-processed': {}, 'other': {}},), is_leaf=True, yang_name="information-source", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-info-source', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """information_source must be of a type compatible with te-info-source""", + 'defined-type': "ietf-te-topology:te-info-source", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'unknown': {}, 'locally-configured': {}, 'ospfv2': {}, 'ospfv3': {}, 'isis': {}, 'bgp-ls': {}, 'system-processed': {}, 'other': {}},), is_leaf=True, yang_name="information-source", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-info-source', is_config=False)""", + }) + + self.__information_source = t + if hasattr(self, '_set'): + self._set() + + def _unset_information_source(self): + self.__information_source = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'unknown': {}, 'locally-configured': {}, 'ospfv2': {}, 'ospfv3': {}, 'isis': {}, 'bgp-ls': {}, 'system-processed': {}, 'other': {}},), is_leaf=True, yang_name="information-source", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-info-source', is_config=False) + + + def _get_information_source_instance(self): + """ + Getter method for information_source_instance, mapped from YANG variable /networks/network/link/te/information_source_entry/information_source_instance (string) + + YANG Description: The name indicating the instance of the information +source. + """ + return self.__information_source_instance + + def _set_information_source_instance(self, v, load=False): + """ + Setter method for information_source_instance, mapped from YANG variable /networks/network/link/te/information_source_entry/information_source_instance (string) + If this variable is read-only (config: false) in the + source YANG file, then _set_information_source_instance is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_information_source_instance() directly. + + YANG Description: The name indicating the instance of the information +source. + """ + 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="information-source-instance", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """information_source_instance must be of a type compatible with string""", + 'defined-type': "string", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="information-source-instance", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=False)""", + }) + + self.__information_source_instance = t + if hasattr(self, '_set'): + self._set() + + def _unset_information_source_instance(self): + self.__information_source_instance = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="information-source-instance", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=False) + + + def _get_information_source_state(self): + """ + Getter method for information_source_state, mapped from YANG variable /networks/network/link/te/information_source_entry/information_source_state (container) + + YANG Description: Contains state attributes related to the information +source. + """ + return self.__information_source_state + + def _set_information_source_state(self, v, load=False): + """ + Setter method for information_source_state, mapped from YANG variable /networks/network/link/te/information_source_entry/information_source_state (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_information_source_state is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_information_source_state() directly. + + YANG Description: Contains state attributes related to the information +source. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=information_source_state.information_source_state, is_container='container', yang_name="information-source-state", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """information_source_state must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=information_source_state.information_source_state, is_container='container', yang_name="information-source-state", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__information_source_state = t + if hasattr(self, '_set'): + self._set() + + def _unset_information_source_state(self): + self.__information_source_state = YANGDynClass(base=information_source_state.information_source_state, is_container='container', yang_name="information-source-state", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_link_index(self): + """ + Getter method for link_index, mapped from YANG variable /networks/network/link/te/information_source_entry/link_index (uint64) + + YANG Description: The link identifier. If OSPF is used, this object +represents an ospfLsdbID. If IS-IS is used, this object +represents an isisLSPID. If a locally configured link is +used, this object represents a unique value, which is +locally defined in a router. + """ + return self.__link_index + + def _set_link_index(self, v, load=False): + """ + Setter method for link_index, mapped from YANG variable /networks/network/link/te/information_source_entry/link_index (uint64) + If this variable is read-only (config: false) in the + source YANG file, then _set_link_index is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_link_index() directly. + + YANG Description: The link identifier. If OSPF is used, this object +represents an ospfLsdbID. If IS-IS is used, this object +represents an isisLSPID. If a locally configured link is +used, this object represents a unique value, which is +locally defined in a router. + """ + 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="link-index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint64', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """link_index 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="link-index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint64', is_config=False)""", + }) + + self.__link_index = t + if hasattr(self, '_set'): + self._set() + + def _unset_link_index(self): + self.__link_index = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="link-index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint64', is_config=False) + + + def _get_administrative_group(self): + """ + Getter method for administrative_group, mapped from YANG variable /networks/network/link/te/information_source_entry/administrative_group (te-types:admin-groups) + + YANG Description: Administrative group or color of the link. +This attribute covers both administrative groups (defined +in RFCs 3630 and 5305) and Extended Administrative Groups +(defined in RFC 7308). + """ + return self.__administrative_group + + def _set_administrative_group(self, v, load=False): + """ + Setter method for administrative_group, mapped from YANG variable /networks/network/link/te/information_source_entry/administrative_group (te-types:admin-groups) + If this variable is read-only (config: false) in the + source YANG file, then _set_administrative_group is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_administrative_group() directly. + + YANG Description: Administrative group or color of the link. +This attribute covers both administrative groups (defined +in RFCs 3630 and 5305) and Extended Administrative Groups +(defined in RFC 7308). + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=[RestrictedClassType(base_type=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}), restriction_dict={'length': ['1..11']}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}),], is_leaf=True, yang_name="administrative-group", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-types:admin-groups', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """administrative_group must be of a type compatible with te-types:admin-groups""", + 'defined-type': "te-types:admin-groups", + 'generated-type': """YANGDynClass(base=[RestrictedClassType(base_type=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}), restriction_dict={'length': ['1..11']}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}),], is_leaf=True, yang_name="administrative-group", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-types:admin-groups', is_config=False)""", + }) + + self.__administrative_group = t + if hasattr(self, '_set'): + self._set() + + def _unset_administrative_group(self): + self.__administrative_group = YANGDynClass(base=[RestrictedClassType(base_type=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}), restriction_dict={'length': ['1..11']}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}),], is_leaf=True, yang_name="administrative-group", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-types:admin-groups', is_config=False) + + + def _get_interface_switching_capability(self): + """ + Getter method for interface_switching_capability, mapped from YANG variable /networks/network/link/te/information_source_entry/interface_switching_capability (list) + + YANG Description: List of ISCDs for this link. + """ + return self.__interface_switching_capability + + def _set_interface_switching_capability(self, v, load=False): + """ + Setter method for interface_switching_capability, mapped from YANG variable /networks/network/link/te/information_source_entry/interface_switching_capability (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_interface_switching_capability is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_interface_switching_capability() directly. + + YANG Description: List of ISCDs for this link. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("switching_capability encoding",interface_switching_capability.interface_switching_capability, yang_name="interface-switching-capability", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='switching-capability encoding', extensions=None), is_container='list', yang_name="interface-switching-capability", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """interface_switching_capability must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("switching_capability encoding",interface_switching_capability.interface_switching_capability, yang_name="interface-switching-capability", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='switching-capability encoding', extensions=None), is_container='list', yang_name="interface-switching-capability", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False)""", + }) + + self.__interface_switching_capability = t + if hasattr(self, '_set'): + self._set() + + def _unset_interface_switching_capability(self): + self.__interface_switching_capability = YANGDynClass(base=YANGListType("switching_capability encoding",interface_switching_capability.interface_switching_capability, yang_name="interface-switching-capability", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='switching-capability encoding', extensions=None), is_container='list', yang_name="interface-switching-capability", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + + + def _get_label_restrictions(self): + """ + Getter method for label_restrictions, mapped from YANG variable /networks/network/link/te/information_source_entry/label_restrictions (container) + + YANG Description: The label restrictions container. + """ + return self.__label_restrictions + + def _set_label_restrictions(self, v, load=False): + """ + Setter method for label_restrictions, mapped from YANG variable /networks/network/link/te/information_source_entry/label_restrictions (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_label_restrictions is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_label_restrictions() directly. + + YANG Description: The label restrictions container. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=label_restrictions.label_restrictions, is_container='container', yang_name="label-restrictions", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """label_restrictions must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=label_restrictions.label_restrictions, is_container='container', yang_name="label-restrictions", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__label_restrictions = t + if hasattr(self, '_set'): + self._set() + + def _unset_label_restrictions(self): + self.__label_restrictions = YANGDynClass(base=label_restrictions.label_restrictions, is_container='container', yang_name="label-restrictions", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_link_protection_type(self): + """ + Getter method for link_protection_type, mapped from YANG variable /networks/network/link/te/information_source_entry/link_protection_type (identityref) + + YANG Description: Link Protection Type desired for this link. + """ + return self.__link_protection_type + + def _set_link_protection_type(self, v, load=False): + """ + Setter method for link_protection_type, mapped from YANG variable /networks/network/link/te/information_source_entry/link_protection_type (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_link_protection_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_link_protection_type() directly. + + YANG Description: Link Protection Type desired for this link. + """ + 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={'link-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-shared': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-shared': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-shared': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-enhanced': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-enhanced': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-enhanced': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="link-protection-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """link_protection_type must be of a type compatible with identityref""", + 'defined-type': "ietf-te-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'link-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-shared': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-shared': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-shared': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-enhanced': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-enhanced': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-enhanced': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="link-protection-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False)""", + }) + + self.__link_protection_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_link_protection_type(self): + self.__link_protection_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'link-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-shared': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-shared': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-shared': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-enhanced': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-enhanced': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-enhanced': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="link-protection-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + + + def _get_max_link_bandwidth(self): + """ + Getter method for max_link_bandwidth, mapped from YANG variable /networks/network/link/te/information_source_entry/max_link_bandwidth (container) + + YANG Description: Maximum bandwidth that can be seen on this link in this +direction. Units are in bytes per second. + """ + return self.__max_link_bandwidth + + def _set_max_link_bandwidth(self, v, load=False): + """ + Setter method for max_link_bandwidth, mapped from YANG variable /networks/network/link/te/information_source_entry/max_link_bandwidth (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_max_link_bandwidth is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_max_link_bandwidth() directly. + + YANG Description: Maximum bandwidth that can be seen on this link in this +direction. Units are in bytes per second. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=max_link_bandwidth.max_link_bandwidth, is_container='container', yang_name="max-link-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """max_link_bandwidth must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=max_link_bandwidth.max_link_bandwidth, is_container='container', yang_name="max-link-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__max_link_bandwidth = t + if hasattr(self, '_set'): + self._set() + + def _unset_max_link_bandwidth(self): + self.__max_link_bandwidth = YANGDynClass(base=max_link_bandwidth.max_link_bandwidth, is_container='container', yang_name="max-link-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_max_resv_link_bandwidth(self): + """ + Getter method for max_resv_link_bandwidth, mapped from YANG variable /networks/network/link/te/information_source_entry/max_resv_link_bandwidth (container) + + YANG Description: Maximum amount of bandwidth that can be reserved in this +direction in this link. Units are in bytes per second. + """ + return self.__max_resv_link_bandwidth + + def _set_max_resv_link_bandwidth(self, v, load=False): + """ + Setter method for max_resv_link_bandwidth, mapped from YANG variable /networks/network/link/te/information_source_entry/max_resv_link_bandwidth (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_max_resv_link_bandwidth is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_max_resv_link_bandwidth() directly. + + YANG Description: Maximum amount of bandwidth that can be reserved in this +direction in this link. Units are in bytes per second. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=max_resv_link_bandwidth.max_resv_link_bandwidth, is_container='container', yang_name="max-resv-link-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """max_resv_link_bandwidth must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=max_resv_link_bandwidth.max_resv_link_bandwidth, is_container='container', yang_name="max-resv-link-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__max_resv_link_bandwidth = t + if hasattr(self, '_set'): + self._set() + + def _unset_max_resv_link_bandwidth(self): + self.__max_resv_link_bandwidth = YANGDynClass(base=max_resv_link_bandwidth.max_resv_link_bandwidth, is_container='container', yang_name="max-resv-link-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_unreserved_bandwidth(self): + """ + Getter method for unreserved_bandwidth, mapped from YANG variable /networks/network/link/te/information_source_entry/unreserved_bandwidth (list) + + YANG Description: Unreserved bandwidth for priority levels 0-7. Units are in +bytes per second. + """ + return self.__unreserved_bandwidth + + def _set_unreserved_bandwidth(self, v, load=False): + """ + Setter method for unreserved_bandwidth, mapped from YANG variable /networks/network/link/te/information_source_entry/unreserved_bandwidth (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_unreserved_bandwidth is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_unreserved_bandwidth() directly. + + YANG Description: Unreserved bandwidth for priority levels 0-7. Units are in +bytes per second. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("priority",unreserved_bandwidth.unreserved_bandwidth, yang_name="unreserved-bandwidth", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='priority', extensions=None), is_container='list', yang_name="unreserved-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """unreserved_bandwidth must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("priority",unreserved_bandwidth.unreserved_bandwidth, yang_name="unreserved-bandwidth", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='priority', extensions=None), is_container='list', yang_name="unreserved-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False)""", + }) + + self.__unreserved_bandwidth = t + if hasattr(self, '_set'): + self._set() + + def _unset_unreserved_bandwidth(self): + self.__unreserved_bandwidth = YANGDynClass(base=YANGListType("priority",unreserved_bandwidth.unreserved_bandwidth, yang_name="unreserved-bandwidth", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='priority', extensions=None), is_container='list', yang_name="unreserved-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + + + def _get_te_default_metric(self): + """ + Getter method for te_default_metric, mapped from YANG variable /networks/network/link/te/information_source_entry/te_default_metric (uint32) + + YANG Description: Traffic Engineering metric. + """ + return self.__te_default_metric + + def _set_te_default_metric(self, v, load=False): + """ + Setter method for te_default_metric, mapped from YANG variable /networks/network/link/te/information_source_entry/te_default_metric (uint32) + If this variable is read-only (config: false) in the + source YANG file, then _set_te_default_metric is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_te_default_metric() directly. + + YANG Description: Traffic Engineering metric. + """ + 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="te-default-metric", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """te_default_metric 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="te-default-metric", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=False)""", + }) + + self.__te_default_metric = t + if hasattr(self, '_set'): + self._set() + + def _unset_te_default_metric(self): + self.__te_default_metric = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="te-default-metric", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=False) + + + def _get_te_delay_metric(self): + """ + Getter method for te_delay_metric, mapped from YANG variable /networks/network/link/te/information_source_entry/te_delay_metric (uint32) + + YANG Description: Traffic Engineering delay metric. + """ + return self.__te_delay_metric + + def _set_te_delay_metric(self, v, load=False): + """ + Setter method for te_delay_metric, mapped from YANG variable /networks/network/link/te/information_source_entry/te_delay_metric (uint32) + If this variable is read-only (config: false) in the + source YANG file, then _set_te_delay_metric is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_te_delay_metric() directly. + + YANG Description: Traffic Engineering delay metric. + """ + 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="te-delay-metric", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """te_delay_metric 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="te-delay-metric", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=False)""", + }) + + self.__te_delay_metric = t + if hasattr(self, '_set'): + self._set() + + def _unset_te_delay_metric(self): + self.__te_delay_metric = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="te-delay-metric", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=False) + + + def _get_te_igp_metric(self): + """ + Getter method for te_igp_metric, mapped from YANG variable /networks/network/link/te/information_source_entry/te_igp_metric (uint32) + + YANG Description: IGP metric used for Traffic Engineering. + """ + return self.__te_igp_metric + + def _set_te_igp_metric(self, v, load=False): + """ + Setter method for te_igp_metric, mapped from YANG variable /networks/network/link/te/information_source_entry/te_igp_metric (uint32) + If this variable is read-only (config: false) in the + source YANG file, then _set_te_igp_metric is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_te_igp_metric() directly. + + YANG Description: IGP metric used for Traffic Engineering. + """ + 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="te-igp-metric", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """te_igp_metric 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="te-igp-metric", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=False)""", + }) + + self.__te_igp_metric = t + if hasattr(self, '_set'): + self._set() + + def _unset_te_igp_metric(self): + self.__te_igp_metric = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="te-igp-metric", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=False) + + + def _get_te_srlgs(self): + """ + Getter method for te_srlgs, mapped from YANG variable /networks/network/link/te/information_source_entry/te_srlgs (container) + + YANG Description: Contains a list of SRLGs. + """ + return self.__te_srlgs + + def _set_te_srlgs(self, v, load=False): + """ + Setter method for te_srlgs, mapped from YANG variable /networks/network/link/te/information_source_entry/te_srlgs (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_te_srlgs is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_te_srlgs() directly. + + YANG Description: Contains a list of SRLGs. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=te_srlgs.te_srlgs, is_container='container', yang_name="te-srlgs", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """te_srlgs must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=te_srlgs.te_srlgs, is_container='container', yang_name="te-srlgs", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__te_srlgs = t + if hasattr(self, '_set'): + self._set() + + def _unset_te_srlgs(self): + self.__te_srlgs = YANGDynClass(base=te_srlgs.te_srlgs, is_container='container', yang_name="te-srlgs", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_te_nsrlgs(self): + """ + Getter method for te_nsrlgs, mapped from YANG variable /networks/network/link/te/information_source_entry/te_nsrlgs (container) + + YANG Description: Contains a list of NSRLGs (Non-Shared Risk Link Groups). +When an abstract TE link is configured, this list specifies +the request that underlay TE paths need to be mutually +disjoint with other TE links in the same groups. + """ + return self.__te_nsrlgs + + def _set_te_nsrlgs(self, v, load=False): + """ + Setter method for te_nsrlgs, mapped from YANG variable /networks/network/link/te/information_source_entry/te_nsrlgs (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_te_nsrlgs is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_te_nsrlgs() directly. + + YANG Description: Contains a list of NSRLGs (Non-Shared Risk Link Groups). +When an abstract TE link is configured, this list specifies +the request that underlay TE paths need to be mutually +disjoint with other TE links in the same groups. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=te_nsrlgs.te_nsrlgs, is_container='container', yang_name="te-nsrlgs", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """te_nsrlgs must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=te_nsrlgs.te_nsrlgs, is_container='container', yang_name="te-nsrlgs", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__te_nsrlgs = t + if hasattr(self, '_set'): + self._set() + + def _unset_te_nsrlgs(self): + self.__te_nsrlgs = YANGDynClass(base=te_nsrlgs.te_nsrlgs, is_container='container', yang_name="te-nsrlgs", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + information_source = __builtin__.property(_get_information_source) + information_source_instance = __builtin__.property(_get_information_source_instance) + information_source_state = __builtin__.property(_get_information_source_state) + link_index = __builtin__.property(_get_link_index) + administrative_group = __builtin__.property(_get_administrative_group) + interface_switching_capability = __builtin__.property(_get_interface_switching_capability) + label_restrictions = __builtin__.property(_get_label_restrictions) + link_protection_type = __builtin__.property(_get_link_protection_type) + max_link_bandwidth = __builtin__.property(_get_max_link_bandwidth) + max_resv_link_bandwidth = __builtin__.property(_get_max_resv_link_bandwidth) + unreserved_bandwidth = __builtin__.property(_get_unreserved_bandwidth) + te_default_metric = __builtin__.property(_get_te_default_metric) + te_delay_metric = __builtin__.property(_get_te_delay_metric) + te_igp_metric = __builtin__.property(_get_te_igp_metric) + te_srlgs = __builtin__.property(_get_te_srlgs) + te_nsrlgs = __builtin__.property(_get_te_nsrlgs) + + + _pyangbind_elements = OrderedDict([('information_source', information_source), ('information_source_instance', information_source_instance), ('information_source_state', information_source_state), ('link_index', link_index), ('administrative_group', administrative_group), ('interface_switching_capability', interface_switching_capability), ('label_restrictions', label_restrictions), ('link_protection_type', link_protection_type), ('max_link_bandwidth', max_link_bandwidth), ('max_resv_link_bandwidth', max_resv_link_bandwidth), ('unreserved_bandwidth', unreserved_bandwidth), ('te_default_metric', te_default_metric), ('te_delay_metric', te_delay_metric), ('te_igp_metric', te_igp_metric), ('te_srlgs', te_srlgs), ('te_nsrlgs', te_nsrlgs), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/information_source_entry/information_source_state/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/information_source_entry/information_source_state/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..51885bb49b9eb9a0279b8ff45e62449f896c03ef --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/information_source_entry/information_source_state/__init__.py @@ -0,0 +1,248 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 topology +class information_source_state(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/link/te/information-source-entry/information-source-state. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Contains state attributes related to the information +source. + """ + __slots__ = ('_path_helper', '_extmethods', '__credibility_preference','__logical_network_element','__network_instance','__topology',) + + _yang_name = 'information-source-state' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__credibility_preference = YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), is_leaf=True, yang_name="credibility-preference", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint16', is_config=False) + self.__logical_network_element = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="logical-network-element", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=False) + self.__network_instance = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="network-instance", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=False) + self.__topology = YANGDynClass(base=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:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', 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 ['networks', 'network', 'link', 'te', 'information-source-entry', 'information-source-state'] + + def _get_credibility_preference(self): + """ + Getter method for credibility_preference, mapped from YANG variable /networks/network/link/te/information_source_entry/information_source_state/credibility_preference (uint16) + + YANG Description: The preference value for calculating the Traffic +Engineering database credibility value used for +tie-break selection between different information-source +values. A higher value is preferable. + """ + return self.__credibility_preference + + def _set_credibility_preference(self, v, load=False): + """ + Setter method for credibility_preference, mapped from YANG variable /networks/network/link/te/information_source_entry/information_source_state/credibility_preference (uint16) + If this variable is read-only (config: false) in the + source YANG file, then _set_credibility_preference is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_credibility_preference() directly. + + YANG Description: The preference value for calculating the Traffic +Engineering database credibility value used for +tie-break selection between different information-source +values. A higher value is preferable. + """ + 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="credibility-preference", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint16', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """credibility_preference 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="credibility-preference", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint16', is_config=False)""", + }) + + self.__credibility_preference = t + if hasattr(self, '_set'): + self._set() + + def _unset_credibility_preference(self): + self.__credibility_preference = YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), is_leaf=True, yang_name="credibility-preference", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint16', is_config=False) + + + def _get_logical_network_element(self): + """ + Getter method for logical_network_element, mapped from YANG variable /networks/network/link/te/information_source_entry/information_source_state/logical_network_element (string) + + YANG Description: When applicable, this is the name of a logical network +element from which the information is learned. + """ + return self.__logical_network_element + + def _set_logical_network_element(self, v, load=False): + """ + Setter method for logical_network_element, mapped from YANG variable /networks/network/link/te/information_source_entry/information_source_state/logical_network_element (string) + If this variable is read-only (config: false) in the + source YANG file, then _set_logical_network_element is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_logical_network_element() directly. + + YANG Description: When applicable, this is the name of a logical network +element from which the information is learned. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="logical-network-element", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """logical_network_element must be of a type compatible with string""", + 'defined-type': "string", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="logical-network-element", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=False)""", + }) + + self.__logical_network_element = t + if hasattr(self, '_set'): + self._set() + + def _unset_logical_network_element(self): + self.__logical_network_element = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="logical-network-element", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=False) + + + def _get_network_instance(self): + """ + Getter method for network_instance, mapped from YANG variable /networks/network/link/te/information_source_entry/information_source_state/network_instance (string) + + YANG Description: When applicable, this is the name of a network instance +from which the information is learned. + """ + return self.__network_instance + + def _set_network_instance(self, v, load=False): + """ + Setter method for network_instance, mapped from YANG variable /networks/network/link/te/information_source_entry/information_source_state/network_instance (string) + If this variable is read-only (config: false) in the + source YANG file, then _set_network_instance is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_network_instance() directly. + + YANG Description: When applicable, this is the name of a network instance +from which the information is learned. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="network-instance", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """network_instance must be of a type compatible with string""", + 'defined-type': "string", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="network-instance", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=False)""", + }) + + self.__network_instance = t + if hasattr(self, '_set'): + self._set() + + def _unset_network_instance(self): + self.__network_instance = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="network-instance", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=False) + + + def _get_topology(self): + """ + Getter method for topology, mapped from YANG variable /networks/network/link/te/information_source_entry/information_source_state/topology (container) + + YANG Description: When the information is processed by the system, +the attributes in this container indicate which topology +is used to generate the result information. + """ + return self.__topology + + def _set_topology(self, v, load=False): + """ + Setter method for topology, mapped from YANG variable /networks/network/link/te/information_source_entry/information_source_state/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. + + YANG Description: When the information is processed by the system, +the attributes in this container indicate which topology +is used to generate the result information. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=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:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """topology must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=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:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__topology = t + if hasattr(self, '_set'): + self._set() + + def _unset_topology(self): + self.__topology = YANGDynClass(base=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:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + credibility_preference = __builtin__.property(_get_credibility_preference) + logical_network_element = __builtin__.property(_get_logical_network_element) + network_instance = __builtin__.property(_get_network_instance) + topology = __builtin__.property(_get_topology) + + + _pyangbind_elements = OrderedDict([('credibility_preference', credibility_preference), ('logical_network_element', logical_network_element), ('network_instance', network_instance), ('topology', topology), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/information_source_entry/information_source_state/topology/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/information_source_entry/information_source_state/topology/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..0c611a8e1a8ca42bd8fd0e26b2027e038f96a3a0 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/information_source_entry/information_source_state/topology/__init__.py @@ -0,0 +1,162 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 topology(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/link/te/information-source-entry/information-source-state/topology. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: When the information is processed by the system, +the attributes in this container indicate which topology +is used to generate the result information. + """ + __slots__ = ('_path_helper', '_extmethods', '__link_ref','__network_ref',) + + _yang_name = 'topology' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__link_ref = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="link-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=False) + self.__network_ref = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="network-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', 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 ['networks', 'network', 'link', 'te', 'information-source-entry', 'information-source-state', 'topology'] + + def _get_link_ref(self): + """ + Getter method for link_ref, mapped from YANG variable /networks/network/link/te/information_source_entry/information_source_state/topology/link_ref (leafref) + + YANG Description: A type for an absolute reference to a link instance. +(This type should not be used for relative references. +In such a case, a relative path should be used instead.) + """ + return self.__link_ref + + def _set_link_ref(self, v, load=False): + """ + Setter method for link_ref, mapped from YANG variable /networks/network/link/te/information_source_entry/information_source_state/topology/link_ref (leafref) + If this variable is read-only (config: false) in the + source YANG file, then _set_link_ref is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_link_ref() directly. + + YANG Description: A type for an absolute reference to a link instance. +(This type should not be used for relative references. +In such a case, a relative path should be used instead.) + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="link-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """link_ref must be of a type compatible with leafref""", + 'defined-type': "leafref", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="link-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=False)""", + }) + + self.__link_ref = t + if hasattr(self, '_set'): + self._set() + + def _unset_link_ref(self): + self.__link_ref = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="link-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=False) + + + def _get_network_ref(self): + """ + Getter method for network_ref, mapped from YANG variable /networks/network/link/te/information_source_entry/information_source_state/topology/network_ref (leafref) + + YANG Description: Used to reference a network -- for example, an underlay +network. + """ + return self.__network_ref + + def _set_network_ref(self, v, load=False): + """ + Setter method for network_ref, mapped from YANG variable /networks/network/link/te/information_source_entry/information_source_state/topology/network_ref (leafref) + If this variable is read-only (config: false) in the + source YANG file, then _set_network_ref is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_network_ref() directly. + + YANG Description: Used to reference a network -- for example, an underlay +network. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="network-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """network_ref must be of a type compatible with leafref""", + 'defined-type': "leafref", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="network-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=False)""", + }) + + self.__network_ref = t + if hasattr(self, '_set'): + self._set() + + def _unset_network_ref(self): + self.__network_ref = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="network-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=False) + + link_ref = __builtin__.property(_get_link_ref) + network_ref = __builtin__.property(_get_network_ref) + + + _pyangbind_elements = OrderedDict([('link_ref', link_ref), ('network_ref', network_ref), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/information_source_entry/interface_switching_capability/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/information_source_entry/interface_switching_capability/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..55c5599b7241e9668f3e096676957d5d85559d6e --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/information_source_entry/interface_switching_capability/__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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 max_lsp_bandwidth +class interface_switching_capability(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/link/te/information-source-entry/interface-switching-capability. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: List of ISCDs for this link. + """ + __slots__ = ('_path_helper', '_extmethods', '__switching_capability','__encoding','__max_lsp_bandwidth',) + + _yang_name = 'interface-switching-capability' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__switching_capability = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'switching-psc1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-psc1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-psc1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-evpl': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-evpl': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-evpl': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-l2sc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-l2sc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-l2sc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-tdm': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-tdm': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-tdm': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-otn': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-otn': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-otn': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-dcsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-dcsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-dcsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-lsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-lsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-lsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-fsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-fsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-fsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="switching-capability", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + self.__encoding = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'lsp-encoding-packet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-packet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-packet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-ethernet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-ethernet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-ethernet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-pdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-pdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-pdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-sdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-sdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-sdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-digital-wrapper': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-digital-wrapper': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-digital-wrapper': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-lambda': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-lambda': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-lambda': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-fiber': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-fiber': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-fiber': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-fiber-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-fiber-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-fiber-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-oduk': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-oduk': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-oduk': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-optical-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-optical-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-optical-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-line': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-line': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-line': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="encoding", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + self.__max_lsp_bandwidth = YANGDynClass(base=YANGListType("priority",max_lsp_bandwidth.max_lsp_bandwidth, yang_name="max-lsp-bandwidth", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='priority', extensions=None), is_container='list', yang_name="max-lsp-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', 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 ['networks', 'network', 'link', 'te', 'information-source-entry', 'interface-switching-capability'] + + def _get_switching_capability(self): + """ + Getter method for switching_capability, mapped from YANG variable /networks/network/link/te/information_source_entry/interface_switching_capability/switching_capability (identityref) + + YANG Description: Switching capability for this interface. + """ + return self.__switching_capability + + def _set_switching_capability(self, v, load=False): + """ + Setter method for switching_capability, mapped from YANG variable /networks/network/link/te/information_source_entry/interface_switching_capability/switching_capability (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_switching_capability is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_switching_capability() directly. + + YANG Description: Switching capability for this 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=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'switching-psc1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-psc1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-psc1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-evpl': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-evpl': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-evpl': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-l2sc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-l2sc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-l2sc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-tdm': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-tdm': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-tdm': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-otn': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-otn': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-otn': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-dcsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-dcsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-dcsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-lsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-lsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-lsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-fsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-fsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-fsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="switching-capability", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """switching_capability must be of a type compatible with identityref""", + 'defined-type': "ietf-te-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'switching-psc1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-psc1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-psc1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-evpl': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-evpl': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-evpl': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-l2sc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-l2sc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-l2sc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-tdm': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-tdm': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-tdm': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-otn': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-otn': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-otn': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-dcsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-dcsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-dcsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-lsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-lsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-lsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-fsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-fsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-fsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="switching-capability", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False)""", + }) + + self.__switching_capability = t + if hasattr(self, '_set'): + self._set() + + def _unset_switching_capability(self): + self.__switching_capability = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'switching-psc1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-psc1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-psc1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-evpl': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-evpl': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-evpl': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-l2sc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-l2sc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-l2sc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-tdm': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-tdm': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-tdm': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-otn': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-otn': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-otn': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-dcsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-dcsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-dcsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-lsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-lsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-lsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-fsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-fsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-fsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="switching-capability", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + + + def _get_encoding(self): + """ + Getter method for encoding, mapped from YANG variable /networks/network/link/te/information_source_entry/interface_switching_capability/encoding (identityref) + + YANG Description: Encoding supported by this interface. + """ + return self.__encoding + + def _set_encoding(self, v, load=False): + """ + Setter method for encoding, mapped from YANG variable /networks/network/link/te/information_source_entry/interface_switching_capability/encoding (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_encoding is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_encoding() directly. + + YANG Description: Encoding supported by this 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=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'lsp-encoding-packet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-packet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-packet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-ethernet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-ethernet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-ethernet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-pdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-pdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-pdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-sdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-sdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-sdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-digital-wrapper': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-digital-wrapper': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-digital-wrapper': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-lambda': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-lambda': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-lambda': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-fiber': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-fiber': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-fiber': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-fiber-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-fiber-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-fiber-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-oduk': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-oduk': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-oduk': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-optical-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-optical-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-optical-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-line': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-line': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-line': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="encoding", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """encoding must be of a type compatible with identityref""", + 'defined-type': "ietf-te-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'lsp-encoding-packet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-packet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-packet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-ethernet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-ethernet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-ethernet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-pdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-pdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-pdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-sdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-sdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-sdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-digital-wrapper': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-digital-wrapper': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-digital-wrapper': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-lambda': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-lambda': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-lambda': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-fiber': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-fiber': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-fiber': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-fiber-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-fiber-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-fiber-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-oduk': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-oduk': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-oduk': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-optical-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-optical-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-optical-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-line': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-line': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-line': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="encoding", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False)""", + }) + + self.__encoding = t + if hasattr(self, '_set'): + self._set() + + def _unset_encoding(self): + self.__encoding = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'lsp-encoding-packet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-packet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-packet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-ethernet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-ethernet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-ethernet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-pdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-pdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-pdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-sdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-sdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-sdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-digital-wrapper': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-digital-wrapper': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-digital-wrapper': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-lambda': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-lambda': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-lambda': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-fiber': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-fiber': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-fiber': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-fiber-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-fiber-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-fiber-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-oduk': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-oduk': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-oduk': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-optical-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-optical-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-optical-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-line': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-line': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-line': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="encoding", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + + + def _get_max_lsp_bandwidth(self): + """ + Getter method for max_lsp_bandwidth, mapped from YANG variable /networks/network/link/te/information_source_entry/interface_switching_capability/max_lsp_bandwidth (list) + + YANG Description: Maximum Label Switched Path (LSP) bandwidth at +priorities 0-7. + """ + return self.__max_lsp_bandwidth + + def _set_max_lsp_bandwidth(self, v, load=False): + """ + Setter method for max_lsp_bandwidth, mapped from YANG variable /networks/network/link/te/information_source_entry/interface_switching_capability/max_lsp_bandwidth (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_max_lsp_bandwidth is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_max_lsp_bandwidth() directly. + + YANG Description: Maximum Label Switched Path (LSP) bandwidth at +priorities 0-7. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("priority",max_lsp_bandwidth.max_lsp_bandwidth, yang_name="max-lsp-bandwidth", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='priority', extensions=None), is_container='list', yang_name="max-lsp-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """max_lsp_bandwidth must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("priority",max_lsp_bandwidth.max_lsp_bandwidth, yang_name="max-lsp-bandwidth", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='priority', extensions=None), is_container='list', yang_name="max-lsp-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False)""", + }) + + self.__max_lsp_bandwidth = t + if hasattr(self, '_set'): + self._set() + + def _unset_max_lsp_bandwidth(self): + self.__max_lsp_bandwidth = YANGDynClass(base=YANGListType("priority",max_lsp_bandwidth.max_lsp_bandwidth, yang_name="max-lsp-bandwidth", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='priority', extensions=None), is_container='list', yang_name="max-lsp-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + + switching_capability = __builtin__.property(_get_switching_capability) + encoding = __builtin__.property(_get_encoding) + max_lsp_bandwidth = __builtin__.property(_get_max_lsp_bandwidth) + + + _pyangbind_elements = OrderedDict([('switching_capability', switching_capability), ('encoding', encoding), ('max_lsp_bandwidth', max_lsp_bandwidth), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/information_source_entry/interface_switching_capability/max_lsp_bandwidth/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/information_source_entry/interface_switching_capability/max_lsp_bandwidth/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..752eac9297da6d3ec6d48954f7a032b82abf3303 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/information_source_entry/interface_switching_capability/max_lsp_bandwidth/__init__.py @@ -0,0 +1,163 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 te_bandwidth +class max_lsp_bandwidth(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/link/te/information-source-entry/interface-switching-capability/max-lsp-bandwidth. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Maximum Label Switched Path (LSP) bandwidth at +priorities 0-7. + """ + __slots__ = ('_path_helper', '_extmethods', '__priority','__te_bandwidth',) + + _yang_name = 'max-lsp-bandwidth' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__priority = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..7']}), is_leaf=True, yang_name="priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint8', is_config=False) + self.__te_bandwidth = YANGDynClass(base=te_bandwidth.te_bandwidth, is_container='container', yang_name="te-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', 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 ['networks', 'network', 'link', 'te', 'information-source-entry', 'interface-switching-capability', 'max-lsp-bandwidth'] + + def _get_priority(self): + """ + Getter method for priority, mapped from YANG variable /networks/network/link/te/information_source_entry/interface_switching_capability/max_lsp_bandwidth/priority (uint8) + + YANG Description: Priority. + """ + return self.__priority + + def _set_priority(self, v, load=False): + """ + Setter method for priority, mapped from YANG variable /networks/network/link/te/information_source_entry/interface_switching_capability/max_lsp_bandwidth/priority (uint8) + If this variable is read-only (config: false) in the + source YANG file, then _set_priority is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_priority() directly. + + YANG Description: Priority. + """ + 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=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..7']}), is_leaf=True, yang_name="priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint8', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """priority must be of a type compatible with uint8""", + 'defined-type': "uint8", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..7']}), is_leaf=True, yang_name="priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint8', is_config=False)""", + }) + + self.__priority = t + if hasattr(self, '_set'): + self._set() + + def _unset_priority(self): + self.__priority = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..7']}), is_leaf=True, yang_name="priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint8', is_config=False) + + + def _get_te_bandwidth(self): + """ + Getter method for te_bandwidth, mapped from YANG variable /networks/network/link/te/information_source_entry/interface_switching_capability/max_lsp_bandwidth/te_bandwidth (container) + + YANG Description: Container that specifies TE bandwidth. The choices +can be augmented for specific data-plane technologies. + """ + return self.__te_bandwidth + + def _set_te_bandwidth(self, v, load=False): + """ + Setter method for te_bandwidth, mapped from YANG variable /networks/network/link/te/information_source_entry/interface_switching_capability/max_lsp_bandwidth/te_bandwidth (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_te_bandwidth is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_te_bandwidth() directly. + + YANG Description: Container that specifies TE bandwidth. The choices +can be augmented for specific data-plane technologies. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=te_bandwidth.te_bandwidth, is_container='container', yang_name="te-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """te_bandwidth must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=te_bandwidth.te_bandwidth, is_container='container', yang_name="te-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__te_bandwidth = t + if hasattr(self, '_set'): + self._set() + + def _unset_te_bandwidth(self): + self.__te_bandwidth = YANGDynClass(base=te_bandwidth.te_bandwidth, is_container='container', yang_name="te-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + priority = __builtin__.property(_get_priority) + te_bandwidth = __builtin__.property(_get_te_bandwidth) + + + _pyangbind_elements = OrderedDict([('priority', priority), ('te_bandwidth', te_bandwidth), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/information_source_entry/interface_switching_capability/max_lsp_bandwidth/te_bandwidth/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/information_source_entry/interface_switching_capability/max_lsp_bandwidth/te_bandwidth/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..4daa8700c655939dce89ef26b11e3c2d55a64fe7 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/information_source_entry/interface_switching_capability/max_lsp_bandwidth/te_bandwidth/__init__.py @@ -0,0 +1,195 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 otn +class te_bandwidth(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/link/te/information-source-entry/interface-switching-capability/max-lsp-bandwidth/te-bandwidth. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Container that specifies TE bandwidth. The choices +can be augmented for specific data-plane technologies. + """ + __slots__ = ('_path_helper', '_extmethods', '__generic','__otn','__eth_bandwidth',) + + _yang_name = 'te-bandwidth' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__generic = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+(,(0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+))*'}), is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-bandwidth', is_config=False) + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False) + self.__eth_bandwidth = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), restriction_dict={'range': ['0..10000000000']}), is_leaf=True, yang_name="eth-bandwidth", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', 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 ['networks', 'network', 'link', 'te', 'information-source-entry', 'interface-switching-capability', 'max-lsp-bandwidth', 'te-bandwidth'] + + def _get_generic(self): + """ + Getter method for generic, mapped from YANG variable /networks/network/link/te/information_source_entry/interface_switching_capability/max_lsp_bandwidth/te_bandwidth/generic (te-bandwidth) + + YANG Description: Bandwidth specified in a generic format. + """ + return self.__generic + + def _set_generic(self, v, load=False): + """ + Setter method for generic, mapped from YANG variable /networks/network/link/te/information_source_entry/interface_switching_capability/max_lsp_bandwidth/te_bandwidth/generic (te-bandwidth) + If this variable is read-only (config: false) in the + source YANG file, then _set_generic is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_generic() directly. + + YANG Description: Bandwidth specified in a generic format. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+(,(0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+))*'}), is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-bandwidth', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """generic must be of a type compatible with te-bandwidth""", + 'defined-type': "ietf-te-topology:te-bandwidth", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+(,(0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+))*'}), is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-bandwidth', is_config=False)""", + }) + + self.__generic = t + if hasattr(self, '_set'): + self._set() + + def _unset_generic(self): + self.__generic = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+(,(0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+))*'}), is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-bandwidth', is_config=False) + + + def _get_otn(self): + """ + Getter method for otn, mapped from YANG variable /networks/network/link/te/information_source_entry/interface_switching_capability/max_lsp_bandwidth/te_bandwidth/otn (container) + + YANG Description: Maximum bandwidth attributes for OTN paths. + """ + return self.__otn + + def _set_otn(self, v, load=False): + """ + Setter method for otn, mapped from YANG variable /networks/network/link/te/information_source_entry/interface_switching_capability/max_lsp_bandwidth/te_bandwidth/otn (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_otn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_otn() directly. + + YANG Description: Maximum bandwidth attributes for OTN paths. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """otn must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False)""", + }) + + self.__otn = t + if hasattr(self, '_set'): + self._set() + + def _unset_otn(self): + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False) + + + def _get_eth_bandwidth(self): + """ + Getter method for eth_bandwidth, mapped from YANG variable /networks/network/link/te/information_source_entry/interface_switching_capability/max_lsp_bandwidth/te_bandwidth/eth_bandwidth (uint64) + + YANG Description: Available bandwith value expressed in kilobits per second + """ + return self.__eth_bandwidth + + def _set_eth_bandwidth(self, v, load=False): + """ + Setter method for eth_bandwidth, mapped from YANG variable /networks/network/link/te/information_source_entry/interface_switching_capability/max_lsp_bandwidth/te_bandwidth/eth_bandwidth (uint64) + If this variable is read-only (config: false) in the + source YANG file, then _set_eth_bandwidth is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_eth_bandwidth() directly. + + YANG Description: Available bandwith value expressed in kilobits per second + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), restriction_dict={'range': ['0..10000000000']}), is_leaf=True, yang_name="eth-bandwidth", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint64', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """eth_bandwidth must be of a type compatible with uint64""", + 'defined-type': "uint64", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), restriction_dict={'range': ['0..10000000000']}), is_leaf=True, yang_name="eth-bandwidth", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint64', is_config=False)""", + }) + + self.__eth_bandwidth = t + if hasattr(self, '_set'): + self._set() + + def _unset_eth_bandwidth(self): + self.__eth_bandwidth = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), restriction_dict={'range': ['0..10000000000']}), is_leaf=True, yang_name="eth-bandwidth", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint64', is_config=False) + + generic = __builtin__.property(_get_generic) + otn = __builtin__.property(_get_otn) + eth_bandwidth = __builtin__.property(_get_eth_bandwidth) + + __choices__ = {'technology': {'generic': ['generic'], 'otn': ['otn'], 'eth': ['eth_bandwidth']}} + _pyangbind_elements = OrderedDict([('generic', generic), ('otn', otn), ('eth_bandwidth', eth_bandwidth), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/information_source_entry/interface_switching_capability/max_lsp_bandwidth/te_bandwidth/otn/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/information_source_entry/interface_switching_capability/max_lsp_bandwidth/te_bandwidth/otn/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..ad8f9372d6e04795ddb3eb99f152fd3f3e3b8ff7 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/information_source_entry/interface_switching_capability/max_lsp_bandwidth/te_bandwidth/otn/__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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 otn(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/link/te/information-source-entry/interface-switching-capability/max-lsp-bandwidth/te-bandwidth/otn. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Maximum bandwidth attributes for OTN paths. + """ + __slots__ = ('_path_helper', '_extmethods', '__odu_type','__max_ts_number',) + + _yang_name = 'otn' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__odu_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="odu-type", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=False) + self.__max_ts_number = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="max-ts-number", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', 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 ['networks', 'network', 'link', 'te', 'information-source-entry', 'interface-switching-capability', 'max-lsp-bandwidth', 'te-bandwidth', 'otn'] + + def _get_odu_type(self): + """ + Getter method for odu_type, mapped from YANG variable /networks/network/link/te/information_source_entry/interface_switching_capability/max_lsp_bandwidth/te_bandwidth/otn/odu_type (identityref) + + YANG Description: ODU type + """ + return self.__odu_type + + def _set_odu_type(self, v, load=False): + """ + Setter method for odu_type, mapped from YANG variable /networks/network/link/te/information_source_entry/interface_switching_capability/max_lsp_bandwidth/te_bandwidth/otn/odu_type (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_odu_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_odu_type() directly. + + YANG Description: ODU type + """ + 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={'ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="odu-type", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """odu_type must be of a type compatible with identityref""", + 'defined-type': "ietf-otn-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="odu-type", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=False)""", + }) + + self.__odu_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_odu_type(self): + self.__odu_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="odu-type", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=False) + + + def _get_max_ts_number(self): + """ + Getter method for max_ts_number, mapped from YANG variable /networks/network/link/te/information_source_entry/interface_switching_capability/max_lsp_bandwidth/te_bandwidth/otn/max_ts_number (uint16) + + YANG Description: The maximum number of Tributary Slots (TS) that could be +used by an ODUflex LSP. + """ + return self.__max_ts_number + + def _set_max_ts_number(self, v, load=False): + """ + Setter method for max_ts_number, mapped from YANG variable /networks/network/link/te/information_source_entry/interface_switching_capability/max_lsp_bandwidth/te_bandwidth/otn/max_ts_number (uint16) + If this variable is read-only (config: false) in the + source YANG file, then _set_max_ts_number is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_max_ts_number() directly. + + YANG Description: The maximum number of Tributary Slots (TS) that could be +used by an ODUflex LSP. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="max-ts-number", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """max_ts_number must be of a type compatible with uint16""", + 'defined-type': "uint16", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="max-ts-number", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', is_config=False)""", + }) + + self.__max_ts_number = t + if hasattr(self, '_set'): + self._set() + + def _unset_max_ts_number(self): + self.__max_ts_number = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="max-ts-number", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', is_config=False) + + odu_type = __builtin__.property(_get_odu_type) + max_ts_number = __builtin__.property(_get_max_ts_number) + + __choices__ = {'technology': {'otn': ['odu_type', 'max_ts_number']}} + _pyangbind_elements = OrderedDict([('odu_type', odu_type), ('max_ts_number', max_ts_number), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/information_source_entry/label_restrictions/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/information_source_entry/label_restrictions/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..47f225a474f9b60c3d999754bcfa23c4c6f8ce39 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/information_source_entry/label_restrictions/__init__.py @@ -0,0 +1,120 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 label_restriction +class label_restrictions(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/link/te/information-source-entry/label-restrictions. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: The label restrictions container. + """ + __slots__ = ('_path_helper', '_extmethods', '__label_restriction',) + + _yang_name = 'label-restrictions' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__label_restriction = YANGDynClass(base=YANGListType("index",label_restriction.label_restriction, yang_name="label-restriction", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='index', extensions=None), is_container='list', yang_name="label-restriction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', 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 ['networks', 'network', 'link', 'te', 'information-source-entry', 'label-restrictions'] + + def _get_label_restriction(self): + """ + Getter method for label_restriction, mapped from YANG variable /networks/network/link/te/information_source_entry/label_restrictions/label_restriction (list) + + YANG Description: The absence of the label restrictions container implies +that all labels are acceptable; otherwise, only restricted +labels are available. + """ + return self.__label_restriction + + def _set_label_restriction(self, v, load=False): + """ + Setter method for label_restriction, mapped from YANG variable /networks/network/link/te/information_source_entry/label_restrictions/label_restriction (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_label_restriction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_label_restriction() directly. + + YANG Description: The absence of the label restrictions container implies +that all labels are acceptable; otherwise, only restricted +labels are available. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("index",label_restriction.label_restriction, yang_name="label-restriction", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='index', extensions=None), is_container='list', yang_name="label-restriction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """label_restriction must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("index",label_restriction.label_restriction, yang_name="label-restriction", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='index', extensions=None), is_container='list', yang_name="label-restriction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False)""", + }) + + self.__label_restriction = t + if hasattr(self, '_set'): + self._set() + + def _unset_label_restriction(self): + self.__label_restriction = YANGDynClass(base=YANGListType("index",label_restriction.label_restriction, yang_name="label-restriction", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='index', extensions=None), is_container='list', yang_name="label-restriction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + + label_restriction = __builtin__.property(_get_label_restriction) + + + _pyangbind_elements = OrderedDict([('label_restriction', label_restriction), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/information_source_entry/label_restrictions/label_restriction/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/information_source_entry/label_restrictions/label_restriction/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..c7ec9312da9070501e2186075828475e1b5fba41 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/information_source_entry/label_restrictions/label_restriction/__init__.py @@ -0,0 +1,450 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 label_start +from . import label_end +from . import label_step +from . import otn_label_range +from . import ethernet_label_range +class label_restriction(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/link/te/information-source-entry/label-restrictions/label-restriction. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: The absence of the label restrictions container implies +that all labels are acceptable; otherwise, only restricted +labels are available. + """ + __slots__ = ('_path_helper', '_extmethods', '__restriction','__index','__label_start','__label_end','__label_step','__range_bitmap','__otn_label_range','__ethernet_label_range',) + + _yang_name = 'label-restriction' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__restriction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'inclusive': {}, 'exclusive': {}},), default=six.text_type("inclusive"), is_leaf=True, yang_name="restriction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='enumeration', is_config=False) + self.__index = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=False) + self.__label_start = YANGDynClass(base=label_start.label_start, is_container='container', yang_name="label-start", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__label_end = YANGDynClass(base=label_end.label_end, is_container='container', yang_name="label-end", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__label_step = YANGDynClass(base=label_step.label_step, is_container='container', yang_name="label-step", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__range_bitmap = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}), is_leaf=True, yang_name="range-bitmap", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:hex-string', is_config=False) + self.__otn_label_range = YANGDynClass(base=otn_label_range.otn_label_range, is_container='container', yang_name="otn-label-range", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False) + self.__ethernet_label_range = YANGDynClass(base=ethernet_label_range.ethernet_label_range, is_container='container', yang_name="ethernet-label-range", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', 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 ['networks', 'network', 'link', 'te', 'information-source-entry', 'label-restrictions', 'label-restriction'] + + def _get_restriction(self): + """ + Getter method for restriction, mapped from YANG variable /networks/network/link/te/information_source_entry/label_restrictions/label_restriction/restriction (enumeration) + + YANG Description: Indicates whether the list item is inclusive or exclusive. + """ + return self.__restriction + + def _set_restriction(self, v, load=False): + """ + Setter method for restriction, mapped from YANG variable /networks/network/link/te/information_source_entry/label_restrictions/label_restriction/restriction (enumeration) + If this variable is read-only (config: false) in the + source YANG file, then _set_restriction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_restriction() directly. + + YANG Description: Indicates whether the list item is inclusive or exclusive. + """ + 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={'inclusive': {}, 'exclusive': {}},), default=six.text_type("inclusive"), is_leaf=True, yang_name="restriction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='enumeration', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """restriction must be of a type compatible with enumeration""", + 'defined-type': "ietf-te-topology:enumeration", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'inclusive': {}, 'exclusive': {}},), default=six.text_type("inclusive"), is_leaf=True, yang_name="restriction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='enumeration', is_config=False)""", + }) + + self.__restriction = t + if hasattr(self, '_set'): + self._set() + + def _unset_restriction(self): + self.__restriction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'inclusive': {}, 'exclusive': {}},), default=six.text_type("inclusive"), is_leaf=True, yang_name="restriction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='enumeration', is_config=False) + + + def _get_index(self): + """ + Getter method for index, mapped from YANG variable /networks/network/link/te/information_source_entry/label_restrictions/label_restriction/index (uint32) + + YANG Description: The index of the label restriction list entry. + """ + return self.__index + + def _set_index(self, v, load=False): + """ + Setter method for index, mapped from YANG variable /networks/network/link/te/information_source_entry/label_restrictions/label_restriction/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 label restriction list entry. + """ + 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=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', 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), is_leaf=True, yang_name="index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', 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), is_leaf=True, yang_name="index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=False) + + + def _get_label_start(self): + """ + Getter method for label_start, mapped from YANG variable /networks/network/link/te/information_source_entry/label_restrictions/label_restriction/label_start (container) + + YANG Description: This is the starting label if a label range is specified. +This is the label value if a single label is specified, +in which case the 'label-end' attribute is not set. + """ + return self.__label_start + + def _set_label_start(self, v, load=False): + """ + Setter method for label_start, mapped from YANG variable /networks/network/link/te/information_source_entry/label_restrictions/label_restriction/label_start (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_label_start is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_label_start() directly. + + YANG Description: This is the starting label if a label range is specified. +This is the label value if a single label is specified, +in which case the 'label-end' attribute is not set. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=label_start.label_start, is_container='container', yang_name="label-start", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """label_start must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=label_start.label_start, is_container='container', yang_name="label-start", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__label_start = t + if hasattr(self, '_set'): + self._set() + + def _unset_label_start(self): + self.__label_start = YANGDynClass(base=label_start.label_start, is_container='container', yang_name="label-start", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_label_end(self): + """ + Getter method for label_end, mapped from YANG variable /networks/network/link/te/information_source_entry/label_restrictions/label_restriction/label_end (container) + + YANG Description: This is the ending label if a label range is specified. +This attribute is not set if a single label is specified. + """ + return self.__label_end + + def _set_label_end(self, v, load=False): + """ + Setter method for label_end, mapped from YANG variable /networks/network/link/te/information_source_entry/label_restrictions/label_restriction/label_end (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_label_end is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_label_end() directly. + + YANG Description: This is the ending label if a label range is specified. +This attribute is not set if a single label is specified. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=label_end.label_end, is_container='container', yang_name="label-end", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """label_end must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=label_end.label_end, is_container='container', yang_name="label-end", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__label_end = t + if hasattr(self, '_set'): + self._set() + + def _unset_label_end(self): + self.__label_end = YANGDynClass(base=label_end.label_end, is_container='container', yang_name="label-end", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_label_step(self): + """ + Getter method for label_step, mapped from YANG variable /networks/network/link/te/information_source_entry/label_restrictions/label_restriction/label_step (container) + + YANG Description: The step increment between labels in the label range. +The label start/end values will have to be consistent +with the sign of label step. For example, +'label-start' < 'label-end' enforces 'label-step' > 0 +'label-start' > 'label-end' enforces 'label-step' < 0. + """ + return self.__label_step + + def _set_label_step(self, v, load=False): + """ + Setter method for label_step, mapped from YANG variable /networks/network/link/te/information_source_entry/label_restrictions/label_restriction/label_step (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_label_step is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_label_step() directly. + + YANG Description: The step increment between labels in the label range. +The label start/end values will have to be consistent +with the sign of label step. For example, +'label-start' < 'label-end' enforces 'label-step' > 0 +'label-start' > 'label-end' enforces 'label-step' < 0. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=label_step.label_step, is_container='container', yang_name="label-step", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """label_step must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=label_step.label_step, is_container='container', yang_name="label-step", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__label_step = t + if hasattr(self, '_set'): + self._set() + + def _unset_label_step(self): + self.__label_step = YANGDynClass(base=label_step.label_step, is_container='container', yang_name="label-step", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_range_bitmap(self): + """ + Getter method for range_bitmap, mapped from YANG variable /networks/network/link/te/information_source_entry/label_restrictions/label_restriction/range_bitmap (yang:hex-string) + + YANG Description: When there are gaps between 'label-start' and 'label-end', +this attribute is used to specify the positions +of the used labels. This is represented in big endian as +'hex-string'. +The most significant byte in the hex-string is the farthest +to the left in the byte sequence. Leading zero bytes in the +configured value may be omitted for brevity. +Each bit position in the 'range-bitmap' 'hex-string' maps +to a label in the range derived from 'label-start'. + +For example, assuming that 'label-start' = 16000 and +'range-bitmap' = 0x01000001, then: + +- bit position (0) is set, and the corresponding mapped + label from the range is 16000 + (0 * 'label-step') or + 16000 for default 'label-step' = 1. +- bit position (24) is set, and the corresponding mapped + label from the range is 16000 + (24 * 'label-step') or + 16024 for default 'label-step' = 1. + """ + return self.__range_bitmap + + def _set_range_bitmap(self, v, load=False): + """ + Setter method for range_bitmap, mapped from YANG variable /networks/network/link/te/information_source_entry/label_restrictions/label_restriction/range_bitmap (yang:hex-string) + If this variable is read-only (config: false) in the + source YANG file, then _set_range_bitmap is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_range_bitmap() directly. + + YANG Description: When there are gaps between 'label-start' and 'label-end', +this attribute is used to specify the positions +of the used labels. This is represented in big endian as +'hex-string'. +The most significant byte in the hex-string is the farthest +to the left in the byte sequence. Leading zero bytes in the +configured value may be omitted for brevity. +Each bit position in the 'range-bitmap' 'hex-string' maps +to a label in the range derived from 'label-start'. + +For example, assuming that 'label-start' = 16000 and +'range-bitmap' = 0x01000001, then: + +- bit position (0) is set, and the corresponding mapped + label from the range is 16000 + (0 * 'label-step') or + 16000 for default 'label-step' = 1. +- bit position (24) is set, and the corresponding mapped + label from the range is 16000 + (24 * 'label-step') or + 16024 for default 'label-step' = 1. + """ + 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})*)?'}), is_leaf=True, yang_name="range-bitmap", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:hex-string', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """range_bitmap must be of a type compatible with yang:hex-string""", + 'defined-type': "yang:hex-string", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}), is_leaf=True, yang_name="range-bitmap", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:hex-string', is_config=False)""", + }) + + self.__range_bitmap = t + if hasattr(self, '_set'): + self._set() + + def _unset_range_bitmap(self): + self.__range_bitmap = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}), is_leaf=True, yang_name="range-bitmap", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:hex-string', is_config=False) + + + def _get_otn_label_range(self): + """ + Getter method for otn_label_range, mapped from YANG variable /networks/network/link/te/information_source_entry/label_restrictions/label_restriction/otn_label_range (container) + + YANG Description: Label range information for OTN. + """ + return self.__otn_label_range + + def _set_otn_label_range(self, v, load=False): + """ + Setter method for otn_label_range, mapped from YANG variable /networks/network/link/te/information_source_entry/label_restrictions/label_restriction/otn_label_range (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_otn_label_range is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_otn_label_range() directly. + + YANG Description: Label range information for OTN. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=otn_label_range.otn_label_range, is_container='container', yang_name="otn-label-range", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """otn_label_range must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=otn_label_range.otn_label_range, is_container='container', yang_name="otn-label-range", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False)""", + }) + + self.__otn_label_range = t + if hasattr(self, '_set'): + self._set() + + def _unset_otn_label_range(self): + self.__otn_label_range = YANGDynClass(base=otn_label_range.otn_label_range, is_container='container', yang_name="otn-label-range", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False) + + + def _get_ethernet_label_range(self): + """ + Getter method for ethernet_label_range, mapped from YANG variable /networks/network/link/te/information_source_entry/label_restrictions/label_restriction/ethernet_label_range (container) + + YANG Description: Ethernet-specific label range related information. + """ + return self.__ethernet_label_range + + def _set_ethernet_label_range(self, v, load=False): + """ + Setter method for ethernet_label_range, mapped from YANG variable /networks/network/link/te/information_source_entry/label_restrictions/label_restriction/ethernet_label_range (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_ethernet_label_range is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_ethernet_label_range() directly. + + YANG Description: Ethernet-specific label range related information. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=ethernet_label_range.ethernet_label_range, is_container='container', yang_name="ethernet-label-range", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """ethernet_label_range must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=ethernet_label_range.ethernet_label_range, is_container='container', yang_name="ethernet-label-range", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='container', is_config=False)""", + }) + + self.__ethernet_label_range = t + if hasattr(self, '_set'): + self._set() + + def _unset_ethernet_label_range(self): + self.__ethernet_label_range = YANGDynClass(base=ethernet_label_range.ethernet_label_range, is_container='container', yang_name="ethernet-label-range", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='container', is_config=False) + + restriction = __builtin__.property(_get_restriction) + index = __builtin__.property(_get_index) + label_start = __builtin__.property(_get_label_start) + label_end = __builtin__.property(_get_label_end) + label_step = __builtin__.property(_get_label_step) + range_bitmap = __builtin__.property(_get_range_bitmap) + otn_label_range = __builtin__.property(_get_otn_label_range) + ethernet_label_range = __builtin__.property(_get_ethernet_label_range) + + + _pyangbind_elements = OrderedDict([('restriction', restriction), ('index', index), ('label_start', label_start), ('label_end', label_end), ('label_step', label_step), ('range_bitmap', range_bitmap), ('otn_label_range', otn_label_range), ('ethernet_label_range', ethernet_label_range), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/information_source_entry/label_restrictions/label_restriction/ethernet_label_range/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/information_source_entry/label_restrictions/label_restriction/ethernet_label_range/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..24ee2d6c9eb7e614af7c24cb021ecf3e8bbec37f --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/information_source_entry/label_restrictions/label_restriction/ethernet_label_range/__init__.py @@ -0,0 +1,154 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 ethernet_label_range(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/link/te/information-source-entry/label-restrictions/label-restriction/ethernet-label-range. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Ethernet-specific label range related information. + """ + __slots__ = ('_path_helper', '_extmethods', '__tag_type','__priority',) + + _yang_name = 'ethernet-label-range' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__tag_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 's-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:s-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:s-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}},), is_leaf=True, yang_name="tag-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:eth-tag-type', is_config=False) + self.__priority = YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), is_leaf=True, yang_name="priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', 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 ['networks', 'network', 'link', 'te', 'information-source-entry', 'label-restrictions', 'label-restriction', 'ethernet-label-range'] + + def _get_tag_type(self): + """ + Getter method for tag_type, mapped from YANG variable /networks/network/link/te/information_source_entry/label_restrictions/label_restriction/ethernet_label_range/tag_type (etht-types:eth-tag-type) + + YANG Description: VLAN tag type. + """ + return self.__tag_type + + def _set_tag_type(self, v, load=False): + """ + Setter method for tag_type, mapped from YANG variable /networks/network/link/te/information_source_entry/label_restrictions/label_restriction/ethernet_label_range/tag_type (etht-types:eth-tag-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_tag_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tag_type() directly. + + YANG Description: VLAN tag type. + """ + 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={'c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 's-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:s-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:s-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}},), is_leaf=True, yang_name="tag-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:eth-tag-type', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tag_type must be of a type compatible with etht-types:eth-tag-type""", + 'defined-type': "etht-types:eth-tag-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 's-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:s-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:s-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}},), is_leaf=True, yang_name="tag-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:eth-tag-type', is_config=False)""", + }) + + self.__tag_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_tag_type(self): + self.__tag_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 's-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:s-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:s-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}},), is_leaf=True, yang_name="tag-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:eth-tag-type', is_config=False) + + + def _get_priority(self): + """ + Getter method for priority, mapped from YANG variable /networks/network/link/te/information_source_entry/label_restrictions/label_restriction/ethernet_label_range/priority (uint8) + + YANG Description: priority. + """ + return self.__priority + + def _set_priority(self, v, load=False): + """ + Setter method for priority, mapped from YANG variable /networks/network/link/te/information_source_entry/label_restrictions/label_restriction/ethernet_label_range/priority (uint8) + If this variable is read-only (config: false) in the + source YANG file, then _set_priority is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_priority() directly. + + YANG Description: priority. + """ + 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="priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint8', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """priority 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="priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint8', is_config=False)""", + }) + + self.__priority = t + if hasattr(self, '_set'): + self._set() + + def _unset_priority(self): + self.__priority = YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), is_leaf=True, yang_name="priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint8', is_config=False) + + tag_type = __builtin__.property(_get_tag_type) + priority = __builtin__.property(_get_priority) + + + _pyangbind_elements = OrderedDict([('tag_type', tag_type), ('priority', priority), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/information_source_entry/label_restrictions/label_restriction/label_end/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/information_source_entry/label_restrictions/label_restriction/label_end/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..105618cf962c111e7ad33e76558bc7b66b9fcc02 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/information_source_entry/label_restrictions/label_restriction/label_end/__init__.py @@ -0,0 +1,119 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 te_label +class label_end(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/link/te/information-source-entry/label-restrictions/label-restriction/label-end. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: This is the ending label if a label range is specified. +This attribute is not set if a single label is specified. + """ + __slots__ = ('_path_helper', '_extmethods', '__te_label',) + + _yang_name = 'label-end' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__te_label = YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', 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 ['networks', 'network', 'link', 'te', 'information-source-entry', 'label-restrictions', 'label-restriction', 'label-end'] + + def _get_te_label(self): + """ + Getter method for te_label, mapped from YANG variable /networks/network/link/te/information_source_entry/label_restrictions/label_restriction/label_end/te_label (container) + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + return self.__te_label + + def _set_te_label(self, v, load=False): + """ + Setter method for te_label, mapped from YANG variable /networks/network/link/te/information_source_entry/label_restrictions/label_restriction/label_end/te_label (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_te_label is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_te_label() directly. + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """te_label must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__te_label = t + if hasattr(self, '_set'): + self._set() + + def _unset_te_label(self): + self.__te_label = YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + te_label = __builtin__.property(_get_te_label) + + + _pyangbind_elements = OrderedDict([('te_label', te_label), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/information_source_entry/label_restrictions/label_restriction/label_end/te_label/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/information_source_entry/label_restrictions/label_restriction/label_end/te_label/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..696280486ca37ef012a8d6922a4b02bdb97cd962 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/information_source_entry/label_restrictions/label_restriction/label_end/te_label/__init__.py @@ -0,0 +1,234 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 otn +class te_label(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/link/te/information-source-entry/label-restrictions/label-restriction/label-end/te-label. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + __slots__ = ('_path_helper', '_extmethods', '__generic','__otn','__vlanid','__direction',) + + _yang_name = 'te-label' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__generic = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=False) + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False) + self.__vlanid = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=False) + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', 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 ['networks', 'network', 'link', 'te', 'information-source-entry', 'label-restrictions', 'label-restriction', 'label-end', 'te-label'] + + def _get_generic(self): + """ + Getter method for generic, mapped from YANG variable /networks/network/link/te/information_source_entry/label_restrictions/label_restriction/label_end/te_label/generic (rt-types:generalized-label) + + YANG Description: TE label specified in a generic format. + """ + return self.__generic + + def _set_generic(self, v, load=False): + """ + Setter method for generic, mapped from YANG variable /networks/network/link/te/information_source_entry/label_restrictions/label_restriction/label_end/te_label/generic (rt-types:generalized-label) + If this variable is read-only (config: false) in the + source YANG file, then _set_generic is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_generic() directly. + + YANG Description: TE label specified in a generic format. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """generic must be of a type compatible with rt-types:generalized-label""", + 'defined-type': "rt-types:generalized-label", + 'generated-type': """YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=False)""", + }) + + self.__generic = t + if hasattr(self, '_set'): + self._set() + + def _unset_generic(self): + self.__generic = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=False) + + + def _get_otn(self): + """ + Getter method for otn, mapped from YANG variable /networks/network/link/te/information_source_entry/label_restrictions/label_restriction/label_end/te_label/otn (container) + + YANG Description: Label start or label end for OTN. + """ + return self.__otn + + def _set_otn(self, v, load=False): + """ + Setter method for otn, mapped from YANG variable /networks/network/link/te/information_source_entry/label_restrictions/label_restriction/label_end/te_label/otn (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_otn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_otn() directly. + + YANG Description: Label start or label end for OTN. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """otn must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False)""", + }) + + self.__otn = t + if hasattr(self, '_set'): + self._set() + + def _unset_otn(self): + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False) + + + def _get_vlanid(self): + """ + Getter method for vlanid, mapped from YANG variable /networks/network/link/te/information_source_entry/label_restrictions/label_restriction/label_end/te_label/vlanid (etht-types:vlanid) + + YANG Description: VLAN tag id. + """ + return self.__vlanid + + def _set_vlanid(self, v, load=False): + """ + Setter method for vlanid, mapped from YANG variable /networks/network/link/te/information_source_entry/label_restrictions/label_restriction/label_end/te_label/vlanid (etht-types:vlanid) + If this variable is read-only (config: false) in the + source YANG file, then _set_vlanid is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_vlanid() directly. + + YANG Description: VLAN tag id. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """vlanid must be of a type compatible with etht-types:vlanid""", + 'defined-type': "etht-types:vlanid", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=False)""", + }) + + self.__vlanid = t + if hasattr(self, '_set'): + self._set() + + def _unset_vlanid(self): + self.__vlanid = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=False) + + + def _get_direction(self): + """ + Getter method for direction, mapped from YANG variable /networks/network/link/te/information_source_entry/label_restrictions/label_restriction/label_end/te_label/direction (te-label-direction) + + YANG Description: Label direction. + """ + return self.__direction + + def _set_direction(self, v, load=False): + """ + Setter method for direction, mapped from YANG variable /networks/network/link/te/information_source_entry/label_restrictions/label_restriction/label_end/te_label/direction (te-label-direction) + If this variable is read-only (config: false) in the + source YANG file, then _set_direction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_direction() directly. + + YANG Description: Label direction. + """ + 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={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """direction must be of a type compatible with te-label-direction""", + 'defined-type': "ietf-te-topology:te-label-direction", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=False)""", + }) + + self.__direction = t + if hasattr(self, '_set'): + self._set() + + def _unset_direction(self): + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=False) + + generic = __builtin__.property(_get_generic) + otn = __builtin__.property(_get_otn) + vlanid = __builtin__.property(_get_vlanid) + direction = __builtin__.property(_get_direction) + + __choices__ = {'technology': {'generic': ['generic'], 'otn': ['otn'], 'eth': ['vlanid']}} + _pyangbind_elements = OrderedDict([('generic', generic), ('otn', otn), ('vlanid', vlanid), ('direction', direction), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/information_source_entry/label_restrictions/label_restriction/label_end/te_label/otn/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/information_source_entry/label_restrictions/label_restriction/label_end/te_label/otn/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..7e552cd7f5bbd878169dcea7fcad11fababa33c3 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/information_source_entry/label_restrictions/label_restriction/label_end/te_label/otn/__init__.py @@ -0,0 +1,154 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 otn(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/link/te/information-source-entry/label-restrictions/label-restriction/label-end/te-label/otn. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Label start or label end for OTN. + """ + __slots__ = ('_path_helper', '_extmethods', '__tpn','__ts',) + + _yang_name = 'otn' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__tpn = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('range-type', 'trib-port'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=False) + self.__ts = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts", parent=self, choice=('range-type', 'trib-slot'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-ts', 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 ['networks', 'network', 'link', 'te', 'information-source-entry', 'label-restrictions', 'label-restriction', 'label-end', 'te-label', 'otn'] + + def _get_tpn(self): + """ + Getter method for tpn, mapped from YANG variable /networks/network/link/te/information_source_entry/label_restrictions/label_restriction/label_end/te_label/otn/tpn (otn-tpn) + + YANG Description: Tributary Port Number (TPN). + """ + return self.__tpn + + def _set_tpn(self, v, load=False): + """ + Setter method for tpn, mapped from YANG variable /networks/network/link/te/information_source_entry/label_restrictions/label_restriction/label_end/te_label/otn/tpn (otn-tpn) + If this variable is read-only (config: false) in the + source YANG file, then _set_tpn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tpn() directly. + + YANG Description: Tributary Port Number (TPN). + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('range-type', 'trib-port'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tpn must be of a type compatible with otn-tpn""", + 'defined-type': "ietf-otn-topology:otn-tpn", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('range-type', 'trib-port'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=False)""", + }) + + self.__tpn = t + if hasattr(self, '_set'): + self._set() + + def _unset_tpn(self): + self.__tpn = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('range-type', 'trib-port'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=False) + + + def _get_ts(self): + """ + Getter method for ts, mapped from YANG variable /networks/network/link/te/information_source_entry/label_restrictions/label_restriction/label_end/te_label/otn/ts (otn-ts) + + YANG Description: Tributary Slot (TS) number. + """ + return self.__ts + + def _set_ts(self, v, load=False): + """ + Setter method for ts, mapped from YANG variable /networks/network/link/te/information_source_entry/label_restrictions/label_restriction/label_end/te_label/otn/ts (otn-ts) + If this variable is read-only (config: false) in the + source YANG file, then _set_ts is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_ts() directly. + + YANG Description: Tributary Slot (TS) number. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts", parent=self, choice=('range-type', 'trib-slot'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-ts', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """ts must be of a type compatible with otn-ts""", + 'defined-type': "ietf-otn-topology:otn-ts", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts", parent=self, choice=('range-type', 'trib-slot'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-ts', is_config=False)""", + }) + + self.__ts = t + if hasattr(self, '_set'): + self._set() + + def _unset_ts(self): + self.__ts = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts", parent=self, choice=('range-type', 'trib-slot'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-ts', is_config=False) + + tpn = __builtin__.property(_get_tpn) + ts = __builtin__.property(_get_ts) + + __choices__ = {'range-type': {'trib-port': ['tpn'], 'trib-slot': ['ts']}} + _pyangbind_elements = OrderedDict([('tpn', tpn), ('ts', ts), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/information_source_entry/label_restrictions/label_restriction/label_start/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/information_source_entry/label_restrictions/label_restriction/label_start/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..06a33be37046c1c858cc68551313870f90938490 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/information_source_entry/label_restrictions/label_restriction/label_start/__init__.py @@ -0,0 +1,120 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 te_label +class label_start(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/link/te/information-source-entry/label-restrictions/label-restriction/label-start. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: This is the starting label if a label range is specified. +This is the label value if a single label is specified, +in which case the 'label-end' attribute is not set. + """ + __slots__ = ('_path_helper', '_extmethods', '__te_label',) + + _yang_name = 'label-start' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__te_label = YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', 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 ['networks', 'network', 'link', 'te', 'information-source-entry', 'label-restrictions', 'label-restriction', 'label-start'] + + def _get_te_label(self): + """ + Getter method for te_label, mapped from YANG variable /networks/network/link/te/information_source_entry/label_restrictions/label_restriction/label_start/te_label (container) + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + return self.__te_label + + def _set_te_label(self, v, load=False): + """ + Setter method for te_label, mapped from YANG variable /networks/network/link/te/information_source_entry/label_restrictions/label_restriction/label_start/te_label (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_te_label is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_te_label() directly. + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """te_label must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__te_label = t + if hasattr(self, '_set'): + self._set() + + def _unset_te_label(self): + self.__te_label = YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + te_label = __builtin__.property(_get_te_label) + + + _pyangbind_elements = OrderedDict([('te_label', te_label), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/information_source_entry/label_restrictions/label_restriction/label_start/te_label/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/information_source_entry/label_restrictions/label_restriction/label_start/te_label/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..1d3235b9852c0ba32525cff5dedaa0c3520aca84 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/information_source_entry/label_restrictions/label_restriction/label_start/te_label/__init__.py @@ -0,0 +1,234 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 otn +class te_label(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/link/te/information-source-entry/label-restrictions/label-restriction/label-start/te-label. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + __slots__ = ('_path_helper', '_extmethods', '__generic','__otn','__vlanid','__direction',) + + _yang_name = 'te-label' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__generic = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=False) + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False) + self.__vlanid = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=False) + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', 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 ['networks', 'network', 'link', 'te', 'information-source-entry', 'label-restrictions', 'label-restriction', 'label-start', 'te-label'] + + def _get_generic(self): + """ + Getter method for generic, mapped from YANG variable /networks/network/link/te/information_source_entry/label_restrictions/label_restriction/label_start/te_label/generic (rt-types:generalized-label) + + YANG Description: TE label specified in a generic format. + """ + return self.__generic + + def _set_generic(self, v, load=False): + """ + Setter method for generic, mapped from YANG variable /networks/network/link/te/information_source_entry/label_restrictions/label_restriction/label_start/te_label/generic (rt-types:generalized-label) + If this variable is read-only (config: false) in the + source YANG file, then _set_generic is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_generic() directly. + + YANG Description: TE label specified in a generic format. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """generic must be of a type compatible with rt-types:generalized-label""", + 'defined-type': "rt-types:generalized-label", + 'generated-type': """YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=False)""", + }) + + self.__generic = t + if hasattr(self, '_set'): + self._set() + + def _unset_generic(self): + self.__generic = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=False) + + + def _get_otn(self): + """ + Getter method for otn, mapped from YANG variable /networks/network/link/te/information_source_entry/label_restrictions/label_restriction/label_start/te_label/otn (container) + + YANG Description: Label start or label end for OTN. + """ + return self.__otn + + def _set_otn(self, v, load=False): + """ + Setter method for otn, mapped from YANG variable /networks/network/link/te/information_source_entry/label_restrictions/label_restriction/label_start/te_label/otn (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_otn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_otn() directly. + + YANG Description: Label start or label end for OTN. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """otn must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False)""", + }) + + self.__otn = t + if hasattr(self, '_set'): + self._set() + + def _unset_otn(self): + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False) + + + def _get_vlanid(self): + """ + Getter method for vlanid, mapped from YANG variable /networks/network/link/te/information_source_entry/label_restrictions/label_restriction/label_start/te_label/vlanid (etht-types:vlanid) + + YANG Description: VLAN tag id. + """ + return self.__vlanid + + def _set_vlanid(self, v, load=False): + """ + Setter method for vlanid, mapped from YANG variable /networks/network/link/te/information_source_entry/label_restrictions/label_restriction/label_start/te_label/vlanid (etht-types:vlanid) + If this variable is read-only (config: false) in the + source YANG file, then _set_vlanid is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_vlanid() directly. + + YANG Description: VLAN tag id. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """vlanid must be of a type compatible with etht-types:vlanid""", + 'defined-type': "etht-types:vlanid", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=False)""", + }) + + self.__vlanid = t + if hasattr(self, '_set'): + self._set() + + def _unset_vlanid(self): + self.__vlanid = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=False) + + + def _get_direction(self): + """ + Getter method for direction, mapped from YANG variable /networks/network/link/te/information_source_entry/label_restrictions/label_restriction/label_start/te_label/direction (te-label-direction) + + YANG Description: Label direction. + """ + return self.__direction + + def _set_direction(self, v, load=False): + """ + Setter method for direction, mapped from YANG variable /networks/network/link/te/information_source_entry/label_restrictions/label_restriction/label_start/te_label/direction (te-label-direction) + If this variable is read-only (config: false) in the + source YANG file, then _set_direction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_direction() directly. + + YANG Description: Label direction. + """ + 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={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """direction must be of a type compatible with te-label-direction""", + 'defined-type': "ietf-te-topology:te-label-direction", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=False)""", + }) + + self.__direction = t + if hasattr(self, '_set'): + self._set() + + def _unset_direction(self): + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=False) + + generic = __builtin__.property(_get_generic) + otn = __builtin__.property(_get_otn) + vlanid = __builtin__.property(_get_vlanid) + direction = __builtin__.property(_get_direction) + + __choices__ = {'technology': {'generic': ['generic'], 'otn': ['otn'], 'eth': ['vlanid']}} + _pyangbind_elements = OrderedDict([('generic', generic), ('otn', otn), ('vlanid', vlanid), ('direction', direction), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/information_source_entry/label_restrictions/label_restriction/label_start/te_label/otn/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/information_source_entry/label_restrictions/label_restriction/label_start/te_label/otn/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..4a9eb242fbf4924e016e63eea71592da5037c09c --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/information_source_entry/label_restrictions/label_restriction/label_start/te_label/otn/__init__.py @@ -0,0 +1,154 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 otn(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/link/te/information-source-entry/label-restrictions/label-restriction/label-start/te-label/otn. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Label start or label end for OTN. + """ + __slots__ = ('_path_helper', '_extmethods', '__tpn','__ts',) + + _yang_name = 'otn' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__tpn = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('range-type', 'trib-port'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=False) + self.__ts = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts", parent=self, choice=('range-type', 'trib-slot'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-ts', 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 ['networks', 'network', 'link', 'te', 'information-source-entry', 'label-restrictions', 'label-restriction', 'label-start', 'te-label', 'otn'] + + def _get_tpn(self): + """ + Getter method for tpn, mapped from YANG variable /networks/network/link/te/information_source_entry/label_restrictions/label_restriction/label_start/te_label/otn/tpn (otn-tpn) + + YANG Description: Tributary Port Number (TPN). + """ + return self.__tpn + + def _set_tpn(self, v, load=False): + """ + Setter method for tpn, mapped from YANG variable /networks/network/link/te/information_source_entry/label_restrictions/label_restriction/label_start/te_label/otn/tpn (otn-tpn) + If this variable is read-only (config: false) in the + source YANG file, then _set_tpn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tpn() directly. + + YANG Description: Tributary Port Number (TPN). + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('range-type', 'trib-port'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tpn must be of a type compatible with otn-tpn""", + 'defined-type': "ietf-otn-topology:otn-tpn", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('range-type', 'trib-port'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=False)""", + }) + + self.__tpn = t + if hasattr(self, '_set'): + self._set() + + def _unset_tpn(self): + self.__tpn = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('range-type', 'trib-port'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=False) + + + def _get_ts(self): + """ + Getter method for ts, mapped from YANG variable /networks/network/link/te/information_source_entry/label_restrictions/label_restriction/label_start/te_label/otn/ts (otn-ts) + + YANG Description: Tributary Slot (TS) number. + """ + return self.__ts + + def _set_ts(self, v, load=False): + """ + Setter method for ts, mapped from YANG variable /networks/network/link/te/information_source_entry/label_restrictions/label_restriction/label_start/te_label/otn/ts (otn-ts) + If this variable is read-only (config: false) in the + source YANG file, then _set_ts is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_ts() directly. + + YANG Description: Tributary Slot (TS) number. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts", parent=self, choice=('range-type', 'trib-slot'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-ts', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """ts must be of a type compatible with otn-ts""", + 'defined-type': "ietf-otn-topology:otn-ts", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts", parent=self, choice=('range-type', 'trib-slot'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-ts', is_config=False)""", + }) + + self.__ts = t + if hasattr(self, '_set'): + self._set() + + def _unset_ts(self): + self.__ts = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts", parent=self, choice=('range-type', 'trib-slot'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-ts', is_config=False) + + tpn = __builtin__.property(_get_tpn) + ts = __builtin__.property(_get_ts) + + __choices__ = {'range-type': {'trib-port': ['tpn'], 'trib-slot': ['ts']}} + _pyangbind_elements = OrderedDict([('tpn', tpn), ('ts', ts), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/information_source_entry/label_restrictions/label_restriction/label_step/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/information_source_entry/label_restrictions/label_restriction/label_step/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e7fa272ea37185dd4b507c1e4be37a069b4bdb30 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/information_source_entry/label_restrictions/label_restriction/label_step/__init__.py @@ -0,0 +1,200 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 otn +class label_step(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/link/te/information-source-entry/label-restrictions/label-restriction/label-step. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: The step increment between labels in the label range. +The label start/end values will have to be consistent +with the sign of label step. For example, +'label-start' < 'label-end' enforces 'label-step' > 0 +'label-start' > 'label-end' enforces 'label-step' < 0. + """ + __slots__ = ('_path_helper', '_extmethods', '__generic','__otn','__eth_step',) + + _yang_name = 'label-step' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__generic = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['-2147483648..2147483647']}, int_size=32), default=RestrictedClassType(base_type=long, restriction_dict={'range': ['-2147483648..2147483647']}, int_size=32)(1), is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='int32', is_config=False) + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False) + self.__eth_step = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), default=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16)(1), is_leaf=True, yang_name="eth-step", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint16', 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 ['networks', 'network', 'link', 'te', 'information-source-entry', 'label-restrictions', 'label-restriction', 'label-step'] + + def _get_generic(self): + """ + Getter method for generic, mapped from YANG variable /networks/network/link/te/information_source_entry/label_restrictions/label_restriction/label_step/generic (int32) + + YANG Description: Label range step. + """ + return self.__generic + + def _set_generic(self, v, load=False): + """ + Setter method for generic, mapped from YANG variable /networks/network/link/te/information_source_entry/label_restrictions/label_restriction/label_step/generic (int32) + If this variable is read-only (config: false) in the + source YANG file, then _set_generic is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_generic() directly. + + YANG Description: Label range step. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['-2147483648..2147483647']}, int_size=32), default=RestrictedClassType(base_type=long, restriction_dict={'range': ['-2147483648..2147483647']}, int_size=32)(1), is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='int32', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """generic must be of a type compatible with int32""", + 'defined-type': "int32", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['-2147483648..2147483647']}, int_size=32), default=RestrictedClassType(base_type=long, restriction_dict={'range': ['-2147483648..2147483647']}, int_size=32)(1), is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='int32', is_config=False)""", + }) + + self.__generic = t + if hasattr(self, '_set'): + self._set() + + def _unset_generic(self): + self.__generic = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['-2147483648..2147483647']}, int_size=32), default=RestrictedClassType(base_type=long, restriction_dict={'range': ['-2147483648..2147483647']}, int_size=32)(1), is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='int32', is_config=False) + + + def _get_otn(self): + """ + Getter method for otn, mapped from YANG variable /networks/network/link/te/information_source_entry/label_restrictions/label_restriction/label_step/otn (container) + + YANG Description: Label step for OTN + """ + return self.__otn + + def _set_otn(self, v, load=False): + """ + Setter method for otn, mapped from YANG variable /networks/network/link/te/information_source_entry/label_restrictions/label_restriction/label_step/otn (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_otn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_otn() directly. + + YANG Description: Label step for OTN + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """otn must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False)""", + }) + + self.__otn = t + if hasattr(self, '_set'): + self._set() + + def _unset_otn(self): + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False) + + + def _get_eth_step(self): + """ + Getter method for eth_step, mapped from YANG variable /networks/network/link/te/information_source_entry/label_restrictions/label_restriction/label_step/eth_step (uint16) + + YANG Description: Label step which represent possible increments for +an Ethernet VLAN tag. + """ + return self.__eth_step + + def _set_eth_step(self, v, load=False): + """ + Setter method for eth_step, mapped from YANG variable /networks/network/link/te/information_source_entry/label_restrictions/label_restriction/label_step/eth_step (uint16) + If this variable is read-only (config: false) in the + source YANG file, then _set_eth_step is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_eth_step() directly. + + YANG Description: Label step which represent possible increments for +an Ethernet VLAN tag. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), default=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16)(1), is_leaf=True, yang_name="eth-step", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint16', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """eth_step must be of a type compatible with uint16""", + 'defined-type': "uint16", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), default=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16)(1), is_leaf=True, yang_name="eth-step", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint16', is_config=False)""", + }) + + self.__eth_step = t + if hasattr(self, '_set'): + self._set() + + def _unset_eth_step(self): + self.__eth_step = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), default=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16)(1), is_leaf=True, yang_name="eth-step", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint16', is_config=False) + + generic = __builtin__.property(_get_generic) + otn = __builtin__.property(_get_otn) + eth_step = __builtin__.property(_get_eth_step) + + __choices__ = {'technology': {'generic': ['generic'], 'otn': ['otn'], 'eth': ['eth_step']}} + _pyangbind_elements = OrderedDict([('generic', generic), ('otn', otn), ('eth_step', eth_step), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/information_source_entry/label_restrictions/label_restriction/label_step/otn/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/information_source_entry/label_restrictions/label_restriction/label_step/otn/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..335aed796e0f84d0f3731e9be362cae8cc4f2965 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/information_source_entry/label_restrictions/label_restriction/label_step/otn/__init__.py @@ -0,0 +1,158 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 otn(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/link/te/information-source-entry/label-restrictions/label-restriction/label-step/otn. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Label step for OTN + """ + __slots__ = ('_path_helper', '_extmethods', '__tpn','__ts',) + + _yang_name = 'otn' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__tpn = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('range-type', 'trib-port'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=False) + self.__ts = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts", parent=self, choice=('range-type', 'trib-slot'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-ts', 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 ['networks', 'network', 'link', 'te', 'information-source-entry', 'label-restrictions', 'label-restriction', 'label-step', 'otn'] + + def _get_tpn(self): + """ + Getter method for tpn, mapped from YANG variable /networks/network/link/te/information_source_entry/label_restrictions/label_restriction/label_step/otn/tpn (otn-tpn) + + YANG Description: Label step which represents possible increments for +Tributary Port Number (TPN). + """ + return self.__tpn + + def _set_tpn(self, v, load=False): + """ + Setter method for tpn, mapped from YANG variable /networks/network/link/te/information_source_entry/label_restrictions/label_restriction/label_step/otn/tpn (otn-tpn) + If this variable is read-only (config: false) in the + source YANG file, then _set_tpn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tpn() directly. + + YANG Description: Label step which represents possible increments for +Tributary Port Number (TPN). + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('range-type', 'trib-port'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tpn must be of a type compatible with otn-tpn""", + 'defined-type': "ietf-otn-topology:otn-tpn", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('range-type', 'trib-port'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=False)""", + }) + + self.__tpn = t + if hasattr(self, '_set'): + self._set() + + def _unset_tpn(self): + self.__tpn = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('range-type', 'trib-port'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=False) + + + def _get_ts(self): + """ + Getter method for ts, mapped from YANG variable /networks/network/link/te/information_source_entry/label_restrictions/label_restriction/label_step/otn/ts (otn-ts) + + YANG Description: Label step which represents possible increments for +Tributary Slot (TS) number. + """ + return self.__ts + + def _set_ts(self, v, load=False): + """ + Setter method for ts, mapped from YANG variable /networks/network/link/te/information_source_entry/label_restrictions/label_restriction/label_step/otn/ts (otn-ts) + If this variable is read-only (config: false) in the + source YANG file, then _set_ts is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_ts() directly. + + YANG Description: Label step which represents possible increments for +Tributary Slot (TS) number. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts", parent=self, choice=('range-type', 'trib-slot'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-ts', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """ts must be of a type compatible with otn-ts""", + 'defined-type': "ietf-otn-topology:otn-ts", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts", parent=self, choice=('range-type', 'trib-slot'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-ts', is_config=False)""", + }) + + self.__ts = t + if hasattr(self, '_set'): + self._set() + + def _unset_ts(self): + self.__ts = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts", parent=self, choice=('range-type', 'trib-slot'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-ts', is_config=False) + + tpn = __builtin__.property(_get_tpn) + ts = __builtin__.property(_get_ts) + + __choices__ = {'range-type': {'trib-port': ['tpn'], 'trib-slot': ['ts']}} + _pyangbind_elements = OrderedDict([('tpn', tpn), ('ts', ts), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/information_source_entry/label_restrictions/label_restriction/otn_label_range/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/information_source_entry/label_restrictions/label_restriction/otn_label_range/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..0c3ff7aaa3f7c1b854e39cc8354e4266ba4edcc7 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/information_source_entry/label_restrictions/label_restriction/otn_label_range/__init__.py @@ -0,0 +1,256 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 otn_label_range(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/link/te/information-source-entry/label-restrictions/label-restriction/otn-label-range. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Label range information for OTN. + """ + __slots__ = ('_path_helper', '_extmethods', '__range_type','__tsg','__odu_type_list','__priority',) + + _yang_name = 'otn-label-range' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__range_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'trib-slot': {}, 'trib-port': {}},), is_leaf=True, yang_name="range-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-label-range-type', is_config=False) + self.__tsg = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=False) + self.__odu_type_list = YANGDynClass(unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},)), is_leaf=False, yang_name="odu-type-list", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=False) + self.__priority = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..7']}), is_leaf=True, yang_name="priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', 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 ['networks', 'network', 'link', 'te', 'information-source-entry', 'label-restrictions', 'label-restriction', 'otn-label-range'] + + def _get_range_type(self): + """ + Getter method for range_type, mapped from YANG variable /networks/network/link/te/information_source_entry/label_restrictions/label_restriction/otn_label_range/range_type (otn-label-range-type) + + YANG Description: The type of range (e.g., TPN or TS) +to which the label range applies + """ + return self.__range_type + + def _set_range_type(self, v, load=False): + """ + Setter method for range_type, mapped from YANG variable /networks/network/link/te/information_source_entry/label_restrictions/label_restriction/otn_label_range/range_type (otn-label-range-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_range_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_range_type() directly. + + YANG Description: The type of range (e.g., TPN or TS) +to which the label range applies + """ + 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={'trib-slot': {}, 'trib-port': {}},), is_leaf=True, yang_name="range-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-label-range-type', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """range_type must be of a type compatible with otn-label-range-type""", + 'defined-type': "ietf-otn-topology:otn-label-range-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'trib-slot': {}, 'trib-port': {}},), is_leaf=True, yang_name="range-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-label-range-type', is_config=False)""", + }) + + self.__range_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_range_type(self): + self.__range_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'trib-slot': {}, 'trib-port': {}},), is_leaf=True, yang_name="range-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-label-range-type', is_config=False) + + + def _get_tsg(self): + """ + Getter method for tsg, mapped from YANG variable /networks/network/link/te/information_source_entry/label_restrictions/label_restriction/otn_label_range/tsg (identityref) + + YANG Description: Tributary slot granularity (TSG) to which the label range +applies. + +This leaf MUST be present when the range-type is TS. + +This leaf MAY be omitted when mapping an ODUk over an OTUk +Link. In this case the range-type is tpn, with only one +entry (ODUk), and the tpn range has only one value (1). + """ + return self.__tsg + + def _set_tsg(self, v, load=False): + """ + Setter method for tsg, mapped from YANG variable /networks/network/link/te/information_source_entry/label_restrictions/label_restriction/otn_label_range/tsg (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_tsg is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tsg() directly. + + YANG Description: Tributary slot granularity (TSG) to which the label range +applies. + +This leaf MUST be present when the range-type is TS. + +This leaf MAY be omitted when mapping an ODUk over an OTUk +Link. In this case the range-type is tpn, with only one +entry (ODUk), and the tpn range has only one value (1). + """ + 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={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tsg must be of a type compatible with identityref""", + 'defined-type': "ietf-otn-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=False)""", + }) + + self.__tsg = t + if hasattr(self, '_set'): + self._set() + + def _unset_tsg(self): + self.__tsg = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=False) + + + def _get_odu_type_list(self): + """ + Getter method for odu_type_list, mapped from YANG variable /networks/network/link/te/information_source_entry/label_restrictions/label_restriction/otn_label_range/odu_type_list (identityref) + + YANG Description: List of ODU types to which the label range applies. + +An Empty odu-type-list means that the label range +applies to all the supported ODU types. + """ + return self.__odu_type_list + + def _set_odu_type_list(self, v, load=False): + """ + Setter method for odu_type_list, mapped from YANG variable /networks/network/link/te/information_source_entry/label_restrictions/label_restriction/otn_label_range/odu_type_list (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_odu_type_list is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_odu_type_list() directly. + + YANG Description: List of ODU types to which the label range applies. + +An Empty odu-type-list means that the label range +applies to all the supported ODU types. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},)), is_leaf=False, yang_name="odu-type-list", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """odu_type_list must be of a type compatible with identityref""", + 'defined-type': "ietf-otn-topology:identityref", + 'generated-type': """YANGDynClass(unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},)), is_leaf=False, yang_name="odu-type-list", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=False)""", + }) + + self.__odu_type_list = t + if hasattr(self, '_set'): + self._set() + + def _unset_odu_type_list(self): + self.__odu_type_list = YANGDynClass(unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},)), is_leaf=False, yang_name="odu-type-list", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=False) + + + def _get_priority(self): + """ + Getter method for priority, mapped from YANG variable /networks/network/link/te/information_source_entry/label_restrictions/label_restriction/otn_label_range/priority (uint8) + + YANG Description: Priority in Interface Switching Capability +Descriptor (ISCD). + """ + return self.__priority + + def _set_priority(self, v, load=False): + """ + Setter method for priority, mapped from YANG variable /networks/network/link/te/information_source_entry/label_restrictions/label_restriction/otn_label_range/priority (uint8) + If this variable is read-only (config: false) in the + source YANG file, then _set_priority is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_priority() directly. + + YANG Description: Priority in Interface Switching Capability +Descriptor (ISCD). + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..7']}), is_leaf=True, yang_name="priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint8', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """priority must be of a type compatible with uint8""", + 'defined-type': "uint8", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..7']}), is_leaf=True, yang_name="priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint8', is_config=False)""", + }) + + self.__priority = t + if hasattr(self, '_set'): + self._set() + + def _unset_priority(self): + self.__priority = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..7']}), is_leaf=True, yang_name="priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint8', is_config=False) + + range_type = __builtin__.property(_get_range_type) + tsg = __builtin__.property(_get_tsg) + odu_type_list = __builtin__.property(_get_odu_type_list) + priority = __builtin__.property(_get_priority) + + + _pyangbind_elements = OrderedDict([('range_type', range_type), ('tsg', tsg), ('odu_type_list', odu_type_list), ('priority', priority), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/information_source_entry/max_link_bandwidth/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/information_source_entry/max_link_bandwidth/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..cfa184bcb7f70d3487c2ef807e7a4dc7f183a019 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/information_source_entry/max_link_bandwidth/__init__.py @@ -0,0 +1,119 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 te_bandwidth +class max_link_bandwidth(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/link/te/information-source-entry/max-link-bandwidth. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Maximum bandwidth that can be seen on this link in this +direction. Units are in bytes per second. + """ + __slots__ = ('_path_helper', '_extmethods', '__te_bandwidth',) + + _yang_name = 'max-link-bandwidth' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__te_bandwidth = YANGDynClass(base=te_bandwidth.te_bandwidth, is_container='container', yang_name="te-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', 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 ['networks', 'network', 'link', 'te', 'information-source-entry', 'max-link-bandwidth'] + + def _get_te_bandwidth(self): + """ + Getter method for te_bandwidth, mapped from YANG variable /networks/network/link/te/information_source_entry/max_link_bandwidth/te_bandwidth (container) + + YANG Description: Container that specifies TE bandwidth. The choices +can be augmented for specific data-plane technologies. + """ + return self.__te_bandwidth + + def _set_te_bandwidth(self, v, load=False): + """ + Setter method for te_bandwidth, mapped from YANG variable /networks/network/link/te/information_source_entry/max_link_bandwidth/te_bandwidth (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_te_bandwidth is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_te_bandwidth() directly. + + YANG Description: Container that specifies TE bandwidth. The choices +can be augmented for specific data-plane technologies. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=te_bandwidth.te_bandwidth, is_container='container', yang_name="te-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """te_bandwidth must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=te_bandwidth.te_bandwidth, is_container='container', yang_name="te-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__te_bandwidth = t + if hasattr(self, '_set'): + self._set() + + def _unset_te_bandwidth(self): + self.__te_bandwidth = YANGDynClass(base=te_bandwidth.te_bandwidth, is_container='container', yang_name="te-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + te_bandwidth = __builtin__.property(_get_te_bandwidth) + + + _pyangbind_elements = OrderedDict([('te_bandwidth', te_bandwidth), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/information_source_entry/max_link_bandwidth/te_bandwidth/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/information_source_entry/max_link_bandwidth/te_bandwidth/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..26e64557cb2e40f6f9e91f44530f26bca4d556fb --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/information_source_entry/max_link_bandwidth/te_bandwidth/__init__.py @@ -0,0 +1,195 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 otn +class te_bandwidth(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/link/te/information-source-entry/max-link-bandwidth/te-bandwidth. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Container that specifies TE bandwidth. The choices +can be augmented for specific data-plane technologies. + """ + __slots__ = ('_path_helper', '_extmethods', '__generic','__otn','__eth_bandwidth',) + + _yang_name = 'te-bandwidth' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__generic = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+(,(0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+))*'}), is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-bandwidth', is_config=False) + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False) + self.__eth_bandwidth = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), restriction_dict={'range': ['0..10000000000']}), is_leaf=True, yang_name="eth-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', 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 ['networks', 'network', 'link', 'te', 'information-source-entry', 'max-link-bandwidth', 'te-bandwidth'] + + def _get_generic(self): + """ + Getter method for generic, mapped from YANG variable /networks/network/link/te/information_source_entry/max_link_bandwidth/te_bandwidth/generic (te-bandwidth) + + YANG Description: Bandwidth specified in a generic format. + """ + return self.__generic + + def _set_generic(self, v, load=False): + """ + Setter method for generic, mapped from YANG variable /networks/network/link/te/information_source_entry/max_link_bandwidth/te_bandwidth/generic (te-bandwidth) + If this variable is read-only (config: false) in the + source YANG file, then _set_generic is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_generic() directly. + + YANG Description: Bandwidth specified in a generic format. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+(,(0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+))*'}), is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-bandwidth', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """generic must be of a type compatible with te-bandwidth""", + 'defined-type': "ietf-te-topology:te-bandwidth", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+(,(0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+))*'}), is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-bandwidth', is_config=False)""", + }) + + self.__generic = t + if hasattr(self, '_set'): + self._set() + + def _unset_generic(self): + self.__generic = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+(,(0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+))*'}), is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-bandwidth', is_config=False) + + + def _get_otn(self): + """ + Getter method for otn, mapped from YANG variable /networks/network/link/te/information_source_entry/max_link_bandwidth/te_bandwidth/otn (container) + + YANG Description: Bandwidth attributes for OTN links + """ + return self.__otn + + def _set_otn(self, v, load=False): + """ + Setter method for otn, mapped from YANG variable /networks/network/link/te/information_source_entry/max_link_bandwidth/te_bandwidth/otn (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_otn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_otn() directly. + + YANG Description: Bandwidth attributes for OTN links + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=otn.otn, is_container='container', yang_name="otn", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """otn must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False)""", + }) + + self.__otn = t + if hasattr(self, '_set'): + self._set() + + def _unset_otn(self): + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False) + + + def _get_eth_bandwidth(self): + """ + Getter method for eth_bandwidth, mapped from YANG variable /networks/network/link/te/information_source_entry/max_link_bandwidth/te_bandwidth/eth_bandwidth (uint64) + + YANG Description: Available bandwith value expressed in kilobits per second + """ + return self.__eth_bandwidth + + def _set_eth_bandwidth(self, v, load=False): + """ + Setter method for eth_bandwidth, mapped from YANG variable /networks/network/link/te/information_source_entry/max_link_bandwidth/te_bandwidth/eth_bandwidth (uint64) + If this variable is read-only (config: false) in the + source YANG file, then _set_eth_bandwidth is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_eth_bandwidth() directly. + + YANG Description: Available bandwith value expressed in kilobits per second + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), restriction_dict={'range': ['0..10000000000']}), is_leaf=True, yang_name="eth-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint64', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """eth_bandwidth must be of a type compatible with uint64""", + 'defined-type': "uint64", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), restriction_dict={'range': ['0..10000000000']}), is_leaf=True, yang_name="eth-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint64', is_config=False)""", + }) + + self.__eth_bandwidth = t + if hasattr(self, '_set'): + self._set() + + def _unset_eth_bandwidth(self): + self.__eth_bandwidth = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), restriction_dict={'range': ['0..10000000000']}), is_leaf=True, yang_name="eth-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint64', is_config=False) + + generic = __builtin__.property(_get_generic) + otn = __builtin__.property(_get_otn) + eth_bandwidth = __builtin__.property(_get_eth_bandwidth) + + __choices__ = {'technology': {'generic': ['generic']}} + _pyangbind_elements = OrderedDict([('generic', generic), ('otn', otn), ('eth_bandwidth', eth_bandwidth), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/information_source_entry/max_link_bandwidth/te_bandwidth/otn/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/information_source_entry/max_link_bandwidth/te_bandwidth/otn/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..ff7bba04afb55d61988936b62f141b6ae3796755 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/information_source_entry/max_link_bandwidth/te_bandwidth/otn/__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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 odulist +class otn(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/link/te/information-source-entry/max-link-bandwidth/te-bandwidth/otn. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Bandwidth attributes for OTN links + """ + __slots__ = ('_path_helper', '_extmethods', '__odulist',) + + _yang_name = 'otn' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__odulist = YANGDynClass(base=YANGListType("odu_type",odulist.odulist, yang_name="odulist", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='odu-type', extensions=None), is_container='list', yang_name="odulist", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='list', 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 ['networks', 'network', 'link', 'te', 'information-source-entry', 'max-link-bandwidth', 'te-bandwidth', 'otn'] + + def _get_odulist(self): + """ + Getter method for odulist, mapped from YANG variable /networks/network/link/te/information_source_entry/max_link_bandwidth/te_bandwidth/otn/odulist (list) + + YANG Description: OTN bandwidth definition + """ + return self.__odulist + + def _set_odulist(self, v, load=False): + """ + Setter method for odulist, mapped from YANG variable /networks/network/link/te/information_source_entry/max_link_bandwidth/te_bandwidth/otn/odulist (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_odulist is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_odulist() directly. + + YANG Description: OTN bandwidth definition + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("odu_type",odulist.odulist, yang_name="odulist", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='odu-type', extensions=None), is_container='list', yang_name="odulist", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='list', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """odulist must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("odu_type",odulist.odulist, yang_name="odulist", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='odu-type', extensions=None), is_container='list', yang_name="odulist", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='list', is_config=False)""", + }) + + self.__odulist = t + if hasattr(self, '_set'): + self._set() + + def _unset_odulist(self): + self.__odulist = YANGDynClass(base=YANGListType("odu_type",odulist.odulist, yang_name="odulist", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='odu-type', extensions=None), is_container='list', yang_name="odulist", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='list', is_config=False) + + odulist = __builtin__.property(_get_odulist) + + + _pyangbind_elements = OrderedDict([('odulist', odulist), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/information_source_entry/max_link_bandwidth/te_bandwidth/otn/odulist/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/information_source_entry/max_link_bandwidth/te_bandwidth/otn/odulist/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..544fbbda76a2a0fb4dc5fc3fb7236780515fa20f --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/information_source_entry/max_link_bandwidth/te_bandwidth/otn/odulist/__init__.py @@ -0,0 +1,200 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 odulist(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/link/te/information-source-entry/max-link-bandwidth/te-bandwidth/otn/odulist. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: OTN bandwidth definition + """ + __slots__ = ('_path_helper', '_extmethods', '__odu_type','__number','__ts_number',) + + _yang_name = 'odulist' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__odu_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="odu-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=False) + self.__number = YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), is_leaf=True, yang_name="number", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', is_config=False) + self.__ts_number = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts-number", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', 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 ['networks', 'network', 'link', 'te', 'information-source-entry', 'max-link-bandwidth', 'te-bandwidth', 'otn', 'odulist'] + + def _get_odu_type(self): + """ + Getter method for odu_type, mapped from YANG variable /networks/network/link/te/information_source_entry/max_link_bandwidth/te_bandwidth/otn/odulist/odu_type (identityref) + + YANG Description: ODU type + """ + return self.__odu_type + + def _set_odu_type(self, v, load=False): + """ + Setter method for odu_type, mapped from YANG variable /networks/network/link/te/information_source_entry/max_link_bandwidth/te_bandwidth/otn/odulist/odu_type (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_odu_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_odu_type() directly. + + YANG Description: ODU type + """ + 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=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="odu-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """odu_type must be of a type compatible with identityref""", + 'defined-type': "ietf-otn-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="odu-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=False)""", + }) + + self.__odu_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_odu_type(self): + self.__odu_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="odu-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=False) + + + def _get_number(self): + """ + Getter method for number, mapped from YANG variable /networks/network/link/te/information_source_entry/max_link_bandwidth/te_bandwidth/otn/odulist/number (uint16) + + YANG Description: Number of ODUs + """ + return self.__number + + def _set_number(self, v, load=False): + """ + Setter method for number, mapped from YANG variable /networks/network/link/te/information_source_entry/max_link_bandwidth/te_bandwidth/otn/odulist/number (uint16) + If this variable is read-only (config: false) in the + source YANG file, then _set_number is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_number() directly. + + YANG Description: Number of ODUs + """ + 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="number", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """number 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="number", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', is_config=False)""", + }) + + self.__number = t + if hasattr(self, '_set'): + self._set() + + def _unset_number(self): + self.__number = YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), is_leaf=True, yang_name="number", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', is_config=False) + + + def _get_ts_number(self): + """ + Getter method for ts_number, mapped from YANG variable /networks/network/link/te/information_source_entry/max_link_bandwidth/te_bandwidth/otn/odulist/ts_number (uint16) + + YANG Description: The number of Tributary Slots (TS) that +could be used by all the ODUflex LSPs. + """ + return self.__ts_number + + def _set_ts_number(self, v, load=False): + """ + Setter method for ts_number, mapped from YANG variable /networks/network/link/te/information_source_entry/max_link_bandwidth/te_bandwidth/otn/odulist/ts_number (uint16) + If this variable is read-only (config: false) in the + source YANG file, then _set_ts_number is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_ts_number() directly. + + YANG Description: The number of Tributary Slots (TS) that +could be used by all the ODUflex LSPs. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts-number", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """ts_number must be of a type compatible with uint16""", + 'defined-type': "uint16", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts-number", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', is_config=False)""", + }) + + self.__ts_number = t + if hasattr(self, '_set'): + self._set() + + def _unset_ts_number(self): + self.__ts_number = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts-number", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', is_config=False) + + odu_type = __builtin__.property(_get_odu_type) + number = __builtin__.property(_get_number) + ts_number = __builtin__.property(_get_ts_number) + + + _pyangbind_elements = OrderedDict([('odu_type', odu_type), ('number', number), ('ts_number', ts_number), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/information_source_entry/max_resv_link_bandwidth/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/information_source_entry/max_resv_link_bandwidth/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..08adf3f16a27f9fe208f257505f655c4f88fa2f8 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/information_source_entry/max_resv_link_bandwidth/__init__.py @@ -0,0 +1,119 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 te_bandwidth +class max_resv_link_bandwidth(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/link/te/information-source-entry/max-resv-link-bandwidth. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Maximum amount of bandwidth that can be reserved in this +direction in this link. Units are in bytes per second. + """ + __slots__ = ('_path_helper', '_extmethods', '__te_bandwidth',) + + _yang_name = 'max-resv-link-bandwidth' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__te_bandwidth = YANGDynClass(base=te_bandwidth.te_bandwidth, is_container='container', yang_name="te-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', 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 ['networks', 'network', 'link', 'te', 'information-source-entry', 'max-resv-link-bandwidth'] + + def _get_te_bandwidth(self): + """ + Getter method for te_bandwidth, mapped from YANG variable /networks/network/link/te/information_source_entry/max_resv_link_bandwidth/te_bandwidth (container) + + YANG Description: Container that specifies TE bandwidth. The choices +can be augmented for specific data-plane technologies. + """ + return self.__te_bandwidth + + def _set_te_bandwidth(self, v, load=False): + """ + Setter method for te_bandwidth, mapped from YANG variable /networks/network/link/te/information_source_entry/max_resv_link_bandwidth/te_bandwidth (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_te_bandwidth is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_te_bandwidth() directly. + + YANG Description: Container that specifies TE bandwidth. The choices +can be augmented for specific data-plane technologies. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=te_bandwidth.te_bandwidth, is_container='container', yang_name="te-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """te_bandwidth must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=te_bandwidth.te_bandwidth, is_container='container', yang_name="te-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__te_bandwidth = t + if hasattr(self, '_set'): + self._set() + + def _unset_te_bandwidth(self): + self.__te_bandwidth = YANGDynClass(base=te_bandwidth.te_bandwidth, is_container='container', yang_name="te-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + te_bandwidth = __builtin__.property(_get_te_bandwidth) + + + _pyangbind_elements = OrderedDict([('te_bandwidth', te_bandwidth), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/information_source_entry/max_resv_link_bandwidth/te_bandwidth/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/information_source_entry/max_resv_link_bandwidth/te_bandwidth/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..bf441d72d2f80a12227ce3f3eecf6275d1f79e66 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/information_source_entry/max_resv_link_bandwidth/te_bandwidth/__init__.py @@ -0,0 +1,195 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 otn +class te_bandwidth(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/link/te/information-source-entry/max-resv-link-bandwidth/te-bandwidth. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Container that specifies TE bandwidth. The choices +can be augmented for specific data-plane technologies. + """ + __slots__ = ('_path_helper', '_extmethods', '__generic','__otn','__eth_bandwidth',) + + _yang_name = 'te-bandwidth' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__generic = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+(,(0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+))*'}), is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-bandwidth', is_config=False) + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False) + self.__eth_bandwidth = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), restriction_dict={'range': ['0..10000000000']}), is_leaf=True, yang_name="eth-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', 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 ['networks', 'network', 'link', 'te', 'information-source-entry', 'max-resv-link-bandwidth', 'te-bandwidth'] + + def _get_generic(self): + """ + Getter method for generic, mapped from YANG variable /networks/network/link/te/information_source_entry/max_resv_link_bandwidth/te_bandwidth/generic (te-bandwidth) + + YANG Description: Bandwidth specified in a generic format. + """ + return self.__generic + + def _set_generic(self, v, load=False): + """ + Setter method for generic, mapped from YANG variable /networks/network/link/te/information_source_entry/max_resv_link_bandwidth/te_bandwidth/generic (te-bandwidth) + If this variable is read-only (config: false) in the + source YANG file, then _set_generic is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_generic() directly. + + YANG Description: Bandwidth specified in a generic format. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+(,(0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+))*'}), is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-bandwidth', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """generic must be of a type compatible with te-bandwidth""", + 'defined-type': "ietf-te-topology:te-bandwidth", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+(,(0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+))*'}), is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-bandwidth', is_config=False)""", + }) + + self.__generic = t + if hasattr(self, '_set'): + self._set() + + def _unset_generic(self): + self.__generic = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+(,(0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+))*'}), is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-bandwidth', is_config=False) + + + def _get_otn(self): + """ + Getter method for otn, mapped from YANG variable /networks/network/link/te/information_source_entry/max_resv_link_bandwidth/te_bandwidth/otn (container) + + YANG Description: Bandwidth attributes for OTN links + """ + return self.__otn + + def _set_otn(self, v, load=False): + """ + Setter method for otn, mapped from YANG variable /networks/network/link/te/information_source_entry/max_resv_link_bandwidth/te_bandwidth/otn (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_otn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_otn() directly. + + YANG Description: Bandwidth attributes for OTN links + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=otn.otn, is_container='container', yang_name="otn", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """otn must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False)""", + }) + + self.__otn = t + if hasattr(self, '_set'): + self._set() + + def _unset_otn(self): + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False) + + + def _get_eth_bandwidth(self): + """ + Getter method for eth_bandwidth, mapped from YANG variable /networks/network/link/te/information_source_entry/max_resv_link_bandwidth/te_bandwidth/eth_bandwidth (uint64) + + YANG Description: Available bandwith value expressed in kilobits per second + """ + return self.__eth_bandwidth + + def _set_eth_bandwidth(self, v, load=False): + """ + Setter method for eth_bandwidth, mapped from YANG variable /networks/network/link/te/information_source_entry/max_resv_link_bandwidth/te_bandwidth/eth_bandwidth (uint64) + If this variable is read-only (config: false) in the + source YANG file, then _set_eth_bandwidth is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_eth_bandwidth() directly. + + YANG Description: Available bandwith value expressed in kilobits per second + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), restriction_dict={'range': ['0..10000000000']}), is_leaf=True, yang_name="eth-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint64', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """eth_bandwidth must be of a type compatible with uint64""", + 'defined-type': "uint64", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), restriction_dict={'range': ['0..10000000000']}), is_leaf=True, yang_name="eth-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint64', is_config=False)""", + }) + + self.__eth_bandwidth = t + if hasattr(self, '_set'): + self._set() + + def _unset_eth_bandwidth(self): + self.__eth_bandwidth = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), restriction_dict={'range': ['0..10000000000']}), is_leaf=True, yang_name="eth-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint64', is_config=False) + + generic = __builtin__.property(_get_generic) + otn = __builtin__.property(_get_otn) + eth_bandwidth = __builtin__.property(_get_eth_bandwidth) + + __choices__ = {'technology': {'generic': ['generic']}} + _pyangbind_elements = OrderedDict([('generic', generic), ('otn', otn), ('eth_bandwidth', eth_bandwidth), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/information_source_entry/max_resv_link_bandwidth/te_bandwidth/otn/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/information_source_entry/max_resv_link_bandwidth/te_bandwidth/otn/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..1e7147727f540e9b913603adac8f4b86f57656f3 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/information_source_entry/max_resv_link_bandwidth/te_bandwidth/otn/__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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 odulist +class otn(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/link/te/information-source-entry/max-resv-link-bandwidth/te-bandwidth/otn. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Bandwidth attributes for OTN links + """ + __slots__ = ('_path_helper', '_extmethods', '__odulist',) + + _yang_name = 'otn' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__odulist = YANGDynClass(base=YANGListType("odu_type",odulist.odulist, yang_name="odulist", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='odu-type', extensions=None), is_container='list', yang_name="odulist", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='list', 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 ['networks', 'network', 'link', 'te', 'information-source-entry', 'max-resv-link-bandwidth', 'te-bandwidth', 'otn'] + + def _get_odulist(self): + """ + Getter method for odulist, mapped from YANG variable /networks/network/link/te/information_source_entry/max_resv_link_bandwidth/te_bandwidth/otn/odulist (list) + + YANG Description: OTN bandwidth definition + """ + return self.__odulist + + def _set_odulist(self, v, load=False): + """ + Setter method for odulist, mapped from YANG variable /networks/network/link/te/information_source_entry/max_resv_link_bandwidth/te_bandwidth/otn/odulist (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_odulist is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_odulist() directly. + + YANG Description: OTN bandwidth definition + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("odu_type",odulist.odulist, yang_name="odulist", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='odu-type', extensions=None), is_container='list', yang_name="odulist", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='list', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """odulist must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("odu_type",odulist.odulist, yang_name="odulist", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='odu-type', extensions=None), is_container='list', yang_name="odulist", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='list', is_config=False)""", + }) + + self.__odulist = t + if hasattr(self, '_set'): + self._set() + + def _unset_odulist(self): + self.__odulist = YANGDynClass(base=YANGListType("odu_type",odulist.odulist, yang_name="odulist", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='odu-type', extensions=None), is_container='list', yang_name="odulist", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='list', is_config=False) + + odulist = __builtin__.property(_get_odulist) + + + _pyangbind_elements = OrderedDict([('odulist', odulist), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/information_source_entry/max_resv_link_bandwidth/te_bandwidth/otn/odulist/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/information_source_entry/max_resv_link_bandwidth/te_bandwidth/otn/odulist/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..aff2126e7b12c1cb338d0a6fdd65143bc69d5da4 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/information_source_entry/max_resv_link_bandwidth/te_bandwidth/otn/odulist/__init__.py @@ -0,0 +1,200 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 odulist(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/link/te/information-source-entry/max-resv-link-bandwidth/te-bandwidth/otn/odulist. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: OTN bandwidth definition + """ + __slots__ = ('_path_helper', '_extmethods', '__odu_type','__number','__ts_number',) + + _yang_name = 'odulist' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__odu_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="odu-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=False) + self.__number = YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), is_leaf=True, yang_name="number", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', is_config=False) + self.__ts_number = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts-number", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', 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 ['networks', 'network', 'link', 'te', 'information-source-entry', 'max-resv-link-bandwidth', 'te-bandwidth', 'otn', 'odulist'] + + def _get_odu_type(self): + """ + Getter method for odu_type, mapped from YANG variable /networks/network/link/te/information_source_entry/max_resv_link_bandwidth/te_bandwidth/otn/odulist/odu_type (identityref) + + YANG Description: ODU type + """ + return self.__odu_type + + def _set_odu_type(self, v, load=False): + """ + Setter method for odu_type, mapped from YANG variable /networks/network/link/te/information_source_entry/max_resv_link_bandwidth/te_bandwidth/otn/odulist/odu_type (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_odu_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_odu_type() directly. + + YANG Description: ODU type + """ + 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=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="odu-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """odu_type must be of a type compatible with identityref""", + 'defined-type': "ietf-otn-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="odu-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=False)""", + }) + + self.__odu_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_odu_type(self): + self.__odu_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="odu-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=False) + + + def _get_number(self): + """ + Getter method for number, mapped from YANG variable /networks/network/link/te/information_source_entry/max_resv_link_bandwidth/te_bandwidth/otn/odulist/number (uint16) + + YANG Description: Number of ODUs + """ + return self.__number + + def _set_number(self, v, load=False): + """ + Setter method for number, mapped from YANG variable /networks/network/link/te/information_source_entry/max_resv_link_bandwidth/te_bandwidth/otn/odulist/number (uint16) + If this variable is read-only (config: false) in the + source YANG file, then _set_number is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_number() directly. + + YANG Description: Number of ODUs + """ + 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="number", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """number 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="number", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', is_config=False)""", + }) + + self.__number = t + if hasattr(self, '_set'): + self._set() + + def _unset_number(self): + self.__number = YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), is_leaf=True, yang_name="number", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', is_config=False) + + + def _get_ts_number(self): + """ + Getter method for ts_number, mapped from YANG variable /networks/network/link/te/information_source_entry/max_resv_link_bandwidth/te_bandwidth/otn/odulist/ts_number (uint16) + + YANG Description: The number of Tributary Slots (TS) that +could be used by all the ODUflex LSPs. + """ + return self.__ts_number + + def _set_ts_number(self, v, load=False): + """ + Setter method for ts_number, mapped from YANG variable /networks/network/link/te/information_source_entry/max_resv_link_bandwidth/te_bandwidth/otn/odulist/ts_number (uint16) + If this variable is read-only (config: false) in the + source YANG file, then _set_ts_number is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_ts_number() directly. + + YANG Description: The number of Tributary Slots (TS) that +could be used by all the ODUflex LSPs. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts-number", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """ts_number must be of a type compatible with uint16""", + 'defined-type': "uint16", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts-number", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', is_config=False)""", + }) + + self.__ts_number = t + if hasattr(self, '_set'): + self._set() + + def _unset_ts_number(self): + self.__ts_number = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts-number", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', is_config=False) + + odu_type = __builtin__.property(_get_odu_type) + number = __builtin__.property(_get_number) + ts_number = __builtin__.property(_get_ts_number) + + + _pyangbind_elements = OrderedDict([('odu_type', odu_type), ('number', number), ('ts_number', ts_number), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/information_source_entry/te_nsrlgs/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/information_source_entry/te_nsrlgs/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..a6704d845bcc2e4fefefa4eb79c27eb94472c2ad --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/information_source_entry/te_nsrlgs/__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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 te_nsrlgs(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/link/te/information-source-entry/te-nsrlgs. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Contains a list of NSRLGs (Non-Shared Risk Link Groups). +When an abstract TE link is configured, this list specifies +the request that underlay TE paths need to be mutually +disjoint with other TE links in the same groups. + """ + __slots__ = ('_path_helper', '_extmethods', '__id',) + + _yang_name = 'te-nsrlgs' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__id = YANGDynClass(unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32)), is_leaf=False, yang_name="id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', 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 ['networks', 'network', 'link', 'te', 'information-source-entry', 'te-nsrlgs'] + + def _get_id(self): + """ + Getter method for id, mapped from YANG variable /networks/network/link/te/information_source_entry/te_nsrlgs/id (uint32) + + YANG Description: NSRLG ID, uniquely configured within a topology. + """ + return self.__id + + def _set_id(self, v, load=False): + """ + Setter method for id, mapped from YANG variable /networks/network/link/te/information_source_entry/te_nsrlgs/id (uint32) + 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: NSRLG ID, uniquely configured within a topology. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32)), is_leaf=False, yang_name="id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """id must be of a type compatible with uint32""", + 'defined-type': "uint32", + 'generated-type': """YANGDynClass(unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32)), is_leaf=False, yang_name="id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=False)""", + }) + + self.__id = t + if hasattr(self, '_set'): + self._set() + + def _unset_id(self): + self.__id = YANGDynClass(unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32)), is_leaf=False, yang_name="id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=False) + + id = __builtin__.property(_get_id) + + + _pyangbind_elements = OrderedDict([('id', id), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/information_source_entry/te_srlgs/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/information_source_entry/te_srlgs/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..9c51afe6b0c912238c170753f4f2979b9a08851c --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/information_source_entry/te_srlgs/__init__.py @@ -0,0 +1,115 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 te_srlgs(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/link/te/information-source-entry/te-srlgs. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Contains a list of SRLGs. + """ + __slots__ = ('_path_helper', '_extmethods', '__value',) + + _yang_name = 'te-srlgs' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__value = YANGDynClass(unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32)), is_leaf=False, yang_name="value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-types:srlg', 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 ['networks', 'network', 'link', 'te', 'information-source-entry', 'te-srlgs'] + + def _get_value(self): + """ + Getter method for value, mapped from YANG variable /networks/network/link/te/information_source_entry/te_srlgs/value (te-types:srlg) + + YANG Description: SRLG value. + """ + return self.__value + + def _set_value(self, v, load=False): + """ + Setter method for value, mapped from YANG variable /networks/network/link/te/information_source_entry/te_srlgs/value (te-types:srlg) + 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: SRLG value. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32)), is_leaf=False, yang_name="value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-types:srlg', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """value must be of a type compatible with te-types:srlg""", + 'defined-type': "te-types:srlg", + 'generated-type': """YANGDynClass(unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32)), is_leaf=False, yang_name="value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-types:srlg', is_config=False)""", + }) + + self.__value = t + if hasattr(self, '_set'): + self._set() + + def _unset_value(self): + self.__value = YANGDynClass(unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32)), is_leaf=False, yang_name="value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-types:srlg', is_config=False) + + value = __builtin__.property(_get_value) + + + _pyangbind_elements = OrderedDict([('value', value), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/information_source_entry/unreserved_bandwidth/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/information_source_entry/unreserved_bandwidth/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..a2151706363bc91a46c2a2126406a55309598f01 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/information_source_entry/unreserved_bandwidth/__init__.py @@ -0,0 +1,163 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 te_bandwidth +class unreserved_bandwidth(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/link/te/information-source-entry/unreserved-bandwidth. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Unreserved bandwidth for priority levels 0-7. Units are in +bytes per second. + """ + __slots__ = ('_path_helper', '_extmethods', '__priority','__te_bandwidth',) + + _yang_name = 'unreserved-bandwidth' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__priority = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..7']}), is_leaf=True, yang_name="priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint8', is_config=False) + self.__te_bandwidth = YANGDynClass(base=te_bandwidth.te_bandwidth, is_container='container', yang_name="te-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', 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 ['networks', 'network', 'link', 'te', 'information-source-entry', 'unreserved-bandwidth'] + + def _get_priority(self): + """ + Getter method for priority, mapped from YANG variable /networks/network/link/te/information_source_entry/unreserved_bandwidth/priority (uint8) + + YANG Description: Priority. + """ + return self.__priority + + def _set_priority(self, v, load=False): + """ + Setter method for priority, mapped from YANG variable /networks/network/link/te/information_source_entry/unreserved_bandwidth/priority (uint8) + If this variable is read-only (config: false) in the + source YANG file, then _set_priority is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_priority() directly. + + YANG Description: Priority. + """ + 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=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..7']}), is_leaf=True, yang_name="priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint8', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """priority must be of a type compatible with uint8""", + 'defined-type': "uint8", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..7']}), is_leaf=True, yang_name="priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint8', is_config=False)""", + }) + + self.__priority = t + if hasattr(self, '_set'): + self._set() + + def _unset_priority(self): + self.__priority = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..7']}), is_leaf=True, yang_name="priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint8', is_config=False) + + + def _get_te_bandwidth(self): + """ + Getter method for te_bandwidth, mapped from YANG variable /networks/network/link/te/information_source_entry/unreserved_bandwidth/te_bandwidth (container) + + YANG Description: Container that specifies TE bandwidth. The choices +can be augmented for specific data-plane technologies. + """ + return self.__te_bandwidth + + def _set_te_bandwidth(self, v, load=False): + """ + Setter method for te_bandwidth, mapped from YANG variable /networks/network/link/te/information_source_entry/unreserved_bandwidth/te_bandwidth (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_te_bandwidth is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_te_bandwidth() directly. + + YANG Description: Container that specifies TE bandwidth. The choices +can be augmented for specific data-plane technologies. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=te_bandwidth.te_bandwidth, is_container='container', yang_name="te-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """te_bandwidth must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=te_bandwidth.te_bandwidth, is_container='container', yang_name="te-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__te_bandwidth = t + if hasattr(self, '_set'): + self._set() + + def _unset_te_bandwidth(self): + self.__te_bandwidth = YANGDynClass(base=te_bandwidth.te_bandwidth, is_container='container', yang_name="te-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + priority = __builtin__.property(_get_priority) + te_bandwidth = __builtin__.property(_get_te_bandwidth) + + + _pyangbind_elements = OrderedDict([('priority', priority), ('te_bandwidth', te_bandwidth), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/information_source_entry/unreserved_bandwidth/te_bandwidth/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/information_source_entry/unreserved_bandwidth/te_bandwidth/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..c786d1941f8b391e743a8422f6d23a13913c2f88 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/information_source_entry/unreserved_bandwidth/te_bandwidth/__init__.py @@ -0,0 +1,195 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 otn +class te_bandwidth(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/link/te/information-source-entry/unreserved-bandwidth/te-bandwidth. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Container that specifies TE bandwidth. The choices +can be augmented for specific data-plane technologies. + """ + __slots__ = ('_path_helper', '_extmethods', '__generic','__otn','__eth_bandwidth',) + + _yang_name = 'te-bandwidth' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__generic = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+(,(0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+))*'}), is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-bandwidth', is_config=False) + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False) + self.__eth_bandwidth = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), restriction_dict={'range': ['0..10000000000']}), is_leaf=True, yang_name="eth-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', 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 ['networks', 'network', 'link', 'te', 'information-source-entry', 'unreserved-bandwidth', 'te-bandwidth'] + + def _get_generic(self): + """ + Getter method for generic, mapped from YANG variable /networks/network/link/te/information_source_entry/unreserved_bandwidth/te_bandwidth/generic (te-bandwidth) + + YANG Description: Bandwidth specified in a generic format. + """ + return self.__generic + + def _set_generic(self, v, load=False): + """ + Setter method for generic, mapped from YANG variable /networks/network/link/te/information_source_entry/unreserved_bandwidth/te_bandwidth/generic (te-bandwidth) + If this variable is read-only (config: false) in the + source YANG file, then _set_generic is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_generic() directly. + + YANG Description: Bandwidth specified in a generic format. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+(,(0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+))*'}), is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-bandwidth', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """generic must be of a type compatible with te-bandwidth""", + 'defined-type': "ietf-te-topology:te-bandwidth", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+(,(0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+))*'}), is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-bandwidth', is_config=False)""", + }) + + self.__generic = t + if hasattr(self, '_set'): + self._set() + + def _unset_generic(self): + self.__generic = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+(,(0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+))*'}), is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-bandwidth', is_config=False) + + + def _get_otn(self): + """ + Getter method for otn, mapped from YANG variable /networks/network/link/te/information_source_entry/unreserved_bandwidth/te_bandwidth/otn (container) + + YANG Description: Bandwidth attributes for OTN links + """ + return self.__otn + + def _set_otn(self, v, load=False): + """ + Setter method for otn, mapped from YANG variable /networks/network/link/te/information_source_entry/unreserved_bandwidth/te_bandwidth/otn (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_otn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_otn() directly. + + YANG Description: Bandwidth attributes for OTN links + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=otn.otn, is_container='container', yang_name="otn", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """otn must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False)""", + }) + + self.__otn = t + if hasattr(self, '_set'): + self._set() + + def _unset_otn(self): + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False) + + + def _get_eth_bandwidth(self): + """ + Getter method for eth_bandwidth, mapped from YANG variable /networks/network/link/te/information_source_entry/unreserved_bandwidth/te_bandwidth/eth_bandwidth (uint64) + + YANG Description: Available bandwith value expressed in kilobits per second + """ + return self.__eth_bandwidth + + def _set_eth_bandwidth(self, v, load=False): + """ + Setter method for eth_bandwidth, mapped from YANG variable /networks/network/link/te/information_source_entry/unreserved_bandwidth/te_bandwidth/eth_bandwidth (uint64) + If this variable is read-only (config: false) in the + source YANG file, then _set_eth_bandwidth is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_eth_bandwidth() directly. + + YANG Description: Available bandwith value expressed in kilobits per second + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), restriction_dict={'range': ['0..10000000000']}), is_leaf=True, yang_name="eth-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint64', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """eth_bandwidth must be of a type compatible with uint64""", + 'defined-type': "uint64", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), restriction_dict={'range': ['0..10000000000']}), is_leaf=True, yang_name="eth-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint64', is_config=False)""", + }) + + self.__eth_bandwidth = t + if hasattr(self, '_set'): + self._set() + + def _unset_eth_bandwidth(self): + self.__eth_bandwidth = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), restriction_dict={'range': ['0..10000000000']}), is_leaf=True, yang_name="eth-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint64', is_config=False) + + generic = __builtin__.property(_get_generic) + otn = __builtin__.property(_get_otn) + eth_bandwidth = __builtin__.property(_get_eth_bandwidth) + + __choices__ = {'technology': {'generic': ['generic']}} + _pyangbind_elements = OrderedDict([('generic', generic), ('otn', otn), ('eth_bandwidth', eth_bandwidth), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/information_source_entry/unreserved_bandwidth/te_bandwidth/otn/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/information_source_entry/unreserved_bandwidth/te_bandwidth/otn/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..8e3a01bcafc387f6a74c8904eb2f8582932998a1 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/information_source_entry/unreserved_bandwidth/te_bandwidth/otn/__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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 odulist +class otn(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/link/te/information-source-entry/unreserved-bandwidth/te-bandwidth/otn. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Bandwidth attributes for OTN links + """ + __slots__ = ('_path_helper', '_extmethods', '__odulist',) + + _yang_name = 'otn' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__odulist = YANGDynClass(base=YANGListType("odu_type",odulist.odulist, yang_name="odulist", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='odu-type', extensions=None), is_container='list', yang_name="odulist", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='list', 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 ['networks', 'network', 'link', 'te', 'information-source-entry', 'unreserved-bandwidth', 'te-bandwidth', 'otn'] + + def _get_odulist(self): + """ + Getter method for odulist, mapped from YANG variable /networks/network/link/te/information_source_entry/unreserved_bandwidth/te_bandwidth/otn/odulist (list) + + YANG Description: OTN bandwidth definition + """ + return self.__odulist + + def _set_odulist(self, v, load=False): + """ + Setter method for odulist, mapped from YANG variable /networks/network/link/te/information_source_entry/unreserved_bandwidth/te_bandwidth/otn/odulist (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_odulist is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_odulist() directly. + + YANG Description: OTN bandwidth definition + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("odu_type",odulist.odulist, yang_name="odulist", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='odu-type', extensions=None), is_container='list', yang_name="odulist", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='list', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """odulist must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("odu_type",odulist.odulist, yang_name="odulist", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='odu-type', extensions=None), is_container='list', yang_name="odulist", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='list', is_config=False)""", + }) + + self.__odulist = t + if hasattr(self, '_set'): + self._set() + + def _unset_odulist(self): + self.__odulist = YANGDynClass(base=YANGListType("odu_type",odulist.odulist, yang_name="odulist", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='odu-type', extensions=None), is_container='list', yang_name="odulist", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='list', is_config=False) + + odulist = __builtin__.property(_get_odulist) + + + _pyangbind_elements = OrderedDict([('odulist', odulist), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/information_source_entry/unreserved_bandwidth/te_bandwidth/otn/odulist/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/information_source_entry/unreserved_bandwidth/te_bandwidth/otn/odulist/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..a0e9a8f1d89ec9dac1dd28f9aef4431b271883c0 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/information_source_entry/unreserved_bandwidth/te_bandwidth/otn/odulist/__init__.py @@ -0,0 +1,200 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 odulist(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/link/te/information-source-entry/unreserved-bandwidth/te-bandwidth/otn/odulist. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: OTN bandwidth definition + """ + __slots__ = ('_path_helper', '_extmethods', '__odu_type','__number','__ts_number',) + + _yang_name = 'odulist' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__odu_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="odu-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=False) + self.__number = YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), is_leaf=True, yang_name="number", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', is_config=False) + self.__ts_number = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts-number", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', 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 ['networks', 'network', 'link', 'te', 'information-source-entry', 'unreserved-bandwidth', 'te-bandwidth', 'otn', 'odulist'] + + def _get_odu_type(self): + """ + Getter method for odu_type, mapped from YANG variable /networks/network/link/te/information_source_entry/unreserved_bandwidth/te_bandwidth/otn/odulist/odu_type (identityref) + + YANG Description: ODU type + """ + return self.__odu_type + + def _set_odu_type(self, v, load=False): + """ + Setter method for odu_type, mapped from YANG variable /networks/network/link/te/information_source_entry/unreserved_bandwidth/te_bandwidth/otn/odulist/odu_type (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_odu_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_odu_type() directly. + + YANG Description: ODU type + """ + 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=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="odu-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """odu_type must be of a type compatible with identityref""", + 'defined-type': "ietf-otn-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="odu-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=False)""", + }) + + self.__odu_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_odu_type(self): + self.__odu_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="odu-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=False) + + + def _get_number(self): + """ + Getter method for number, mapped from YANG variable /networks/network/link/te/information_source_entry/unreserved_bandwidth/te_bandwidth/otn/odulist/number (uint16) + + YANG Description: Number of ODUs + """ + return self.__number + + def _set_number(self, v, load=False): + """ + Setter method for number, mapped from YANG variable /networks/network/link/te/information_source_entry/unreserved_bandwidth/te_bandwidth/otn/odulist/number (uint16) + If this variable is read-only (config: false) in the + source YANG file, then _set_number is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_number() directly. + + YANG Description: Number of ODUs + """ + 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="number", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """number 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="number", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', is_config=False)""", + }) + + self.__number = t + if hasattr(self, '_set'): + self._set() + + def _unset_number(self): + self.__number = YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), is_leaf=True, yang_name="number", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', is_config=False) + + + def _get_ts_number(self): + """ + Getter method for ts_number, mapped from YANG variable /networks/network/link/te/information_source_entry/unreserved_bandwidth/te_bandwidth/otn/odulist/ts_number (uint16) + + YANG Description: The number of Tributary Slots (TS) that +could be used by all the ODUflex LSPs. + """ + return self.__ts_number + + def _set_ts_number(self, v, load=False): + """ + Setter method for ts_number, mapped from YANG variable /networks/network/link/te/information_source_entry/unreserved_bandwidth/te_bandwidth/otn/odulist/ts_number (uint16) + If this variable is read-only (config: false) in the + source YANG file, then _set_ts_number is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_ts_number() directly. + + YANG Description: The number of Tributary Slots (TS) that +could be used by all the ODUflex LSPs. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts-number", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """ts_number must be of a type compatible with uint16""", + 'defined-type': "uint16", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts-number", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', is_config=False)""", + }) + + self.__ts_number = t + if hasattr(self, '_set'): + self._set() + + def _unset_ts_number(self): + self.__ts_number = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts-number", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', is_config=False) + + odu_type = __builtin__.property(_get_odu_type) + number = __builtin__.property(_get_number) + ts_number = __builtin__.property(_get_ts_number) + + + _pyangbind_elements = OrderedDict([('odu_type', odu_type), ('number', number), ('ts_number', ts_number), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/information_source_state/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/information_source_state/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..4646d00267a1a8740cddfd61eb2f6f55e6d241bd --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/information_source_state/__init__.py @@ -0,0 +1,248 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 topology +class information_source_state(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/link/te/information-source-state. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Contains state attributes related to the information +source. + """ + __slots__ = ('_path_helper', '_extmethods', '__credibility_preference','__logical_network_element','__network_instance','__topology',) + + _yang_name = 'information-source-state' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__credibility_preference = YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), is_leaf=True, yang_name="credibility-preference", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint16', is_config=False) + self.__logical_network_element = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="logical-network-element", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=False) + self.__network_instance = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="network-instance", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=False) + self.__topology = YANGDynClass(base=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:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', 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 ['networks', 'network', 'link', 'te', 'information-source-state'] + + def _get_credibility_preference(self): + """ + Getter method for credibility_preference, mapped from YANG variable /networks/network/link/te/information_source_state/credibility_preference (uint16) + + YANG Description: The preference value for calculating the Traffic +Engineering database credibility value used for +tie-break selection between different information-source +values. A higher value is preferable. + """ + return self.__credibility_preference + + def _set_credibility_preference(self, v, load=False): + """ + Setter method for credibility_preference, mapped from YANG variable /networks/network/link/te/information_source_state/credibility_preference (uint16) + If this variable is read-only (config: false) in the + source YANG file, then _set_credibility_preference is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_credibility_preference() directly. + + YANG Description: The preference value for calculating the Traffic +Engineering database credibility value used for +tie-break selection between different information-source +values. A higher value is preferable. + """ + 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="credibility-preference", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint16', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """credibility_preference 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="credibility-preference", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint16', is_config=False)""", + }) + + self.__credibility_preference = t + if hasattr(self, '_set'): + self._set() + + def _unset_credibility_preference(self): + self.__credibility_preference = YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), is_leaf=True, yang_name="credibility-preference", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint16', is_config=False) + + + def _get_logical_network_element(self): + """ + Getter method for logical_network_element, mapped from YANG variable /networks/network/link/te/information_source_state/logical_network_element (string) + + YANG Description: When applicable, this is the name of a logical network +element from which the information is learned. + """ + return self.__logical_network_element + + def _set_logical_network_element(self, v, load=False): + """ + Setter method for logical_network_element, mapped from YANG variable /networks/network/link/te/information_source_state/logical_network_element (string) + If this variable is read-only (config: false) in the + source YANG file, then _set_logical_network_element is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_logical_network_element() directly. + + YANG Description: When applicable, this is the name of a logical network +element from which the information is learned. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="logical-network-element", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """logical_network_element must be of a type compatible with string""", + 'defined-type': "string", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="logical-network-element", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=False)""", + }) + + self.__logical_network_element = t + if hasattr(self, '_set'): + self._set() + + def _unset_logical_network_element(self): + self.__logical_network_element = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="logical-network-element", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=False) + + + def _get_network_instance(self): + """ + Getter method for network_instance, mapped from YANG variable /networks/network/link/te/information_source_state/network_instance (string) + + YANG Description: When applicable, this is the name of a network instance +from which the information is learned. + """ + return self.__network_instance + + def _set_network_instance(self, v, load=False): + """ + Setter method for network_instance, mapped from YANG variable /networks/network/link/te/information_source_state/network_instance (string) + If this variable is read-only (config: false) in the + source YANG file, then _set_network_instance is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_network_instance() directly. + + YANG Description: When applicable, this is the name of a network instance +from which the information is learned. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="network-instance", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """network_instance must be of a type compatible with string""", + 'defined-type': "string", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="network-instance", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=False)""", + }) + + self.__network_instance = t + if hasattr(self, '_set'): + self._set() + + def _unset_network_instance(self): + self.__network_instance = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="network-instance", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=False) + + + def _get_topology(self): + """ + Getter method for topology, mapped from YANG variable /networks/network/link/te/information_source_state/topology (container) + + YANG Description: When the information is processed by the system, +the attributes in this container indicate which topology +is used to generate the result information. + """ + return self.__topology + + def _set_topology(self, v, load=False): + """ + Setter method for topology, mapped from YANG variable /networks/network/link/te/information_source_state/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. + + YANG Description: When the information is processed by the system, +the attributes in this container indicate which topology +is used to generate the result information. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=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:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """topology must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=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:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__topology = t + if hasattr(self, '_set'): + self._set() + + def _unset_topology(self): + self.__topology = YANGDynClass(base=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:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + credibility_preference = __builtin__.property(_get_credibility_preference) + logical_network_element = __builtin__.property(_get_logical_network_element) + network_instance = __builtin__.property(_get_network_instance) + topology = __builtin__.property(_get_topology) + + + _pyangbind_elements = OrderedDict([('credibility_preference', credibility_preference), ('logical_network_element', logical_network_element), ('network_instance', network_instance), ('topology', topology), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/information_source_state/topology/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/information_source_state/topology/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..6a22bed59f6d55f3d9c34838f790317f68e64361 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/information_source_state/topology/__init__.py @@ -0,0 +1,162 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 topology(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/link/te/information-source-state/topology. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: When the information is processed by the system, +the attributes in this container indicate which topology +is used to generate the result information. + """ + __slots__ = ('_path_helper', '_extmethods', '__link_ref','__network_ref',) + + _yang_name = 'topology' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__link_ref = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="link-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=False) + self.__network_ref = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="network-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', 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 ['networks', 'network', 'link', 'te', 'information-source-state', 'topology'] + + def _get_link_ref(self): + """ + Getter method for link_ref, mapped from YANG variable /networks/network/link/te/information_source_state/topology/link_ref (leafref) + + YANG Description: A type for an absolute reference to a link instance. +(This type should not be used for relative references. +In such a case, a relative path should be used instead.) + """ + return self.__link_ref + + def _set_link_ref(self, v, load=False): + """ + Setter method for link_ref, mapped from YANG variable /networks/network/link/te/information_source_state/topology/link_ref (leafref) + If this variable is read-only (config: false) in the + source YANG file, then _set_link_ref is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_link_ref() directly. + + YANG Description: A type for an absolute reference to a link instance. +(This type should not be used for relative references. +In such a case, a relative path should be used instead.) + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="link-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """link_ref must be of a type compatible with leafref""", + 'defined-type': "leafref", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="link-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=False)""", + }) + + self.__link_ref = t + if hasattr(self, '_set'): + self._set() + + def _unset_link_ref(self): + self.__link_ref = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="link-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=False) + + + def _get_network_ref(self): + """ + Getter method for network_ref, mapped from YANG variable /networks/network/link/te/information_source_state/topology/network_ref (leafref) + + YANG Description: Used to reference a network -- for example, an underlay +network. + """ + return self.__network_ref + + def _set_network_ref(self, v, load=False): + """ + Setter method for network_ref, mapped from YANG variable /networks/network/link/te/information_source_state/topology/network_ref (leafref) + If this variable is read-only (config: false) in the + source YANG file, then _set_network_ref is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_network_ref() directly. + + YANG Description: Used to reference a network -- for example, an underlay +network. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="network-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """network_ref must be of a type compatible with leafref""", + 'defined-type': "leafref", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="network-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=False)""", + }) + + self.__network_ref = t + if hasattr(self, '_set'): + self._set() + + def _unset_network_ref(self): + self.__network_ref = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="network-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=False) + + link_ref = __builtin__.property(_get_link_ref) + network_ref = __builtin__.property(_get_network_ref) + + + _pyangbind_elements = OrderedDict([('link_ref', link_ref), ('network_ref', network_ref), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/recovery/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/recovery/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..441cf6d42f12b1cb923eb18703988060e533fb5f --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/recovery/__init__.py @@ -0,0 +1,154 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 recovery(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/link/te/recovery. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Status of the recovery process. + """ + __slots__ = ('_path_helper', '_extmethods', '__restoration_status','__protection_status',) + + _yang_name = 'recovery' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__restoration_status = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'normal': {}, 'recovery-started': {}, 'recovery-succeeded': {}, 'recovery-failed': {}, 'reversion-started': {}, 'reversion-succeeded': {}, 'reversion-failed': {}, 'recovery-unavailable': {}, 'recovery-admin': {}, 'wait-to-restore': {}},), is_leaf=True, yang_name="restoration-status", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-types:te-recovery-status', is_config=False) + self.__protection_status = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'normal': {}, 'recovery-started': {}, 'recovery-succeeded': {}, 'recovery-failed': {}, 'reversion-started': {}, 'reversion-succeeded': {}, 'reversion-failed': {}, 'recovery-unavailable': {}, 'recovery-admin': {}, 'wait-to-restore': {}},), is_leaf=True, yang_name="protection-status", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-types:te-recovery-status', 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 ['networks', 'network', 'link', 'te', 'recovery'] + + def _get_restoration_status(self): + """ + Getter method for restoration_status, mapped from YANG variable /networks/network/link/te/recovery/restoration_status (te-types:te-recovery-status) + + YANG Description: Restoration status. + """ + return self.__restoration_status + + def _set_restoration_status(self, v, load=False): + """ + Setter method for restoration_status, mapped from YANG variable /networks/network/link/te/recovery/restoration_status (te-types:te-recovery-status) + If this variable is read-only (config: false) in the + source YANG file, then _set_restoration_status is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_restoration_status() directly. + + YANG Description: Restoration status. + """ + 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={'normal': {}, 'recovery-started': {}, 'recovery-succeeded': {}, 'recovery-failed': {}, 'reversion-started': {}, 'reversion-succeeded': {}, 'reversion-failed': {}, 'recovery-unavailable': {}, 'recovery-admin': {}, 'wait-to-restore': {}},), is_leaf=True, yang_name="restoration-status", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-types:te-recovery-status', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """restoration_status must be of a type compatible with te-types:te-recovery-status""", + 'defined-type': "te-types:te-recovery-status", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'normal': {}, 'recovery-started': {}, 'recovery-succeeded': {}, 'recovery-failed': {}, 'reversion-started': {}, 'reversion-succeeded': {}, 'reversion-failed': {}, 'recovery-unavailable': {}, 'recovery-admin': {}, 'wait-to-restore': {}},), is_leaf=True, yang_name="restoration-status", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-types:te-recovery-status', is_config=False)""", + }) + + self.__restoration_status = t + if hasattr(self, '_set'): + self._set() + + def _unset_restoration_status(self): + self.__restoration_status = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'normal': {}, 'recovery-started': {}, 'recovery-succeeded': {}, 'recovery-failed': {}, 'reversion-started': {}, 'reversion-succeeded': {}, 'reversion-failed': {}, 'recovery-unavailable': {}, 'recovery-admin': {}, 'wait-to-restore': {}},), is_leaf=True, yang_name="restoration-status", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-types:te-recovery-status', is_config=False) + + + def _get_protection_status(self): + """ + Getter method for protection_status, mapped from YANG variable /networks/network/link/te/recovery/protection_status (te-types:te-recovery-status) + + YANG Description: Protection status. + """ + return self.__protection_status + + def _set_protection_status(self, v, load=False): + """ + Setter method for protection_status, mapped from YANG variable /networks/network/link/te/recovery/protection_status (te-types:te-recovery-status) + If this variable is read-only (config: false) in the + source YANG file, then _set_protection_status is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_protection_status() directly. + + YANG Description: Protection status. + """ + 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={'normal': {}, 'recovery-started': {}, 'recovery-succeeded': {}, 'recovery-failed': {}, 'reversion-started': {}, 'reversion-succeeded': {}, 'reversion-failed': {}, 'recovery-unavailable': {}, 'recovery-admin': {}, 'wait-to-restore': {}},), is_leaf=True, yang_name="protection-status", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-types:te-recovery-status', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """protection_status must be of a type compatible with te-types:te-recovery-status""", + 'defined-type': "te-types:te-recovery-status", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'normal': {}, 'recovery-started': {}, 'recovery-succeeded': {}, 'recovery-failed': {}, 'reversion-started': {}, 'reversion-succeeded': {}, 'reversion-failed': {}, 'recovery-unavailable': {}, 'recovery-admin': {}, 'wait-to-restore': {}},), is_leaf=True, yang_name="protection-status", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-types:te-recovery-status', is_config=False)""", + }) + + self.__protection_status = t + if hasattr(self, '_set'): + self._set() + + def _unset_protection_status(self): + self.__protection_status = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'normal': {}, 'recovery-started': {}, 'recovery-succeeded': {}, 'recovery-failed': {}, 'reversion-started': {}, 'reversion-succeeded': {}, 'reversion-failed': {}, 'recovery-unavailable': {}, 'recovery-admin': {}, 'wait-to-restore': {}},), is_leaf=True, yang_name="protection-status", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-types:te-recovery-status', is_config=False) + + restoration_status = __builtin__.property(_get_restoration_status) + protection_status = __builtin__.property(_get_protection_status) + + + _pyangbind_elements = OrderedDict([('restoration_status', restoration_status), ('protection_status', protection_status), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/statistics/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/statistics/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..cbfbda90fca5f685855f866bba04ab806cb12b35 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/statistics/__init__.py @@ -0,0 +1,810 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 statistics(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/link/te/statistics. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Statistics data. + """ + __slots__ = ('_path_helper', '_extmethods', '__discontinuity_time','__disables','__enables','__maintenance_clears','__maintenance_sets','__modifies','__downs','__ups','__fault_clears','__fault_detects','__protection_switches','__protection_reverts','__restoration_failures','__restoration_starts','__restoration_successes','__restoration_reversion_failures','__restoration_reversion_starts','__restoration_reversion_successes',) + + _yang_name = 'statistics' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__discontinuity_time = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(Z|[\\+\\-]\\d{2}:\\d{2})'}), is_leaf=True, yang_name="discontinuity-time", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:date-and-time', is_config=False) + self.__disables = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="disables", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False) + self.__enables = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="enables", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False) + self.__maintenance_clears = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="maintenance-clears", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False) + self.__maintenance_sets = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="maintenance-sets", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False) + self.__modifies = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="modifies", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False) + self.__downs = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="downs", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False) + self.__ups = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="ups", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False) + self.__fault_clears = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="fault-clears", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False) + self.__fault_detects = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="fault-detects", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False) + self.__protection_switches = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="protection-switches", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False) + self.__protection_reverts = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="protection-reverts", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False) + self.__restoration_failures = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="restoration-failures", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False) + self.__restoration_starts = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="restoration-starts", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False) + self.__restoration_successes = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="restoration-successes", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False) + self.__restoration_reversion_failures = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="restoration-reversion-failures", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False) + self.__restoration_reversion_starts = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="restoration-reversion-starts", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False) + self.__restoration_reversion_successes = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="restoration-reversion-successes", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', 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 ['networks', 'network', 'link', 'te', 'statistics'] + + def _get_discontinuity_time(self): + """ + Getter method for discontinuity_time, mapped from YANG variable /networks/network/link/te/statistics/discontinuity_time (yang:date-and-time) + + YANG Description: The time of the most recent occasion at which any one or +more of this interface's counters suffered a +discontinuity. If no such discontinuities have occurred +since the last re-initialization of the local management +subsystem, then this node contains the time the local +management subsystem re-initialized itself. + """ + return self.__discontinuity_time + + def _set_discontinuity_time(self, v, load=False): + """ + Setter method for discontinuity_time, mapped from YANG variable /networks/network/link/te/statistics/discontinuity_time (yang:date-and-time) + If this variable is read-only (config: false) in the + source YANG file, then _set_discontinuity_time is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_discontinuity_time() directly. + + YANG Description: The time of the most recent occasion at which any one or +more of this interface's counters suffered a +discontinuity. If no such discontinuities have occurred +since the last re-initialization of the local management +subsystem, then this node contains the time the local +management subsystem re-initialized itself. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(Z|[\\+\\-]\\d{2}:\\d{2})'}), is_leaf=True, yang_name="discontinuity-time", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:date-and-time', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """discontinuity_time must be of a type compatible with yang:date-and-time""", + 'defined-type': "yang:date-and-time", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(Z|[\\+\\-]\\d{2}:\\d{2})'}), is_leaf=True, yang_name="discontinuity-time", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:date-and-time', is_config=False)""", + }) + + self.__discontinuity_time = t + if hasattr(self, '_set'): + self._set() + + def _unset_discontinuity_time(self): + self.__discontinuity_time = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(Z|[\\+\\-]\\d{2}:\\d{2})'}), is_leaf=True, yang_name="discontinuity-time", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:date-and-time', is_config=False) + + + def _get_disables(self): + """ + Getter method for disables, mapped from YANG variable /networks/network/link/te/statistics/disables (yang:counter32) + + YANG Description: Number of times that a link was disabled. + """ + return self.__disables + + def _set_disables(self, v, load=False): + """ + Setter method for disables, mapped from YANG variable /networks/network/link/te/statistics/disables (yang:counter32) + If this variable is read-only (config: false) in the + source YANG file, then _set_disables is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_disables() directly. + + YANG Description: Number of times that a link was disabled. + """ + 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="disables", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """disables must be of a type compatible with yang:counter32""", + 'defined-type': "yang:counter32", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="disables", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False)""", + }) + + self.__disables = t + if hasattr(self, '_set'): + self._set() + + def _unset_disables(self): + self.__disables = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="disables", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False) + + + def _get_enables(self): + """ + Getter method for enables, mapped from YANG variable /networks/network/link/te/statistics/enables (yang:counter32) + + YANG Description: Number of times that a link was enabled. + """ + return self.__enables + + def _set_enables(self, v, load=False): + """ + Setter method for enables, mapped from YANG variable /networks/network/link/te/statistics/enables (yang:counter32) + If this variable is read-only (config: false) in the + source YANG file, then _set_enables is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_enables() directly. + + YANG Description: Number of times that a link was enabled. + """ + 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="enables", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """enables must be of a type compatible with yang:counter32""", + 'defined-type': "yang:counter32", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="enables", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False)""", + }) + + self.__enables = t + if hasattr(self, '_set'): + self._set() + + def _unset_enables(self): + self.__enables = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="enables", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False) + + + def _get_maintenance_clears(self): + """ + Getter method for maintenance_clears, mapped from YANG variable /networks/network/link/te/statistics/maintenance_clears (yang:counter32) + + YANG Description: Number of times that a link was taken out of maintenance. + """ + return self.__maintenance_clears + + def _set_maintenance_clears(self, v, load=False): + """ + Setter method for maintenance_clears, mapped from YANG variable /networks/network/link/te/statistics/maintenance_clears (yang:counter32) + If this variable is read-only (config: false) in the + source YANG file, then _set_maintenance_clears is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_maintenance_clears() directly. + + YANG Description: Number of times that a link was taken out of maintenance. + """ + 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="maintenance-clears", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """maintenance_clears must be of a type compatible with yang:counter32""", + 'defined-type': "yang:counter32", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="maintenance-clears", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False)""", + }) + + self.__maintenance_clears = t + if hasattr(self, '_set'): + self._set() + + def _unset_maintenance_clears(self): + self.__maintenance_clears = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="maintenance-clears", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False) + + + def _get_maintenance_sets(self): + """ + Getter method for maintenance_sets, mapped from YANG variable /networks/network/link/te/statistics/maintenance_sets (yang:counter32) + + YANG Description: Number of times that a link was put in maintenance. + """ + return self.__maintenance_sets + + def _set_maintenance_sets(self, v, load=False): + """ + Setter method for maintenance_sets, mapped from YANG variable /networks/network/link/te/statistics/maintenance_sets (yang:counter32) + If this variable is read-only (config: false) in the + source YANG file, then _set_maintenance_sets is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_maintenance_sets() directly. + + YANG Description: Number of times that a link was put in maintenance. + """ + 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="maintenance-sets", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """maintenance_sets must be of a type compatible with yang:counter32""", + 'defined-type': "yang:counter32", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="maintenance-sets", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False)""", + }) + + self.__maintenance_sets = t + if hasattr(self, '_set'): + self._set() + + def _unset_maintenance_sets(self): + self.__maintenance_sets = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="maintenance-sets", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False) + + + def _get_modifies(self): + """ + Getter method for modifies, mapped from YANG variable /networks/network/link/te/statistics/modifies (yang:counter32) + + YANG Description: Number of times that a link was modified. + """ + return self.__modifies + + def _set_modifies(self, v, load=False): + """ + Setter method for modifies, mapped from YANG variable /networks/network/link/te/statistics/modifies (yang:counter32) + If this variable is read-only (config: false) in the + source YANG file, then _set_modifies is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_modifies() directly. + + YANG Description: Number of times that a link was modified. + """ + 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="modifies", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """modifies must be of a type compatible with yang:counter32""", + 'defined-type': "yang:counter32", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="modifies", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False)""", + }) + + self.__modifies = t + if hasattr(self, '_set'): + self._set() + + def _unset_modifies(self): + self.__modifies = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="modifies", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False) + + + def _get_downs(self): + """ + Getter method for downs, mapped from YANG variable /networks/network/link/te/statistics/downs (yang:counter32) + + YANG Description: Number of times that a link was set to an operational state +of 'down'. + """ + return self.__downs + + def _set_downs(self, v, load=False): + """ + Setter method for downs, mapped from YANG variable /networks/network/link/te/statistics/downs (yang:counter32) + If this variable is read-only (config: false) in the + source YANG file, then _set_downs is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_downs() directly. + + YANG Description: Number of times that a link was set to an operational state +of 'down'. + """ + 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="downs", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """downs must be of a type compatible with yang:counter32""", + 'defined-type': "yang:counter32", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="downs", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False)""", + }) + + self.__downs = t + if hasattr(self, '_set'): + self._set() + + def _unset_downs(self): + self.__downs = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="downs", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False) + + + def _get_ups(self): + """ + Getter method for ups, mapped from YANG variable /networks/network/link/te/statistics/ups (yang:counter32) + + YANG Description: Number of times that a link was set to an operational state +of 'up'. + """ + return self.__ups + + def _set_ups(self, v, load=False): + """ + Setter method for ups, mapped from YANG variable /networks/network/link/te/statistics/ups (yang:counter32) + If this variable is read-only (config: false) in the + source YANG file, then _set_ups is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_ups() directly. + + YANG Description: Number of times that a link was set to an operational state +of 'up'. + """ + 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="ups", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """ups must be of a type compatible with yang:counter32""", + 'defined-type': "yang:counter32", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="ups", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False)""", + }) + + self.__ups = t + if hasattr(self, '_set'): + self._set() + + def _unset_ups(self): + self.__ups = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="ups", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False) + + + def _get_fault_clears(self): + """ + Getter method for fault_clears, mapped from YANG variable /networks/network/link/te/statistics/fault_clears (yang:counter32) + + YANG Description: Number of times that a link experienced a fault-clear +event. + """ + return self.__fault_clears + + def _set_fault_clears(self, v, load=False): + """ + Setter method for fault_clears, mapped from YANG variable /networks/network/link/te/statistics/fault_clears (yang:counter32) + If this variable is read-only (config: false) in the + source YANG file, then _set_fault_clears is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_fault_clears() directly. + + YANG Description: Number of times that a link experienced a fault-clear +event. + """ + 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="fault-clears", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """fault_clears must be of a type compatible with yang:counter32""", + 'defined-type': "yang:counter32", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="fault-clears", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False)""", + }) + + self.__fault_clears = t + if hasattr(self, '_set'): + self._set() + + def _unset_fault_clears(self): + self.__fault_clears = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="fault-clears", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False) + + + def _get_fault_detects(self): + """ + Getter method for fault_detects, mapped from YANG variable /networks/network/link/te/statistics/fault_detects (yang:counter32) + + YANG Description: Number of times that a link experienced fault detection. + """ + return self.__fault_detects + + def _set_fault_detects(self, v, load=False): + """ + Setter method for fault_detects, mapped from YANG variable /networks/network/link/te/statistics/fault_detects (yang:counter32) + If this variable is read-only (config: false) in the + source YANG file, then _set_fault_detects is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_fault_detects() directly. + + YANG Description: Number of times that a link experienced fault detection. + """ + 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="fault-detects", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """fault_detects must be of a type compatible with yang:counter32""", + 'defined-type': "yang:counter32", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="fault-detects", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False)""", + }) + + self.__fault_detects = t + if hasattr(self, '_set'): + self._set() + + def _unset_fault_detects(self): + self.__fault_detects = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="fault-detects", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False) + + + def _get_protection_switches(self): + """ + Getter method for protection_switches, mapped from YANG variable /networks/network/link/te/statistics/protection_switches (yang:counter32) + + YANG Description: Number of times that a link experienced protection +switchover. + """ + return self.__protection_switches + + def _set_protection_switches(self, v, load=False): + """ + Setter method for protection_switches, mapped from YANG variable /networks/network/link/te/statistics/protection_switches (yang:counter32) + If this variable is read-only (config: false) in the + source YANG file, then _set_protection_switches is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_protection_switches() directly. + + YANG Description: Number of times that a link experienced protection +switchover. + """ + 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="protection-switches", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """protection_switches must be of a type compatible with yang:counter32""", + 'defined-type': "yang:counter32", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="protection-switches", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False)""", + }) + + self.__protection_switches = t + if hasattr(self, '_set'): + self._set() + + def _unset_protection_switches(self): + self.__protection_switches = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="protection-switches", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False) + + + def _get_protection_reverts(self): + """ + Getter method for protection_reverts, mapped from YANG variable /networks/network/link/te/statistics/protection_reverts (yang:counter32) + + YANG Description: Number of times that a link experienced protection +reversion. + """ + return self.__protection_reverts + + def _set_protection_reverts(self, v, load=False): + """ + Setter method for protection_reverts, mapped from YANG variable /networks/network/link/te/statistics/protection_reverts (yang:counter32) + If this variable is read-only (config: false) in the + source YANG file, then _set_protection_reverts is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_protection_reverts() directly. + + YANG Description: Number of times that a link experienced protection +reversion. + """ + 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="protection-reverts", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """protection_reverts must be of a type compatible with yang:counter32""", + 'defined-type': "yang:counter32", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="protection-reverts", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False)""", + }) + + self.__protection_reverts = t + if hasattr(self, '_set'): + self._set() + + def _unset_protection_reverts(self): + self.__protection_reverts = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="protection-reverts", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False) + + + def _get_restoration_failures(self): + """ + Getter method for restoration_failures, mapped from YANG variable /networks/network/link/te/statistics/restoration_failures (yang:counter32) + + YANG Description: Number of times that a link experienced restoration +failure. + """ + return self.__restoration_failures + + def _set_restoration_failures(self, v, load=False): + """ + Setter method for restoration_failures, mapped from YANG variable /networks/network/link/te/statistics/restoration_failures (yang:counter32) + If this variable is read-only (config: false) in the + source YANG file, then _set_restoration_failures is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_restoration_failures() directly. + + YANG Description: Number of times that a link experienced restoration +failure. + """ + 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="restoration-failures", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """restoration_failures must be of a type compatible with yang:counter32""", + 'defined-type': "yang:counter32", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="restoration-failures", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False)""", + }) + + self.__restoration_failures = t + if hasattr(self, '_set'): + self._set() + + def _unset_restoration_failures(self): + self.__restoration_failures = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="restoration-failures", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False) + + + def _get_restoration_starts(self): + """ + Getter method for restoration_starts, mapped from YANG variable /networks/network/link/te/statistics/restoration_starts (yang:counter32) + + YANG Description: Number of times that a link experienced restoration +start. + """ + return self.__restoration_starts + + def _set_restoration_starts(self, v, load=False): + """ + Setter method for restoration_starts, mapped from YANG variable /networks/network/link/te/statistics/restoration_starts (yang:counter32) + If this variable is read-only (config: false) in the + source YANG file, then _set_restoration_starts is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_restoration_starts() directly. + + YANG Description: Number of times that a link experienced restoration +start. + """ + 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="restoration-starts", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """restoration_starts must be of a type compatible with yang:counter32""", + 'defined-type': "yang:counter32", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="restoration-starts", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False)""", + }) + + self.__restoration_starts = t + if hasattr(self, '_set'): + self._set() + + def _unset_restoration_starts(self): + self.__restoration_starts = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="restoration-starts", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False) + + + def _get_restoration_successes(self): + """ + Getter method for restoration_successes, mapped from YANG variable /networks/network/link/te/statistics/restoration_successes (yang:counter32) + + YANG Description: Number of times that a link experienced restoration +success. + """ + return self.__restoration_successes + + def _set_restoration_successes(self, v, load=False): + """ + Setter method for restoration_successes, mapped from YANG variable /networks/network/link/te/statistics/restoration_successes (yang:counter32) + If this variable is read-only (config: false) in the + source YANG file, then _set_restoration_successes is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_restoration_successes() directly. + + YANG Description: Number of times that a link experienced restoration +success. + """ + 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="restoration-successes", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """restoration_successes must be of a type compatible with yang:counter32""", + 'defined-type': "yang:counter32", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="restoration-successes", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False)""", + }) + + self.__restoration_successes = t + if hasattr(self, '_set'): + self._set() + + def _unset_restoration_successes(self): + self.__restoration_successes = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="restoration-successes", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False) + + + def _get_restoration_reversion_failures(self): + """ + Getter method for restoration_reversion_failures, mapped from YANG variable /networks/network/link/te/statistics/restoration_reversion_failures (yang:counter32) + + YANG Description: Number of times that a link experienced restoration +reversion failure. + """ + return self.__restoration_reversion_failures + + def _set_restoration_reversion_failures(self, v, load=False): + """ + Setter method for restoration_reversion_failures, mapped from YANG variable /networks/network/link/te/statistics/restoration_reversion_failures (yang:counter32) + If this variable is read-only (config: false) in the + source YANG file, then _set_restoration_reversion_failures is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_restoration_reversion_failures() directly. + + YANG Description: Number of times that a link experienced restoration +reversion failure. + """ + 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="restoration-reversion-failures", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """restoration_reversion_failures must be of a type compatible with yang:counter32""", + 'defined-type': "yang:counter32", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="restoration-reversion-failures", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False)""", + }) + + self.__restoration_reversion_failures = t + if hasattr(self, '_set'): + self._set() + + def _unset_restoration_reversion_failures(self): + self.__restoration_reversion_failures = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="restoration-reversion-failures", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False) + + + def _get_restoration_reversion_starts(self): + """ + Getter method for restoration_reversion_starts, mapped from YANG variable /networks/network/link/te/statistics/restoration_reversion_starts (yang:counter32) + + YANG Description: Number of times that a link experienced restoration +reversion start. + """ + return self.__restoration_reversion_starts + + def _set_restoration_reversion_starts(self, v, load=False): + """ + Setter method for restoration_reversion_starts, mapped from YANG variable /networks/network/link/te/statistics/restoration_reversion_starts (yang:counter32) + If this variable is read-only (config: false) in the + source YANG file, then _set_restoration_reversion_starts is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_restoration_reversion_starts() directly. + + YANG Description: Number of times that a link experienced restoration +reversion start. + """ + 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="restoration-reversion-starts", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """restoration_reversion_starts must be of a type compatible with yang:counter32""", + 'defined-type': "yang:counter32", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="restoration-reversion-starts", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False)""", + }) + + self.__restoration_reversion_starts = t + if hasattr(self, '_set'): + self._set() + + def _unset_restoration_reversion_starts(self): + self.__restoration_reversion_starts = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="restoration-reversion-starts", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False) + + + def _get_restoration_reversion_successes(self): + """ + Getter method for restoration_reversion_successes, mapped from YANG variable /networks/network/link/te/statistics/restoration_reversion_successes (yang:counter32) + + YANG Description: Number of times that a link experienced restoration +reversion success. + """ + return self.__restoration_reversion_successes + + def _set_restoration_reversion_successes(self, v, load=False): + """ + Setter method for restoration_reversion_successes, mapped from YANG variable /networks/network/link/te/statistics/restoration_reversion_successes (yang:counter32) + If this variable is read-only (config: false) in the + source YANG file, then _set_restoration_reversion_successes is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_restoration_reversion_successes() directly. + + YANG Description: Number of times that a link experienced restoration +reversion success. + """ + 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="restoration-reversion-successes", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """restoration_reversion_successes must be of a type compatible with yang:counter32""", + 'defined-type': "yang:counter32", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="restoration-reversion-successes", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False)""", + }) + + self.__restoration_reversion_successes = t + if hasattr(self, '_set'): + self._set() + + def _unset_restoration_reversion_successes(self): + self.__restoration_reversion_successes = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="restoration-reversion-successes", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False) + + discontinuity_time = __builtin__.property(_get_discontinuity_time) + disables = __builtin__.property(_get_disables) + enables = __builtin__.property(_get_enables) + maintenance_clears = __builtin__.property(_get_maintenance_clears) + maintenance_sets = __builtin__.property(_get_maintenance_sets) + modifies = __builtin__.property(_get_modifies) + downs = __builtin__.property(_get_downs) + ups = __builtin__.property(_get_ups) + fault_clears = __builtin__.property(_get_fault_clears) + fault_detects = __builtin__.property(_get_fault_detects) + protection_switches = __builtin__.property(_get_protection_switches) + protection_reverts = __builtin__.property(_get_protection_reverts) + restoration_failures = __builtin__.property(_get_restoration_failures) + restoration_starts = __builtin__.property(_get_restoration_starts) + restoration_successes = __builtin__.property(_get_restoration_successes) + restoration_reversion_failures = __builtin__.property(_get_restoration_reversion_failures) + restoration_reversion_starts = __builtin__.property(_get_restoration_reversion_starts) + restoration_reversion_successes = __builtin__.property(_get_restoration_reversion_successes) + + + _pyangbind_elements = OrderedDict([('discontinuity_time', discontinuity_time), ('disables', disables), ('enables', enables), ('maintenance_clears', maintenance_clears), ('maintenance_sets', maintenance_sets), ('modifies', modifies), ('downs', downs), ('ups', ups), ('fault_clears', fault_clears), ('fault_detects', fault_detects), ('protection_switches', protection_switches), ('protection_reverts', protection_reverts), ('restoration_failures', restoration_failures), ('restoration_starts', restoration_starts), ('restoration_successes', restoration_successes), ('restoration_reversion_failures', restoration_reversion_failures), ('restoration_reversion_starts', restoration_reversion_starts), ('restoration_reversion_successes', restoration_reversion_successes), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..f83e385c43cf4ee2c24fa6bde7b528d15df5ae2c --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/__init__.py @@ -0,0 +1,938 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 external_domain +from . import underlay +from . import interface_switching_capability +from . import label_restrictions +from . import max_link_bandwidth +from . import max_resv_link_bandwidth +from . import unreserved_bandwidth +from . import te_srlgs +from . import te_nsrlgs +from . import otn_link +from . import client_svc +class te_link_attributes(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/link/te/te-link-attributes. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Link attributes in a TE topology. + """ + __slots__ = ('_path_helper', '_extmethods', '__access_type','__external_domain','__is_abstract','__name','__underlay','__admin_status','__link_index','__administrative_group','__interface_switching_capability','__label_restrictions','__link_protection_type','__max_link_bandwidth','__max_resv_link_bandwidth','__unreserved_bandwidth','__te_default_metric','__te_delay_metric','__te_igp_metric','__te_srlgs','__te_nsrlgs','__otn_link','__client_svc',) + + _yang_name = 'te-link-attributes' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__access_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'point-to-point': {}, 'multi-access': {}},), is_leaf=True, yang_name="access-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-types:te-link-access-type', is_config=True) + self.__external_domain = YANGDynClass(base=external_domain.external_domain, is_container='container', yang_name="external-domain", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__is_abstract = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="is-abstract", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='empty', is_config=True) + 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='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=True) + self.__underlay = YANGDynClass(base=underlay.underlay, is_container='container', yang_name="underlay", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__admin_status = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'up': {}, 'down': {}, 'testing': {}, 'preparing-maintenance': {}, 'maintenance': {}, 'unknown': {}},), is_leaf=True, yang_name="admin-status", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-types:te-admin-status', is_config=True) + self.__link_index = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="link-index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint64', is_config=True) + self.__administrative_group = YANGDynClass(base=[RestrictedClassType(base_type=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}), restriction_dict={'length': ['1..11']}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}),], is_leaf=True, yang_name="administrative-group", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-types:admin-groups', is_config=True) + self.__interface_switching_capability = YANGDynClass(base=YANGListType("switching_capability encoding",interface_switching_capability.interface_switching_capability, yang_name="interface-switching-capability", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='switching-capability encoding', extensions=None), is_container='list', yang_name="interface-switching-capability", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + self.__label_restrictions = YANGDynClass(base=label_restrictions.label_restrictions, is_container='container', yang_name="label-restrictions", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__link_protection_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'link-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-shared': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-shared': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-shared': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-enhanced': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-enhanced': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-enhanced': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="link-protection-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + self.__max_link_bandwidth = YANGDynClass(base=max_link_bandwidth.max_link_bandwidth, is_container='container', yang_name="max-link-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__max_resv_link_bandwidth = YANGDynClass(base=max_resv_link_bandwidth.max_resv_link_bandwidth, is_container='container', yang_name="max-resv-link-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__unreserved_bandwidth = YANGDynClass(base=YANGListType("priority",unreserved_bandwidth.unreserved_bandwidth, yang_name="unreserved-bandwidth", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='priority', extensions=None), is_container='list', yang_name="unreserved-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + self.__te_default_metric = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="te-default-metric", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + self.__te_delay_metric = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="te-delay-metric", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + self.__te_igp_metric = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="te-igp-metric", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + self.__te_srlgs = YANGDynClass(base=te_srlgs.te_srlgs, is_container='container', yang_name="te-srlgs", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__te_nsrlgs = YANGDynClass(base=te_nsrlgs.te_nsrlgs, is_container='container', yang_name="te-nsrlgs", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__otn_link = YANGDynClass(base=otn_link.otn_link, is_container='container', yang_name="otn-link", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + self.__client_svc = YANGDynClass(base=client_svc.client_svc, is_container='container', yang_name="client-svc", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-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 ['networks', 'network', 'link', 'te', 'te-link-attributes'] + + def _get_access_type(self): + """ + Getter method for access_type, mapped from YANG variable /networks/network/link/te/te_link_attributes/access_type (te-types:te-link-access-type) + + YANG Description: Link access type, which can be point-to-point or +multi-access. + """ + return self.__access_type + + def _set_access_type(self, v, load=False): + """ + Setter method for access_type, mapped from YANG variable /networks/network/link/te/te_link_attributes/access_type (te-types:te-link-access-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_access_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_access_type() directly. + + YANG Description: Link access type, which can be point-to-point or +multi-access. + """ + 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={'point-to-point': {}, 'multi-access': {}},), is_leaf=True, yang_name="access-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-types:te-link-access-type', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """access_type must be of a type compatible with te-types:te-link-access-type""", + 'defined-type': "te-types:te-link-access-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'point-to-point': {}, 'multi-access': {}},), is_leaf=True, yang_name="access-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-types:te-link-access-type', is_config=True)""", + }) + + self.__access_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_access_type(self): + self.__access_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'point-to-point': {}, 'multi-access': {}},), is_leaf=True, yang_name="access-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-types:te-link-access-type', is_config=True) + + + def _get_external_domain(self): + """ + Getter method for external_domain, mapped from YANG variable /networks/network/link/te/te_link_attributes/external_domain (container) + + YANG Description: For an inter-domain link, specifies the attributes of +the remote end of the link, to facilitate the signaling at +the local end. + """ + return self.__external_domain + + def _set_external_domain(self, v, load=False): + """ + Setter method for external_domain, mapped from YANG variable /networks/network/link/te/te_link_attributes/external_domain (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_external_domain is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_external_domain() directly. + + YANG Description: For an inter-domain link, specifies the attributes of +the remote end of the link, to facilitate the signaling at +the local end. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=external_domain.external_domain, is_container='container', yang_name="external-domain", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """external_domain must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=external_domain.external_domain, is_container='container', yang_name="external-domain", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__external_domain = t + if hasattr(self, '_set'): + self._set() + + def _unset_external_domain(self): + self.__external_domain = YANGDynClass(base=external_domain.external_domain, is_container='container', yang_name="external-domain", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_is_abstract(self): + """ + Getter method for is_abstract, mapped from YANG variable /networks/network/link/te/te_link_attributes/is_abstract (empty) + + YANG Description: Present if the link is abstract. + """ + return self.__is_abstract + + def _set_is_abstract(self, v, load=False): + """ + Setter method for is_abstract, mapped from YANG variable /networks/network/link/te/te_link_attributes/is_abstract (empty) + If this variable is read-only (config: false) in the + source YANG file, then _set_is_abstract is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_is_abstract() directly. + + YANG Description: Present if the link is abstract. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBool, is_leaf=True, yang_name="is-abstract", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='empty', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """is_abstract must be of a type compatible with empty""", + 'defined-type': "empty", + 'generated-type': """YANGDynClass(base=YANGBool, is_leaf=True, yang_name="is-abstract", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='empty', is_config=True)""", + }) + + self.__is_abstract = t + if hasattr(self, '_set'): + self._set() + + def _unset_is_abstract(self): + self.__is_abstract = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="is-abstract", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='empty', is_config=True) + + + def _get_name(self): + """ + Getter method for name, mapped from YANG variable /networks/network/link/te/te_link_attributes/name (string) + + YANG Description: Link name. + """ + return self.__name + + def _set_name(self, v, load=False): + """ + Setter method for name, mapped from YANG variable /networks/network/link/te/te_link_attributes/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: Link name. + """ + 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='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', 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='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', 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='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=True) + + + def _get_underlay(self): + """ + Getter method for underlay, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay (container) + + YANG Description: Attributes of the TE link underlay. + """ + return self.__underlay + + def _set_underlay(self, v, load=False): + """ + Setter method for underlay, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_underlay is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_underlay() directly. + + YANG Description: Attributes of the TE link underlay. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=underlay.underlay, is_container='container', yang_name="underlay", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """underlay must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=underlay.underlay, is_container='container', yang_name="underlay", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__underlay = t + if hasattr(self, '_set'): + self._set() + + def _unset_underlay(self): + self.__underlay = YANGDynClass(base=underlay.underlay, is_container='container', yang_name="underlay", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_admin_status(self): + """ + Getter method for admin_status, mapped from YANG variable /networks/network/link/te/te_link_attributes/admin_status (te-types:te-admin-status) + + YANG Description: The administrative state of the link. + """ + return self.__admin_status + + def _set_admin_status(self, v, load=False): + """ + Setter method for admin_status, mapped from YANG variable /networks/network/link/te/te_link_attributes/admin_status (te-types:te-admin-status) + 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 administrative state of the link. + """ + 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': {}, 'preparing-maintenance': {}, 'maintenance': {}, 'unknown': {}},), is_leaf=True, yang_name="admin-status", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-types:te-admin-status', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """admin_status must be of a type compatible with te-types:te-admin-status""", + 'defined-type': "te-types:te-admin-status", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'up': {}, 'down': {}, 'testing': {}, 'preparing-maintenance': {}, 'maintenance': {}, 'unknown': {}},), is_leaf=True, yang_name="admin-status", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-types:te-admin-status', is_config=True)""", + }) + + 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': {}, 'preparing-maintenance': {}, 'maintenance': {}, 'unknown': {}},), is_leaf=True, yang_name="admin-status", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-types:te-admin-status', is_config=True) + + + def _get_link_index(self): + """ + Getter method for link_index, mapped from YANG variable /networks/network/link/te/te_link_attributes/link_index (uint64) + + YANG Description: The link identifier. If OSPF is used, this object +represents an ospfLsdbID. If IS-IS is used, this object +represents an isisLSPID. If a locally configured link is +used, this object represents a unique value, which is +locally defined in a router. + """ + return self.__link_index + + def _set_link_index(self, v, load=False): + """ + Setter method for link_index, mapped from YANG variable /networks/network/link/te/te_link_attributes/link_index (uint64) + If this variable is read-only (config: false) in the + source YANG file, then _set_link_index is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_link_index() directly. + + YANG Description: The link identifier. If OSPF is used, this object +represents an ospfLsdbID. If IS-IS is used, this object +represents an isisLSPID. If a locally configured link is +used, this object represents a unique value, which is +locally defined in a router. + """ + 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="link-index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint64', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """link_index 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="link-index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint64', is_config=True)""", + }) + + self.__link_index = t + if hasattr(self, '_set'): + self._set() + + def _unset_link_index(self): + self.__link_index = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="link-index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint64', is_config=True) + + + def _get_administrative_group(self): + """ + Getter method for administrative_group, mapped from YANG variable /networks/network/link/te/te_link_attributes/administrative_group (te-types:admin-groups) + + YANG Description: Administrative group or color of the link. +This attribute covers both administrative groups (defined +in RFCs 3630 and 5305) and Extended Administrative Groups +(defined in RFC 7308). + """ + return self.__administrative_group + + def _set_administrative_group(self, v, load=False): + """ + Setter method for administrative_group, mapped from YANG variable /networks/network/link/te/te_link_attributes/administrative_group (te-types:admin-groups) + If this variable is read-only (config: false) in the + source YANG file, then _set_administrative_group is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_administrative_group() directly. + + YANG Description: Administrative group or color of the link. +This attribute covers both administrative groups (defined +in RFCs 3630 and 5305) and Extended Administrative Groups +(defined in RFC 7308). + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=[RestrictedClassType(base_type=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}), restriction_dict={'length': ['1..11']}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}),], is_leaf=True, yang_name="administrative-group", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-types:admin-groups', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """administrative_group must be of a type compatible with te-types:admin-groups""", + 'defined-type': "te-types:admin-groups", + 'generated-type': """YANGDynClass(base=[RestrictedClassType(base_type=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}), restriction_dict={'length': ['1..11']}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}),], is_leaf=True, yang_name="administrative-group", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-types:admin-groups', is_config=True)""", + }) + + self.__administrative_group = t + if hasattr(self, '_set'): + self._set() + + def _unset_administrative_group(self): + self.__administrative_group = YANGDynClass(base=[RestrictedClassType(base_type=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}), restriction_dict={'length': ['1..11']}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}),], is_leaf=True, yang_name="administrative-group", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-types:admin-groups', is_config=True) + + + def _get_interface_switching_capability(self): + """ + Getter method for interface_switching_capability, mapped from YANG variable /networks/network/link/te/te_link_attributes/interface_switching_capability (list) + + YANG Description: List of ISCDs for this link. + """ + return self.__interface_switching_capability + + def _set_interface_switching_capability(self, v, load=False): + """ + Setter method for interface_switching_capability, mapped from YANG variable /networks/network/link/te/te_link_attributes/interface_switching_capability (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_interface_switching_capability is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_interface_switching_capability() directly. + + YANG Description: List of ISCDs for this link. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("switching_capability encoding",interface_switching_capability.interface_switching_capability, yang_name="interface-switching-capability", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='switching-capability encoding', extensions=None), is_container='list', yang_name="interface-switching-capability", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """interface_switching_capability must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("switching_capability encoding",interface_switching_capability.interface_switching_capability, yang_name="interface-switching-capability", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='switching-capability encoding', extensions=None), is_container='list', yang_name="interface-switching-capability", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True)""", + }) + + self.__interface_switching_capability = t + if hasattr(self, '_set'): + self._set() + + def _unset_interface_switching_capability(self): + self.__interface_switching_capability = YANGDynClass(base=YANGListType("switching_capability encoding",interface_switching_capability.interface_switching_capability, yang_name="interface-switching-capability", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='switching-capability encoding', extensions=None), is_container='list', yang_name="interface-switching-capability", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + + + def _get_label_restrictions(self): + """ + Getter method for label_restrictions, mapped from YANG variable /networks/network/link/te/te_link_attributes/label_restrictions (container) + + YANG Description: The label restrictions container. + """ + return self.__label_restrictions + + def _set_label_restrictions(self, v, load=False): + """ + Setter method for label_restrictions, mapped from YANG variable /networks/network/link/te/te_link_attributes/label_restrictions (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_label_restrictions is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_label_restrictions() directly. + + YANG Description: The label restrictions container. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=label_restrictions.label_restrictions, is_container='container', yang_name="label-restrictions", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """label_restrictions must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=label_restrictions.label_restrictions, is_container='container', yang_name="label-restrictions", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__label_restrictions = t + if hasattr(self, '_set'): + self._set() + + def _unset_label_restrictions(self): + self.__label_restrictions = YANGDynClass(base=label_restrictions.label_restrictions, is_container='container', yang_name="label-restrictions", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_link_protection_type(self): + """ + Getter method for link_protection_type, mapped from YANG variable /networks/network/link/te/te_link_attributes/link_protection_type (identityref) + + YANG Description: Link Protection Type desired for this link. + """ + return self.__link_protection_type + + def _set_link_protection_type(self, v, load=False): + """ + Setter method for link_protection_type, mapped from YANG variable /networks/network/link/te/te_link_attributes/link_protection_type (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_link_protection_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_link_protection_type() directly. + + YANG Description: Link Protection Type desired for this link. + """ + 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={'link-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-shared': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-shared': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-shared': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-enhanced': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-enhanced': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-enhanced': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="link-protection-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """link_protection_type must be of a type compatible with identityref""", + 'defined-type': "ietf-te-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'link-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-shared': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-shared': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-shared': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-enhanced': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-enhanced': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-enhanced': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="link-protection-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True)""", + }) + + self.__link_protection_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_link_protection_type(self): + self.__link_protection_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'link-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-shared': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-shared': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-shared': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-enhanced': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-enhanced': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-enhanced': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="link-protection-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + + + def _get_max_link_bandwidth(self): + """ + Getter method for max_link_bandwidth, mapped from YANG variable /networks/network/link/te/te_link_attributes/max_link_bandwidth (container) + + YANG Description: Maximum bandwidth that can be seen on this link in this +direction. Units are in bytes per second. + """ + return self.__max_link_bandwidth + + def _set_max_link_bandwidth(self, v, load=False): + """ + Setter method for max_link_bandwidth, mapped from YANG variable /networks/network/link/te/te_link_attributes/max_link_bandwidth (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_max_link_bandwidth is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_max_link_bandwidth() directly. + + YANG Description: Maximum bandwidth that can be seen on this link in this +direction. Units are in bytes per second. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=max_link_bandwidth.max_link_bandwidth, is_container='container', yang_name="max-link-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """max_link_bandwidth must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=max_link_bandwidth.max_link_bandwidth, is_container='container', yang_name="max-link-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__max_link_bandwidth = t + if hasattr(self, '_set'): + self._set() + + def _unset_max_link_bandwidth(self): + self.__max_link_bandwidth = YANGDynClass(base=max_link_bandwidth.max_link_bandwidth, is_container='container', yang_name="max-link-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_max_resv_link_bandwidth(self): + """ + Getter method for max_resv_link_bandwidth, mapped from YANG variable /networks/network/link/te/te_link_attributes/max_resv_link_bandwidth (container) + + YANG Description: Maximum amount of bandwidth that can be reserved in this +direction in this link. Units are in bytes per second. + """ + return self.__max_resv_link_bandwidth + + def _set_max_resv_link_bandwidth(self, v, load=False): + """ + Setter method for max_resv_link_bandwidth, mapped from YANG variable /networks/network/link/te/te_link_attributes/max_resv_link_bandwidth (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_max_resv_link_bandwidth is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_max_resv_link_bandwidth() directly. + + YANG Description: Maximum amount of bandwidth that can be reserved in this +direction in this link. Units are in bytes per second. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=max_resv_link_bandwidth.max_resv_link_bandwidth, is_container='container', yang_name="max-resv-link-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """max_resv_link_bandwidth must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=max_resv_link_bandwidth.max_resv_link_bandwidth, is_container='container', yang_name="max-resv-link-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__max_resv_link_bandwidth = t + if hasattr(self, '_set'): + self._set() + + def _unset_max_resv_link_bandwidth(self): + self.__max_resv_link_bandwidth = YANGDynClass(base=max_resv_link_bandwidth.max_resv_link_bandwidth, is_container='container', yang_name="max-resv-link-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_unreserved_bandwidth(self): + """ + Getter method for unreserved_bandwidth, mapped from YANG variable /networks/network/link/te/te_link_attributes/unreserved_bandwidth (list) + + YANG Description: Unreserved bandwidth for priority levels 0-7. Units are in +bytes per second. + """ + return self.__unreserved_bandwidth + + def _set_unreserved_bandwidth(self, v, load=False): + """ + Setter method for unreserved_bandwidth, mapped from YANG variable /networks/network/link/te/te_link_attributes/unreserved_bandwidth (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_unreserved_bandwidth is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_unreserved_bandwidth() directly. + + YANG Description: Unreserved bandwidth for priority levels 0-7. Units are in +bytes per second. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("priority",unreserved_bandwidth.unreserved_bandwidth, yang_name="unreserved-bandwidth", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='priority', extensions=None), is_container='list', yang_name="unreserved-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """unreserved_bandwidth must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("priority",unreserved_bandwidth.unreserved_bandwidth, yang_name="unreserved-bandwidth", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='priority', extensions=None), is_container='list', yang_name="unreserved-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True)""", + }) + + self.__unreserved_bandwidth = t + if hasattr(self, '_set'): + self._set() + + def _unset_unreserved_bandwidth(self): + self.__unreserved_bandwidth = YANGDynClass(base=YANGListType("priority",unreserved_bandwidth.unreserved_bandwidth, yang_name="unreserved-bandwidth", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='priority', extensions=None), is_container='list', yang_name="unreserved-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + + + def _get_te_default_metric(self): + """ + Getter method for te_default_metric, mapped from YANG variable /networks/network/link/te/te_link_attributes/te_default_metric (uint32) + + YANG Description: Traffic Engineering metric. + """ + return self.__te_default_metric + + def _set_te_default_metric(self, v, load=False): + """ + Setter method for te_default_metric, mapped from YANG variable /networks/network/link/te/te_link_attributes/te_default_metric (uint32) + If this variable is read-only (config: false) in the + source YANG file, then _set_te_default_metric is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_te_default_metric() directly. + + YANG Description: Traffic Engineering metric. + """ + 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="te-default-metric", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """te_default_metric 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="te-default-metric", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True)""", + }) + + self.__te_default_metric = t + if hasattr(self, '_set'): + self._set() + + def _unset_te_default_metric(self): + self.__te_default_metric = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="te-default-metric", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + + + def _get_te_delay_metric(self): + """ + Getter method for te_delay_metric, mapped from YANG variable /networks/network/link/te/te_link_attributes/te_delay_metric (uint32) + + YANG Description: Traffic Engineering delay metric. + """ + return self.__te_delay_metric + + def _set_te_delay_metric(self, v, load=False): + """ + Setter method for te_delay_metric, mapped from YANG variable /networks/network/link/te/te_link_attributes/te_delay_metric (uint32) + If this variable is read-only (config: false) in the + source YANG file, then _set_te_delay_metric is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_te_delay_metric() directly. + + YANG Description: Traffic Engineering delay metric. + """ + 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="te-delay-metric", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """te_delay_metric 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="te-delay-metric", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True)""", + }) + + self.__te_delay_metric = t + if hasattr(self, '_set'): + self._set() + + def _unset_te_delay_metric(self): + self.__te_delay_metric = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="te-delay-metric", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + + + def _get_te_igp_metric(self): + """ + Getter method for te_igp_metric, mapped from YANG variable /networks/network/link/te/te_link_attributes/te_igp_metric (uint32) + + YANG Description: IGP metric used for Traffic Engineering. + """ + return self.__te_igp_metric + + def _set_te_igp_metric(self, v, load=False): + """ + Setter method for te_igp_metric, mapped from YANG variable /networks/network/link/te/te_link_attributes/te_igp_metric (uint32) + If this variable is read-only (config: false) in the + source YANG file, then _set_te_igp_metric is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_te_igp_metric() directly. + + YANG Description: IGP metric used for Traffic Engineering. + """ + 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="te-igp-metric", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """te_igp_metric 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="te-igp-metric", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True)""", + }) + + self.__te_igp_metric = t + if hasattr(self, '_set'): + self._set() + + def _unset_te_igp_metric(self): + self.__te_igp_metric = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="te-igp-metric", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + + + def _get_te_srlgs(self): + """ + Getter method for te_srlgs, mapped from YANG variable /networks/network/link/te/te_link_attributes/te_srlgs (container) + + YANG Description: Contains a list of SRLGs. + """ + return self.__te_srlgs + + def _set_te_srlgs(self, v, load=False): + """ + Setter method for te_srlgs, mapped from YANG variable /networks/network/link/te/te_link_attributes/te_srlgs (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_te_srlgs is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_te_srlgs() directly. + + YANG Description: Contains a list of SRLGs. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=te_srlgs.te_srlgs, is_container='container', yang_name="te-srlgs", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """te_srlgs must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=te_srlgs.te_srlgs, is_container='container', yang_name="te-srlgs", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__te_srlgs = t + if hasattr(self, '_set'): + self._set() + + def _unset_te_srlgs(self): + self.__te_srlgs = YANGDynClass(base=te_srlgs.te_srlgs, is_container='container', yang_name="te-srlgs", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_te_nsrlgs(self): + """ + Getter method for te_nsrlgs, mapped from YANG variable /networks/network/link/te/te_link_attributes/te_nsrlgs (container) + + YANG Description: Contains a list of NSRLGs (Non-Shared Risk Link Groups). +When an abstract TE link is configured, this list specifies +the request that underlay TE paths need to be mutually +disjoint with other TE links in the same groups. + """ + return self.__te_nsrlgs + + def _set_te_nsrlgs(self, v, load=False): + """ + Setter method for te_nsrlgs, mapped from YANG variable /networks/network/link/te/te_link_attributes/te_nsrlgs (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_te_nsrlgs is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_te_nsrlgs() directly. + + YANG Description: Contains a list of NSRLGs (Non-Shared Risk Link Groups). +When an abstract TE link is configured, this list specifies +the request that underlay TE paths need to be mutually +disjoint with other TE links in the same groups. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=te_nsrlgs.te_nsrlgs, is_container='container', yang_name="te-nsrlgs", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """te_nsrlgs must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=te_nsrlgs.te_nsrlgs, is_container='container', yang_name="te-nsrlgs", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__te_nsrlgs = t + if hasattr(self, '_set'): + self._set() + + def _unset_te_nsrlgs(self): + self.__te_nsrlgs = YANGDynClass(base=te_nsrlgs.te_nsrlgs, is_container='container', yang_name="te-nsrlgs", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_otn_link(self): + """ + Getter method for otn_link, mapped from YANG variable /networks/network/link/te/te_link_attributes/otn_link (container) + + YANG Description: Attributes of the OTN Link. + """ + return self.__otn_link + + def _set_otn_link(self, v, load=False): + """ + Setter method for otn_link, mapped from YANG variable /networks/network/link/te/te_link_attributes/otn_link (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_otn_link is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_otn_link() directly. + + YANG Description: Attributes of the OTN Link. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=otn_link.otn_link, is_container='container', yang_name="otn-link", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """otn_link must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=otn_link.otn_link, is_container='container', yang_name="otn-link", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True)""", + }) + + self.__otn_link = t + if hasattr(self, '_set'): + self._set() + + def _unset_otn_link(self): + self.__otn_link = YANGDynClass(base=otn_link.otn_link, is_container='container', yang_name="otn-link", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + + + def _get_client_svc(self): + """ + Getter method for client_svc, mapped from YANG variable /networks/network/link/te/te_link_attributes/client_svc (container) + + YANG Description: Attributes of the Link supporting CBR client signals. + """ + return self.__client_svc + + def _set_client_svc(self, v, load=False): + """ + Setter method for client_svc, mapped from YANG variable /networks/network/link/te/te_link_attributes/client_svc (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_client_svc is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_client_svc() directly. + + YANG Description: Attributes of the Link supporting CBR client signals. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=client_svc.client_svc, is_container='container', yang_name="client-svc", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """client_svc must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=client_svc.client_svc, is_container='container', yang_name="client-svc", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True)""", + }) + + self.__client_svc = t + if hasattr(self, '_set'): + self._set() + + def _unset_client_svc(self): + self.__client_svc = YANGDynClass(base=client_svc.client_svc, is_container='container', yang_name="client-svc", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + + access_type = __builtin__.property(_get_access_type, _set_access_type) + external_domain = __builtin__.property(_get_external_domain, _set_external_domain) + is_abstract = __builtin__.property(_get_is_abstract, _set_is_abstract) + name = __builtin__.property(_get_name, _set_name) + underlay = __builtin__.property(_get_underlay, _set_underlay) + admin_status = __builtin__.property(_get_admin_status, _set_admin_status) + link_index = __builtin__.property(_get_link_index, _set_link_index) + administrative_group = __builtin__.property(_get_administrative_group, _set_administrative_group) + interface_switching_capability = __builtin__.property(_get_interface_switching_capability, _set_interface_switching_capability) + label_restrictions = __builtin__.property(_get_label_restrictions, _set_label_restrictions) + link_protection_type = __builtin__.property(_get_link_protection_type, _set_link_protection_type) + max_link_bandwidth = __builtin__.property(_get_max_link_bandwidth, _set_max_link_bandwidth) + max_resv_link_bandwidth = __builtin__.property(_get_max_resv_link_bandwidth, _set_max_resv_link_bandwidth) + unreserved_bandwidth = __builtin__.property(_get_unreserved_bandwidth, _set_unreserved_bandwidth) + te_default_metric = __builtin__.property(_get_te_default_metric, _set_te_default_metric) + te_delay_metric = __builtin__.property(_get_te_delay_metric, _set_te_delay_metric) + te_igp_metric = __builtin__.property(_get_te_igp_metric, _set_te_igp_metric) + te_srlgs = __builtin__.property(_get_te_srlgs, _set_te_srlgs) + te_nsrlgs = __builtin__.property(_get_te_nsrlgs, _set_te_nsrlgs) + otn_link = __builtin__.property(_get_otn_link, _set_otn_link) + client_svc = __builtin__.property(_get_client_svc, _set_client_svc) + + + _pyangbind_elements = OrderedDict([('access_type', access_type), ('external_domain', external_domain), ('is_abstract', is_abstract), ('name', name), ('underlay', underlay), ('admin_status', admin_status), ('link_index', link_index), ('administrative_group', administrative_group), ('interface_switching_capability', interface_switching_capability), ('label_restrictions', label_restrictions), ('link_protection_type', link_protection_type), ('max_link_bandwidth', max_link_bandwidth), ('max_resv_link_bandwidth', max_resv_link_bandwidth), ('unreserved_bandwidth', unreserved_bandwidth), ('te_default_metric', te_default_metric), ('te_delay_metric', te_delay_metric), ('te_igp_metric', te_igp_metric), ('te_srlgs', te_srlgs), ('te_nsrlgs', te_nsrlgs), ('otn_link', otn_link), ('client_svc', client_svc), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/client_svc/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/client_svc/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..69ba52bbc1f3cd59eea7b26cf14885731e978925 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/client_svc/__init__.py @@ -0,0 +1,115 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 client_svc(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/link/te/te-link-attributes/client-svc. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Attributes of the Link supporting CBR client signals. + """ + __slots__ = ('_path_helper', '_extmethods', '__supported_client_signal',) + + _yang_name = 'client-svc' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__supported_client_signal = YANGDynClass(unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ETH-1Gb': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ETH-1Gb': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ETH-1Gb': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ETH-10Gb-LAN': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ETH-10Gb-LAN': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ETH-10Gb-LAN': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ETH-10Gb-WAN': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ETH-10Gb-WAN': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ETH-10Gb-WAN': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ETH-40Gb': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ETH-40Gb': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ETH-40Gb': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ETH-100Gb': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ETH-100Gb': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ETH-100Gb': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'STM-1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:STM-1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:STM-1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'STM-4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:STM-4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:STM-4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'STM-16': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:STM-16': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:STM-16': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'STM-64': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:STM-64': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:STM-64': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'STM-256': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:STM-256': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:STM-256': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'OC-3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:OC-3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:OC-3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'OC-12': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:OC-12': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:OC-12': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'OC-48': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:OC-48': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:OC-48': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'OC-192': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:OC-192': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:OC-192': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'OC-768': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:OC-768': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:OC-768': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'FC-100': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:FC-100': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:FC-100': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'FC-200': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:FC-200': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:FC-200': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'FC-400': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:FC-400': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:FC-400': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'FC-800': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:FC-800': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:FC-800': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'FC-1200': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:FC-1200': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:FC-1200': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'FC-1600': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:FC-1600': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:FC-1600': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'FC-3200': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:FC-3200': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:FC-3200': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'FICON-4G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:FICON-4G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:FICON-4G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'FICON-8G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:FICON-8G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:FICON-8G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},)), is_leaf=False, yang_name="supported-client-signal", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', 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 ['networks', 'network', 'link', 'te', 'te-link-attributes', 'client-svc'] + + def _get_supported_client_signal(self): + """ + Getter method for supported_client_signal, mapped from YANG variable /networks/network/link/te/te_link_attributes/client_svc/supported_client_signal (identityref) + + YANG Description: List of client signal types supported by the Link. + """ + return self.__supported_client_signal + + def _set_supported_client_signal(self, v, load=False): + """ + Setter method for supported_client_signal, mapped from YANG variable /networks/network/link/te/te_link_attributes/client_svc/supported_client_signal (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_supported_client_signal is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_supported_client_signal() directly. + + YANG Description: List of client signal types supported by the Link. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ETH-1Gb': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ETH-1Gb': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ETH-1Gb': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ETH-10Gb-LAN': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ETH-10Gb-LAN': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ETH-10Gb-LAN': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ETH-10Gb-WAN': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ETH-10Gb-WAN': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ETH-10Gb-WAN': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ETH-40Gb': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ETH-40Gb': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ETH-40Gb': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ETH-100Gb': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ETH-100Gb': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ETH-100Gb': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'STM-1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:STM-1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:STM-1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'STM-4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:STM-4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:STM-4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'STM-16': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:STM-16': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:STM-16': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'STM-64': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:STM-64': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:STM-64': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'STM-256': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:STM-256': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:STM-256': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'OC-3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:OC-3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:OC-3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'OC-12': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:OC-12': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:OC-12': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'OC-48': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:OC-48': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:OC-48': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'OC-192': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:OC-192': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:OC-192': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'OC-768': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:OC-768': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:OC-768': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'FC-100': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:FC-100': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:FC-100': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'FC-200': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:FC-200': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:FC-200': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'FC-400': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:FC-400': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:FC-400': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'FC-800': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:FC-800': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:FC-800': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'FC-1200': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:FC-1200': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:FC-1200': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'FC-1600': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:FC-1600': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:FC-1600': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'FC-3200': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:FC-3200': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:FC-3200': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'FICON-4G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:FICON-4G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:FICON-4G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'FICON-8G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:FICON-8G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:FICON-8G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},)), is_leaf=False, yang_name="supported-client-signal", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """supported_client_signal must be of a type compatible with identityref""", + 'defined-type': "ietf-otn-topology:identityref", + 'generated-type': """YANGDynClass(unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ETH-1Gb': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ETH-1Gb': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ETH-1Gb': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ETH-10Gb-LAN': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ETH-10Gb-LAN': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ETH-10Gb-LAN': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ETH-10Gb-WAN': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ETH-10Gb-WAN': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ETH-10Gb-WAN': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ETH-40Gb': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ETH-40Gb': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ETH-40Gb': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ETH-100Gb': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ETH-100Gb': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ETH-100Gb': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'STM-1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:STM-1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:STM-1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'STM-4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:STM-4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:STM-4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'STM-16': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:STM-16': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:STM-16': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'STM-64': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:STM-64': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:STM-64': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'STM-256': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:STM-256': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:STM-256': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'OC-3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:OC-3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:OC-3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'OC-12': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:OC-12': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:OC-12': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'OC-48': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:OC-48': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:OC-48': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'OC-192': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:OC-192': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:OC-192': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'OC-768': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:OC-768': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:OC-768': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'FC-100': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:FC-100': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:FC-100': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'FC-200': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:FC-200': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:FC-200': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'FC-400': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:FC-400': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:FC-400': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'FC-800': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:FC-800': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:FC-800': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'FC-1200': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:FC-1200': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:FC-1200': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'FC-1600': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:FC-1600': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:FC-1600': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'FC-3200': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:FC-3200': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:FC-3200': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'FICON-4G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:FICON-4G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:FICON-4G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'FICON-8G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:FICON-8G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:FICON-8G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},)), is_leaf=False, yang_name="supported-client-signal", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True)""", + }) + + self.__supported_client_signal = t + if hasattr(self, '_set'): + self._set() + + def _unset_supported_client_signal(self): + self.__supported_client_signal = YANGDynClass(unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ETH-1Gb': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ETH-1Gb': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ETH-1Gb': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ETH-10Gb-LAN': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ETH-10Gb-LAN': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ETH-10Gb-LAN': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ETH-10Gb-WAN': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ETH-10Gb-WAN': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ETH-10Gb-WAN': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ETH-40Gb': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ETH-40Gb': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ETH-40Gb': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ETH-100Gb': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ETH-100Gb': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ETH-100Gb': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'STM-1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:STM-1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:STM-1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'STM-4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:STM-4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:STM-4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'STM-16': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:STM-16': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:STM-16': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'STM-64': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:STM-64': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:STM-64': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'STM-256': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:STM-256': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:STM-256': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'OC-3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:OC-3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:OC-3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'OC-12': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:OC-12': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:OC-12': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'OC-48': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:OC-48': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:OC-48': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'OC-192': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:OC-192': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:OC-192': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'OC-768': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:OC-768': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:OC-768': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'FC-100': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:FC-100': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:FC-100': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'FC-200': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:FC-200': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:FC-200': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'FC-400': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:FC-400': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:FC-400': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'FC-800': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:FC-800': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:FC-800': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'FC-1200': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:FC-1200': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:FC-1200': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'FC-1600': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:FC-1600': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:FC-1600': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'FC-3200': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:FC-3200': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:FC-3200': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'FICON-4G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:FICON-4G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:FICON-4G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'FICON-8G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:FICON-8G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:FICON-8G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},)), is_leaf=False, yang_name="supported-client-signal", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + + supported_client_signal = __builtin__.property(_get_supported_client_signal, _set_supported_client_signal) + + + _pyangbind_elements = OrderedDict([('supported_client_signal', supported_client_signal), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/external_domain/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/external_domain/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..adc0d23fb6e1d7573a6686a7b049a3bccf0a2dd3 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/external_domain/__init__.py @@ -0,0 +1,205 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 external_domain(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/link/te/te-link-attributes/external-domain. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: For an inter-domain link, specifies the attributes of +the remote end of the link, to facilitate the signaling at +the local end. + """ + __slots__ = ('_path_helper', '_extmethods', '__network_ref','__remote_te_node_id','__remote_te_link_tp_id',) + + _yang_name = 'external-domain' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__network_ref = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="network-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=True) + self.__remote_te_node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="remote-te-node-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-types:te-node-id', is_config=True) + self.__remote_te_link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="remote-te-link-tp-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-types:te-tp-id', 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 ['networks', 'network', 'link', 'te', 'te-link-attributes', 'external-domain'] + + def _get_network_ref(self): + """ + Getter method for network_ref, mapped from YANG variable /networks/network/link/te/te_link_attributes/external_domain/network_ref (leafref) + + YANG Description: Used to reference a network -- for example, an underlay +network. + """ + return self.__network_ref + + def _set_network_ref(self, v, load=False): + """ + Setter method for network_ref, mapped from YANG variable /networks/network/link/te/te_link_attributes/external_domain/network_ref (leafref) + If this variable is read-only (config: false) in the + source YANG file, then _set_network_ref is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_network_ref() directly. + + YANG Description: Used to reference a network -- for example, an underlay +network. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="network-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """network_ref must be of a type compatible with leafref""", + 'defined-type': "leafref", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="network-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=True)""", + }) + + self.__network_ref = t + if hasattr(self, '_set'): + self._set() + + def _unset_network_ref(self): + self.__network_ref = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="network-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=True) + + + def _get_remote_te_node_id(self): + """ + Getter method for remote_te_node_id, mapped from YANG variable /networks/network/link/te/te_link_attributes/external_domain/remote_te_node_id (te-types:te-node-id) + + YANG Description: Remote TE node identifier, used together with +'remote-te-link-tp-id' to identify the remote Link +Termination Point (LTP) in a different domain. + """ + return self.__remote_te_node_id + + def _set_remote_te_node_id(self, v, load=False): + """ + Setter method for remote_te_node_id, mapped from YANG variable /networks/network/link/te/te_link_attributes/external_domain/remote_te_node_id (te-types:te-node-id) + If this variable is read-only (config: false) in the + source YANG file, then _set_remote_te_node_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_remote_te_node_id() directly. + + YANG Description: Remote TE node identifier, used together with +'remote-te-link-tp-id' to identify the remote Link +Termination Point (LTP) in a different domain. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="remote-te-node-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-types:te-node-id', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """remote_te_node_id must be of a type compatible with te-types:te-node-id""", + 'defined-type': "te-types:te-node-id", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="remote-te-node-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-types:te-node-id', is_config=True)""", + }) + + self.__remote_te_node_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_remote_te_node_id(self): + self.__remote_te_node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="remote-te-node-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-types:te-node-id', is_config=True) + + + def _get_remote_te_link_tp_id(self): + """ + Getter method for remote_te_link_tp_id, mapped from YANG variable /networks/network/link/te/te_link_attributes/external_domain/remote_te_link_tp_id (te-types:te-tp-id) + + YANG Description: Remote TE LTP identifier, used together with +'remote-te-node-id' to identify the remote LTP in a +different domain. + """ + return self.__remote_te_link_tp_id + + def _set_remote_te_link_tp_id(self, v, load=False): + """ + Setter method for remote_te_link_tp_id, mapped from YANG variable /networks/network/link/te/te_link_attributes/external_domain/remote_te_link_tp_id (te-types:te-tp-id) + If this variable is read-only (config: false) in the + source YANG file, then _set_remote_te_link_tp_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_remote_te_link_tp_id() directly. + + YANG Description: Remote TE LTP identifier, used together with +'remote-te-node-id' to identify the remote LTP in a +different domain. + """ + 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),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="remote-te-link-tp-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-types:te-tp-id', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """remote_te_link_tp_id must be of a type compatible with te-types:te-tp-id""", + 'defined-type': "te-types:te-tp-id", + 'generated-type': """YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="remote-te-link-tp-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-types:te-tp-id', is_config=True)""", + }) + + self.__remote_te_link_tp_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_remote_te_link_tp_id(self): + self.__remote_te_link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="remote-te-link-tp-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-types:te-tp-id', is_config=True) + + network_ref = __builtin__.property(_get_network_ref, _set_network_ref) + remote_te_node_id = __builtin__.property(_get_remote_te_node_id, _set_remote_te_node_id) + remote_te_link_tp_id = __builtin__.property(_get_remote_te_link_tp_id, _set_remote_te_link_tp_id) + + + _pyangbind_elements = OrderedDict([('network_ref', network_ref), ('remote_te_node_id', remote_te_node_id), ('remote_te_link_tp_id', remote_te_link_tp_id), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/interface_switching_capability/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/interface_switching_capability/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e999df8fd7004d8a4ff893b3c470c52dbd6076b6 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/interface_switching_capability/__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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 max_lsp_bandwidth +class interface_switching_capability(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/link/te/te-link-attributes/interface-switching-capability. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: List of ISCDs for this link. + """ + __slots__ = ('_path_helper', '_extmethods', '__switching_capability','__encoding','__max_lsp_bandwidth',) + + _yang_name = 'interface-switching-capability' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__switching_capability = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'switching-psc1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-psc1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-psc1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-evpl': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-evpl': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-evpl': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-l2sc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-l2sc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-l2sc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-tdm': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-tdm': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-tdm': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-otn': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-otn': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-otn': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-dcsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-dcsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-dcsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-lsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-lsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-lsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-fsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-fsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-fsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="switching-capability", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + self.__encoding = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'lsp-encoding-packet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-packet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-packet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-ethernet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-ethernet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-ethernet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-pdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-pdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-pdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-sdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-sdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-sdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-digital-wrapper': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-digital-wrapper': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-digital-wrapper': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-lambda': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-lambda': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-lambda': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-fiber': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-fiber': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-fiber': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-fiber-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-fiber-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-fiber-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-oduk': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-oduk': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-oduk': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-optical-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-optical-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-optical-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-line': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-line': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-line': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="encoding", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + self.__max_lsp_bandwidth = YANGDynClass(base=YANGListType("priority",max_lsp_bandwidth.max_lsp_bandwidth, yang_name="max-lsp-bandwidth", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='priority', extensions=None), is_container='list', yang_name="max-lsp-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-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 ['networks', 'network', 'link', 'te', 'te-link-attributes', 'interface-switching-capability'] + + def _get_switching_capability(self): + """ + Getter method for switching_capability, mapped from YANG variable /networks/network/link/te/te_link_attributes/interface_switching_capability/switching_capability (identityref) + + YANG Description: Switching capability for this interface. + """ + return self.__switching_capability + + def _set_switching_capability(self, v, load=False): + """ + Setter method for switching_capability, mapped from YANG variable /networks/network/link/te/te_link_attributes/interface_switching_capability/switching_capability (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_switching_capability is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_switching_capability() directly. + + YANG Description: Switching capability for this 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=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'switching-psc1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-psc1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-psc1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-evpl': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-evpl': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-evpl': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-l2sc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-l2sc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-l2sc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-tdm': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-tdm': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-tdm': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-otn': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-otn': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-otn': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-dcsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-dcsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-dcsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-lsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-lsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-lsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-fsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-fsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-fsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="switching-capability", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """switching_capability must be of a type compatible with identityref""", + 'defined-type': "ietf-te-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'switching-psc1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-psc1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-psc1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-evpl': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-evpl': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-evpl': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-l2sc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-l2sc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-l2sc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-tdm': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-tdm': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-tdm': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-otn': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-otn': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-otn': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-dcsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-dcsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-dcsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-lsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-lsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-lsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-fsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-fsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-fsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="switching-capability", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True)""", + }) + + self.__switching_capability = t + if hasattr(self, '_set'): + self._set() + + def _unset_switching_capability(self): + self.__switching_capability = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'switching-psc1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-psc1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-psc1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-evpl': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-evpl': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-evpl': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-l2sc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-l2sc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-l2sc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-tdm': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-tdm': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-tdm': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-otn': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-otn': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-otn': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-dcsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-dcsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-dcsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-lsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-lsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-lsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-fsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-fsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-fsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="switching-capability", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + + + def _get_encoding(self): + """ + Getter method for encoding, mapped from YANG variable /networks/network/link/te/te_link_attributes/interface_switching_capability/encoding (identityref) + + YANG Description: Encoding supported by this interface. + """ + return self.__encoding + + def _set_encoding(self, v, load=False): + """ + Setter method for encoding, mapped from YANG variable /networks/network/link/te/te_link_attributes/interface_switching_capability/encoding (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_encoding is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_encoding() directly. + + YANG Description: Encoding supported by this 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=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'lsp-encoding-packet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-packet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-packet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-ethernet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-ethernet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-ethernet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-pdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-pdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-pdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-sdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-sdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-sdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-digital-wrapper': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-digital-wrapper': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-digital-wrapper': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-lambda': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-lambda': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-lambda': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-fiber': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-fiber': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-fiber': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-fiber-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-fiber-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-fiber-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-oduk': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-oduk': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-oduk': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-optical-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-optical-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-optical-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-line': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-line': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-line': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="encoding", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """encoding must be of a type compatible with identityref""", + 'defined-type': "ietf-te-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'lsp-encoding-packet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-packet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-packet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-ethernet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-ethernet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-ethernet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-pdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-pdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-pdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-sdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-sdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-sdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-digital-wrapper': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-digital-wrapper': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-digital-wrapper': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-lambda': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-lambda': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-lambda': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-fiber': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-fiber': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-fiber': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-fiber-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-fiber-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-fiber-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-oduk': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-oduk': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-oduk': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-optical-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-optical-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-optical-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-line': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-line': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-line': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="encoding", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True)""", + }) + + self.__encoding = t + if hasattr(self, '_set'): + self._set() + + def _unset_encoding(self): + self.__encoding = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'lsp-encoding-packet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-packet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-packet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-ethernet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-ethernet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-ethernet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-pdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-pdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-pdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-sdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-sdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-sdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-digital-wrapper': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-digital-wrapper': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-digital-wrapper': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-lambda': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-lambda': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-lambda': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-fiber': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-fiber': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-fiber': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-fiber-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-fiber-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-fiber-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-oduk': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-oduk': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-oduk': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-optical-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-optical-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-optical-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-line': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-line': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-line': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="encoding", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + + + def _get_max_lsp_bandwidth(self): + """ + Getter method for max_lsp_bandwidth, mapped from YANG variable /networks/network/link/te/te_link_attributes/interface_switching_capability/max_lsp_bandwidth (list) + + YANG Description: Maximum Label Switched Path (LSP) bandwidth at +priorities 0-7. + """ + return self.__max_lsp_bandwidth + + def _set_max_lsp_bandwidth(self, v, load=False): + """ + Setter method for max_lsp_bandwidth, mapped from YANG variable /networks/network/link/te/te_link_attributes/interface_switching_capability/max_lsp_bandwidth (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_max_lsp_bandwidth is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_max_lsp_bandwidth() directly. + + YANG Description: Maximum Label Switched Path (LSP) bandwidth at +priorities 0-7. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("priority",max_lsp_bandwidth.max_lsp_bandwidth, yang_name="max-lsp-bandwidth", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='priority', extensions=None), is_container='list', yang_name="max-lsp-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """max_lsp_bandwidth must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("priority",max_lsp_bandwidth.max_lsp_bandwidth, yang_name="max-lsp-bandwidth", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='priority', extensions=None), is_container='list', yang_name="max-lsp-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True)""", + }) + + self.__max_lsp_bandwidth = t + if hasattr(self, '_set'): + self._set() + + def _unset_max_lsp_bandwidth(self): + self.__max_lsp_bandwidth = YANGDynClass(base=YANGListType("priority",max_lsp_bandwidth.max_lsp_bandwidth, yang_name="max-lsp-bandwidth", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='priority', extensions=None), is_container='list', yang_name="max-lsp-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + + switching_capability = __builtin__.property(_get_switching_capability, _set_switching_capability) + encoding = __builtin__.property(_get_encoding, _set_encoding) + max_lsp_bandwidth = __builtin__.property(_get_max_lsp_bandwidth, _set_max_lsp_bandwidth) + + + _pyangbind_elements = OrderedDict([('switching_capability', switching_capability), ('encoding', encoding), ('max_lsp_bandwidth', max_lsp_bandwidth), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/interface_switching_capability/max_lsp_bandwidth/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/interface_switching_capability/max_lsp_bandwidth/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..fd066564c019446b9f1d290725548dd988592cfa --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/interface_switching_capability/max_lsp_bandwidth/__init__.py @@ -0,0 +1,163 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 te_bandwidth +class max_lsp_bandwidth(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/link/te/te-link-attributes/interface-switching-capability/max-lsp-bandwidth. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Maximum Label Switched Path (LSP) bandwidth at +priorities 0-7. + """ + __slots__ = ('_path_helper', '_extmethods', '__priority','__te_bandwidth',) + + _yang_name = 'max-lsp-bandwidth' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__priority = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..7']}), is_leaf=True, yang_name="priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint8', is_config=True) + self.__te_bandwidth = YANGDynClass(base=te_bandwidth.te_bandwidth, is_container='container', yang_name="te-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-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 ['networks', 'network', 'link', 'te', 'te-link-attributes', 'interface-switching-capability', 'max-lsp-bandwidth'] + + def _get_priority(self): + """ + Getter method for priority, mapped from YANG variable /networks/network/link/te/te_link_attributes/interface_switching_capability/max_lsp_bandwidth/priority (uint8) + + YANG Description: Priority. + """ + return self.__priority + + def _set_priority(self, v, load=False): + """ + Setter method for priority, mapped from YANG variable /networks/network/link/te/te_link_attributes/interface_switching_capability/max_lsp_bandwidth/priority (uint8) + If this variable is read-only (config: false) in the + source YANG file, then _set_priority is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_priority() directly. + + YANG Description: Priority. + """ + 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=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..7']}), is_leaf=True, yang_name="priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint8', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """priority must be of a type compatible with uint8""", + 'defined-type': "uint8", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..7']}), is_leaf=True, yang_name="priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint8', is_config=True)""", + }) + + self.__priority = t + if hasattr(self, '_set'): + self._set() + + def _unset_priority(self): + self.__priority = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..7']}), is_leaf=True, yang_name="priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint8', is_config=True) + + + def _get_te_bandwidth(self): + """ + Getter method for te_bandwidth, mapped from YANG variable /networks/network/link/te/te_link_attributes/interface_switching_capability/max_lsp_bandwidth/te_bandwidth (container) + + YANG Description: Container that specifies TE bandwidth. The choices +can be augmented for specific data-plane technologies. + """ + return self.__te_bandwidth + + def _set_te_bandwidth(self, v, load=False): + """ + Setter method for te_bandwidth, mapped from YANG variable /networks/network/link/te/te_link_attributes/interface_switching_capability/max_lsp_bandwidth/te_bandwidth (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_te_bandwidth is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_te_bandwidth() directly. + + YANG Description: Container that specifies TE bandwidth. The choices +can be augmented for specific data-plane technologies. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=te_bandwidth.te_bandwidth, is_container='container', yang_name="te-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """te_bandwidth must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=te_bandwidth.te_bandwidth, is_container='container', yang_name="te-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__te_bandwidth = t + if hasattr(self, '_set'): + self._set() + + def _unset_te_bandwidth(self): + self.__te_bandwidth = YANGDynClass(base=te_bandwidth.te_bandwidth, is_container='container', yang_name="te-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + priority = __builtin__.property(_get_priority, _set_priority) + te_bandwidth = __builtin__.property(_get_te_bandwidth, _set_te_bandwidth) + + + _pyangbind_elements = OrderedDict([('priority', priority), ('te_bandwidth', te_bandwidth), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/interface_switching_capability/max_lsp_bandwidth/te_bandwidth/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/interface_switching_capability/max_lsp_bandwidth/te_bandwidth/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..ae1f4655b617b424563ff1a67918aca3aa745d15 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/interface_switching_capability/max_lsp_bandwidth/te_bandwidth/__init__.py @@ -0,0 +1,195 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 otn +class te_bandwidth(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/link/te/te-link-attributes/interface-switching-capability/max-lsp-bandwidth/te-bandwidth. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Container that specifies TE bandwidth. The choices +can be augmented for specific data-plane technologies. + """ + __slots__ = ('_path_helper', '_extmethods', '__generic','__otn','__eth_bandwidth',) + + _yang_name = 'te-bandwidth' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__generic = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+(,(0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+))*'}), is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-bandwidth', is_config=True) + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + self.__eth_bandwidth = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), restriction_dict={'range': ['0..10000000000']}), is_leaf=True, yang_name="eth-bandwidth", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint64', 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 ['networks', 'network', 'link', 'te', 'te-link-attributes', 'interface-switching-capability', 'max-lsp-bandwidth', 'te-bandwidth'] + + def _get_generic(self): + """ + Getter method for generic, mapped from YANG variable /networks/network/link/te/te_link_attributes/interface_switching_capability/max_lsp_bandwidth/te_bandwidth/generic (te-bandwidth) + + YANG Description: Bandwidth specified in a generic format. + """ + return self.__generic + + def _set_generic(self, v, load=False): + """ + Setter method for generic, mapped from YANG variable /networks/network/link/te/te_link_attributes/interface_switching_capability/max_lsp_bandwidth/te_bandwidth/generic (te-bandwidth) + If this variable is read-only (config: false) in the + source YANG file, then _set_generic is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_generic() directly. + + YANG Description: Bandwidth specified in a generic format. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+(,(0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+))*'}), is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-bandwidth', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """generic must be of a type compatible with te-bandwidth""", + 'defined-type': "ietf-te-topology:te-bandwidth", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+(,(0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+))*'}), is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-bandwidth', is_config=True)""", + }) + + self.__generic = t + if hasattr(self, '_set'): + self._set() + + def _unset_generic(self): + self.__generic = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+(,(0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+))*'}), is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-bandwidth', is_config=True) + + + def _get_otn(self): + """ + Getter method for otn, mapped from YANG variable /networks/network/link/te/te_link_attributes/interface_switching_capability/max_lsp_bandwidth/te_bandwidth/otn (container) + + YANG Description: Maximum bandwidth attributes for OTN paths. + """ + return self.__otn + + def _set_otn(self, v, load=False): + """ + Setter method for otn, mapped from YANG variable /networks/network/link/te/te_link_attributes/interface_switching_capability/max_lsp_bandwidth/te_bandwidth/otn (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_otn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_otn() directly. + + YANG Description: Maximum bandwidth attributes for OTN paths. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """otn must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True)""", + }) + + self.__otn = t + if hasattr(self, '_set'): + self._set() + + def _unset_otn(self): + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + + + def _get_eth_bandwidth(self): + """ + Getter method for eth_bandwidth, mapped from YANG variable /networks/network/link/te/te_link_attributes/interface_switching_capability/max_lsp_bandwidth/te_bandwidth/eth_bandwidth (uint64) + + YANG Description: Available bandwith value expressed in kilobits per second + """ + return self.__eth_bandwidth + + def _set_eth_bandwidth(self, v, load=False): + """ + Setter method for eth_bandwidth, mapped from YANG variable /networks/network/link/te/te_link_attributes/interface_switching_capability/max_lsp_bandwidth/te_bandwidth/eth_bandwidth (uint64) + If this variable is read-only (config: false) in the + source YANG file, then _set_eth_bandwidth is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_eth_bandwidth() directly. + + YANG Description: Available bandwith value expressed in kilobits per second + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), restriction_dict={'range': ['0..10000000000']}), is_leaf=True, yang_name="eth-bandwidth", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint64', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """eth_bandwidth must be of a type compatible with uint64""", + 'defined-type': "uint64", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), restriction_dict={'range': ['0..10000000000']}), is_leaf=True, yang_name="eth-bandwidth", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint64', is_config=True)""", + }) + + self.__eth_bandwidth = t + if hasattr(self, '_set'): + self._set() + + def _unset_eth_bandwidth(self): + self.__eth_bandwidth = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), restriction_dict={'range': ['0..10000000000']}), is_leaf=True, yang_name="eth-bandwidth", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint64', is_config=True) + + generic = __builtin__.property(_get_generic, _set_generic) + otn = __builtin__.property(_get_otn, _set_otn) + eth_bandwidth = __builtin__.property(_get_eth_bandwidth, _set_eth_bandwidth) + + __choices__ = {'technology': {'generic': ['generic'], 'otn': ['otn'], 'eth': ['eth_bandwidth']}} + _pyangbind_elements = OrderedDict([('generic', generic), ('otn', otn), ('eth_bandwidth', eth_bandwidth), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/interface_switching_capability/max_lsp_bandwidth/te_bandwidth/otn/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/interface_switching_capability/max_lsp_bandwidth/te_bandwidth/otn/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..714d3fac7bdc67f8355b240a8d6b2975aeeaf415 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/interface_switching_capability/max_lsp_bandwidth/te_bandwidth/otn/__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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 otn(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/link/te/te-link-attributes/interface-switching-capability/max-lsp-bandwidth/te-bandwidth/otn. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Maximum bandwidth attributes for OTN paths. + """ + __slots__ = ('_path_helper', '_extmethods', '__odu_type','__max_ts_number',) + + _yang_name = 'otn' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__odu_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="odu-type", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + self.__max_ts_number = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="max-ts-number", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', 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 ['networks', 'network', 'link', 'te', 'te-link-attributes', 'interface-switching-capability', 'max-lsp-bandwidth', 'te-bandwidth', 'otn'] + + def _get_odu_type(self): + """ + Getter method for odu_type, mapped from YANG variable /networks/network/link/te/te_link_attributes/interface_switching_capability/max_lsp_bandwidth/te_bandwidth/otn/odu_type (identityref) + + YANG Description: ODU type + """ + return self.__odu_type + + def _set_odu_type(self, v, load=False): + """ + Setter method for odu_type, mapped from YANG variable /networks/network/link/te/te_link_attributes/interface_switching_capability/max_lsp_bandwidth/te_bandwidth/otn/odu_type (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_odu_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_odu_type() directly. + + YANG Description: ODU type + """ + 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={'ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="odu-type", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """odu_type must be of a type compatible with identityref""", + 'defined-type': "ietf-otn-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="odu-type", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True)""", + }) + + self.__odu_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_odu_type(self): + self.__odu_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="odu-type", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + + + def _get_max_ts_number(self): + """ + Getter method for max_ts_number, mapped from YANG variable /networks/network/link/te/te_link_attributes/interface_switching_capability/max_lsp_bandwidth/te_bandwidth/otn/max_ts_number (uint16) + + YANG Description: The maximum number of Tributary Slots (TS) that could be +used by an ODUflex LSP. + """ + return self.__max_ts_number + + def _set_max_ts_number(self, v, load=False): + """ + Setter method for max_ts_number, mapped from YANG variable /networks/network/link/te/te_link_attributes/interface_switching_capability/max_lsp_bandwidth/te_bandwidth/otn/max_ts_number (uint16) + If this variable is read-only (config: false) in the + source YANG file, then _set_max_ts_number is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_max_ts_number() directly. + + YANG Description: The maximum number of Tributary Slots (TS) that could be +used by an ODUflex LSP. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="max-ts-number", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """max_ts_number must be of a type compatible with uint16""", + 'defined-type': "uint16", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="max-ts-number", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', is_config=True)""", + }) + + self.__max_ts_number = t + if hasattr(self, '_set'): + self._set() + + def _unset_max_ts_number(self): + self.__max_ts_number = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="max-ts-number", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', is_config=True) + + odu_type = __builtin__.property(_get_odu_type, _set_odu_type) + max_ts_number = __builtin__.property(_get_max_ts_number, _set_max_ts_number) + + __choices__ = {'technology': {'otn': ['odu_type', 'max_ts_number']}} + _pyangbind_elements = OrderedDict([('odu_type', odu_type), ('max_ts_number', max_ts_number), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/label_restrictions/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/label_restrictions/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..f4e44b0e9dd6557014d1255c5cf76f22fdca0ded --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/label_restrictions/__init__.py @@ -0,0 +1,120 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 label_restriction +class label_restrictions(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/link/te/te-link-attributes/label-restrictions. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: The label restrictions container. + """ + __slots__ = ('_path_helper', '_extmethods', '__label_restriction',) + + _yang_name = 'label-restrictions' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__label_restriction = YANGDynClass(base=YANGListType("index",label_restriction.label_restriction, yang_name="label-restriction", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='index', extensions=None), is_container='list', yang_name="label-restriction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-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 ['networks', 'network', 'link', 'te', 'te-link-attributes', 'label-restrictions'] + + def _get_label_restriction(self): + """ + Getter method for label_restriction, mapped from YANG variable /networks/network/link/te/te_link_attributes/label_restrictions/label_restriction (list) + + YANG Description: The absence of the label restrictions container implies +that all labels are acceptable; otherwise, only restricted +labels are available. + """ + return self.__label_restriction + + def _set_label_restriction(self, v, load=False): + """ + Setter method for label_restriction, mapped from YANG variable /networks/network/link/te/te_link_attributes/label_restrictions/label_restriction (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_label_restriction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_label_restriction() directly. + + YANG Description: The absence of the label restrictions container implies +that all labels are acceptable; otherwise, only restricted +labels are available. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("index",label_restriction.label_restriction, yang_name="label-restriction", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='index', extensions=None), is_container='list', yang_name="label-restriction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """label_restriction must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("index",label_restriction.label_restriction, yang_name="label-restriction", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='index', extensions=None), is_container='list', yang_name="label-restriction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True)""", + }) + + self.__label_restriction = t + if hasattr(self, '_set'): + self._set() + + def _unset_label_restriction(self): + self.__label_restriction = YANGDynClass(base=YANGListType("index",label_restriction.label_restriction, yang_name="label-restriction", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='index', extensions=None), is_container='list', yang_name="label-restriction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + + label_restriction = __builtin__.property(_get_label_restriction, _set_label_restriction) + + + _pyangbind_elements = OrderedDict([('label_restriction', label_restriction), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/label_restrictions/label_restriction/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/label_restrictions/label_restriction/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..44f0812775abb236b1da05700735e632fe9ef6c7 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/label_restrictions/label_restriction/__init__.py @@ -0,0 +1,450 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 label_start +from . import label_end +from . import label_step +from . import otn_label_range +from . import ethernet_label_range +class label_restriction(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/link/te/te-link-attributes/label-restrictions/label-restriction. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: The absence of the label restrictions container implies +that all labels are acceptable; otherwise, only restricted +labels are available. + """ + __slots__ = ('_path_helper', '_extmethods', '__restriction','__index','__label_start','__label_end','__label_step','__range_bitmap','__otn_label_range','__ethernet_label_range',) + + _yang_name = 'label-restriction' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__restriction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'inclusive': {}, 'exclusive': {}},), default=six.text_type("inclusive"), is_leaf=True, yang_name="restriction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='enumeration', is_config=True) + self.__index = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + self.__label_start = YANGDynClass(base=label_start.label_start, is_container='container', yang_name="label-start", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__label_end = YANGDynClass(base=label_end.label_end, is_container='container', yang_name="label-end", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__label_step = YANGDynClass(base=label_step.label_step, is_container='container', yang_name="label-step", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__range_bitmap = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}), is_leaf=True, yang_name="range-bitmap", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:hex-string', is_config=True) + self.__otn_label_range = YANGDynClass(base=otn_label_range.otn_label_range, is_container='container', yang_name="otn-label-range", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + self.__ethernet_label_range = YANGDynClass(base=ethernet_label_range.ethernet_label_range, is_container='container', yang_name="ethernet-label-range", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-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 ['networks', 'network', 'link', 'te', 'te-link-attributes', 'label-restrictions', 'label-restriction'] + + def _get_restriction(self): + """ + Getter method for restriction, mapped from YANG variable /networks/network/link/te/te_link_attributes/label_restrictions/label_restriction/restriction (enumeration) + + YANG Description: Indicates whether the list item is inclusive or exclusive. + """ + return self.__restriction + + def _set_restriction(self, v, load=False): + """ + Setter method for restriction, mapped from YANG variable /networks/network/link/te/te_link_attributes/label_restrictions/label_restriction/restriction (enumeration) + If this variable is read-only (config: false) in the + source YANG file, then _set_restriction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_restriction() directly. + + YANG Description: Indicates whether the list item is inclusive or exclusive. + """ + 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={'inclusive': {}, 'exclusive': {}},), default=six.text_type("inclusive"), is_leaf=True, yang_name="restriction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='enumeration', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """restriction must be of a type compatible with enumeration""", + 'defined-type': "ietf-te-topology:enumeration", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'inclusive': {}, 'exclusive': {}},), default=six.text_type("inclusive"), is_leaf=True, yang_name="restriction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='enumeration', is_config=True)""", + }) + + self.__restriction = t + if hasattr(self, '_set'): + self._set() + + def _unset_restriction(self): + self.__restriction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'inclusive': {}, 'exclusive': {}},), default=six.text_type("inclusive"), is_leaf=True, yang_name="restriction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='enumeration', is_config=True) + + + def _get_index(self): + """ + Getter method for index, mapped from YANG variable /networks/network/link/te/te_link_attributes/label_restrictions/label_restriction/index (uint32) + + YANG Description: The index of the label restriction list entry. + """ + return self.__index + + def _set_index(self, v, load=False): + """ + Setter method for index, mapped from YANG variable /networks/network/link/te/te_link_attributes/label_restrictions/label_restriction/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 label restriction list entry. + """ + 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=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', 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), is_leaf=True, yang_name="index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', 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), is_leaf=True, yang_name="index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + + + def _get_label_start(self): + """ + Getter method for label_start, mapped from YANG variable /networks/network/link/te/te_link_attributes/label_restrictions/label_restriction/label_start (container) + + YANG Description: This is the starting label if a label range is specified. +This is the label value if a single label is specified, +in which case the 'label-end' attribute is not set. + """ + return self.__label_start + + def _set_label_start(self, v, load=False): + """ + Setter method for label_start, mapped from YANG variable /networks/network/link/te/te_link_attributes/label_restrictions/label_restriction/label_start (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_label_start is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_label_start() directly. + + YANG Description: This is the starting label if a label range is specified. +This is the label value if a single label is specified, +in which case the 'label-end' attribute is not set. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=label_start.label_start, is_container='container', yang_name="label-start", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """label_start must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=label_start.label_start, is_container='container', yang_name="label-start", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__label_start = t + if hasattr(self, '_set'): + self._set() + + def _unset_label_start(self): + self.__label_start = YANGDynClass(base=label_start.label_start, is_container='container', yang_name="label-start", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_label_end(self): + """ + Getter method for label_end, mapped from YANG variable /networks/network/link/te/te_link_attributes/label_restrictions/label_restriction/label_end (container) + + YANG Description: This is the ending label if a label range is specified. +This attribute is not set if a single label is specified. + """ + return self.__label_end + + def _set_label_end(self, v, load=False): + """ + Setter method for label_end, mapped from YANG variable /networks/network/link/te/te_link_attributes/label_restrictions/label_restriction/label_end (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_label_end is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_label_end() directly. + + YANG Description: This is the ending label if a label range is specified. +This attribute is not set if a single label is specified. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=label_end.label_end, is_container='container', yang_name="label-end", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """label_end must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=label_end.label_end, is_container='container', yang_name="label-end", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__label_end = t + if hasattr(self, '_set'): + self._set() + + def _unset_label_end(self): + self.__label_end = YANGDynClass(base=label_end.label_end, is_container='container', yang_name="label-end", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_label_step(self): + """ + Getter method for label_step, mapped from YANG variable /networks/network/link/te/te_link_attributes/label_restrictions/label_restriction/label_step (container) + + YANG Description: The step increment between labels in the label range. +The label start/end values will have to be consistent +with the sign of label step. For example, +'label-start' < 'label-end' enforces 'label-step' > 0 +'label-start' > 'label-end' enforces 'label-step' < 0. + """ + return self.__label_step + + def _set_label_step(self, v, load=False): + """ + Setter method for label_step, mapped from YANG variable /networks/network/link/te/te_link_attributes/label_restrictions/label_restriction/label_step (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_label_step is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_label_step() directly. + + YANG Description: The step increment between labels in the label range. +The label start/end values will have to be consistent +with the sign of label step. For example, +'label-start' < 'label-end' enforces 'label-step' > 0 +'label-start' > 'label-end' enforces 'label-step' < 0. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=label_step.label_step, is_container='container', yang_name="label-step", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """label_step must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=label_step.label_step, is_container='container', yang_name="label-step", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__label_step = t + if hasattr(self, '_set'): + self._set() + + def _unset_label_step(self): + self.__label_step = YANGDynClass(base=label_step.label_step, is_container='container', yang_name="label-step", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_range_bitmap(self): + """ + Getter method for range_bitmap, mapped from YANG variable /networks/network/link/te/te_link_attributes/label_restrictions/label_restriction/range_bitmap (yang:hex-string) + + YANG Description: When there are gaps between 'label-start' and 'label-end', +this attribute is used to specify the positions +of the used labels. This is represented in big endian as +'hex-string'. +The most significant byte in the hex-string is the farthest +to the left in the byte sequence. Leading zero bytes in the +configured value may be omitted for brevity. +Each bit position in the 'range-bitmap' 'hex-string' maps +to a label in the range derived from 'label-start'. + +For example, assuming that 'label-start' = 16000 and +'range-bitmap' = 0x01000001, then: + +- bit position (0) is set, and the corresponding mapped + label from the range is 16000 + (0 * 'label-step') or + 16000 for default 'label-step' = 1. +- bit position (24) is set, and the corresponding mapped + label from the range is 16000 + (24 * 'label-step') or + 16024 for default 'label-step' = 1. + """ + return self.__range_bitmap + + def _set_range_bitmap(self, v, load=False): + """ + Setter method for range_bitmap, mapped from YANG variable /networks/network/link/te/te_link_attributes/label_restrictions/label_restriction/range_bitmap (yang:hex-string) + If this variable is read-only (config: false) in the + source YANG file, then _set_range_bitmap is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_range_bitmap() directly. + + YANG Description: When there are gaps between 'label-start' and 'label-end', +this attribute is used to specify the positions +of the used labels. This is represented in big endian as +'hex-string'. +The most significant byte in the hex-string is the farthest +to the left in the byte sequence. Leading zero bytes in the +configured value may be omitted for brevity. +Each bit position in the 'range-bitmap' 'hex-string' maps +to a label in the range derived from 'label-start'. + +For example, assuming that 'label-start' = 16000 and +'range-bitmap' = 0x01000001, then: + +- bit position (0) is set, and the corresponding mapped + label from the range is 16000 + (0 * 'label-step') or + 16000 for default 'label-step' = 1. +- bit position (24) is set, and the corresponding mapped + label from the range is 16000 + (24 * 'label-step') or + 16024 for default 'label-step' = 1. + """ + 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})*)?'}), is_leaf=True, yang_name="range-bitmap", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:hex-string', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """range_bitmap must be of a type compatible with yang:hex-string""", + 'defined-type': "yang:hex-string", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}), is_leaf=True, yang_name="range-bitmap", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:hex-string', is_config=True)""", + }) + + self.__range_bitmap = t + if hasattr(self, '_set'): + self._set() + + def _unset_range_bitmap(self): + self.__range_bitmap = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}), is_leaf=True, yang_name="range-bitmap", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:hex-string', is_config=True) + + + def _get_otn_label_range(self): + """ + Getter method for otn_label_range, mapped from YANG variable /networks/network/link/te/te_link_attributes/label_restrictions/label_restriction/otn_label_range (container) + + YANG Description: Label range information for OTN. + """ + return self.__otn_label_range + + def _set_otn_label_range(self, v, load=False): + """ + Setter method for otn_label_range, mapped from YANG variable /networks/network/link/te/te_link_attributes/label_restrictions/label_restriction/otn_label_range (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_otn_label_range is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_otn_label_range() directly. + + YANG Description: Label range information for OTN. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=otn_label_range.otn_label_range, is_container='container', yang_name="otn-label-range", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """otn_label_range must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=otn_label_range.otn_label_range, is_container='container', yang_name="otn-label-range", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True)""", + }) + + self.__otn_label_range = t + if hasattr(self, '_set'): + self._set() + + def _unset_otn_label_range(self): + self.__otn_label_range = YANGDynClass(base=otn_label_range.otn_label_range, is_container='container', yang_name="otn-label-range", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + + + def _get_ethernet_label_range(self): + """ + Getter method for ethernet_label_range, mapped from YANG variable /networks/network/link/te/te_link_attributes/label_restrictions/label_restriction/ethernet_label_range (container) + + YANG Description: Ethernet-specific label range related information. + """ + return self.__ethernet_label_range + + def _set_ethernet_label_range(self, v, load=False): + """ + Setter method for ethernet_label_range, mapped from YANG variable /networks/network/link/te/te_link_attributes/label_restrictions/label_restriction/ethernet_label_range (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_ethernet_label_range is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_ethernet_label_range() directly. + + YANG Description: Ethernet-specific label range related information. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=ethernet_label_range.ethernet_label_range, is_container='container', yang_name="ethernet-label-range", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """ethernet_label_range must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=ethernet_label_range.ethernet_label_range, is_container='container', yang_name="ethernet-label-range", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='container', is_config=True)""", + }) + + self.__ethernet_label_range = t + if hasattr(self, '_set'): + self._set() + + def _unset_ethernet_label_range(self): + self.__ethernet_label_range = YANGDynClass(base=ethernet_label_range.ethernet_label_range, is_container='container', yang_name="ethernet-label-range", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='container', is_config=True) + + restriction = __builtin__.property(_get_restriction, _set_restriction) + index = __builtin__.property(_get_index, _set_index) + label_start = __builtin__.property(_get_label_start, _set_label_start) + label_end = __builtin__.property(_get_label_end, _set_label_end) + label_step = __builtin__.property(_get_label_step, _set_label_step) + range_bitmap = __builtin__.property(_get_range_bitmap, _set_range_bitmap) + otn_label_range = __builtin__.property(_get_otn_label_range, _set_otn_label_range) + ethernet_label_range = __builtin__.property(_get_ethernet_label_range, _set_ethernet_label_range) + + + _pyangbind_elements = OrderedDict([('restriction', restriction), ('index', index), ('label_start', label_start), ('label_end', label_end), ('label_step', label_step), ('range_bitmap', range_bitmap), ('otn_label_range', otn_label_range), ('ethernet_label_range', ethernet_label_range), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/label_restrictions/label_restriction/ethernet_label_range/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/label_restrictions/label_restriction/ethernet_label_range/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..52e6a65c17f8e1dc93617d8d83c97d1264f7c66d --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/label_restrictions/label_restriction/ethernet_label_range/__init__.py @@ -0,0 +1,154 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 ethernet_label_range(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/link/te/te-link-attributes/label-restrictions/label-restriction/ethernet-label-range. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Ethernet-specific label range related information. + """ + __slots__ = ('_path_helper', '_extmethods', '__tag_type','__priority',) + + _yang_name = 'ethernet-label-range' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__tag_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 's-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:s-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:s-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}},), is_leaf=True, yang_name="tag-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:eth-tag-type', is_config=True) + self.__priority = YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), is_leaf=True, yang_name="priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', 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 ['networks', 'network', 'link', 'te', 'te-link-attributes', 'label-restrictions', 'label-restriction', 'ethernet-label-range'] + + def _get_tag_type(self): + """ + Getter method for tag_type, mapped from YANG variable /networks/network/link/te/te_link_attributes/label_restrictions/label_restriction/ethernet_label_range/tag_type (etht-types:eth-tag-type) + + YANG Description: VLAN tag type. + """ + return self.__tag_type + + def _set_tag_type(self, v, load=False): + """ + Setter method for tag_type, mapped from YANG variable /networks/network/link/te/te_link_attributes/label_restrictions/label_restriction/ethernet_label_range/tag_type (etht-types:eth-tag-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_tag_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tag_type() directly. + + YANG Description: VLAN tag type. + """ + 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={'c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 's-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:s-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:s-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}},), is_leaf=True, yang_name="tag-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:eth-tag-type', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tag_type must be of a type compatible with etht-types:eth-tag-type""", + 'defined-type': "etht-types:eth-tag-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 's-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:s-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:s-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}},), is_leaf=True, yang_name="tag-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:eth-tag-type', is_config=True)""", + }) + + self.__tag_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_tag_type(self): + self.__tag_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 's-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:s-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:s-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}},), is_leaf=True, yang_name="tag-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:eth-tag-type', is_config=True) + + + def _get_priority(self): + """ + Getter method for priority, mapped from YANG variable /networks/network/link/te/te_link_attributes/label_restrictions/label_restriction/ethernet_label_range/priority (uint8) + + YANG Description: priority. + """ + return self.__priority + + def _set_priority(self, v, load=False): + """ + Setter method for priority, mapped from YANG variable /networks/network/link/te/te_link_attributes/label_restrictions/label_restriction/ethernet_label_range/priority (uint8) + If this variable is read-only (config: false) in the + source YANG file, then _set_priority is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_priority() directly. + + YANG Description: priority. + """ + 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="priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint8', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """priority 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="priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint8', is_config=True)""", + }) + + self.__priority = t + if hasattr(self, '_set'): + self._set() + + def _unset_priority(self): + self.__priority = YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), is_leaf=True, yang_name="priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint8', is_config=True) + + tag_type = __builtin__.property(_get_tag_type, _set_tag_type) + priority = __builtin__.property(_get_priority, _set_priority) + + + _pyangbind_elements = OrderedDict([('tag_type', tag_type), ('priority', priority), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/label_restrictions/label_restriction/label_end/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/label_restrictions/label_restriction/label_end/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..ac25e0634b6d08a4574177f2ff1630f4a2b2496f --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/label_restrictions/label_restriction/label_end/__init__.py @@ -0,0 +1,119 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 te_label +class label_end(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/link/te/te-link-attributes/label-restrictions/label-restriction/label-end. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: This is the ending label if a label range is specified. +This attribute is not set if a single label is specified. + """ + __slots__ = ('_path_helper', '_extmethods', '__te_label',) + + _yang_name = 'label-end' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__te_label = YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-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 ['networks', 'network', 'link', 'te', 'te-link-attributes', 'label-restrictions', 'label-restriction', 'label-end'] + + def _get_te_label(self): + """ + Getter method for te_label, mapped from YANG variable /networks/network/link/te/te_link_attributes/label_restrictions/label_restriction/label_end/te_label (container) + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + return self.__te_label + + def _set_te_label(self, v, load=False): + """ + Setter method for te_label, mapped from YANG variable /networks/network/link/te/te_link_attributes/label_restrictions/label_restriction/label_end/te_label (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_te_label is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_te_label() directly. + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """te_label must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__te_label = t + if hasattr(self, '_set'): + self._set() + + def _unset_te_label(self): + self.__te_label = YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + te_label = __builtin__.property(_get_te_label, _set_te_label) + + + _pyangbind_elements = OrderedDict([('te_label', te_label), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/label_restrictions/label_restriction/label_end/te_label/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/label_restrictions/label_restriction/label_end/te_label/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..67dde90521ef28bc7f60fd4de11958b9383db32b --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/label_restrictions/label_restriction/label_end/te_label/__init__.py @@ -0,0 +1,234 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 otn +class te_label(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/link/te/te-link-attributes/label-restrictions/label-restriction/label-end/te-label. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + __slots__ = ('_path_helper', '_extmethods', '__generic','__otn','__vlanid','__direction',) + + _yang_name = 'te-label' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__generic = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True) + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + self.__vlanid = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True) + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', 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 ['networks', 'network', 'link', 'te', 'te-link-attributes', 'label-restrictions', 'label-restriction', 'label-end', 'te-label'] + + def _get_generic(self): + """ + Getter method for generic, mapped from YANG variable /networks/network/link/te/te_link_attributes/label_restrictions/label_restriction/label_end/te_label/generic (rt-types:generalized-label) + + YANG Description: TE label specified in a generic format. + """ + return self.__generic + + def _set_generic(self, v, load=False): + """ + Setter method for generic, mapped from YANG variable /networks/network/link/te/te_link_attributes/label_restrictions/label_restriction/label_end/te_label/generic (rt-types:generalized-label) + If this variable is read-only (config: false) in the + source YANG file, then _set_generic is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_generic() directly. + + YANG Description: TE label specified in a generic format. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """generic must be of a type compatible with rt-types:generalized-label""", + 'defined-type': "rt-types:generalized-label", + 'generated-type': """YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True)""", + }) + + self.__generic = t + if hasattr(self, '_set'): + self._set() + + def _unset_generic(self): + self.__generic = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True) + + + def _get_otn(self): + """ + Getter method for otn, mapped from YANG variable /networks/network/link/te/te_link_attributes/label_restrictions/label_restriction/label_end/te_label/otn (container) + + YANG Description: Label start or label end for OTN. + """ + return self.__otn + + def _set_otn(self, v, load=False): + """ + Setter method for otn, mapped from YANG variable /networks/network/link/te/te_link_attributes/label_restrictions/label_restriction/label_end/te_label/otn (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_otn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_otn() directly. + + YANG Description: Label start or label end for OTN. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """otn must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True)""", + }) + + self.__otn = t + if hasattr(self, '_set'): + self._set() + + def _unset_otn(self): + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + + + def _get_vlanid(self): + """ + Getter method for vlanid, mapped from YANG variable /networks/network/link/te/te_link_attributes/label_restrictions/label_restriction/label_end/te_label/vlanid (etht-types:vlanid) + + YANG Description: VLAN tag id. + """ + return self.__vlanid + + def _set_vlanid(self, v, load=False): + """ + Setter method for vlanid, mapped from YANG variable /networks/network/link/te/te_link_attributes/label_restrictions/label_restriction/label_end/te_label/vlanid (etht-types:vlanid) + If this variable is read-only (config: false) in the + source YANG file, then _set_vlanid is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_vlanid() directly. + + YANG Description: VLAN tag id. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """vlanid must be of a type compatible with etht-types:vlanid""", + 'defined-type': "etht-types:vlanid", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True)""", + }) + + self.__vlanid = t + if hasattr(self, '_set'): + self._set() + + def _unset_vlanid(self): + self.__vlanid = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True) + + + def _get_direction(self): + """ + Getter method for direction, mapped from YANG variable /networks/network/link/te/te_link_attributes/label_restrictions/label_restriction/label_end/te_label/direction (te-label-direction) + + YANG Description: Label direction. + """ + return self.__direction + + def _set_direction(self, v, load=False): + """ + Setter method for direction, mapped from YANG variable /networks/network/link/te/te_link_attributes/label_restrictions/label_restriction/label_end/te_label/direction (te-label-direction) + If this variable is read-only (config: false) in the + source YANG file, then _set_direction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_direction() directly. + + YANG Description: Label direction. + """ + 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={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """direction must be of a type compatible with te-label-direction""", + 'defined-type': "ietf-te-topology:te-label-direction", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=True)""", + }) + + self.__direction = t + if hasattr(self, '_set'): + self._set() + + def _unset_direction(self): + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=True) + + generic = __builtin__.property(_get_generic, _set_generic) + otn = __builtin__.property(_get_otn, _set_otn) + vlanid = __builtin__.property(_get_vlanid, _set_vlanid) + direction = __builtin__.property(_get_direction, _set_direction) + + __choices__ = {'technology': {'generic': ['generic'], 'otn': ['otn'], 'eth': ['vlanid']}} + _pyangbind_elements = OrderedDict([('generic', generic), ('otn', otn), ('vlanid', vlanid), ('direction', direction), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/label_restrictions/label_restriction/label_end/te_label/otn/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/label_restrictions/label_restriction/label_end/te_label/otn/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..24875829b97bd7c53e734cb3a60b1730eac4694a --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/label_restrictions/label_restriction/label_end/te_label/otn/__init__.py @@ -0,0 +1,154 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 otn(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/link/te/te-link-attributes/label-restrictions/label-restriction/label-end/te-label/otn. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Label start or label end for OTN. + """ + __slots__ = ('_path_helper', '_extmethods', '__tpn','__ts',) + + _yang_name = 'otn' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__tpn = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('range-type', 'trib-port'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True) + self.__ts = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts", parent=self, choice=('range-type', 'trib-slot'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-ts', 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 ['networks', 'network', 'link', 'te', 'te-link-attributes', 'label-restrictions', 'label-restriction', 'label-end', 'te-label', 'otn'] + + def _get_tpn(self): + """ + Getter method for tpn, mapped from YANG variable /networks/network/link/te/te_link_attributes/label_restrictions/label_restriction/label_end/te_label/otn/tpn (otn-tpn) + + YANG Description: Tributary Port Number (TPN). + """ + return self.__tpn + + def _set_tpn(self, v, load=False): + """ + Setter method for tpn, mapped from YANG variable /networks/network/link/te/te_link_attributes/label_restrictions/label_restriction/label_end/te_label/otn/tpn (otn-tpn) + If this variable is read-only (config: false) in the + source YANG file, then _set_tpn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tpn() directly. + + YANG Description: Tributary Port Number (TPN). + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('range-type', 'trib-port'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tpn must be of a type compatible with otn-tpn""", + 'defined-type': "ietf-otn-topology:otn-tpn", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('range-type', 'trib-port'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True)""", + }) + + self.__tpn = t + if hasattr(self, '_set'): + self._set() + + def _unset_tpn(self): + self.__tpn = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('range-type', 'trib-port'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True) + + + def _get_ts(self): + """ + Getter method for ts, mapped from YANG variable /networks/network/link/te/te_link_attributes/label_restrictions/label_restriction/label_end/te_label/otn/ts (otn-ts) + + YANG Description: Tributary Slot (TS) number. + """ + return self.__ts + + def _set_ts(self, v, load=False): + """ + Setter method for ts, mapped from YANG variable /networks/network/link/te/te_link_attributes/label_restrictions/label_restriction/label_end/te_label/otn/ts (otn-ts) + If this variable is read-only (config: false) in the + source YANG file, then _set_ts is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_ts() directly. + + YANG Description: Tributary Slot (TS) number. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts", parent=self, choice=('range-type', 'trib-slot'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-ts', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """ts must be of a type compatible with otn-ts""", + 'defined-type': "ietf-otn-topology:otn-ts", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts", parent=self, choice=('range-type', 'trib-slot'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-ts', is_config=True)""", + }) + + self.__ts = t + if hasattr(self, '_set'): + self._set() + + def _unset_ts(self): + self.__ts = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts", parent=self, choice=('range-type', 'trib-slot'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-ts', is_config=True) + + tpn = __builtin__.property(_get_tpn, _set_tpn) + ts = __builtin__.property(_get_ts, _set_ts) + + __choices__ = {'range-type': {'trib-port': ['tpn'], 'trib-slot': ['ts']}} + _pyangbind_elements = OrderedDict([('tpn', tpn), ('ts', ts), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/label_restrictions/label_restriction/label_start/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/label_restrictions/label_restriction/label_start/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..65fb7f8e1624aee0aa322c455c72558add6d54d3 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/label_restrictions/label_restriction/label_start/__init__.py @@ -0,0 +1,120 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 te_label +class label_start(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/link/te/te-link-attributes/label-restrictions/label-restriction/label-start. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: This is the starting label if a label range is specified. +This is the label value if a single label is specified, +in which case the 'label-end' attribute is not set. + """ + __slots__ = ('_path_helper', '_extmethods', '__te_label',) + + _yang_name = 'label-start' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__te_label = YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-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 ['networks', 'network', 'link', 'te', 'te-link-attributes', 'label-restrictions', 'label-restriction', 'label-start'] + + def _get_te_label(self): + """ + Getter method for te_label, mapped from YANG variable /networks/network/link/te/te_link_attributes/label_restrictions/label_restriction/label_start/te_label (container) + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + return self.__te_label + + def _set_te_label(self, v, load=False): + """ + Setter method for te_label, mapped from YANG variable /networks/network/link/te/te_link_attributes/label_restrictions/label_restriction/label_start/te_label (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_te_label is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_te_label() directly. + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """te_label must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__te_label = t + if hasattr(self, '_set'): + self._set() + + def _unset_te_label(self): + self.__te_label = YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + te_label = __builtin__.property(_get_te_label, _set_te_label) + + + _pyangbind_elements = OrderedDict([('te_label', te_label), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/label_restrictions/label_restriction/label_start/te_label/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/label_restrictions/label_restriction/label_start/te_label/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..4a68961e3223f9bcfa8f06bac656a0d58279c7fe --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/label_restrictions/label_restriction/label_start/te_label/__init__.py @@ -0,0 +1,234 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 otn +class te_label(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/link/te/te-link-attributes/label-restrictions/label-restriction/label-start/te-label. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + __slots__ = ('_path_helper', '_extmethods', '__generic','__otn','__vlanid','__direction',) + + _yang_name = 'te-label' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__generic = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True) + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + self.__vlanid = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True) + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', 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 ['networks', 'network', 'link', 'te', 'te-link-attributes', 'label-restrictions', 'label-restriction', 'label-start', 'te-label'] + + def _get_generic(self): + """ + Getter method for generic, mapped from YANG variable /networks/network/link/te/te_link_attributes/label_restrictions/label_restriction/label_start/te_label/generic (rt-types:generalized-label) + + YANG Description: TE label specified in a generic format. + """ + return self.__generic + + def _set_generic(self, v, load=False): + """ + Setter method for generic, mapped from YANG variable /networks/network/link/te/te_link_attributes/label_restrictions/label_restriction/label_start/te_label/generic (rt-types:generalized-label) + If this variable is read-only (config: false) in the + source YANG file, then _set_generic is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_generic() directly. + + YANG Description: TE label specified in a generic format. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """generic must be of a type compatible with rt-types:generalized-label""", + 'defined-type': "rt-types:generalized-label", + 'generated-type': """YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True)""", + }) + + self.__generic = t + if hasattr(self, '_set'): + self._set() + + def _unset_generic(self): + self.__generic = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True) + + + def _get_otn(self): + """ + Getter method for otn, mapped from YANG variable /networks/network/link/te/te_link_attributes/label_restrictions/label_restriction/label_start/te_label/otn (container) + + YANG Description: Label start or label end for OTN. + """ + return self.__otn + + def _set_otn(self, v, load=False): + """ + Setter method for otn, mapped from YANG variable /networks/network/link/te/te_link_attributes/label_restrictions/label_restriction/label_start/te_label/otn (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_otn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_otn() directly. + + YANG Description: Label start or label end for OTN. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """otn must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True)""", + }) + + self.__otn = t + if hasattr(self, '_set'): + self._set() + + def _unset_otn(self): + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + + + def _get_vlanid(self): + """ + Getter method for vlanid, mapped from YANG variable /networks/network/link/te/te_link_attributes/label_restrictions/label_restriction/label_start/te_label/vlanid (etht-types:vlanid) + + YANG Description: VLAN tag id. + """ + return self.__vlanid + + def _set_vlanid(self, v, load=False): + """ + Setter method for vlanid, mapped from YANG variable /networks/network/link/te/te_link_attributes/label_restrictions/label_restriction/label_start/te_label/vlanid (etht-types:vlanid) + If this variable is read-only (config: false) in the + source YANG file, then _set_vlanid is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_vlanid() directly. + + YANG Description: VLAN tag id. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """vlanid must be of a type compatible with etht-types:vlanid""", + 'defined-type': "etht-types:vlanid", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True)""", + }) + + self.__vlanid = t + if hasattr(self, '_set'): + self._set() + + def _unset_vlanid(self): + self.__vlanid = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True) + + + def _get_direction(self): + """ + Getter method for direction, mapped from YANG variable /networks/network/link/te/te_link_attributes/label_restrictions/label_restriction/label_start/te_label/direction (te-label-direction) + + YANG Description: Label direction. + """ + return self.__direction + + def _set_direction(self, v, load=False): + """ + Setter method for direction, mapped from YANG variable /networks/network/link/te/te_link_attributes/label_restrictions/label_restriction/label_start/te_label/direction (te-label-direction) + If this variable is read-only (config: false) in the + source YANG file, then _set_direction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_direction() directly. + + YANG Description: Label direction. + """ + 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={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """direction must be of a type compatible with te-label-direction""", + 'defined-type': "ietf-te-topology:te-label-direction", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=True)""", + }) + + self.__direction = t + if hasattr(self, '_set'): + self._set() + + def _unset_direction(self): + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=True) + + generic = __builtin__.property(_get_generic, _set_generic) + otn = __builtin__.property(_get_otn, _set_otn) + vlanid = __builtin__.property(_get_vlanid, _set_vlanid) + direction = __builtin__.property(_get_direction, _set_direction) + + __choices__ = {'technology': {'generic': ['generic'], 'otn': ['otn'], 'eth': ['vlanid']}} + _pyangbind_elements = OrderedDict([('generic', generic), ('otn', otn), ('vlanid', vlanid), ('direction', direction), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/label_restrictions/label_restriction/label_start/te_label/otn/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/label_restrictions/label_restriction/label_start/te_label/otn/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..082f89723c1a7ce0382b9266cd665359ac29e533 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/label_restrictions/label_restriction/label_start/te_label/otn/__init__.py @@ -0,0 +1,154 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 otn(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/link/te/te-link-attributes/label-restrictions/label-restriction/label-start/te-label/otn. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Label start or label end for OTN. + """ + __slots__ = ('_path_helper', '_extmethods', '__tpn','__ts',) + + _yang_name = 'otn' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__tpn = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('range-type', 'trib-port'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True) + self.__ts = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts", parent=self, choice=('range-type', 'trib-slot'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-ts', 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 ['networks', 'network', 'link', 'te', 'te-link-attributes', 'label-restrictions', 'label-restriction', 'label-start', 'te-label', 'otn'] + + def _get_tpn(self): + """ + Getter method for tpn, mapped from YANG variable /networks/network/link/te/te_link_attributes/label_restrictions/label_restriction/label_start/te_label/otn/tpn (otn-tpn) + + YANG Description: Tributary Port Number (TPN). + """ + return self.__tpn + + def _set_tpn(self, v, load=False): + """ + Setter method for tpn, mapped from YANG variable /networks/network/link/te/te_link_attributes/label_restrictions/label_restriction/label_start/te_label/otn/tpn (otn-tpn) + If this variable is read-only (config: false) in the + source YANG file, then _set_tpn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tpn() directly. + + YANG Description: Tributary Port Number (TPN). + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('range-type', 'trib-port'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tpn must be of a type compatible with otn-tpn""", + 'defined-type': "ietf-otn-topology:otn-tpn", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('range-type', 'trib-port'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True)""", + }) + + self.__tpn = t + if hasattr(self, '_set'): + self._set() + + def _unset_tpn(self): + self.__tpn = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('range-type', 'trib-port'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True) + + + def _get_ts(self): + """ + Getter method for ts, mapped from YANG variable /networks/network/link/te/te_link_attributes/label_restrictions/label_restriction/label_start/te_label/otn/ts (otn-ts) + + YANG Description: Tributary Slot (TS) number. + """ + return self.__ts + + def _set_ts(self, v, load=False): + """ + Setter method for ts, mapped from YANG variable /networks/network/link/te/te_link_attributes/label_restrictions/label_restriction/label_start/te_label/otn/ts (otn-ts) + If this variable is read-only (config: false) in the + source YANG file, then _set_ts is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_ts() directly. + + YANG Description: Tributary Slot (TS) number. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts", parent=self, choice=('range-type', 'trib-slot'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-ts', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """ts must be of a type compatible with otn-ts""", + 'defined-type': "ietf-otn-topology:otn-ts", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts", parent=self, choice=('range-type', 'trib-slot'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-ts', is_config=True)""", + }) + + self.__ts = t + if hasattr(self, '_set'): + self._set() + + def _unset_ts(self): + self.__ts = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts", parent=self, choice=('range-type', 'trib-slot'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-ts', is_config=True) + + tpn = __builtin__.property(_get_tpn, _set_tpn) + ts = __builtin__.property(_get_ts, _set_ts) + + __choices__ = {'range-type': {'trib-port': ['tpn'], 'trib-slot': ['ts']}} + _pyangbind_elements = OrderedDict([('tpn', tpn), ('ts', ts), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/label_restrictions/label_restriction/label_step/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/label_restrictions/label_restriction/label_step/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..51201035a600a310728cb184967cfd0295c1bb04 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/label_restrictions/label_restriction/label_step/__init__.py @@ -0,0 +1,200 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 otn +class label_step(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/link/te/te-link-attributes/label-restrictions/label-restriction/label-step. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: The step increment between labels in the label range. +The label start/end values will have to be consistent +with the sign of label step. For example, +'label-start' < 'label-end' enforces 'label-step' > 0 +'label-start' > 'label-end' enforces 'label-step' < 0. + """ + __slots__ = ('_path_helper', '_extmethods', '__generic','__otn','__eth_step',) + + _yang_name = 'label-step' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__generic = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['-2147483648..2147483647']}, int_size=32), default=RestrictedClassType(base_type=long, restriction_dict={'range': ['-2147483648..2147483647']}, int_size=32)(1), is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='int32', is_config=True) + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + self.__eth_step = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), default=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16)(1), is_leaf=True, yang_name="eth-step", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint16', 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 ['networks', 'network', 'link', 'te', 'te-link-attributes', 'label-restrictions', 'label-restriction', 'label-step'] + + def _get_generic(self): + """ + Getter method for generic, mapped from YANG variable /networks/network/link/te/te_link_attributes/label_restrictions/label_restriction/label_step/generic (int32) + + YANG Description: Label range step. + """ + return self.__generic + + def _set_generic(self, v, load=False): + """ + Setter method for generic, mapped from YANG variable /networks/network/link/te/te_link_attributes/label_restrictions/label_restriction/label_step/generic (int32) + If this variable is read-only (config: false) in the + source YANG file, then _set_generic is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_generic() directly. + + YANG Description: Label range step. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['-2147483648..2147483647']}, int_size=32), default=RestrictedClassType(base_type=long, restriction_dict={'range': ['-2147483648..2147483647']}, int_size=32)(1), is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='int32', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """generic must be of a type compatible with int32""", + 'defined-type': "int32", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['-2147483648..2147483647']}, int_size=32), default=RestrictedClassType(base_type=long, restriction_dict={'range': ['-2147483648..2147483647']}, int_size=32)(1), is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='int32', is_config=True)""", + }) + + self.__generic = t + if hasattr(self, '_set'): + self._set() + + def _unset_generic(self): + self.__generic = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['-2147483648..2147483647']}, int_size=32), default=RestrictedClassType(base_type=long, restriction_dict={'range': ['-2147483648..2147483647']}, int_size=32)(1), is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='int32', is_config=True) + + + def _get_otn(self): + """ + Getter method for otn, mapped from YANG variable /networks/network/link/te/te_link_attributes/label_restrictions/label_restriction/label_step/otn (container) + + YANG Description: Label step for OTN + """ + return self.__otn + + def _set_otn(self, v, load=False): + """ + Setter method for otn, mapped from YANG variable /networks/network/link/te/te_link_attributes/label_restrictions/label_restriction/label_step/otn (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_otn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_otn() directly. + + YANG Description: Label step for OTN + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """otn must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True)""", + }) + + self.__otn = t + if hasattr(self, '_set'): + self._set() + + def _unset_otn(self): + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + + + def _get_eth_step(self): + """ + Getter method for eth_step, mapped from YANG variable /networks/network/link/te/te_link_attributes/label_restrictions/label_restriction/label_step/eth_step (uint16) + + YANG Description: Label step which represent possible increments for +an Ethernet VLAN tag. + """ + return self.__eth_step + + def _set_eth_step(self, v, load=False): + """ + Setter method for eth_step, mapped from YANG variable /networks/network/link/te/te_link_attributes/label_restrictions/label_restriction/label_step/eth_step (uint16) + If this variable is read-only (config: false) in the + source YANG file, then _set_eth_step is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_eth_step() directly. + + YANG Description: Label step which represent possible increments for +an Ethernet VLAN tag. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), default=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16)(1), is_leaf=True, yang_name="eth-step", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint16', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """eth_step must be of a type compatible with uint16""", + 'defined-type': "uint16", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), default=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16)(1), is_leaf=True, yang_name="eth-step", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint16', is_config=True)""", + }) + + self.__eth_step = t + if hasattr(self, '_set'): + self._set() + + def _unset_eth_step(self): + self.__eth_step = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), default=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16)(1), is_leaf=True, yang_name="eth-step", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint16', is_config=True) + + generic = __builtin__.property(_get_generic, _set_generic) + otn = __builtin__.property(_get_otn, _set_otn) + eth_step = __builtin__.property(_get_eth_step, _set_eth_step) + + __choices__ = {'technology': {'generic': ['generic'], 'otn': ['otn'], 'eth': ['eth_step']}} + _pyangbind_elements = OrderedDict([('generic', generic), ('otn', otn), ('eth_step', eth_step), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/label_restrictions/label_restriction/label_step/otn/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/label_restrictions/label_restriction/label_step/otn/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..1325a1afdeebef2b7141462c193da301279412ea --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/label_restrictions/label_restriction/label_step/otn/__init__.py @@ -0,0 +1,158 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 otn(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/link/te/te-link-attributes/label-restrictions/label-restriction/label-step/otn. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Label step for OTN + """ + __slots__ = ('_path_helper', '_extmethods', '__tpn','__ts',) + + _yang_name = 'otn' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__tpn = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('range-type', 'trib-port'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True) + self.__ts = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts", parent=self, choice=('range-type', 'trib-slot'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-ts', 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 ['networks', 'network', 'link', 'te', 'te-link-attributes', 'label-restrictions', 'label-restriction', 'label-step', 'otn'] + + def _get_tpn(self): + """ + Getter method for tpn, mapped from YANG variable /networks/network/link/te/te_link_attributes/label_restrictions/label_restriction/label_step/otn/tpn (otn-tpn) + + YANG Description: Label step which represents possible increments for +Tributary Port Number (TPN). + """ + return self.__tpn + + def _set_tpn(self, v, load=False): + """ + Setter method for tpn, mapped from YANG variable /networks/network/link/te/te_link_attributes/label_restrictions/label_restriction/label_step/otn/tpn (otn-tpn) + If this variable is read-only (config: false) in the + source YANG file, then _set_tpn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tpn() directly. + + YANG Description: Label step which represents possible increments for +Tributary Port Number (TPN). + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('range-type', 'trib-port'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tpn must be of a type compatible with otn-tpn""", + 'defined-type': "ietf-otn-topology:otn-tpn", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('range-type', 'trib-port'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True)""", + }) + + self.__tpn = t + if hasattr(self, '_set'): + self._set() + + def _unset_tpn(self): + self.__tpn = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('range-type', 'trib-port'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True) + + + def _get_ts(self): + """ + Getter method for ts, mapped from YANG variable /networks/network/link/te/te_link_attributes/label_restrictions/label_restriction/label_step/otn/ts (otn-ts) + + YANG Description: Label step which represents possible increments for +Tributary Slot (TS) number. + """ + return self.__ts + + def _set_ts(self, v, load=False): + """ + Setter method for ts, mapped from YANG variable /networks/network/link/te/te_link_attributes/label_restrictions/label_restriction/label_step/otn/ts (otn-ts) + If this variable is read-only (config: false) in the + source YANG file, then _set_ts is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_ts() directly. + + YANG Description: Label step which represents possible increments for +Tributary Slot (TS) number. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts", parent=self, choice=('range-type', 'trib-slot'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-ts', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """ts must be of a type compatible with otn-ts""", + 'defined-type': "ietf-otn-topology:otn-ts", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts", parent=self, choice=('range-type', 'trib-slot'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-ts', is_config=True)""", + }) + + self.__ts = t + if hasattr(self, '_set'): + self._set() + + def _unset_ts(self): + self.__ts = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts", parent=self, choice=('range-type', 'trib-slot'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-ts', is_config=True) + + tpn = __builtin__.property(_get_tpn, _set_tpn) + ts = __builtin__.property(_get_ts, _set_ts) + + __choices__ = {'range-type': {'trib-port': ['tpn'], 'trib-slot': ['ts']}} + _pyangbind_elements = OrderedDict([('tpn', tpn), ('ts', ts), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/label_restrictions/label_restriction/otn_label_range/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/label_restrictions/label_restriction/otn_label_range/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..b59c995b2870f460b03de3af569ff6b7fd1d9bea --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/label_restrictions/label_restriction/otn_label_range/__init__.py @@ -0,0 +1,256 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 otn_label_range(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/link/te/te-link-attributes/label-restrictions/label-restriction/otn-label-range. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Label range information for OTN. + """ + __slots__ = ('_path_helper', '_extmethods', '__range_type','__tsg','__odu_type_list','__priority',) + + _yang_name = 'otn-label-range' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__range_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'trib-slot': {}, 'trib-port': {}},), is_leaf=True, yang_name="range-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-label-range-type', is_config=True) + self.__tsg = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + self.__odu_type_list = YANGDynClass(unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},)), is_leaf=False, yang_name="odu-type-list", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + self.__priority = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..7']}), is_leaf=True, yang_name="priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', 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 ['networks', 'network', 'link', 'te', 'te-link-attributes', 'label-restrictions', 'label-restriction', 'otn-label-range'] + + def _get_range_type(self): + """ + Getter method for range_type, mapped from YANG variable /networks/network/link/te/te_link_attributes/label_restrictions/label_restriction/otn_label_range/range_type (otn-label-range-type) + + YANG Description: The type of range (e.g., TPN or TS) +to which the label range applies + """ + return self.__range_type + + def _set_range_type(self, v, load=False): + """ + Setter method for range_type, mapped from YANG variable /networks/network/link/te/te_link_attributes/label_restrictions/label_restriction/otn_label_range/range_type (otn-label-range-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_range_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_range_type() directly. + + YANG Description: The type of range (e.g., TPN or TS) +to which the label range applies + """ + 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={'trib-slot': {}, 'trib-port': {}},), is_leaf=True, yang_name="range-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-label-range-type', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """range_type must be of a type compatible with otn-label-range-type""", + 'defined-type': "ietf-otn-topology:otn-label-range-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'trib-slot': {}, 'trib-port': {}},), is_leaf=True, yang_name="range-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-label-range-type', is_config=True)""", + }) + + self.__range_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_range_type(self): + self.__range_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'trib-slot': {}, 'trib-port': {}},), is_leaf=True, yang_name="range-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-label-range-type', is_config=True) + + + def _get_tsg(self): + """ + Getter method for tsg, mapped from YANG variable /networks/network/link/te/te_link_attributes/label_restrictions/label_restriction/otn_label_range/tsg (identityref) + + YANG Description: Tributary slot granularity (TSG) to which the label range +applies. + +This leaf MUST be present when the range-type is TS. + +This leaf MAY be omitted when mapping an ODUk over an OTUk +Link. In this case the range-type is tpn, with only one +entry (ODUk), and the tpn range has only one value (1). + """ + return self.__tsg + + def _set_tsg(self, v, load=False): + """ + Setter method for tsg, mapped from YANG variable /networks/network/link/te/te_link_attributes/label_restrictions/label_restriction/otn_label_range/tsg (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_tsg is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tsg() directly. + + YANG Description: Tributary slot granularity (TSG) to which the label range +applies. + +This leaf MUST be present when the range-type is TS. + +This leaf MAY be omitted when mapping an ODUk over an OTUk +Link. In this case the range-type is tpn, with only one +entry (ODUk), and the tpn range has only one value (1). + """ + 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={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tsg must be of a type compatible with identityref""", + 'defined-type': "ietf-otn-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True)""", + }) + + self.__tsg = t + if hasattr(self, '_set'): + self._set() + + def _unset_tsg(self): + self.__tsg = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + + + def _get_odu_type_list(self): + """ + Getter method for odu_type_list, mapped from YANG variable /networks/network/link/te/te_link_attributes/label_restrictions/label_restriction/otn_label_range/odu_type_list (identityref) + + YANG Description: List of ODU types to which the label range applies. + +An Empty odu-type-list means that the label range +applies to all the supported ODU types. + """ + return self.__odu_type_list + + def _set_odu_type_list(self, v, load=False): + """ + Setter method for odu_type_list, mapped from YANG variable /networks/network/link/te/te_link_attributes/label_restrictions/label_restriction/otn_label_range/odu_type_list (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_odu_type_list is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_odu_type_list() directly. + + YANG Description: List of ODU types to which the label range applies. + +An Empty odu-type-list means that the label range +applies to all the supported ODU types. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},)), is_leaf=False, yang_name="odu-type-list", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """odu_type_list must be of a type compatible with identityref""", + 'defined-type': "ietf-otn-topology:identityref", + 'generated-type': """YANGDynClass(unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},)), is_leaf=False, yang_name="odu-type-list", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True)""", + }) + + self.__odu_type_list = t + if hasattr(self, '_set'): + self._set() + + def _unset_odu_type_list(self): + self.__odu_type_list = YANGDynClass(unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},)), is_leaf=False, yang_name="odu-type-list", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + + + def _get_priority(self): + """ + Getter method for priority, mapped from YANG variable /networks/network/link/te/te_link_attributes/label_restrictions/label_restriction/otn_label_range/priority (uint8) + + YANG Description: Priority in Interface Switching Capability +Descriptor (ISCD). + """ + return self.__priority + + def _set_priority(self, v, load=False): + """ + Setter method for priority, mapped from YANG variable /networks/network/link/te/te_link_attributes/label_restrictions/label_restriction/otn_label_range/priority (uint8) + If this variable is read-only (config: false) in the + source YANG file, then _set_priority is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_priority() directly. + + YANG Description: Priority in Interface Switching Capability +Descriptor (ISCD). + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..7']}), is_leaf=True, yang_name="priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint8', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """priority must be of a type compatible with uint8""", + 'defined-type': "uint8", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..7']}), is_leaf=True, yang_name="priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint8', is_config=True)""", + }) + + self.__priority = t + if hasattr(self, '_set'): + self._set() + + def _unset_priority(self): + self.__priority = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..7']}), is_leaf=True, yang_name="priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint8', is_config=True) + + range_type = __builtin__.property(_get_range_type, _set_range_type) + tsg = __builtin__.property(_get_tsg, _set_tsg) + odu_type_list = __builtin__.property(_get_odu_type_list, _set_odu_type_list) + priority = __builtin__.property(_get_priority, _set_priority) + + + _pyangbind_elements = OrderedDict([('range_type', range_type), ('tsg', tsg), ('odu_type_list', odu_type_list), ('priority', priority), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/max_link_bandwidth/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/max_link_bandwidth/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..566cf779960e7da8cd888ced53ed38b2e79f8fcf --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/max_link_bandwidth/__init__.py @@ -0,0 +1,119 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 te_bandwidth +class max_link_bandwidth(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/link/te/te-link-attributes/max-link-bandwidth. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Maximum bandwidth that can be seen on this link in this +direction. Units are in bytes per second. + """ + __slots__ = ('_path_helper', '_extmethods', '__te_bandwidth',) + + _yang_name = 'max-link-bandwidth' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__te_bandwidth = YANGDynClass(base=te_bandwidth.te_bandwidth, is_container='container', yang_name="te-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-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 ['networks', 'network', 'link', 'te', 'te-link-attributes', 'max-link-bandwidth'] + + def _get_te_bandwidth(self): + """ + Getter method for te_bandwidth, mapped from YANG variable /networks/network/link/te/te_link_attributes/max_link_bandwidth/te_bandwidth (container) + + YANG Description: Container that specifies TE bandwidth. The choices +can be augmented for specific data-plane technologies. + """ + return self.__te_bandwidth + + def _set_te_bandwidth(self, v, load=False): + """ + Setter method for te_bandwidth, mapped from YANG variable /networks/network/link/te/te_link_attributes/max_link_bandwidth/te_bandwidth (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_te_bandwidth is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_te_bandwidth() directly. + + YANG Description: Container that specifies TE bandwidth. The choices +can be augmented for specific data-plane technologies. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=te_bandwidth.te_bandwidth, is_container='container', yang_name="te-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """te_bandwidth must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=te_bandwidth.te_bandwidth, is_container='container', yang_name="te-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__te_bandwidth = t + if hasattr(self, '_set'): + self._set() + + def _unset_te_bandwidth(self): + self.__te_bandwidth = YANGDynClass(base=te_bandwidth.te_bandwidth, is_container='container', yang_name="te-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + te_bandwidth = __builtin__.property(_get_te_bandwidth, _set_te_bandwidth) + + + _pyangbind_elements = OrderedDict([('te_bandwidth', te_bandwidth), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/max_link_bandwidth/te_bandwidth/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/max_link_bandwidth/te_bandwidth/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..c0e0c9a78aab5fa13c8b166c9eb1e3374e31bc2d --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/max_link_bandwidth/te_bandwidth/__init__.py @@ -0,0 +1,195 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 otn +class te_bandwidth(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/link/te/te-link-attributes/max-link-bandwidth/te-bandwidth. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Container that specifies TE bandwidth. The choices +can be augmented for specific data-plane technologies. + """ + __slots__ = ('_path_helper', '_extmethods', '__generic','__otn','__eth_bandwidth',) + + _yang_name = 'te-bandwidth' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__generic = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+(,(0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+))*'}), is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-bandwidth', is_config=True) + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + self.__eth_bandwidth = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), restriction_dict={'range': ['0..10000000000']}), is_leaf=True, yang_name="eth-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint64', 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 ['networks', 'network', 'link', 'te', 'te-link-attributes', 'max-link-bandwidth', 'te-bandwidth'] + + def _get_generic(self): + """ + Getter method for generic, mapped from YANG variable /networks/network/link/te/te_link_attributes/max_link_bandwidth/te_bandwidth/generic (te-bandwidth) + + YANG Description: Bandwidth specified in a generic format. + """ + return self.__generic + + def _set_generic(self, v, load=False): + """ + Setter method for generic, mapped from YANG variable /networks/network/link/te/te_link_attributes/max_link_bandwidth/te_bandwidth/generic (te-bandwidth) + If this variable is read-only (config: false) in the + source YANG file, then _set_generic is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_generic() directly. + + YANG Description: Bandwidth specified in a generic format. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+(,(0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+))*'}), is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-bandwidth', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """generic must be of a type compatible with te-bandwidth""", + 'defined-type': "ietf-te-topology:te-bandwidth", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+(,(0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+))*'}), is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-bandwidth', is_config=True)""", + }) + + self.__generic = t + if hasattr(self, '_set'): + self._set() + + def _unset_generic(self): + self.__generic = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+(,(0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+))*'}), is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-bandwidth', is_config=True) + + + def _get_otn(self): + """ + Getter method for otn, mapped from YANG variable /networks/network/link/te/te_link_attributes/max_link_bandwidth/te_bandwidth/otn (container) + + YANG Description: Bandwidth attributes for OTN links + """ + return self.__otn + + def _set_otn(self, v, load=False): + """ + Setter method for otn, mapped from YANG variable /networks/network/link/te/te_link_attributes/max_link_bandwidth/te_bandwidth/otn (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_otn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_otn() directly. + + YANG Description: Bandwidth attributes for OTN links + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=otn.otn, is_container='container', yang_name="otn", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """otn must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True)""", + }) + + self.__otn = t + if hasattr(self, '_set'): + self._set() + + def _unset_otn(self): + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + + + def _get_eth_bandwidth(self): + """ + Getter method for eth_bandwidth, mapped from YANG variable /networks/network/link/te/te_link_attributes/max_link_bandwidth/te_bandwidth/eth_bandwidth (uint64) + + YANG Description: Available bandwith value expressed in kilobits per second + """ + return self.__eth_bandwidth + + def _set_eth_bandwidth(self, v, load=False): + """ + Setter method for eth_bandwidth, mapped from YANG variable /networks/network/link/te/te_link_attributes/max_link_bandwidth/te_bandwidth/eth_bandwidth (uint64) + If this variable is read-only (config: false) in the + source YANG file, then _set_eth_bandwidth is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_eth_bandwidth() directly. + + YANG Description: Available bandwith value expressed in kilobits per second + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), restriction_dict={'range': ['0..10000000000']}), is_leaf=True, yang_name="eth-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint64', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """eth_bandwidth must be of a type compatible with uint64""", + 'defined-type': "uint64", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), restriction_dict={'range': ['0..10000000000']}), is_leaf=True, yang_name="eth-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint64', is_config=True)""", + }) + + self.__eth_bandwidth = t + if hasattr(self, '_set'): + self._set() + + def _unset_eth_bandwidth(self): + self.__eth_bandwidth = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), restriction_dict={'range': ['0..10000000000']}), is_leaf=True, yang_name="eth-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint64', is_config=True) + + generic = __builtin__.property(_get_generic, _set_generic) + otn = __builtin__.property(_get_otn, _set_otn) + eth_bandwidth = __builtin__.property(_get_eth_bandwidth, _set_eth_bandwidth) + + __choices__ = {'technology': {'generic': ['generic']}} + _pyangbind_elements = OrderedDict([('generic', generic), ('otn', otn), ('eth_bandwidth', eth_bandwidth), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/max_link_bandwidth/te_bandwidth/otn/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/max_link_bandwidth/te_bandwidth/otn/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..94132f930254b1e06ff745c118b01a4511b75f1b --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/max_link_bandwidth/te_bandwidth/otn/__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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 odulist +class otn(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/link/te/te-link-attributes/max-link-bandwidth/te-bandwidth/otn. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Bandwidth attributes for OTN links + """ + __slots__ = ('_path_helper', '_extmethods', '__odulist',) + + _yang_name = 'otn' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__odulist = YANGDynClass(base=YANGListType("odu_type",odulist.odulist, yang_name="odulist", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='odu-type', extensions=None), is_container='list', yang_name="odulist", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-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 ['networks', 'network', 'link', 'te', 'te-link-attributes', 'max-link-bandwidth', 'te-bandwidth', 'otn'] + + def _get_odulist(self): + """ + Getter method for odulist, mapped from YANG variable /networks/network/link/te/te_link_attributes/max_link_bandwidth/te_bandwidth/otn/odulist (list) + + YANG Description: OTN bandwidth definition + """ + return self.__odulist + + def _set_odulist(self, v, load=False): + """ + Setter method for odulist, mapped from YANG variable /networks/network/link/te/te_link_attributes/max_link_bandwidth/te_bandwidth/otn/odulist (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_odulist is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_odulist() directly. + + YANG Description: OTN bandwidth definition + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("odu_type",odulist.odulist, yang_name="odulist", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='odu-type', extensions=None), is_container='list', yang_name="odulist", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='list', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """odulist must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("odu_type",odulist.odulist, yang_name="odulist", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='odu-type', extensions=None), is_container='list', yang_name="odulist", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='list', is_config=True)""", + }) + + self.__odulist = t + if hasattr(self, '_set'): + self._set() + + def _unset_odulist(self): + self.__odulist = YANGDynClass(base=YANGListType("odu_type",odulist.odulist, yang_name="odulist", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='odu-type', extensions=None), is_container='list', yang_name="odulist", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='list', is_config=True) + + odulist = __builtin__.property(_get_odulist, _set_odulist) + + + _pyangbind_elements = OrderedDict([('odulist', odulist), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/max_link_bandwidth/te_bandwidth/otn/odulist/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/max_link_bandwidth/te_bandwidth/otn/odulist/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..53a6ab8739a937f1c33d42b7ac93cabddf249521 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/max_link_bandwidth/te_bandwidth/otn/odulist/__init__.py @@ -0,0 +1,200 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 odulist(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/link/te/te-link-attributes/max-link-bandwidth/te-bandwidth/otn/odulist. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: OTN bandwidth definition + """ + __slots__ = ('_path_helper', '_extmethods', '__odu_type','__number','__ts_number',) + + _yang_name = 'odulist' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__odu_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="odu-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + self.__number = YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), is_leaf=True, yang_name="number", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', is_config=True) + self.__ts_number = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts-number", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', 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 ['networks', 'network', 'link', 'te', 'te-link-attributes', 'max-link-bandwidth', 'te-bandwidth', 'otn', 'odulist'] + + def _get_odu_type(self): + """ + Getter method for odu_type, mapped from YANG variable /networks/network/link/te/te_link_attributes/max_link_bandwidth/te_bandwidth/otn/odulist/odu_type (identityref) + + YANG Description: ODU type + """ + return self.__odu_type + + def _set_odu_type(self, v, load=False): + """ + Setter method for odu_type, mapped from YANG variable /networks/network/link/te/te_link_attributes/max_link_bandwidth/te_bandwidth/otn/odulist/odu_type (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_odu_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_odu_type() directly. + + YANG Description: ODU type + """ + 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=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="odu-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """odu_type must be of a type compatible with identityref""", + 'defined-type': "ietf-otn-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="odu-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True)""", + }) + + self.__odu_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_odu_type(self): + self.__odu_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="odu-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + + + def _get_number(self): + """ + Getter method for number, mapped from YANG variable /networks/network/link/te/te_link_attributes/max_link_bandwidth/te_bandwidth/otn/odulist/number (uint16) + + YANG Description: Number of ODUs + """ + return self.__number + + def _set_number(self, v, load=False): + """ + Setter method for number, mapped from YANG variable /networks/network/link/te/te_link_attributes/max_link_bandwidth/te_bandwidth/otn/odulist/number (uint16) + If this variable is read-only (config: false) in the + source YANG file, then _set_number is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_number() directly. + + YANG Description: Number of ODUs + """ + 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="number", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """number 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="number", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', is_config=True)""", + }) + + self.__number = t + if hasattr(self, '_set'): + self._set() + + def _unset_number(self): + self.__number = YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), is_leaf=True, yang_name="number", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', is_config=True) + + + def _get_ts_number(self): + """ + Getter method for ts_number, mapped from YANG variable /networks/network/link/te/te_link_attributes/max_link_bandwidth/te_bandwidth/otn/odulist/ts_number (uint16) + + YANG Description: The number of Tributary Slots (TS) that +could be used by all the ODUflex LSPs. + """ + return self.__ts_number + + def _set_ts_number(self, v, load=False): + """ + Setter method for ts_number, mapped from YANG variable /networks/network/link/te/te_link_attributes/max_link_bandwidth/te_bandwidth/otn/odulist/ts_number (uint16) + If this variable is read-only (config: false) in the + source YANG file, then _set_ts_number is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_ts_number() directly. + + YANG Description: The number of Tributary Slots (TS) that +could be used by all the ODUflex LSPs. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts-number", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """ts_number must be of a type compatible with uint16""", + 'defined-type': "uint16", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts-number", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', is_config=True)""", + }) + + self.__ts_number = t + if hasattr(self, '_set'): + self._set() + + def _unset_ts_number(self): + self.__ts_number = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts-number", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', is_config=True) + + odu_type = __builtin__.property(_get_odu_type, _set_odu_type) + number = __builtin__.property(_get_number, _set_number) + ts_number = __builtin__.property(_get_ts_number, _set_ts_number) + + + _pyangbind_elements = OrderedDict([('odu_type', odu_type), ('number', number), ('ts_number', ts_number), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/max_resv_link_bandwidth/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/max_resv_link_bandwidth/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..33d25351b1f49adbc787e667e557f3cf3de3f387 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/max_resv_link_bandwidth/__init__.py @@ -0,0 +1,119 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 te_bandwidth +class max_resv_link_bandwidth(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/link/te/te-link-attributes/max-resv-link-bandwidth. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Maximum amount of bandwidth that can be reserved in this +direction in this link. Units are in bytes per second. + """ + __slots__ = ('_path_helper', '_extmethods', '__te_bandwidth',) + + _yang_name = 'max-resv-link-bandwidth' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__te_bandwidth = YANGDynClass(base=te_bandwidth.te_bandwidth, is_container='container', yang_name="te-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-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 ['networks', 'network', 'link', 'te', 'te-link-attributes', 'max-resv-link-bandwidth'] + + def _get_te_bandwidth(self): + """ + Getter method for te_bandwidth, mapped from YANG variable /networks/network/link/te/te_link_attributes/max_resv_link_bandwidth/te_bandwidth (container) + + YANG Description: Container that specifies TE bandwidth. The choices +can be augmented for specific data-plane technologies. + """ + return self.__te_bandwidth + + def _set_te_bandwidth(self, v, load=False): + """ + Setter method for te_bandwidth, mapped from YANG variable /networks/network/link/te/te_link_attributes/max_resv_link_bandwidth/te_bandwidth (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_te_bandwidth is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_te_bandwidth() directly. + + YANG Description: Container that specifies TE bandwidth. The choices +can be augmented for specific data-plane technologies. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=te_bandwidth.te_bandwidth, is_container='container', yang_name="te-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """te_bandwidth must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=te_bandwidth.te_bandwidth, is_container='container', yang_name="te-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__te_bandwidth = t + if hasattr(self, '_set'): + self._set() + + def _unset_te_bandwidth(self): + self.__te_bandwidth = YANGDynClass(base=te_bandwidth.te_bandwidth, is_container='container', yang_name="te-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + te_bandwidth = __builtin__.property(_get_te_bandwidth, _set_te_bandwidth) + + + _pyangbind_elements = OrderedDict([('te_bandwidth', te_bandwidth), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/max_resv_link_bandwidth/te_bandwidth/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/max_resv_link_bandwidth/te_bandwidth/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..34072dafa69abb467c6e46d7f7ee550119244547 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/max_resv_link_bandwidth/te_bandwidth/__init__.py @@ -0,0 +1,195 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 otn +class te_bandwidth(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/link/te/te-link-attributes/max-resv-link-bandwidth/te-bandwidth. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Container that specifies TE bandwidth. The choices +can be augmented for specific data-plane technologies. + """ + __slots__ = ('_path_helper', '_extmethods', '__generic','__otn','__eth_bandwidth',) + + _yang_name = 'te-bandwidth' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__generic = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+(,(0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+))*'}), is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-bandwidth', is_config=True) + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + self.__eth_bandwidth = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), restriction_dict={'range': ['0..10000000000']}), is_leaf=True, yang_name="eth-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint64', 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 ['networks', 'network', 'link', 'te', 'te-link-attributes', 'max-resv-link-bandwidth', 'te-bandwidth'] + + def _get_generic(self): + """ + Getter method for generic, mapped from YANG variable /networks/network/link/te/te_link_attributes/max_resv_link_bandwidth/te_bandwidth/generic (te-bandwidth) + + YANG Description: Bandwidth specified in a generic format. + """ + return self.__generic + + def _set_generic(self, v, load=False): + """ + Setter method for generic, mapped from YANG variable /networks/network/link/te/te_link_attributes/max_resv_link_bandwidth/te_bandwidth/generic (te-bandwidth) + If this variable is read-only (config: false) in the + source YANG file, then _set_generic is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_generic() directly. + + YANG Description: Bandwidth specified in a generic format. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+(,(0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+))*'}), is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-bandwidth', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """generic must be of a type compatible with te-bandwidth""", + 'defined-type': "ietf-te-topology:te-bandwidth", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+(,(0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+))*'}), is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-bandwidth', is_config=True)""", + }) + + self.__generic = t + if hasattr(self, '_set'): + self._set() + + def _unset_generic(self): + self.__generic = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+(,(0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+))*'}), is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-bandwidth', is_config=True) + + + def _get_otn(self): + """ + Getter method for otn, mapped from YANG variable /networks/network/link/te/te_link_attributes/max_resv_link_bandwidth/te_bandwidth/otn (container) + + YANG Description: Bandwidth attributes for OTN links + """ + return self.__otn + + def _set_otn(self, v, load=False): + """ + Setter method for otn, mapped from YANG variable /networks/network/link/te/te_link_attributes/max_resv_link_bandwidth/te_bandwidth/otn (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_otn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_otn() directly. + + YANG Description: Bandwidth attributes for OTN links + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=otn.otn, is_container='container', yang_name="otn", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """otn must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True)""", + }) + + self.__otn = t + if hasattr(self, '_set'): + self._set() + + def _unset_otn(self): + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + + + def _get_eth_bandwidth(self): + """ + Getter method for eth_bandwidth, mapped from YANG variable /networks/network/link/te/te_link_attributes/max_resv_link_bandwidth/te_bandwidth/eth_bandwidth (uint64) + + YANG Description: Available bandwith value expressed in kilobits per second + """ + return self.__eth_bandwidth + + def _set_eth_bandwidth(self, v, load=False): + """ + Setter method for eth_bandwidth, mapped from YANG variable /networks/network/link/te/te_link_attributes/max_resv_link_bandwidth/te_bandwidth/eth_bandwidth (uint64) + If this variable is read-only (config: false) in the + source YANG file, then _set_eth_bandwidth is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_eth_bandwidth() directly. + + YANG Description: Available bandwith value expressed in kilobits per second + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), restriction_dict={'range': ['0..10000000000']}), is_leaf=True, yang_name="eth-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint64', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """eth_bandwidth must be of a type compatible with uint64""", + 'defined-type': "uint64", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), restriction_dict={'range': ['0..10000000000']}), is_leaf=True, yang_name="eth-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint64', is_config=True)""", + }) + + self.__eth_bandwidth = t + if hasattr(self, '_set'): + self._set() + + def _unset_eth_bandwidth(self): + self.__eth_bandwidth = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), restriction_dict={'range': ['0..10000000000']}), is_leaf=True, yang_name="eth-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint64', is_config=True) + + generic = __builtin__.property(_get_generic, _set_generic) + otn = __builtin__.property(_get_otn, _set_otn) + eth_bandwidth = __builtin__.property(_get_eth_bandwidth, _set_eth_bandwidth) + + __choices__ = {'technology': {'generic': ['generic']}} + _pyangbind_elements = OrderedDict([('generic', generic), ('otn', otn), ('eth_bandwidth', eth_bandwidth), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/max_resv_link_bandwidth/te_bandwidth/otn/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/max_resv_link_bandwidth/te_bandwidth/otn/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..971708460d371d869013e6eb51c35bbca416cc87 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/max_resv_link_bandwidth/te_bandwidth/otn/__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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 odulist +class otn(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/link/te/te-link-attributes/max-resv-link-bandwidth/te-bandwidth/otn. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Bandwidth attributes for OTN links + """ + __slots__ = ('_path_helper', '_extmethods', '__odulist',) + + _yang_name = 'otn' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__odulist = YANGDynClass(base=YANGListType("odu_type",odulist.odulist, yang_name="odulist", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='odu-type', extensions=None), is_container='list', yang_name="odulist", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-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 ['networks', 'network', 'link', 'te', 'te-link-attributes', 'max-resv-link-bandwidth', 'te-bandwidth', 'otn'] + + def _get_odulist(self): + """ + Getter method for odulist, mapped from YANG variable /networks/network/link/te/te_link_attributes/max_resv_link_bandwidth/te_bandwidth/otn/odulist (list) + + YANG Description: OTN bandwidth definition + """ + return self.__odulist + + def _set_odulist(self, v, load=False): + """ + Setter method for odulist, mapped from YANG variable /networks/network/link/te/te_link_attributes/max_resv_link_bandwidth/te_bandwidth/otn/odulist (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_odulist is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_odulist() directly. + + YANG Description: OTN bandwidth definition + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("odu_type",odulist.odulist, yang_name="odulist", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='odu-type', extensions=None), is_container='list', yang_name="odulist", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='list', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """odulist must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("odu_type",odulist.odulist, yang_name="odulist", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='odu-type', extensions=None), is_container='list', yang_name="odulist", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='list', is_config=True)""", + }) + + self.__odulist = t + if hasattr(self, '_set'): + self._set() + + def _unset_odulist(self): + self.__odulist = YANGDynClass(base=YANGListType("odu_type",odulist.odulist, yang_name="odulist", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='odu-type', extensions=None), is_container='list', yang_name="odulist", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='list', is_config=True) + + odulist = __builtin__.property(_get_odulist, _set_odulist) + + + _pyangbind_elements = OrderedDict([('odulist', odulist), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/max_resv_link_bandwidth/te_bandwidth/otn/odulist/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/max_resv_link_bandwidth/te_bandwidth/otn/odulist/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..8ee145707c3270bee11e71ad357fb1c6df8fe5d0 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/max_resv_link_bandwidth/te_bandwidth/otn/odulist/__init__.py @@ -0,0 +1,200 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 odulist(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/link/te/te-link-attributes/max-resv-link-bandwidth/te-bandwidth/otn/odulist. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: OTN bandwidth definition + """ + __slots__ = ('_path_helper', '_extmethods', '__odu_type','__number','__ts_number',) + + _yang_name = 'odulist' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__odu_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="odu-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + self.__number = YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), is_leaf=True, yang_name="number", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', is_config=True) + self.__ts_number = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts-number", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', 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 ['networks', 'network', 'link', 'te', 'te-link-attributes', 'max-resv-link-bandwidth', 'te-bandwidth', 'otn', 'odulist'] + + def _get_odu_type(self): + """ + Getter method for odu_type, mapped from YANG variable /networks/network/link/te/te_link_attributes/max_resv_link_bandwidth/te_bandwidth/otn/odulist/odu_type (identityref) + + YANG Description: ODU type + """ + return self.__odu_type + + def _set_odu_type(self, v, load=False): + """ + Setter method for odu_type, mapped from YANG variable /networks/network/link/te/te_link_attributes/max_resv_link_bandwidth/te_bandwidth/otn/odulist/odu_type (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_odu_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_odu_type() directly. + + YANG Description: ODU type + """ + 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=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="odu-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """odu_type must be of a type compatible with identityref""", + 'defined-type': "ietf-otn-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="odu-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True)""", + }) + + self.__odu_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_odu_type(self): + self.__odu_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="odu-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + + + def _get_number(self): + """ + Getter method for number, mapped from YANG variable /networks/network/link/te/te_link_attributes/max_resv_link_bandwidth/te_bandwidth/otn/odulist/number (uint16) + + YANG Description: Number of ODUs + """ + return self.__number + + def _set_number(self, v, load=False): + """ + Setter method for number, mapped from YANG variable /networks/network/link/te/te_link_attributes/max_resv_link_bandwidth/te_bandwidth/otn/odulist/number (uint16) + If this variable is read-only (config: false) in the + source YANG file, then _set_number is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_number() directly. + + YANG Description: Number of ODUs + """ + 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="number", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """number 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="number", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', is_config=True)""", + }) + + self.__number = t + if hasattr(self, '_set'): + self._set() + + def _unset_number(self): + self.__number = YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), is_leaf=True, yang_name="number", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', is_config=True) + + + def _get_ts_number(self): + """ + Getter method for ts_number, mapped from YANG variable /networks/network/link/te/te_link_attributes/max_resv_link_bandwidth/te_bandwidth/otn/odulist/ts_number (uint16) + + YANG Description: The number of Tributary Slots (TS) that +could be used by all the ODUflex LSPs. + """ + return self.__ts_number + + def _set_ts_number(self, v, load=False): + """ + Setter method for ts_number, mapped from YANG variable /networks/network/link/te/te_link_attributes/max_resv_link_bandwidth/te_bandwidth/otn/odulist/ts_number (uint16) + If this variable is read-only (config: false) in the + source YANG file, then _set_ts_number is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_ts_number() directly. + + YANG Description: The number of Tributary Slots (TS) that +could be used by all the ODUflex LSPs. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts-number", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """ts_number must be of a type compatible with uint16""", + 'defined-type': "uint16", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts-number", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', is_config=True)""", + }) + + self.__ts_number = t + if hasattr(self, '_set'): + self._set() + + def _unset_ts_number(self): + self.__ts_number = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts-number", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', is_config=True) + + odu_type = __builtin__.property(_get_odu_type, _set_odu_type) + number = __builtin__.property(_get_number, _set_number) + ts_number = __builtin__.property(_get_ts_number, _set_ts_number) + + + _pyangbind_elements = OrderedDict([('odu_type', odu_type), ('number', number), ('ts_number', ts_number), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/otn_link/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/otn_link/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..62dec2b8900c4567216707abd01d79e8e567f631 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/otn_link/__init__.py @@ -0,0 +1,199 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 otn_link(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/link/te/te-link-attributes/otn-link. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Attributes of the OTN Link. + """ + __slots__ = ('_path_helper', '_extmethods', '__odtu_flex_type','__tsg','__distance',) + + _yang_name = 'otn-link' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__odtu_flex_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'2': {}, '3': {}, '4': {}, 'Cn': {}},), is_leaf=True, yang_name="odtu-flex-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='l1-types:odtu-flex-type', is_config=True) + self.__tsg = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + self.__distance = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="distance", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', 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 ['networks', 'network', 'link', 'te', 'te-link-attributes', 'otn-link'] + + def _get_odtu_flex_type(self): + """ + Getter method for odtu_flex_type, mapped from YANG variable /networks/network/link/te/te_link_attributes/otn_link/odtu_flex_type (l1-types:odtu-flex-type) + + YANG Description: The type of Optical Data Tributary Unit (ODTU) +whose nominal bitrate is used to compute the number of +Tributary Slots (TS) required by the ODUflex LSPs set up +on this OTN Link. + """ + return self.__odtu_flex_type + + def _set_odtu_flex_type(self, v, load=False): + """ + Setter method for odtu_flex_type, mapped from YANG variable /networks/network/link/te/te_link_attributes/otn_link/odtu_flex_type (l1-types:odtu-flex-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_odtu_flex_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_odtu_flex_type() directly. + + YANG Description: The type of Optical Data Tributary Unit (ODTU) +whose nominal bitrate is used to compute the number of +Tributary Slots (TS) required by the ODUflex LSPs set up +on this OTN Link. + """ + 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={'2': {}, '3': {}, '4': {}, 'Cn': {}},), is_leaf=True, yang_name="odtu-flex-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='l1-types:odtu-flex-type', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """odtu_flex_type must be of a type compatible with l1-types:odtu-flex-type""", + 'defined-type': "l1-types:odtu-flex-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'2': {}, '3': {}, '4': {}, 'Cn': {}},), is_leaf=True, yang_name="odtu-flex-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='l1-types:odtu-flex-type', is_config=True)""", + }) + + self.__odtu_flex_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_odtu_flex_type(self): + self.__odtu_flex_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'2': {}, '3': {}, '4': {}, 'Cn': {}},), is_leaf=True, yang_name="odtu-flex-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='l1-types:odtu-flex-type', is_config=True) + + + def _get_tsg(self): + """ + Getter method for tsg, mapped from YANG variable /networks/network/link/te/te_link_attributes/otn_link/tsg (identityref) + + YANG Description: Tributary slot granularity. + """ + return self.__tsg + + def _set_tsg(self, v, load=False): + """ + Setter method for tsg, mapped from YANG variable /networks/network/link/te/te_link_attributes/otn_link/tsg (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_tsg is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tsg() directly. + + YANG Description: Tributary slot granularity. + """ + 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={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tsg must be of a type compatible with identityref""", + 'defined-type': "ietf-otn-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True)""", + }) + + self.__tsg = t + if hasattr(self, '_set'): + self._set() + + def _unset_tsg(self): + self.__tsg = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + + + def _get_distance(self): + """ + Getter method for distance, mapped from YANG variable /networks/network/link/te/te_link_attributes/otn_link/distance (uint32) + + YANG Description: distance in the unit of kilometers + """ + return self.__distance + + def _set_distance(self, v, load=False): + """ + Setter method for distance, mapped from YANG variable /networks/network/link/te/te_link_attributes/otn_link/distance (uint32) + If this variable is read-only (config: false) in the + source YANG file, then _set_distance is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_distance() directly. + + YANG Description: distance in the unit of kilometers + """ + 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="distance", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint32', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """distance 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="distance", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint32', is_config=True)""", + }) + + self.__distance = t + if hasattr(self, '_set'): + self._set() + + def _unset_distance(self): + self.__distance = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="distance", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint32', is_config=True) + + odtu_flex_type = __builtin__.property(_get_odtu_flex_type, _set_odtu_flex_type) + tsg = __builtin__.property(_get_tsg, _set_tsg) + distance = __builtin__.property(_get_distance, _set_distance) + + + _pyangbind_elements = OrderedDict([('odtu_flex_type', odtu_flex_type), ('tsg', tsg), ('distance', distance), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/te_nsrlgs/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/te_nsrlgs/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..51926d3135bc483730723c3ee73ed2b4201ea38c --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/te_nsrlgs/__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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 te_nsrlgs(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/link/te/te-link-attributes/te-nsrlgs. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Contains a list of NSRLGs (Non-Shared Risk Link Groups). +When an abstract TE link is configured, this list specifies +the request that underlay TE paths need to be mutually +disjoint with other TE links in the same groups. + """ + __slots__ = ('_path_helper', '_extmethods', '__id',) + + _yang_name = 'te-nsrlgs' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__id = YANGDynClass(unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32)), is_leaf=False, yang_name="id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', 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 ['networks', 'network', 'link', 'te', 'te-link-attributes', 'te-nsrlgs'] + + def _get_id(self): + """ + Getter method for id, mapped from YANG variable /networks/network/link/te/te_link_attributes/te_nsrlgs/id (uint32) + + YANG Description: NSRLG ID, uniquely configured within a topology. + """ + return self.__id + + def _set_id(self, v, load=False): + """ + Setter method for id, mapped from YANG variable /networks/network/link/te/te_link_attributes/te_nsrlgs/id (uint32) + 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: NSRLG ID, uniquely configured within a topology. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32)), is_leaf=False, yang_name="id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """id must be of a type compatible with uint32""", + 'defined-type': "uint32", + 'generated-type': """YANGDynClass(unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32)), is_leaf=False, yang_name="id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True)""", + }) + + self.__id = t + if hasattr(self, '_set'): + self._set() + + def _unset_id(self): + self.__id = YANGDynClass(unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32)), is_leaf=False, yang_name="id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + + id = __builtin__.property(_get_id, _set_id) + + + _pyangbind_elements = OrderedDict([('id', id), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/te_srlgs/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/te_srlgs/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..92ac61644757fb7d4aad97d30d818e3f496f526e --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/te_srlgs/__init__.py @@ -0,0 +1,115 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 te_srlgs(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/link/te/te-link-attributes/te-srlgs. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Contains a list of SRLGs. + """ + __slots__ = ('_path_helper', '_extmethods', '__value',) + + _yang_name = 'te-srlgs' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__value = YANGDynClass(unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32)), is_leaf=False, yang_name="value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-types:srlg', 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 ['networks', 'network', 'link', 'te', 'te-link-attributes', 'te-srlgs'] + + def _get_value(self): + """ + Getter method for value, mapped from YANG variable /networks/network/link/te/te_link_attributes/te_srlgs/value (te-types:srlg) + + YANG Description: SRLG value. + """ + return self.__value + + def _set_value(self, v, load=False): + """ + Setter method for value, mapped from YANG variable /networks/network/link/te/te_link_attributes/te_srlgs/value (te-types:srlg) + 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: SRLG value. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32)), is_leaf=False, yang_name="value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-types:srlg', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """value must be of a type compatible with te-types:srlg""", + 'defined-type': "te-types:srlg", + 'generated-type': """YANGDynClass(unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32)), is_leaf=False, yang_name="value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-types:srlg', is_config=True)""", + }) + + self.__value = t + if hasattr(self, '_set'): + self._set() + + def _unset_value(self): + self.__value = YANGDynClass(unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32)), is_leaf=False, yang_name="value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-types:srlg', is_config=True) + + value = __builtin__.property(_get_value, _set_value) + + + _pyangbind_elements = OrderedDict([('value', value), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/underlay/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/underlay/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..129490e773c092f4dfeb730380f9bfd6f63158c8 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/underlay/__init__.py @@ -0,0 +1,326 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 primary_path +from . import backup_path +from . import tunnel_termination_points +from . import tunnels +class underlay(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/link/te/te-link-attributes/underlay. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Attributes of the TE link underlay. + """ + __slots__ = ('_path_helper', '_extmethods', '__enabled','__primary_path','__backup_path','__protection_type','__tunnel_termination_points','__tunnels',) + + _yang_name = 'underlay' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__enabled = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="enabled", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='boolean', is_config=True) + self.__primary_path = YANGDynClass(base=primary_path.primary_path, is_container='container', yang_name="primary-path", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__backup_path = YANGDynClass(base=YANGListType("index",backup_path.backup_path, yang_name="backup-path", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='index', extensions=None), is_container='list', yang_name="backup-path", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + self.__protection_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'lsp-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-reroute-extra': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-reroute-extra': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-reroute-extra': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-reroute': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-reroute': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-reroute': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-1-for-n': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-1-for-n': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-1-for-n': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-unidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-unidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-unidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-bidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-bidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-bidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="protection-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + self.__tunnel_termination_points = YANGDynClass(base=tunnel_termination_points.tunnel_termination_points, is_container='container', yang_name="tunnel-termination-points", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__tunnels = YANGDynClass(base=tunnels.tunnels, is_container='container', yang_name="tunnels", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-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 ['networks', 'network', 'link', 'te', 'te-link-attributes', 'underlay'] + + def _get_enabled(self): + """ + Getter method for enabled, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay/enabled (boolean) + + YANG Description: 'true' if the underlay is enabled. +'false' if the underlay is disabled. + """ + return self.__enabled + + def _set_enabled(self, v, load=False): + """ + Setter method for enabled, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay/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: 'true' if the underlay is enabled. +'false' if the underlay is disabled. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBool, is_leaf=True, yang_name="enabled", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', 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, is_leaf=True, yang_name="enabled", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='boolean', is_config=True)""", + }) + + self.__enabled = t + if hasattr(self, '_set'): + self._set() + + def _unset_enabled(self): + self.__enabled = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="enabled", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='boolean', is_config=True) + + + def _get_primary_path(self): + """ + Getter method for primary_path, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay/primary_path (container) + + YANG Description: The service path on the underlay topology that +supports this link. + """ + return self.__primary_path + + def _set_primary_path(self, v, load=False): + """ + Setter method for primary_path, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay/primary_path (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_primary_path is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_primary_path() directly. + + YANG Description: The service path on the underlay topology that +supports this link. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=primary_path.primary_path, is_container='container', yang_name="primary-path", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """primary_path must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=primary_path.primary_path, is_container='container', yang_name="primary-path", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__primary_path = t + if hasattr(self, '_set'): + self._set() + + def _unset_primary_path(self): + self.__primary_path = YANGDynClass(base=primary_path.primary_path, is_container='container', yang_name="primary-path", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_backup_path(self): + """ + Getter method for backup_path, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay/backup_path (list) + + YANG Description: A list of backup service paths on the underlay topology that +protect the underlay primary path. If the primary path is +not protected, the list contains zero elements. If the +primary path is protected, the list contains one or more +elements. + """ + return self.__backup_path + + def _set_backup_path(self, v, load=False): + """ + Setter method for backup_path, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay/backup_path (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_backup_path is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_backup_path() directly. + + YANG Description: A list of backup service paths on the underlay topology that +protect the underlay primary path. If the primary path is +not protected, the list contains zero elements. If the +primary path is protected, the list contains one or more +elements. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("index",backup_path.backup_path, yang_name="backup-path", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='index', extensions=None), is_container='list', yang_name="backup-path", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """backup_path must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("index",backup_path.backup_path, yang_name="backup-path", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='index', extensions=None), is_container='list', yang_name="backup-path", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True)""", + }) + + self.__backup_path = t + if hasattr(self, '_set'): + self._set() + + def _unset_backup_path(self): + self.__backup_path = YANGDynClass(base=YANGListType("index",backup_path.backup_path, yang_name="backup-path", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='index', extensions=None), is_container='list', yang_name="backup-path", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + + + def _get_protection_type(self): + """ + Getter method for protection_type, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay/protection_type (identityref) + + YANG Description: Underlay protection type desired for this link. + """ + return self.__protection_type + + def _set_protection_type(self, v, load=False): + """ + Setter method for protection_type, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay/protection_type (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_protection_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_protection_type() directly. + + YANG Description: Underlay protection type desired for this link. + """ + 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={'lsp-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-reroute-extra': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-reroute-extra': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-reroute-extra': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-reroute': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-reroute': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-reroute': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-1-for-n': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-1-for-n': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-1-for-n': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-unidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-unidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-unidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-bidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-bidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-bidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="protection-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """protection_type must be of a type compatible with identityref""", + 'defined-type': "ietf-te-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'lsp-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-reroute-extra': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-reroute-extra': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-reroute-extra': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-reroute': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-reroute': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-reroute': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-1-for-n': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-1-for-n': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-1-for-n': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-unidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-unidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-unidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-bidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-bidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-bidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="protection-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True)""", + }) + + self.__protection_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_protection_type(self): + self.__protection_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'lsp-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-reroute-extra': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-reroute-extra': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-reroute-extra': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-reroute': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-reroute': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-reroute': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-1-for-n': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-1-for-n': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-1-for-n': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-unidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-unidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-unidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-bidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-bidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-bidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="protection-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + + + def _get_tunnel_termination_points(self): + """ + Getter method for tunnel_termination_points, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay/tunnel_termination_points (container) + + YANG Description: Underlay TTPs desired for this link. + """ + return self.__tunnel_termination_points + + def _set_tunnel_termination_points(self, v, load=False): + """ + Setter method for tunnel_termination_points, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay/tunnel_termination_points (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_tunnel_termination_points is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tunnel_termination_points() directly. + + YANG Description: Underlay TTPs desired for this link. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=tunnel_termination_points.tunnel_termination_points, is_container='container', yang_name="tunnel-termination-points", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tunnel_termination_points must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=tunnel_termination_points.tunnel_termination_points, is_container='container', yang_name="tunnel-termination-points", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__tunnel_termination_points = t + if hasattr(self, '_set'): + self._set() + + def _unset_tunnel_termination_points(self): + self.__tunnel_termination_points = YANGDynClass(base=tunnel_termination_points.tunnel_termination_points, is_container='container', yang_name="tunnel-termination-points", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_tunnels(self): + """ + Getter method for tunnels, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay/tunnels (container) + + YANG Description: Underlay TE tunnels supporting this TE link. + """ + return self.__tunnels + + def _set_tunnels(self, v, load=False): + """ + Setter method for tunnels, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay/tunnels (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_tunnels is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tunnels() directly. + + YANG Description: Underlay TE tunnels supporting this TE link. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=tunnels.tunnels, is_container='container', yang_name="tunnels", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tunnels must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=tunnels.tunnels, is_container='container', yang_name="tunnels", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__tunnels = t + if hasattr(self, '_set'): + self._set() + + def _unset_tunnels(self): + self.__tunnels = YANGDynClass(base=tunnels.tunnels, is_container='container', yang_name="tunnels", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + enabled = __builtin__.property(_get_enabled, _set_enabled) + primary_path = __builtin__.property(_get_primary_path, _set_primary_path) + backup_path = __builtin__.property(_get_backup_path, _set_backup_path) + protection_type = __builtin__.property(_get_protection_type, _set_protection_type) + tunnel_termination_points = __builtin__.property(_get_tunnel_termination_points, _set_tunnel_termination_points) + tunnels = __builtin__.property(_get_tunnels, _set_tunnels) + + + _pyangbind_elements = OrderedDict([('enabled', enabled), ('primary_path', primary_path), ('backup_path', backup_path), ('protection_type', protection_type), ('tunnel_termination_points', tunnel_termination_points), ('tunnels', tunnels), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/underlay/backup_path/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/underlay/backup_path/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..6e430aedb3678a19f425b9df6afd510c0a5a40eb --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/underlay/backup_path/__init__.py @@ -0,0 +1,207 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 path_element +class backup_path(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/link/te/te-link-attributes/underlay/backup-path. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: A list of backup service paths on the underlay topology that +protect the underlay primary path. If the primary path is +not protected, the list contains zero elements. If the +primary path is protected, the list contains one or more +elements. + """ + __slots__ = ('_path_helper', '_extmethods', '__index','__network_ref','__path_element',) + + _yang_name = 'backup-path' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _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), is_leaf=True, yang_name="index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + self.__network_ref = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="network-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=True) + self.__path_element = YANGDynClass(base=YANGListType("path_element_id",path_element.path_element, yang_name="path-element", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='path-element-id', extensions=None), is_container='list', yang_name="path-element", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-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 ['networks', 'network', 'link', 'te', 'te-link-attributes', 'underlay', 'backup-path'] + + def _get_index(self): + """ + Getter method for index, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay/backup_path/index (uint32) + + YANG Description: A sequence number to identify a backup path. + """ + return self.__index + + def _set_index(self, v, load=False): + """ + Setter method for index, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay/backup_path/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: A sequence number to identify a backup path. + """ + 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=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', 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), is_leaf=True, yang_name="index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', 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), is_leaf=True, yang_name="index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + + + def _get_network_ref(self): + """ + Getter method for network_ref, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay/backup_path/network_ref (leafref) + + YANG Description: Used to reference a network -- for example, an underlay +network. + """ + return self.__network_ref + + def _set_network_ref(self, v, load=False): + """ + Setter method for network_ref, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay/backup_path/network_ref (leafref) + If this variable is read-only (config: false) in the + source YANG file, then _set_network_ref is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_network_ref() directly. + + YANG Description: Used to reference a network -- for example, an underlay +network. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="network-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """network_ref must be of a type compatible with leafref""", + 'defined-type': "leafref", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="network-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=True)""", + }) + + self.__network_ref = t + if hasattr(self, '_set'): + self._set() + + def _unset_network_ref(self): + self.__network_ref = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="network-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=True) + + + def _get_path_element(self): + """ + Getter method for path_element, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay/backup_path/path_element (list) + + YANG Description: A list of path elements describing the backup service +path. + """ + return self.__path_element + + def _set_path_element(self, v, load=False): + """ + Setter method for path_element, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay/backup_path/path_element (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_element is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_element() directly. + + YANG Description: A list of path elements describing the backup service +path. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("path_element_id",path_element.path_element, yang_name="path-element", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='path-element-id', extensions=None), is_container='list', yang_name="path-element", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_element must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("path_element_id",path_element.path_element, yang_name="path-element", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='path-element-id', extensions=None), is_container='list', yang_name="path-element", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True)""", + }) + + self.__path_element = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_element(self): + self.__path_element = YANGDynClass(base=YANGListType("path_element_id",path_element.path_element, yang_name="path-element", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='path-element-id', extensions=None), is_container='list', yang_name="path-element", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + + index = __builtin__.property(_get_index, _set_index) + network_ref = __builtin__.property(_get_network_ref, _set_network_ref) + path_element = __builtin__.property(_get_path_element, _set_path_element) + + + _pyangbind_elements = OrderedDict([('index', index), ('network_ref', network_ref), ('path_element', path_element), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/underlay/backup_path/path_element/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/underlay/backup_path/path_element/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..aca211807fc5946c59ac378a1fe43764cf342f48 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/underlay/backup_path/path_element/__init__.py @@ -0,0 +1,321 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 numbered_node_hop +from . import numbered_link_hop +from . import unnumbered_link_hop +from . import as_number_hop +from . import label_hop +class path_element(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/link/te/te-link-attributes/underlay/backup-path/path-element. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: A list of path elements describing the backup service +path. + """ + __slots__ = ('_path_helper', '_extmethods', '__path_element_id','__numbered_node_hop','__numbered_link_hop','__unnumbered_link_hop','__as_number_hop','__label_hop',) + + _yang_name = 'path-element' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__path_element_id = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="path-element-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + self.__numbered_node_hop = YANGDynClass(base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__numbered_link_hop = YANGDynClass(base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__unnumbered_link_hop = YANGDynClass(base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__as_number_hop = YANGDynClass(base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__label_hop = YANGDynClass(base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-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 ['networks', 'network', 'link', 'te', 'te-link-attributes', 'underlay', 'backup-path', 'path-element'] + + def _get_path_element_id(self): + """ + Getter method for path_element_id, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay/backup_path/path_element/path_element_id (uint32) + + YANG Description: To identify the element in a path. + """ + return self.__path_element_id + + def _set_path_element_id(self, v, load=False): + """ + Setter method for path_element_id, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay/backup_path/path_element/path_element_id (uint32) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_element_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_element_id() directly. + + YANG Description: To identify the element in a path. + """ + 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=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="path-element-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_element_id 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="path-element-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True)""", + }) + + self.__path_element_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_element_id(self): + self.__path_element_id = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="path-element-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + + + def _get_numbered_node_hop(self): + """ + Getter method for numbered_node_hop, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay/backup_path/path_element/numbered_node_hop (container) + + YANG Description: Numbered node route hop. + """ + return self.__numbered_node_hop + + def _set_numbered_node_hop(self, v, load=False): + """ + Setter method for numbered_node_hop, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay/backup_path/path_element/numbered_node_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_numbered_node_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_numbered_node_hop() directly. + + YANG Description: Numbered node route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """numbered_node_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__numbered_node_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_numbered_node_hop(self): + self.__numbered_node_hop = YANGDynClass(base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_numbered_link_hop(self): + """ + Getter method for numbered_link_hop, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay/backup_path/path_element/numbered_link_hop (container) + + YANG Description: Numbered link explicit route hop. + """ + return self.__numbered_link_hop + + def _set_numbered_link_hop(self, v, load=False): + """ + Setter method for numbered_link_hop, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay/backup_path/path_element/numbered_link_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_numbered_link_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_numbered_link_hop() directly. + + YANG Description: Numbered link explicit route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """numbered_link_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__numbered_link_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_numbered_link_hop(self): + self.__numbered_link_hop = YANGDynClass(base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_unnumbered_link_hop(self): + """ + Getter method for unnumbered_link_hop, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay/backup_path/path_element/unnumbered_link_hop (container) + + YANG Description: Unnumbered link explicit route hop. + """ + return self.__unnumbered_link_hop + + def _set_unnumbered_link_hop(self, v, load=False): + """ + Setter method for unnumbered_link_hop, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay/backup_path/path_element/unnumbered_link_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_unnumbered_link_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_unnumbered_link_hop() directly. + + YANG Description: Unnumbered link explicit route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """unnumbered_link_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__unnumbered_link_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_unnumbered_link_hop(self): + self.__unnumbered_link_hop = YANGDynClass(base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_as_number_hop(self): + """ + Getter method for as_number_hop, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay/backup_path/path_element/as_number_hop (container) + + YANG Description: AS explicit route hop. + """ + return self.__as_number_hop + + def _set_as_number_hop(self, v, load=False): + """ + Setter method for as_number_hop, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay/backup_path/path_element/as_number_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_as_number_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_as_number_hop() directly. + + YANG Description: AS explicit route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """as_number_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__as_number_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_as_number_hop(self): + self.__as_number_hop = YANGDynClass(base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_label_hop(self): + """ + Getter method for label_hop, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay/backup_path/path_element/label_hop (container) + + YANG Description: Label hop type. + """ + return self.__label_hop + + def _set_label_hop(self, v, load=False): + """ + Setter method for label_hop, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay/backup_path/path_element/label_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_label_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_label_hop() directly. + + YANG Description: Label hop type. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """label_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__label_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_label_hop(self): + self.__label_hop = YANGDynClass(base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + path_element_id = __builtin__.property(_get_path_element_id, _set_path_element_id) + numbered_node_hop = __builtin__.property(_get_numbered_node_hop, _set_numbered_node_hop) + numbered_link_hop = __builtin__.property(_get_numbered_link_hop, _set_numbered_link_hop) + unnumbered_link_hop = __builtin__.property(_get_unnumbered_link_hop, _set_unnumbered_link_hop) + as_number_hop = __builtin__.property(_get_as_number_hop, _set_as_number_hop) + label_hop = __builtin__.property(_get_label_hop, _set_label_hop) + + __choices__ = {'type': {'numbered-node-hop': ['numbered_node_hop'], 'numbered-link-hop': ['numbered_link_hop'], 'unnumbered-link-hop': ['unnumbered_link_hop'], 'as-number': ['as_number_hop'], 'label': ['label_hop']}} + _pyangbind_elements = OrderedDict([('path_element_id', path_element_id), ('numbered_node_hop', numbered_node_hop), ('numbered_link_hop', numbered_link_hop), ('unnumbered_link_hop', unnumbered_link_hop), ('as_number_hop', as_number_hop), ('label_hop', label_hop), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/underlay/backup_path/path_element/as_number_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/underlay/backup_path/path_element/as_number_hop/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..3613095739ab1dda42e1ee56bfd2410e73111288 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/underlay/backup_path/path_element/as_number_hop/__init__.py @@ -0,0 +1,154 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 as_number_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/link/te/te-link-attributes/underlay/backup-path/path-element/as-number-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: AS explicit route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__as_number','__hop_type',) + + _yang_name = 'as-number-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__as_number = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=True) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', 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 ['networks', 'network', 'link', 'te', 'te-link-attributes', 'underlay', 'backup-path', 'path-element', 'as-number-hop'] + + def _get_as_number(self): + """ + Getter method for as_number, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay/backup_path/path_element/as_number_hop/as_number (inet:as-number) + + YANG Description: The Autonomous System (AS) number. + """ + return self.__as_number + + def _set_as_number(self, v, load=False): + """ + Setter method for as_number, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay/backup_path/path_element/as_number_hop/as_number (inet:as-number) + If this variable is read-only (config: false) in the + source YANG file, then _set_as_number is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_as_number() directly. + + YANG Description: The Autonomous System (AS) number. + """ + 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="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """as_number must be of a type compatible with inet:as-number""", + 'defined-type': "inet:as-number", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=True)""", + }) + + self.__as_number = t + if hasattr(self, '_set'): + self._set() + + def _unset_as_number(self): + self.__as_number = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=True) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay/backup_path/path_element/as_number_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay/backup_path/path_element/as_number_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + 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={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + + as_number = __builtin__.property(_get_as_number, _set_as_number) + hop_type = __builtin__.property(_get_hop_type, _set_hop_type) + + __choices__ = {'type': {'as-number': ['as_number', 'hop_type']}} + _pyangbind_elements = OrderedDict([('as_number', as_number), ('hop_type', hop_type), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/underlay/backup_path/path_element/label_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/underlay/backup_path/path_element/label_hop/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..b9ec35dbe9b20e8c7925632ccb72415340368201 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/underlay/backup_path/path_element/label_hop/__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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 te_label +class label_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/link/te/te-link-attributes/underlay/backup-path/path-element/label-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Label hop type. + """ + __slots__ = ('_path_helper', '_extmethods', '__te_label',) + + _yang_name = 'label-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__te_label = YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-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 ['networks', 'network', 'link', 'te', 'te-link-attributes', 'underlay', 'backup-path', 'path-element', 'label-hop'] + + def _get_te_label(self): + """ + Getter method for te_label, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay/backup_path/path_element/label_hop/te_label (container) + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + return self.__te_label + + def _set_te_label(self, v, load=False): + """ + Setter method for te_label, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay/backup_path/path_element/label_hop/te_label (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_te_label is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_te_label() directly. + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """te_label must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__te_label = t + if hasattr(self, '_set'): + self._set() + + def _unset_te_label(self): + self.__te_label = YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + te_label = __builtin__.property(_get_te_label, _set_te_label) + + __choices__ = {'type': {'label': ['te_label']}} + _pyangbind_elements = OrderedDict([('te_label', te_label), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/underlay/backup_path/path_element/label_hop/te_label/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/underlay/backup_path/path_element/label_hop/te_label/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..4e91ab131548adfa142ddf87e34ce02d3a89638c --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/underlay/backup_path/path_element/label_hop/te_label/__init__.py @@ -0,0 +1,234 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 otn +class te_label(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/link/te/te-link-attributes/underlay/backup-path/path-element/label-hop/te-label. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + __slots__ = ('_path_helper', '_extmethods', '__generic','__otn','__vlanid','__direction',) + + _yang_name = 'te-label' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__generic = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True) + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + self.__vlanid = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True) + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', 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 ['networks', 'network', 'link', 'te', 'te-link-attributes', 'underlay', 'backup-path', 'path-element', 'label-hop', 'te-label'] + + def _get_generic(self): + """ + Getter method for generic, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay/backup_path/path_element/label_hop/te_label/generic (rt-types:generalized-label) + + YANG Description: TE label specified in a generic format. + """ + return self.__generic + + def _set_generic(self, v, load=False): + """ + Setter method for generic, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay/backup_path/path_element/label_hop/te_label/generic (rt-types:generalized-label) + If this variable is read-only (config: false) in the + source YANG file, then _set_generic is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_generic() directly. + + YANG Description: TE label specified in a generic format. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """generic must be of a type compatible with rt-types:generalized-label""", + 'defined-type': "rt-types:generalized-label", + 'generated-type': """YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True)""", + }) + + self.__generic = t + if hasattr(self, '_set'): + self._set() + + def _unset_generic(self): + self.__generic = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True) + + + def _get_otn(self): + """ + Getter method for otn, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay/backup_path/path_element/label_hop/te_label/otn (container) + + YANG Description: Label hop for OTN. + """ + return self.__otn + + def _set_otn(self, v, load=False): + """ + Setter method for otn, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay/backup_path/path_element/label_hop/te_label/otn (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_otn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_otn() directly. + + YANG Description: Label hop for OTN. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """otn must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True)""", + }) + + self.__otn = t + if hasattr(self, '_set'): + self._set() + + def _unset_otn(self): + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + + + def _get_vlanid(self): + """ + Getter method for vlanid, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay/backup_path/path_element/label_hop/te_label/vlanid (etht-types:vlanid) + + YANG Description: VLAN tag id. + """ + return self.__vlanid + + def _set_vlanid(self, v, load=False): + """ + Setter method for vlanid, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay/backup_path/path_element/label_hop/te_label/vlanid (etht-types:vlanid) + If this variable is read-only (config: false) in the + source YANG file, then _set_vlanid is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_vlanid() directly. + + YANG Description: VLAN tag id. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """vlanid must be of a type compatible with etht-types:vlanid""", + 'defined-type': "etht-types:vlanid", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True)""", + }) + + self.__vlanid = t + if hasattr(self, '_set'): + self._set() + + def _unset_vlanid(self): + self.__vlanid = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True) + + + def _get_direction(self): + """ + Getter method for direction, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay/backup_path/path_element/label_hop/te_label/direction (te-label-direction) + + YANG Description: Label direction. + """ + return self.__direction + + def _set_direction(self, v, load=False): + """ + Setter method for direction, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay/backup_path/path_element/label_hop/te_label/direction (te-label-direction) + If this variable is read-only (config: false) in the + source YANG file, then _set_direction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_direction() directly. + + YANG Description: Label direction. + """ + 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={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """direction must be of a type compatible with te-label-direction""", + 'defined-type': "ietf-te-topology:te-label-direction", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=True)""", + }) + + self.__direction = t + if hasattr(self, '_set'): + self._set() + + def _unset_direction(self): + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=True) + + generic = __builtin__.property(_get_generic, _set_generic) + otn = __builtin__.property(_get_otn, _set_otn) + vlanid = __builtin__.property(_get_vlanid, _set_vlanid) + direction = __builtin__.property(_get_direction, _set_direction) + + __choices__ = {'technology': {'generic': ['generic'], 'otn': ['otn'], 'eth': ['vlanid']}, 'type': {'label': ['direction']}} + _pyangbind_elements = OrderedDict([('generic', generic), ('otn', otn), ('vlanid', vlanid), ('direction', direction), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/underlay/backup_path/path_element/label_hop/te_label/otn/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/underlay/backup_path/path_element/label_hop/te_label/otn/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..fb2e02afeb4d26363c3e3b4ca5b38d9ea1bb831e --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/underlay/backup_path/path_element/label_hop/te_label/otn/__init__.py @@ -0,0 +1,209 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 otn(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/link/te/te-link-attributes/underlay/backup-path/path-element/label-hop/te-label/otn. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Label hop for OTN. + """ + __slots__ = ('_path_helper', '_extmethods', '__tpn','__tsg','__ts_list',) + + _yang_name = 'otn' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__tpn = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True) + self.__tsg = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + self.__ts_list = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-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 ['networks', 'network', 'link', 'te', 'te-link-attributes', 'underlay', 'backup-path', 'path-element', 'label-hop', 'te-label', 'otn'] + + def _get_tpn(self): + """ + Getter method for tpn, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay/backup_path/path_element/label_hop/te_label/otn/tpn (otn-tpn) + + YANG Description: Tributary Port Number (TPN). + """ + return self.__tpn + + def _set_tpn(self, v, load=False): + """ + Setter method for tpn, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay/backup_path/path_element/label_hop/te_label/otn/tpn (otn-tpn) + If this variable is read-only (config: false) in the + source YANG file, then _set_tpn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tpn() directly. + + YANG Description: Tributary Port Number (TPN). + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tpn must be of a type compatible with otn-tpn""", + 'defined-type': "ietf-otn-topology:otn-tpn", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True)""", + }) + + self.__tpn = t + if hasattr(self, '_set'): + self._set() + + def _unset_tpn(self): + self.__tpn = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True) + + + def _get_tsg(self): + """ + Getter method for tsg, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay/backup_path/path_element/label_hop/te_label/otn/tsg (identityref) + + YANG Description: Tributary Slot Granularity (TSG). + """ + return self.__tsg + + def _set_tsg(self, v, load=False): + """ + Setter method for tsg, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay/backup_path/path_element/label_hop/te_label/otn/tsg (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_tsg is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tsg() directly. + + YANG Description: Tributary Slot Granularity (TSG). + """ + 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={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tsg must be of a type compatible with identityref""", + 'defined-type': "ietf-otn-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True)""", + }) + + self.__tsg = t + if hasattr(self, '_set'): + self._set() + + def _unset_tsg(self): + self.__tsg = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + + + def _get_ts_list(self): + """ + Getter method for ts_list, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay/backup_path/path_element/label_hop/te_label/otn/ts_list (string) + + YANG Description: A list of available Tributary Slots (TS) ranging + + + + +between 1 and 4095. If multiple values or +ranges are given, they all MUST be disjoint +and MUST be in ascending order. +For example 1-20,25,50-1000. + """ + return self.__ts_list + + def _set_ts_list(self, v, load=False): + """ + Setter method for ts_list, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay/backup_path/path_element/label_hop/te_label/otn/ts_list (string) + If this variable is read-only (config: false) in the + source YANG file, then _set_ts_list is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_ts_list() directly. + + YANG Description: A list of available Tributary Slots (TS) ranging + + + + +between 1 and 4095. If multiple values or +ranges are given, they all MUST be disjoint +and MUST be in ascending order. +For example 1-20,25,50-1000. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='string', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """ts_list must be of a type compatible with string""", + 'defined-type': "string", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='string', is_config=True)""", + }) + + self.__ts_list = t + if hasattr(self, '_set'): + self._set() + + def _unset_ts_list(self): + self.__ts_list = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='string', is_config=True) + + tpn = __builtin__.property(_get_tpn, _set_tpn) + tsg = __builtin__.property(_get_tsg, _set_tsg) + ts_list = __builtin__.property(_get_ts_list, _set_ts_list) + + __choices__ = {'technology': {'otn': ['tpn', 'tsg', 'ts_list']}} + _pyangbind_elements = OrderedDict([('tpn', tpn), ('tsg', tsg), ('ts_list', ts_list), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/underlay/backup_path/path_element/numbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/underlay/backup_path/path_element/numbered_link_hop/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..06923495db9b049ac32d9f799c0b0793b7583a39 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/underlay/backup_path/path_element/numbered_link_hop/__init__.py @@ -0,0 +1,193 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 numbered_link_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/link/te/te-link-attributes/underlay/backup-path/path-element/numbered-link-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Numbered link explicit route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__link_tp_id','__hop_type','__direction',) + + _yang_name = 'numbered-link-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', 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 ['networks', 'network', 'link', 'te', 'te-link-attributes', 'underlay', 'backup-path', 'path-element', 'numbered-link-hop'] + + def _get_link_tp_id(self): + """ + Getter method for link_tp_id, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay/backup_path/path_element/numbered_link_hop/link_tp_id (te-tp-id) + + YANG Description: TE Link Termination Point (LTP) identifier. + """ + return self.__link_tp_id + + def _set_link_tp_id(self, v, load=False): + """ + Setter method for link_tp_id, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay/backup_path/path_element/numbered_link_hop/link_tp_id (te-tp-id) + If this variable is read-only (config: false) in the + source YANG file, then _set_link_tp_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_link_tp_id() directly. + + YANG Description: TE Link Termination Point (LTP) identifier. + """ + 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),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """link_tp_id must be of a type compatible with te-tp-id""", + 'defined-type': "ietf-te-topology:te-tp-id", + 'generated-type': """YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True)""", + }) + + self.__link_tp_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_link_tp_id(self): + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay/backup_path/path_element/numbered_link_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay/backup_path/path_element/numbered_link_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + 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={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + + + def _get_direction(self): + """ + Getter method for direction, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay/backup_path/path_element/numbered_link_hop/direction (te-link-direction) + + YANG Description: Link route object direction. + """ + return self.__direction + + def _set_direction(self, v, load=False): + """ + Setter method for direction, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay/backup_path/path_element/numbered_link_hop/direction (te-link-direction) + If this variable is read-only (config: false) in the + source YANG file, then _set_direction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_direction() directly. + + YANG Description: Link route object direction. + """ + 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={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """direction must be of a type compatible with te-link-direction""", + 'defined-type': "ietf-te-topology:te-link-direction", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True)""", + }) + + self.__direction = t + if hasattr(self, '_set'): + self._set() + + def _unset_direction(self): + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True) + + link_tp_id = __builtin__.property(_get_link_tp_id, _set_link_tp_id) + hop_type = __builtin__.property(_get_hop_type, _set_hop_type) + direction = __builtin__.property(_get_direction, _set_direction) + + __choices__ = {'type': {'numbered-link-hop': ['link_tp_id', 'hop_type', 'direction']}} + _pyangbind_elements = OrderedDict([('link_tp_id', link_tp_id), ('hop_type', hop_type), ('direction', direction), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/underlay/backup_path/path_element/numbered_node_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/underlay/backup_path/path_element/numbered_node_hop/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..24687817713ab1d51b59ca694c621be191e53ea5 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/underlay/backup_path/path_element/numbered_node_hop/__init__.py @@ -0,0 +1,154 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 numbered_node_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/link/te/te-link-attributes/underlay/backup-path/path-element/numbered-node-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Numbered node route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__node_id','__hop_type',) + + _yang_name = 'numbered-node-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', 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 ['networks', 'network', 'link', 'te', 'te-link-attributes', 'underlay', 'backup-path', 'path-element', 'numbered-node-hop'] + + def _get_node_id(self): + """ + Getter method for node_id, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay/backup_path/path_element/numbered_node_hop/node_id (te-node-id) + + YANG Description: The identifier of a node in the TE topology. + """ + return self.__node_id + + def _set_node_id(self, v, load=False): + """ + Setter method for node_id, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay/backup_path/path_element/numbered_node_hop/node_id (te-node-id) + 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. + + YANG Description: The identifier of a node in the TE topology. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """node_id must be of a type compatible with te-node-id""", + 'defined-type': "ietf-te-topology:te-node-id", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True)""", + }) + + self.__node_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_node_id(self): + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay/backup_path/path_element/numbered_node_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay/backup_path/path_element/numbered_node_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + 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={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + + node_id = __builtin__.property(_get_node_id, _set_node_id) + hop_type = __builtin__.property(_get_hop_type, _set_hop_type) + + __choices__ = {'type': {'numbered-node-hop': ['node_id', 'hop_type']}} + _pyangbind_elements = OrderedDict([('node_id', node_id), ('hop_type', hop_type), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/underlay/backup_path/path_element/unnumbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/underlay/backup_path/path_element/unnumbered_link_hop/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..7b040726e4af3bfebb68e9584bd6d60eb9fb5082 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/underlay/backup_path/path_element/unnumbered_link_hop/__init__.py @@ -0,0 +1,236 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 unnumbered_link_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/link/te/te-link-attributes/underlay/backup-path/path-element/unnumbered-link-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Unnumbered link explicit route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__link_tp_id','__node_id','__hop_type','__direction',) + + _yang_name = 'unnumbered-link-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True) + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', 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 ['networks', 'network', 'link', 'te', 'te-link-attributes', 'underlay', 'backup-path', 'path-element', 'unnumbered-link-hop'] + + def _get_link_tp_id(self): + """ + Getter method for link_tp_id, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay/backup_path/path_element/unnumbered_link_hop/link_tp_id (te-tp-id) + + YANG Description: TE LTP identifier. The combination of the TE link ID +and the TE node ID is used to identify an unnumbered +TE link. + """ + return self.__link_tp_id + + def _set_link_tp_id(self, v, load=False): + """ + Setter method for link_tp_id, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay/backup_path/path_element/unnumbered_link_hop/link_tp_id (te-tp-id) + If this variable is read-only (config: false) in the + source YANG file, then _set_link_tp_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_link_tp_id() directly. + + YANG Description: TE LTP identifier. The combination of the TE link ID +and the TE node ID is used to identify an unnumbered +TE link. + """ + 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),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """link_tp_id must be of a type compatible with te-tp-id""", + 'defined-type': "ietf-te-topology:te-tp-id", + 'generated-type': """YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True)""", + }) + + self.__link_tp_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_link_tp_id(self): + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True) + + + def _get_node_id(self): + """ + Getter method for node_id, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay/backup_path/path_element/unnumbered_link_hop/node_id (te-node-id) + + YANG Description: The identifier of a node in the TE topology. + """ + return self.__node_id + + def _set_node_id(self, v, load=False): + """ + Setter method for node_id, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay/backup_path/path_element/unnumbered_link_hop/node_id (te-node-id) + 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. + + YANG Description: The identifier of a node in the TE topology. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """node_id must be of a type compatible with te-node-id""", + 'defined-type': "ietf-te-topology:te-node-id", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True)""", + }) + + self.__node_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_node_id(self): + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay/backup_path/path_element/unnumbered_link_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay/backup_path/path_element/unnumbered_link_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + 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={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + + + def _get_direction(self): + """ + Getter method for direction, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay/backup_path/path_element/unnumbered_link_hop/direction (te-link-direction) + + YANG Description: Link route object direction. + """ + return self.__direction + + def _set_direction(self, v, load=False): + """ + Setter method for direction, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay/backup_path/path_element/unnumbered_link_hop/direction (te-link-direction) + If this variable is read-only (config: false) in the + source YANG file, then _set_direction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_direction() directly. + + YANG Description: Link route object direction. + """ + 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={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """direction must be of a type compatible with te-link-direction""", + 'defined-type': "ietf-te-topology:te-link-direction", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True)""", + }) + + self.__direction = t + if hasattr(self, '_set'): + self._set() + + def _unset_direction(self): + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True) + + link_tp_id = __builtin__.property(_get_link_tp_id, _set_link_tp_id) + node_id = __builtin__.property(_get_node_id, _set_node_id) + hop_type = __builtin__.property(_get_hop_type, _set_hop_type) + direction = __builtin__.property(_get_direction, _set_direction) + + __choices__ = {'type': {'unnumbered-link-hop': ['link_tp_id', 'node_id', 'hop_type', 'direction']}} + _pyangbind_elements = OrderedDict([('link_tp_id', link_tp_id), ('node_id', node_id), ('hop_type', hop_type), ('direction', direction), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/underlay/primary_path/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/underlay/primary_path/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..2cbefb38a259de886eefbd7db230a93ba58a62a7 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/underlay/primary_path/__init__.py @@ -0,0 +1,158 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 path_element +class primary_path(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/link/te/te-link-attributes/underlay/primary-path. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: The service path on the underlay topology that +supports this link. + """ + __slots__ = ('_path_helper', '_extmethods', '__network_ref','__path_element',) + + _yang_name = 'primary-path' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__network_ref = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="network-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=True) + self.__path_element = YANGDynClass(base=YANGListType("path_element_id",path_element.path_element, yang_name="path-element", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='path-element-id', extensions=None), is_container='list', yang_name="path-element", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-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 ['networks', 'network', 'link', 'te', 'te-link-attributes', 'underlay', 'primary-path'] + + def _get_network_ref(self): + """ + Getter method for network_ref, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay/primary_path/network_ref (leafref) + + YANG Description: Used to reference a network -- for example, an underlay +network. + """ + return self.__network_ref + + def _set_network_ref(self, v, load=False): + """ + Setter method for network_ref, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay/primary_path/network_ref (leafref) + If this variable is read-only (config: false) in the + source YANG file, then _set_network_ref is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_network_ref() directly. + + YANG Description: Used to reference a network -- for example, an underlay +network. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="network-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """network_ref must be of a type compatible with leafref""", + 'defined-type': "leafref", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="network-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=True)""", + }) + + self.__network_ref = t + if hasattr(self, '_set'): + self._set() + + def _unset_network_ref(self): + self.__network_ref = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="network-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=True) + + + def _get_path_element(self): + """ + Getter method for path_element, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay/primary_path/path_element (list) + + YANG Description: A list of path elements describing the service path. + """ + return self.__path_element + + def _set_path_element(self, v, load=False): + """ + Setter method for path_element, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay/primary_path/path_element (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_element is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_element() directly. + + YANG Description: A list of path elements describing the service path. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("path_element_id",path_element.path_element, yang_name="path-element", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='path-element-id', extensions=None), is_container='list', yang_name="path-element", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_element must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("path_element_id",path_element.path_element, yang_name="path-element", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='path-element-id', extensions=None), is_container='list', yang_name="path-element", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True)""", + }) + + self.__path_element = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_element(self): + self.__path_element = YANGDynClass(base=YANGListType("path_element_id",path_element.path_element, yang_name="path-element", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='path-element-id', extensions=None), is_container='list', yang_name="path-element", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + + network_ref = __builtin__.property(_get_network_ref, _set_network_ref) + path_element = __builtin__.property(_get_path_element, _set_path_element) + + + _pyangbind_elements = OrderedDict([('network_ref', network_ref), ('path_element', path_element), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/underlay/primary_path/path_element/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/underlay/primary_path/path_element/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..d1f9ba7c64066aca0fc7de0aa7e80f76b731e675 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/underlay/primary_path/path_element/__init__.py @@ -0,0 +1,320 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 numbered_node_hop +from . import numbered_link_hop +from . import unnumbered_link_hop +from . import as_number_hop +from . import label_hop +class path_element(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/link/te/te-link-attributes/underlay/primary-path/path-element. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: A list of path elements describing the service path. + """ + __slots__ = ('_path_helper', '_extmethods', '__path_element_id','__numbered_node_hop','__numbered_link_hop','__unnumbered_link_hop','__as_number_hop','__label_hop',) + + _yang_name = 'path-element' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__path_element_id = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="path-element-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + self.__numbered_node_hop = YANGDynClass(base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__numbered_link_hop = YANGDynClass(base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__unnumbered_link_hop = YANGDynClass(base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__as_number_hop = YANGDynClass(base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__label_hop = YANGDynClass(base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-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 ['networks', 'network', 'link', 'te', 'te-link-attributes', 'underlay', 'primary-path', 'path-element'] + + def _get_path_element_id(self): + """ + Getter method for path_element_id, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay/primary_path/path_element/path_element_id (uint32) + + YANG Description: To identify the element in a path. + """ + return self.__path_element_id + + def _set_path_element_id(self, v, load=False): + """ + Setter method for path_element_id, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay/primary_path/path_element/path_element_id (uint32) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_element_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_element_id() directly. + + YANG Description: To identify the element in a path. + """ + 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=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="path-element-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_element_id 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="path-element-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True)""", + }) + + self.__path_element_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_element_id(self): + self.__path_element_id = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="path-element-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + + + def _get_numbered_node_hop(self): + """ + Getter method for numbered_node_hop, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay/primary_path/path_element/numbered_node_hop (container) + + YANG Description: Numbered node route hop. + """ + return self.__numbered_node_hop + + def _set_numbered_node_hop(self, v, load=False): + """ + Setter method for numbered_node_hop, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay/primary_path/path_element/numbered_node_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_numbered_node_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_numbered_node_hop() directly. + + YANG Description: Numbered node route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """numbered_node_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__numbered_node_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_numbered_node_hop(self): + self.__numbered_node_hop = YANGDynClass(base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_numbered_link_hop(self): + """ + Getter method for numbered_link_hop, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay/primary_path/path_element/numbered_link_hop (container) + + YANG Description: Numbered link explicit route hop. + """ + return self.__numbered_link_hop + + def _set_numbered_link_hop(self, v, load=False): + """ + Setter method for numbered_link_hop, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay/primary_path/path_element/numbered_link_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_numbered_link_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_numbered_link_hop() directly. + + YANG Description: Numbered link explicit route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """numbered_link_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__numbered_link_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_numbered_link_hop(self): + self.__numbered_link_hop = YANGDynClass(base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_unnumbered_link_hop(self): + """ + Getter method for unnumbered_link_hop, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay/primary_path/path_element/unnumbered_link_hop (container) + + YANG Description: Unnumbered link explicit route hop. + """ + return self.__unnumbered_link_hop + + def _set_unnumbered_link_hop(self, v, load=False): + """ + Setter method for unnumbered_link_hop, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay/primary_path/path_element/unnumbered_link_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_unnumbered_link_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_unnumbered_link_hop() directly. + + YANG Description: Unnumbered link explicit route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """unnumbered_link_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__unnumbered_link_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_unnumbered_link_hop(self): + self.__unnumbered_link_hop = YANGDynClass(base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_as_number_hop(self): + """ + Getter method for as_number_hop, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay/primary_path/path_element/as_number_hop (container) + + YANG Description: AS explicit route hop. + """ + return self.__as_number_hop + + def _set_as_number_hop(self, v, load=False): + """ + Setter method for as_number_hop, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay/primary_path/path_element/as_number_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_as_number_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_as_number_hop() directly. + + YANG Description: AS explicit route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """as_number_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__as_number_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_as_number_hop(self): + self.__as_number_hop = YANGDynClass(base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_label_hop(self): + """ + Getter method for label_hop, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay/primary_path/path_element/label_hop (container) + + YANG Description: Label hop type. + """ + return self.__label_hop + + def _set_label_hop(self, v, load=False): + """ + Setter method for label_hop, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay/primary_path/path_element/label_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_label_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_label_hop() directly. + + YANG Description: Label hop type. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """label_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__label_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_label_hop(self): + self.__label_hop = YANGDynClass(base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + path_element_id = __builtin__.property(_get_path_element_id, _set_path_element_id) + numbered_node_hop = __builtin__.property(_get_numbered_node_hop, _set_numbered_node_hop) + numbered_link_hop = __builtin__.property(_get_numbered_link_hop, _set_numbered_link_hop) + unnumbered_link_hop = __builtin__.property(_get_unnumbered_link_hop, _set_unnumbered_link_hop) + as_number_hop = __builtin__.property(_get_as_number_hop, _set_as_number_hop) + label_hop = __builtin__.property(_get_label_hop, _set_label_hop) + + __choices__ = {'type': {'numbered-node-hop': ['numbered_node_hop'], 'numbered-link-hop': ['numbered_link_hop'], 'unnumbered-link-hop': ['unnumbered_link_hop'], 'as-number': ['as_number_hop'], 'label': ['label_hop']}} + _pyangbind_elements = OrderedDict([('path_element_id', path_element_id), ('numbered_node_hop', numbered_node_hop), ('numbered_link_hop', numbered_link_hop), ('unnumbered_link_hop', unnumbered_link_hop), ('as_number_hop', as_number_hop), ('label_hop', label_hop), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/underlay/primary_path/path_element/as_number_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/underlay/primary_path/path_element/as_number_hop/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..be898e3aae7fc97049bd45468088608d37ceac84 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/underlay/primary_path/path_element/as_number_hop/__init__.py @@ -0,0 +1,154 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 as_number_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/link/te/te-link-attributes/underlay/primary-path/path-element/as-number-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: AS explicit route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__as_number','__hop_type',) + + _yang_name = 'as-number-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__as_number = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=True) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', 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 ['networks', 'network', 'link', 'te', 'te-link-attributes', 'underlay', 'primary-path', 'path-element', 'as-number-hop'] + + def _get_as_number(self): + """ + Getter method for as_number, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay/primary_path/path_element/as_number_hop/as_number (inet:as-number) + + YANG Description: The Autonomous System (AS) number. + """ + return self.__as_number + + def _set_as_number(self, v, load=False): + """ + Setter method for as_number, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay/primary_path/path_element/as_number_hop/as_number (inet:as-number) + If this variable is read-only (config: false) in the + source YANG file, then _set_as_number is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_as_number() directly. + + YANG Description: The Autonomous System (AS) number. + """ + 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="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """as_number must be of a type compatible with inet:as-number""", + 'defined-type': "inet:as-number", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=True)""", + }) + + self.__as_number = t + if hasattr(self, '_set'): + self._set() + + def _unset_as_number(self): + self.__as_number = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=True) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay/primary_path/path_element/as_number_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay/primary_path/path_element/as_number_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + 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={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + + as_number = __builtin__.property(_get_as_number, _set_as_number) + hop_type = __builtin__.property(_get_hop_type, _set_hop_type) + + __choices__ = {'type': {'as-number': ['as_number', 'hop_type']}} + _pyangbind_elements = OrderedDict([('as_number', as_number), ('hop_type', hop_type), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/underlay/primary_path/path_element/label_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/underlay/primary_path/path_element/label_hop/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..46d140192c590c9c1df54170cec68de0382e2c2f --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/underlay/primary_path/path_element/label_hop/__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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 te_label +class label_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/link/te/te-link-attributes/underlay/primary-path/path-element/label-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Label hop type. + """ + __slots__ = ('_path_helper', '_extmethods', '__te_label',) + + _yang_name = 'label-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__te_label = YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-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 ['networks', 'network', 'link', 'te', 'te-link-attributes', 'underlay', 'primary-path', 'path-element', 'label-hop'] + + def _get_te_label(self): + """ + Getter method for te_label, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay/primary_path/path_element/label_hop/te_label (container) + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + return self.__te_label + + def _set_te_label(self, v, load=False): + """ + Setter method for te_label, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay/primary_path/path_element/label_hop/te_label (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_te_label is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_te_label() directly. + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """te_label must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__te_label = t + if hasattr(self, '_set'): + self._set() + + def _unset_te_label(self): + self.__te_label = YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + te_label = __builtin__.property(_get_te_label, _set_te_label) + + __choices__ = {'type': {'label': ['te_label']}} + _pyangbind_elements = OrderedDict([('te_label', te_label), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/underlay/primary_path/path_element/label_hop/te_label/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/underlay/primary_path/path_element/label_hop/te_label/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..3aee6e73b3049dd3deaff121618e076d718c68fc --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/underlay/primary_path/path_element/label_hop/te_label/__init__.py @@ -0,0 +1,234 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 otn +class te_label(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/link/te/te-link-attributes/underlay/primary-path/path-element/label-hop/te-label. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + __slots__ = ('_path_helper', '_extmethods', '__generic','__otn','__vlanid','__direction',) + + _yang_name = 'te-label' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__generic = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True) + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + self.__vlanid = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True) + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', 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 ['networks', 'network', 'link', 'te', 'te-link-attributes', 'underlay', 'primary-path', 'path-element', 'label-hop', 'te-label'] + + def _get_generic(self): + """ + Getter method for generic, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay/primary_path/path_element/label_hop/te_label/generic (rt-types:generalized-label) + + YANG Description: TE label specified in a generic format. + """ + return self.__generic + + def _set_generic(self, v, load=False): + """ + Setter method for generic, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay/primary_path/path_element/label_hop/te_label/generic (rt-types:generalized-label) + If this variable is read-only (config: false) in the + source YANG file, then _set_generic is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_generic() directly. + + YANG Description: TE label specified in a generic format. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """generic must be of a type compatible with rt-types:generalized-label""", + 'defined-type': "rt-types:generalized-label", + 'generated-type': """YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True)""", + }) + + self.__generic = t + if hasattr(self, '_set'): + self._set() + + def _unset_generic(self): + self.__generic = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True) + + + def _get_otn(self): + """ + Getter method for otn, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay/primary_path/path_element/label_hop/te_label/otn (container) + + YANG Description: Label hop for OTN. + """ + return self.__otn + + def _set_otn(self, v, load=False): + """ + Setter method for otn, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay/primary_path/path_element/label_hop/te_label/otn (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_otn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_otn() directly. + + YANG Description: Label hop for OTN. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """otn must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True)""", + }) + + self.__otn = t + if hasattr(self, '_set'): + self._set() + + def _unset_otn(self): + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + + + def _get_vlanid(self): + """ + Getter method for vlanid, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay/primary_path/path_element/label_hop/te_label/vlanid (etht-types:vlanid) + + YANG Description: VLAN tag id. + """ + return self.__vlanid + + def _set_vlanid(self, v, load=False): + """ + Setter method for vlanid, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay/primary_path/path_element/label_hop/te_label/vlanid (etht-types:vlanid) + If this variable is read-only (config: false) in the + source YANG file, then _set_vlanid is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_vlanid() directly. + + YANG Description: VLAN tag id. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """vlanid must be of a type compatible with etht-types:vlanid""", + 'defined-type': "etht-types:vlanid", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True)""", + }) + + self.__vlanid = t + if hasattr(self, '_set'): + self._set() + + def _unset_vlanid(self): + self.__vlanid = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True) + + + def _get_direction(self): + """ + Getter method for direction, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay/primary_path/path_element/label_hop/te_label/direction (te-label-direction) + + YANG Description: Label direction. + """ + return self.__direction + + def _set_direction(self, v, load=False): + """ + Setter method for direction, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay/primary_path/path_element/label_hop/te_label/direction (te-label-direction) + If this variable is read-only (config: false) in the + source YANG file, then _set_direction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_direction() directly. + + YANG Description: Label direction. + """ + 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={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """direction must be of a type compatible with te-label-direction""", + 'defined-type': "ietf-te-topology:te-label-direction", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=True)""", + }) + + self.__direction = t + if hasattr(self, '_set'): + self._set() + + def _unset_direction(self): + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=True) + + generic = __builtin__.property(_get_generic, _set_generic) + otn = __builtin__.property(_get_otn, _set_otn) + vlanid = __builtin__.property(_get_vlanid, _set_vlanid) + direction = __builtin__.property(_get_direction, _set_direction) + + __choices__ = {'technology': {'generic': ['generic'], 'otn': ['otn'], 'eth': ['vlanid']}, 'type': {'label': ['direction']}} + _pyangbind_elements = OrderedDict([('generic', generic), ('otn', otn), ('vlanid', vlanid), ('direction', direction), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/underlay/primary_path/path_element/label_hop/te_label/otn/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/underlay/primary_path/path_element/label_hop/te_label/otn/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..30e2c479a2ba0bd1dcf916efa4f39705b62ed1b1 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/underlay/primary_path/path_element/label_hop/te_label/otn/__init__.py @@ -0,0 +1,209 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 otn(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/link/te/te-link-attributes/underlay/primary-path/path-element/label-hop/te-label/otn. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Label hop for OTN. + """ + __slots__ = ('_path_helper', '_extmethods', '__tpn','__tsg','__ts_list',) + + _yang_name = 'otn' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__tpn = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True) + self.__tsg = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + self.__ts_list = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-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 ['networks', 'network', 'link', 'te', 'te-link-attributes', 'underlay', 'primary-path', 'path-element', 'label-hop', 'te-label', 'otn'] + + def _get_tpn(self): + """ + Getter method for tpn, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay/primary_path/path_element/label_hop/te_label/otn/tpn (otn-tpn) + + YANG Description: Tributary Port Number (TPN). + """ + return self.__tpn + + def _set_tpn(self, v, load=False): + """ + Setter method for tpn, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay/primary_path/path_element/label_hop/te_label/otn/tpn (otn-tpn) + If this variable is read-only (config: false) in the + source YANG file, then _set_tpn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tpn() directly. + + YANG Description: Tributary Port Number (TPN). + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tpn must be of a type compatible with otn-tpn""", + 'defined-type': "ietf-otn-topology:otn-tpn", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True)""", + }) + + self.__tpn = t + if hasattr(self, '_set'): + self._set() + + def _unset_tpn(self): + self.__tpn = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True) + + + def _get_tsg(self): + """ + Getter method for tsg, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay/primary_path/path_element/label_hop/te_label/otn/tsg (identityref) + + YANG Description: Tributary Slot Granularity (TSG). + """ + return self.__tsg + + def _set_tsg(self, v, load=False): + """ + Setter method for tsg, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay/primary_path/path_element/label_hop/te_label/otn/tsg (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_tsg is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tsg() directly. + + YANG Description: Tributary Slot Granularity (TSG). + """ + 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={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tsg must be of a type compatible with identityref""", + 'defined-type': "ietf-otn-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True)""", + }) + + self.__tsg = t + if hasattr(self, '_set'): + self._set() + + def _unset_tsg(self): + self.__tsg = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + + + def _get_ts_list(self): + """ + Getter method for ts_list, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay/primary_path/path_element/label_hop/te_label/otn/ts_list (string) + + YANG Description: A list of available Tributary Slots (TS) ranging + + + + +between 1 and 4095. If multiple values or +ranges are given, they all MUST be disjoint +and MUST be in ascending order. +For example 1-20,25,50-1000. + """ + return self.__ts_list + + def _set_ts_list(self, v, load=False): + """ + Setter method for ts_list, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay/primary_path/path_element/label_hop/te_label/otn/ts_list (string) + If this variable is read-only (config: false) in the + source YANG file, then _set_ts_list is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_ts_list() directly. + + YANG Description: A list of available Tributary Slots (TS) ranging + + + + +between 1 and 4095. If multiple values or +ranges are given, they all MUST be disjoint +and MUST be in ascending order. +For example 1-20,25,50-1000. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='string', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """ts_list must be of a type compatible with string""", + 'defined-type': "string", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='string', is_config=True)""", + }) + + self.__ts_list = t + if hasattr(self, '_set'): + self._set() + + def _unset_ts_list(self): + self.__ts_list = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='string', is_config=True) + + tpn = __builtin__.property(_get_tpn, _set_tpn) + tsg = __builtin__.property(_get_tsg, _set_tsg) + ts_list = __builtin__.property(_get_ts_list, _set_ts_list) + + __choices__ = {'technology': {'otn': ['tpn', 'tsg', 'ts_list']}} + _pyangbind_elements = OrderedDict([('tpn', tpn), ('tsg', tsg), ('ts_list', ts_list), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/underlay/primary_path/path_element/numbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/underlay/primary_path/path_element/numbered_link_hop/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..88d8af789152ed19bc3fd9635abaaf57a89e422f --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/underlay/primary_path/path_element/numbered_link_hop/__init__.py @@ -0,0 +1,193 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 numbered_link_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/link/te/te-link-attributes/underlay/primary-path/path-element/numbered-link-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Numbered link explicit route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__link_tp_id','__hop_type','__direction',) + + _yang_name = 'numbered-link-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', 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 ['networks', 'network', 'link', 'te', 'te-link-attributes', 'underlay', 'primary-path', 'path-element', 'numbered-link-hop'] + + def _get_link_tp_id(self): + """ + Getter method for link_tp_id, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay/primary_path/path_element/numbered_link_hop/link_tp_id (te-tp-id) + + YANG Description: TE Link Termination Point (LTP) identifier. + """ + return self.__link_tp_id + + def _set_link_tp_id(self, v, load=False): + """ + Setter method for link_tp_id, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay/primary_path/path_element/numbered_link_hop/link_tp_id (te-tp-id) + If this variable is read-only (config: false) in the + source YANG file, then _set_link_tp_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_link_tp_id() directly. + + YANG Description: TE Link Termination Point (LTP) identifier. + """ + 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),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """link_tp_id must be of a type compatible with te-tp-id""", + 'defined-type': "ietf-te-topology:te-tp-id", + 'generated-type': """YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True)""", + }) + + self.__link_tp_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_link_tp_id(self): + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay/primary_path/path_element/numbered_link_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay/primary_path/path_element/numbered_link_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + 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={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + + + def _get_direction(self): + """ + Getter method for direction, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay/primary_path/path_element/numbered_link_hop/direction (te-link-direction) + + YANG Description: Link route object direction. + """ + return self.__direction + + def _set_direction(self, v, load=False): + """ + Setter method for direction, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay/primary_path/path_element/numbered_link_hop/direction (te-link-direction) + If this variable is read-only (config: false) in the + source YANG file, then _set_direction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_direction() directly. + + YANG Description: Link route object direction. + """ + 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={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """direction must be of a type compatible with te-link-direction""", + 'defined-type': "ietf-te-topology:te-link-direction", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True)""", + }) + + self.__direction = t + if hasattr(self, '_set'): + self._set() + + def _unset_direction(self): + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True) + + link_tp_id = __builtin__.property(_get_link_tp_id, _set_link_tp_id) + hop_type = __builtin__.property(_get_hop_type, _set_hop_type) + direction = __builtin__.property(_get_direction, _set_direction) + + __choices__ = {'type': {'numbered-link-hop': ['link_tp_id', 'hop_type', 'direction']}} + _pyangbind_elements = OrderedDict([('link_tp_id', link_tp_id), ('hop_type', hop_type), ('direction', direction), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/underlay/primary_path/path_element/numbered_node_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/underlay/primary_path/path_element/numbered_node_hop/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..fe386ce02952a8bb2e7192b274a4705c27c4c40d --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/underlay/primary_path/path_element/numbered_node_hop/__init__.py @@ -0,0 +1,154 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 numbered_node_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/link/te/te-link-attributes/underlay/primary-path/path-element/numbered-node-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Numbered node route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__node_id','__hop_type',) + + _yang_name = 'numbered-node-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', 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 ['networks', 'network', 'link', 'te', 'te-link-attributes', 'underlay', 'primary-path', 'path-element', 'numbered-node-hop'] + + def _get_node_id(self): + """ + Getter method for node_id, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay/primary_path/path_element/numbered_node_hop/node_id (te-node-id) + + YANG Description: The identifier of a node in the TE topology. + """ + return self.__node_id + + def _set_node_id(self, v, load=False): + """ + Setter method for node_id, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay/primary_path/path_element/numbered_node_hop/node_id (te-node-id) + 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. + + YANG Description: The identifier of a node in the TE topology. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """node_id must be of a type compatible with te-node-id""", + 'defined-type': "ietf-te-topology:te-node-id", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True)""", + }) + + self.__node_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_node_id(self): + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay/primary_path/path_element/numbered_node_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay/primary_path/path_element/numbered_node_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + 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={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + + node_id = __builtin__.property(_get_node_id, _set_node_id) + hop_type = __builtin__.property(_get_hop_type, _set_hop_type) + + __choices__ = {'type': {'numbered-node-hop': ['node_id', 'hop_type']}} + _pyangbind_elements = OrderedDict([('node_id', node_id), ('hop_type', hop_type), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/underlay/primary_path/path_element/unnumbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/underlay/primary_path/path_element/unnumbered_link_hop/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..130901543218adc5066d8a5d062670d62db66a46 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/underlay/primary_path/path_element/unnumbered_link_hop/__init__.py @@ -0,0 +1,236 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 unnumbered_link_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/link/te/te-link-attributes/underlay/primary-path/path-element/unnumbered-link-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Unnumbered link explicit route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__link_tp_id','__node_id','__hop_type','__direction',) + + _yang_name = 'unnumbered-link-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True) + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', 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 ['networks', 'network', 'link', 'te', 'te-link-attributes', 'underlay', 'primary-path', 'path-element', 'unnumbered-link-hop'] + + def _get_link_tp_id(self): + """ + Getter method for link_tp_id, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay/primary_path/path_element/unnumbered_link_hop/link_tp_id (te-tp-id) + + YANG Description: TE LTP identifier. The combination of the TE link ID +and the TE node ID is used to identify an unnumbered +TE link. + """ + return self.__link_tp_id + + def _set_link_tp_id(self, v, load=False): + """ + Setter method for link_tp_id, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay/primary_path/path_element/unnumbered_link_hop/link_tp_id (te-tp-id) + If this variable is read-only (config: false) in the + source YANG file, then _set_link_tp_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_link_tp_id() directly. + + YANG Description: TE LTP identifier. The combination of the TE link ID +and the TE node ID is used to identify an unnumbered +TE link. + """ + 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),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """link_tp_id must be of a type compatible with te-tp-id""", + 'defined-type': "ietf-te-topology:te-tp-id", + 'generated-type': """YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True)""", + }) + + self.__link_tp_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_link_tp_id(self): + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True) + + + def _get_node_id(self): + """ + Getter method for node_id, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay/primary_path/path_element/unnumbered_link_hop/node_id (te-node-id) + + YANG Description: The identifier of a node in the TE topology. + """ + return self.__node_id + + def _set_node_id(self, v, load=False): + """ + Setter method for node_id, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay/primary_path/path_element/unnumbered_link_hop/node_id (te-node-id) + 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. + + YANG Description: The identifier of a node in the TE topology. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """node_id must be of a type compatible with te-node-id""", + 'defined-type': "ietf-te-topology:te-node-id", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True)""", + }) + + self.__node_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_node_id(self): + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay/primary_path/path_element/unnumbered_link_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay/primary_path/path_element/unnumbered_link_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + 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={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + + + def _get_direction(self): + """ + Getter method for direction, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay/primary_path/path_element/unnumbered_link_hop/direction (te-link-direction) + + YANG Description: Link route object direction. + """ + return self.__direction + + def _set_direction(self, v, load=False): + """ + Setter method for direction, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay/primary_path/path_element/unnumbered_link_hop/direction (te-link-direction) + If this variable is read-only (config: false) in the + source YANG file, then _set_direction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_direction() directly. + + YANG Description: Link route object direction. + """ + 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={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """direction must be of a type compatible with te-link-direction""", + 'defined-type': "ietf-te-topology:te-link-direction", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True)""", + }) + + self.__direction = t + if hasattr(self, '_set'): + self._set() + + def _unset_direction(self): + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True) + + link_tp_id = __builtin__.property(_get_link_tp_id, _set_link_tp_id) + node_id = __builtin__.property(_get_node_id, _set_node_id) + hop_type = __builtin__.property(_get_hop_type, _set_hop_type) + direction = __builtin__.property(_get_direction, _set_direction) + + __choices__ = {'type': {'unnumbered-link-hop': ['link_tp_id', 'node_id', 'hop_type', 'direction']}} + _pyangbind_elements = OrderedDict([('link_tp_id', link_tp_id), ('node_id', node_id), ('hop_type', hop_type), ('direction', direction), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/underlay/tunnel_termination_points/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/underlay/tunnel_termination_points/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..6b516827dcd8b813b46797cba3ac2091dc776515 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/underlay/tunnel_termination_points/__init__.py @@ -0,0 +1,154 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 tunnel_termination_points(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/link/te/te-link-attributes/underlay/tunnel-termination-points. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Underlay TTPs desired for this link. + """ + __slots__ = ('_path_helper', '_extmethods', '__source','__destination',) + + _yang_name = 'tunnel-termination-points' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__source = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="source", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='binary', is_config=True) + self.__destination = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="destination", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='binary', 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 ['networks', 'network', 'link', 'te', 'te-link-attributes', 'underlay', 'tunnel-termination-points'] + + def _get_source(self): + """ + Getter method for source, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay/tunnel_termination_points/source (binary) + + YANG Description: Source TTP identifier. + """ + return self.__source + + def _set_source(self, v, load=False): + """ + Setter method for source, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay/tunnel_termination_points/source (binary) + If this variable is read-only (config: false) in the + source YANG file, then _set_source is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_source() directly. + + YANG Description: Source TTP identifier. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBinary, is_leaf=True, yang_name="source", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='binary', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """source must be of a type compatible with binary""", + 'defined-type': "binary", + 'generated-type': """YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="source", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='binary', is_config=True)""", + }) + + self.__source = t + if hasattr(self, '_set'): + self._set() + + def _unset_source(self): + self.__source = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="source", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='binary', is_config=True) + + + def _get_destination(self): + """ + Getter method for destination, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay/tunnel_termination_points/destination (binary) + + YANG Description: Destination TTP identifier. + """ + return self.__destination + + def _set_destination(self, v, load=False): + """ + Setter method for destination, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay/tunnel_termination_points/destination (binary) + If this variable is read-only (config: false) in the + source YANG file, then _set_destination is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_destination() directly. + + YANG Description: Destination TTP identifier. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBinary, is_leaf=True, yang_name="destination", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='binary', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """destination must be of a type compatible with binary""", + 'defined-type': "binary", + 'generated-type': """YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="destination", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='binary', is_config=True)""", + }) + + self.__destination = t + if hasattr(self, '_set'): + self._set() + + def _unset_destination(self): + self.__destination = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="destination", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='binary', is_config=True) + + source = __builtin__.property(_get_source, _set_source) + destination = __builtin__.property(_get_destination, _set_destination) + + + _pyangbind_elements = OrderedDict([('source', source), ('destination', destination), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/underlay/tunnels/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/underlay/tunnels/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..4402db40ec66aff67c7a0cfc860e603e9990c7b2 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/underlay/tunnels/__init__.py @@ -0,0 +1,167 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 tunnel +class tunnels(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/link/te/te-link-attributes/underlay/tunnels. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Underlay TE tunnels supporting this TE link. + """ + __slots__ = ('_path_helper', '_extmethods', '__sharing','__tunnel',) + + _yang_name = 'tunnels' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__sharing = YANGDynClass(base=YANGBool, default=YANGBool("true"), is_leaf=True, yang_name="sharing", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='boolean', is_config=True) + self.__tunnel = YANGDynClass(base=YANGListType("tunnel_name",tunnel.tunnel, yang_name="tunnel", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='tunnel-name', extensions=None), is_container='list', yang_name="tunnel", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-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 ['networks', 'network', 'link', 'te', 'te-link-attributes', 'underlay', 'tunnels'] + + def _get_sharing(self): + """ + Getter method for sharing, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay/tunnels/sharing (boolean) + + YANG Description: 'true' if the underlay tunnel can be shared with other +TE links; +'false' if the underlay tunnel is dedicated to this +TE link. +This leaf is the default option for all TE tunnels +and may be overridden by the per-TE-tunnel value. + """ + return self.__sharing + + def _set_sharing(self, v, load=False): + """ + Setter method for sharing, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay/tunnels/sharing (boolean) + If this variable is read-only (config: false) in the + source YANG file, then _set_sharing is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_sharing() directly. + + YANG Description: 'true' if the underlay tunnel can be shared with other +TE links; +'false' if the underlay tunnel is dedicated to this +TE link. +This leaf is the default option for all TE tunnels +and may be overridden by the per-TE-tunnel value. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBool, default=YANGBool("true"), is_leaf=True, yang_name="sharing", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='boolean', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """sharing must be of a type compatible with boolean""", + 'defined-type': "boolean", + 'generated-type': """YANGDynClass(base=YANGBool, default=YANGBool("true"), is_leaf=True, yang_name="sharing", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='boolean', is_config=True)""", + }) + + self.__sharing = t + if hasattr(self, '_set'): + self._set() + + def _unset_sharing(self): + self.__sharing = YANGDynClass(base=YANGBool, default=YANGBool("true"), is_leaf=True, yang_name="sharing", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='boolean', is_config=True) + + + def _get_tunnel(self): + """ + Getter method for tunnel, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay/tunnels/tunnel (list) + + YANG Description: Zero, one, or more underlay TE tunnels that support this +TE link. + """ + return self.__tunnel + + def _set_tunnel(self, v, load=False): + """ + Setter method for tunnel, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay/tunnels/tunnel (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_tunnel is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tunnel() directly. + + YANG Description: Zero, one, or more underlay TE tunnels that support this +TE link. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("tunnel_name",tunnel.tunnel, yang_name="tunnel", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='tunnel-name', extensions=None), is_container='list', yang_name="tunnel", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tunnel must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("tunnel_name",tunnel.tunnel, yang_name="tunnel", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='tunnel-name', extensions=None), is_container='list', yang_name="tunnel", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True)""", + }) + + self.__tunnel = t + if hasattr(self, '_set'): + self._set() + + def _unset_tunnel(self): + self.__tunnel = YANGDynClass(base=YANGListType("tunnel_name",tunnel.tunnel, yang_name="tunnel", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='tunnel-name', extensions=None), is_container='list', yang_name="tunnel", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + + sharing = __builtin__.property(_get_sharing, _set_sharing) + tunnel = __builtin__.property(_get_tunnel, _set_tunnel) + + + _pyangbind_elements = OrderedDict([('sharing', sharing), ('tunnel', tunnel), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/underlay/tunnels/tunnel/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/underlay/tunnels/tunnel/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..bfd6fae3f3acb313d064cd6ae1f77fd068e3b838 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/underlay/tunnels/tunnel/__init__.py @@ -0,0 +1,170 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 tunnel(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/link/te/te-link-attributes/underlay/tunnels/tunnel. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Zero, one, or more underlay TE tunnels that support this +TE link. + """ + __slots__ = ('_path_helper', '_extmethods', '__tunnel_name','__sharing',) + + _yang_name = 'tunnel' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__tunnel_name = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="tunnel-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=True) + self.__sharing = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="sharing", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', 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 ['networks', 'network', 'link', 'te', 'te-link-attributes', 'underlay', 'tunnels', 'tunnel'] + + def _get_tunnel_name(self): + """ + Getter method for tunnel_name, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay/tunnels/tunnel/tunnel_name (string) + + YANG Description: A tunnel name uniquely identifies an underlay TE tunnel, +used together with the 'source-node' value for this +link. + """ + return self.__tunnel_name + + def _set_tunnel_name(self, v, load=False): + """ + Setter method for tunnel_name, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay/tunnels/tunnel/tunnel_name (string) + If this variable is read-only (config: false) in the + source YANG file, then _set_tunnel_name is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tunnel_name() directly. + + YANG Description: A tunnel name uniquely identifies an underlay TE tunnel, +used together with the 'source-node' value for this +link. + """ + 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="tunnel-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tunnel_name must be of a type compatible with string""", + 'defined-type': "string", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="tunnel-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=True)""", + }) + + self.__tunnel_name = t + if hasattr(self, '_set'): + self._set() + + def _unset_tunnel_name(self): + self.__tunnel_name = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="tunnel-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=True) + + + def _get_sharing(self): + """ + Getter method for sharing, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay/tunnels/tunnel/sharing (boolean) + + YANG Description: 'true' if the underlay tunnel can be shared with other +TE links; +'false' if the underlay tunnel is dedicated to this +TE link. + """ + return self.__sharing + + def _set_sharing(self, v, load=False): + """ + Setter method for sharing, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay/tunnels/tunnel/sharing (boolean) + If this variable is read-only (config: false) in the + source YANG file, then _set_sharing is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_sharing() directly. + + YANG Description: 'true' if the underlay tunnel can be shared with other +TE links; +'false' if the underlay tunnel is dedicated to this +TE link. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBool, is_leaf=True, yang_name="sharing", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='boolean', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """sharing must be of a type compatible with boolean""", + 'defined-type': "boolean", + 'generated-type': """YANGDynClass(base=YANGBool, is_leaf=True, yang_name="sharing", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='boolean', is_config=True)""", + }) + + self.__sharing = t + if hasattr(self, '_set'): + self._set() + + def _unset_sharing(self): + self.__sharing = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="sharing", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='boolean', is_config=True) + + tunnel_name = __builtin__.property(_get_tunnel_name, _set_tunnel_name) + sharing = __builtin__.property(_get_sharing, _set_sharing) + + + _pyangbind_elements = OrderedDict([('tunnel_name', tunnel_name), ('sharing', sharing), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/unreserved_bandwidth/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/unreserved_bandwidth/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..64b36f07a78fe03bee92be19c211885a3b77c25f --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/unreserved_bandwidth/__init__.py @@ -0,0 +1,163 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 te_bandwidth +class unreserved_bandwidth(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/link/te/te-link-attributes/unreserved-bandwidth. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Unreserved bandwidth for priority levels 0-7. Units are in +bytes per second. + """ + __slots__ = ('_path_helper', '_extmethods', '__priority','__te_bandwidth',) + + _yang_name = 'unreserved-bandwidth' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__priority = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..7']}), is_leaf=True, yang_name="priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint8', is_config=True) + self.__te_bandwidth = YANGDynClass(base=te_bandwidth.te_bandwidth, is_container='container', yang_name="te-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-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 ['networks', 'network', 'link', 'te', 'te-link-attributes', 'unreserved-bandwidth'] + + def _get_priority(self): + """ + Getter method for priority, mapped from YANG variable /networks/network/link/te/te_link_attributes/unreserved_bandwidth/priority (uint8) + + YANG Description: Priority. + """ + return self.__priority + + def _set_priority(self, v, load=False): + """ + Setter method for priority, mapped from YANG variable /networks/network/link/te/te_link_attributes/unreserved_bandwidth/priority (uint8) + If this variable is read-only (config: false) in the + source YANG file, then _set_priority is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_priority() directly. + + YANG Description: Priority. + """ + 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=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..7']}), is_leaf=True, yang_name="priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint8', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """priority must be of a type compatible with uint8""", + 'defined-type': "uint8", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..7']}), is_leaf=True, yang_name="priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint8', is_config=True)""", + }) + + self.__priority = t + if hasattr(self, '_set'): + self._set() + + def _unset_priority(self): + self.__priority = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..7']}), is_leaf=True, yang_name="priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint8', is_config=True) + + + def _get_te_bandwidth(self): + """ + Getter method for te_bandwidth, mapped from YANG variable /networks/network/link/te/te_link_attributes/unreserved_bandwidth/te_bandwidth (container) + + YANG Description: Container that specifies TE bandwidth. The choices +can be augmented for specific data-plane technologies. + """ + return self.__te_bandwidth + + def _set_te_bandwidth(self, v, load=False): + """ + Setter method for te_bandwidth, mapped from YANG variable /networks/network/link/te/te_link_attributes/unreserved_bandwidth/te_bandwidth (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_te_bandwidth is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_te_bandwidth() directly. + + YANG Description: Container that specifies TE bandwidth. The choices +can be augmented for specific data-plane technologies. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=te_bandwidth.te_bandwidth, is_container='container', yang_name="te-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """te_bandwidth must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=te_bandwidth.te_bandwidth, is_container='container', yang_name="te-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__te_bandwidth = t + if hasattr(self, '_set'): + self._set() + + def _unset_te_bandwidth(self): + self.__te_bandwidth = YANGDynClass(base=te_bandwidth.te_bandwidth, is_container='container', yang_name="te-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + priority = __builtin__.property(_get_priority, _set_priority) + te_bandwidth = __builtin__.property(_get_te_bandwidth, _set_te_bandwidth) + + + _pyangbind_elements = OrderedDict([('priority', priority), ('te_bandwidth', te_bandwidth), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/unreserved_bandwidth/te_bandwidth/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/unreserved_bandwidth/te_bandwidth/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..597c65903b26bc8cefae123a64988c0aa4c5cd2e --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/unreserved_bandwidth/te_bandwidth/__init__.py @@ -0,0 +1,195 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 otn +class te_bandwidth(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/link/te/te-link-attributes/unreserved-bandwidth/te-bandwidth. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Container that specifies TE bandwidth. The choices +can be augmented for specific data-plane technologies. + """ + __slots__ = ('_path_helper', '_extmethods', '__generic','__otn','__eth_bandwidth',) + + _yang_name = 'te-bandwidth' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__generic = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+(,(0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+))*'}), is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-bandwidth', is_config=True) + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + self.__eth_bandwidth = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), restriction_dict={'range': ['0..10000000000']}), is_leaf=True, yang_name="eth-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint64', 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 ['networks', 'network', 'link', 'te', 'te-link-attributes', 'unreserved-bandwidth', 'te-bandwidth'] + + def _get_generic(self): + """ + Getter method for generic, mapped from YANG variable /networks/network/link/te/te_link_attributes/unreserved_bandwidth/te_bandwidth/generic (te-bandwidth) + + YANG Description: Bandwidth specified in a generic format. + """ + return self.__generic + + def _set_generic(self, v, load=False): + """ + Setter method for generic, mapped from YANG variable /networks/network/link/te/te_link_attributes/unreserved_bandwidth/te_bandwidth/generic (te-bandwidth) + If this variable is read-only (config: false) in the + source YANG file, then _set_generic is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_generic() directly. + + YANG Description: Bandwidth specified in a generic format. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+(,(0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+))*'}), is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-bandwidth', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """generic must be of a type compatible with te-bandwidth""", + 'defined-type': "ietf-te-topology:te-bandwidth", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+(,(0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+))*'}), is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-bandwidth', is_config=True)""", + }) + + self.__generic = t + if hasattr(self, '_set'): + self._set() + + def _unset_generic(self): + self.__generic = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+(,(0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+))*'}), is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-bandwidth', is_config=True) + + + def _get_otn(self): + """ + Getter method for otn, mapped from YANG variable /networks/network/link/te/te_link_attributes/unreserved_bandwidth/te_bandwidth/otn (container) + + YANG Description: Bandwidth attributes for OTN links + """ + return self.__otn + + def _set_otn(self, v, load=False): + """ + Setter method for otn, mapped from YANG variable /networks/network/link/te/te_link_attributes/unreserved_bandwidth/te_bandwidth/otn (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_otn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_otn() directly. + + YANG Description: Bandwidth attributes for OTN links + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=otn.otn, is_container='container', yang_name="otn", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """otn must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True)""", + }) + + self.__otn = t + if hasattr(self, '_set'): + self._set() + + def _unset_otn(self): + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + + + def _get_eth_bandwidth(self): + """ + Getter method for eth_bandwidth, mapped from YANG variable /networks/network/link/te/te_link_attributes/unreserved_bandwidth/te_bandwidth/eth_bandwidth (uint64) + + YANG Description: Available bandwith value expressed in kilobits per second + """ + return self.__eth_bandwidth + + def _set_eth_bandwidth(self, v, load=False): + """ + Setter method for eth_bandwidth, mapped from YANG variable /networks/network/link/te/te_link_attributes/unreserved_bandwidth/te_bandwidth/eth_bandwidth (uint64) + If this variable is read-only (config: false) in the + source YANG file, then _set_eth_bandwidth is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_eth_bandwidth() directly. + + YANG Description: Available bandwith value expressed in kilobits per second + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), restriction_dict={'range': ['0..10000000000']}), is_leaf=True, yang_name="eth-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint64', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """eth_bandwidth must be of a type compatible with uint64""", + 'defined-type': "uint64", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), restriction_dict={'range': ['0..10000000000']}), is_leaf=True, yang_name="eth-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint64', is_config=True)""", + }) + + self.__eth_bandwidth = t + if hasattr(self, '_set'): + self._set() + + def _unset_eth_bandwidth(self): + self.__eth_bandwidth = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), restriction_dict={'range': ['0..10000000000']}), is_leaf=True, yang_name="eth-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint64', is_config=True) + + generic = __builtin__.property(_get_generic, _set_generic) + otn = __builtin__.property(_get_otn, _set_otn) + eth_bandwidth = __builtin__.property(_get_eth_bandwidth, _set_eth_bandwidth) + + __choices__ = {'technology': {'generic': ['generic']}} + _pyangbind_elements = OrderedDict([('generic', generic), ('otn', otn), ('eth_bandwidth', eth_bandwidth), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/unreserved_bandwidth/te_bandwidth/otn/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/unreserved_bandwidth/te_bandwidth/otn/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..602ca2e1a1aa0bd56135627dc9e3000869e09a9a --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/unreserved_bandwidth/te_bandwidth/otn/__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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 odulist +class otn(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/link/te/te-link-attributes/unreserved-bandwidth/te-bandwidth/otn. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Bandwidth attributes for OTN links + """ + __slots__ = ('_path_helper', '_extmethods', '__odulist',) + + _yang_name = 'otn' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__odulist = YANGDynClass(base=YANGListType("odu_type",odulist.odulist, yang_name="odulist", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='odu-type', extensions=None), is_container='list', yang_name="odulist", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-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 ['networks', 'network', 'link', 'te', 'te-link-attributes', 'unreserved-bandwidth', 'te-bandwidth', 'otn'] + + def _get_odulist(self): + """ + Getter method for odulist, mapped from YANG variable /networks/network/link/te/te_link_attributes/unreserved_bandwidth/te_bandwidth/otn/odulist (list) + + YANG Description: OTN bandwidth definition + """ + return self.__odulist + + def _set_odulist(self, v, load=False): + """ + Setter method for odulist, mapped from YANG variable /networks/network/link/te/te_link_attributes/unreserved_bandwidth/te_bandwidth/otn/odulist (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_odulist is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_odulist() directly. + + YANG Description: OTN bandwidth definition + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("odu_type",odulist.odulist, yang_name="odulist", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='odu-type', extensions=None), is_container='list', yang_name="odulist", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='list', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """odulist must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("odu_type",odulist.odulist, yang_name="odulist", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='odu-type', extensions=None), is_container='list', yang_name="odulist", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='list', is_config=True)""", + }) + + self.__odulist = t + if hasattr(self, '_set'): + self._set() + + def _unset_odulist(self): + self.__odulist = YANGDynClass(base=YANGListType("odu_type",odulist.odulist, yang_name="odulist", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='odu-type', extensions=None), is_container='list', yang_name="odulist", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='list', is_config=True) + + odulist = __builtin__.property(_get_odulist, _set_odulist) + + + _pyangbind_elements = OrderedDict([('odulist', odulist), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/unreserved_bandwidth/te_bandwidth/otn/odulist/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/unreserved_bandwidth/te_bandwidth/otn/odulist/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..94ca139a6b10008b227c4026e74a8f3cff14f421 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/unreserved_bandwidth/te_bandwidth/otn/odulist/__init__.py @@ -0,0 +1,200 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 odulist(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/link/te/te-link-attributes/unreserved-bandwidth/te-bandwidth/otn/odulist. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: OTN bandwidth definition + """ + __slots__ = ('_path_helper', '_extmethods', '__odu_type','__number','__ts_number',) + + _yang_name = 'odulist' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__odu_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="odu-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + self.__number = YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), is_leaf=True, yang_name="number", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', is_config=True) + self.__ts_number = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts-number", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', 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 ['networks', 'network', 'link', 'te', 'te-link-attributes', 'unreserved-bandwidth', 'te-bandwidth', 'otn', 'odulist'] + + def _get_odu_type(self): + """ + Getter method for odu_type, mapped from YANG variable /networks/network/link/te/te_link_attributes/unreserved_bandwidth/te_bandwidth/otn/odulist/odu_type (identityref) + + YANG Description: ODU type + """ + return self.__odu_type + + def _set_odu_type(self, v, load=False): + """ + Setter method for odu_type, mapped from YANG variable /networks/network/link/te/te_link_attributes/unreserved_bandwidth/te_bandwidth/otn/odulist/odu_type (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_odu_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_odu_type() directly. + + YANG Description: ODU type + """ + 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=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="odu-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """odu_type must be of a type compatible with identityref""", + 'defined-type': "ietf-otn-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="odu-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True)""", + }) + + self.__odu_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_odu_type(self): + self.__odu_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="odu-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + + + def _get_number(self): + """ + Getter method for number, mapped from YANG variable /networks/network/link/te/te_link_attributes/unreserved_bandwidth/te_bandwidth/otn/odulist/number (uint16) + + YANG Description: Number of ODUs + """ + return self.__number + + def _set_number(self, v, load=False): + """ + Setter method for number, mapped from YANG variable /networks/network/link/te/te_link_attributes/unreserved_bandwidth/te_bandwidth/otn/odulist/number (uint16) + If this variable is read-only (config: false) in the + source YANG file, then _set_number is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_number() directly. + + YANG Description: Number of ODUs + """ + 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="number", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """number 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="number", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', is_config=True)""", + }) + + self.__number = t + if hasattr(self, '_set'): + self._set() + + def _unset_number(self): + self.__number = YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), is_leaf=True, yang_name="number", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', is_config=True) + + + def _get_ts_number(self): + """ + Getter method for ts_number, mapped from YANG variable /networks/network/link/te/te_link_attributes/unreserved_bandwidth/te_bandwidth/otn/odulist/ts_number (uint16) + + YANG Description: The number of Tributary Slots (TS) that +could be used by all the ODUflex LSPs. + """ + return self.__ts_number + + def _set_ts_number(self, v, load=False): + """ + Setter method for ts_number, mapped from YANG variable /networks/network/link/te/te_link_attributes/unreserved_bandwidth/te_bandwidth/otn/odulist/ts_number (uint16) + If this variable is read-only (config: false) in the + source YANG file, then _set_ts_number is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_ts_number() directly. + + YANG Description: The number of Tributary Slots (TS) that +could be used by all the ODUflex LSPs. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts-number", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """ts_number must be of a type compatible with uint16""", + 'defined-type': "uint16", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts-number", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', is_config=True)""", + }) + + self.__ts_number = t + if hasattr(self, '_set'): + self._set() + + def _unset_ts_number(self): + self.__ts_number = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts-number", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', is_config=True) + + odu_type = __builtin__.property(_get_odu_type, _set_odu_type) + number = __builtin__.property(_get_number, _set_number) + ts_number = __builtin__.property(_get_ts_number, _set_ts_number) + + + _pyangbind_elements = OrderedDict([('odu_type', odu_type), ('number', number), ('ts_number', ts_number), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/underlay/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/underlay/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..f8ac511c0723811b8f63497653bf430e23d9e083 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/underlay/__init__.py @@ -0,0 +1,154 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 underlay(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/link/te/underlay. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: State attributes for the TE link underlay. + """ + __slots__ = ('_path_helper', '_extmethods', '__dynamic','__committed',) + + _yang_name = 'underlay' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__dynamic = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="dynamic", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='boolean', is_config=False) + self.__committed = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="committed", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', 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 ['networks', 'network', 'link', 'te', 'underlay'] + + def _get_dynamic(self): + """ + Getter method for dynamic, mapped from YANG variable /networks/network/link/te/underlay/dynamic (boolean) + + YANG Description: 'true' if the underlay is dynamically created. + """ + return self.__dynamic + + def _set_dynamic(self, v, load=False): + """ + Setter method for dynamic, mapped from YANG variable /networks/network/link/te/underlay/dynamic (boolean) + If this variable is read-only (config: false) in the + source YANG file, then _set_dynamic is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_dynamic() directly. + + YANG Description: 'true' if the underlay is dynamically created. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBool, is_leaf=True, yang_name="dynamic", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='boolean', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """dynamic must be of a type compatible with boolean""", + 'defined-type': "boolean", + 'generated-type': """YANGDynClass(base=YANGBool, is_leaf=True, yang_name="dynamic", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='boolean', is_config=False)""", + }) + + self.__dynamic = t + if hasattr(self, '_set'): + self._set() + + def _unset_dynamic(self): + self.__dynamic = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="dynamic", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='boolean', is_config=False) + + + def _get_committed(self): + """ + Getter method for committed, mapped from YANG variable /networks/network/link/te/underlay/committed (boolean) + + YANG Description: 'true' if the underlay is committed. + """ + return self.__committed + + def _set_committed(self, v, load=False): + """ + Setter method for committed, mapped from YANG variable /networks/network/link/te/underlay/committed (boolean) + 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: 'true' if the underlay is committed. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBool, is_leaf=True, yang_name="committed", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='boolean', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """committed must be of a type compatible with boolean""", + 'defined-type': "boolean", + 'generated-type': """YANGDynClass(base=YANGBool, is_leaf=True, yang_name="committed", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='boolean', is_config=False)""", + }) + + self.__committed = t + if hasattr(self, '_set'): + self._set() + + def _unset_committed(self): + self.__committed = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="committed", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='boolean', is_config=False) + + dynamic = __builtin__.property(_get_dynamic) + committed = __builtin__.property(_get_committed) + + + _pyangbind_elements = OrderedDict([('dynamic', dynamic), ('committed', committed), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/network_types/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/network_types/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..75d12adce980c2efeaecc63888bfefa0d8a212f4 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/network_types/__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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 te_topology +class network_types(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/network-types. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Serves as an augmentation target. +The network type is indicated through corresponding +presence containers augmented into this container. + """ + __slots__ = ('_path_helper', '_extmethods', '__te_topology',) + + _yang_name = 'network-types' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__te_topology = YANGDynClass(base=te_topology.te_topology, is_container='container', yang_name="te-topology", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-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 ['networks', 'network', 'network-types'] + + def _get_te_topology(self): + """ + Getter method for te_topology, mapped from YANG variable /networks/network/network_types/te_topology (container) + + YANG Description: Its presence identifies the TE topology type. + """ + return self.__te_topology + + def _set_te_topology(self, v, load=False): + """ + Setter method for te_topology, mapped from YANG variable /networks/network/network_types/te_topology (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_te_topology is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_te_topology() directly. + + YANG Description: Its presence identifies the TE topology type. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=te_topology.te_topology, is_container='container', yang_name="te-topology", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """te_topology must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=te_topology.te_topology, is_container='container', yang_name="te-topology", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__te_topology = t + if hasattr(self, '_set'): + self._set() + + def _unset_te_topology(self): + self.__te_topology = YANGDynClass(base=te_topology.te_topology, is_container='container', yang_name="te-topology", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + te_topology = __builtin__.property(_get_te_topology, _set_te_topology) + + + _pyangbind_elements = OrderedDict([('te_topology', te_topology), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/network_types/te_topology/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/network_types/te_topology/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..0e986049c1a93b6aa60e414fb7a0127a46e2b2b9 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/network_types/te_topology/__init__.py @@ -0,0 +1,36 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 te_topology(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/network-types/te-topology. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Its presence identifies the TE topology type. + """ + _pyangbind_elements = {} + + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..11a24953959b6adc3fd494341b1e325c665e534c --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/__init__.py @@ -0,0 +1,291 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 supporting_node +from . import termination_point +from . import te +class node(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: The inventory of nodes of this network. + """ + __slots__ = ('_path_helper', '_extmethods', '__node_id','__supporting_node','__termination_point','__te_node_id','__te',) + + _yang_name = 'node' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _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:ietf:params:xml:ns:yang:ietf-network', defining_module='ietf-network', yang_type='node-id', is_config=True) + self.__supporting_node = YANGDynClass(base=YANGListType("network_ref node_ref",supporting_node.supporting_node, yang_name="supporting-node", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='network-ref node-ref', extensions=None), is_container='list', yang_name="supporting-node", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-network', defining_module='ietf-network', yang_type='list', is_config=True) + self.__termination_point = YANGDynClass(base=YANGListType("tp_id",termination_point.termination_point, yang_name="termination-point", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='tp-id', extensions=None), is_container='list', yang_name="termination-point", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-network-topology', defining_module='ietf-network-topology', yang_type='list', is_config=True) + self.__te_node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="te-node-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-types:te-node-id', is_config=True) + self.__te = YANGDynClass(base=te.te, is_container='container', yang_name="te", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-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 ['networks', 'network', 'node'] + + def _get_node_id(self): + """ + Getter method for node_id, mapped from YANG variable /networks/network/node/node_id (node-id) + + YANG Description: Uniquely identifies a node within the containing +network. + """ + return self.__node_id + + def _set_node_id(self, v, load=False): + """ + Setter method for node_id, mapped from YANG variable /networks/network/node/node_id (node-id) + 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. + + YANG Description: Uniquely identifies a node within the containing +network. + """ + 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:ietf:params:xml:ns:yang:ietf-network', defining_module='ietf-network', yang_type='node-id', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """node_id must be of a type compatible with node-id""", + 'defined-type': "ietf-network:node-id", + '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:ietf:params:xml:ns:yang:ietf-network', defining_module='ietf-network', yang_type='node-id', 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:ietf:params:xml:ns:yang:ietf-network', defining_module='ietf-network', yang_type='node-id', is_config=True) + + + def _get_supporting_node(self): + """ + Getter method for supporting_node, mapped from YANG variable /networks/network/node/supporting_node (list) + + YANG Description: Represents another node that is in an underlay network +and that supports this node. Used to represent layering +structure. + """ + return self.__supporting_node + + def _set_supporting_node(self, v, load=False): + """ + Setter method for supporting_node, mapped from YANG variable /networks/network/node/supporting_node (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_supporting_node is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_supporting_node() directly. + + YANG Description: Represents another node that is in an underlay network +and that supports this node. Used to represent layering +structure. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("network_ref node_ref",supporting_node.supporting_node, yang_name="supporting-node", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='network-ref node-ref', extensions=None), is_container='list', yang_name="supporting-node", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-network', defining_module='ietf-network', yang_type='list', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """supporting_node must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("network_ref node_ref",supporting_node.supporting_node, yang_name="supporting-node", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='network-ref node-ref', extensions=None), is_container='list', yang_name="supporting-node", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-network', defining_module='ietf-network', yang_type='list', is_config=True)""", + }) + + self.__supporting_node = t + if hasattr(self, '_set'): + self._set() + + def _unset_supporting_node(self): + self.__supporting_node = YANGDynClass(base=YANGListType("network_ref node_ref",supporting_node.supporting_node, yang_name="supporting-node", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='network-ref node-ref', extensions=None), is_container='list', yang_name="supporting-node", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-network', defining_module='ietf-network', yang_type='list', is_config=True) + + + def _get_termination_point(self): + """ + Getter method for termination_point, mapped from YANG variable /networks/network/node/termination_point (list) + + YANG Description: A termination point can terminate a link. +Depending on the type of topology, a termination point +could, for example, refer to a port or an interface. + """ + return self.__termination_point + + def _set_termination_point(self, v, load=False): + """ + Setter method for termination_point, mapped from YANG variable /networks/network/node/termination_point (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_termination_point is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_termination_point() directly. + + YANG Description: A termination point can terminate a link. +Depending on the type of topology, a termination point +could, for example, refer to a port or an interface. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("tp_id",termination_point.termination_point, yang_name="termination-point", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='tp-id', extensions=None), is_container='list', yang_name="termination-point", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-network-topology', defining_module='ietf-network-topology', yang_type='list', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """termination_point must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("tp_id",termination_point.termination_point, yang_name="termination-point", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='tp-id', extensions=None), is_container='list', yang_name="termination-point", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-network-topology', defining_module='ietf-network-topology', yang_type='list', is_config=True)""", + }) + + self.__termination_point = t + if hasattr(self, '_set'): + self._set() + + def _unset_termination_point(self): + self.__termination_point = YANGDynClass(base=YANGListType("tp_id",termination_point.termination_point, yang_name="termination-point", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='tp-id', extensions=None), is_container='list', yang_name="termination-point", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-network-topology', defining_module='ietf-network-topology', yang_type='list', is_config=True) + + + def _get_te_node_id(self): + """ + Getter method for te_node_id, mapped from YANG variable /networks/network/node/te_node_id (te-types:te-node-id) + + YANG Description: The identifier of a node in the TE topology. +A node is specific to a topology to which it belongs. + """ + return self.__te_node_id + + def _set_te_node_id(self, v, load=False): + """ + Setter method for te_node_id, mapped from YANG variable /networks/network/node/te_node_id (te-types:te-node-id) + If this variable is read-only (config: false) in the + source YANG file, then _set_te_node_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_te_node_id() directly. + + YANG Description: The identifier of a node in the TE topology. +A node is specific to a topology to which it belongs. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="te-node-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-types:te-node-id', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """te_node_id must be of a type compatible with te-types:te-node-id""", + 'defined-type': "te-types:te-node-id", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="te-node-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-types:te-node-id', is_config=True)""", + }) + + self.__te_node_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_te_node_id(self): + self.__te_node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="te-node-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-types:te-node-id', is_config=True) + + + def _get_te(self): + """ + Getter method for te, mapped from YANG variable /networks/network/node/te (container) + + YANG Description: Indicates TE support. + """ + return self.__te + + def _set_te(self, v, load=False): + """ + Setter method for te, mapped from YANG variable /networks/network/node/te (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_te is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_te() directly. + + YANG Description: Indicates TE support. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=te.te, is_container='container', yang_name="te", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """te must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=te.te, is_container='container', yang_name="te", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__te = t + if hasattr(self, '_set'): + self._set() + + def _unset_te(self): + self.__te = YANGDynClass(base=te.te, is_container='container', yang_name="te", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + node_id = __builtin__.property(_get_node_id, _set_node_id) + supporting_node = __builtin__.property(_get_supporting_node, _set_supporting_node) + termination_point = __builtin__.property(_get_termination_point, _set_termination_point) + te_node_id = __builtin__.property(_get_te_node_id, _set_te_node_id) + te = __builtin__.property(_get_te, _set_te) + + + _pyangbind_elements = OrderedDict([('node_id', node_id), ('supporting_node', supporting_node), ('termination_point', termination_point), ('te_node_id', te_node_id), ('te', te), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/supporting_node/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/supporting_node/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..c4cd2fc8eb7a10aa682f77595b9ee0ba29765045 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/supporting_node/__init__.py @@ -0,0 +1,168 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 supporting_node(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/supporting-node. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Represents another node that is in an underlay network +and that supports this node. Used to represent layering +structure. + """ + __slots__ = ('_path_helper', '_extmethods', '__network_ref','__node_ref',) + + _yang_name = 'supporting-node' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__network_ref = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="network-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-network', defining_module='ietf-network', yang_type='leafref', is_config=True) + self.__node_ref = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="node-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-network', defining_module='ietf-network', 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 ['networks', 'network', 'node', 'supporting-node'] + + def _get_network_ref(self): + """ + Getter method for network_ref, mapped from YANG variable /networks/network/node/supporting_node/network_ref (leafref) + + YANG Description: References the underlay network of which the +underlay node is a part. + """ + return self.__network_ref + + def _set_network_ref(self, v, load=False): + """ + Setter method for network_ref, mapped from YANG variable /networks/network/node/supporting_node/network_ref (leafref) + If this variable is read-only (config: false) in the + source YANG file, then _set_network_ref is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_network_ref() directly. + + YANG Description: References the underlay network of which the +underlay node is a part. + """ + 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="network-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-network', defining_module='ietf-network', yang_type='leafref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """network_ref must be of a type compatible with leafref""", + 'defined-type': "leafref", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="network-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-network', defining_module='ietf-network', yang_type='leafref', is_config=True)""", + }) + + self.__network_ref = t + if hasattr(self, '_set'): + self._set() + + def _unset_network_ref(self): + self.__network_ref = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="network-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-network', defining_module='ietf-network', yang_type='leafref', is_config=True) + + + def _get_node_ref(self): + """ + Getter method for node_ref, mapped from YANG variable /networks/network/node/supporting_node/node_ref (leafref) + + YANG Description: References the underlay node itself. + """ + return self.__node_ref + + def _set_node_ref(self, v, load=False): + """ + Setter method for node_ref, mapped from YANG variable /networks/network/node/supporting_node/node_ref (leafref) + If this variable is read-only (config: false) in the + source YANG file, then _set_node_ref is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_node_ref() directly. + + YANG Description: References the underlay node itself. + """ + 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-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-network', defining_module='ietf-network', yang_type='leafref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """node_ref must be of a type compatible with leafref""", + 'defined-type': "leafref", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="node-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-network', defining_module='ietf-network', yang_type='leafref', is_config=True)""", + }) + + self.__node_ref = t + if hasattr(self, '_set'): + self._set() + + def _unset_node_ref(self): + self.__node_ref = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="node-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-network', defining_module='ietf-network', yang_type='leafref', is_config=True) + + network_ref = __builtin__.property(_get_network_ref, _set_network_ref) + node_ref = __builtin__.property(_get_node_ref, _set_node_ref) + + + _pyangbind_elements = OrderedDict([('network_ref', network_ref), ('node_ref', node_ref), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..90adef961b80a55ee2c4a53e302ebef0d76218a7 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/__init__.py @@ -0,0 +1,519 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 te_node_attributes +from . import geolocation +from . import information_source_state +from . import information_source_entry +from . import statistics +from . import tunnel_termination_point +class te(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Indicates TE support. + """ + __slots__ = ('_path_helper', '_extmethods', '__te_node_template','__te_node_attributes','__oper_status','__geolocation','__is_multi_access_dr','__information_source','__information_source_instance','__information_source_state','__information_source_entry','__statistics','__tunnel_termination_point',) + + _yang_name = 'te' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__te_node_template = YANGDynClass(unique=True, base=TypedListType(allowed_type=six.text_type), is_leaf=False, yang_name="te-node-template", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=True) + self.__te_node_attributes = YANGDynClass(base=te_node_attributes.te_node_attributes, is_container='container', yang_name="te-node-attributes", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__oper_status = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'up': {}, 'down': {}, 'testing': {}, 'preparing-maintenance': {}, 'maintenance': {}, 'unknown': {}},), is_leaf=True, yang_name="oper-status", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-types:te-oper-status', is_config=False) + self.__geolocation = YANGDynClass(base=geolocation.geolocation, is_container='container', yang_name="geolocation", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__is_multi_access_dr = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="is-multi-access-dr", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='empty', is_config=False) + self.__information_source = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'unknown': {}, 'locally-configured': {}, 'ospfv2': {}, 'ospfv3': {}, 'isis': {}, 'bgp-ls': {}, 'system-processed': {}, 'other': {}},), is_leaf=True, yang_name="information-source", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-info-source', is_config=False) + self.__information_source_instance = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="information-source-instance", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=False) + self.__information_source_state = YANGDynClass(base=information_source_state.information_source_state, is_container='container', yang_name="information-source-state", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__information_source_entry = YANGDynClass(base=YANGListType("information_source information_source_instance",information_source_entry.information_source_entry, yang_name="information-source-entry", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='information-source information-source-instance', extensions=None), is_container='list', yang_name="information-source-entry", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + self.__statistics = YANGDynClass(base=statistics.statistics, is_container='container', yang_name="statistics", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__tunnel_termination_point = YANGDynClass(base=YANGListType("tunnel_tp_id",tunnel_termination_point.tunnel_termination_point, yang_name="tunnel-termination-point", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='tunnel-tp-id', extensions=None), is_container='list', yang_name="tunnel-termination-point", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-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 ['networks', 'network', 'node', 'te'] + + def _get_te_node_template(self): + """ + Getter method for te_node_template, mapped from YANG variable /networks/network/node/te/te_node_template (leafref) + + YANG Description: The reference to a TE node template. + """ + return self.__te_node_template + + def _set_te_node_template(self, v, load=False): + """ + Setter method for te_node_template, mapped from YANG variable /networks/network/node/te/te_node_template (leafref) + If this variable is read-only (config: false) in the + source YANG file, then _set_te_node_template is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_te_node_template() directly. + + YANG Description: The reference to a TE node template. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,unique=True, base=TypedListType(allowed_type=six.text_type), is_leaf=False, yang_name="te-node-template", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """te_node_template must be of a type compatible with leafref""", + 'defined-type': "leafref", + 'generated-type': """YANGDynClass(unique=True, base=TypedListType(allowed_type=six.text_type), is_leaf=False, yang_name="te-node-template", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=True)""", + }) + + self.__te_node_template = t + if hasattr(self, '_set'): + self._set() + + def _unset_te_node_template(self): + self.__te_node_template = YANGDynClass(unique=True, base=TypedListType(allowed_type=six.text_type), is_leaf=False, yang_name="te-node-template", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=True) + + + def _get_te_node_attributes(self): + """ + Getter method for te_node_attributes, mapped from YANG variable /networks/network/node/te/te_node_attributes (container) + + YANG Description: Contains node attributes in a TE topology. + """ + return self.__te_node_attributes + + def _set_te_node_attributes(self, v, load=False): + """ + Setter method for te_node_attributes, mapped from YANG variable /networks/network/node/te/te_node_attributes (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_te_node_attributes is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_te_node_attributes() directly. + + YANG Description: Contains node attributes in a TE topology. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=te_node_attributes.te_node_attributes, is_container='container', yang_name="te-node-attributes", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """te_node_attributes must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=te_node_attributes.te_node_attributes, is_container='container', yang_name="te-node-attributes", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__te_node_attributes = t + if hasattr(self, '_set'): + self._set() + + def _unset_te_node_attributes(self): + self.__te_node_attributes = YANGDynClass(base=te_node_attributes.te_node_attributes, is_container='container', yang_name="te-node-attributes", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_oper_status(self): + """ + Getter method for oper_status, mapped from YANG variable /networks/network/node/te/oper_status (te-types:te-oper-status) + + YANG Description: The current operational state of the node. + """ + return self.__oper_status + + def _set_oper_status(self, v, load=False): + """ + Setter method for oper_status, mapped from YANG variable /networks/network/node/te/oper_status (te-types:te-oper-status) + 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 node. + """ + 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': {}, 'preparing-maintenance': {}, 'maintenance': {}, 'unknown': {}},), is_leaf=True, yang_name="oper-status", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-types:te-oper-status', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """oper_status must be of a type compatible with te-types:te-oper-status""", + 'defined-type': "te-types:te-oper-status", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'up': {}, 'down': {}, 'testing': {}, 'preparing-maintenance': {}, 'maintenance': {}, 'unknown': {}},), is_leaf=True, yang_name="oper-status", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-types:te-oper-status', 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': {}, 'down': {}, 'testing': {}, 'preparing-maintenance': {}, 'maintenance': {}, 'unknown': {}},), is_leaf=True, yang_name="oper-status", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-types:te-oper-status', is_config=False) + + + def _get_geolocation(self): + """ + Getter method for geolocation, mapped from YANG variable /networks/network/node/te/geolocation (container) + + YANG Description: Contains a GPS location. + """ + return self.__geolocation + + def _set_geolocation(self, v, load=False): + """ + Setter method for geolocation, mapped from YANG variable /networks/network/node/te/geolocation (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_geolocation is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_geolocation() directly. + + YANG Description: Contains a GPS location. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=geolocation.geolocation, is_container='container', yang_name="geolocation", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """geolocation must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=geolocation.geolocation, is_container='container', yang_name="geolocation", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__geolocation = t + if hasattr(self, '_set'): + self._set() + + def _unset_geolocation(self): + self.__geolocation = YANGDynClass(base=geolocation.geolocation, is_container='container', yang_name="geolocation", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_is_multi_access_dr(self): + """ + Getter method for is_multi_access_dr, mapped from YANG variable /networks/network/node/te/is_multi_access_dr (empty) + + YANG Description: The presence of this attribute indicates that this TE node +is a pseudonode elected as a designated router. + """ + return self.__is_multi_access_dr + + def _set_is_multi_access_dr(self, v, load=False): + """ + Setter method for is_multi_access_dr, mapped from YANG variable /networks/network/node/te/is_multi_access_dr (empty) + If this variable is read-only (config: false) in the + source YANG file, then _set_is_multi_access_dr is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_is_multi_access_dr() directly. + + YANG Description: The presence of this attribute indicates that this TE node +is a pseudonode elected as a designated router. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBool, is_leaf=True, yang_name="is-multi-access-dr", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='empty', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """is_multi_access_dr must be of a type compatible with empty""", + 'defined-type': "empty", + 'generated-type': """YANGDynClass(base=YANGBool, is_leaf=True, yang_name="is-multi-access-dr", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='empty', is_config=False)""", + }) + + self.__is_multi_access_dr = t + if hasattr(self, '_set'): + self._set() + + def _unset_is_multi_access_dr(self): + self.__is_multi_access_dr = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="is-multi-access-dr", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='empty', is_config=False) + + + def _get_information_source(self): + """ + Getter method for information_source, mapped from YANG variable /networks/network/node/te/information_source (te-info-source) + + YANG Description: Indicates the type of information source. + """ + return self.__information_source + + def _set_information_source(self, v, load=False): + """ + Setter method for information_source, mapped from YANG variable /networks/network/node/te/information_source (te-info-source) + If this variable is read-only (config: false) in the + source YANG file, then _set_information_source is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_information_source() directly. + + YANG Description: Indicates the type of information source. + """ + 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': {}, 'locally-configured': {}, 'ospfv2': {}, 'ospfv3': {}, 'isis': {}, 'bgp-ls': {}, 'system-processed': {}, 'other': {}},), is_leaf=True, yang_name="information-source", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-info-source', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """information_source must be of a type compatible with te-info-source""", + 'defined-type': "ietf-te-topology:te-info-source", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'unknown': {}, 'locally-configured': {}, 'ospfv2': {}, 'ospfv3': {}, 'isis': {}, 'bgp-ls': {}, 'system-processed': {}, 'other': {}},), is_leaf=True, yang_name="information-source", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-info-source', is_config=False)""", + }) + + self.__information_source = t + if hasattr(self, '_set'): + self._set() + + def _unset_information_source(self): + self.__information_source = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'unknown': {}, 'locally-configured': {}, 'ospfv2': {}, 'ospfv3': {}, 'isis': {}, 'bgp-ls': {}, 'system-processed': {}, 'other': {}},), is_leaf=True, yang_name="information-source", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-info-source', is_config=False) + + + def _get_information_source_instance(self): + """ + Getter method for information_source_instance, mapped from YANG variable /networks/network/node/te/information_source_instance (string) + + YANG Description: The name indicating the instance of the information +source. + """ + return self.__information_source_instance + + def _set_information_source_instance(self, v, load=False): + """ + Setter method for information_source_instance, mapped from YANG variable /networks/network/node/te/information_source_instance (string) + If this variable is read-only (config: false) in the + source YANG file, then _set_information_source_instance is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_information_source_instance() directly. + + YANG Description: The name indicating the instance of the information +source. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="information-source-instance", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """information_source_instance must be of a type compatible with string""", + 'defined-type': "string", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="information-source-instance", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=False)""", + }) + + self.__information_source_instance = t + if hasattr(self, '_set'): + self._set() + + def _unset_information_source_instance(self): + self.__information_source_instance = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="information-source-instance", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=False) + + + def _get_information_source_state(self): + """ + Getter method for information_source_state, mapped from YANG variable /networks/network/node/te/information_source_state (container) + + YANG Description: Contains state attributes related to the information +source. + """ + return self.__information_source_state + + def _set_information_source_state(self, v, load=False): + """ + Setter method for information_source_state, mapped from YANG variable /networks/network/node/te/information_source_state (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_information_source_state is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_information_source_state() directly. + + YANG Description: Contains state attributes related to the information +source. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=information_source_state.information_source_state, is_container='container', yang_name="information-source-state", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """information_source_state must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=information_source_state.information_source_state, is_container='container', yang_name="information-source-state", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__information_source_state = t + if hasattr(self, '_set'): + self._set() + + def _unset_information_source_state(self): + self.__information_source_state = YANGDynClass(base=information_source_state.information_source_state, is_container='container', yang_name="information-source-state", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_information_source_entry(self): + """ + Getter method for information_source_entry, mapped from YANG variable /networks/network/node/te/information_source_entry (list) + + YANG Description: A list of information sources learned, including the source +that is used. + """ + return self.__information_source_entry + + def _set_information_source_entry(self, v, load=False): + """ + Setter method for information_source_entry, mapped from YANG variable /networks/network/node/te/information_source_entry (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_information_source_entry is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_information_source_entry() directly. + + YANG Description: A list of information sources learned, including the source +that is used. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("information_source information_source_instance",information_source_entry.information_source_entry, yang_name="information-source-entry", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='information-source information-source-instance', extensions=None), is_container='list', yang_name="information-source-entry", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """information_source_entry must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("information_source information_source_instance",information_source_entry.information_source_entry, yang_name="information-source-entry", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='information-source information-source-instance', extensions=None), is_container='list', yang_name="information-source-entry", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False)""", + }) + + self.__information_source_entry = t + if hasattr(self, '_set'): + self._set() + + def _unset_information_source_entry(self): + self.__information_source_entry = YANGDynClass(base=YANGListType("information_source information_source_instance",information_source_entry.information_source_entry, yang_name="information-source-entry", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='information-source information-source-instance', extensions=None), is_container='list', yang_name="information-source-entry", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + + + def _get_statistics(self): + """ + Getter method for statistics, mapped from YANG variable /networks/network/node/te/statistics (container) + + YANG Description: Statistics data. + """ + return self.__statistics + + def _set_statistics(self, v, load=False): + """ + Setter method for statistics, mapped from YANG variable /networks/network/node/te/statistics (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_statistics is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_statistics() directly. + + YANG Description: Statistics data. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=statistics.statistics, is_container='container', yang_name="statistics", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """statistics must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=statistics.statistics, is_container='container', yang_name="statistics", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__statistics = t + if hasattr(self, '_set'): + self._set() + + def _unset_statistics(self): + self.__statistics = YANGDynClass(base=statistics.statistics, is_container='container', yang_name="statistics", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_tunnel_termination_point(self): + """ + Getter method for tunnel_termination_point, mapped from YANG variable /networks/network/node/te/tunnel_termination_point (list) + + YANG Description: A termination point can terminate a tunnel. + """ + return self.__tunnel_termination_point + + def _set_tunnel_termination_point(self, v, load=False): + """ + Setter method for tunnel_termination_point, mapped from YANG variable /networks/network/node/te/tunnel_termination_point (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_tunnel_termination_point is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tunnel_termination_point() directly. + + YANG Description: A termination point can terminate a tunnel. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("tunnel_tp_id",tunnel_termination_point.tunnel_termination_point, yang_name="tunnel-termination-point", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='tunnel-tp-id', extensions=None), is_container='list', yang_name="tunnel-termination-point", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tunnel_termination_point must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("tunnel_tp_id",tunnel_termination_point.tunnel_termination_point, yang_name="tunnel-termination-point", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='tunnel-tp-id', extensions=None), is_container='list', yang_name="tunnel-termination-point", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True)""", + }) + + self.__tunnel_termination_point = t + if hasattr(self, '_set'): + self._set() + + def _unset_tunnel_termination_point(self): + self.__tunnel_termination_point = YANGDynClass(base=YANGListType("tunnel_tp_id",tunnel_termination_point.tunnel_termination_point, yang_name="tunnel-termination-point", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='tunnel-tp-id', extensions=None), is_container='list', yang_name="tunnel-termination-point", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + + te_node_template = __builtin__.property(_get_te_node_template, _set_te_node_template) + te_node_attributes = __builtin__.property(_get_te_node_attributes, _set_te_node_attributes) + oper_status = __builtin__.property(_get_oper_status) + geolocation = __builtin__.property(_get_geolocation) + is_multi_access_dr = __builtin__.property(_get_is_multi_access_dr) + information_source = __builtin__.property(_get_information_source) + information_source_instance = __builtin__.property(_get_information_source_instance) + information_source_state = __builtin__.property(_get_information_source_state) + information_source_entry = __builtin__.property(_get_information_source_entry) + statistics = __builtin__.property(_get_statistics) + tunnel_termination_point = __builtin__.property(_get_tunnel_termination_point, _set_tunnel_termination_point) + + + _pyangbind_elements = OrderedDict([('te_node_template', te_node_template), ('te_node_attributes', te_node_attributes), ('oper_status', oper_status), ('geolocation', geolocation), ('is_multi_access_dr', is_multi_access_dr), ('information_source', information_source), ('information_source_instance', information_source_instance), ('information_source_state', information_source_state), ('information_source_entry', information_source_entry), ('statistics', statistics), ('tunnel_termination_point', tunnel_termination_point), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/geolocation/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/geolocation/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..f9e405188bb0b9a5ca59a72e70cf39a1a47338f8 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/geolocation/__init__.py @@ -0,0 +1,193 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 geolocation(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/geolocation. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Contains a GPS location. + """ + __slots__ = ('_path_helper', '_extmethods', '__altitude','__latitude','__longitude',) + + _yang_name = 'geolocation' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__altitude = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['-9223372036854775808..9223372036854775807']}, int_size=64), is_leaf=True, yang_name="altitude", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='int64', is_config=False) + self.__latitude = YANGDynClass(base=RestrictedClassType(base_type=RestrictedPrecisionDecimalType(precision=8), restriction_dict={'range': ['-90..90']}), is_leaf=True, yang_name="latitude", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='geographic-coordinate-degree', is_config=False) + self.__longitude = YANGDynClass(base=RestrictedClassType(base_type=RestrictedPrecisionDecimalType(precision=8), restriction_dict={'range': ['-180..180']}), is_leaf=True, yang_name="longitude", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='geographic-coordinate-degree', 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 ['networks', 'network', 'node', 'te', 'geolocation'] + + def _get_altitude(self): + """ + Getter method for altitude, mapped from YANG variable /networks/network/node/te/geolocation/altitude (int64) + + YANG Description: Distance above sea level. + """ + return self.__altitude + + def _set_altitude(self, v, load=False): + """ + Setter method for altitude, mapped from YANG variable /networks/network/node/te/geolocation/altitude (int64) + If this variable is read-only (config: false) in the + source YANG file, then _set_altitude is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_altitude() directly. + + YANG Description: Distance above sea level. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['-9223372036854775808..9223372036854775807']}, int_size=64), is_leaf=True, yang_name="altitude", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='int64', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """altitude must be of a type compatible with int64""", + 'defined-type': "int64", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['-9223372036854775808..9223372036854775807']}, int_size=64), is_leaf=True, yang_name="altitude", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='int64', is_config=False)""", + }) + + self.__altitude = t + if hasattr(self, '_set'): + self._set() + + def _unset_altitude(self): + self.__altitude = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['-9223372036854775808..9223372036854775807']}, int_size=64), is_leaf=True, yang_name="altitude", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='int64', is_config=False) + + + def _get_latitude(self): + """ + Getter method for latitude, mapped from YANG variable /networks/network/node/te/geolocation/latitude (geographic-coordinate-degree) + + YANG Description: Relative position north or south on the Earth's surface. + """ + return self.__latitude + + def _set_latitude(self, v, load=False): + """ + Setter method for latitude, mapped from YANG variable /networks/network/node/te/geolocation/latitude (geographic-coordinate-degree) + If this variable is read-only (config: false) in the + source YANG file, then _set_latitude is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_latitude() directly. + + YANG Description: Relative position north or south on the Earth's surface. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedPrecisionDecimalType(precision=8), restriction_dict={'range': ['-90..90']}), is_leaf=True, yang_name="latitude", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='geographic-coordinate-degree', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """latitude must be of a type compatible with geographic-coordinate-degree""", + 'defined-type': "ietf-te-topology:geographic-coordinate-degree", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedPrecisionDecimalType(precision=8), restriction_dict={'range': ['-90..90']}), is_leaf=True, yang_name="latitude", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='geographic-coordinate-degree', is_config=False)""", + }) + + self.__latitude = t + if hasattr(self, '_set'): + self._set() + + def _unset_latitude(self): + self.__latitude = YANGDynClass(base=RestrictedClassType(base_type=RestrictedPrecisionDecimalType(precision=8), restriction_dict={'range': ['-90..90']}), is_leaf=True, yang_name="latitude", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='geographic-coordinate-degree', is_config=False) + + + def _get_longitude(self): + """ + Getter method for longitude, mapped from YANG variable /networks/network/node/te/geolocation/longitude (geographic-coordinate-degree) + + YANG Description: Angular distance east or west on the Earth's surface. + """ + return self.__longitude + + def _set_longitude(self, v, load=False): + """ + Setter method for longitude, mapped from YANG variable /networks/network/node/te/geolocation/longitude (geographic-coordinate-degree) + If this variable is read-only (config: false) in the + source YANG file, then _set_longitude is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_longitude() directly. + + YANG Description: Angular distance east or west on the Earth's surface. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedPrecisionDecimalType(precision=8), restriction_dict={'range': ['-180..180']}), is_leaf=True, yang_name="longitude", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='geographic-coordinate-degree', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """longitude must be of a type compatible with geographic-coordinate-degree""", + 'defined-type': "ietf-te-topology:geographic-coordinate-degree", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedPrecisionDecimalType(precision=8), restriction_dict={'range': ['-180..180']}), is_leaf=True, yang_name="longitude", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='geographic-coordinate-degree', is_config=False)""", + }) + + self.__longitude = t + if hasattr(self, '_set'): + self._set() + + def _unset_longitude(self): + self.__longitude = YANGDynClass(base=RestrictedClassType(base_type=RestrictedPrecisionDecimalType(precision=8), restriction_dict={'range': ['-180..180']}), is_leaf=True, yang_name="longitude", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='geographic-coordinate-degree', is_config=False) + + altitude = __builtin__.property(_get_altitude) + latitude = __builtin__.property(_get_latitude) + longitude = __builtin__.property(_get_longitude) + + + _pyangbind_elements = OrderedDict([('altitude', altitude), ('latitude', latitude), ('longitude', longitude), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..5e51769ff90cb32cf778bdfc427c8646cf214dc7 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/__init__.py @@ -0,0 +1,451 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 information_source_state +from . import connectivity_matrices +from . import underlay_topology +class information_source_entry(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: A list of information sources learned, including the source +that is used. + """ + __slots__ = ('_path_helper', '_extmethods', '__information_source','__information_source_instance','__information_source_state','__connectivity_matrices','__domain_id','__is_abstract','__name','__signaling_address','__underlay_topology',) + + _yang_name = 'information-source-entry' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__information_source = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'unknown': {}, 'locally-configured': {}, 'ospfv2': {}, 'ospfv3': {}, 'isis': {}, 'bgp-ls': {}, 'system-processed': {}, 'other': {}},), is_leaf=True, yang_name="information-source", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-info-source', is_config=False) + self.__information_source_instance = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="information-source-instance", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=False) + self.__information_source_state = YANGDynClass(base=information_source_state.information_source_state, is_container='container', yang_name="information-source-state", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__connectivity_matrices = YANGDynClass(base=connectivity_matrices.connectivity_matrices, is_container='container', yang_name="connectivity-matrices", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__domain_id = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="domain-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=False) + self.__is_abstract = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="is-abstract", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='empty', 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='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=False) + self.__signaling_address = YANGDynClass(unique=True, base=TypedListType(allowed_type=[RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),]), is_leaf=False, yang_name="signaling-address", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:ip-address', is_config=False) + self.__underlay_topology = YANGDynClass(base=underlay_topology.underlay_topology, is_container='container', yang_name="underlay-topology", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', 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 ['networks', 'network', 'node', 'te', 'information-source-entry'] + + def _get_information_source(self): + """ + Getter method for information_source, mapped from YANG variable /networks/network/node/te/information_source_entry/information_source (te-info-source) + + YANG Description: Indicates the type of information source. + """ + return self.__information_source + + def _set_information_source(self, v, load=False): + """ + Setter method for information_source, mapped from YANG variable /networks/network/node/te/information_source_entry/information_source (te-info-source) + If this variable is read-only (config: false) in the + source YANG file, then _set_information_source is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_information_source() directly. + + YANG Description: Indicates the type of information source. + """ + 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=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'unknown': {}, 'locally-configured': {}, 'ospfv2': {}, 'ospfv3': {}, 'isis': {}, 'bgp-ls': {}, 'system-processed': {}, 'other': {}},), is_leaf=True, yang_name="information-source", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-info-source', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """information_source must be of a type compatible with te-info-source""", + 'defined-type': "ietf-te-topology:te-info-source", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'unknown': {}, 'locally-configured': {}, 'ospfv2': {}, 'ospfv3': {}, 'isis': {}, 'bgp-ls': {}, 'system-processed': {}, 'other': {}},), is_leaf=True, yang_name="information-source", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-info-source', is_config=False)""", + }) + + self.__information_source = t + if hasattr(self, '_set'): + self._set() + + def _unset_information_source(self): + self.__information_source = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'unknown': {}, 'locally-configured': {}, 'ospfv2': {}, 'ospfv3': {}, 'isis': {}, 'bgp-ls': {}, 'system-processed': {}, 'other': {}},), is_leaf=True, yang_name="information-source", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-info-source', is_config=False) + + + def _get_information_source_instance(self): + """ + Getter method for information_source_instance, mapped from YANG variable /networks/network/node/te/information_source_entry/information_source_instance (string) + + YANG Description: The name indicating the instance of the information +source. + """ + return self.__information_source_instance + + def _set_information_source_instance(self, v, load=False): + """ + Setter method for information_source_instance, mapped from YANG variable /networks/network/node/te/information_source_entry/information_source_instance (string) + If this variable is read-only (config: false) in the + source YANG file, then _set_information_source_instance is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_information_source_instance() directly. + + YANG Description: The name indicating the instance of the information +source. + """ + 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="information-source-instance", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """information_source_instance must be of a type compatible with string""", + 'defined-type': "string", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="information-source-instance", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=False)""", + }) + + self.__information_source_instance = t + if hasattr(self, '_set'): + self._set() + + def _unset_information_source_instance(self): + self.__information_source_instance = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="information-source-instance", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=False) + + + def _get_information_source_state(self): + """ + Getter method for information_source_state, mapped from YANG variable /networks/network/node/te/information_source_entry/information_source_state (container) + + YANG Description: Contains state attributes related to the information +source. + """ + return self.__information_source_state + + def _set_information_source_state(self, v, load=False): + """ + Setter method for information_source_state, mapped from YANG variable /networks/network/node/te/information_source_entry/information_source_state (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_information_source_state is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_information_source_state() directly. + + YANG Description: Contains state attributes related to the information +source. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=information_source_state.information_source_state, is_container='container', yang_name="information-source-state", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """information_source_state must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=information_source_state.information_source_state, is_container='container', yang_name="information-source-state", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__information_source_state = t + if hasattr(self, '_set'): + self._set() + + def _unset_information_source_state(self): + self.__information_source_state = YANGDynClass(base=information_source_state.information_source_state, is_container='container', yang_name="information-source-state", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_connectivity_matrices(self): + """ + Getter method for connectivity_matrices, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices (container) + + YANG Description: Contains a connectivity matrix on a TE node. + """ + return self.__connectivity_matrices + + def _set_connectivity_matrices(self, v, load=False): + """ + Setter method for connectivity_matrices, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_connectivity_matrices is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_connectivity_matrices() directly. + + YANG Description: Contains a connectivity matrix on a TE node. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=connectivity_matrices.connectivity_matrices, is_container='container', yang_name="connectivity-matrices", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """connectivity_matrices must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=connectivity_matrices.connectivity_matrices, is_container='container', yang_name="connectivity-matrices", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__connectivity_matrices = t + if hasattr(self, '_set'): + self._set() + + def _unset_connectivity_matrices(self): + self.__connectivity_matrices = YANGDynClass(base=connectivity_matrices.connectivity_matrices, is_container='container', yang_name="connectivity-matrices", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_domain_id(self): + """ + Getter method for domain_id, mapped from YANG variable /networks/network/node/te/information_source_entry/domain_id (uint32) + + YANG Description: Identifies the domain to which this node belongs. +This attribute is used to support inter-domain links. + """ + return self.__domain_id + + def _set_domain_id(self, v, load=False): + """ + Setter method for domain_id, mapped from YANG variable /networks/network/node/te/information_source_entry/domain_id (uint32) + If this variable is read-only (config: false) in the + source YANG file, then _set_domain_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_domain_id() directly. + + YANG Description: Identifies the domain to which this node belongs. +This attribute is used to support inter-domain links. + """ + 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="domain-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """domain_id 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="domain-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=False)""", + }) + + self.__domain_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_domain_id(self): + self.__domain_id = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="domain-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=False) + + + def _get_is_abstract(self): + """ + Getter method for is_abstract, mapped from YANG variable /networks/network/node/te/information_source_entry/is_abstract (empty) + + YANG Description: Present if the node is abstract; not present if the node +is actual. + """ + return self.__is_abstract + + def _set_is_abstract(self, v, load=False): + """ + Setter method for is_abstract, mapped from YANG variable /networks/network/node/te/information_source_entry/is_abstract (empty) + If this variable is read-only (config: false) in the + source YANG file, then _set_is_abstract is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_is_abstract() directly. + + YANG Description: Present if the node is abstract; not present if the node +is actual. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBool, is_leaf=True, yang_name="is-abstract", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='empty', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """is_abstract must be of a type compatible with empty""", + 'defined-type': "empty", + 'generated-type': """YANGDynClass(base=YANGBool, is_leaf=True, yang_name="is-abstract", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='empty', is_config=False)""", + }) + + self.__is_abstract = t + if hasattr(self, '_set'): + self._set() + + def _unset_is_abstract(self): + self.__is_abstract = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="is-abstract", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='empty', is_config=False) + + + def _get_name(self): + """ + Getter method for name, mapped from YANG variable /networks/network/node/te/information_source_entry/name (string) + + YANG Description: Node name. + """ + return self.__name + + def _set_name(self, v, load=False): + """ + Setter method for name, mapped from YANG variable /networks/network/node/te/information_source_entry/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: Node name. + """ + 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='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', 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='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', 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='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=False) + + + def _get_signaling_address(self): + """ + Getter method for signaling_address, mapped from YANG variable /networks/network/node/te/information_source_entry/signaling_address (inet:ip-address) + + YANG Description: The node's signaling address. + """ + return self.__signaling_address + + def _set_signaling_address(self, v, load=False): + """ + Setter method for signaling_address, mapped from YANG variable /networks/network/node/te/information_source_entry/signaling_address (inet:ip-address) + If this variable is read-only (config: false) in the + source YANG file, then _set_signaling_address is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_signaling_address() directly. + + YANG Description: The node's signaling address. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,unique=True, base=TypedListType(allowed_type=[RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),]), is_leaf=False, yang_name="signaling-address", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:ip-address', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """signaling_address must be of a type compatible with inet:ip-address""", + 'defined-type': "inet:ip-address", + 'generated-type': """YANGDynClass(unique=True, base=TypedListType(allowed_type=[RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),]), is_leaf=False, yang_name="signaling-address", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:ip-address', is_config=False)""", + }) + + self.__signaling_address = t + if hasattr(self, '_set'): + self._set() + + def _unset_signaling_address(self): + self.__signaling_address = YANGDynClass(unique=True, base=TypedListType(allowed_type=[RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),]), is_leaf=False, yang_name="signaling-address", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:ip-address', is_config=False) + + + def _get_underlay_topology(self): + """ + Getter method for underlay_topology, mapped from YANG variable /networks/network/node/te/information_source_entry/underlay_topology (container) + + YANG Description: When an abstract node encapsulates a topology, the +attributes in this container point to said topology. + """ + return self.__underlay_topology + + def _set_underlay_topology(self, v, load=False): + """ + Setter method for underlay_topology, mapped from YANG variable /networks/network/node/te/information_source_entry/underlay_topology (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_underlay_topology is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_underlay_topology() directly. + + YANG Description: When an abstract node encapsulates a topology, the +attributes in this container point to said topology. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=underlay_topology.underlay_topology, is_container='container', yang_name="underlay-topology", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """underlay_topology must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=underlay_topology.underlay_topology, is_container='container', yang_name="underlay-topology", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__underlay_topology = t + if hasattr(self, '_set'): + self._set() + + def _unset_underlay_topology(self): + self.__underlay_topology = YANGDynClass(base=underlay_topology.underlay_topology, is_container='container', yang_name="underlay-topology", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + information_source = __builtin__.property(_get_information_source) + information_source_instance = __builtin__.property(_get_information_source_instance) + information_source_state = __builtin__.property(_get_information_source_state) + connectivity_matrices = __builtin__.property(_get_connectivity_matrices) + domain_id = __builtin__.property(_get_domain_id) + is_abstract = __builtin__.property(_get_is_abstract) + name = __builtin__.property(_get_name) + signaling_address = __builtin__.property(_get_signaling_address) + underlay_topology = __builtin__.property(_get_underlay_topology) + + + _pyangbind_elements = OrderedDict([('information_source', information_source), ('information_source_instance', information_source_instance), ('information_source_state', information_source_state), ('connectivity_matrices', connectivity_matrices), ('domain_id', domain_id), ('is_abstract', is_abstract), ('name', name), ('signaling_address', signaling_address), ('underlay_topology', underlay_topology), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..a773758ba44ded62fa976a1b512ca27ca0ac49bb --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/__init__.py @@ -0,0 +1,412 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 label_restrictions +from . import underlay +from . import path_constraints +from . import optimizations +from . import path_properties +from . import connectivity_matrix +class connectivity_matrices(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Contains a connectivity matrix on a TE node. + """ + __slots__ = ('_path_helper', '_extmethods', '__number_of_entries','__label_restrictions','__is_allowed','__underlay','__path_constraints','__optimizations','__path_properties','__connectivity_matrix',) + + _yang_name = 'connectivity-matrices' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__number_of_entries = YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), is_leaf=True, yang_name="number-of-entries", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint16', is_config=False) + self.__label_restrictions = YANGDynClass(base=label_restrictions.label_restrictions, is_container='container', yang_name="label-restrictions", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__is_allowed = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="is-allowed", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='boolean', is_config=False) + self.__underlay = YANGDynClass(base=underlay.underlay, is_container='container', yang_name="underlay", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__path_constraints = YANGDynClass(base=path_constraints.path_constraints, is_container='container', yang_name="path-constraints", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__optimizations = YANGDynClass(base=optimizations.optimizations, is_container='container', yang_name="optimizations", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__path_properties = YANGDynClass(base=path_properties.path_properties, is_container='container', yang_name="path-properties", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__connectivity_matrix = YANGDynClass(base=YANGListType("id",connectivity_matrix.connectivity_matrix, yang_name="connectivity-matrix", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='id', extensions=None), is_container='list', yang_name="connectivity-matrix", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', 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 ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices'] + + def _get_number_of_entries(self): + """ + Getter method for number_of_entries, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/number_of_entries (uint16) + + YANG Description: The number of connectivity matrix entries. +If this number is specified in the configuration request, +the number is the requested number of entries, which may +not all be listed in the list; +if this number is reported in the state data, +the number is the current number of operational entries. + """ + return self.__number_of_entries + + def _set_number_of_entries(self, v, load=False): + """ + Setter method for number_of_entries, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/number_of_entries (uint16) + If this variable is read-only (config: false) in the + source YANG file, then _set_number_of_entries is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_number_of_entries() directly. + + YANG Description: The number of connectivity matrix entries. +If this number is specified in the configuration request, +the number is the requested number of entries, which may +not all be listed in the list; +if this number is reported in the state data, +the number is the current number of operational entries. + """ + 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="number-of-entries", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint16', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """number_of_entries 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="number-of-entries", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint16', is_config=False)""", + }) + + self.__number_of_entries = t + if hasattr(self, '_set'): + self._set() + + def _unset_number_of_entries(self): + self.__number_of_entries = YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), is_leaf=True, yang_name="number-of-entries", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint16', is_config=False) + + + def _get_label_restrictions(self): + """ + Getter method for label_restrictions, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions (container) + + YANG Description: The label restrictions container. + """ + return self.__label_restrictions + + def _set_label_restrictions(self, v, load=False): + """ + Setter method for label_restrictions, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_label_restrictions is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_label_restrictions() directly. + + YANG Description: The label restrictions container. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=label_restrictions.label_restrictions, is_container='container', yang_name="label-restrictions", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """label_restrictions must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=label_restrictions.label_restrictions, is_container='container', yang_name="label-restrictions", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__label_restrictions = t + if hasattr(self, '_set'): + self._set() + + def _unset_label_restrictions(self): + self.__label_restrictions = YANGDynClass(base=label_restrictions.label_restrictions, is_container='container', yang_name="label-restrictions", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_is_allowed(self): + """ + Getter method for is_allowed, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/is_allowed (boolean) + + YANG Description: 'true' - switching is allowed; +'false' - switching is disallowed. + """ + return self.__is_allowed + + def _set_is_allowed(self, v, load=False): + """ + Setter method for is_allowed, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/is_allowed (boolean) + If this variable is read-only (config: false) in the + source YANG file, then _set_is_allowed is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_is_allowed() directly. + + YANG Description: 'true' - switching is allowed; +'false' - switching is disallowed. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBool, is_leaf=True, yang_name="is-allowed", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='boolean', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """is_allowed must be of a type compatible with boolean""", + 'defined-type': "boolean", + 'generated-type': """YANGDynClass(base=YANGBool, is_leaf=True, yang_name="is-allowed", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='boolean', is_config=False)""", + }) + + self.__is_allowed = t + if hasattr(self, '_set'): + self._set() + + def _unset_is_allowed(self): + self.__is_allowed = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="is-allowed", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='boolean', is_config=False) + + + def _get_underlay(self): + """ + Getter method for underlay, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay (container) + + YANG Description: Attributes of the TE link underlay. + """ + return self.__underlay + + def _set_underlay(self, v, load=False): + """ + Setter method for underlay, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_underlay is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_underlay() directly. + + YANG Description: Attributes of the TE link underlay. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=underlay.underlay, is_container='container', yang_name="underlay", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """underlay must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=underlay.underlay, is_container='container', yang_name="underlay", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__underlay = t + if hasattr(self, '_set'): + self._set() + + def _unset_underlay(self): + self.__underlay = YANGDynClass(base=underlay.underlay, is_container='container', yang_name="underlay", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_path_constraints(self): + """ + Getter method for path_constraints, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints (container) + + YANG Description: TE named path constraints container. + """ + return self.__path_constraints + + def _set_path_constraints(self, v, load=False): + """ + Setter method for path_constraints, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_constraints is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_constraints() directly. + + YANG Description: TE named path constraints container. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=path_constraints.path_constraints, is_container='container', yang_name="path-constraints", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_constraints must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=path_constraints.path_constraints, is_container='container', yang_name="path-constraints", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__path_constraints = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_constraints(self): + self.__path_constraints = YANGDynClass(base=path_constraints.path_constraints, is_container='container', yang_name="path-constraints", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_optimizations(self): + """ + Getter method for optimizations, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/optimizations (container) + + YANG Description: The objective function container that includes +attributes to impose when computing a TE path. + """ + return self.__optimizations + + def _set_optimizations(self, v, load=False): + """ + Setter method for optimizations, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/optimizations (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_optimizations is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_optimizations() directly. + + YANG Description: The objective function container that includes +attributes to impose when computing a TE path. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=optimizations.optimizations, is_container='container', yang_name="optimizations", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """optimizations must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=optimizations.optimizations, is_container='container', yang_name="optimizations", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__optimizations = t + if hasattr(self, '_set'): + self._set() + + def _unset_optimizations(self): + self.__optimizations = YANGDynClass(base=optimizations.optimizations, is_container='container', yang_name="optimizations", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_path_properties(self): + """ + Getter method for path_properties, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_properties (container) + + YANG Description: The TE path properties. + """ + return self.__path_properties + + def _set_path_properties(self, v, load=False): + """ + Setter method for path_properties, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_properties (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_properties is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_properties() directly. + + YANG Description: The TE path properties. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=path_properties.path_properties, is_container='container', yang_name="path-properties", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_properties must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=path_properties.path_properties, is_container='container', yang_name="path-properties", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__path_properties = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_properties(self): + self.__path_properties = YANGDynClass(base=path_properties.path_properties, is_container='container', yang_name="path-properties", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_connectivity_matrix(self): + """ + Getter method for connectivity_matrix, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix (list) + + YANG Description: Represents a node's switching limitations, i.e., +limitations in the interconnecting network TE links +across the node. + """ + return self.__connectivity_matrix + + def _set_connectivity_matrix(self, v, load=False): + """ + Setter method for connectivity_matrix, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_connectivity_matrix is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_connectivity_matrix() directly. + + YANG Description: Represents a node's switching limitations, i.e., +limitations in the interconnecting network TE links +across the node. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("id",connectivity_matrix.connectivity_matrix, yang_name="connectivity-matrix", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='id', extensions=None), is_container='list', yang_name="connectivity-matrix", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """connectivity_matrix must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("id",connectivity_matrix.connectivity_matrix, yang_name="connectivity-matrix", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='id', extensions=None), is_container='list', yang_name="connectivity-matrix", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False)""", + }) + + self.__connectivity_matrix = t + if hasattr(self, '_set'): + self._set() + + def _unset_connectivity_matrix(self): + self.__connectivity_matrix = YANGDynClass(base=YANGListType("id",connectivity_matrix.connectivity_matrix, yang_name="connectivity-matrix", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='id', extensions=None), is_container='list', yang_name="connectivity-matrix", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + + number_of_entries = __builtin__.property(_get_number_of_entries) + label_restrictions = __builtin__.property(_get_label_restrictions) + is_allowed = __builtin__.property(_get_is_allowed) + underlay = __builtin__.property(_get_underlay) + path_constraints = __builtin__.property(_get_path_constraints) + optimizations = __builtin__.property(_get_optimizations) + path_properties = __builtin__.property(_get_path_properties) + connectivity_matrix = __builtin__.property(_get_connectivity_matrix) + + + _pyangbind_elements = OrderedDict([('number_of_entries', number_of_entries), ('label_restrictions', label_restrictions), ('is_allowed', is_allowed), ('underlay', underlay), ('path_constraints', path_constraints), ('optimizations', optimizations), ('path_properties', path_properties), ('connectivity_matrix', connectivity_matrix), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..edc6885b375fde570c5fc0ea5a921e49f04146da --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/__init__.py @@ -0,0 +1,405 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 from_ +from . import to +from . import underlay +from . import path_constraints +from . import optimizations +from . import path_properties +class connectivity_matrix(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/connectivity-matrix. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Represents a node's switching limitations, i.e., +limitations in the interconnecting network TE links +across the node. + """ + __slots__ = ('_path_helper', '_extmethods', '__id','__from_','__to','__is_allowed','__underlay','__path_constraints','__optimizations','__path_properties',) + + _yang_name = 'connectivity-matrix' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__id = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=False) + self.__from_ = YANGDynClass(base=from_.from_, is_container='container', yang_name="from", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__to = YANGDynClass(base=to.to, is_container='container', yang_name="to", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__is_allowed = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="is-allowed", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='boolean', is_config=False) + self.__underlay = YANGDynClass(base=underlay.underlay, is_container='container', yang_name="underlay", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__path_constraints = YANGDynClass(base=path_constraints.path_constraints, is_container='container', yang_name="path-constraints", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__optimizations = YANGDynClass(base=optimizations.optimizations, is_container='container', yang_name="optimizations", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__path_properties = YANGDynClass(base=path_properties.path_properties, is_container='container', yang_name="path-properties", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', 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 ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'connectivity-matrix'] + + def _get_id(self): + """ + Getter method for id, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/id (uint32) + + YANG Description: Identifies the connectivity matrix entry. + """ + return self.__id + + def _set_id(self, v, load=False): + """ + Setter method for id, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/id (uint32) + 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: Identifies the connectivity matrix entry. + """ + 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=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """id 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="id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=False)""", + }) + + self.__id = t + if hasattr(self, '_set'): + self._set() + + def _unset_id(self): + self.__id = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=False) + + + def _get_from_(self): + """ + Getter method for from_, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from (container) + + YANG Description: Reference to a source LTP. + """ + return self.__from_ + + def _set_from_(self, v, load=False): + """ + Setter method for from_, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_from_ is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_from_() directly. + + YANG Description: Reference to a source LTP. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=from_.from_, is_container='container', yang_name="from", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """from_ must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=from_.from_, is_container='container', yang_name="from", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__from_ = t + if hasattr(self, '_set'): + self._set() + + def _unset_from_(self): + self.__from_ = YANGDynClass(base=from_.from_, is_container='container', yang_name="from", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_to(self): + """ + Getter method for to, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to (container) + + YANG Description: Reference to a destination LTP. + """ + return self.__to + + def _set_to(self, v, load=False): + """ + Setter method for to, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_to is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_to() directly. + + YANG Description: Reference to a destination LTP. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=to.to, is_container='container', yang_name="to", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """to must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=to.to, is_container='container', yang_name="to", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__to = t + if hasattr(self, '_set'): + self._set() + + def _unset_to(self): + self.__to = YANGDynClass(base=to.to, is_container='container', yang_name="to", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_is_allowed(self): + """ + Getter method for is_allowed, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/is_allowed (boolean) + + YANG Description: 'true' - switching is allowed; +'false' - switching is disallowed. + """ + return self.__is_allowed + + def _set_is_allowed(self, v, load=False): + """ + Setter method for is_allowed, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/is_allowed (boolean) + If this variable is read-only (config: false) in the + source YANG file, then _set_is_allowed is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_is_allowed() directly. + + YANG Description: 'true' - switching is allowed; +'false' - switching is disallowed. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBool, is_leaf=True, yang_name="is-allowed", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='boolean', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """is_allowed must be of a type compatible with boolean""", + 'defined-type': "boolean", + 'generated-type': """YANGDynClass(base=YANGBool, is_leaf=True, yang_name="is-allowed", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='boolean', is_config=False)""", + }) + + self.__is_allowed = t + if hasattr(self, '_set'): + self._set() + + def _unset_is_allowed(self): + self.__is_allowed = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="is-allowed", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='boolean', is_config=False) + + + def _get_underlay(self): + """ + Getter method for underlay, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay (container) + + YANG Description: Attributes of the TE link underlay. + """ + return self.__underlay + + def _set_underlay(self, v, load=False): + """ + Setter method for underlay, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_underlay is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_underlay() directly. + + YANG Description: Attributes of the TE link underlay. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=underlay.underlay, is_container='container', yang_name="underlay", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """underlay must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=underlay.underlay, is_container='container', yang_name="underlay", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__underlay = t + if hasattr(self, '_set'): + self._set() + + def _unset_underlay(self): + self.__underlay = YANGDynClass(base=underlay.underlay, is_container='container', yang_name="underlay", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_path_constraints(self): + """ + Getter method for path_constraints, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints (container) + + YANG Description: TE named path constraints container. + """ + return self.__path_constraints + + def _set_path_constraints(self, v, load=False): + """ + Setter method for path_constraints, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_constraints is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_constraints() directly. + + YANG Description: TE named path constraints container. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=path_constraints.path_constraints, is_container='container', yang_name="path-constraints", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_constraints must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=path_constraints.path_constraints, is_container='container', yang_name="path-constraints", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__path_constraints = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_constraints(self): + self.__path_constraints = YANGDynClass(base=path_constraints.path_constraints, is_container='container', yang_name="path-constraints", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_optimizations(self): + """ + Getter method for optimizations, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations (container) + + YANG Description: The objective function container that includes +attributes to impose when computing a TE path. + """ + return self.__optimizations + + def _set_optimizations(self, v, load=False): + """ + Setter method for optimizations, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_optimizations is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_optimizations() directly. + + YANG Description: The objective function container that includes +attributes to impose when computing a TE path. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=optimizations.optimizations, is_container='container', yang_name="optimizations", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """optimizations must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=optimizations.optimizations, is_container='container', yang_name="optimizations", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__optimizations = t + if hasattr(self, '_set'): + self._set() + + def _unset_optimizations(self): + self.__optimizations = YANGDynClass(base=optimizations.optimizations, is_container='container', yang_name="optimizations", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_path_properties(self): + """ + Getter method for path_properties, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties (container) + + YANG Description: The TE path properties. + """ + return self.__path_properties + + def _set_path_properties(self, v, load=False): + """ + Setter method for path_properties, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_properties is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_properties() directly. + + YANG Description: The TE path properties. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=path_properties.path_properties, is_container='container', yang_name="path-properties", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_properties must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=path_properties.path_properties, is_container='container', yang_name="path-properties", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__path_properties = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_properties(self): + self.__path_properties = YANGDynClass(base=path_properties.path_properties, is_container='container', yang_name="path-properties", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + id = __builtin__.property(_get_id) + from_ = __builtin__.property(_get_from_) + to = __builtin__.property(_get_to) + is_allowed = __builtin__.property(_get_is_allowed) + underlay = __builtin__.property(_get_underlay) + path_constraints = __builtin__.property(_get_path_constraints) + optimizations = __builtin__.property(_get_optimizations) + path_properties = __builtin__.property(_get_path_properties) + + + _pyangbind_elements = OrderedDict([('id', id), ('from_', from_), ('to', to), ('is_allowed', is_allowed), ('underlay', underlay), ('path_constraints', path_constraints), ('optimizations', optimizations), ('path_properties', path_properties), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from_/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from_/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..8769c9ff833e1692ef73c35baa17a41698f52311 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from_/__init__.py @@ -0,0 +1,155 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 label_restrictions +class from_(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/connectivity-matrix/from. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Reference to a source LTP. + """ + __slots__ = ('_path_helper', '_extmethods', '__tp_ref','__label_restrictions',) + + _yang_name = 'from' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__tp_ref = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="tp-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=False) + self.__label_restrictions = YANGDynClass(base=label_restrictions.label_restrictions, is_container='container', yang_name="label-restrictions", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', 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 ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'connectivity-matrix', 'from'] + + def _get_tp_ref(self): + """ + Getter method for tp_ref, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from/tp_ref (leafref) + + YANG Description: Relative reference to a termination point. + """ + return self.__tp_ref + + def _set_tp_ref(self, v, load=False): + """ + Setter method for tp_ref, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from/tp_ref (leafref) + If this variable is read-only (config: false) in the + source YANG file, then _set_tp_ref is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tp_ref() directly. + + YANG Description: Relative reference to a termination point. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="tp-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tp_ref must be of a type compatible with leafref""", + 'defined-type': "leafref", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="tp-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=False)""", + }) + + self.__tp_ref = t + if hasattr(self, '_set'): + self._set() + + def _unset_tp_ref(self): + self.__tp_ref = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="tp-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=False) + + + def _get_label_restrictions(self): + """ + Getter method for label_restrictions, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from/label_restrictions (container) + + YANG Description: The label restrictions container. + """ + return self.__label_restrictions + + def _set_label_restrictions(self, v, load=False): + """ + Setter method for label_restrictions, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from/label_restrictions (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_label_restrictions is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_label_restrictions() directly. + + YANG Description: The label restrictions container. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=label_restrictions.label_restrictions, is_container='container', yang_name="label-restrictions", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """label_restrictions must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=label_restrictions.label_restrictions, is_container='container', yang_name="label-restrictions", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__label_restrictions = t + if hasattr(self, '_set'): + self._set() + + def _unset_label_restrictions(self): + self.__label_restrictions = YANGDynClass(base=label_restrictions.label_restrictions, is_container='container', yang_name="label-restrictions", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + tp_ref = __builtin__.property(_get_tp_ref) + label_restrictions = __builtin__.property(_get_label_restrictions) + + + _pyangbind_elements = OrderedDict([('tp_ref', tp_ref), ('label_restrictions', label_restrictions), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from_/label_restrictions/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from_/label_restrictions/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..90df40ae35535e21096173e6b5ef0176bbc231e4 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from_/label_restrictions/__init__.py @@ -0,0 +1,120 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 label_restriction +class label_restrictions(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/connectivity-matrix/from/label-restrictions. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: The label restrictions container. + """ + __slots__ = ('_path_helper', '_extmethods', '__label_restriction',) + + _yang_name = 'label-restrictions' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__label_restriction = YANGDynClass(base=YANGListType("index",label_restriction.label_restriction, yang_name="label-restriction", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='index', extensions=None), is_container='list', yang_name="label-restriction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', 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 ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'connectivity-matrix', 'from', 'label-restrictions'] + + def _get_label_restriction(self): + """ + Getter method for label_restriction, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction (list) + + YANG Description: The absence of the label restrictions container implies +that all labels are acceptable; otherwise, only restricted +labels are available. + """ + return self.__label_restriction + + def _set_label_restriction(self, v, load=False): + """ + Setter method for label_restriction, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_label_restriction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_label_restriction() directly. + + YANG Description: The absence of the label restrictions container implies +that all labels are acceptable; otherwise, only restricted +labels are available. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("index",label_restriction.label_restriction, yang_name="label-restriction", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='index', extensions=None), is_container='list', yang_name="label-restriction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """label_restriction must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("index",label_restriction.label_restriction, yang_name="label-restriction", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='index', extensions=None), is_container='list', yang_name="label-restriction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False)""", + }) + + self.__label_restriction = t + if hasattr(self, '_set'): + self._set() + + def _unset_label_restriction(self): + self.__label_restriction = YANGDynClass(base=YANGListType("index",label_restriction.label_restriction, yang_name="label-restriction", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='index', extensions=None), is_container='list', yang_name="label-restriction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + + label_restriction = __builtin__.property(_get_label_restriction) + + + _pyangbind_elements = OrderedDict([('label_restriction', label_restriction), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from_/label_restrictions/label_restriction/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from_/label_restrictions/label_restriction/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..325db171092d6188d67e021e75e86b189b8ecc19 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from_/label_restrictions/label_restriction/__init__.py @@ -0,0 +1,450 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 label_start +from . import label_end +from . import label_step +from . import otn_label_range +from . import ethernet_label_range +class label_restriction(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/connectivity-matrix/from/label-restrictions/label-restriction. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: The absence of the label restrictions container implies +that all labels are acceptable; otherwise, only restricted +labels are available. + """ + __slots__ = ('_path_helper', '_extmethods', '__restriction','__index','__label_start','__label_end','__label_step','__range_bitmap','__otn_label_range','__ethernet_label_range',) + + _yang_name = 'label-restriction' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__restriction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'inclusive': {}, 'exclusive': {}},), default=six.text_type("inclusive"), is_leaf=True, yang_name="restriction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='enumeration', is_config=False) + self.__index = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=False) + self.__label_start = YANGDynClass(base=label_start.label_start, is_container='container', yang_name="label-start", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__label_end = YANGDynClass(base=label_end.label_end, is_container='container', yang_name="label-end", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__label_step = YANGDynClass(base=label_step.label_step, is_container='container', yang_name="label-step", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__range_bitmap = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}), is_leaf=True, yang_name="range-bitmap", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:hex-string', is_config=False) + self.__otn_label_range = YANGDynClass(base=otn_label_range.otn_label_range, is_container='container', yang_name="otn-label-range", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False) + self.__ethernet_label_range = YANGDynClass(base=ethernet_label_range.ethernet_label_range, is_container='container', yang_name="ethernet-label-range", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', 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 ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'connectivity-matrix', 'from', 'label-restrictions', 'label-restriction'] + + def _get_restriction(self): + """ + Getter method for restriction, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/restriction (enumeration) + + YANG Description: Indicates whether the list item is inclusive or exclusive. + """ + return self.__restriction + + def _set_restriction(self, v, load=False): + """ + Setter method for restriction, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/restriction (enumeration) + If this variable is read-only (config: false) in the + source YANG file, then _set_restriction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_restriction() directly. + + YANG Description: Indicates whether the list item is inclusive or exclusive. + """ + 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={'inclusive': {}, 'exclusive': {}},), default=six.text_type("inclusive"), is_leaf=True, yang_name="restriction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='enumeration', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """restriction must be of a type compatible with enumeration""", + 'defined-type': "ietf-te-topology:enumeration", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'inclusive': {}, 'exclusive': {}},), default=six.text_type("inclusive"), is_leaf=True, yang_name="restriction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='enumeration', is_config=False)""", + }) + + self.__restriction = t + if hasattr(self, '_set'): + self._set() + + def _unset_restriction(self): + self.__restriction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'inclusive': {}, 'exclusive': {}},), default=six.text_type("inclusive"), is_leaf=True, yang_name="restriction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='enumeration', is_config=False) + + + def _get_index(self): + """ + Getter method for index, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/index (uint32) + + YANG Description: The index of the label restriction list entry. + """ + return self.__index + + def _set_index(self, v, load=False): + """ + Setter method for index, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/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 label restriction list entry. + """ + 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=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', 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), is_leaf=True, yang_name="index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', 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), is_leaf=True, yang_name="index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=False) + + + def _get_label_start(self): + """ + Getter method for label_start, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/label_start (container) + + YANG Description: This is the starting label if a label range is specified. +This is the label value if a single label is specified, +in which case the 'label-end' attribute is not set. + """ + return self.__label_start + + def _set_label_start(self, v, load=False): + """ + Setter method for label_start, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/label_start (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_label_start is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_label_start() directly. + + YANG Description: This is the starting label if a label range is specified. +This is the label value if a single label is specified, +in which case the 'label-end' attribute is not set. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=label_start.label_start, is_container='container', yang_name="label-start", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """label_start must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=label_start.label_start, is_container='container', yang_name="label-start", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__label_start = t + if hasattr(self, '_set'): + self._set() + + def _unset_label_start(self): + self.__label_start = YANGDynClass(base=label_start.label_start, is_container='container', yang_name="label-start", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_label_end(self): + """ + Getter method for label_end, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/label_end (container) + + YANG Description: This is the ending label if a label range is specified. +This attribute is not set if a single label is specified. + """ + return self.__label_end + + def _set_label_end(self, v, load=False): + """ + Setter method for label_end, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/label_end (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_label_end is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_label_end() directly. + + YANG Description: This is the ending label if a label range is specified. +This attribute is not set if a single label is specified. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=label_end.label_end, is_container='container', yang_name="label-end", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """label_end must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=label_end.label_end, is_container='container', yang_name="label-end", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__label_end = t + if hasattr(self, '_set'): + self._set() + + def _unset_label_end(self): + self.__label_end = YANGDynClass(base=label_end.label_end, is_container='container', yang_name="label-end", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_label_step(self): + """ + Getter method for label_step, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/label_step (container) + + YANG Description: The step increment between labels in the label range. +The label start/end values will have to be consistent +with the sign of label step. For example, +'label-start' < 'label-end' enforces 'label-step' > 0 +'label-start' > 'label-end' enforces 'label-step' < 0. + """ + return self.__label_step + + def _set_label_step(self, v, load=False): + """ + Setter method for label_step, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/label_step (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_label_step is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_label_step() directly. + + YANG Description: The step increment between labels in the label range. +The label start/end values will have to be consistent +with the sign of label step. For example, +'label-start' < 'label-end' enforces 'label-step' > 0 +'label-start' > 'label-end' enforces 'label-step' < 0. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=label_step.label_step, is_container='container', yang_name="label-step", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """label_step must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=label_step.label_step, is_container='container', yang_name="label-step", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__label_step = t + if hasattr(self, '_set'): + self._set() + + def _unset_label_step(self): + self.__label_step = YANGDynClass(base=label_step.label_step, is_container='container', yang_name="label-step", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_range_bitmap(self): + """ + Getter method for range_bitmap, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/range_bitmap (yang:hex-string) + + YANG Description: When there are gaps between 'label-start' and 'label-end', +this attribute is used to specify the positions +of the used labels. This is represented in big endian as +'hex-string'. +The most significant byte in the hex-string is the farthest +to the left in the byte sequence. Leading zero bytes in the +configured value may be omitted for brevity. +Each bit position in the 'range-bitmap' 'hex-string' maps +to a label in the range derived from 'label-start'. + +For example, assuming that 'label-start' = 16000 and +'range-bitmap' = 0x01000001, then: + +- bit position (0) is set, and the corresponding mapped + label from the range is 16000 + (0 * 'label-step') or + 16000 for default 'label-step' = 1. +- bit position (24) is set, and the corresponding mapped + label from the range is 16000 + (24 * 'label-step') or + 16024 for default 'label-step' = 1. + """ + return self.__range_bitmap + + def _set_range_bitmap(self, v, load=False): + """ + Setter method for range_bitmap, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/range_bitmap (yang:hex-string) + If this variable is read-only (config: false) in the + source YANG file, then _set_range_bitmap is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_range_bitmap() directly. + + YANG Description: When there are gaps between 'label-start' and 'label-end', +this attribute is used to specify the positions +of the used labels. This is represented in big endian as +'hex-string'. +The most significant byte in the hex-string is the farthest +to the left in the byte sequence. Leading zero bytes in the +configured value may be omitted for brevity. +Each bit position in the 'range-bitmap' 'hex-string' maps +to a label in the range derived from 'label-start'. + +For example, assuming that 'label-start' = 16000 and +'range-bitmap' = 0x01000001, then: + +- bit position (0) is set, and the corresponding mapped + label from the range is 16000 + (0 * 'label-step') or + 16000 for default 'label-step' = 1. +- bit position (24) is set, and the corresponding mapped + label from the range is 16000 + (24 * 'label-step') or + 16024 for default 'label-step' = 1. + """ + 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})*)?'}), is_leaf=True, yang_name="range-bitmap", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:hex-string', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """range_bitmap must be of a type compatible with yang:hex-string""", + 'defined-type': "yang:hex-string", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}), is_leaf=True, yang_name="range-bitmap", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:hex-string', is_config=False)""", + }) + + self.__range_bitmap = t + if hasattr(self, '_set'): + self._set() + + def _unset_range_bitmap(self): + self.__range_bitmap = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}), is_leaf=True, yang_name="range-bitmap", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:hex-string', is_config=False) + + + def _get_otn_label_range(self): + """ + Getter method for otn_label_range, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/otn_label_range (container) + + YANG Description: Label range information for OTN. + """ + return self.__otn_label_range + + def _set_otn_label_range(self, v, load=False): + """ + Setter method for otn_label_range, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/otn_label_range (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_otn_label_range is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_otn_label_range() directly. + + YANG Description: Label range information for OTN. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=otn_label_range.otn_label_range, is_container='container', yang_name="otn-label-range", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """otn_label_range must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=otn_label_range.otn_label_range, is_container='container', yang_name="otn-label-range", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False)""", + }) + + self.__otn_label_range = t + if hasattr(self, '_set'): + self._set() + + def _unset_otn_label_range(self): + self.__otn_label_range = YANGDynClass(base=otn_label_range.otn_label_range, is_container='container', yang_name="otn-label-range", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False) + + + def _get_ethernet_label_range(self): + """ + Getter method for ethernet_label_range, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/ethernet_label_range (container) + + YANG Description: Ethernet-specific label range related information. + """ + return self.__ethernet_label_range + + def _set_ethernet_label_range(self, v, load=False): + """ + Setter method for ethernet_label_range, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/ethernet_label_range (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_ethernet_label_range is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_ethernet_label_range() directly. + + YANG Description: Ethernet-specific label range related information. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=ethernet_label_range.ethernet_label_range, is_container='container', yang_name="ethernet-label-range", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """ethernet_label_range must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=ethernet_label_range.ethernet_label_range, is_container='container', yang_name="ethernet-label-range", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='container', is_config=False)""", + }) + + self.__ethernet_label_range = t + if hasattr(self, '_set'): + self._set() + + def _unset_ethernet_label_range(self): + self.__ethernet_label_range = YANGDynClass(base=ethernet_label_range.ethernet_label_range, is_container='container', yang_name="ethernet-label-range", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='container', is_config=False) + + restriction = __builtin__.property(_get_restriction) + index = __builtin__.property(_get_index) + label_start = __builtin__.property(_get_label_start) + label_end = __builtin__.property(_get_label_end) + label_step = __builtin__.property(_get_label_step) + range_bitmap = __builtin__.property(_get_range_bitmap) + otn_label_range = __builtin__.property(_get_otn_label_range) + ethernet_label_range = __builtin__.property(_get_ethernet_label_range) + + + _pyangbind_elements = OrderedDict([('restriction', restriction), ('index', index), ('label_start', label_start), ('label_end', label_end), ('label_step', label_step), ('range_bitmap', range_bitmap), ('otn_label_range', otn_label_range), ('ethernet_label_range', ethernet_label_range), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from_/label_restrictions/label_restriction/ethernet_label_range/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from_/label_restrictions/label_restriction/ethernet_label_range/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..ccc0a8bf938137b56874dff8b76cac52f6fe9f11 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from_/label_restrictions/label_restriction/ethernet_label_range/__init__.py @@ -0,0 +1,154 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 ethernet_label_range(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/connectivity-matrix/from/label-restrictions/label-restriction/ethernet-label-range. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Ethernet-specific label range related information. + """ + __slots__ = ('_path_helper', '_extmethods', '__tag_type','__priority',) + + _yang_name = 'ethernet-label-range' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__tag_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 's-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:s-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:s-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}},), is_leaf=True, yang_name="tag-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:eth-tag-type', is_config=False) + self.__priority = YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), is_leaf=True, yang_name="priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', 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 ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'connectivity-matrix', 'from', 'label-restrictions', 'label-restriction', 'ethernet-label-range'] + + def _get_tag_type(self): + """ + Getter method for tag_type, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/ethernet_label_range/tag_type (etht-types:eth-tag-type) + + YANG Description: VLAN tag type. + """ + return self.__tag_type + + def _set_tag_type(self, v, load=False): + """ + Setter method for tag_type, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/ethernet_label_range/tag_type (etht-types:eth-tag-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_tag_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tag_type() directly. + + YANG Description: VLAN tag type. + """ + 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={'c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 's-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:s-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:s-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}},), is_leaf=True, yang_name="tag-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:eth-tag-type', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tag_type must be of a type compatible with etht-types:eth-tag-type""", + 'defined-type': "etht-types:eth-tag-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 's-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:s-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:s-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}},), is_leaf=True, yang_name="tag-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:eth-tag-type', is_config=False)""", + }) + + self.__tag_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_tag_type(self): + self.__tag_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 's-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:s-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:s-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}},), is_leaf=True, yang_name="tag-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:eth-tag-type', is_config=False) + + + def _get_priority(self): + """ + Getter method for priority, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/ethernet_label_range/priority (uint8) + + YANG Description: priority. + """ + return self.__priority + + def _set_priority(self, v, load=False): + """ + Setter method for priority, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/ethernet_label_range/priority (uint8) + If this variable is read-only (config: false) in the + source YANG file, then _set_priority is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_priority() directly. + + YANG Description: priority. + """ + 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="priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint8', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """priority 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="priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint8', is_config=False)""", + }) + + self.__priority = t + if hasattr(self, '_set'): + self._set() + + def _unset_priority(self): + self.__priority = YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), is_leaf=True, yang_name="priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint8', is_config=False) + + tag_type = __builtin__.property(_get_tag_type) + priority = __builtin__.property(_get_priority) + + + _pyangbind_elements = OrderedDict([('tag_type', tag_type), ('priority', priority), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from_/label_restrictions/label_restriction/label_end/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from_/label_restrictions/label_restriction/label_end/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..8116db8f36b36091805b53088883c23dacf04b29 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from_/label_restrictions/label_restriction/label_end/__init__.py @@ -0,0 +1,119 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 te_label +class label_end(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/connectivity-matrix/from/label-restrictions/label-restriction/label-end. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: This is the ending label if a label range is specified. +This attribute is not set if a single label is specified. + """ + __slots__ = ('_path_helper', '_extmethods', '__te_label',) + + _yang_name = 'label-end' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__te_label = YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', 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 ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'connectivity-matrix', 'from', 'label-restrictions', 'label-restriction', 'label-end'] + + def _get_te_label(self): + """ + Getter method for te_label, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/label_end/te_label (container) + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + return self.__te_label + + def _set_te_label(self, v, load=False): + """ + Setter method for te_label, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/label_end/te_label (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_te_label is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_te_label() directly. + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """te_label must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__te_label = t + if hasattr(self, '_set'): + self._set() + + def _unset_te_label(self): + self.__te_label = YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + te_label = __builtin__.property(_get_te_label) + + + _pyangbind_elements = OrderedDict([('te_label', te_label), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from_/label_restrictions/label_restriction/label_end/te_label/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from_/label_restrictions/label_restriction/label_end/te_label/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..7d689d60add0e4a98bdf1660273236a8e8fa0a4a --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from_/label_restrictions/label_restriction/label_end/te_label/__init__.py @@ -0,0 +1,234 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 otn +class te_label(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/connectivity-matrix/from/label-restrictions/label-restriction/label-end/te-label. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + __slots__ = ('_path_helper', '_extmethods', '__generic','__otn','__vlanid','__direction',) + + _yang_name = 'te-label' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__generic = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=False) + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False) + self.__vlanid = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=False) + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', 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 ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'connectivity-matrix', 'from', 'label-restrictions', 'label-restriction', 'label-end', 'te-label'] + + def _get_generic(self): + """ + Getter method for generic, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/label_end/te_label/generic (rt-types:generalized-label) + + YANG Description: TE label specified in a generic format. + """ + return self.__generic + + def _set_generic(self, v, load=False): + """ + Setter method for generic, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/label_end/te_label/generic (rt-types:generalized-label) + If this variable is read-only (config: false) in the + source YANG file, then _set_generic is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_generic() directly. + + YANG Description: TE label specified in a generic format. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """generic must be of a type compatible with rt-types:generalized-label""", + 'defined-type': "rt-types:generalized-label", + 'generated-type': """YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=False)""", + }) + + self.__generic = t + if hasattr(self, '_set'): + self._set() + + def _unset_generic(self): + self.__generic = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=False) + + + def _get_otn(self): + """ + Getter method for otn, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/label_end/te_label/otn (container) + + YANG Description: Label start or label end for OTN. + """ + return self.__otn + + def _set_otn(self, v, load=False): + """ + Setter method for otn, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/label_end/te_label/otn (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_otn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_otn() directly. + + YANG Description: Label start or label end for OTN. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """otn must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False)""", + }) + + self.__otn = t + if hasattr(self, '_set'): + self._set() + + def _unset_otn(self): + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False) + + + def _get_vlanid(self): + """ + Getter method for vlanid, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/label_end/te_label/vlanid (etht-types:vlanid) + + YANG Description: VLAN tag id. + """ + return self.__vlanid + + def _set_vlanid(self, v, load=False): + """ + Setter method for vlanid, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/label_end/te_label/vlanid (etht-types:vlanid) + If this variable is read-only (config: false) in the + source YANG file, then _set_vlanid is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_vlanid() directly. + + YANG Description: VLAN tag id. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """vlanid must be of a type compatible with etht-types:vlanid""", + 'defined-type': "etht-types:vlanid", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=False)""", + }) + + self.__vlanid = t + if hasattr(self, '_set'): + self._set() + + def _unset_vlanid(self): + self.__vlanid = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=False) + + + def _get_direction(self): + """ + Getter method for direction, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/label_end/te_label/direction (te-label-direction) + + YANG Description: Label direction. + """ + return self.__direction + + def _set_direction(self, v, load=False): + """ + Setter method for direction, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/label_end/te_label/direction (te-label-direction) + If this variable is read-only (config: false) in the + source YANG file, then _set_direction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_direction() directly. + + YANG Description: Label direction. + """ + 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={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """direction must be of a type compatible with te-label-direction""", + 'defined-type': "ietf-te-topology:te-label-direction", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=False)""", + }) + + self.__direction = t + if hasattr(self, '_set'): + self._set() + + def _unset_direction(self): + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=False) + + generic = __builtin__.property(_get_generic) + otn = __builtin__.property(_get_otn) + vlanid = __builtin__.property(_get_vlanid) + direction = __builtin__.property(_get_direction) + + __choices__ = {'technology': {'generic': ['generic'], 'otn': ['otn'], 'eth': ['vlanid']}} + _pyangbind_elements = OrderedDict([('generic', generic), ('otn', otn), ('vlanid', vlanid), ('direction', direction), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from_/label_restrictions/label_restriction/label_end/te_label/otn/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from_/label_restrictions/label_restriction/label_end/te_label/otn/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..3dbff3b161cde1c2502bdbfdf693d91523aab36c --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from_/label_restrictions/label_restriction/label_end/te_label/otn/__init__.py @@ -0,0 +1,154 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 otn(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/connectivity-matrix/from/label-restrictions/label-restriction/label-end/te-label/otn. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Label start or label end for OTN. + """ + __slots__ = ('_path_helper', '_extmethods', '__tpn','__ts',) + + _yang_name = 'otn' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__tpn = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('range-type', 'trib-port'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=False) + self.__ts = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts", parent=self, choice=('range-type', 'trib-slot'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-ts', 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 ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'connectivity-matrix', 'from', 'label-restrictions', 'label-restriction', 'label-end', 'te-label', 'otn'] + + def _get_tpn(self): + """ + Getter method for tpn, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/label_end/te_label/otn/tpn (otn-tpn) + + YANG Description: Tributary Port Number (TPN). + """ + return self.__tpn + + def _set_tpn(self, v, load=False): + """ + Setter method for tpn, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/label_end/te_label/otn/tpn (otn-tpn) + If this variable is read-only (config: false) in the + source YANG file, then _set_tpn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tpn() directly. + + YANG Description: Tributary Port Number (TPN). + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('range-type', 'trib-port'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tpn must be of a type compatible with otn-tpn""", + 'defined-type': "ietf-otn-topology:otn-tpn", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('range-type', 'trib-port'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=False)""", + }) + + self.__tpn = t + if hasattr(self, '_set'): + self._set() + + def _unset_tpn(self): + self.__tpn = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('range-type', 'trib-port'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=False) + + + def _get_ts(self): + """ + Getter method for ts, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/label_end/te_label/otn/ts (otn-ts) + + YANG Description: Tributary Slot (TS) number. + """ + return self.__ts + + def _set_ts(self, v, load=False): + """ + Setter method for ts, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/label_end/te_label/otn/ts (otn-ts) + If this variable is read-only (config: false) in the + source YANG file, then _set_ts is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_ts() directly. + + YANG Description: Tributary Slot (TS) number. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts", parent=self, choice=('range-type', 'trib-slot'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-ts', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """ts must be of a type compatible with otn-ts""", + 'defined-type': "ietf-otn-topology:otn-ts", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts", parent=self, choice=('range-type', 'trib-slot'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-ts', is_config=False)""", + }) + + self.__ts = t + if hasattr(self, '_set'): + self._set() + + def _unset_ts(self): + self.__ts = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts", parent=self, choice=('range-type', 'trib-slot'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-ts', is_config=False) + + tpn = __builtin__.property(_get_tpn) + ts = __builtin__.property(_get_ts) + + __choices__ = {'range-type': {'trib-port': ['tpn'], 'trib-slot': ['ts']}} + _pyangbind_elements = OrderedDict([('tpn', tpn), ('ts', ts), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from_/label_restrictions/label_restriction/label_start/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from_/label_restrictions/label_restriction/label_start/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..c682b45e55c56f0da6fa132bd251230c253280af --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from_/label_restrictions/label_restriction/label_start/__init__.py @@ -0,0 +1,120 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 te_label +class label_start(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/connectivity-matrix/from/label-restrictions/label-restriction/label-start. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: This is the starting label if a label range is specified. +This is the label value if a single label is specified, +in which case the 'label-end' attribute is not set. + """ + __slots__ = ('_path_helper', '_extmethods', '__te_label',) + + _yang_name = 'label-start' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__te_label = YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', 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 ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'connectivity-matrix', 'from', 'label-restrictions', 'label-restriction', 'label-start'] + + def _get_te_label(self): + """ + Getter method for te_label, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/label_start/te_label (container) + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + return self.__te_label + + def _set_te_label(self, v, load=False): + """ + Setter method for te_label, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/label_start/te_label (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_te_label is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_te_label() directly. + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """te_label must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__te_label = t + if hasattr(self, '_set'): + self._set() + + def _unset_te_label(self): + self.__te_label = YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + te_label = __builtin__.property(_get_te_label) + + + _pyangbind_elements = OrderedDict([('te_label', te_label), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from_/label_restrictions/label_restriction/label_start/te_label/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from_/label_restrictions/label_restriction/label_start/te_label/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..3d28ae831e848224cc5e3c307bbaf3c4a3ad1357 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from_/label_restrictions/label_restriction/label_start/te_label/__init__.py @@ -0,0 +1,234 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 otn +class te_label(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/connectivity-matrix/from/label-restrictions/label-restriction/label-start/te-label. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + __slots__ = ('_path_helper', '_extmethods', '__generic','__otn','__vlanid','__direction',) + + _yang_name = 'te-label' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__generic = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=False) + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False) + self.__vlanid = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=False) + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', 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 ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'connectivity-matrix', 'from', 'label-restrictions', 'label-restriction', 'label-start', 'te-label'] + + def _get_generic(self): + """ + Getter method for generic, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/label_start/te_label/generic (rt-types:generalized-label) + + YANG Description: TE label specified in a generic format. + """ + return self.__generic + + def _set_generic(self, v, load=False): + """ + Setter method for generic, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/label_start/te_label/generic (rt-types:generalized-label) + If this variable is read-only (config: false) in the + source YANG file, then _set_generic is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_generic() directly. + + YANG Description: TE label specified in a generic format. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """generic must be of a type compatible with rt-types:generalized-label""", + 'defined-type': "rt-types:generalized-label", + 'generated-type': """YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=False)""", + }) + + self.__generic = t + if hasattr(self, '_set'): + self._set() + + def _unset_generic(self): + self.__generic = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=False) + + + def _get_otn(self): + """ + Getter method for otn, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/label_start/te_label/otn (container) + + YANG Description: Label start or label end for OTN. + """ + return self.__otn + + def _set_otn(self, v, load=False): + """ + Setter method for otn, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/label_start/te_label/otn (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_otn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_otn() directly. + + YANG Description: Label start or label end for OTN. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """otn must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False)""", + }) + + self.__otn = t + if hasattr(self, '_set'): + self._set() + + def _unset_otn(self): + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False) + + + def _get_vlanid(self): + """ + Getter method for vlanid, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/label_start/te_label/vlanid (etht-types:vlanid) + + YANG Description: VLAN tag id. + """ + return self.__vlanid + + def _set_vlanid(self, v, load=False): + """ + Setter method for vlanid, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/label_start/te_label/vlanid (etht-types:vlanid) + If this variable is read-only (config: false) in the + source YANG file, then _set_vlanid is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_vlanid() directly. + + YANG Description: VLAN tag id. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """vlanid must be of a type compatible with etht-types:vlanid""", + 'defined-type': "etht-types:vlanid", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=False)""", + }) + + self.__vlanid = t + if hasattr(self, '_set'): + self._set() + + def _unset_vlanid(self): + self.__vlanid = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=False) + + + def _get_direction(self): + """ + Getter method for direction, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/label_start/te_label/direction (te-label-direction) + + YANG Description: Label direction. + """ + return self.__direction + + def _set_direction(self, v, load=False): + """ + Setter method for direction, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/label_start/te_label/direction (te-label-direction) + If this variable is read-only (config: false) in the + source YANG file, then _set_direction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_direction() directly. + + YANG Description: Label direction. + """ + 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={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """direction must be of a type compatible with te-label-direction""", + 'defined-type': "ietf-te-topology:te-label-direction", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=False)""", + }) + + self.__direction = t + if hasattr(self, '_set'): + self._set() + + def _unset_direction(self): + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=False) + + generic = __builtin__.property(_get_generic) + otn = __builtin__.property(_get_otn) + vlanid = __builtin__.property(_get_vlanid) + direction = __builtin__.property(_get_direction) + + __choices__ = {'technology': {'generic': ['generic'], 'otn': ['otn'], 'eth': ['vlanid']}} + _pyangbind_elements = OrderedDict([('generic', generic), ('otn', otn), ('vlanid', vlanid), ('direction', direction), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from_/label_restrictions/label_restriction/label_start/te_label/otn/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from_/label_restrictions/label_restriction/label_start/te_label/otn/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..458413ca8117db279493430de3d46d8e84404c84 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from_/label_restrictions/label_restriction/label_start/te_label/otn/__init__.py @@ -0,0 +1,154 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 otn(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/connectivity-matrix/from/label-restrictions/label-restriction/label-start/te-label/otn. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Label start or label end for OTN. + """ + __slots__ = ('_path_helper', '_extmethods', '__tpn','__ts',) + + _yang_name = 'otn' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__tpn = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('range-type', 'trib-port'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=False) + self.__ts = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts", parent=self, choice=('range-type', 'trib-slot'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-ts', 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 ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'connectivity-matrix', 'from', 'label-restrictions', 'label-restriction', 'label-start', 'te-label', 'otn'] + + def _get_tpn(self): + """ + Getter method for tpn, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/label_start/te_label/otn/tpn (otn-tpn) + + YANG Description: Tributary Port Number (TPN). + """ + return self.__tpn + + def _set_tpn(self, v, load=False): + """ + Setter method for tpn, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/label_start/te_label/otn/tpn (otn-tpn) + If this variable is read-only (config: false) in the + source YANG file, then _set_tpn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tpn() directly. + + YANG Description: Tributary Port Number (TPN). + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('range-type', 'trib-port'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tpn must be of a type compatible with otn-tpn""", + 'defined-type': "ietf-otn-topology:otn-tpn", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('range-type', 'trib-port'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=False)""", + }) + + self.__tpn = t + if hasattr(self, '_set'): + self._set() + + def _unset_tpn(self): + self.__tpn = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('range-type', 'trib-port'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=False) + + + def _get_ts(self): + """ + Getter method for ts, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/label_start/te_label/otn/ts (otn-ts) + + YANG Description: Tributary Slot (TS) number. + """ + return self.__ts + + def _set_ts(self, v, load=False): + """ + Setter method for ts, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/label_start/te_label/otn/ts (otn-ts) + If this variable is read-only (config: false) in the + source YANG file, then _set_ts is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_ts() directly. + + YANG Description: Tributary Slot (TS) number. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts", parent=self, choice=('range-type', 'trib-slot'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-ts', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """ts must be of a type compatible with otn-ts""", + 'defined-type': "ietf-otn-topology:otn-ts", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts", parent=self, choice=('range-type', 'trib-slot'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-ts', is_config=False)""", + }) + + self.__ts = t + if hasattr(self, '_set'): + self._set() + + def _unset_ts(self): + self.__ts = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts", parent=self, choice=('range-type', 'trib-slot'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-ts', is_config=False) + + tpn = __builtin__.property(_get_tpn) + ts = __builtin__.property(_get_ts) + + __choices__ = {'range-type': {'trib-port': ['tpn'], 'trib-slot': ['ts']}} + _pyangbind_elements = OrderedDict([('tpn', tpn), ('ts', ts), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from_/label_restrictions/label_restriction/label_step/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from_/label_restrictions/label_restriction/label_step/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..817c68ae2952a3b519fb3d39519d1665660afaf9 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from_/label_restrictions/label_restriction/label_step/__init__.py @@ -0,0 +1,200 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 otn +class label_step(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/connectivity-matrix/from/label-restrictions/label-restriction/label-step. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: The step increment between labels in the label range. +The label start/end values will have to be consistent +with the sign of label step. For example, +'label-start' < 'label-end' enforces 'label-step' > 0 +'label-start' > 'label-end' enforces 'label-step' < 0. + """ + __slots__ = ('_path_helper', '_extmethods', '__generic','__otn','__eth_step',) + + _yang_name = 'label-step' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__generic = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['-2147483648..2147483647']}, int_size=32), default=RestrictedClassType(base_type=long, restriction_dict={'range': ['-2147483648..2147483647']}, int_size=32)(1), is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='int32', is_config=False) + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False) + self.__eth_step = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), default=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16)(1), is_leaf=True, yang_name="eth-step", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint16', 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 ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'connectivity-matrix', 'from', 'label-restrictions', 'label-restriction', 'label-step'] + + def _get_generic(self): + """ + Getter method for generic, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/label_step/generic (int32) + + YANG Description: Label range step. + """ + return self.__generic + + def _set_generic(self, v, load=False): + """ + Setter method for generic, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/label_step/generic (int32) + If this variable is read-only (config: false) in the + source YANG file, then _set_generic is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_generic() directly. + + YANG Description: Label range step. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['-2147483648..2147483647']}, int_size=32), default=RestrictedClassType(base_type=long, restriction_dict={'range': ['-2147483648..2147483647']}, int_size=32)(1), is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='int32', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """generic must be of a type compatible with int32""", + 'defined-type': "int32", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['-2147483648..2147483647']}, int_size=32), default=RestrictedClassType(base_type=long, restriction_dict={'range': ['-2147483648..2147483647']}, int_size=32)(1), is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='int32', is_config=False)""", + }) + + self.__generic = t + if hasattr(self, '_set'): + self._set() + + def _unset_generic(self): + self.__generic = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['-2147483648..2147483647']}, int_size=32), default=RestrictedClassType(base_type=long, restriction_dict={'range': ['-2147483648..2147483647']}, int_size=32)(1), is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='int32', is_config=False) + + + def _get_otn(self): + """ + Getter method for otn, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/label_step/otn (container) + + YANG Description: Label step for OTN + """ + return self.__otn + + def _set_otn(self, v, load=False): + """ + Setter method for otn, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/label_step/otn (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_otn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_otn() directly. + + YANG Description: Label step for OTN + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """otn must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False)""", + }) + + self.__otn = t + if hasattr(self, '_set'): + self._set() + + def _unset_otn(self): + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False) + + + def _get_eth_step(self): + """ + Getter method for eth_step, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/label_step/eth_step (uint16) + + YANG Description: Label step which represent possible increments for +an Ethernet VLAN tag. + """ + return self.__eth_step + + def _set_eth_step(self, v, load=False): + """ + Setter method for eth_step, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/label_step/eth_step (uint16) + If this variable is read-only (config: false) in the + source YANG file, then _set_eth_step is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_eth_step() directly. + + YANG Description: Label step which represent possible increments for +an Ethernet VLAN tag. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), default=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16)(1), is_leaf=True, yang_name="eth-step", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint16', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """eth_step must be of a type compatible with uint16""", + 'defined-type': "uint16", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), default=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16)(1), is_leaf=True, yang_name="eth-step", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint16', is_config=False)""", + }) + + self.__eth_step = t + if hasattr(self, '_set'): + self._set() + + def _unset_eth_step(self): + self.__eth_step = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), default=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16)(1), is_leaf=True, yang_name="eth-step", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint16', is_config=False) + + generic = __builtin__.property(_get_generic) + otn = __builtin__.property(_get_otn) + eth_step = __builtin__.property(_get_eth_step) + + __choices__ = {'technology': {'generic': ['generic'], 'otn': ['otn'], 'eth': ['eth_step']}} + _pyangbind_elements = OrderedDict([('generic', generic), ('otn', otn), ('eth_step', eth_step), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from_/label_restrictions/label_restriction/label_step/otn/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from_/label_restrictions/label_restriction/label_step/otn/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..715687de97618e53b00342fe79a49f3812011355 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from_/label_restrictions/label_restriction/label_step/otn/__init__.py @@ -0,0 +1,158 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 otn(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/connectivity-matrix/from/label-restrictions/label-restriction/label-step/otn. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Label step for OTN + """ + __slots__ = ('_path_helper', '_extmethods', '__tpn','__ts',) + + _yang_name = 'otn' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__tpn = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('range-type', 'trib-port'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=False) + self.__ts = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts", parent=self, choice=('range-type', 'trib-slot'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-ts', 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 ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'connectivity-matrix', 'from', 'label-restrictions', 'label-restriction', 'label-step', 'otn'] + + def _get_tpn(self): + """ + Getter method for tpn, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/label_step/otn/tpn (otn-tpn) + + YANG Description: Label step which represents possible increments for +Tributary Port Number (TPN). + """ + return self.__tpn + + def _set_tpn(self, v, load=False): + """ + Setter method for tpn, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/label_step/otn/tpn (otn-tpn) + If this variable is read-only (config: false) in the + source YANG file, then _set_tpn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tpn() directly. + + YANG Description: Label step which represents possible increments for +Tributary Port Number (TPN). + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('range-type', 'trib-port'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tpn must be of a type compatible with otn-tpn""", + 'defined-type': "ietf-otn-topology:otn-tpn", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('range-type', 'trib-port'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=False)""", + }) + + self.__tpn = t + if hasattr(self, '_set'): + self._set() + + def _unset_tpn(self): + self.__tpn = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('range-type', 'trib-port'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=False) + + + def _get_ts(self): + """ + Getter method for ts, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/label_step/otn/ts (otn-ts) + + YANG Description: Label step which represents possible increments for +Tributary Slot (TS) number. + """ + return self.__ts + + def _set_ts(self, v, load=False): + """ + Setter method for ts, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/label_step/otn/ts (otn-ts) + If this variable is read-only (config: false) in the + source YANG file, then _set_ts is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_ts() directly. + + YANG Description: Label step which represents possible increments for +Tributary Slot (TS) number. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts", parent=self, choice=('range-type', 'trib-slot'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-ts', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """ts must be of a type compatible with otn-ts""", + 'defined-type': "ietf-otn-topology:otn-ts", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts", parent=self, choice=('range-type', 'trib-slot'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-ts', is_config=False)""", + }) + + self.__ts = t + if hasattr(self, '_set'): + self._set() + + def _unset_ts(self): + self.__ts = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts", parent=self, choice=('range-type', 'trib-slot'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-ts', is_config=False) + + tpn = __builtin__.property(_get_tpn) + ts = __builtin__.property(_get_ts) + + __choices__ = {'range-type': {'trib-port': ['tpn'], 'trib-slot': ['ts']}} + _pyangbind_elements = OrderedDict([('tpn', tpn), ('ts', ts), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from_/label_restrictions/label_restriction/otn_label_range/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from_/label_restrictions/label_restriction/otn_label_range/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..82fc8d6a107cf829ac674f2b2f6897c4fe4e9236 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from_/label_restrictions/label_restriction/otn_label_range/__init__.py @@ -0,0 +1,256 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 otn_label_range(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/connectivity-matrix/from/label-restrictions/label-restriction/otn-label-range. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Label range information for OTN. + """ + __slots__ = ('_path_helper', '_extmethods', '__range_type','__tsg','__odu_type_list','__priority',) + + _yang_name = 'otn-label-range' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__range_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'trib-slot': {}, 'trib-port': {}},), is_leaf=True, yang_name="range-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-label-range-type', is_config=False) + self.__tsg = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=False) + self.__odu_type_list = YANGDynClass(unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},)), is_leaf=False, yang_name="odu-type-list", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=False) + self.__priority = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..7']}), is_leaf=True, yang_name="priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', 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 ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'connectivity-matrix', 'from', 'label-restrictions', 'label-restriction', 'otn-label-range'] + + def _get_range_type(self): + """ + Getter method for range_type, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/otn_label_range/range_type (otn-label-range-type) + + YANG Description: The type of range (e.g., TPN or TS) +to which the label range applies + """ + return self.__range_type + + def _set_range_type(self, v, load=False): + """ + Setter method for range_type, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/otn_label_range/range_type (otn-label-range-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_range_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_range_type() directly. + + YANG Description: The type of range (e.g., TPN or TS) +to which the label range applies + """ + 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={'trib-slot': {}, 'trib-port': {}},), is_leaf=True, yang_name="range-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-label-range-type', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """range_type must be of a type compatible with otn-label-range-type""", + 'defined-type': "ietf-otn-topology:otn-label-range-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'trib-slot': {}, 'trib-port': {}},), is_leaf=True, yang_name="range-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-label-range-type', is_config=False)""", + }) + + self.__range_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_range_type(self): + self.__range_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'trib-slot': {}, 'trib-port': {}},), is_leaf=True, yang_name="range-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-label-range-type', is_config=False) + + + def _get_tsg(self): + """ + Getter method for tsg, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/otn_label_range/tsg (identityref) + + YANG Description: Tributary slot granularity (TSG) to which the label range +applies. + +This leaf MUST be present when the range-type is TS. + +This leaf MAY be omitted when mapping an ODUk over an OTUk +Link. In this case the range-type is tpn, with only one +entry (ODUk), and the tpn range has only one value (1). + """ + return self.__tsg + + def _set_tsg(self, v, load=False): + """ + Setter method for tsg, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/otn_label_range/tsg (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_tsg is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tsg() directly. + + YANG Description: Tributary slot granularity (TSG) to which the label range +applies. + +This leaf MUST be present when the range-type is TS. + +This leaf MAY be omitted when mapping an ODUk over an OTUk +Link. In this case the range-type is tpn, with only one +entry (ODUk), and the tpn range has only one value (1). + """ + 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={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tsg must be of a type compatible with identityref""", + 'defined-type': "ietf-otn-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=False)""", + }) + + self.__tsg = t + if hasattr(self, '_set'): + self._set() + + def _unset_tsg(self): + self.__tsg = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=False) + + + def _get_odu_type_list(self): + """ + Getter method for odu_type_list, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/otn_label_range/odu_type_list (identityref) + + YANG Description: List of ODU types to which the label range applies. + +An Empty odu-type-list means that the label range +applies to all the supported ODU types. + """ + return self.__odu_type_list + + def _set_odu_type_list(self, v, load=False): + """ + Setter method for odu_type_list, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/otn_label_range/odu_type_list (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_odu_type_list is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_odu_type_list() directly. + + YANG Description: List of ODU types to which the label range applies. + +An Empty odu-type-list means that the label range +applies to all the supported ODU types. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},)), is_leaf=False, yang_name="odu-type-list", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """odu_type_list must be of a type compatible with identityref""", + 'defined-type': "ietf-otn-topology:identityref", + 'generated-type': """YANGDynClass(unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},)), is_leaf=False, yang_name="odu-type-list", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=False)""", + }) + + self.__odu_type_list = t + if hasattr(self, '_set'): + self._set() + + def _unset_odu_type_list(self): + self.__odu_type_list = YANGDynClass(unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},)), is_leaf=False, yang_name="odu-type-list", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=False) + + + def _get_priority(self): + """ + Getter method for priority, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/otn_label_range/priority (uint8) + + YANG Description: Priority in Interface Switching Capability +Descriptor (ISCD). + """ + return self.__priority + + def _set_priority(self, v, load=False): + """ + Setter method for priority, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/otn_label_range/priority (uint8) + If this variable is read-only (config: false) in the + source YANG file, then _set_priority is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_priority() directly. + + YANG Description: Priority in Interface Switching Capability +Descriptor (ISCD). + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..7']}), is_leaf=True, yang_name="priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint8', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """priority must be of a type compatible with uint8""", + 'defined-type': "uint8", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..7']}), is_leaf=True, yang_name="priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint8', is_config=False)""", + }) + + self.__priority = t + if hasattr(self, '_set'): + self._set() + + def _unset_priority(self): + self.__priority = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..7']}), is_leaf=True, yang_name="priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint8', is_config=False) + + range_type = __builtin__.property(_get_range_type) + tsg = __builtin__.property(_get_tsg) + odu_type_list = __builtin__.property(_get_odu_type_list) + priority = __builtin__.property(_get_priority) + + + _pyangbind_elements = OrderedDict([('range_type', range_type), ('tsg', tsg), ('odu_type_list', odu_type_list), ('priority', priority), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..ff0a5fab9e00c2dad085dd6e6878cd72be331294 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/__init__.py @@ -0,0 +1,199 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 optimization_metric +from . import tiebreakers +from . import objective_function +class optimizations(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/connectivity-matrix/optimizations. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: The objective function container that includes +attributes to impose when computing a TE path. + """ + __slots__ = ('_path_helper', '_extmethods', '__optimization_metric','__tiebreakers','__objective_function',) + + _yang_name = 'optimizations' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__optimization_metric = YANGDynClass(base=YANGListType("metric_type",optimization_metric.optimization_metric, yang_name="optimization-metric", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='metric-type', extensions=None, choice=False), is_container='list', yang_name="optimization-metric", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + self.__tiebreakers = YANGDynClass(base=tiebreakers.tiebreakers, is_container='container', yang_name="tiebreakers", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__objective_function = YANGDynClass(base=objective_function.objective_function, is_container='container', yang_name="objective-function", parent=self, choice=('algorithm', 'objective-function'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', 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 ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'connectivity-matrix', 'optimizations'] + + def _get_optimization_metric(self): + """ + Getter method for optimization_metric, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric (list) + + YANG Description: TE path metric type. + """ + return self.__optimization_metric + + def _set_optimization_metric(self, v, load=False): + """ + Setter method for optimization_metric, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_optimization_metric is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_optimization_metric() directly. + + YANG Description: TE path metric type. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("metric_type",optimization_metric.optimization_metric, yang_name="optimization-metric", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='metric-type', extensions=None, choice=False), is_container='list', yang_name="optimization-metric", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """optimization_metric must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("metric_type",optimization_metric.optimization_metric, yang_name="optimization-metric", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='metric-type', extensions=None, choice=False), is_container='list', yang_name="optimization-metric", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False)""", + }) + + self.__optimization_metric = t + if hasattr(self, '_set'): + self._set() + + def _unset_optimization_metric(self): + self.__optimization_metric = YANGDynClass(base=YANGListType("metric_type",optimization_metric.optimization_metric, yang_name="optimization-metric", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='metric-type', extensions=None, choice=False), is_container='list', yang_name="optimization-metric", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + + + def _get_tiebreakers(self): + """ + Getter method for tiebreakers, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/tiebreakers (container) + + YANG Description: Container for the list of tiebreakers. + """ + return self.__tiebreakers + + def _set_tiebreakers(self, v, load=False): + """ + Setter method for tiebreakers, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/tiebreakers (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_tiebreakers is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tiebreakers() directly. + + YANG Description: Container for the list of tiebreakers. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=tiebreakers.tiebreakers, is_container='container', yang_name="tiebreakers", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tiebreakers must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=tiebreakers.tiebreakers, is_container='container', yang_name="tiebreakers", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__tiebreakers = t + if hasattr(self, '_set'): + self._set() + + def _unset_tiebreakers(self): + self.__tiebreakers = YANGDynClass(base=tiebreakers.tiebreakers, is_container='container', yang_name="tiebreakers", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_objective_function(self): + """ + Getter method for objective_function, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/objective_function (container) + + YANG Description: The objective function container that includes +attributes to impose when computing a TE path. + """ + return self.__objective_function + + def _set_objective_function(self, v, load=False): + """ + Setter method for objective_function, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/objective_function (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_objective_function is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_objective_function() directly. + + YANG Description: The objective function container that includes +attributes to impose when computing a TE path. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=objective_function.objective_function, is_container='container', yang_name="objective-function", parent=self, choice=('algorithm', 'objective-function'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """objective_function must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=objective_function.objective_function, is_container='container', yang_name="objective-function", parent=self, choice=('algorithm', 'objective-function'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__objective_function = t + if hasattr(self, '_set'): + self._set() + + def _unset_objective_function(self): + self.__objective_function = YANGDynClass(base=objective_function.objective_function, is_container='container', yang_name="objective-function", parent=self, choice=('algorithm', 'objective-function'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + optimization_metric = __builtin__.property(_get_optimization_metric) + tiebreakers = __builtin__.property(_get_tiebreakers) + objective_function = __builtin__.property(_get_objective_function) + + __choices__ = {'algorithm': {'metric': ['optimization_metric', 'tiebreakers'], 'objective-function': ['objective_function']}} + _pyangbind_elements = OrderedDict([('optimization_metric', optimization_metric), ('tiebreakers', tiebreakers), ('objective_function', objective_function), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/objective_function/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/objective_function/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..a9fdbbbf68758cf2a463614b37e87d03b4915884 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/objective_function/__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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 objective_function(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/connectivity-matrix/optimizations/objective-function. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: The objective function container that includes +attributes to impose when computing a TE path. + """ + __slots__ = ('_path_helper', '_extmethods', '__objective_function_type',) + + _yang_name = 'objective-function' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__objective_function_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'of-minimize-cost-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-cost-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-cost-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-minimize-load-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-load-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-load-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-maximize-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-maximize-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-maximize-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-minimize-agg-bandwidth-consumption': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-agg-bandwidth-consumption': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-agg-bandwidth-consumption': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-minimize-load-most-loaded-link': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-load-most-loaded-link': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-load-most-loaded-link': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-minimize-cost-path-set': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-cost-path-set': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-cost-path-set': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), default=six.text_type("te-types:of-minimize-cost-path"), is_leaf=True, yang_name="objective-function-type", parent=self, choice=('algorithm', 'objective-function'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', 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 ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'connectivity-matrix', 'optimizations', 'objective-function'] + + def _get_objective_function_type(self): + """ + Getter method for objective_function_type, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/objective_function/objective_function_type (identityref) + + YANG Description: Objective function entry. + """ + return self.__objective_function_type + + def _set_objective_function_type(self, v, load=False): + """ + Setter method for objective_function_type, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/objective_function/objective_function_type (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_objective_function_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_objective_function_type() directly. + + YANG Description: Objective function entry. + """ + 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={'of-minimize-cost-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-cost-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-cost-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-minimize-load-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-load-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-load-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-maximize-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-maximize-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-maximize-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-minimize-agg-bandwidth-consumption': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-agg-bandwidth-consumption': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-agg-bandwidth-consumption': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-minimize-load-most-loaded-link': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-load-most-loaded-link': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-load-most-loaded-link': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-minimize-cost-path-set': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-cost-path-set': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-cost-path-set': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), default=six.text_type("te-types:of-minimize-cost-path"), is_leaf=True, yang_name="objective-function-type", parent=self, choice=('algorithm', 'objective-function'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """objective_function_type must be of a type compatible with identityref""", + 'defined-type': "ietf-te-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'of-minimize-cost-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-cost-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-cost-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-minimize-load-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-load-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-load-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-maximize-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-maximize-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-maximize-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-minimize-agg-bandwidth-consumption': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-agg-bandwidth-consumption': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-agg-bandwidth-consumption': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-minimize-load-most-loaded-link': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-load-most-loaded-link': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-load-most-loaded-link': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-minimize-cost-path-set': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-cost-path-set': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-cost-path-set': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), default=six.text_type("te-types:of-minimize-cost-path"), is_leaf=True, yang_name="objective-function-type", parent=self, choice=('algorithm', 'objective-function'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False)""", + }) + + self.__objective_function_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_objective_function_type(self): + self.__objective_function_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'of-minimize-cost-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-cost-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-cost-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-minimize-load-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-load-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-load-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-maximize-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-maximize-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-maximize-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-minimize-agg-bandwidth-consumption': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-agg-bandwidth-consumption': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-agg-bandwidth-consumption': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-minimize-load-most-loaded-link': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-load-most-loaded-link': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-load-most-loaded-link': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-minimize-cost-path-set': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-cost-path-set': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-cost-path-set': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), default=six.text_type("te-types:of-minimize-cost-path"), is_leaf=True, yang_name="objective-function-type", parent=self, choice=('algorithm', 'objective-function'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + + objective_function_type = __builtin__.property(_get_objective_function_type) + + __choices__ = {'algorithm': {'objective-function': ['objective_function_type']}} + _pyangbind_elements = OrderedDict([('objective_function_type', objective_function_type), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..74c142e286f35832cce0def7cfde3f1f063ad8dd --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/__init__.py @@ -0,0 +1,241 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 explicit_route_exclude_objects +from . import explicit_route_include_objects +class optimization_metric(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/connectivity-matrix/optimizations/optimization-metric. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: TE path metric type. + """ + __slots__ = ('_path_helper', '_extmethods', '__metric_type','__weight','__explicit_route_exclude_objects','__explicit_route_include_objects',) + + _yang_name = 'optimization-metric' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__metric_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="metric-type", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + self.__weight = YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), default=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8)(1), is_leaf=True, yang_name="weight", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint8', is_config=False) + self.__explicit_route_exclude_objects = YANGDynClass(base=explicit_route_exclude_objects.explicit_route_exclude_objects, is_container='container', yang_name="explicit-route-exclude-objects", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__explicit_route_include_objects = YANGDynClass(base=explicit_route_include_objects.explicit_route_include_objects, is_container='container', yang_name="explicit-route-include-objects", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', 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 ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'connectivity-matrix', 'optimizations', 'optimization-metric'] + + def _get_metric_type(self): + """ + Getter method for metric_type, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/metric_type (identityref) + + YANG Description: Identifies the 'metric-type' that the path computation +process uses for optimization. + """ + return self.__metric_type + + def _set_metric_type(self, v, load=False): + """ + Setter method for metric_type, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/metric_type (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_metric_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_metric_type() directly. + + YANG Description: Identifies the 'metric-type' that the path computation +process uses for optimization. + """ + 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=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="metric-type", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """metric_type must be of a type compatible with identityref""", + 'defined-type': "ietf-te-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="metric-type", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False)""", + }) + + self.__metric_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_metric_type(self): + self.__metric_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="metric-type", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + + + def _get_weight(self): + """ + Getter method for weight, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/weight (uint8) + + YANG Description: TE path metric normalization weight. + """ + return self.__weight + + def _set_weight(self, v, load=False): + """ + Setter method for weight, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/weight (uint8) + If this variable is read-only (config: false) in the + source YANG file, then _set_weight is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_weight() directly. + + YANG Description: TE path metric normalization weight. + """ + 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), default=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8)(1), is_leaf=True, yang_name="weight", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint8', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """weight 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), default=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8)(1), is_leaf=True, yang_name="weight", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint8', is_config=False)""", + }) + + self.__weight = t + if hasattr(self, '_set'): + self._set() + + def _unset_weight(self): + self.__weight = YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), default=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8)(1), is_leaf=True, yang_name="weight", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint8', is_config=False) + + + def _get_explicit_route_exclude_objects(self): + """ + Getter method for explicit_route_exclude_objects, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects (container) + + YANG Description: Container for the 'exclude route' object list. + """ + return self.__explicit_route_exclude_objects + + def _set_explicit_route_exclude_objects(self, v, load=False): + """ + Setter method for explicit_route_exclude_objects, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_explicit_route_exclude_objects is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_explicit_route_exclude_objects() directly. + + YANG Description: Container for the 'exclude route' object list. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=explicit_route_exclude_objects.explicit_route_exclude_objects, is_container='container', yang_name="explicit-route-exclude-objects", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """explicit_route_exclude_objects must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=explicit_route_exclude_objects.explicit_route_exclude_objects, is_container='container', yang_name="explicit-route-exclude-objects", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__explicit_route_exclude_objects = t + if hasattr(self, '_set'): + self._set() + + def _unset_explicit_route_exclude_objects(self): + self.__explicit_route_exclude_objects = YANGDynClass(base=explicit_route_exclude_objects.explicit_route_exclude_objects, is_container='container', yang_name="explicit-route-exclude-objects", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_explicit_route_include_objects(self): + """ + Getter method for explicit_route_include_objects, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects (container) + + YANG Description: Container for the 'include route' object list. + """ + return self.__explicit_route_include_objects + + def _set_explicit_route_include_objects(self, v, load=False): + """ + Setter method for explicit_route_include_objects, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_explicit_route_include_objects is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_explicit_route_include_objects() directly. + + YANG Description: Container for the 'include route' object list. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=explicit_route_include_objects.explicit_route_include_objects, is_container='container', yang_name="explicit-route-include-objects", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """explicit_route_include_objects must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=explicit_route_include_objects.explicit_route_include_objects, is_container='container', yang_name="explicit-route-include-objects", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__explicit_route_include_objects = t + if hasattr(self, '_set'): + self._set() + + def _unset_explicit_route_include_objects(self): + self.__explicit_route_include_objects = YANGDynClass(base=explicit_route_include_objects.explicit_route_include_objects, is_container='container', yang_name="explicit-route-include-objects", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + metric_type = __builtin__.property(_get_metric_type) + weight = __builtin__.property(_get_weight) + explicit_route_exclude_objects = __builtin__.property(_get_explicit_route_exclude_objects) + explicit_route_include_objects = __builtin__.property(_get_explicit_route_include_objects) + + __choices__ = {'algorithm': {'metric': ['metric_type', 'weight', 'explicit_route_exclude_objects', 'explicit_route_include_objects']}} + _pyangbind_elements = OrderedDict([('metric_type', metric_type), ('weight', weight), ('explicit_route_exclude_objects', explicit_route_exclude_objects), ('explicit_route_include_objects', explicit_route_include_objects), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..ed88eea0523e3f83d8f162ce0bbec135e0dc81fa --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/__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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 route_object_exclude_object +class explicit_route_exclude_objects(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/connectivity-matrix/optimizations/optimization-metric/explicit-route-exclude-objects. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Container for the 'exclude route' object list. + """ + __slots__ = ('_path_helper', '_extmethods', '__route_object_exclude_object',) + + _yang_name = 'explicit-route-exclude-objects' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__route_object_exclude_object = YANGDynClass(base=YANGListType("index",route_object_exclude_object.route_object_exclude_object, yang_name="route-object-exclude-object", parent=self, is_container='list', user_ordered=True, path_helper=self._path_helper, yang_keys='index', extensions=None, choice=('algorithm', 'metric')), is_container='list', yang_name="route-object-exclude-object", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', 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 ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'connectivity-matrix', 'optimizations', 'optimization-metric', 'explicit-route-exclude-objects'] + + def _get_route_object_exclude_object(self): + """ + Getter method for route_object_exclude_object, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object (list) + + YANG Description: List of Explicit Route Objects to be excluded in the +path computation. + """ + return self.__route_object_exclude_object + + def _set_route_object_exclude_object(self, v, load=False): + """ + Setter method for route_object_exclude_object, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_route_object_exclude_object is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_route_object_exclude_object() directly. + + YANG Description: List of Explicit Route Objects to be excluded in the +path computation. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("index",route_object_exclude_object.route_object_exclude_object, yang_name="route-object-exclude-object", parent=self, is_container='list', user_ordered=True, path_helper=self._path_helper, yang_keys='index', extensions=None, choice=('algorithm', 'metric')), is_container='list', yang_name="route-object-exclude-object", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """route_object_exclude_object must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("index",route_object_exclude_object.route_object_exclude_object, yang_name="route-object-exclude-object", parent=self, is_container='list', user_ordered=True, path_helper=self._path_helper, yang_keys='index', extensions=None, choice=('algorithm', 'metric')), is_container='list', yang_name="route-object-exclude-object", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False)""", + }) + + self.__route_object_exclude_object = t + if hasattr(self, '_set'): + self._set() + + def _unset_route_object_exclude_object(self): + self.__route_object_exclude_object = YANGDynClass(base=YANGListType("index",route_object_exclude_object.route_object_exclude_object, yang_name="route-object-exclude-object", parent=self, is_container='list', user_ordered=True, path_helper=self._path_helper, yang_keys='index', extensions=None, choice=('algorithm', 'metric')), is_container='list', yang_name="route-object-exclude-object", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + + route_object_exclude_object = __builtin__.property(_get_route_object_exclude_object) + + __choices__ = {'algorithm': {'metric': ['route_object_exclude_object']}} + _pyangbind_elements = OrderedDict([('route_object_exclude_object', route_object_exclude_object), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..ad5bff3e1db5d7ba061f150470e3c611553f7ed6 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/__init__.py @@ -0,0 +1,365 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 numbered_node_hop +from . import numbered_link_hop +from . import unnumbered_link_hop +from . import as_number_hop +from . import label_hop +from . import srlg +class route_object_exclude_object(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/connectivity-matrix/optimizations/optimization-metric/explicit-route-exclude-objects/route-object-exclude-object. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: List of Explicit Route Objects to be excluded in the +path computation. + """ + __slots__ = ('_path_helper', '_extmethods', '__index','__numbered_node_hop','__numbered_link_hop','__unnumbered_link_hop','__as_number_hop','__label_hop','__srlg',) + + _yang_name = 'route-object-exclude-object' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _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), is_leaf=True, yang_name="index", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=False) + self.__numbered_node_hop = YANGDynClass(base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__numbered_link_hop = YANGDynClass(base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__unnumbered_link_hop = YANGDynClass(base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__as_number_hop = YANGDynClass(base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__label_hop = YANGDynClass(base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__srlg = YANGDynClass(base=srlg.srlg, is_container='container', yang_name="srlg", parent=self, choice=('type', 'srlg'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', 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 ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'connectivity-matrix', 'optimizations', 'optimization-metric', 'explicit-route-exclude-objects', 'route-object-exclude-object'] + + def _get_index(self): + """ + Getter method for index, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/index (uint32) + + YANG Description: Route object entry index. The index is used to +identify an entry in the list. The order of entries +is defined by the user without relying on key values. + """ + return self.__index + + def _set_index(self, v, load=False): + """ + Setter method for index, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/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: Route object entry index. The index is used to +identify an entry in the list. The order of entries +is defined by the user without relying on key values. + """ + 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=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="index", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', 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), is_leaf=True, yang_name="index", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', 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), is_leaf=True, yang_name="index", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=False) + + + def _get_numbered_node_hop(self): + """ + Getter method for numbered_node_hop, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/numbered_node_hop (container) + + YANG Description: Numbered node route hop. + """ + return self.__numbered_node_hop + + def _set_numbered_node_hop(self, v, load=False): + """ + Setter method for numbered_node_hop, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/numbered_node_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_numbered_node_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_numbered_node_hop() directly. + + YANG Description: Numbered node route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """numbered_node_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__numbered_node_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_numbered_node_hop(self): + self.__numbered_node_hop = YANGDynClass(base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_numbered_link_hop(self): + """ + Getter method for numbered_link_hop, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/numbered_link_hop (container) + + YANG Description: Numbered link explicit route hop. + """ + return self.__numbered_link_hop + + def _set_numbered_link_hop(self, v, load=False): + """ + Setter method for numbered_link_hop, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/numbered_link_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_numbered_link_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_numbered_link_hop() directly. + + YANG Description: Numbered link explicit route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """numbered_link_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__numbered_link_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_numbered_link_hop(self): + self.__numbered_link_hop = YANGDynClass(base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_unnumbered_link_hop(self): + """ + Getter method for unnumbered_link_hop, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/unnumbered_link_hop (container) + + YANG Description: Unnumbered link explicit route hop. + """ + return self.__unnumbered_link_hop + + def _set_unnumbered_link_hop(self, v, load=False): + """ + Setter method for unnumbered_link_hop, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/unnumbered_link_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_unnumbered_link_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_unnumbered_link_hop() directly. + + YANG Description: Unnumbered link explicit route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """unnumbered_link_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__unnumbered_link_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_unnumbered_link_hop(self): + self.__unnumbered_link_hop = YANGDynClass(base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_as_number_hop(self): + """ + Getter method for as_number_hop, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/as_number_hop (container) + + YANG Description: AS explicit route hop. + """ + return self.__as_number_hop + + def _set_as_number_hop(self, v, load=False): + """ + Setter method for as_number_hop, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/as_number_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_as_number_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_as_number_hop() directly. + + YANG Description: AS explicit route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """as_number_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__as_number_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_as_number_hop(self): + self.__as_number_hop = YANGDynClass(base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_label_hop(self): + """ + Getter method for label_hop, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop (container) + + YANG Description: Label hop type. + """ + return self.__label_hop + + def _set_label_hop(self, v, load=False): + """ + Setter method for label_hop, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_label_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_label_hop() directly. + + YANG Description: Label hop type. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """label_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__label_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_label_hop(self): + self.__label_hop = YANGDynClass(base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_srlg(self): + """ + Getter method for srlg, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/srlg (container) + + YANG Description: SRLG container. + """ + return self.__srlg + + def _set_srlg(self, v, load=False): + """ + Setter method for srlg, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/srlg (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_srlg is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_srlg() directly. + + YANG Description: SRLG container. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=srlg.srlg, is_container='container', yang_name="srlg", parent=self, choice=('type', 'srlg'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """srlg must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=srlg.srlg, is_container='container', yang_name="srlg", parent=self, choice=('type', 'srlg'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__srlg = t + if hasattr(self, '_set'): + self._set() + + def _unset_srlg(self): + self.__srlg = YANGDynClass(base=srlg.srlg, is_container='container', yang_name="srlg", parent=self, choice=('type', 'srlg'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + index = __builtin__.property(_get_index) + numbered_node_hop = __builtin__.property(_get_numbered_node_hop) + numbered_link_hop = __builtin__.property(_get_numbered_link_hop) + unnumbered_link_hop = __builtin__.property(_get_unnumbered_link_hop) + as_number_hop = __builtin__.property(_get_as_number_hop) + label_hop = __builtin__.property(_get_label_hop) + srlg = __builtin__.property(_get_srlg) + + __choices__ = {'algorithm': {'metric': ['index']}, 'type': {'numbered-node-hop': ['numbered_node_hop'], 'numbered-link-hop': ['numbered_link_hop'], 'unnumbered-link-hop': ['unnumbered_link_hop'], 'as-number': ['as_number_hop'], 'label': ['label_hop'], 'srlg': ['srlg']}} + _pyangbind_elements = OrderedDict([('index', index), ('numbered_node_hop', numbered_node_hop), ('numbered_link_hop', numbered_link_hop), ('unnumbered_link_hop', unnumbered_link_hop), ('as_number_hop', as_number_hop), ('label_hop', label_hop), ('srlg', srlg), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/as_number_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/as_number_hop/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..40a38d18d628ed146248bdc5225294c9735e8f71 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/as_number_hop/__init__.py @@ -0,0 +1,154 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 as_number_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/connectivity-matrix/optimizations/optimization-metric/explicit-route-exclude-objects/route-object-exclude-object/as-number-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: AS explicit route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__as_number','__hop_type',) + + _yang_name = 'as-number-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__as_number = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=False) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', 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 ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'connectivity-matrix', 'optimizations', 'optimization-metric', 'explicit-route-exclude-objects', 'route-object-exclude-object', 'as-number-hop'] + + def _get_as_number(self): + """ + Getter method for as_number, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/as_number_hop/as_number (inet:as-number) + + YANG Description: The Autonomous System (AS) number. + """ + return self.__as_number + + def _set_as_number(self, v, load=False): + """ + Setter method for as_number, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/as_number_hop/as_number (inet:as-number) + If this variable is read-only (config: false) in the + source YANG file, then _set_as_number is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_as_number() directly. + + YANG Description: The Autonomous System (AS) number. + """ + 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="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """as_number must be of a type compatible with inet:as-number""", + 'defined-type': "inet:as-number", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=False)""", + }) + + self.__as_number = t + if hasattr(self, '_set'): + self._set() + + def _unset_as_number(self): + self.__as_number = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=False) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/as_number_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/as_number_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + 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={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + + as_number = __builtin__.property(_get_as_number) + hop_type = __builtin__.property(_get_hop_type) + + __choices__ = {'type': {'as-number': ['as_number', 'hop_type']}} + _pyangbind_elements = OrderedDict([('as_number', as_number), ('hop_type', hop_type), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..d86889be2e17816277f7cc9d2f844cf3bbfeeb2e --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/__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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 te_label +class label_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/connectivity-matrix/optimizations/optimization-metric/explicit-route-exclude-objects/route-object-exclude-object/label-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Label hop type. + """ + __slots__ = ('_path_helper', '_extmethods', '__te_label',) + + _yang_name = 'label-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__te_label = YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', 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 ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'connectivity-matrix', 'optimizations', 'optimization-metric', 'explicit-route-exclude-objects', 'route-object-exclude-object', 'label-hop'] + + def _get_te_label(self): + """ + Getter method for te_label, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label (container) + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + return self.__te_label + + def _set_te_label(self, v, load=False): + """ + Setter method for te_label, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_te_label is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_te_label() directly. + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """te_label must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__te_label = t + if hasattr(self, '_set'): + self._set() + + def _unset_te_label(self): + self.__te_label = YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + te_label = __builtin__.property(_get_te_label) + + __choices__ = {'type': {'label': ['te_label']}} + _pyangbind_elements = OrderedDict([('te_label', te_label), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..b404a2341dd3c0b52f3ddcf6d370a8649aa6252b --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label/__init__.py @@ -0,0 +1,234 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 otn +class te_label(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/connectivity-matrix/optimizations/optimization-metric/explicit-route-exclude-objects/route-object-exclude-object/label-hop/te-label. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + __slots__ = ('_path_helper', '_extmethods', '__generic','__otn','__vlanid','__direction',) + + _yang_name = 'te-label' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__generic = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=False) + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False) + self.__vlanid = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=False) + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', 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 ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'connectivity-matrix', 'optimizations', 'optimization-metric', 'explicit-route-exclude-objects', 'route-object-exclude-object', 'label-hop', 'te-label'] + + def _get_generic(self): + """ + Getter method for generic, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label/generic (rt-types:generalized-label) + + YANG Description: TE label specified in a generic format. + """ + return self.__generic + + def _set_generic(self, v, load=False): + """ + Setter method for generic, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label/generic (rt-types:generalized-label) + If this variable is read-only (config: false) in the + source YANG file, then _set_generic is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_generic() directly. + + YANG Description: TE label specified in a generic format. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """generic must be of a type compatible with rt-types:generalized-label""", + 'defined-type': "rt-types:generalized-label", + 'generated-type': """YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=False)""", + }) + + self.__generic = t + if hasattr(self, '_set'): + self._set() + + def _unset_generic(self): + self.__generic = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=False) + + + def _get_otn(self): + """ + Getter method for otn, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label/otn (container) + + YANG Description: Label hop for OTN. + """ + return self.__otn + + def _set_otn(self, v, load=False): + """ + Setter method for otn, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label/otn (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_otn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_otn() directly. + + YANG Description: Label hop for OTN. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """otn must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False)""", + }) + + self.__otn = t + if hasattr(self, '_set'): + self._set() + + def _unset_otn(self): + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False) + + + def _get_vlanid(self): + """ + Getter method for vlanid, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label/vlanid (etht-types:vlanid) + + YANG Description: VLAN tag id. + """ + return self.__vlanid + + def _set_vlanid(self, v, load=False): + """ + Setter method for vlanid, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label/vlanid (etht-types:vlanid) + If this variable is read-only (config: false) in the + source YANG file, then _set_vlanid is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_vlanid() directly. + + YANG Description: VLAN tag id. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """vlanid must be of a type compatible with etht-types:vlanid""", + 'defined-type': "etht-types:vlanid", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=False)""", + }) + + self.__vlanid = t + if hasattr(self, '_set'): + self._set() + + def _unset_vlanid(self): + self.__vlanid = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=False) + + + def _get_direction(self): + """ + Getter method for direction, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label/direction (te-label-direction) + + YANG Description: Label direction. + """ + return self.__direction + + def _set_direction(self, v, load=False): + """ + Setter method for direction, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label/direction (te-label-direction) + If this variable is read-only (config: false) in the + source YANG file, then _set_direction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_direction() directly. + + YANG Description: Label direction. + """ + 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={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """direction must be of a type compatible with te-label-direction""", + 'defined-type': "ietf-te-topology:te-label-direction", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=False)""", + }) + + self.__direction = t + if hasattr(self, '_set'): + self._set() + + def _unset_direction(self): + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=False) + + generic = __builtin__.property(_get_generic) + otn = __builtin__.property(_get_otn) + vlanid = __builtin__.property(_get_vlanid) + direction = __builtin__.property(_get_direction) + + __choices__ = {'technology': {'generic': ['generic'], 'otn': ['otn'], 'eth': ['vlanid']}, 'type': {'label': ['direction']}} + _pyangbind_elements = OrderedDict([('generic', generic), ('otn', otn), ('vlanid', vlanid), ('direction', direction), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label/otn/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label/otn/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..fbabbb174ea802870622969f3ebfdc96041ec866 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label/otn/__init__.py @@ -0,0 +1,209 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 otn(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/connectivity-matrix/optimizations/optimization-metric/explicit-route-exclude-objects/route-object-exclude-object/label-hop/te-label/otn. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Label hop for OTN. + """ + __slots__ = ('_path_helper', '_extmethods', '__tpn','__tsg','__ts_list',) + + _yang_name = 'otn' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__tpn = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=False) + self.__tsg = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=False) + self.__ts_list = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', 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 ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'connectivity-matrix', 'optimizations', 'optimization-metric', 'explicit-route-exclude-objects', 'route-object-exclude-object', 'label-hop', 'te-label', 'otn'] + + def _get_tpn(self): + """ + Getter method for tpn, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label/otn/tpn (otn-tpn) + + YANG Description: Tributary Port Number (TPN). + """ + return self.__tpn + + def _set_tpn(self, v, load=False): + """ + Setter method for tpn, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label/otn/tpn (otn-tpn) + If this variable is read-only (config: false) in the + source YANG file, then _set_tpn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tpn() directly. + + YANG Description: Tributary Port Number (TPN). + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tpn must be of a type compatible with otn-tpn""", + 'defined-type': "ietf-otn-topology:otn-tpn", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=False)""", + }) + + self.__tpn = t + if hasattr(self, '_set'): + self._set() + + def _unset_tpn(self): + self.__tpn = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=False) + + + def _get_tsg(self): + """ + Getter method for tsg, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label/otn/tsg (identityref) + + YANG Description: Tributary Slot Granularity (TSG). + """ + return self.__tsg + + def _set_tsg(self, v, load=False): + """ + Setter method for tsg, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label/otn/tsg (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_tsg is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tsg() directly. + + YANG Description: Tributary Slot Granularity (TSG). + """ + 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={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tsg must be of a type compatible with identityref""", + 'defined-type': "ietf-otn-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=False)""", + }) + + self.__tsg = t + if hasattr(self, '_set'): + self._set() + + def _unset_tsg(self): + self.__tsg = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=False) + + + def _get_ts_list(self): + """ + Getter method for ts_list, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label/otn/ts_list (string) + + YANG Description: A list of available Tributary Slots (TS) ranging + + + + +between 1 and 4095. If multiple values or +ranges are given, they all MUST be disjoint +and MUST be in ascending order. +For example 1-20,25,50-1000. + """ + return self.__ts_list + + def _set_ts_list(self, v, load=False): + """ + Setter method for ts_list, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label/otn/ts_list (string) + If this variable is read-only (config: false) in the + source YANG file, then _set_ts_list is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_ts_list() directly. + + YANG Description: A list of available Tributary Slots (TS) ranging + + + + +between 1 and 4095. If multiple values or +ranges are given, they all MUST be disjoint +and MUST be in ascending order. +For example 1-20,25,50-1000. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='string', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """ts_list must be of a type compatible with string""", + 'defined-type': "string", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='string', is_config=False)""", + }) + + self.__ts_list = t + if hasattr(self, '_set'): + self._set() + + def _unset_ts_list(self): + self.__ts_list = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='string', is_config=False) + + tpn = __builtin__.property(_get_tpn) + tsg = __builtin__.property(_get_tsg) + ts_list = __builtin__.property(_get_ts_list) + + __choices__ = {'technology': {'otn': ['tpn', 'tsg', 'ts_list']}} + _pyangbind_elements = OrderedDict([('tpn', tpn), ('tsg', tsg), ('ts_list', ts_list), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/numbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/numbered_link_hop/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..4a9ce25d09b5b8f875683b6ddfb480498d02c772 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/numbered_link_hop/__init__.py @@ -0,0 +1,193 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 numbered_link_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/connectivity-matrix/optimizations/optimization-metric/explicit-route-exclude-objects/route-object-exclude-object/numbered-link-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Numbered link explicit route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__link_tp_id','__hop_type','__direction',) + + _yang_name = 'numbered-link-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=False) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', 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 ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'connectivity-matrix', 'optimizations', 'optimization-metric', 'explicit-route-exclude-objects', 'route-object-exclude-object', 'numbered-link-hop'] + + def _get_link_tp_id(self): + """ + Getter method for link_tp_id, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/numbered_link_hop/link_tp_id (te-tp-id) + + YANG Description: TE Link Termination Point (LTP) identifier. + """ + return self.__link_tp_id + + def _set_link_tp_id(self, v, load=False): + """ + Setter method for link_tp_id, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/numbered_link_hop/link_tp_id (te-tp-id) + If this variable is read-only (config: false) in the + source YANG file, then _set_link_tp_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_link_tp_id() directly. + + YANG Description: TE Link Termination Point (LTP) identifier. + """ + 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),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """link_tp_id must be of a type compatible with te-tp-id""", + 'defined-type': "ietf-te-topology:te-tp-id", + 'generated-type': """YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=False)""", + }) + + self.__link_tp_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_link_tp_id(self): + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=False) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/numbered_link_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/numbered_link_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + 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={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + + + def _get_direction(self): + """ + Getter method for direction, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/numbered_link_hop/direction (te-link-direction) + + YANG Description: Link route object direction. + """ + return self.__direction + + def _set_direction(self, v, load=False): + """ + Setter method for direction, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/numbered_link_hop/direction (te-link-direction) + If this variable is read-only (config: false) in the + source YANG file, then _set_direction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_direction() directly. + + YANG Description: Link route object direction. + """ + 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={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """direction must be of a type compatible with te-link-direction""", + 'defined-type': "ietf-te-topology:te-link-direction", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=False)""", + }) + + self.__direction = t + if hasattr(self, '_set'): + self._set() + + def _unset_direction(self): + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=False) + + link_tp_id = __builtin__.property(_get_link_tp_id) + hop_type = __builtin__.property(_get_hop_type) + direction = __builtin__.property(_get_direction) + + __choices__ = {'type': {'numbered-link-hop': ['link_tp_id', 'hop_type', 'direction']}} + _pyangbind_elements = OrderedDict([('link_tp_id', link_tp_id), ('hop_type', hop_type), ('direction', direction), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/numbered_node_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/numbered_node_hop/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..81ae5ee3b77f37707e2da604edf964ff04ec629a --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/numbered_node_hop/__init__.py @@ -0,0 +1,154 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 numbered_node_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/connectivity-matrix/optimizations/optimization-metric/explicit-route-exclude-objects/route-object-exclude-object/numbered-node-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Numbered node route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__node_id','__hop_type',) + + _yang_name = 'numbered-node-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=False) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', 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 ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'connectivity-matrix', 'optimizations', 'optimization-metric', 'explicit-route-exclude-objects', 'route-object-exclude-object', 'numbered-node-hop'] + + def _get_node_id(self): + """ + Getter method for node_id, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/numbered_node_hop/node_id (te-node-id) + + YANG Description: The identifier of a node in the TE topology. + """ + return self.__node_id + + def _set_node_id(self, v, load=False): + """ + Setter method for node_id, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/numbered_node_hop/node_id (te-node-id) + 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. + + YANG Description: The identifier of a node in the TE topology. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """node_id must be of a type compatible with te-node-id""", + 'defined-type': "ietf-te-topology:te-node-id", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=False)""", + }) + + self.__node_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_node_id(self): + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=False) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/numbered_node_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/numbered_node_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + 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={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + + node_id = __builtin__.property(_get_node_id) + hop_type = __builtin__.property(_get_hop_type) + + __choices__ = {'type': {'numbered-node-hop': ['node_id', 'hop_type']}} + _pyangbind_elements = OrderedDict([('node_id', node_id), ('hop_type', hop_type), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/srlg/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/srlg/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..ba86eb284b0d67d02217472f28df7cd6bcaec674 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/srlg/__init__.py @@ -0,0 +1,115 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 srlg(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/connectivity-matrix/optimizations/optimization-metric/explicit-route-exclude-objects/route-object-exclude-object/srlg. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: SRLG container. + """ + __slots__ = ('_path_helper', '_extmethods', '__srlg',) + + _yang_name = 'srlg' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__srlg = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="srlg", parent=self, choice=('type', 'srlg'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', 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 ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'connectivity-matrix', 'optimizations', 'optimization-metric', 'explicit-route-exclude-objects', 'route-object-exclude-object', 'srlg'] + + def _get_srlg(self): + """ + Getter method for srlg, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/srlg/srlg (uint32) + + YANG Description: SRLG value. + """ + return self.__srlg + + def _set_srlg(self, v, load=False): + """ + Setter method for srlg, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/srlg/srlg (uint32) + If this variable is read-only (config: false) in the + source YANG file, then _set_srlg is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_srlg() directly. + + YANG Description: SRLG value. + """ + 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="srlg", parent=self, choice=('type', 'srlg'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """srlg 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="srlg", parent=self, choice=('type', 'srlg'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=False)""", + }) + + self.__srlg = t + if hasattr(self, '_set'): + self._set() + + def _unset_srlg(self): + self.__srlg = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="srlg", parent=self, choice=('type', 'srlg'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=False) + + srlg = __builtin__.property(_get_srlg) + + __choices__ = {'type': {'srlg': ['srlg']}} + _pyangbind_elements = OrderedDict([('srlg', srlg), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/unnumbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/unnumbered_link_hop/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..edb8b9e25e13ebe6ee7960ab0f7c5e2d8dee9012 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/unnumbered_link_hop/__init__.py @@ -0,0 +1,236 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 unnumbered_link_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/connectivity-matrix/optimizations/optimization-metric/explicit-route-exclude-objects/route-object-exclude-object/unnumbered-link-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Unnumbered link explicit route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__link_tp_id','__node_id','__hop_type','__direction',) + + _yang_name = 'unnumbered-link-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=False) + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=False) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', 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 ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'connectivity-matrix', 'optimizations', 'optimization-metric', 'explicit-route-exclude-objects', 'route-object-exclude-object', 'unnumbered-link-hop'] + + def _get_link_tp_id(self): + """ + Getter method for link_tp_id, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/unnumbered_link_hop/link_tp_id (te-tp-id) + + YANG Description: TE LTP identifier. The combination of the TE link ID +and the TE node ID is used to identify an unnumbered +TE link. + """ + return self.__link_tp_id + + def _set_link_tp_id(self, v, load=False): + """ + Setter method for link_tp_id, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/unnumbered_link_hop/link_tp_id (te-tp-id) + If this variable is read-only (config: false) in the + source YANG file, then _set_link_tp_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_link_tp_id() directly. + + YANG Description: TE LTP identifier. The combination of the TE link ID +and the TE node ID is used to identify an unnumbered +TE link. + """ + 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),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """link_tp_id must be of a type compatible with te-tp-id""", + 'defined-type': "ietf-te-topology:te-tp-id", + 'generated-type': """YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=False)""", + }) + + self.__link_tp_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_link_tp_id(self): + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=False) + + + def _get_node_id(self): + """ + Getter method for node_id, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/unnumbered_link_hop/node_id (te-node-id) + + YANG Description: The identifier of a node in the TE topology. + """ + return self.__node_id + + def _set_node_id(self, v, load=False): + """ + Setter method for node_id, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/unnumbered_link_hop/node_id (te-node-id) + 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. + + YANG Description: The identifier of a node in the TE topology. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """node_id must be of a type compatible with te-node-id""", + 'defined-type': "ietf-te-topology:te-node-id", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=False)""", + }) + + self.__node_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_node_id(self): + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=False) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/unnumbered_link_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/unnumbered_link_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + 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={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + + + def _get_direction(self): + """ + Getter method for direction, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/unnumbered_link_hop/direction (te-link-direction) + + YANG Description: Link route object direction. + """ + return self.__direction + + def _set_direction(self, v, load=False): + """ + Setter method for direction, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/unnumbered_link_hop/direction (te-link-direction) + If this variable is read-only (config: false) in the + source YANG file, then _set_direction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_direction() directly. + + YANG Description: Link route object direction. + """ + 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={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """direction must be of a type compatible with te-link-direction""", + 'defined-type': "ietf-te-topology:te-link-direction", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=False)""", + }) + + self.__direction = t + if hasattr(self, '_set'): + self._set() + + def _unset_direction(self): + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=False) + + link_tp_id = __builtin__.property(_get_link_tp_id) + node_id = __builtin__.property(_get_node_id) + hop_type = __builtin__.property(_get_hop_type) + direction = __builtin__.property(_get_direction) + + __choices__ = {'type': {'unnumbered-link-hop': ['link_tp_id', 'node_id', 'hop_type', 'direction']}} + _pyangbind_elements = OrderedDict([('link_tp_id', link_tp_id), ('node_id', node_id), ('hop_type', hop_type), ('direction', direction), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..21986a9121fe59debbe172846f8a3555461a08dd --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/__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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 route_object_include_object +class explicit_route_include_objects(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/connectivity-matrix/optimizations/optimization-metric/explicit-route-include-objects. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Container for the 'include route' object list. + """ + __slots__ = ('_path_helper', '_extmethods', '__route_object_include_object',) + + _yang_name = 'explicit-route-include-objects' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__route_object_include_object = YANGDynClass(base=YANGListType("index",route_object_include_object.route_object_include_object, yang_name="route-object-include-object", parent=self, is_container='list', user_ordered=True, path_helper=self._path_helper, yang_keys='index', extensions=None, choice=('algorithm', 'metric')), is_container='list', yang_name="route-object-include-object", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', 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 ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'connectivity-matrix', 'optimizations', 'optimization-metric', 'explicit-route-include-objects'] + + def _get_route_object_include_object(self): + """ + Getter method for route_object_include_object, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object (list) + + YANG Description: List of Explicit Route Objects to be included in the +path computation. + """ + return self.__route_object_include_object + + def _set_route_object_include_object(self, v, load=False): + """ + Setter method for route_object_include_object, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_route_object_include_object is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_route_object_include_object() directly. + + YANG Description: List of Explicit Route Objects to be included in the +path computation. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("index",route_object_include_object.route_object_include_object, yang_name="route-object-include-object", parent=self, is_container='list', user_ordered=True, path_helper=self._path_helper, yang_keys='index', extensions=None, choice=('algorithm', 'metric')), is_container='list', yang_name="route-object-include-object", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """route_object_include_object must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("index",route_object_include_object.route_object_include_object, yang_name="route-object-include-object", parent=self, is_container='list', user_ordered=True, path_helper=self._path_helper, yang_keys='index', extensions=None, choice=('algorithm', 'metric')), is_container='list', yang_name="route-object-include-object", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False)""", + }) + + self.__route_object_include_object = t + if hasattr(self, '_set'): + self._set() + + def _unset_route_object_include_object(self): + self.__route_object_include_object = YANGDynClass(base=YANGListType("index",route_object_include_object.route_object_include_object, yang_name="route-object-include-object", parent=self, is_container='list', user_ordered=True, path_helper=self._path_helper, yang_keys='index', extensions=None, choice=('algorithm', 'metric')), is_container='list', yang_name="route-object-include-object", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + + route_object_include_object = __builtin__.property(_get_route_object_include_object) + + __choices__ = {'algorithm': {'metric': ['route_object_include_object']}} + _pyangbind_elements = OrderedDict([('route_object_include_object', route_object_include_object), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..5140272eec2eedae3de75b2f870493f81ce95e8a --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/__init__.py @@ -0,0 +1,325 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 numbered_node_hop +from . import numbered_link_hop +from . import unnumbered_link_hop +from . import as_number_hop +from . import label_hop +class route_object_include_object(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/connectivity-matrix/optimizations/optimization-metric/explicit-route-include-objects/route-object-include-object. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: List of Explicit Route Objects to be included in the +path computation. + """ + __slots__ = ('_path_helper', '_extmethods', '__index','__numbered_node_hop','__numbered_link_hop','__unnumbered_link_hop','__as_number_hop','__label_hop',) + + _yang_name = 'route-object-include-object' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _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), is_leaf=True, yang_name="index", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=False) + self.__numbered_node_hop = YANGDynClass(base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__numbered_link_hop = YANGDynClass(base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__unnumbered_link_hop = YANGDynClass(base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__as_number_hop = YANGDynClass(base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__label_hop = YANGDynClass(base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', 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 ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'connectivity-matrix', 'optimizations', 'optimization-metric', 'explicit-route-include-objects', 'route-object-include-object'] + + def _get_index(self): + """ + Getter method for index, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/index (uint32) + + YANG Description: Route object entry index. The index is used to +identify an entry in the list. The order of entries +is defined by the user without relying on key values. + """ + return self.__index + + def _set_index(self, v, load=False): + """ + Setter method for index, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/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: Route object entry index. The index is used to +identify an entry in the list. The order of entries +is defined by the user without relying on key values. + """ + 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=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="index", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', 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), is_leaf=True, yang_name="index", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', 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), is_leaf=True, yang_name="index", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=False) + + + def _get_numbered_node_hop(self): + """ + Getter method for numbered_node_hop, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/numbered_node_hop (container) + + YANG Description: Numbered node route hop. + """ + return self.__numbered_node_hop + + def _set_numbered_node_hop(self, v, load=False): + """ + Setter method for numbered_node_hop, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/numbered_node_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_numbered_node_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_numbered_node_hop() directly. + + YANG Description: Numbered node route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """numbered_node_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__numbered_node_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_numbered_node_hop(self): + self.__numbered_node_hop = YANGDynClass(base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_numbered_link_hop(self): + """ + Getter method for numbered_link_hop, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/numbered_link_hop (container) + + YANG Description: Numbered link explicit route hop. + """ + return self.__numbered_link_hop + + def _set_numbered_link_hop(self, v, load=False): + """ + Setter method for numbered_link_hop, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/numbered_link_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_numbered_link_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_numbered_link_hop() directly. + + YANG Description: Numbered link explicit route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """numbered_link_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__numbered_link_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_numbered_link_hop(self): + self.__numbered_link_hop = YANGDynClass(base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_unnumbered_link_hop(self): + """ + Getter method for unnumbered_link_hop, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/unnumbered_link_hop (container) + + YANG Description: Unnumbered link explicit route hop. + """ + return self.__unnumbered_link_hop + + def _set_unnumbered_link_hop(self, v, load=False): + """ + Setter method for unnumbered_link_hop, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/unnumbered_link_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_unnumbered_link_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_unnumbered_link_hop() directly. + + YANG Description: Unnumbered link explicit route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """unnumbered_link_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__unnumbered_link_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_unnumbered_link_hop(self): + self.__unnumbered_link_hop = YANGDynClass(base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_as_number_hop(self): + """ + Getter method for as_number_hop, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/as_number_hop (container) + + YANG Description: AS explicit route hop. + """ + return self.__as_number_hop + + def _set_as_number_hop(self, v, load=False): + """ + Setter method for as_number_hop, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/as_number_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_as_number_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_as_number_hop() directly. + + YANG Description: AS explicit route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """as_number_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__as_number_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_as_number_hop(self): + self.__as_number_hop = YANGDynClass(base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_label_hop(self): + """ + Getter method for label_hop, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop (container) + + YANG Description: Label hop type. + """ + return self.__label_hop + + def _set_label_hop(self, v, load=False): + """ + Setter method for label_hop, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_label_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_label_hop() directly. + + YANG Description: Label hop type. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """label_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__label_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_label_hop(self): + self.__label_hop = YANGDynClass(base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + index = __builtin__.property(_get_index) + numbered_node_hop = __builtin__.property(_get_numbered_node_hop) + numbered_link_hop = __builtin__.property(_get_numbered_link_hop) + unnumbered_link_hop = __builtin__.property(_get_unnumbered_link_hop) + as_number_hop = __builtin__.property(_get_as_number_hop) + label_hop = __builtin__.property(_get_label_hop) + + __choices__ = {'algorithm': {'metric': ['index']}, 'type': {'numbered-node-hop': ['numbered_node_hop'], 'numbered-link-hop': ['numbered_link_hop'], 'unnumbered-link-hop': ['unnumbered_link_hop'], 'as-number': ['as_number_hop'], 'label': ['label_hop']}} + _pyangbind_elements = OrderedDict([('index', index), ('numbered_node_hop', numbered_node_hop), ('numbered_link_hop', numbered_link_hop), ('unnumbered_link_hop', unnumbered_link_hop), ('as_number_hop', as_number_hop), ('label_hop', label_hop), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/as_number_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/as_number_hop/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..0f65b4645ffa752af6fd7b7d7fb5b666c4e06fa4 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/as_number_hop/__init__.py @@ -0,0 +1,154 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 as_number_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/connectivity-matrix/optimizations/optimization-metric/explicit-route-include-objects/route-object-include-object/as-number-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: AS explicit route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__as_number','__hop_type',) + + _yang_name = 'as-number-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__as_number = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=False) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', 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 ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'connectivity-matrix', 'optimizations', 'optimization-metric', 'explicit-route-include-objects', 'route-object-include-object', 'as-number-hop'] + + def _get_as_number(self): + """ + Getter method for as_number, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/as_number_hop/as_number (inet:as-number) + + YANG Description: The Autonomous System (AS) number. + """ + return self.__as_number + + def _set_as_number(self, v, load=False): + """ + Setter method for as_number, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/as_number_hop/as_number (inet:as-number) + If this variable is read-only (config: false) in the + source YANG file, then _set_as_number is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_as_number() directly. + + YANG Description: The Autonomous System (AS) number. + """ + 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="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """as_number must be of a type compatible with inet:as-number""", + 'defined-type': "inet:as-number", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=False)""", + }) + + self.__as_number = t + if hasattr(self, '_set'): + self._set() + + def _unset_as_number(self): + self.__as_number = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=False) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/as_number_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/as_number_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + 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={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + + as_number = __builtin__.property(_get_as_number) + hop_type = __builtin__.property(_get_hop_type) + + __choices__ = {'type': {'as-number': ['as_number', 'hop_type']}} + _pyangbind_elements = OrderedDict([('as_number', as_number), ('hop_type', hop_type), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..882e1f01ad2e280789f31daa41c1cfd7db8c0b0b --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/__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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 te_label +class label_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/connectivity-matrix/optimizations/optimization-metric/explicit-route-include-objects/route-object-include-object/label-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Label hop type. + """ + __slots__ = ('_path_helper', '_extmethods', '__te_label',) + + _yang_name = 'label-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__te_label = YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', 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 ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'connectivity-matrix', 'optimizations', 'optimization-metric', 'explicit-route-include-objects', 'route-object-include-object', 'label-hop'] + + def _get_te_label(self): + """ + Getter method for te_label, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label (container) + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + return self.__te_label + + def _set_te_label(self, v, load=False): + """ + Setter method for te_label, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_te_label is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_te_label() directly. + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """te_label must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__te_label = t + if hasattr(self, '_set'): + self._set() + + def _unset_te_label(self): + self.__te_label = YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + te_label = __builtin__.property(_get_te_label) + + __choices__ = {'type': {'label': ['te_label']}} + _pyangbind_elements = OrderedDict([('te_label', te_label), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..2dde61c314cd20e407b23b60262896426b0bad5a --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label/__init__.py @@ -0,0 +1,234 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 otn +class te_label(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/connectivity-matrix/optimizations/optimization-metric/explicit-route-include-objects/route-object-include-object/label-hop/te-label. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + __slots__ = ('_path_helper', '_extmethods', '__generic','__otn','__vlanid','__direction',) + + _yang_name = 'te-label' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__generic = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=False) + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False) + self.__vlanid = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=False) + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', 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 ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'connectivity-matrix', 'optimizations', 'optimization-metric', 'explicit-route-include-objects', 'route-object-include-object', 'label-hop', 'te-label'] + + def _get_generic(self): + """ + Getter method for generic, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label/generic (rt-types:generalized-label) + + YANG Description: TE label specified in a generic format. + """ + return self.__generic + + def _set_generic(self, v, load=False): + """ + Setter method for generic, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label/generic (rt-types:generalized-label) + If this variable is read-only (config: false) in the + source YANG file, then _set_generic is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_generic() directly. + + YANG Description: TE label specified in a generic format. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """generic must be of a type compatible with rt-types:generalized-label""", + 'defined-type': "rt-types:generalized-label", + 'generated-type': """YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=False)""", + }) + + self.__generic = t + if hasattr(self, '_set'): + self._set() + + def _unset_generic(self): + self.__generic = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=False) + + + def _get_otn(self): + """ + Getter method for otn, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label/otn (container) + + YANG Description: Label hop for OTN. + """ + return self.__otn + + def _set_otn(self, v, load=False): + """ + Setter method for otn, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label/otn (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_otn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_otn() directly. + + YANG Description: Label hop for OTN. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """otn must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False)""", + }) + + self.__otn = t + if hasattr(self, '_set'): + self._set() + + def _unset_otn(self): + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False) + + + def _get_vlanid(self): + """ + Getter method for vlanid, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label/vlanid (etht-types:vlanid) + + YANG Description: VLAN tag id. + """ + return self.__vlanid + + def _set_vlanid(self, v, load=False): + """ + Setter method for vlanid, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label/vlanid (etht-types:vlanid) + If this variable is read-only (config: false) in the + source YANG file, then _set_vlanid is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_vlanid() directly. + + YANG Description: VLAN tag id. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """vlanid must be of a type compatible with etht-types:vlanid""", + 'defined-type': "etht-types:vlanid", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=False)""", + }) + + self.__vlanid = t + if hasattr(self, '_set'): + self._set() + + def _unset_vlanid(self): + self.__vlanid = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=False) + + + def _get_direction(self): + """ + Getter method for direction, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label/direction (te-label-direction) + + YANG Description: Label direction. + """ + return self.__direction + + def _set_direction(self, v, load=False): + """ + Setter method for direction, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label/direction (te-label-direction) + If this variable is read-only (config: false) in the + source YANG file, then _set_direction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_direction() directly. + + YANG Description: Label direction. + """ + 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={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """direction must be of a type compatible with te-label-direction""", + 'defined-type': "ietf-te-topology:te-label-direction", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=False)""", + }) + + self.__direction = t + if hasattr(self, '_set'): + self._set() + + def _unset_direction(self): + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=False) + + generic = __builtin__.property(_get_generic) + otn = __builtin__.property(_get_otn) + vlanid = __builtin__.property(_get_vlanid) + direction = __builtin__.property(_get_direction) + + __choices__ = {'technology': {'generic': ['generic'], 'otn': ['otn'], 'eth': ['vlanid']}, 'type': {'label': ['direction']}} + _pyangbind_elements = OrderedDict([('generic', generic), ('otn', otn), ('vlanid', vlanid), ('direction', direction), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label/otn/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label/otn/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..784b431b63e8e1512737a4aa72e186a0fdc7425d --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label/otn/__init__.py @@ -0,0 +1,209 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 otn(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/connectivity-matrix/optimizations/optimization-metric/explicit-route-include-objects/route-object-include-object/label-hop/te-label/otn. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Label hop for OTN. + """ + __slots__ = ('_path_helper', '_extmethods', '__tpn','__tsg','__ts_list',) + + _yang_name = 'otn' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__tpn = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=False) + self.__tsg = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=False) + self.__ts_list = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', 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 ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'connectivity-matrix', 'optimizations', 'optimization-metric', 'explicit-route-include-objects', 'route-object-include-object', 'label-hop', 'te-label', 'otn'] + + def _get_tpn(self): + """ + Getter method for tpn, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label/otn/tpn (otn-tpn) + + YANG Description: Tributary Port Number (TPN). + """ + return self.__tpn + + def _set_tpn(self, v, load=False): + """ + Setter method for tpn, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label/otn/tpn (otn-tpn) + If this variable is read-only (config: false) in the + source YANG file, then _set_tpn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tpn() directly. + + YANG Description: Tributary Port Number (TPN). + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tpn must be of a type compatible with otn-tpn""", + 'defined-type': "ietf-otn-topology:otn-tpn", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=False)""", + }) + + self.__tpn = t + if hasattr(self, '_set'): + self._set() + + def _unset_tpn(self): + self.__tpn = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=False) + + + def _get_tsg(self): + """ + Getter method for tsg, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label/otn/tsg (identityref) + + YANG Description: Tributary Slot Granularity (TSG). + """ + return self.__tsg + + def _set_tsg(self, v, load=False): + """ + Setter method for tsg, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label/otn/tsg (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_tsg is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tsg() directly. + + YANG Description: Tributary Slot Granularity (TSG). + """ + 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={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tsg must be of a type compatible with identityref""", + 'defined-type': "ietf-otn-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=False)""", + }) + + self.__tsg = t + if hasattr(self, '_set'): + self._set() + + def _unset_tsg(self): + self.__tsg = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=False) + + + def _get_ts_list(self): + """ + Getter method for ts_list, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label/otn/ts_list (string) + + YANG Description: A list of available Tributary Slots (TS) ranging + + + + +between 1 and 4095. If multiple values or +ranges are given, they all MUST be disjoint +and MUST be in ascending order. +For example 1-20,25,50-1000. + """ + return self.__ts_list + + def _set_ts_list(self, v, load=False): + """ + Setter method for ts_list, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label/otn/ts_list (string) + If this variable is read-only (config: false) in the + source YANG file, then _set_ts_list is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_ts_list() directly. + + YANG Description: A list of available Tributary Slots (TS) ranging + + + + +between 1 and 4095. If multiple values or +ranges are given, they all MUST be disjoint +and MUST be in ascending order. +For example 1-20,25,50-1000. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='string', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """ts_list must be of a type compatible with string""", + 'defined-type': "string", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='string', is_config=False)""", + }) + + self.__ts_list = t + if hasattr(self, '_set'): + self._set() + + def _unset_ts_list(self): + self.__ts_list = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='string', is_config=False) + + tpn = __builtin__.property(_get_tpn) + tsg = __builtin__.property(_get_tsg) + ts_list = __builtin__.property(_get_ts_list) + + __choices__ = {'technology': {'otn': ['tpn', 'tsg', 'ts_list']}} + _pyangbind_elements = OrderedDict([('tpn', tpn), ('tsg', tsg), ('ts_list', ts_list), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/numbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/numbered_link_hop/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..14455045c23fefc0083d02c80eb537bb6fd7a1d8 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/numbered_link_hop/__init__.py @@ -0,0 +1,193 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 numbered_link_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/connectivity-matrix/optimizations/optimization-metric/explicit-route-include-objects/route-object-include-object/numbered-link-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Numbered link explicit route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__link_tp_id','__hop_type','__direction',) + + _yang_name = 'numbered-link-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=False) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', 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 ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'connectivity-matrix', 'optimizations', 'optimization-metric', 'explicit-route-include-objects', 'route-object-include-object', 'numbered-link-hop'] + + def _get_link_tp_id(self): + """ + Getter method for link_tp_id, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/numbered_link_hop/link_tp_id (te-tp-id) + + YANG Description: TE Link Termination Point (LTP) identifier. + """ + return self.__link_tp_id + + def _set_link_tp_id(self, v, load=False): + """ + Setter method for link_tp_id, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/numbered_link_hop/link_tp_id (te-tp-id) + If this variable is read-only (config: false) in the + source YANG file, then _set_link_tp_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_link_tp_id() directly. + + YANG Description: TE Link Termination Point (LTP) identifier. + """ + 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),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """link_tp_id must be of a type compatible with te-tp-id""", + 'defined-type': "ietf-te-topology:te-tp-id", + 'generated-type': """YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=False)""", + }) + + self.__link_tp_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_link_tp_id(self): + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=False) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/numbered_link_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/numbered_link_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + 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={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + + + def _get_direction(self): + """ + Getter method for direction, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/numbered_link_hop/direction (te-link-direction) + + YANG Description: Link route object direction. + """ + return self.__direction + + def _set_direction(self, v, load=False): + """ + Setter method for direction, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/numbered_link_hop/direction (te-link-direction) + If this variable is read-only (config: false) in the + source YANG file, then _set_direction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_direction() directly. + + YANG Description: Link route object direction. + """ + 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={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """direction must be of a type compatible with te-link-direction""", + 'defined-type': "ietf-te-topology:te-link-direction", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=False)""", + }) + + self.__direction = t + if hasattr(self, '_set'): + self._set() + + def _unset_direction(self): + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=False) + + link_tp_id = __builtin__.property(_get_link_tp_id) + hop_type = __builtin__.property(_get_hop_type) + direction = __builtin__.property(_get_direction) + + __choices__ = {'type': {'numbered-link-hop': ['link_tp_id', 'hop_type', 'direction']}} + _pyangbind_elements = OrderedDict([('link_tp_id', link_tp_id), ('hop_type', hop_type), ('direction', direction), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/numbered_node_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/numbered_node_hop/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..70eea9f9a90b0c4be8d37bf71a715c92654a731b --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/numbered_node_hop/__init__.py @@ -0,0 +1,154 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 numbered_node_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/connectivity-matrix/optimizations/optimization-metric/explicit-route-include-objects/route-object-include-object/numbered-node-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Numbered node route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__node_id','__hop_type',) + + _yang_name = 'numbered-node-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=False) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', 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 ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'connectivity-matrix', 'optimizations', 'optimization-metric', 'explicit-route-include-objects', 'route-object-include-object', 'numbered-node-hop'] + + def _get_node_id(self): + """ + Getter method for node_id, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/numbered_node_hop/node_id (te-node-id) + + YANG Description: The identifier of a node in the TE topology. + """ + return self.__node_id + + def _set_node_id(self, v, load=False): + """ + Setter method for node_id, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/numbered_node_hop/node_id (te-node-id) + 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. + + YANG Description: The identifier of a node in the TE topology. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """node_id must be of a type compatible with te-node-id""", + 'defined-type': "ietf-te-topology:te-node-id", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=False)""", + }) + + self.__node_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_node_id(self): + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=False) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/numbered_node_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/numbered_node_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + 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={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + + node_id = __builtin__.property(_get_node_id) + hop_type = __builtin__.property(_get_hop_type) + + __choices__ = {'type': {'numbered-node-hop': ['node_id', 'hop_type']}} + _pyangbind_elements = OrderedDict([('node_id', node_id), ('hop_type', hop_type), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/unnumbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/unnumbered_link_hop/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..eb61c881e99e645a8ba8de8a09eeb50add524777 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/unnumbered_link_hop/__init__.py @@ -0,0 +1,236 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 unnumbered_link_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/connectivity-matrix/optimizations/optimization-metric/explicit-route-include-objects/route-object-include-object/unnumbered-link-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Unnumbered link explicit route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__link_tp_id','__node_id','__hop_type','__direction',) + + _yang_name = 'unnumbered-link-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=False) + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=False) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', 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 ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'connectivity-matrix', 'optimizations', 'optimization-metric', 'explicit-route-include-objects', 'route-object-include-object', 'unnumbered-link-hop'] + + def _get_link_tp_id(self): + """ + Getter method for link_tp_id, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/unnumbered_link_hop/link_tp_id (te-tp-id) + + YANG Description: TE LTP identifier. The combination of the TE link ID +and the TE node ID is used to identify an unnumbered +TE link. + """ + return self.__link_tp_id + + def _set_link_tp_id(self, v, load=False): + """ + Setter method for link_tp_id, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/unnumbered_link_hop/link_tp_id (te-tp-id) + If this variable is read-only (config: false) in the + source YANG file, then _set_link_tp_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_link_tp_id() directly. + + YANG Description: TE LTP identifier. The combination of the TE link ID +and the TE node ID is used to identify an unnumbered +TE link. + """ + 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),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """link_tp_id must be of a type compatible with te-tp-id""", + 'defined-type': "ietf-te-topology:te-tp-id", + 'generated-type': """YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=False)""", + }) + + self.__link_tp_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_link_tp_id(self): + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=False) + + + def _get_node_id(self): + """ + Getter method for node_id, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/unnumbered_link_hop/node_id (te-node-id) + + YANG Description: The identifier of a node in the TE topology. + """ + return self.__node_id + + def _set_node_id(self, v, load=False): + """ + Setter method for node_id, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/unnumbered_link_hop/node_id (te-node-id) + 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. + + YANG Description: The identifier of a node in the TE topology. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """node_id must be of a type compatible with te-node-id""", + 'defined-type': "ietf-te-topology:te-node-id", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=False)""", + }) + + self.__node_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_node_id(self): + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=False) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/unnumbered_link_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/unnumbered_link_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + 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={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + + + def _get_direction(self): + """ + Getter method for direction, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/unnumbered_link_hop/direction (te-link-direction) + + YANG Description: Link route object direction. + """ + return self.__direction + + def _set_direction(self, v, load=False): + """ + Setter method for direction, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/unnumbered_link_hop/direction (te-link-direction) + If this variable is read-only (config: false) in the + source YANG file, then _set_direction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_direction() directly. + + YANG Description: Link route object direction. + """ + 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={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """direction must be of a type compatible with te-link-direction""", + 'defined-type': "ietf-te-topology:te-link-direction", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=False)""", + }) + + self.__direction = t + if hasattr(self, '_set'): + self._set() + + def _unset_direction(self): + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=False) + + link_tp_id = __builtin__.property(_get_link_tp_id) + node_id = __builtin__.property(_get_node_id) + hop_type = __builtin__.property(_get_hop_type) + direction = __builtin__.property(_get_direction) + + __choices__ = {'type': {'unnumbered-link-hop': ['link_tp_id', 'node_id', 'hop_type', 'direction']}} + _pyangbind_elements = OrderedDict([('link_tp_id', link_tp_id), ('node_id', node_id), ('hop_type', hop_type), ('direction', direction), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/tiebreakers/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/tiebreakers/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..8c6d935272024dc3c1b00e6c99bda99b30961f06 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/tiebreakers/__init__.py @@ -0,0 +1,120 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 tiebreaker +class tiebreakers(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/connectivity-matrix/optimizations/tiebreakers. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Container for the list of tiebreakers. + """ + __slots__ = ('_path_helper', '_extmethods', '__tiebreaker',) + + _yang_name = 'tiebreakers' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__tiebreaker = YANGDynClass(base=YANGListType("tiebreaker_type",tiebreaker.tiebreaker, yang_name="tiebreaker", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='tiebreaker-type', extensions=None, choice=('algorithm', 'metric')), is_container='list', yang_name="tiebreaker", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', 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 ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'connectivity-matrix', 'optimizations', 'tiebreakers'] + + def _get_tiebreaker(self): + """ + Getter method for tiebreaker, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/tiebreakers/tiebreaker (list) + + YANG Description: The list of tiebreaker criteria to apply on an +equally favored set of paths, in order to pick +the best. + """ + return self.__tiebreaker + + def _set_tiebreaker(self, v, load=False): + """ + Setter method for tiebreaker, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/tiebreakers/tiebreaker (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_tiebreaker is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tiebreaker() directly. + + YANG Description: The list of tiebreaker criteria to apply on an +equally favored set of paths, in order to pick +the best. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("tiebreaker_type",tiebreaker.tiebreaker, yang_name="tiebreaker", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='tiebreaker-type', extensions=None, choice=('algorithm', 'metric')), is_container='list', yang_name="tiebreaker", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tiebreaker must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("tiebreaker_type",tiebreaker.tiebreaker, yang_name="tiebreaker", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='tiebreaker-type', extensions=None, choice=('algorithm', 'metric')), is_container='list', yang_name="tiebreaker", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False)""", + }) + + self.__tiebreaker = t + if hasattr(self, '_set'): + self._set() + + def _unset_tiebreaker(self): + self.__tiebreaker = YANGDynClass(base=YANGListType("tiebreaker_type",tiebreaker.tiebreaker, yang_name="tiebreaker", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='tiebreaker-type', extensions=None, choice=('algorithm', 'metric')), is_container='list', yang_name="tiebreaker", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + + tiebreaker = __builtin__.property(_get_tiebreaker) + + __choices__ = {'algorithm': {'metric': ['tiebreaker']}} + _pyangbind_elements = OrderedDict([('tiebreaker', tiebreaker), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/tiebreakers/tiebreaker/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/tiebreakers/tiebreaker/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..52b5c81b73875d53580d39558efa2b25529d3ea6 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/tiebreakers/tiebreaker/__init__.py @@ -0,0 +1,122 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 tiebreaker(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/connectivity-matrix/optimizations/tiebreakers/tiebreaker. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: The list of tiebreaker criteria to apply on an +equally favored set of paths, in order to pick +the best. + """ + __slots__ = ('_path_helper', '_extmethods', '__tiebreaker_type',) + + _yang_name = 'tiebreaker' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__tiebreaker_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="tiebreaker-type", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', 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 ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'connectivity-matrix', 'optimizations', 'tiebreakers', 'tiebreaker'] + + def _get_tiebreaker_type(self): + """ + Getter method for tiebreaker_type, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/tiebreakers/tiebreaker/tiebreaker_type (identityref) + + YANG Description: Identifies an entry in the list of tiebreakers. + """ + return self.__tiebreaker_type + + def _set_tiebreaker_type(self, v, load=False): + """ + Setter method for tiebreaker_type, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/tiebreakers/tiebreaker/tiebreaker_type (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_tiebreaker_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tiebreaker_type() directly. + + YANG Description: Identifies an entry in the list of tiebreakers. + """ + 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=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="tiebreaker-type", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tiebreaker_type must be of a type compatible with identityref""", + 'defined-type': "ietf-te-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="tiebreaker-type", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False)""", + }) + + self.__tiebreaker_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_tiebreaker_type(self): + self.__tiebreaker_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="tiebreaker-type", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + + tiebreaker_type = __builtin__.property(_get_tiebreaker_type) + + __choices__ = {'algorithm': {'metric': ['tiebreaker_type']}} + _pyangbind_elements = OrderedDict([('tiebreaker_type', tiebreaker_type), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..36a802786ce00a6338c3c1e09e7054ca2b79cf39 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/__init__.py @@ -0,0 +1,523 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 te_bandwidth +from . import path_metric_bounds +from . import path_affinities_values +from . import path_affinity_names +from . import path_srlgs_lists +from . import path_srlgs_names +class path_constraints(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/connectivity-matrix/path-constraints. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: TE named path constraints container. + """ + __slots__ = ('_path_helper', '_extmethods', '__te_bandwidth','__link_protection','__setup_priority','__hold_priority','__signaling_type','__path_metric_bounds','__path_affinities_values','__path_affinity_names','__path_srlgs_lists','__path_srlgs_names','__disjointness',) + + _yang_name = 'path-constraints' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__te_bandwidth = YANGDynClass(base=te_bandwidth.te_bandwidth, is_container='container', yang_name="te-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__link_protection = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'link-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-shared': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-shared': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-shared': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-enhanced': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-enhanced': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-enhanced': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), default=six.text_type("te-types:link-protection-unprotected"), is_leaf=True, yang_name="link-protection", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + self.__setup_priority = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..7']}), default=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8)(7), is_leaf=True, yang_name="setup-priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint8', is_config=False) + self.__hold_priority = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..7']}), default=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8)(7), is_leaf=True, yang_name="hold-priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint8', is_config=False) + self.__signaling_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'path-setup-static': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-setup-static': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-setup-static': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-setup-rsvp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-setup-rsvp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-setup-rsvp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-setup-sr': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-setup-sr': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-setup-sr': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), default=six.text_type("te-types:path-setup-rsvp"), is_leaf=True, yang_name="signaling-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + self.__path_metric_bounds = YANGDynClass(base=path_metric_bounds.path_metric_bounds, is_container='container', yang_name="path-metric-bounds", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__path_affinities_values = YANGDynClass(base=path_affinities_values.path_affinities_values, is_container='container', yang_name="path-affinities-values", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__path_affinity_names = YANGDynClass(base=path_affinity_names.path_affinity_names, is_container='container', yang_name="path-affinity-names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__path_srlgs_lists = YANGDynClass(base=path_srlgs_lists.path_srlgs_lists, is_container='container', yang_name="path-srlgs-lists", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__path_srlgs_names = YANGDynClass(base=path_srlgs_names.path_srlgs_names, is_container='container', yang_name="path-srlgs-names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__disjointness = YANGDynClass(base=YANGBitsType(allowed_bits={'node': '0', 'link': '1', 'srlg': '2'}), is_leaf=True, yang_name="disjointness", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-path-disjointness', 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 ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'connectivity-matrix', 'path-constraints'] + + def _get_te_bandwidth(self): + """ + Getter method for te_bandwidth, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/te_bandwidth (container) + + YANG Description: Container that specifies TE bandwidth. The choices +can be augmented for specific data-plane technologies. + """ + return self.__te_bandwidth + + def _set_te_bandwidth(self, v, load=False): + """ + Setter method for te_bandwidth, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/te_bandwidth (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_te_bandwidth is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_te_bandwidth() directly. + + YANG Description: Container that specifies TE bandwidth. The choices +can be augmented for specific data-plane technologies. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=te_bandwidth.te_bandwidth, is_container='container', yang_name="te-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """te_bandwidth must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=te_bandwidth.te_bandwidth, is_container='container', yang_name="te-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__te_bandwidth = t + if hasattr(self, '_set'): + self._set() + + def _unset_te_bandwidth(self): + self.__te_bandwidth = YANGDynClass(base=te_bandwidth.te_bandwidth, is_container='container', yang_name="te-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_link_protection(self): + """ + Getter method for link_protection, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/link_protection (identityref) + + YANG Description: Link protection type required for the links included +in the computed path. + """ + return self.__link_protection + + def _set_link_protection(self, v, load=False): + """ + Setter method for link_protection, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/link_protection (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_link_protection is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_link_protection() directly. + + YANG Description: Link protection type required for the links included +in the computed path. + """ + 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={'link-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-shared': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-shared': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-shared': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-enhanced': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-enhanced': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-enhanced': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), default=six.text_type("te-types:link-protection-unprotected"), is_leaf=True, yang_name="link-protection", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """link_protection must be of a type compatible with identityref""", + 'defined-type': "ietf-te-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'link-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-shared': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-shared': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-shared': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-enhanced': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-enhanced': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-enhanced': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), default=six.text_type("te-types:link-protection-unprotected"), is_leaf=True, yang_name="link-protection", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False)""", + }) + + self.__link_protection = t + if hasattr(self, '_set'): + self._set() + + def _unset_link_protection(self): + self.__link_protection = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'link-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-shared': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-shared': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-shared': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-enhanced': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-enhanced': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-enhanced': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), default=six.text_type("te-types:link-protection-unprotected"), is_leaf=True, yang_name="link-protection", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + + + def _get_setup_priority(self): + """ + Getter method for setup_priority, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/setup_priority (uint8) + + YANG Description: TE LSP requested setup priority. + """ + return self.__setup_priority + + def _set_setup_priority(self, v, load=False): + """ + Setter method for setup_priority, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/setup_priority (uint8) + If this variable is read-only (config: false) in the + source YANG file, then _set_setup_priority is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_setup_priority() directly. + + YANG Description: TE LSP requested setup priority. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..7']}), default=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8)(7), is_leaf=True, yang_name="setup-priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint8', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """setup_priority must be of a type compatible with uint8""", + 'defined-type': "uint8", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..7']}), default=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8)(7), is_leaf=True, yang_name="setup-priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint8', is_config=False)""", + }) + + self.__setup_priority = t + if hasattr(self, '_set'): + self._set() + + def _unset_setup_priority(self): + self.__setup_priority = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..7']}), default=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8)(7), is_leaf=True, yang_name="setup-priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint8', is_config=False) + + + def _get_hold_priority(self): + """ + Getter method for hold_priority, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/hold_priority (uint8) + + YANG Description: TE LSP requested hold priority. + """ + return self.__hold_priority + + def _set_hold_priority(self, v, load=False): + """ + Setter method for hold_priority, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/hold_priority (uint8) + If this variable is read-only (config: false) in the + source YANG file, then _set_hold_priority is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hold_priority() directly. + + YANG Description: TE LSP requested hold priority. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..7']}), default=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8)(7), is_leaf=True, yang_name="hold-priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint8', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hold_priority must be of a type compatible with uint8""", + 'defined-type': "uint8", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..7']}), default=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8)(7), is_leaf=True, yang_name="hold-priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint8', is_config=False)""", + }) + + self.__hold_priority = t + if hasattr(self, '_set'): + self._set() + + def _unset_hold_priority(self): + self.__hold_priority = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..7']}), default=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8)(7), is_leaf=True, yang_name="hold-priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint8', is_config=False) + + + def _get_signaling_type(self): + """ + Getter method for signaling_type, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/signaling_type (identityref) + + YANG Description: TE tunnel path signaling type. + """ + return self.__signaling_type + + def _set_signaling_type(self, v, load=False): + """ + Setter method for signaling_type, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/signaling_type (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_signaling_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_signaling_type() directly. + + YANG Description: TE tunnel path signaling type. + """ + 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={'path-setup-static': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-setup-static': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-setup-static': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-setup-rsvp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-setup-rsvp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-setup-rsvp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-setup-sr': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-setup-sr': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-setup-sr': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), default=six.text_type("te-types:path-setup-rsvp"), is_leaf=True, yang_name="signaling-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """signaling_type must be of a type compatible with identityref""", + 'defined-type': "ietf-te-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'path-setup-static': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-setup-static': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-setup-static': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-setup-rsvp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-setup-rsvp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-setup-rsvp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-setup-sr': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-setup-sr': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-setup-sr': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), default=six.text_type("te-types:path-setup-rsvp"), is_leaf=True, yang_name="signaling-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False)""", + }) + + self.__signaling_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_signaling_type(self): + self.__signaling_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'path-setup-static': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-setup-static': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-setup-static': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-setup-rsvp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-setup-rsvp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-setup-rsvp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-setup-sr': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-setup-sr': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-setup-sr': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), default=six.text_type("te-types:path-setup-rsvp"), is_leaf=True, yang_name="signaling-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + + + def _get_path_metric_bounds(self): + """ + Getter method for path_metric_bounds, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/path_metric_bounds (container) + + YANG Description: TE path metric bounds container. + """ + return self.__path_metric_bounds + + def _set_path_metric_bounds(self, v, load=False): + """ + Setter method for path_metric_bounds, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/path_metric_bounds (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_metric_bounds is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_metric_bounds() directly. + + YANG Description: TE path metric bounds container. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=path_metric_bounds.path_metric_bounds, is_container='container', yang_name="path-metric-bounds", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_metric_bounds must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=path_metric_bounds.path_metric_bounds, is_container='container', yang_name="path-metric-bounds", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__path_metric_bounds = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_metric_bounds(self): + self.__path_metric_bounds = YANGDynClass(base=path_metric_bounds.path_metric_bounds, is_container='container', yang_name="path-metric-bounds", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_path_affinities_values(self): + """ + Getter method for path_affinities_values, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/path_affinities_values (container) + + YANG Description: Path affinities represented as values. + """ + return self.__path_affinities_values + + def _set_path_affinities_values(self, v, load=False): + """ + Setter method for path_affinities_values, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/path_affinities_values (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_affinities_values is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_affinities_values() directly. + + YANG Description: Path affinities represented as values. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=path_affinities_values.path_affinities_values, is_container='container', yang_name="path-affinities-values", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_affinities_values must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=path_affinities_values.path_affinities_values, is_container='container', yang_name="path-affinities-values", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__path_affinities_values = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_affinities_values(self): + self.__path_affinities_values = YANGDynClass(base=path_affinities_values.path_affinities_values, is_container='container', yang_name="path-affinities-values", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_path_affinity_names(self): + """ + Getter method for path_affinity_names, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/path_affinity_names (container) + + YANG Description: Path affinities represented as names. + """ + return self.__path_affinity_names + + def _set_path_affinity_names(self, v, load=False): + """ + Setter method for path_affinity_names, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/path_affinity_names (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_affinity_names is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_affinity_names() directly. + + YANG Description: Path affinities represented as names. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=path_affinity_names.path_affinity_names, is_container='container', yang_name="path-affinity-names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_affinity_names must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=path_affinity_names.path_affinity_names, is_container='container', yang_name="path-affinity-names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__path_affinity_names = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_affinity_names(self): + self.__path_affinity_names = YANGDynClass(base=path_affinity_names.path_affinity_names, is_container='container', yang_name="path-affinity-names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_path_srlgs_lists(self): + """ + Getter method for path_srlgs_lists, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/path_srlgs_lists (container) + + YANG Description: Path SRLG properties container. + """ + return self.__path_srlgs_lists + + def _set_path_srlgs_lists(self, v, load=False): + """ + Setter method for path_srlgs_lists, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/path_srlgs_lists (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_srlgs_lists is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_srlgs_lists() directly. + + YANG Description: Path SRLG properties container. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=path_srlgs_lists.path_srlgs_lists, is_container='container', yang_name="path-srlgs-lists", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_srlgs_lists must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=path_srlgs_lists.path_srlgs_lists, is_container='container', yang_name="path-srlgs-lists", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__path_srlgs_lists = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_srlgs_lists(self): + self.__path_srlgs_lists = YANGDynClass(base=path_srlgs_lists.path_srlgs_lists, is_container='container', yang_name="path-srlgs-lists", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_path_srlgs_names(self): + """ + Getter method for path_srlgs_names, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/path_srlgs_names (container) + + YANG Description: Container for the list of named SRLGs. + """ + return self.__path_srlgs_names + + def _set_path_srlgs_names(self, v, load=False): + """ + Setter method for path_srlgs_names, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/path_srlgs_names (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_srlgs_names is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_srlgs_names() directly. + + YANG Description: Container for the list of named SRLGs. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=path_srlgs_names.path_srlgs_names, is_container='container', yang_name="path-srlgs-names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_srlgs_names must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=path_srlgs_names.path_srlgs_names, is_container='container', yang_name="path-srlgs-names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__path_srlgs_names = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_srlgs_names(self): + self.__path_srlgs_names = YANGDynClass(base=path_srlgs_names.path_srlgs_names, is_container='container', yang_name="path-srlgs-names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_disjointness(self): + """ + Getter method for disjointness, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/disjointness (te-path-disjointness) + + YANG Description: The type of resource disjointness. +When configured for a primary path, the disjointness level +applies to all secondary LSPs. When configured for a +secondary path, the disjointness level overrides the level +configured for the primary path. + """ + return self.__disjointness + + def _set_disjointness(self, v, load=False): + """ + Setter method for disjointness, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/disjointness (te-path-disjointness) + If this variable is read-only (config: false) in the + source YANG file, then _set_disjointness is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_disjointness() directly. + + YANG Description: The type of resource disjointness. +When configured for a primary path, the disjointness level +applies to all secondary LSPs. When configured for a +secondary path, the disjointness level overrides the level +configured for the primary path. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBitsType(allowed_bits={'node': '0', 'link': '1', 'srlg': '2'}), is_leaf=True, yang_name="disjointness", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-path-disjointness', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """disjointness must be of a type compatible with te-path-disjointness""", + 'defined-type': "ietf-te-topology:te-path-disjointness", + 'generated-type': """YANGDynClass(base=YANGBitsType(allowed_bits={'node': '0', 'link': '1', 'srlg': '2'}), is_leaf=True, yang_name="disjointness", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-path-disjointness', is_config=False)""", + }) + + self.__disjointness = t + if hasattr(self, '_set'): + self._set() + + def _unset_disjointness(self): + self.__disjointness = YANGDynClass(base=YANGBitsType(allowed_bits={'node': '0', 'link': '1', 'srlg': '2'}), is_leaf=True, yang_name="disjointness", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-path-disjointness', is_config=False) + + te_bandwidth = __builtin__.property(_get_te_bandwidth) + link_protection = __builtin__.property(_get_link_protection) + setup_priority = __builtin__.property(_get_setup_priority) + hold_priority = __builtin__.property(_get_hold_priority) + signaling_type = __builtin__.property(_get_signaling_type) + path_metric_bounds = __builtin__.property(_get_path_metric_bounds) + path_affinities_values = __builtin__.property(_get_path_affinities_values) + path_affinity_names = __builtin__.property(_get_path_affinity_names) + path_srlgs_lists = __builtin__.property(_get_path_srlgs_lists) + path_srlgs_names = __builtin__.property(_get_path_srlgs_names) + disjointness = __builtin__.property(_get_disjointness) + + + _pyangbind_elements = OrderedDict([('te_bandwidth', te_bandwidth), ('link_protection', link_protection), ('setup_priority', setup_priority), ('hold_priority', hold_priority), ('signaling_type', signaling_type), ('path_metric_bounds', path_metric_bounds), ('path_affinities_values', path_affinities_values), ('path_affinity_names', path_affinity_names), ('path_srlgs_lists', path_srlgs_lists), ('path_srlgs_names', path_srlgs_names), ('disjointness', disjointness), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/path_affinities_values/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/path_affinities_values/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..aec7be61a4d5a62743420173d73c07dc98f4c0b7 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/path_affinities_values/__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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 path_affinities_value +class path_affinities_values(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/connectivity-matrix/path-constraints/path-affinities-values. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Path affinities represented as values. + """ + __slots__ = ('_path_helper', '_extmethods', '__path_affinities_value',) + + _yang_name = 'path-affinities-values' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__path_affinities_value = YANGDynClass(base=YANGListType("usage",path_affinities_value.path_affinities_value, yang_name="path-affinities-value", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-affinities-value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', 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 ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'connectivity-matrix', 'path-constraints', 'path-affinities-values'] + + def _get_path_affinities_value(self): + """ + Getter method for path_affinities_value, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/path_affinities_values/path_affinities_value (list) + + YANG Description: List of named affinity constraints. + """ + return self.__path_affinities_value + + def _set_path_affinities_value(self, v, load=False): + """ + Setter method for path_affinities_value, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/path_affinities_values/path_affinities_value (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_affinities_value is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_affinities_value() directly. + + YANG Description: List of named affinity constraints. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("usage",path_affinities_value.path_affinities_value, yang_name="path-affinities-value", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-affinities-value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_affinities_value must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("usage",path_affinities_value.path_affinities_value, yang_name="path-affinities-value", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-affinities-value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False)""", + }) + + self.__path_affinities_value = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_affinities_value(self): + self.__path_affinities_value = YANGDynClass(base=YANGListType("usage",path_affinities_value.path_affinities_value, yang_name="path-affinities-value", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-affinities-value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + + path_affinities_value = __builtin__.property(_get_path_affinities_value) + + + _pyangbind_elements = OrderedDict([('path_affinities_value', path_affinities_value), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/path_affinities_values/path_affinities_value/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/path_affinities_values/path_affinities_value/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..7a8d69da62bff28db4a5c294238a07d4fd36df9e --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/path_affinities_values/path_affinities_value/__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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 path_affinities_value(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/connectivity-matrix/path-constraints/path-affinities-values/path-affinities-value. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: List of named affinity constraints. + """ + __slots__ = ('_path_helper', '_extmethods', '__usage','__value',) + + _yang_name = 'path-affinities-value' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__usage = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + self.__value = YANGDynClass(base=[RestrictedClassType(base_type=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}), restriction_dict={'length': ['1..11']}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}),], default=six.text_type(""), is_leaf=True, yang_name="value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='admin-groups', 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 ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'connectivity-matrix', 'path-constraints', 'path-affinities-values', 'path-affinities-value'] + + def _get_usage(self): + """ + Getter method for usage, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/path_affinities_values/path_affinities_value/usage (identityref) + + YANG Description: Identifies an entry in the list of value affinity +constraints. + """ + return self.__usage + + def _set_usage(self, v, load=False): + """ + Setter method for usage, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/path_affinities_values/path_affinities_value/usage (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_usage is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_usage() directly. + + YANG Description: Identifies an entry in the list of value affinity +constraints. + """ + 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=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """usage must be of a type compatible with identityref""", + 'defined-type': "ietf-te-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False)""", + }) + + self.__usage = t + if hasattr(self, '_set'): + self._set() + + def _unset_usage(self): + self.__usage = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + + + def _get_value(self): + """ + Getter method for value, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/path_affinities_values/path_affinities_value/value (admin-groups) + + YANG Description: The affinity value. The default is empty. + """ + return self.__value + + def _set_value(self, v, load=False): + """ + Setter method for value, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/path_affinities_values/path_affinities_value/value (admin-groups) + 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: The affinity value. The default is empty. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=[RestrictedClassType(base_type=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}), restriction_dict={'length': ['1..11']}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}),], default=six.text_type(""), is_leaf=True, yang_name="value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='admin-groups', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """value must be of a type compatible with admin-groups""", + 'defined-type': "ietf-te-topology:admin-groups", + 'generated-type': """YANGDynClass(base=[RestrictedClassType(base_type=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}), restriction_dict={'length': ['1..11']}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}),], default=six.text_type(""), is_leaf=True, yang_name="value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='admin-groups', is_config=False)""", + }) + + self.__value = t + if hasattr(self, '_set'): + self._set() + + def _unset_value(self): + self.__value = YANGDynClass(base=[RestrictedClassType(base_type=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}), restriction_dict={'length': ['1..11']}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}),], default=six.text_type(""), is_leaf=True, yang_name="value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='admin-groups', is_config=False) + + usage = __builtin__.property(_get_usage) + value = __builtin__.property(_get_value) + + + _pyangbind_elements = OrderedDict([('usage', usage), ('value', value), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/path_affinity_names/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/path_affinity_names/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..ac5c598a48c14e1beed8d680b6da8c350b0eeacc --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/path_affinity_names/__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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 path_affinity_name +class path_affinity_names(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/connectivity-matrix/path-constraints/path-affinity-names. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Path affinities represented as names. + """ + __slots__ = ('_path_helper', '_extmethods', '__path_affinity_name',) + + _yang_name = 'path-affinity-names' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__path_affinity_name = YANGDynClass(base=YANGListType("usage",path_affinity_name.path_affinity_name, yang_name="path-affinity-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-affinity-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', 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 ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'connectivity-matrix', 'path-constraints', 'path-affinity-names'] + + def _get_path_affinity_name(self): + """ + Getter method for path_affinity_name, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/path_affinity_names/path_affinity_name (list) + + YANG Description: List of named affinity constraints. + """ + return self.__path_affinity_name + + def _set_path_affinity_name(self, v, load=False): + """ + Setter method for path_affinity_name, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/path_affinity_names/path_affinity_name (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_affinity_name is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_affinity_name() directly. + + YANG Description: List of named affinity constraints. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("usage",path_affinity_name.path_affinity_name, yang_name="path-affinity-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-affinity-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_affinity_name must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("usage",path_affinity_name.path_affinity_name, yang_name="path-affinity-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-affinity-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False)""", + }) + + self.__path_affinity_name = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_affinity_name(self): + self.__path_affinity_name = YANGDynClass(base=YANGListType("usage",path_affinity_name.path_affinity_name, yang_name="path-affinity-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-affinity-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + + path_affinity_name = __builtin__.property(_get_path_affinity_name) + + + _pyangbind_elements = OrderedDict([('path_affinity_name', path_affinity_name), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/path_affinity_names/path_affinity_name/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/path_affinity_names/path_affinity_name/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..df70c3c795414c8923b496cc519a630c3fbac04b --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/path_affinity_names/path_affinity_name/__init__.py @@ -0,0 +1,162 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 affinity_name +class path_affinity_name(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/connectivity-matrix/path-constraints/path-affinity-names/path-affinity-name. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: List of named affinity constraints. + """ + __slots__ = ('_path_helper', '_extmethods', '__usage','__affinity_name',) + + _yang_name = 'path-affinity-name' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__usage = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + self.__affinity_name = YANGDynClass(base=YANGListType("name",affinity_name.affinity_name, yang_name="affinity-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='name', extensions=None), is_container='list', yang_name="affinity-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', 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 ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'connectivity-matrix', 'path-constraints', 'path-affinity-names', 'path-affinity-name'] + + def _get_usage(self): + """ + Getter method for usage, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/path_affinity_names/path_affinity_name/usage (identityref) + + YANG Description: Identifies an entry in the list of named affinity +constraints. + """ + return self.__usage + + def _set_usage(self, v, load=False): + """ + Setter method for usage, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/path_affinity_names/path_affinity_name/usage (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_usage is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_usage() directly. + + YANG Description: Identifies an entry in the list of named affinity +constraints. + """ + 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=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """usage must be of a type compatible with identityref""", + 'defined-type': "ietf-te-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False)""", + }) + + self.__usage = t + if hasattr(self, '_set'): + self._set() + + def _unset_usage(self): + self.__usage = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + + + def _get_affinity_name(self): + """ + Getter method for affinity_name, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/path_affinity_names/path_affinity_name/affinity_name (list) + + YANG Description: List of named affinities. + """ + return self.__affinity_name + + def _set_affinity_name(self, v, load=False): + """ + Setter method for affinity_name, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/path_affinity_names/path_affinity_name/affinity_name (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_affinity_name is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_affinity_name() directly. + + YANG Description: List of named affinities. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("name",affinity_name.affinity_name, yang_name="affinity-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='name', extensions=None), is_container='list', yang_name="affinity-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """affinity_name must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("name",affinity_name.affinity_name, yang_name="affinity-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='name', extensions=None), is_container='list', yang_name="affinity-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False)""", + }) + + self.__affinity_name = t + if hasattr(self, '_set'): + self._set() + + def _unset_affinity_name(self): + self.__affinity_name = YANGDynClass(base=YANGListType("name",affinity_name.affinity_name, yang_name="affinity-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='name', extensions=None), is_container='list', yang_name="affinity-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + + usage = __builtin__.property(_get_usage) + affinity_name = __builtin__.property(_get_affinity_name) + + + _pyangbind_elements = OrderedDict([('usage', usage), ('affinity_name', affinity_name), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/path_affinity_names/path_affinity_name/affinity_name/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/path_affinity_names/path_affinity_name/affinity_name/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..5b69454e75f6d6e0971bc82173c8f01e5572eb27 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/path_affinity_names/path_affinity_name/affinity_name/__init__.py @@ -0,0 +1,120 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 affinity_name(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/connectivity-matrix/path-constraints/path-affinity-names/path-affinity-name/affinity-name. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: List of named affinities. + """ + __slots__ = ('_path_helper', '_extmethods', '__name',) + + _yang_name = 'affinity-name' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _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='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', 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 ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'connectivity-matrix', 'path-constraints', 'path-affinity-names', 'path-affinity-name', 'affinity-name'] + + def _get_name(self): + """ + Getter method for name, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/path_affinity_names/path_affinity_name/affinity_name/name (string) + + YANG Description: Identifies a named affinity entry. + """ + return self.__name + + def _set_name(self, v, load=False): + """ + Setter method for name, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/path_affinity_names/path_affinity_name/affinity_name/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: Identifies a named affinity entry. + """ + 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='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', 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, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', 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, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=False) + + name = __builtin__.property(_get_name) + + + _pyangbind_elements = OrderedDict([('name', name), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/path_metric_bounds/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/path_metric_bounds/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..d5df4f4698edf0430c3d4e4a063ff3af693f8039 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/path_metric_bounds/__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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 path_metric_bound +class path_metric_bounds(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/connectivity-matrix/path-constraints/path-metric-bounds. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: TE path metric bounds container. + """ + __slots__ = ('_path_helper', '_extmethods', '__path_metric_bound',) + + _yang_name = 'path-metric-bounds' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__path_metric_bound = YANGDynClass(base=YANGListType("metric_type",path_metric_bound.path_metric_bound, yang_name="path-metric-bound", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='metric-type', extensions=None), is_container='list', yang_name="path-metric-bound", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', 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 ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'connectivity-matrix', 'path-constraints', 'path-metric-bounds'] + + def _get_path_metric_bound(self): + """ + Getter method for path_metric_bound, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/path_metric_bounds/path_metric_bound (list) + + YANG Description: List of TE path metric bounds. + """ + return self.__path_metric_bound + + def _set_path_metric_bound(self, v, load=False): + """ + Setter method for path_metric_bound, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/path_metric_bounds/path_metric_bound (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_metric_bound is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_metric_bound() directly. + + YANG Description: List of TE path metric bounds. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("metric_type",path_metric_bound.path_metric_bound, yang_name="path-metric-bound", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='metric-type', extensions=None), is_container='list', yang_name="path-metric-bound", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_metric_bound must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("metric_type",path_metric_bound.path_metric_bound, yang_name="path-metric-bound", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='metric-type', extensions=None), is_container='list', yang_name="path-metric-bound", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False)""", + }) + + self.__path_metric_bound = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_metric_bound(self): + self.__path_metric_bound = YANGDynClass(base=YANGListType("metric_type",path_metric_bound.path_metric_bound, yang_name="path-metric-bound", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='metric-type', extensions=None), is_container='list', yang_name="path-metric-bound", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + + path_metric_bound = __builtin__.property(_get_path_metric_bound) + + + _pyangbind_elements = OrderedDict([('path_metric_bound', path_metric_bound), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/path_metric_bounds/path_metric_bound/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/path_metric_bounds/path_metric_bound/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..fd7e445c0d416fe1cd5778f0a07f32503cb30a26 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/path_metric_bounds/path_metric_bound/__init__.py @@ -0,0 +1,165 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 path_metric_bound(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/connectivity-matrix/path-constraints/path-metric-bounds/path-metric-bound. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: List of TE path metric bounds. + """ + __slots__ = ('_path_helper', '_extmethods', '__metric_type','__upper_bound',) + + _yang_name = 'path-metric-bound' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__metric_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="metric-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + self.__upper_bound = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), default=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64)(0), is_leaf=True, yang_name="upper-bound", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', 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 ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'connectivity-matrix', 'path-constraints', 'path-metric-bounds', 'path-metric-bound'] + + def _get_metric_type(self): + """ + Getter method for metric_type, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/path_metric_bounds/path_metric_bound/metric_type (identityref) + + YANG Description: Identifies an entry in the list of 'metric-type' items +bound for the TE path. + """ + return self.__metric_type + + def _set_metric_type(self, v, load=False): + """ + Setter method for metric_type, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/path_metric_bounds/path_metric_bound/metric_type (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_metric_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_metric_type() directly. + + YANG Description: Identifies an entry in the list of 'metric-type' items +bound for the TE path. + """ + 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=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="metric-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """metric_type must be of a type compatible with identityref""", + 'defined-type': "ietf-te-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="metric-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False)""", + }) + + self.__metric_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_metric_type(self): + self.__metric_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="metric-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + + + def _get_upper_bound(self): + """ + Getter method for upper_bound, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/path_metric_bounds/path_metric_bound/upper_bound (uint64) + + YANG Description: Upper bound on the end-to-end TE path metric. A zero +indicates an unbounded upper limit for the specific +'metric-type'. + """ + return self.__upper_bound + + def _set_upper_bound(self, v, load=False): + """ + Setter method for upper_bound, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/path_metric_bounds/path_metric_bound/upper_bound (uint64) + If this variable is read-only (config: false) in the + source YANG file, then _set_upper_bound is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_upper_bound() directly. + + YANG Description: Upper bound on the end-to-end TE path metric. A zero +indicates an unbounded upper limit for the specific +'metric-type'. + """ + 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), default=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64)(0), is_leaf=True, yang_name="upper-bound", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint64', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """upper_bound 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), default=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64)(0), is_leaf=True, yang_name="upper-bound", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint64', is_config=False)""", + }) + + self.__upper_bound = t + if hasattr(self, '_set'): + self._set() + + def _unset_upper_bound(self): + self.__upper_bound = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), default=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64)(0), is_leaf=True, yang_name="upper-bound", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint64', is_config=False) + + metric_type = __builtin__.property(_get_metric_type) + upper_bound = __builtin__.property(_get_upper_bound) + + + _pyangbind_elements = OrderedDict([('metric_type', metric_type), ('upper_bound', upper_bound), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/path_srlgs_lists/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/path_srlgs_lists/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..f089523be84c77715f2ef69f20fee14ddd096c4a --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/path_srlgs_lists/__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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 path_srlgs_list +class path_srlgs_lists(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/connectivity-matrix/path-constraints/path-srlgs-lists. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Path SRLG properties container. + """ + __slots__ = ('_path_helper', '_extmethods', '__path_srlgs_list',) + + _yang_name = 'path-srlgs-lists' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__path_srlgs_list = YANGDynClass(base=YANGListType("usage",path_srlgs_list.path_srlgs_list, yang_name="path-srlgs-list", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-srlgs-list", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', 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 ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'connectivity-matrix', 'path-constraints', 'path-srlgs-lists'] + + def _get_path_srlgs_list(self): + """ + Getter method for path_srlgs_list, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/path_srlgs_lists/path_srlgs_list (list) + + YANG Description: List of SRLG values to be included or excluded. + """ + return self.__path_srlgs_list + + def _set_path_srlgs_list(self, v, load=False): + """ + Setter method for path_srlgs_list, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/path_srlgs_lists/path_srlgs_list (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_srlgs_list is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_srlgs_list() directly. + + YANG Description: List of SRLG values to be included or excluded. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("usage",path_srlgs_list.path_srlgs_list, yang_name="path-srlgs-list", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-srlgs-list", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_srlgs_list must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("usage",path_srlgs_list.path_srlgs_list, yang_name="path-srlgs-list", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-srlgs-list", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False)""", + }) + + self.__path_srlgs_list = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_srlgs_list(self): + self.__path_srlgs_list = YANGDynClass(base=YANGListType("usage",path_srlgs_list.path_srlgs_list, yang_name="path-srlgs-list", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-srlgs-list", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + + path_srlgs_list = __builtin__.property(_get_path_srlgs_list) + + + _pyangbind_elements = OrderedDict([('path_srlgs_list', path_srlgs_list), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/path_srlgs_lists/path_srlgs_list/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/path_srlgs_lists/path_srlgs_list/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..b48cb25ffa81f50cf1d51a2efc2e7ef82f6eb6db --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/path_srlgs_lists/path_srlgs_list/__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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 path_srlgs_list(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/connectivity-matrix/path-constraints/path-srlgs-lists/path-srlgs-list. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: List of SRLG values to be included or excluded. + """ + __slots__ = ('_path_helper', '_extmethods', '__usage','__values',) + + _yang_name = 'path-srlgs-list' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__usage = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + self.__values = YANGDynClass(unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32)), is_leaf=False, yang_name="values", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='srlg', 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 ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'connectivity-matrix', 'path-constraints', 'path-srlgs-lists', 'path-srlgs-list'] + + def _get_usage(self): + """ + Getter method for usage, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/path_srlgs_lists/path_srlgs_list/usage (identityref) + + YANG Description: Identifies an entry in a list of SRLGs to either +include or exclude. + """ + return self.__usage + + def _set_usage(self, v, load=False): + """ + Setter method for usage, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/path_srlgs_lists/path_srlgs_list/usage (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_usage is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_usage() directly. + + YANG Description: Identifies an entry in a list of SRLGs to either +include or exclude. + """ + 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=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """usage must be of a type compatible with identityref""", + 'defined-type': "ietf-te-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False)""", + }) + + self.__usage = t + if hasattr(self, '_set'): + self._set() + + def _unset_usage(self): + self.__usage = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + + + def _get_values(self): + """ + Getter method for values, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/path_srlgs_lists/path_srlgs_list/values (srlg) + + YANG Description: List of SRLG values. + """ + return self.__values + + def _set_values(self, v, load=False): + """ + Setter method for values, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/path_srlgs_lists/path_srlgs_list/values (srlg) + If this variable is read-only (config: false) in the + source YANG file, then _set_values is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_values() directly. + + YANG Description: List of SRLG values. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32)), is_leaf=False, yang_name="values", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='srlg', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """values must be of a type compatible with srlg""", + 'defined-type': "ietf-te-topology:srlg", + 'generated-type': """YANGDynClass(unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32)), is_leaf=False, yang_name="values", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='srlg', is_config=False)""", + }) + + self.__values = t + if hasattr(self, '_set'): + self._set() + + def _unset_values(self): + self.__values = YANGDynClass(unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32)), is_leaf=False, yang_name="values", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='srlg', is_config=False) + + usage = __builtin__.property(_get_usage) + values = __builtin__.property(_get_values) + + + _pyangbind_elements = OrderedDict([('usage', usage), ('values', values), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/path_srlgs_names/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/path_srlgs_names/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..d18d1658d5bb0cd62f7a9adec7140b198f27df3a --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/path_srlgs_names/__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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 path_srlgs_name +class path_srlgs_names(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/connectivity-matrix/path-constraints/path-srlgs-names. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Container for the list of named SRLGs. + """ + __slots__ = ('_path_helper', '_extmethods', '__path_srlgs_name',) + + _yang_name = 'path-srlgs-names' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__path_srlgs_name = YANGDynClass(base=YANGListType("usage",path_srlgs_name.path_srlgs_name, yang_name="path-srlgs-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-srlgs-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', 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 ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'connectivity-matrix', 'path-constraints', 'path-srlgs-names'] + + def _get_path_srlgs_name(self): + """ + Getter method for path_srlgs_name, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/path_srlgs_names/path_srlgs_name (list) + + YANG Description: List of named SRLGs to be included or excluded. + """ + return self.__path_srlgs_name + + def _set_path_srlgs_name(self, v, load=False): + """ + Setter method for path_srlgs_name, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/path_srlgs_names/path_srlgs_name (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_srlgs_name is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_srlgs_name() directly. + + YANG Description: List of named SRLGs to be included or excluded. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("usage",path_srlgs_name.path_srlgs_name, yang_name="path-srlgs-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-srlgs-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_srlgs_name must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("usage",path_srlgs_name.path_srlgs_name, yang_name="path-srlgs-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-srlgs-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False)""", + }) + + self.__path_srlgs_name = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_srlgs_name(self): + self.__path_srlgs_name = YANGDynClass(base=YANGListType("usage",path_srlgs_name.path_srlgs_name, yang_name="path-srlgs-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-srlgs-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + + path_srlgs_name = __builtin__.property(_get_path_srlgs_name) + + + _pyangbind_elements = OrderedDict([('path_srlgs_name', path_srlgs_name), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/path_srlgs_names/path_srlgs_name/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/path_srlgs_names/path_srlgs_name/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..cee736f2442ff529b658cda7cb8631a1580d9776 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/path_srlgs_names/path_srlgs_name/__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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 path_srlgs_name(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/connectivity-matrix/path-constraints/path-srlgs-names/path-srlgs-name. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: List of named SRLGs to be included or excluded. + """ + __slots__ = ('_path_helper', '_extmethods', '__usage','__names',) + + _yang_name = 'path-srlgs-name' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__usage = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + self.__names = YANGDynClass(unique=True, base=TypedListType(allowed_type=six.text_type), is_leaf=False, yang_name="names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', 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 ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'connectivity-matrix', 'path-constraints', 'path-srlgs-names', 'path-srlgs-name'] + + def _get_usage(self): + """ + Getter method for usage, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/path_srlgs_names/path_srlgs_name/usage (identityref) + + YANG Description: Identifies an entry in a list of named SRLGs to either +include or exclude. + """ + return self.__usage + + def _set_usage(self, v, load=False): + """ + Setter method for usage, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/path_srlgs_names/path_srlgs_name/usage (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_usage is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_usage() directly. + + YANG Description: Identifies an entry in a list of named SRLGs to either +include or exclude. + """ + 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=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """usage must be of a type compatible with identityref""", + 'defined-type': "ietf-te-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False)""", + }) + + self.__usage = t + if hasattr(self, '_set'): + self._set() + + def _unset_usage(self): + self.__usage = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + + + def _get_names(self): + """ + Getter method for names, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/path_srlgs_names/path_srlgs_name/names (string) + + YANG Description: List of named SRLGs. + """ + return self.__names + + def _set_names(self, v, load=False): + """ + Setter method for names, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/path_srlgs_names/path_srlgs_name/names (string) + If this variable is read-only (config: false) in the + source YANG file, then _set_names is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_names() directly. + + YANG Description: List of named SRLGs. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,unique=True, base=TypedListType(allowed_type=six.text_type), is_leaf=False, yang_name="names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """names must be of a type compatible with string""", + 'defined-type': "string", + 'generated-type': """YANGDynClass(unique=True, base=TypedListType(allowed_type=six.text_type), is_leaf=False, yang_name="names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=False)""", + }) + + self.__names = t + if hasattr(self, '_set'): + self._set() + + def _unset_names(self): + self.__names = YANGDynClass(unique=True, base=TypedListType(allowed_type=six.text_type), is_leaf=False, yang_name="names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=False) + + usage = __builtin__.property(_get_usage) + names = __builtin__.property(_get_names) + + + _pyangbind_elements = OrderedDict([('usage', usage), ('names', names), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/te_bandwidth/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/te_bandwidth/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..a079dcabfae8a4a267d46459bd88664e9c3f8723 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/te_bandwidth/__init__.py @@ -0,0 +1,195 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 otn +class te_bandwidth(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/connectivity-matrix/path-constraints/te-bandwidth. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Container that specifies TE bandwidth. The choices +can be augmented for specific data-plane technologies. + """ + __slots__ = ('_path_helper', '_extmethods', '__generic','__otn','__eth_bandwidth',) + + _yang_name = 'te-bandwidth' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__generic = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+(,(0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+))*'}), is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-bandwidth', is_config=False) + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False) + self.__eth_bandwidth = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), restriction_dict={'range': ['0..10000000000']}), is_leaf=True, yang_name="eth-bandwidth", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', 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 ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'connectivity-matrix', 'path-constraints', 'te-bandwidth'] + + def _get_generic(self): + """ + Getter method for generic, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/te_bandwidth/generic (te-bandwidth) + + YANG Description: Bandwidth specified in a generic format. + """ + return self.__generic + + def _set_generic(self, v, load=False): + """ + Setter method for generic, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/te_bandwidth/generic (te-bandwidth) + If this variable is read-only (config: false) in the + source YANG file, then _set_generic is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_generic() directly. + + YANG Description: Bandwidth specified in a generic format. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+(,(0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+))*'}), is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-bandwidth', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """generic must be of a type compatible with te-bandwidth""", + 'defined-type': "ietf-te-topology:te-bandwidth", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+(,(0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+))*'}), is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-bandwidth', is_config=False)""", + }) + + self.__generic = t + if hasattr(self, '_set'): + self._set() + + def _unset_generic(self): + self.__generic = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+(,(0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+))*'}), is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-bandwidth', is_config=False) + + + def _get_otn(self): + """ + Getter method for otn, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/te_bandwidth/otn (container) + + YANG Description: Bandwidth attributes for OTN links + """ + return self.__otn + + def _set_otn(self, v, load=False): + """ + Setter method for otn, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/te_bandwidth/otn (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_otn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_otn() directly. + + YANG Description: Bandwidth attributes for OTN links + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """otn must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False)""", + }) + + self.__otn = t + if hasattr(self, '_set'): + self._set() + + def _unset_otn(self): + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False) + + + def _get_eth_bandwidth(self): + """ + Getter method for eth_bandwidth, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/te_bandwidth/eth_bandwidth (uint64) + + YANG Description: Available bandwith value expressed in kilobits per second + """ + return self.__eth_bandwidth + + def _set_eth_bandwidth(self, v, load=False): + """ + Setter method for eth_bandwidth, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/te_bandwidth/eth_bandwidth (uint64) + If this variable is read-only (config: false) in the + source YANG file, then _set_eth_bandwidth is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_eth_bandwidth() directly. + + YANG Description: Available bandwith value expressed in kilobits per second + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), restriction_dict={'range': ['0..10000000000']}), is_leaf=True, yang_name="eth-bandwidth", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint64', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """eth_bandwidth must be of a type compatible with uint64""", + 'defined-type': "uint64", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), restriction_dict={'range': ['0..10000000000']}), is_leaf=True, yang_name="eth-bandwidth", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint64', is_config=False)""", + }) + + self.__eth_bandwidth = t + if hasattr(self, '_set'): + self._set() + + def _unset_eth_bandwidth(self): + self.__eth_bandwidth = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), restriction_dict={'range': ['0..10000000000']}), is_leaf=True, yang_name="eth-bandwidth", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint64', is_config=False) + + generic = __builtin__.property(_get_generic) + otn = __builtin__.property(_get_otn) + eth_bandwidth = __builtin__.property(_get_eth_bandwidth) + + __choices__ = {'technology': {'generic': ['generic'], 'otn': ['otn'], 'eth': ['eth_bandwidth']}} + _pyangbind_elements = OrderedDict([('generic', generic), ('otn', otn), ('eth_bandwidth', eth_bandwidth), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/te_bandwidth/otn/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/te_bandwidth/otn/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..6b5dd7c31d174362032052dfb9c602cbe4c29c0c --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/te_bandwidth/otn/__init__.py @@ -0,0 +1,163 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 odulist +class otn(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/connectivity-matrix/path-constraints/te-bandwidth/otn. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Bandwidth attributes for OTN links + """ + __slots__ = ('_path_helper', '_extmethods', '__odulist','__odtu_flex_type',) + + _yang_name = 'otn' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__odulist = YANGDynClass(base=YANGListType("odu_type",odulist.odulist, yang_name="odulist", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='odu-type', extensions=None, choice=('technology', 'otn')), is_container='list', yang_name="odulist", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='list', is_config=False) + self.__odtu_flex_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'2': {}, '3': {}, '4': {}, 'Cn': {}},), is_leaf=True, yang_name="odtu-flex-type", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='l1-types:odtu-flex-type', 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 ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'connectivity-matrix', 'path-constraints', 'te-bandwidth', 'otn'] + + def _get_odulist(self): + """ + Getter method for odulist, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/te_bandwidth/otn/odulist (list) + + YANG Description: OTN bandwidth definition + """ + return self.__odulist + + def _set_odulist(self, v, load=False): + """ + Setter method for odulist, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/te_bandwidth/otn/odulist (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_odulist is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_odulist() directly. + + YANG Description: OTN bandwidth definition + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("odu_type",odulist.odulist, yang_name="odulist", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='odu-type', extensions=None, choice=('technology', 'otn')), is_container='list', yang_name="odulist", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='list', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """odulist must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("odu_type",odulist.odulist, yang_name="odulist", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='odu-type', extensions=None, choice=('technology', 'otn')), is_container='list', yang_name="odulist", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='list', is_config=False)""", + }) + + self.__odulist = t + if hasattr(self, '_set'): + self._set() + + def _unset_odulist(self): + self.__odulist = YANGDynClass(base=YANGListType("odu_type",odulist.odulist, yang_name="odulist", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='odu-type', extensions=None, choice=('technology', 'otn')), is_container='list', yang_name="odulist", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='list', is_config=False) + + + def _get_odtu_flex_type(self): + """ + Getter method for odtu_flex_type, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/te_bandwidth/otn/odtu_flex_type (l1-types:odtu-flex-type) + + YANG Description: The type of Optical Data Tributary Unit (ODTU) +whose nominal bitrate is used to compute the number of +Tributary Slots (TS) required by the ODUflex LSPs +set up along the underlay path of this OTN +connectivity matrix entry. + """ + return self.__odtu_flex_type + + def _set_odtu_flex_type(self, v, load=False): + """ + Setter method for odtu_flex_type, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/te_bandwidth/otn/odtu_flex_type (l1-types:odtu-flex-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_odtu_flex_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_odtu_flex_type() directly. + + YANG Description: The type of Optical Data Tributary Unit (ODTU) +whose nominal bitrate is used to compute the number of +Tributary Slots (TS) required by the ODUflex LSPs +set up along the underlay path of this OTN +connectivity matrix entry. + """ + 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={'2': {}, '3': {}, '4': {}, 'Cn': {}},), is_leaf=True, yang_name="odtu-flex-type", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='l1-types:odtu-flex-type', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """odtu_flex_type must be of a type compatible with l1-types:odtu-flex-type""", + 'defined-type': "l1-types:odtu-flex-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'2': {}, '3': {}, '4': {}, 'Cn': {}},), is_leaf=True, yang_name="odtu-flex-type", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='l1-types:odtu-flex-type', is_config=False)""", + }) + + self.__odtu_flex_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_odtu_flex_type(self): + self.__odtu_flex_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'2': {}, '3': {}, '4': {}, 'Cn': {}},), is_leaf=True, yang_name="odtu-flex-type", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='l1-types:odtu-flex-type', is_config=False) + + odulist = __builtin__.property(_get_odulist) + odtu_flex_type = __builtin__.property(_get_odtu_flex_type) + + __choices__ = {'technology': {'otn': ['odulist', 'odtu_flex_type']}} + _pyangbind_elements = OrderedDict([('odulist', odulist), ('odtu_flex_type', odtu_flex_type), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/te_bandwidth/otn/odulist/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/te_bandwidth/otn/odulist/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..afa750977534afaf21fff915a0144bc78bdde0d0 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/te_bandwidth/otn/odulist/__init__.py @@ -0,0 +1,200 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 odulist(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/connectivity-matrix/path-constraints/te-bandwidth/otn/odulist. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: OTN bandwidth definition + """ + __slots__ = ('_path_helper', '_extmethods', '__odu_type','__number','__ts_number',) + + _yang_name = 'odulist' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__odu_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="odu-type", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=False) + self.__number = YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), is_leaf=True, yang_name="number", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', is_config=False) + self.__ts_number = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts-number", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', 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 ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'connectivity-matrix', 'path-constraints', 'te-bandwidth', 'otn', 'odulist'] + + def _get_odu_type(self): + """ + Getter method for odu_type, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/te_bandwidth/otn/odulist/odu_type (identityref) + + YANG Description: ODU type + """ + return self.__odu_type + + def _set_odu_type(self, v, load=False): + """ + Setter method for odu_type, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/te_bandwidth/otn/odulist/odu_type (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_odu_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_odu_type() directly. + + YANG Description: ODU type + """ + 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=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="odu-type", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """odu_type must be of a type compatible with identityref""", + 'defined-type': "ietf-otn-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="odu-type", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=False)""", + }) + + self.__odu_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_odu_type(self): + self.__odu_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="odu-type", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=False) + + + def _get_number(self): + """ + Getter method for number, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/te_bandwidth/otn/odulist/number (uint16) + + YANG Description: Number of ODUs + """ + return self.__number + + def _set_number(self, v, load=False): + """ + Setter method for number, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/te_bandwidth/otn/odulist/number (uint16) + If this variable is read-only (config: false) in the + source YANG file, then _set_number is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_number() directly. + + YANG Description: Number of ODUs + """ + 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="number", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """number 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="number", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', is_config=False)""", + }) + + self.__number = t + if hasattr(self, '_set'): + self._set() + + def _unset_number(self): + self.__number = YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), is_leaf=True, yang_name="number", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', is_config=False) + + + def _get_ts_number(self): + """ + Getter method for ts_number, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/te_bandwidth/otn/odulist/ts_number (uint16) + + YANG Description: The number of Tributary Slots (TS) that +could be used by all the ODUflex LSPs. + """ + return self.__ts_number + + def _set_ts_number(self, v, load=False): + """ + Setter method for ts_number, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/te_bandwidth/otn/odulist/ts_number (uint16) + If this variable is read-only (config: false) in the + source YANG file, then _set_ts_number is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_ts_number() directly. + + YANG Description: The number of Tributary Slots (TS) that +could be used by all the ODUflex LSPs. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts-number", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """ts_number must be of a type compatible with uint16""", + 'defined-type': "uint16", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts-number", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', is_config=False)""", + }) + + self.__ts_number = t + if hasattr(self, '_set'): + self._set() + + def _unset_ts_number(self): + self.__ts_number = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts-number", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', is_config=False) + + odu_type = __builtin__.property(_get_odu_type) + number = __builtin__.property(_get_number) + ts_number = __builtin__.property(_get_ts_number) + + __choices__ = {'technology': {'otn': ['odu_type', 'number', 'ts_number']}} + _pyangbind_elements = OrderedDict([('odu_type', odu_type), ('number', number), ('ts_number', ts_number), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..f87c34494c5e902ec0b191b491c9f87048a71fc0 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/__init__.py @@ -0,0 +1,318 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 path_metric +from . import path_affinities_values +from . import path_affinity_names +from . import path_srlgs_lists +from . import path_srlgs_names +from . import path_route_objects +class path_properties(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/connectivity-matrix/path-properties. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: The TE path properties. + """ + __slots__ = ('_path_helper', '_extmethods', '__path_metric','__path_affinities_values','__path_affinity_names','__path_srlgs_lists','__path_srlgs_names','__path_route_objects',) + + _yang_name = 'path-properties' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__path_metric = YANGDynClass(base=YANGListType("metric_type",path_metric.path_metric, yang_name="path-metric", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='metric-type', extensions=None), is_container='list', yang_name="path-metric", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + self.__path_affinities_values = YANGDynClass(base=path_affinities_values.path_affinities_values, is_container='container', yang_name="path-affinities-values", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__path_affinity_names = YANGDynClass(base=path_affinity_names.path_affinity_names, is_container='container', yang_name="path-affinity-names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__path_srlgs_lists = YANGDynClass(base=path_srlgs_lists.path_srlgs_lists, is_container='container', yang_name="path-srlgs-lists", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__path_srlgs_names = YANGDynClass(base=path_srlgs_names.path_srlgs_names, is_container='container', yang_name="path-srlgs-names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__path_route_objects = YANGDynClass(base=path_route_objects.path_route_objects, is_container='container', yang_name="path-route-objects", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', 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 ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'connectivity-matrix', 'path-properties'] + + def _get_path_metric(self): + """ + Getter method for path_metric, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_metric (list) + + YANG Description: TE path metric type. + """ + return self.__path_metric + + def _set_path_metric(self, v, load=False): + """ + Setter method for path_metric, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_metric (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_metric is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_metric() directly. + + YANG Description: TE path metric type. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("metric_type",path_metric.path_metric, yang_name="path-metric", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='metric-type', extensions=None), is_container='list', yang_name="path-metric", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_metric must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("metric_type",path_metric.path_metric, yang_name="path-metric", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='metric-type', extensions=None), is_container='list', yang_name="path-metric", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False)""", + }) + + self.__path_metric = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_metric(self): + self.__path_metric = YANGDynClass(base=YANGListType("metric_type",path_metric.path_metric, yang_name="path-metric", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='metric-type', extensions=None), is_container='list', yang_name="path-metric", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + + + def _get_path_affinities_values(self): + """ + Getter method for path_affinities_values, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_affinities_values (container) + + YANG Description: Path affinities represented as values. + """ + return self.__path_affinities_values + + def _set_path_affinities_values(self, v, load=False): + """ + Setter method for path_affinities_values, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_affinities_values (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_affinities_values is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_affinities_values() directly. + + YANG Description: Path affinities represented as values. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=path_affinities_values.path_affinities_values, is_container='container', yang_name="path-affinities-values", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_affinities_values must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=path_affinities_values.path_affinities_values, is_container='container', yang_name="path-affinities-values", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__path_affinities_values = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_affinities_values(self): + self.__path_affinities_values = YANGDynClass(base=path_affinities_values.path_affinities_values, is_container='container', yang_name="path-affinities-values", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_path_affinity_names(self): + """ + Getter method for path_affinity_names, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_affinity_names (container) + + YANG Description: Path affinities represented as names. + """ + return self.__path_affinity_names + + def _set_path_affinity_names(self, v, load=False): + """ + Setter method for path_affinity_names, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_affinity_names (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_affinity_names is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_affinity_names() directly. + + YANG Description: Path affinities represented as names. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=path_affinity_names.path_affinity_names, is_container='container', yang_name="path-affinity-names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_affinity_names must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=path_affinity_names.path_affinity_names, is_container='container', yang_name="path-affinity-names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__path_affinity_names = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_affinity_names(self): + self.__path_affinity_names = YANGDynClass(base=path_affinity_names.path_affinity_names, is_container='container', yang_name="path-affinity-names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_path_srlgs_lists(self): + """ + Getter method for path_srlgs_lists, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_srlgs_lists (container) + + YANG Description: Path SRLG properties container. + """ + return self.__path_srlgs_lists + + def _set_path_srlgs_lists(self, v, load=False): + """ + Setter method for path_srlgs_lists, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_srlgs_lists (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_srlgs_lists is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_srlgs_lists() directly. + + YANG Description: Path SRLG properties container. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=path_srlgs_lists.path_srlgs_lists, is_container='container', yang_name="path-srlgs-lists", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_srlgs_lists must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=path_srlgs_lists.path_srlgs_lists, is_container='container', yang_name="path-srlgs-lists", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__path_srlgs_lists = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_srlgs_lists(self): + self.__path_srlgs_lists = YANGDynClass(base=path_srlgs_lists.path_srlgs_lists, is_container='container', yang_name="path-srlgs-lists", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_path_srlgs_names(self): + """ + Getter method for path_srlgs_names, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_srlgs_names (container) + + YANG Description: Container for the list of named SRLGs. + """ + return self.__path_srlgs_names + + def _set_path_srlgs_names(self, v, load=False): + """ + Setter method for path_srlgs_names, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_srlgs_names (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_srlgs_names is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_srlgs_names() directly. + + YANG Description: Container for the list of named SRLGs. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=path_srlgs_names.path_srlgs_names, is_container='container', yang_name="path-srlgs-names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_srlgs_names must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=path_srlgs_names.path_srlgs_names, is_container='container', yang_name="path-srlgs-names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__path_srlgs_names = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_srlgs_names(self): + self.__path_srlgs_names = YANGDynClass(base=path_srlgs_names.path_srlgs_names, is_container='container', yang_name="path-srlgs-names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_path_route_objects(self): + """ + Getter method for path_route_objects, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects (container) + + YANG Description: Container for the list of route objects either returned by +the computation engine or actually used by an LSP. + """ + return self.__path_route_objects + + def _set_path_route_objects(self, v, load=False): + """ + Setter method for path_route_objects, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_route_objects is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_route_objects() directly. + + YANG Description: Container for the list of route objects either returned by +the computation engine or actually used by an LSP. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=path_route_objects.path_route_objects, is_container='container', yang_name="path-route-objects", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_route_objects must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=path_route_objects.path_route_objects, is_container='container', yang_name="path-route-objects", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__path_route_objects = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_route_objects(self): + self.__path_route_objects = YANGDynClass(base=path_route_objects.path_route_objects, is_container='container', yang_name="path-route-objects", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + path_metric = __builtin__.property(_get_path_metric) + path_affinities_values = __builtin__.property(_get_path_affinities_values) + path_affinity_names = __builtin__.property(_get_path_affinity_names) + path_srlgs_lists = __builtin__.property(_get_path_srlgs_lists) + path_srlgs_names = __builtin__.property(_get_path_srlgs_names) + path_route_objects = __builtin__.property(_get_path_route_objects) + + + _pyangbind_elements = OrderedDict([('path_metric', path_metric), ('path_affinities_values', path_affinities_values), ('path_affinity_names', path_affinity_names), ('path_srlgs_lists', path_srlgs_lists), ('path_srlgs_names', path_srlgs_names), ('path_route_objects', path_route_objects), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_affinities_values/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_affinities_values/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..5e54de27228aad73fbca118fde3e1fa2376541cf --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_affinities_values/__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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 path_affinities_value +class path_affinities_values(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/connectivity-matrix/path-properties/path-affinities-values. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Path affinities represented as values. + """ + __slots__ = ('_path_helper', '_extmethods', '__path_affinities_value',) + + _yang_name = 'path-affinities-values' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__path_affinities_value = YANGDynClass(base=YANGListType("usage",path_affinities_value.path_affinities_value, yang_name="path-affinities-value", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-affinities-value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', 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 ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'connectivity-matrix', 'path-properties', 'path-affinities-values'] + + def _get_path_affinities_value(self): + """ + Getter method for path_affinities_value, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_affinities_values/path_affinities_value (list) + + YANG Description: List of named affinity constraints. + """ + return self.__path_affinities_value + + def _set_path_affinities_value(self, v, load=False): + """ + Setter method for path_affinities_value, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_affinities_values/path_affinities_value (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_affinities_value is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_affinities_value() directly. + + YANG Description: List of named affinity constraints. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("usage",path_affinities_value.path_affinities_value, yang_name="path-affinities-value", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-affinities-value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_affinities_value must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("usage",path_affinities_value.path_affinities_value, yang_name="path-affinities-value", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-affinities-value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False)""", + }) + + self.__path_affinities_value = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_affinities_value(self): + self.__path_affinities_value = YANGDynClass(base=YANGListType("usage",path_affinities_value.path_affinities_value, yang_name="path-affinities-value", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-affinities-value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + + path_affinities_value = __builtin__.property(_get_path_affinities_value) + + + _pyangbind_elements = OrderedDict([('path_affinities_value', path_affinities_value), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_affinities_values/path_affinities_value/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_affinities_values/path_affinities_value/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..df6fd94eb524085ace9f530e78b2c21b279c795f --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_affinities_values/path_affinities_value/__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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 path_affinities_value(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/connectivity-matrix/path-properties/path-affinities-values/path-affinities-value. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: List of named affinity constraints. + """ + __slots__ = ('_path_helper', '_extmethods', '__usage','__value',) + + _yang_name = 'path-affinities-value' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__usage = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + self.__value = YANGDynClass(base=[RestrictedClassType(base_type=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}), restriction_dict={'length': ['1..11']}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}),], default=six.text_type(""), is_leaf=True, yang_name="value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='admin-groups', 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 ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'connectivity-matrix', 'path-properties', 'path-affinities-values', 'path-affinities-value'] + + def _get_usage(self): + """ + Getter method for usage, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_affinities_values/path_affinities_value/usage (identityref) + + YANG Description: Identifies an entry in the list of value affinity +constraints. + """ + return self.__usage + + def _set_usage(self, v, load=False): + """ + Setter method for usage, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_affinities_values/path_affinities_value/usage (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_usage is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_usage() directly. + + YANG Description: Identifies an entry in the list of value affinity +constraints. + """ + 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=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """usage must be of a type compatible with identityref""", + 'defined-type': "ietf-te-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False)""", + }) + + self.__usage = t + if hasattr(self, '_set'): + self._set() + + def _unset_usage(self): + self.__usage = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + + + def _get_value(self): + """ + Getter method for value, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_affinities_values/path_affinities_value/value (admin-groups) + + YANG Description: The affinity value. The default is empty. + """ + return self.__value + + def _set_value(self, v, load=False): + """ + Setter method for value, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_affinities_values/path_affinities_value/value (admin-groups) + 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: The affinity value. The default is empty. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=[RestrictedClassType(base_type=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}), restriction_dict={'length': ['1..11']}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}),], default=six.text_type(""), is_leaf=True, yang_name="value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='admin-groups', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """value must be of a type compatible with admin-groups""", + 'defined-type': "ietf-te-topology:admin-groups", + 'generated-type': """YANGDynClass(base=[RestrictedClassType(base_type=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}), restriction_dict={'length': ['1..11']}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}),], default=six.text_type(""), is_leaf=True, yang_name="value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='admin-groups', is_config=False)""", + }) + + self.__value = t + if hasattr(self, '_set'): + self._set() + + def _unset_value(self): + self.__value = YANGDynClass(base=[RestrictedClassType(base_type=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}), restriction_dict={'length': ['1..11']}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}),], default=six.text_type(""), is_leaf=True, yang_name="value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='admin-groups', is_config=False) + + usage = __builtin__.property(_get_usage) + value = __builtin__.property(_get_value) + + + _pyangbind_elements = OrderedDict([('usage', usage), ('value', value), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_affinity_names/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_affinity_names/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..97969b43740067ba7b3f079983f8f43c624d1466 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_affinity_names/__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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 path_affinity_name +class path_affinity_names(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/connectivity-matrix/path-properties/path-affinity-names. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Path affinities represented as names. + """ + __slots__ = ('_path_helper', '_extmethods', '__path_affinity_name',) + + _yang_name = 'path-affinity-names' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__path_affinity_name = YANGDynClass(base=YANGListType("usage",path_affinity_name.path_affinity_name, yang_name="path-affinity-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-affinity-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', 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 ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'connectivity-matrix', 'path-properties', 'path-affinity-names'] + + def _get_path_affinity_name(self): + """ + Getter method for path_affinity_name, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_affinity_names/path_affinity_name (list) + + YANG Description: List of named affinity constraints. + """ + return self.__path_affinity_name + + def _set_path_affinity_name(self, v, load=False): + """ + Setter method for path_affinity_name, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_affinity_names/path_affinity_name (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_affinity_name is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_affinity_name() directly. + + YANG Description: List of named affinity constraints. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("usage",path_affinity_name.path_affinity_name, yang_name="path-affinity-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-affinity-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_affinity_name must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("usage",path_affinity_name.path_affinity_name, yang_name="path-affinity-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-affinity-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False)""", + }) + + self.__path_affinity_name = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_affinity_name(self): + self.__path_affinity_name = YANGDynClass(base=YANGListType("usage",path_affinity_name.path_affinity_name, yang_name="path-affinity-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-affinity-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + + path_affinity_name = __builtin__.property(_get_path_affinity_name) + + + _pyangbind_elements = OrderedDict([('path_affinity_name', path_affinity_name), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_affinity_names/path_affinity_name/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_affinity_names/path_affinity_name/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..47b1cb4768bb609d795a99ea877462d5143a3976 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_affinity_names/path_affinity_name/__init__.py @@ -0,0 +1,162 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 affinity_name +class path_affinity_name(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/connectivity-matrix/path-properties/path-affinity-names/path-affinity-name. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: List of named affinity constraints. + """ + __slots__ = ('_path_helper', '_extmethods', '__usage','__affinity_name',) + + _yang_name = 'path-affinity-name' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__usage = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + self.__affinity_name = YANGDynClass(base=YANGListType("name",affinity_name.affinity_name, yang_name="affinity-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='name', extensions=None), is_container='list', yang_name="affinity-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', 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 ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'connectivity-matrix', 'path-properties', 'path-affinity-names', 'path-affinity-name'] + + def _get_usage(self): + """ + Getter method for usage, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_affinity_names/path_affinity_name/usage (identityref) + + YANG Description: Identifies an entry in the list of named affinity +constraints. + """ + return self.__usage + + def _set_usage(self, v, load=False): + """ + Setter method for usage, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_affinity_names/path_affinity_name/usage (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_usage is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_usage() directly. + + YANG Description: Identifies an entry in the list of named affinity +constraints. + """ + 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=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """usage must be of a type compatible with identityref""", + 'defined-type': "ietf-te-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False)""", + }) + + self.__usage = t + if hasattr(self, '_set'): + self._set() + + def _unset_usage(self): + self.__usage = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + + + def _get_affinity_name(self): + """ + Getter method for affinity_name, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_affinity_names/path_affinity_name/affinity_name (list) + + YANG Description: List of named affinities. + """ + return self.__affinity_name + + def _set_affinity_name(self, v, load=False): + """ + Setter method for affinity_name, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_affinity_names/path_affinity_name/affinity_name (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_affinity_name is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_affinity_name() directly. + + YANG Description: List of named affinities. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("name",affinity_name.affinity_name, yang_name="affinity-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='name', extensions=None), is_container='list', yang_name="affinity-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """affinity_name must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("name",affinity_name.affinity_name, yang_name="affinity-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='name', extensions=None), is_container='list', yang_name="affinity-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False)""", + }) + + self.__affinity_name = t + if hasattr(self, '_set'): + self._set() + + def _unset_affinity_name(self): + self.__affinity_name = YANGDynClass(base=YANGListType("name",affinity_name.affinity_name, yang_name="affinity-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='name', extensions=None), is_container='list', yang_name="affinity-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + + usage = __builtin__.property(_get_usage) + affinity_name = __builtin__.property(_get_affinity_name) + + + _pyangbind_elements = OrderedDict([('usage', usage), ('affinity_name', affinity_name), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_affinity_names/path_affinity_name/affinity_name/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_affinity_names/path_affinity_name/affinity_name/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..043b7900eaed4d12e772026171a965693e6fb371 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_affinity_names/path_affinity_name/affinity_name/__init__.py @@ -0,0 +1,120 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 affinity_name(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/connectivity-matrix/path-properties/path-affinity-names/path-affinity-name/affinity-name. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: List of named affinities. + """ + __slots__ = ('_path_helper', '_extmethods', '__name',) + + _yang_name = 'affinity-name' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _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='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', 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 ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'connectivity-matrix', 'path-properties', 'path-affinity-names', 'path-affinity-name', 'affinity-name'] + + def _get_name(self): + """ + Getter method for name, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_affinity_names/path_affinity_name/affinity_name/name (string) + + YANG Description: Identifies a named affinity entry. + """ + return self.__name + + def _set_name(self, v, load=False): + """ + Setter method for name, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_affinity_names/path_affinity_name/affinity_name/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: Identifies a named affinity entry. + """ + 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='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', 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, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', 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, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=False) + + name = __builtin__.property(_get_name) + + + _pyangbind_elements = OrderedDict([('name', name), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_metric/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_metric/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..46350a791d4cda3328317288a91d8f1b6dc41515 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_metric/__init__.py @@ -0,0 +1,159 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 path_metric(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/connectivity-matrix/path-properties/path-metric. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: TE path metric type. + """ + __slots__ = ('_path_helper', '_extmethods', '__metric_type','__accumulative_value',) + + _yang_name = 'path-metric' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__metric_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="metric-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + self.__accumulative_value = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="accumulative-value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', 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 ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'connectivity-matrix', 'path-properties', 'path-metric'] + + def _get_metric_type(self): + """ + Getter method for metric_type, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_metric/metric_type (identityref) + + YANG Description: TE path metric type. + """ + return self.__metric_type + + def _set_metric_type(self, v, load=False): + """ + Setter method for metric_type, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_metric/metric_type (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_metric_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_metric_type() directly. + + YANG Description: TE path metric type. + """ + 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=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="metric-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """metric_type must be of a type compatible with identityref""", + 'defined-type': "ietf-te-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="metric-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False)""", + }) + + self.__metric_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_metric_type(self): + self.__metric_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="metric-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + + + def _get_accumulative_value(self): + """ + Getter method for accumulative_value, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_metric/accumulative_value (uint64) + + YANG Description: TE path metric accumulative value. + """ + return self.__accumulative_value + + def _set_accumulative_value(self, v, load=False): + """ + Setter method for accumulative_value, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_metric/accumulative_value (uint64) + If this variable is read-only (config: false) in the + source YANG file, then _set_accumulative_value is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_accumulative_value() directly. + + YANG Description: TE path metric accumulative value. + """ + 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="accumulative-value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint64', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """accumulative_value 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="accumulative-value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint64', is_config=False)""", + }) + + self.__accumulative_value = t + if hasattr(self, '_set'): + self._set() + + def _unset_accumulative_value(self): + self.__accumulative_value = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="accumulative-value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint64', is_config=False) + + metric_type = __builtin__.property(_get_metric_type) + accumulative_value = __builtin__.property(_get_accumulative_value) + + + _pyangbind_elements = OrderedDict([('metric_type', metric_type), ('accumulative_value', accumulative_value), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..cd515c92f9c87e5fead687d05f45a09c2a94a494 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/__init__.py @@ -0,0 +1,119 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 path_route_object +class path_route_objects(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/connectivity-matrix/path-properties/path-route-objects. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Container for the list of route objects either returned by +the computation engine or actually used by an LSP. + """ + __slots__ = ('_path_helper', '_extmethods', '__path_route_object',) + + _yang_name = 'path-route-objects' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__path_route_object = YANGDynClass(base=YANGListType("index",path_route_object.path_route_object, yang_name="path-route-object", parent=self, is_container='list', user_ordered=True, path_helper=self._path_helper, yang_keys='index', extensions=None), is_container='list', yang_name="path-route-object", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', 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 ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'connectivity-matrix', 'path-properties', 'path-route-objects'] + + def _get_path_route_object(self): + """ + Getter method for path_route_object, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object (list) + + YANG Description: List of route objects either returned by the computation +engine or actually used by an LSP. + """ + return self.__path_route_object + + def _set_path_route_object(self, v, load=False): + """ + Setter method for path_route_object, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_route_object is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_route_object() directly. + + YANG Description: List of route objects either returned by the computation +engine or actually used by an LSP. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("index",path_route_object.path_route_object, yang_name="path-route-object", parent=self, is_container='list', user_ordered=True, path_helper=self._path_helper, yang_keys='index', extensions=None), is_container='list', yang_name="path-route-object", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_route_object must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("index",path_route_object.path_route_object, yang_name="path-route-object", parent=self, is_container='list', user_ordered=True, path_helper=self._path_helper, yang_keys='index', extensions=None), is_container='list', yang_name="path-route-object", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False)""", + }) + + self.__path_route_object = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_route_object(self): + self.__path_route_object = YANGDynClass(base=YANGListType("index",path_route_object.path_route_object, yang_name="path-route-object", parent=self, is_container='list', user_ordered=True, path_helper=self._path_helper, yang_keys='index', extensions=None), is_container='list', yang_name="path-route-object", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + + path_route_object = __builtin__.property(_get_path_route_object) + + + _pyangbind_elements = OrderedDict([('path_route_object', path_route_object), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..1161f751e512844bdf95a624bf007614f735a69e --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/__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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 numbered_node_hop +from . import numbered_link_hop +from . import unnumbered_link_hop +from . import as_number_hop +from . import label_hop +class path_route_object(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/connectivity-matrix/path-properties/path-route-objects/path-route-object. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: List of route objects either returned by the computation +engine or actually used by an LSP. + """ + __slots__ = ('_path_helper', '_extmethods', '__index','__numbered_node_hop','__numbered_link_hop','__unnumbered_link_hop','__as_number_hop','__label_hop',) + + _yang_name = 'path-route-object' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _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), is_leaf=True, yang_name="index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=False) + self.__numbered_node_hop = YANGDynClass(base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__numbered_link_hop = YANGDynClass(base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__unnumbered_link_hop = YANGDynClass(base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__as_number_hop = YANGDynClass(base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__label_hop = YANGDynClass(base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', 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 ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'connectivity-matrix', 'path-properties', 'path-route-objects', 'path-route-object'] + + def _get_index(self): + """ + Getter method for index, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/index (uint32) + + YANG Description: Route object entry index. The index is used to +identify an entry in the list. The order of entries +is defined by the user without relying on key +values. + """ + return self.__index + + def _set_index(self, v, load=False): + """ + Setter method for index, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/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: Route object entry index. The index is used to +identify an entry in the list. The order of entries +is defined by the user without relying on key +values. + """ + 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=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', 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), is_leaf=True, yang_name="index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', 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), is_leaf=True, yang_name="index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=False) + + + def _get_numbered_node_hop(self): + """ + Getter method for numbered_node_hop, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/numbered_node_hop (container) + + YANG Description: Numbered node route hop. + """ + return self.__numbered_node_hop + + def _set_numbered_node_hop(self, v, load=False): + """ + Setter method for numbered_node_hop, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/numbered_node_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_numbered_node_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_numbered_node_hop() directly. + + YANG Description: Numbered node route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """numbered_node_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__numbered_node_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_numbered_node_hop(self): + self.__numbered_node_hop = YANGDynClass(base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_numbered_link_hop(self): + """ + Getter method for numbered_link_hop, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/numbered_link_hop (container) + + YANG Description: Numbered link explicit route hop. + """ + return self.__numbered_link_hop + + def _set_numbered_link_hop(self, v, load=False): + """ + Setter method for numbered_link_hop, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/numbered_link_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_numbered_link_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_numbered_link_hop() directly. + + YANG Description: Numbered link explicit route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """numbered_link_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__numbered_link_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_numbered_link_hop(self): + self.__numbered_link_hop = YANGDynClass(base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_unnumbered_link_hop(self): + """ + Getter method for unnumbered_link_hop, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/unnumbered_link_hop (container) + + YANG Description: Unnumbered link explicit route hop. + """ + return self.__unnumbered_link_hop + + def _set_unnumbered_link_hop(self, v, load=False): + """ + Setter method for unnumbered_link_hop, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/unnumbered_link_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_unnumbered_link_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_unnumbered_link_hop() directly. + + YANG Description: Unnumbered link explicit route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """unnumbered_link_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__unnumbered_link_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_unnumbered_link_hop(self): + self.__unnumbered_link_hop = YANGDynClass(base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_as_number_hop(self): + """ + Getter method for as_number_hop, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/as_number_hop (container) + + YANG Description: AS explicit route hop. + """ + return self.__as_number_hop + + def _set_as_number_hop(self, v, load=False): + """ + Setter method for as_number_hop, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/as_number_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_as_number_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_as_number_hop() directly. + + YANG Description: AS explicit route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """as_number_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__as_number_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_as_number_hop(self): + self.__as_number_hop = YANGDynClass(base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_label_hop(self): + """ + Getter method for label_hop, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/label_hop (container) + + YANG Description: Label hop type. + """ + return self.__label_hop + + def _set_label_hop(self, v, load=False): + """ + Setter method for label_hop, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/label_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_label_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_label_hop() directly. + + YANG Description: Label hop type. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """label_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__label_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_label_hop(self): + self.__label_hop = YANGDynClass(base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + index = __builtin__.property(_get_index) + numbered_node_hop = __builtin__.property(_get_numbered_node_hop) + numbered_link_hop = __builtin__.property(_get_numbered_link_hop) + unnumbered_link_hop = __builtin__.property(_get_unnumbered_link_hop) + as_number_hop = __builtin__.property(_get_as_number_hop) + label_hop = __builtin__.property(_get_label_hop) + + __choices__ = {'type': {'numbered-node-hop': ['numbered_node_hop'], 'numbered-link-hop': ['numbered_link_hop'], 'unnumbered-link-hop': ['unnumbered_link_hop'], 'as-number': ['as_number_hop'], 'label': ['label_hop']}} + _pyangbind_elements = OrderedDict([('index', index), ('numbered_node_hop', numbered_node_hop), ('numbered_link_hop', numbered_link_hop), ('unnumbered_link_hop', unnumbered_link_hop), ('as_number_hop', as_number_hop), ('label_hop', label_hop), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/as_number_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/as_number_hop/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..b257ffed78be11f619693f26c8ac4ed962d9dbf6 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/as_number_hop/__init__.py @@ -0,0 +1,154 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 as_number_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/connectivity-matrix/path-properties/path-route-objects/path-route-object/as-number-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: AS explicit route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__as_number','__hop_type',) + + _yang_name = 'as-number-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__as_number = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=False) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', 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 ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'connectivity-matrix', 'path-properties', 'path-route-objects', 'path-route-object', 'as-number-hop'] + + def _get_as_number(self): + """ + Getter method for as_number, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/as_number_hop/as_number (inet:as-number) + + YANG Description: The Autonomous System (AS) number. + """ + return self.__as_number + + def _set_as_number(self, v, load=False): + """ + Setter method for as_number, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/as_number_hop/as_number (inet:as-number) + If this variable is read-only (config: false) in the + source YANG file, then _set_as_number is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_as_number() directly. + + YANG Description: The Autonomous System (AS) number. + """ + 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="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """as_number must be of a type compatible with inet:as-number""", + 'defined-type': "inet:as-number", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=False)""", + }) + + self.__as_number = t + if hasattr(self, '_set'): + self._set() + + def _unset_as_number(self): + self.__as_number = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=False) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/as_number_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/as_number_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + 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={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + + as_number = __builtin__.property(_get_as_number) + hop_type = __builtin__.property(_get_hop_type) + + __choices__ = {'type': {'as-number': ['as_number', 'hop_type']}} + _pyangbind_elements = OrderedDict([('as_number', as_number), ('hop_type', hop_type), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/label_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/label_hop/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..1740e147ea928bcfad9d102a2911d91d2e4e19d7 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/label_hop/__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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 te_label +class label_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/connectivity-matrix/path-properties/path-route-objects/path-route-object/label-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Label hop type. + """ + __slots__ = ('_path_helper', '_extmethods', '__te_label',) + + _yang_name = 'label-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__te_label = YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', 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 ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'connectivity-matrix', 'path-properties', 'path-route-objects', 'path-route-object', 'label-hop'] + + def _get_te_label(self): + """ + Getter method for te_label, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/label_hop/te_label (container) + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + return self.__te_label + + def _set_te_label(self, v, load=False): + """ + Setter method for te_label, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/label_hop/te_label (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_te_label is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_te_label() directly. + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """te_label must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__te_label = t + if hasattr(self, '_set'): + self._set() + + def _unset_te_label(self): + self.__te_label = YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + te_label = __builtin__.property(_get_te_label) + + __choices__ = {'type': {'label': ['te_label']}} + _pyangbind_elements = OrderedDict([('te_label', te_label), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/label_hop/te_label/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/label_hop/te_label/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..f69cf8311d9b085775451b9553f4b2189c23dc10 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/label_hop/te_label/__init__.py @@ -0,0 +1,234 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 otn +class te_label(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/connectivity-matrix/path-properties/path-route-objects/path-route-object/label-hop/te-label. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + __slots__ = ('_path_helper', '_extmethods', '__generic','__otn','__vlanid','__direction',) + + _yang_name = 'te-label' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__generic = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=False) + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False) + self.__vlanid = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=False) + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', 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 ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'connectivity-matrix', 'path-properties', 'path-route-objects', 'path-route-object', 'label-hop', 'te-label'] + + def _get_generic(self): + """ + Getter method for generic, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/label_hop/te_label/generic (rt-types:generalized-label) + + YANG Description: TE label specified in a generic format. + """ + return self.__generic + + def _set_generic(self, v, load=False): + """ + Setter method for generic, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/label_hop/te_label/generic (rt-types:generalized-label) + If this variable is read-only (config: false) in the + source YANG file, then _set_generic is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_generic() directly. + + YANG Description: TE label specified in a generic format. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """generic must be of a type compatible with rt-types:generalized-label""", + 'defined-type': "rt-types:generalized-label", + 'generated-type': """YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=False)""", + }) + + self.__generic = t + if hasattr(self, '_set'): + self._set() + + def _unset_generic(self): + self.__generic = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=False) + + + def _get_otn(self): + """ + Getter method for otn, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/label_hop/te_label/otn (container) + + YANG Description: Label hop for OTN. + """ + return self.__otn + + def _set_otn(self, v, load=False): + """ + Setter method for otn, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/label_hop/te_label/otn (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_otn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_otn() directly. + + YANG Description: Label hop for OTN. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """otn must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False)""", + }) + + self.__otn = t + if hasattr(self, '_set'): + self._set() + + def _unset_otn(self): + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False) + + + def _get_vlanid(self): + """ + Getter method for vlanid, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/label_hop/te_label/vlanid (etht-types:vlanid) + + YANG Description: VLAN tag id. + """ + return self.__vlanid + + def _set_vlanid(self, v, load=False): + """ + Setter method for vlanid, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/label_hop/te_label/vlanid (etht-types:vlanid) + If this variable is read-only (config: false) in the + source YANG file, then _set_vlanid is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_vlanid() directly. + + YANG Description: VLAN tag id. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """vlanid must be of a type compatible with etht-types:vlanid""", + 'defined-type': "etht-types:vlanid", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=False)""", + }) + + self.__vlanid = t + if hasattr(self, '_set'): + self._set() + + def _unset_vlanid(self): + self.__vlanid = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=False) + + + def _get_direction(self): + """ + Getter method for direction, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/label_hop/te_label/direction (te-label-direction) + + YANG Description: Label direction. + """ + return self.__direction + + def _set_direction(self, v, load=False): + """ + Setter method for direction, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/label_hop/te_label/direction (te-label-direction) + If this variable is read-only (config: false) in the + source YANG file, then _set_direction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_direction() directly. + + YANG Description: Label direction. + """ + 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={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """direction must be of a type compatible with te-label-direction""", + 'defined-type': "ietf-te-topology:te-label-direction", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=False)""", + }) + + self.__direction = t + if hasattr(self, '_set'): + self._set() + + def _unset_direction(self): + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=False) + + generic = __builtin__.property(_get_generic) + otn = __builtin__.property(_get_otn) + vlanid = __builtin__.property(_get_vlanid) + direction = __builtin__.property(_get_direction) + + __choices__ = {'technology': {'generic': ['generic'], 'otn': ['otn'], 'eth': ['vlanid']}, 'type': {'label': ['direction']}} + _pyangbind_elements = OrderedDict([('generic', generic), ('otn', otn), ('vlanid', vlanid), ('direction', direction), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/label_hop/te_label/otn/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/label_hop/te_label/otn/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e8b6d2f8d0f71572c858c6119f28b9d849b147d1 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/label_hop/te_label/otn/__init__.py @@ -0,0 +1,209 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 otn(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/connectivity-matrix/path-properties/path-route-objects/path-route-object/label-hop/te-label/otn. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Label hop for OTN. + """ + __slots__ = ('_path_helper', '_extmethods', '__tpn','__tsg','__ts_list',) + + _yang_name = 'otn' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__tpn = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=False) + self.__tsg = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=False) + self.__ts_list = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', 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 ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'connectivity-matrix', 'path-properties', 'path-route-objects', 'path-route-object', 'label-hop', 'te-label', 'otn'] + + def _get_tpn(self): + """ + Getter method for tpn, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/label_hop/te_label/otn/tpn (otn-tpn) + + YANG Description: Tributary Port Number (TPN). + """ + return self.__tpn + + def _set_tpn(self, v, load=False): + """ + Setter method for tpn, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/label_hop/te_label/otn/tpn (otn-tpn) + If this variable is read-only (config: false) in the + source YANG file, then _set_tpn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tpn() directly. + + YANG Description: Tributary Port Number (TPN). + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tpn must be of a type compatible with otn-tpn""", + 'defined-type': "ietf-otn-topology:otn-tpn", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=False)""", + }) + + self.__tpn = t + if hasattr(self, '_set'): + self._set() + + def _unset_tpn(self): + self.__tpn = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=False) + + + def _get_tsg(self): + """ + Getter method for tsg, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/label_hop/te_label/otn/tsg (identityref) + + YANG Description: Tributary Slot Granularity (TSG). + """ + return self.__tsg + + def _set_tsg(self, v, load=False): + """ + Setter method for tsg, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/label_hop/te_label/otn/tsg (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_tsg is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tsg() directly. + + YANG Description: Tributary Slot Granularity (TSG). + """ + 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={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tsg must be of a type compatible with identityref""", + 'defined-type': "ietf-otn-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=False)""", + }) + + self.__tsg = t + if hasattr(self, '_set'): + self._set() + + def _unset_tsg(self): + self.__tsg = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=False) + + + def _get_ts_list(self): + """ + Getter method for ts_list, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/label_hop/te_label/otn/ts_list (string) + + YANG Description: A list of available Tributary Slots (TS) ranging + + + + +between 1 and 4095. If multiple values or +ranges are given, they all MUST be disjoint +and MUST be in ascending order. +For example 1-20,25,50-1000. + """ + return self.__ts_list + + def _set_ts_list(self, v, load=False): + """ + Setter method for ts_list, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/label_hop/te_label/otn/ts_list (string) + If this variable is read-only (config: false) in the + source YANG file, then _set_ts_list is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_ts_list() directly. + + YANG Description: A list of available Tributary Slots (TS) ranging + + + + +between 1 and 4095. If multiple values or +ranges are given, they all MUST be disjoint +and MUST be in ascending order. +For example 1-20,25,50-1000. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='string', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """ts_list must be of a type compatible with string""", + 'defined-type': "string", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='string', is_config=False)""", + }) + + self.__ts_list = t + if hasattr(self, '_set'): + self._set() + + def _unset_ts_list(self): + self.__ts_list = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='string', is_config=False) + + tpn = __builtin__.property(_get_tpn) + tsg = __builtin__.property(_get_tsg) + ts_list = __builtin__.property(_get_ts_list) + + __choices__ = {'technology': {'otn': ['tpn', 'tsg', 'ts_list']}} + _pyangbind_elements = OrderedDict([('tpn', tpn), ('tsg', tsg), ('ts_list', ts_list), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/numbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/numbered_link_hop/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..af1242f7df8795d13bc589e60a08bc0064c961a6 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/numbered_link_hop/__init__.py @@ -0,0 +1,193 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 numbered_link_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/connectivity-matrix/path-properties/path-route-objects/path-route-object/numbered-link-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Numbered link explicit route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__link_tp_id','__hop_type','__direction',) + + _yang_name = 'numbered-link-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=False) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', 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 ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'connectivity-matrix', 'path-properties', 'path-route-objects', 'path-route-object', 'numbered-link-hop'] + + def _get_link_tp_id(self): + """ + Getter method for link_tp_id, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/numbered_link_hop/link_tp_id (te-tp-id) + + YANG Description: TE Link Termination Point (LTP) identifier. + """ + return self.__link_tp_id + + def _set_link_tp_id(self, v, load=False): + """ + Setter method for link_tp_id, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/numbered_link_hop/link_tp_id (te-tp-id) + If this variable is read-only (config: false) in the + source YANG file, then _set_link_tp_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_link_tp_id() directly. + + YANG Description: TE Link Termination Point (LTP) identifier. + """ + 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),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """link_tp_id must be of a type compatible with te-tp-id""", + 'defined-type': "ietf-te-topology:te-tp-id", + 'generated-type': """YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=False)""", + }) + + self.__link_tp_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_link_tp_id(self): + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=False) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/numbered_link_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/numbered_link_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + 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={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + + + def _get_direction(self): + """ + Getter method for direction, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/numbered_link_hop/direction (te-link-direction) + + YANG Description: Link route object direction. + """ + return self.__direction + + def _set_direction(self, v, load=False): + """ + Setter method for direction, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/numbered_link_hop/direction (te-link-direction) + If this variable is read-only (config: false) in the + source YANG file, then _set_direction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_direction() directly. + + YANG Description: Link route object direction. + """ + 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={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """direction must be of a type compatible with te-link-direction""", + 'defined-type': "ietf-te-topology:te-link-direction", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=False)""", + }) + + self.__direction = t + if hasattr(self, '_set'): + self._set() + + def _unset_direction(self): + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=False) + + link_tp_id = __builtin__.property(_get_link_tp_id) + hop_type = __builtin__.property(_get_hop_type) + direction = __builtin__.property(_get_direction) + + __choices__ = {'type': {'numbered-link-hop': ['link_tp_id', 'hop_type', 'direction']}} + _pyangbind_elements = OrderedDict([('link_tp_id', link_tp_id), ('hop_type', hop_type), ('direction', direction), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/numbered_node_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/numbered_node_hop/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..6d06026657464feb50eef363ce1661c1aca5b0e9 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/numbered_node_hop/__init__.py @@ -0,0 +1,154 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 numbered_node_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/connectivity-matrix/path-properties/path-route-objects/path-route-object/numbered-node-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Numbered node route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__node_id','__hop_type',) + + _yang_name = 'numbered-node-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=False) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', 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 ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'connectivity-matrix', 'path-properties', 'path-route-objects', 'path-route-object', 'numbered-node-hop'] + + def _get_node_id(self): + """ + Getter method for node_id, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/numbered_node_hop/node_id (te-node-id) + + YANG Description: The identifier of a node in the TE topology. + """ + return self.__node_id + + def _set_node_id(self, v, load=False): + """ + Setter method for node_id, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/numbered_node_hop/node_id (te-node-id) + 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. + + YANG Description: The identifier of a node in the TE topology. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """node_id must be of a type compatible with te-node-id""", + 'defined-type': "ietf-te-topology:te-node-id", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=False)""", + }) + + self.__node_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_node_id(self): + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=False) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/numbered_node_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/numbered_node_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + 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={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + + node_id = __builtin__.property(_get_node_id) + hop_type = __builtin__.property(_get_hop_type) + + __choices__ = {'type': {'numbered-node-hop': ['node_id', 'hop_type']}} + _pyangbind_elements = OrderedDict([('node_id', node_id), ('hop_type', hop_type), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/unnumbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/unnumbered_link_hop/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..ce5442e682e33f23002793fdd0316cb570c8e77e --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/unnumbered_link_hop/__init__.py @@ -0,0 +1,236 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 unnumbered_link_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/connectivity-matrix/path-properties/path-route-objects/path-route-object/unnumbered-link-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Unnumbered link explicit route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__link_tp_id','__node_id','__hop_type','__direction',) + + _yang_name = 'unnumbered-link-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=False) + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=False) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', 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 ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'connectivity-matrix', 'path-properties', 'path-route-objects', 'path-route-object', 'unnumbered-link-hop'] + + def _get_link_tp_id(self): + """ + Getter method for link_tp_id, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/unnumbered_link_hop/link_tp_id (te-tp-id) + + YANG Description: TE LTP identifier. The combination of the TE link ID +and the TE node ID is used to identify an unnumbered +TE link. + """ + return self.__link_tp_id + + def _set_link_tp_id(self, v, load=False): + """ + Setter method for link_tp_id, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/unnumbered_link_hop/link_tp_id (te-tp-id) + If this variable is read-only (config: false) in the + source YANG file, then _set_link_tp_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_link_tp_id() directly. + + YANG Description: TE LTP identifier. The combination of the TE link ID +and the TE node ID is used to identify an unnumbered +TE link. + """ + 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),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """link_tp_id must be of a type compatible with te-tp-id""", + 'defined-type': "ietf-te-topology:te-tp-id", + 'generated-type': """YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=False)""", + }) + + self.__link_tp_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_link_tp_id(self): + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=False) + + + def _get_node_id(self): + """ + Getter method for node_id, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/unnumbered_link_hop/node_id (te-node-id) + + YANG Description: The identifier of a node in the TE topology. + """ + return self.__node_id + + def _set_node_id(self, v, load=False): + """ + Setter method for node_id, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/unnumbered_link_hop/node_id (te-node-id) + 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. + + YANG Description: The identifier of a node in the TE topology. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """node_id must be of a type compatible with te-node-id""", + 'defined-type': "ietf-te-topology:te-node-id", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=False)""", + }) + + self.__node_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_node_id(self): + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=False) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/unnumbered_link_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/unnumbered_link_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + 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={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + + + def _get_direction(self): + """ + Getter method for direction, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/unnumbered_link_hop/direction (te-link-direction) + + YANG Description: Link route object direction. + """ + return self.__direction + + def _set_direction(self, v, load=False): + """ + Setter method for direction, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/unnumbered_link_hop/direction (te-link-direction) + If this variable is read-only (config: false) in the + source YANG file, then _set_direction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_direction() directly. + + YANG Description: Link route object direction. + """ + 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={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """direction must be of a type compatible with te-link-direction""", + 'defined-type': "ietf-te-topology:te-link-direction", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=False)""", + }) + + self.__direction = t + if hasattr(self, '_set'): + self._set() + + def _unset_direction(self): + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=False) + + link_tp_id = __builtin__.property(_get_link_tp_id) + node_id = __builtin__.property(_get_node_id) + hop_type = __builtin__.property(_get_hop_type) + direction = __builtin__.property(_get_direction) + + __choices__ = {'type': {'unnumbered-link-hop': ['link_tp_id', 'node_id', 'hop_type', 'direction']}} + _pyangbind_elements = OrderedDict([('link_tp_id', link_tp_id), ('node_id', node_id), ('hop_type', hop_type), ('direction', direction), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_srlgs_lists/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_srlgs_lists/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..9eeb9f3bc0897e087dbb923f08aa12eca8acd9e8 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_srlgs_lists/__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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 path_srlgs_list +class path_srlgs_lists(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/connectivity-matrix/path-properties/path-srlgs-lists. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Path SRLG properties container. + """ + __slots__ = ('_path_helper', '_extmethods', '__path_srlgs_list',) + + _yang_name = 'path-srlgs-lists' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__path_srlgs_list = YANGDynClass(base=YANGListType("usage",path_srlgs_list.path_srlgs_list, yang_name="path-srlgs-list", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-srlgs-list", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', 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 ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'connectivity-matrix', 'path-properties', 'path-srlgs-lists'] + + def _get_path_srlgs_list(self): + """ + Getter method for path_srlgs_list, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_srlgs_lists/path_srlgs_list (list) + + YANG Description: List of SRLG values to be included or excluded. + """ + return self.__path_srlgs_list + + def _set_path_srlgs_list(self, v, load=False): + """ + Setter method for path_srlgs_list, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_srlgs_lists/path_srlgs_list (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_srlgs_list is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_srlgs_list() directly. + + YANG Description: List of SRLG values to be included or excluded. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("usage",path_srlgs_list.path_srlgs_list, yang_name="path-srlgs-list", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-srlgs-list", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_srlgs_list must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("usage",path_srlgs_list.path_srlgs_list, yang_name="path-srlgs-list", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-srlgs-list", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False)""", + }) + + self.__path_srlgs_list = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_srlgs_list(self): + self.__path_srlgs_list = YANGDynClass(base=YANGListType("usage",path_srlgs_list.path_srlgs_list, yang_name="path-srlgs-list", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-srlgs-list", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + + path_srlgs_list = __builtin__.property(_get_path_srlgs_list) + + + _pyangbind_elements = OrderedDict([('path_srlgs_list', path_srlgs_list), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_srlgs_lists/path_srlgs_list/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_srlgs_lists/path_srlgs_list/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..1055b900a70cb06d2e5f85b4483a8fe86a9edd9d --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_srlgs_lists/path_srlgs_list/__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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 path_srlgs_list(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/connectivity-matrix/path-properties/path-srlgs-lists/path-srlgs-list. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: List of SRLG values to be included or excluded. + """ + __slots__ = ('_path_helper', '_extmethods', '__usage','__values',) + + _yang_name = 'path-srlgs-list' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__usage = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + self.__values = YANGDynClass(unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32)), is_leaf=False, yang_name="values", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='srlg', 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 ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'connectivity-matrix', 'path-properties', 'path-srlgs-lists', 'path-srlgs-list'] + + def _get_usage(self): + """ + Getter method for usage, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_srlgs_lists/path_srlgs_list/usage (identityref) + + YANG Description: Identifies an entry in a list of SRLGs to either +include or exclude. + """ + return self.__usage + + def _set_usage(self, v, load=False): + """ + Setter method for usage, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_srlgs_lists/path_srlgs_list/usage (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_usage is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_usage() directly. + + YANG Description: Identifies an entry in a list of SRLGs to either +include or exclude. + """ + 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=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """usage must be of a type compatible with identityref""", + 'defined-type': "ietf-te-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False)""", + }) + + self.__usage = t + if hasattr(self, '_set'): + self._set() + + def _unset_usage(self): + self.__usage = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + + + def _get_values(self): + """ + Getter method for values, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_srlgs_lists/path_srlgs_list/values (srlg) + + YANG Description: List of SRLG values. + """ + return self.__values + + def _set_values(self, v, load=False): + """ + Setter method for values, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_srlgs_lists/path_srlgs_list/values (srlg) + If this variable is read-only (config: false) in the + source YANG file, then _set_values is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_values() directly. + + YANG Description: List of SRLG values. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32)), is_leaf=False, yang_name="values", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='srlg', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """values must be of a type compatible with srlg""", + 'defined-type': "ietf-te-topology:srlg", + 'generated-type': """YANGDynClass(unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32)), is_leaf=False, yang_name="values", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='srlg', is_config=False)""", + }) + + self.__values = t + if hasattr(self, '_set'): + self._set() + + def _unset_values(self): + self.__values = YANGDynClass(unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32)), is_leaf=False, yang_name="values", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='srlg', is_config=False) + + usage = __builtin__.property(_get_usage) + values = __builtin__.property(_get_values) + + + _pyangbind_elements = OrderedDict([('usage', usage), ('values', values), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_srlgs_names/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_srlgs_names/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..796ccb5f22347bf51b003e64b52d420885ca2303 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_srlgs_names/__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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 path_srlgs_name +class path_srlgs_names(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/connectivity-matrix/path-properties/path-srlgs-names. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Container for the list of named SRLGs. + """ + __slots__ = ('_path_helper', '_extmethods', '__path_srlgs_name',) + + _yang_name = 'path-srlgs-names' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__path_srlgs_name = YANGDynClass(base=YANGListType("usage",path_srlgs_name.path_srlgs_name, yang_name="path-srlgs-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-srlgs-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', 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 ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'connectivity-matrix', 'path-properties', 'path-srlgs-names'] + + def _get_path_srlgs_name(self): + """ + Getter method for path_srlgs_name, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_srlgs_names/path_srlgs_name (list) + + YANG Description: List of named SRLGs to be included or excluded. + """ + return self.__path_srlgs_name + + def _set_path_srlgs_name(self, v, load=False): + """ + Setter method for path_srlgs_name, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_srlgs_names/path_srlgs_name (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_srlgs_name is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_srlgs_name() directly. + + YANG Description: List of named SRLGs to be included or excluded. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("usage",path_srlgs_name.path_srlgs_name, yang_name="path-srlgs-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-srlgs-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_srlgs_name must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("usage",path_srlgs_name.path_srlgs_name, yang_name="path-srlgs-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-srlgs-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False)""", + }) + + self.__path_srlgs_name = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_srlgs_name(self): + self.__path_srlgs_name = YANGDynClass(base=YANGListType("usage",path_srlgs_name.path_srlgs_name, yang_name="path-srlgs-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-srlgs-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + + path_srlgs_name = __builtin__.property(_get_path_srlgs_name) + + + _pyangbind_elements = OrderedDict([('path_srlgs_name', path_srlgs_name), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_srlgs_names/path_srlgs_name/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_srlgs_names/path_srlgs_name/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..bdfa7bcab051555880838320ed60dcb06c1e9439 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_srlgs_names/path_srlgs_name/__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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 path_srlgs_name(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/connectivity-matrix/path-properties/path-srlgs-names/path-srlgs-name. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: List of named SRLGs to be included or excluded. + """ + __slots__ = ('_path_helper', '_extmethods', '__usage','__names',) + + _yang_name = 'path-srlgs-name' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__usage = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + self.__names = YANGDynClass(unique=True, base=TypedListType(allowed_type=six.text_type), is_leaf=False, yang_name="names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', 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 ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'connectivity-matrix', 'path-properties', 'path-srlgs-names', 'path-srlgs-name'] + + def _get_usage(self): + """ + Getter method for usage, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_srlgs_names/path_srlgs_name/usage (identityref) + + YANG Description: Identifies an entry in a list of named SRLGs to either +include or exclude. + """ + return self.__usage + + def _set_usage(self, v, load=False): + """ + Setter method for usage, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_srlgs_names/path_srlgs_name/usage (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_usage is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_usage() directly. + + YANG Description: Identifies an entry in a list of named SRLGs to either +include or exclude. + """ + 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=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """usage must be of a type compatible with identityref""", + 'defined-type': "ietf-te-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False)""", + }) + + self.__usage = t + if hasattr(self, '_set'): + self._set() + + def _unset_usage(self): + self.__usage = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + + + def _get_names(self): + """ + Getter method for names, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_srlgs_names/path_srlgs_name/names (string) + + YANG Description: List of named SRLGs. + """ + return self.__names + + def _set_names(self, v, load=False): + """ + Setter method for names, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_srlgs_names/path_srlgs_name/names (string) + If this variable is read-only (config: false) in the + source YANG file, then _set_names is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_names() directly. + + YANG Description: List of named SRLGs. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,unique=True, base=TypedListType(allowed_type=six.text_type), is_leaf=False, yang_name="names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """names must be of a type compatible with string""", + 'defined-type': "string", + 'generated-type': """YANGDynClass(unique=True, base=TypedListType(allowed_type=six.text_type), is_leaf=False, yang_name="names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=False)""", + }) + + self.__names = t + if hasattr(self, '_set'): + self._set() + + def _unset_names(self): + self.__names = YANGDynClass(unique=True, base=TypedListType(allowed_type=six.text_type), is_leaf=False, yang_name="names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=False) + + usage = __builtin__.property(_get_usage) + names = __builtin__.property(_get_names) + + + _pyangbind_elements = OrderedDict([('usage', usage), ('names', names), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..71191caa02af70c0c425dc03e155ef14be19c1bb --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/__init__.py @@ -0,0 +1,155 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 label_restrictions +class to(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/connectivity-matrix/to. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Reference to a destination LTP. + """ + __slots__ = ('_path_helper', '_extmethods', '__tp_ref','__label_restrictions',) + + _yang_name = 'to' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__tp_ref = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="tp-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=False) + self.__label_restrictions = YANGDynClass(base=label_restrictions.label_restrictions, is_container='container', yang_name="label-restrictions", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', 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 ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'connectivity-matrix', 'to'] + + def _get_tp_ref(self): + """ + Getter method for tp_ref, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/tp_ref (leafref) + + YANG Description: Relative reference to a termination point. + """ + return self.__tp_ref + + def _set_tp_ref(self, v, load=False): + """ + Setter method for tp_ref, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/tp_ref (leafref) + If this variable is read-only (config: false) in the + source YANG file, then _set_tp_ref is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tp_ref() directly. + + YANG Description: Relative reference to a termination point. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="tp-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tp_ref must be of a type compatible with leafref""", + 'defined-type': "leafref", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="tp-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=False)""", + }) + + self.__tp_ref = t + if hasattr(self, '_set'): + self._set() + + def _unset_tp_ref(self): + self.__tp_ref = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="tp-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=False) + + + def _get_label_restrictions(self): + """ + Getter method for label_restrictions, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions (container) + + YANG Description: The label restrictions container. + """ + return self.__label_restrictions + + def _set_label_restrictions(self, v, load=False): + """ + Setter method for label_restrictions, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_label_restrictions is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_label_restrictions() directly. + + YANG Description: The label restrictions container. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=label_restrictions.label_restrictions, is_container='container', yang_name="label-restrictions", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """label_restrictions must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=label_restrictions.label_restrictions, is_container='container', yang_name="label-restrictions", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__label_restrictions = t + if hasattr(self, '_set'): + self._set() + + def _unset_label_restrictions(self): + self.__label_restrictions = YANGDynClass(base=label_restrictions.label_restrictions, is_container='container', yang_name="label-restrictions", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + tp_ref = __builtin__.property(_get_tp_ref) + label_restrictions = __builtin__.property(_get_label_restrictions) + + + _pyangbind_elements = OrderedDict([('tp_ref', tp_ref), ('label_restrictions', label_restrictions), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..3873a02ce4893dd956ce47d381bb005e268c944a --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/__init__.py @@ -0,0 +1,120 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 label_restriction +class label_restrictions(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/connectivity-matrix/to/label-restrictions. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: The label restrictions container. + """ + __slots__ = ('_path_helper', '_extmethods', '__label_restriction',) + + _yang_name = 'label-restrictions' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__label_restriction = YANGDynClass(base=YANGListType("index",label_restriction.label_restriction, yang_name="label-restriction", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='index', extensions=None), is_container='list', yang_name="label-restriction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', 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 ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'connectivity-matrix', 'to', 'label-restrictions'] + + def _get_label_restriction(self): + """ + Getter method for label_restriction, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction (list) + + YANG Description: The absence of the label restrictions container implies +that all labels are acceptable; otherwise, only restricted +labels are available. + """ + return self.__label_restriction + + def _set_label_restriction(self, v, load=False): + """ + Setter method for label_restriction, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_label_restriction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_label_restriction() directly. + + YANG Description: The absence of the label restrictions container implies +that all labels are acceptable; otherwise, only restricted +labels are available. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("index",label_restriction.label_restriction, yang_name="label-restriction", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='index', extensions=None), is_container='list', yang_name="label-restriction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """label_restriction must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("index",label_restriction.label_restriction, yang_name="label-restriction", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='index', extensions=None), is_container='list', yang_name="label-restriction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False)""", + }) + + self.__label_restriction = t + if hasattr(self, '_set'): + self._set() + + def _unset_label_restriction(self): + self.__label_restriction = YANGDynClass(base=YANGListType("index",label_restriction.label_restriction, yang_name="label-restriction", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='index', extensions=None), is_container='list', yang_name="label-restriction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + + label_restriction = __builtin__.property(_get_label_restriction) + + + _pyangbind_elements = OrderedDict([('label_restriction', label_restriction), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..dbf240ba846fa6468376de6985a59828653c0b8a --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/__init__.py @@ -0,0 +1,450 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 label_start +from . import label_end +from . import label_step +from . import otn_label_range +from . import ethernet_label_range +class label_restriction(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/connectivity-matrix/to/label-restrictions/label-restriction. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: The absence of the label restrictions container implies +that all labels are acceptable; otherwise, only restricted +labels are available. + """ + __slots__ = ('_path_helper', '_extmethods', '__restriction','__index','__label_start','__label_end','__label_step','__range_bitmap','__otn_label_range','__ethernet_label_range',) + + _yang_name = 'label-restriction' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__restriction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'inclusive': {}, 'exclusive': {}},), default=six.text_type("inclusive"), is_leaf=True, yang_name="restriction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='enumeration', is_config=False) + self.__index = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=False) + self.__label_start = YANGDynClass(base=label_start.label_start, is_container='container', yang_name="label-start", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__label_end = YANGDynClass(base=label_end.label_end, is_container='container', yang_name="label-end", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__label_step = YANGDynClass(base=label_step.label_step, is_container='container', yang_name="label-step", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__range_bitmap = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}), is_leaf=True, yang_name="range-bitmap", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:hex-string', is_config=False) + self.__otn_label_range = YANGDynClass(base=otn_label_range.otn_label_range, is_container='container', yang_name="otn-label-range", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False) + self.__ethernet_label_range = YANGDynClass(base=ethernet_label_range.ethernet_label_range, is_container='container', yang_name="ethernet-label-range", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', 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 ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'connectivity-matrix', 'to', 'label-restrictions', 'label-restriction'] + + def _get_restriction(self): + """ + Getter method for restriction, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/restriction (enumeration) + + YANG Description: Indicates whether the list item is inclusive or exclusive. + """ + return self.__restriction + + def _set_restriction(self, v, load=False): + """ + Setter method for restriction, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/restriction (enumeration) + If this variable is read-only (config: false) in the + source YANG file, then _set_restriction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_restriction() directly. + + YANG Description: Indicates whether the list item is inclusive or exclusive. + """ + 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={'inclusive': {}, 'exclusive': {}},), default=six.text_type("inclusive"), is_leaf=True, yang_name="restriction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='enumeration', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """restriction must be of a type compatible with enumeration""", + 'defined-type': "ietf-te-topology:enumeration", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'inclusive': {}, 'exclusive': {}},), default=six.text_type("inclusive"), is_leaf=True, yang_name="restriction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='enumeration', is_config=False)""", + }) + + self.__restriction = t + if hasattr(self, '_set'): + self._set() + + def _unset_restriction(self): + self.__restriction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'inclusive': {}, 'exclusive': {}},), default=six.text_type("inclusive"), is_leaf=True, yang_name="restriction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='enumeration', is_config=False) + + + def _get_index(self): + """ + Getter method for index, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/index (uint32) + + YANG Description: The index of the label restriction list entry. + """ + return self.__index + + def _set_index(self, v, load=False): + """ + Setter method for index, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/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 label restriction list entry. + """ + 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=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', 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), is_leaf=True, yang_name="index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', 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), is_leaf=True, yang_name="index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=False) + + + def _get_label_start(self): + """ + Getter method for label_start, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_start (container) + + YANG Description: This is the starting label if a label range is specified. +This is the label value if a single label is specified, +in which case the 'label-end' attribute is not set. + """ + return self.__label_start + + def _set_label_start(self, v, load=False): + """ + Setter method for label_start, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_start (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_label_start is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_label_start() directly. + + YANG Description: This is the starting label if a label range is specified. +This is the label value if a single label is specified, +in which case the 'label-end' attribute is not set. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=label_start.label_start, is_container='container', yang_name="label-start", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """label_start must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=label_start.label_start, is_container='container', yang_name="label-start", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__label_start = t + if hasattr(self, '_set'): + self._set() + + def _unset_label_start(self): + self.__label_start = YANGDynClass(base=label_start.label_start, is_container='container', yang_name="label-start", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_label_end(self): + """ + Getter method for label_end, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_end (container) + + YANG Description: This is the ending label if a label range is specified. +This attribute is not set if a single label is specified. + """ + return self.__label_end + + def _set_label_end(self, v, load=False): + """ + Setter method for label_end, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_end (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_label_end is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_label_end() directly. + + YANG Description: This is the ending label if a label range is specified. +This attribute is not set if a single label is specified. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=label_end.label_end, is_container='container', yang_name="label-end", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """label_end must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=label_end.label_end, is_container='container', yang_name="label-end", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__label_end = t + if hasattr(self, '_set'): + self._set() + + def _unset_label_end(self): + self.__label_end = YANGDynClass(base=label_end.label_end, is_container='container', yang_name="label-end", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_label_step(self): + """ + Getter method for label_step, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_step (container) + + YANG Description: The step increment between labels in the label range. +The label start/end values will have to be consistent +with the sign of label step. For example, +'label-start' < 'label-end' enforces 'label-step' > 0 +'label-start' > 'label-end' enforces 'label-step' < 0. + """ + return self.__label_step + + def _set_label_step(self, v, load=False): + """ + Setter method for label_step, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_step (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_label_step is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_label_step() directly. + + YANG Description: The step increment between labels in the label range. +The label start/end values will have to be consistent +with the sign of label step. For example, +'label-start' < 'label-end' enforces 'label-step' > 0 +'label-start' > 'label-end' enforces 'label-step' < 0. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=label_step.label_step, is_container='container', yang_name="label-step", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """label_step must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=label_step.label_step, is_container='container', yang_name="label-step", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__label_step = t + if hasattr(self, '_set'): + self._set() + + def _unset_label_step(self): + self.__label_step = YANGDynClass(base=label_step.label_step, is_container='container', yang_name="label-step", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_range_bitmap(self): + """ + Getter method for range_bitmap, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/range_bitmap (yang:hex-string) + + YANG Description: When there are gaps between 'label-start' and 'label-end', +this attribute is used to specify the positions +of the used labels. This is represented in big endian as +'hex-string'. +The most significant byte in the hex-string is the farthest +to the left in the byte sequence. Leading zero bytes in the +configured value may be omitted for brevity. +Each bit position in the 'range-bitmap' 'hex-string' maps +to a label in the range derived from 'label-start'. + +For example, assuming that 'label-start' = 16000 and +'range-bitmap' = 0x01000001, then: + +- bit position (0) is set, and the corresponding mapped + label from the range is 16000 + (0 * 'label-step') or + 16000 for default 'label-step' = 1. +- bit position (24) is set, and the corresponding mapped + label from the range is 16000 + (24 * 'label-step') or + 16024 for default 'label-step' = 1. + """ + return self.__range_bitmap + + def _set_range_bitmap(self, v, load=False): + """ + Setter method for range_bitmap, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/range_bitmap (yang:hex-string) + If this variable is read-only (config: false) in the + source YANG file, then _set_range_bitmap is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_range_bitmap() directly. + + YANG Description: When there are gaps between 'label-start' and 'label-end', +this attribute is used to specify the positions +of the used labels. This is represented in big endian as +'hex-string'. +The most significant byte in the hex-string is the farthest +to the left in the byte sequence. Leading zero bytes in the +configured value may be omitted for brevity. +Each bit position in the 'range-bitmap' 'hex-string' maps +to a label in the range derived from 'label-start'. + +For example, assuming that 'label-start' = 16000 and +'range-bitmap' = 0x01000001, then: + +- bit position (0) is set, and the corresponding mapped + label from the range is 16000 + (0 * 'label-step') or + 16000 for default 'label-step' = 1. +- bit position (24) is set, and the corresponding mapped + label from the range is 16000 + (24 * 'label-step') or + 16024 for default 'label-step' = 1. + """ + 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})*)?'}), is_leaf=True, yang_name="range-bitmap", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:hex-string', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """range_bitmap must be of a type compatible with yang:hex-string""", + 'defined-type': "yang:hex-string", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}), is_leaf=True, yang_name="range-bitmap", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:hex-string', is_config=False)""", + }) + + self.__range_bitmap = t + if hasattr(self, '_set'): + self._set() + + def _unset_range_bitmap(self): + self.__range_bitmap = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}), is_leaf=True, yang_name="range-bitmap", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:hex-string', is_config=False) + + + def _get_otn_label_range(self): + """ + Getter method for otn_label_range, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/otn_label_range (container) + + YANG Description: Label range information for OTN. + """ + return self.__otn_label_range + + def _set_otn_label_range(self, v, load=False): + """ + Setter method for otn_label_range, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/otn_label_range (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_otn_label_range is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_otn_label_range() directly. + + YANG Description: Label range information for OTN. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=otn_label_range.otn_label_range, is_container='container', yang_name="otn-label-range", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """otn_label_range must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=otn_label_range.otn_label_range, is_container='container', yang_name="otn-label-range", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False)""", + }) + + self.__otn_label_range = t + if hasattr(self, '_set'): + self._set() + + def _unset_otn_label_range(self): + self.__otn_label_range = YANGDynClass(base=otn_label_range.otn_label_range, is_container='container', yang_name="otn-label-range", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False) + + + def _get_ethernet_label_range(self): + """ + Getter method for ethernet_label_range, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/ethernet_label_range (container) + + YANG Description: Ethernet-specific label range related information. + """ + return self.__ethernet_label_range + + def _set_ethernet_label_range(self, v, load=False): + """ + Setter method for ethernet_label_range, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/ethernet_label_range (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_ethernet_label_range is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_ethernet_label_range() directly. + + YANG Description: Ethernet-specific label range related information. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=ethernet_label_range.ethernet_label_range, is_container='container', yang_name="ethernet-label-range", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """ethernet_label_range must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=ethernet_label_range.ethernet_label_range, is_container='container', yang_name="ethernet-label-range", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='container', is_config=False)""", + }) + + self.__ethernet_label_range = t + if hasattr(self, '_set'): + self._set() + + def _unset_ethernet_label_range(self): + self.__ethernet_label_range = YANGDynClass(base=ethernet_label_range.ethernet_label_range, is_container='container', yang_name="ethernet-label-range", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='container', is_config=False) + + restriction = __builtin__.property(_get_restriction) + index = __builtin__.property(_get_index) + label_start = __builtin__.property(_get_label_start) + label_end = __builtin__.property(_get_label_end) + label_step = __builtin__.property(_get_label_step) + range_bitmap = __builtin__.property(_get_range_bitmap) + otn_label_range = __builtin__.property(_get_otn_label_range) + ethernet_label_range = __builtin__.property(_get_ethernet_label_range) + + + _pyangbind_elements = OrderedDict([('restriction', restriction), ('index', index), ('label_start', label_start), ('label_end', label_end), ('label_step', label_step), ('range_bitmap', range_bitmap), ('otn_label_range', otn_label_range), ('ethernet_label_range', ethernet_label_range), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/ethernet_label_range/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/ethernet_label_range/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..3f672822b48accb14de87483e9dd12867456df08 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/ethernet_label_range/__init__.py @@ -0,0 +1,154 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 ethernet_label_range(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/connectivity-matrix/to/label-restrictions/label-restriction/ethernet-label-range. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Ethernet-specific label range related information. + """ + __slots__ = ('_path_helper', '_extmethods', '__tag_type','__priority',) + + _yang_name = 'ethernet-label-range' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__tag_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 's-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:s-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:s-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}},), is_leaf=True, yang_name="tag-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:eth-tag-type', is_config=False) + self.__priority = YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), is_leaf=True, yang_name="priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', 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 ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'connectivity-matrix', 'to', 'label-restrictions', 'label-restriction', 'ethernet-label-range'] + + def _get_tag_type(self): + """ + Getter method for tag_type, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/ethernet_label_range/tag_type (etht-types:eth-tag-type) + + YANG Description: VLAN tag type. + """ + return self.__tag_type + + def _set_tag_type(self, v, load=False): + """ + Setter method for tag_type, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/ethernet_label_range/tag_type (etht-types:eth-tag-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_tag_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tag_type() directly. + + YANG Description: VLAN tag type. + """ + 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={'c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 's-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:s-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:s-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}},), is_leaf=True, yang_name="tag-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:eth-tag-type', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tag_type must be of a type compatible with etht-types:eth-tag-type""", + 'defined-type': "etht-types:eth-tag-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 's-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:s-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:s-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}},), is_leaf=True, yang_name="tag-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:eth-tag-type', is_config=False)""", + }) + + self.__tag_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_tag_type(self): + self.__tag_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 's-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:s-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:s-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}},), is_leaf=True, yang_name="tag-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:eth-tag-type', is_config=False) + + + def _get_priority(self): + """ + Getter method for priority, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/ethernet_label_range/priority (uint8) + + YANG Description: priority. + """ + return self.__priority + + def _set_priority(self, v, load=False): + """ + Setter method for priority, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/ethernet_label_range/priority (uint8) + If this variable is read-only (config: false) in the + source YANG file, then _set_priority is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_priority() directly. + + YANG Description: priority. + """ + 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="priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint8', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """priority 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="priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint8', is_config=False)""", + }) + + self.__priority = t + if hasattr(self, '_set'): + self._set() + + def _unset_priority(self): + self.__priority = YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), is_leaf=True, yang_name="priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint8', is_config=False) + + tag_type = __builtin__.property(_get_tag_type) + priority = __builtin__.property(_get_priority) + + + _pyangbind_elements = OrderedDict([('tag_type', tag_type), ('priority', priority), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_end/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_end/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..332a6026574b5c48fcc2d103f24fbbc3da2b2ab3 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_end/__init__.py @@ -0,0 +1,119 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 te_label +class label_end(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/connectivity-matrix/to/label-restrictions/label-restriction/label-end. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: This is the ending label if a label range is specified. +This attribute is not set if a single label is specified. + """ + __slots__ = ('_path_helper', '_extmethods', '__te_label',) + + _yang_name = 'label-end' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__te_label = YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', 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 ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'connectivity-matrix', 'to', 'label-restrictions', 'label-restriction', 'label-end'] + + def _get_te_label(self): + """ + Getter method for te_label, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_end/te_label (container) + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + return self.__te_label + + def _set_te_label(self, v, load=False): + """ + Setter method for te_label, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_end/te_label (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_te_label is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_te_label() directly. + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """te_label must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__te_label = t + if hasattr(self, '_set'): + self._set() + + def _unset_te_label(self): + self.__te_label = YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + te_label = __builtin__.property(_get_te_label) + + + _pyangbind_elements = OrderedDict([('te_label', te_label), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_end/te_label/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_end/te_label/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..37028d9bfc5a0c01683aa7e53f7a6b574d6a3f42 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_end/te_label/__init__.py @@ -0,0 +1,234 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 otn +class te_label(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/connectivity-matrix/to/label-restrictions/label-restriction/label-end/te-label. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + __slots__ = ('_path_helper', '_extmethods', '__generic','__otn','__vlanid','__direction',) + + _yang_name = 'te-label' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__generic = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=False) + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False) + self.__vlanid = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=False) + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', 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 ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'connectivity-matrix', 'to', 'label-restrictions', 'label-restriction', 'label-end', 'te-label'] + + def _get_generic(self): + """ + Getter method for generic, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_end/te_label/generic (rt-types:generalized-label) + + YANG Description: TE label specified in a generic format. + """ + return self.__generic + + def _set_generic(self, v, load=False): + """ + Setter method for generic, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_end/te_label/generic (rt-types:generalized-label) + If this variable is read-only (config: false) in the + source YANG file, then _set_generic is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_generic() directly. + + YANG Description: TE label specified in a generic format. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """generic must be of a type compatible with rt-types:generalized-label""", + 'defined-type': "rt-types:generalized-label", + 'generated-type': """YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=False)""", + }) + + self.__generic = t + if hasattr(self, '_set'): + self._set() + + def _unset_generic(self): + self.__generic = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=False) + + + def _get_otn(self): + """ + Getter method for otn, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_end/te_label/otn (container) + + YANG Description: Label start or label end for OTN. + """ + return self.__otn + + def _set_otn(self, v, load=False): + """ + Setter method for otn, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_end/te_label/otn (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_otn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_otn() directly. + + YANG Description: Label start or label end for OTN. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """otn must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False)""", + }) + + self.__otn = t + if hasattr(self, '_set'): + self._set() + + def _unset_otn(self): + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False) + + + def _get_vlanid(self): + """ + Getter method for vlanid, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_end/te_label/vlanid (etht-types:vlanid) + + YANG Description: VLAN tag id. + """ + return self.__vlanid + + def _set_vlanid(self, v, load=False): + """ + Setter method for vlanid, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_end/te_label/vlanid (etht-types:vlanid) + If this variable is read-only (config: false) in the + source YANG file, then _set_vlanid is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_vlanid() directly. + + YANG Description: VLAN tag id. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """vlanid must be of a type compatible with etht-types:vlanid""", + 'defined-type': "etht-types:vlanid", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=False)""", + }) + + self.__vlanid = t + if hasattr(self, '_set'): + self._set() + + def _unset_vlanid(self): + self.__vlanid = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=False) + + + def _get_direction(self): + """ + Getter method for direction, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_end/te_label/direction (te-label-direction) + + YANG Description: Label direction. + """ + return self.__direction + + def _set_direction(self, v, load=False): + """ + Setter method for direction, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_end/te_label/direction (te-label-direction) + If this variable is read-only (config: false) in the + source YANG file, then _set_direction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_direction() directly. + + YANG Description: Label direction. + """ + 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={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """direction must be of a type compatible with te-label-direction""", + 'defined-type': "ietf-te-topology:te-label-direction", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=False)""", + }) + + self.__direction = t + if hasattr(self, '_set'): + self._set() + + def _unset_direction(self): + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=False) + + generic = __builtin__.property(_get_generic) + otn = __builtin__.property(_get_otn) + vlanid = __builtin__.property(_get_vlanid) + direction = __builtin__.property(_get_direction) + + __choices__ = {'technology': {'generic': ['generic'], 'otn': ['otn'], 'eth': ['vlanid']}} + _pyangbind_elements = OrderedDict([('generic', generic), ('otn', otn), ('vlanid', vlanid), ('direction', direction), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_end/te_label/otn/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_end/te_label/otn/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..162b896241b326516b2a2d5261f872ecfe29ffbf --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_end/te_label/otn/__init__.py @@ -0,0 +1,154 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 otn(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/connectivity-matrix/to/label-restrictions/label-restriction/label-end/te-label/otn. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Label start or label end for OTN. + """ + __slots__ = ('_path_helper', '_extmethods', '__tpn','__ts',) + + _yang_name = 'otn' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__tpn = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('range-type', 'trib-port'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=False) + self.__ts = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts", parent=self, choice=('range-type', 'trib-slot'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-ts', 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 ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'connectivity-matrix', 'to', 'label-restrictions', 'label-restriction', 'label-end', 'te-label', 'otn'] + + def _get_tpn(self): + """ + Getter method for tpn, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_end/te_label/otn/tpn (otn-tpn) + + YANG Description: Tributary Port Number (TPN). + """ + return self.__tpn + + def _set_tpn(self, v, load=False): + """ + Setter method for tpn, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_end/te_label/otn/tpn (otn-tpn) + If this variable is read-only (config: false) in the + source YANG file, then _set_tpn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tpn() directly. + + YANG Description: Tributary Port Number (TPN). + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('range-type', 'trib-port'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tpn must be of a type compatible with otn-tpn""", + 'defined-type': "ietf-otn-topology:otn-tpn", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('range-type', 'trib-port'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=False)""", + }) + + self.__tpn = t + if hasattr(self, '_set'): + self._set() + + def _unset_tpn(self): + self.__tpn = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('range-type', 'trib-port'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=False) + + + def _get_ts(self): + """ + Getter method for ts, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_end/te_label/otn/ts (otn-ts) + + YANG Description: Tributary Slot (TS) number. + """ + return self.__ts + + def _set_ts(self, v, load=False): + """ + Setter method for ts, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_end/te_label/otn/ts (otn-ts) + If this variable is read-only (config: false) in the + source YANG file, then _set_ts is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_ts() directly. + + YANG Description: Tributary Slot (TS) number. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts", parent=self, choice=('range-type', 'trib-slot'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-ts', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """ts must be of a type compatible with otn-ts""", + 'defined-type': "ietf-otn-topology:otn-ts", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts", parent=self, choice=('range-type', 'trib-slot'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-ts', is_config=False)""", + }) + + self.__ts = t + if hasattr(self, '_set'): + self._set() + + def _unset_ts(self): + self.__ts = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts", parent=self, choice=('range-type', 'trib-slot'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-ts', is_config=False) + + tpn = __builtin__.property(_get_tpn) + ts = __builtin__.property(_get_ts) + + __choices__ = {'range-type': {'trib-port': ['tpn'], 'trib-slot': ['ts']}} + _pyangbind_elements = OrderedDict([('tpn', tpn), ('ts', ts), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_start/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_start/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..334475e0d1a9680a9b58e7c939a59ce7431c6db9 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_start/__init__.py @@ -0,0 +1,120 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 te_label +class label_start(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/connectivity-matrix/to/label-restrictions/label-restriction/label-start. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: This is the starting label if a label range is specified. +This is the label value if a single label is specified, +in which case the 'label-end' attribute is not set. + """ + __slots__ = ('_path_helper', '_extmethods', '__te_label',) + + _yang_name = 'label-start' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__te_label = YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', 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 ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'connectivity-matrix', 'to', 'label-restrictions', 'label-restriction', 'label-start'] + + def _get_te_label(self): + """ + Getter method for te_label, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_start/te_label (container) + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + return self.__te_label + + def _set_te_label(self, v, load=False): + """ + Setter method for te_label, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_start/te_label (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_te_label is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_te_label() directly. + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """te_label must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__te_label = t + if hasattr(self, '_set'): + self._set() + + def _unset_te_label(self): + self.__te_label = YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + te_label = __builtin__.property(_get_te_label) + + + _pyangbind_elements = OrderedDict([('te_label', te_label), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_start/te_label/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_start/te_label/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..7c384d8f7a786c4d542d4c36dc4f340d1ec0d3c9 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_start/te_label/__init__.py @@ -0,0 +1,234 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 otn +class te_label(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/connectivity-matrix/to/label-restrictions/label-restriction/label-start/te-label. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + __slots__ = ('_path_helper', '_extmethods', '__generic','__otn','__vlanid','__direction',) + + _yang_name = 'te-label' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__generic = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=False) + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False) + self.__vlanid = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=False) + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', 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 ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'connectivity-matrix', 'to', 'label-restrictions', 'label-restriction', 'label-start', 'te-label'] + + def _get_generic(self): + """ + Getter method for generic, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_start/te_label/generic (rt-types:generalized-label) + + YANG Description: TE label specified in a generic format. + """ + return self.__generic + + def _set_generic(self, v, load=False): + """ + Setter method for generic, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_start/te_label/generic (rt-types:generalized-label) + If this variable is read-only (config: false) in the + source YANG file, then _set_generic is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_generic() directly. + + YANG Description: TE label specified in a generic format. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """generic must be of a type compatible with rt-types:generalized-label""", + 'defined-type': "rt-types:generalized-label", + 'generated-type': """YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=False)""", + }) + + self.__generic = t + if hasattr(self, '_set'): + self._set() + + def _unset_generic(self): + self.__generic = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=False) + + + def _get_otn(self): + """ + Getter method for otn, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_start/te_label/otn (container) + + YANG Description: Label start or label end for OTN. + """ + return self.__otn + + def _set_otn(self, v, load=False): + """ + Setter method for otn, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_start/te_label/otn (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_otn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_otn() directly. + + YANG Description: Label start or label end for OTN. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """otn must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False)""", + }) + + self.__otn = t + if hasattr(self, '_set'): + self._set() + + def _unset_otn(self): + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False) + + + def _get_vlanid(self): + """ + Getter method for vlanid, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_start/te_label/vlanid (etht-types:vlanid) + + YANG Description: VLAN tag id. + """ + return self.__vlanid + + def _set_vlanid(self, v, load=False): + """ + Setter method for vlanid, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_start/te_label/vlanid (etht-types:vlanid) + If this variable is read-only (config: false) in the + source YANG file, then _set_vlanid is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_vlanid() directly. + + YANG Description: VLAN tag id. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """vlanid must be of a type compatible with etht-types:vlanid""", + 'defined-type': "etht-types:vlanid", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=False)""", + }) + + self.__vlanid = t + if hasattr(self, '_set'): + self._set() + + def _unset_vlanid(self): + self.__vlanid = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=False) + + + def _get_direction(self): + """ + Getter method for direction, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_start/te_label/direction (te-label-direction) + + YANG Description: Label direction. + """ + return self.__direction + + def _set_direction(self, v, load=False): + """ + Setter method for direction, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_start/te_label/direction (te-label-direction) + If this variable is read-only (config: false) in the + source YANG file, then _set_direction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_direction() directly. + + YANG Description: Label direction. + """ + 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={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """direction must be of a type compatible with te-label-direction""", + 'defined-type': "ietf-te-topology:te-label-direction", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=False)""", + }) + + self.__direction = t + if hasattr(self, '_set'): + self._set() + + def _unset_direction(self): + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=False) + + generic = __builtin__.property(_get_generic) + otn = __builtin__.property(_get_otn) + vlanid = __builtin__.property(_get_vlanid) + direction = __builtin__.property(_get_direction) + + __choices__ = {'technology': {'generic': ['generic'], 'otn': ['otn'], 'eth': ['vlanid']}} + _pyangbind_elements = OrderedDict([('generic', generic), ('otn', otn), ('vlanid', vlanid), ('direction', direction), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_start/te_label/otn/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_start/te_label/otn/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..612e7141b0b4a8e877b2769cc353c653486113db --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_start/te_label/otn/__init__.py @@ -0,0 +1,154 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 otn(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/connectivity-matrix/to/label-restrictions/label-restriction/label-start/te-label/otn. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Label start or label end for OTN. + """ + __slots__ = ('_path_helper', '_extmethods', '__tpn','__ts',) + + _yang_name = 'otn' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__tpn = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('range-type', 'trib-port'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=False) + self.__ts = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts", parent=self, choice=('range-type', 'trib-slot'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-ts', 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 ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'connectivity-matrix', 'to', 'label-restrictions', 'label-restriction', 'label-start', 'te-label', 'otn'] + + def _get_tpn(self): + """ + Getter method for tpn, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_start/te_label/otn/tpn (otn-tpn) + + YANG Description: Tributary Port Number (TPN). + """ + return self.__tpn + + def _set_tpn(self, v, load=False): + """ + Setter method for tpn, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_start/te_label/otn/tpn (otn-tpn) + If this variable is read-only (config: false) in the + source YANG file, then _set_tpn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tpn() directly. + + YANG Description: Tributary Port Number (TPN). + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('range-type', 'trib-port'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tpn must be of a type compatible with otn-tpn""", + 'defined-type': "ietf-otn-topology:otn-tpn", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('range-type', 'trib-port'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=False)""", + }) + + self.__tpn = t + if hasattr(self, '_set'): + self._set() + + def _unset_tpn(self): + self.__tpn = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('range-type', 'trib-port'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=False) + + + def _get_ts(self): + """ + Getter method for ts, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_start/te_label/otn/ts (otn-ts) + + YANG Description: Tributary Slot (TS) number. + """ + return self.__ts + + def _set_ts(self, v, load=False): + """ + Setter method for ts, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_start/te_label/otn/ts (otn-ts) + If this variable is read-only (config: false) in the + source YANG file, then _set_ts is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_ts() directly. + + YANG Description: Tributary Slot (TS) number. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts", parent=self, choice=('range-type', 'trib-slot'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-ts', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """ts must be of a type compatible with otn-ts""", + 'defined-type': "ietf-otn-topology:otn-ts", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts", parent=self, choice=('range-type', 'trib-slot'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-ts', is_config=False)""", + }) + + self.__ts = t + if hasattr(self, '_set'): + self._set() + + def _unset_ts(self): + self.__ts = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts", parent=self, choice=('range-type', 'trib-slot'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-ts', is_config=False) + + tpn = __builtin__.property(_get_tpn) + ts = __builtin__.property(_get_ts) + + __choices__ = {'range-type': {'trib-port': ['tpn'], 'trib-slot': ['ts']}} + _pyangbind_elements = OrderedDict([('tpn', tpn), ('ts', ts), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_step/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_step/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..12f872b1f11d4f08571e87a68731c62b60ef8811 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_step/__init__.py @@ -0,0 +1,200 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 otn +class label_step(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/connectivity-matrix/to/label-restrictions/label-restriction/label-step. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: The step increment between labels in the label range. +The label start/end values will have to be consistent +with the sign of label step. For example, +'label-start' < 'label-end' enforces 'label-step' > 0 +'label-start' > 'label-end' enforces 'label-step' < 0. + """ + __slots__ = ('_path_helper', '_extmethods', '__generic','__otn','__eth_step',) + + _yang_name = 'label-step' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__generic = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['-2147483648..2147483647']}, int_size=32), default=RestrictedClassType(base_type=long, restriction_dict={'range': ['-2147483648..2147483647']}, int_size=32)(1), is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='int32', is_config=False) + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False) + self.__eth_step = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), default=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16)(1), is_leaf=True, yang_name="eth-step", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint16', 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 ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'connectivity-matrix', 'to', 'label-restrictions', 'label-restriction', 'label-step'] + + def _get_generic(self): + """ + Getter method for generic, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_step/generic (int32) + + YANG Description: Label range step. + """ + return self.__generic + + def _set_generic(self, v, load=False): + """ + Setter method for generic, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_step/generic (int32) + If this variable is read-only (config: false) in the + source YANG file, then _set_generic is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_generic() directly. + + YANG Description: Label range step. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['-2147483648..2147483647']}, int_size=32), default=RestrictedClassType(base_type=long, restriction_dict={'range': ['-2147483648..2147483647']}, int_size=32)(1), is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='int32', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """generic must be of a type compatible with int32""", + 'defined-type': "int32", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['-2147483648..2147483647']}, int_size=32), default=RestrictedClassType(base_type=long, restriction_dict={'range': ['-2147483648..2147483647']}, int_size=32)(1), is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='int32', is_config=False)""", + }) + + self.__generic = t + if hasattr(self, '_set'): + self._set() + + def _unset_generic(self): + self.__generic = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['-2147483648..2147483647']}, int_size=32), default=RestrictedClassType(base_type=long, restriction_dict={'range': ['-2147483648..2147483647']}, int_size=32)(1), is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='int32', is_config=False) + + + def _get_otn(self): + """ + Getter method for otn, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_step/otn (container) + + YANG Description: Label step for OTN + """ + return self.__otn + + def _set_otn(self, v, load=False): + """ + Setter method for otn, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_step/otn (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_otn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_otn() directly. + + YANG Description: Label step for OTN + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """otn must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False)""", + }) + + self.__otn = t + if hasattr(self, '_set'): + self._set() + + def _unset_otn(self): + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False) + + + def _get_eth_step(self): + """ + Getter method for eth_step, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_step/eth_step (uint16) + + YANG Description: Label step which represent possible increments for +an Ethernet VLAN tag. + """ + return self.__eth_step + + def _set_eth_step(self, v, load=False): + """ + Setter method for eth_step, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_step/eth_step (uint16) + If this variable is read-only (config: false) in the + source YANG file, then _set_eth_step is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_eth_step() directly. + + YANG Description: Label step which represent possible increments for +an Ethernet VLAN tag. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), default=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16)(1), is_leaf=True, yang_name="eth-step", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint16', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """eth_step must be of a type compatible with uint16""", + 'defined-type': "uint16", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), default=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16)(1), is_leaf=True, yang_name="eth-step", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint16', is_config=False)""", + }) + + self.__eth_step = t + if hasattr(self, '_set'): + self._set() + + def _unset_eth_step(self): + self.__eth_step = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), default=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16)(1), is_leaf=True, yang_name="eth-step", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint16', is_config=False) + + generic = __builtin__.property(_get_generic) + otn = __builtin__.property(_get_otn) + eth_step = __builtin__.property(_get_eth_step) + + __choices__ = {'technology': {'generic': ['generic'], 'otn': ['otn'], 'eth': ['eth_step']}} + _pyangbind_elements = OrderedDict([('generic', generic), ('otn', otn), ('eth_step', eth_step), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_step/otn/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_step/otn/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..4f53bda83992147e406598acc77da79e6a9cd51a --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_step/otn/__init__.py @@ -0,0 +1,158 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 otn(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/connectivity-matrix/to/label-restrictions/label-restriction/label-step/otn. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Label step for OTN + """ + __slots__ = ('_path_helper', '_extmethods', '__tpn','__ts',) + + _yang_name = 'otn' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__tpn = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('range-type', 'trib-port'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=False) + self.__ts = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts", parent=self, choice=('range-type', 'trib-slot'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-ts', 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 ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'connectivity-matrix', 'to', 'label-restrictions', 'label-restriction', 'label-step', 'otn'] + + def _get_tpn(self): + """ + Getter method for tpn, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_step/otn/tpn (otn-tpn) + + YANG Description: Label step which represents possible increments for +Tributary Port Number (TPN). + """ + return self.__tpn + + def _set_tpn(self, v, load=False): + """ + Setter method for tpn, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_step/otn/tpn (otn-tpn) + If this variable is read-only (config: false) in the + source YANG file, then _set_tpn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tpn() directly. + + YANG Description: Label step which represents possible increments for +Tributary Port Number (TPN). + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('range-type', 'trib-port'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tpn must be of a type compatible with otn-tpn""", + 'defined-type': "ietf-otn-topology:otn-tpn", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('range-type', 'trib-port'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=False)""", + }) + + self.__tpn = t + if hasattr(self, '_set'): + self._set() + + def _unset_tpn(self): + self.__tpn = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('range-type', 'trib-port'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=False) + + + def _get_ts(self): + """ + Getter method for ts, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_step/otn/ts (otn-ts) + + YANG Description: Label step which represents possible increments for +Tributary Slot (TS) number. + """ + return self.__ts + + def _set_ts(self, v, load=False): + """ + Setter method for ts, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_step/otn/ts (otn-ts) + If this variable is read-only (config: false) in the + source YANG file, then _set_ts is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_ts() directly. + + YANG Description: Label step which represents possible increments for +Tributary Slot (TS) number. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts", parent=self, choice=('range-type', 'trib-slot'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-ts', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """ts must be of a type compatible with otn-ts""", + 'defined-type': "ietf-otn-topology:otn-ts", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts", parent=self, choice=('range-type', 'trib-slot'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-ts', is_config=False)""", + }) + + self.__ts = t + if hasattr(self, '_set'): + self._set() + + def _unset_ts(self): + self.__ts = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts", parent=self, choice=('range-type', 'trib-slot'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-ts', is_config=False) + + tpn = __builtin__.property(_get_tpn) + ts = __builtin__.property(_get_ts) + + __choices__ = {'range-type': {'trib-port': ['tpn'], 'trib-slot': ['ts']}} + _pyangbind_elements = OrderedDict([('tpn', tpn), ('ts', ts), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/otn_label_range/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/otn_label_range/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..84ed14bf97bc2f6ca26fee89b43061f9fd0e2334 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/otn_label_range/__init__.py @@ -0,0 +1,256 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 otn_label_range(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/connectivity-matrix/to/label-restrictions/label-restriction/otn-label-range. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Label range information for OTN. + """ + __slots__ = ('_path_helper', '_extmethods', '__range_type','__tsg','__odu_type_list','__priority',) + + _yang_name = 'otn-label-range' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__range_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'trib-slot': {}, 'trib-port': {}},), is_leaf=True, yang_name="range-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-label-range-type', is_config=False) + self.__tsg = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=False) + self.__odu_type_list = YANGDynClass(unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},)), is_leaf=False, yang_name="odu-type-list", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=False) + self.__priority = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..7']}), is_leaf=True, yang_name="priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', 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 ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'connectivity-matrix', 'to', 'label-restrictions', 'label-restriction', 'otn-label-range'] + + def _get_range_type(self): + """ + Getter method for range_type, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/otn_label_range/range_type (otn-label-range-type) + + YANG Description: The type of range (e.g., TPN or TS) +to which the label range applies + """ + return self.__range_type + + def _set_range_type(self, v, load=False): + """ + Setter method for range_type, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/otn_label_range/range_type (otn-label-range-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_range_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_range_type() directly. + + YANG Description: The type of range (e.g., TPN or TS) +to which the label range applies + """ + 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={'trib-slot': {}, 'trib-port': {}},), is_leaf=True, yang_name="range-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-label-range-type', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """range_type must be of a type compatible with otn-label-range-type""", + 'defined-type': "ietf-otn-topology:otn-label-range-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'trib-slot': {}, 'trib-port': {}},), is_leaf=True, yang_name="range-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-label-range-type', is_config=False)""", + }) + + self.__range_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_range_type(self): + self.__range_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'trib-slot': {}, 'trib-port': {}},), is_leaf=True, yang_name="range-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-label-range-type', is_config=False) + + + def _get_tsg(self): + """ + Getter method for tsg, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/otn_label_range/tsg (identityref) + + YANG Description: Tributary slot granularity (TSG) to which the label range +applies. + +This leaf MUST be present when the range-type is TS. + +This leaf MAY be omitted when mapping an ODUk over an OTUk +Link. In this case the range-type is tpn, with only one +entry (ODUk), and the tpn range has only one value (1). + """ + return self.__tsg + + def _set_tsg(self, v, load=False): + """ + Setter method for tsg, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/otn_label_range/tsg (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_tsg is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tsg() directly. + + YANG Description: Tributary slot granularity (TSG) to which the label range +applies. + +This leaf MUST be present when the range-type is TS. + +This leaf MAY be omitted when mapping an ODUk over an OTUk +Link. In this case the range-type is tpn, with only one +entry (ODUk), and the tpn range has only one value (1). + """ + 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={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tsg must be of a type compatible with identityref""", + 'defined-type': "ietf-otn-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=False)""", + }) + + self.__tsg = t + if hasattr(self, '_set'): + self._set() + + def _unset_tsg(self): + self.__tsg = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=False) + + + def _get_odu_type_list(self): + """ + Getter method for odu_type_list, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/otn_label_range/odu_type_list (identityref) + + YANG Description: List of ODU types to which the label range applies. + +An Empty odu-type-list means that the label range +applies to all the supported ODU types. + """ + return self.__odu_type_list + + def _set_odu_type_list(self, v, load=False): + """ + Setter method for odu_type_list, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/otn_label_range/odu_type_list (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_odu_type_list is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_odu_type_list() directly. + + YANG Description: List of ODU types to which the label range applies. + +An Empty odu-type-list means that the label range +applies to all the supported ODU types. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},)), is_leaf=False, yang_name="odu-type-list", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """odu_type_list must be of a type compatible with identityref""", + 'defined-type': "ietf-otn-topology:identityref", + 'generated-type': """YANGDynClass(unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},)), is_leaf=False, yang_name="odu-type-list", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=False)""", + }) + + self.__odu_type_list = t + if hasattr(self, '_set'): + self._set() + + def _unset_odu_type_list(self): + self.__odu_type_list = YANGDynClass(unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},)), is_leaf=False, yang_name="odu-type-list", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=False) + + + def _get_priority(self): + """ + Getter method for priority, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/otn_label_range/priority (uint8) + + YANG Description: Priority in Interface Switching Capability +Descriptor (ISCD). + """ + return self.__priority + + def _set_priority(self, v, load=False): + """ + Setter method for priority, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/otn_label_range/priority (uint8) + If this variable is read-only (config: false) in the + source YANG file, then _set_priority is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_priority() directly. + + YANG Description: Priority in Interface Switching Capability +Descriptor (ISCD). + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..7']}), is_leaf=True, yang_name="priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint8', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """priority must be of a type compatible with uint8""", + 'defined-type': "uint8", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..7']}), is_leaf=True, yang_name="priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint8', is_config=False)""", + }) + + self.__priority = t + if hasattr(self, '_set'): + self._set() + + def _unset_priority(self): + self.__priority = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..7']}), is_leaf=True, yang_name="priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint8', is_config=False) + + range_type = __builtin__.property(_get_range_type) + tsg = __builtin__.property(_get_tsg) + odu_type_list = __builtin__.property(_get_odu_type_list) + priority = __builtin__.property(_get_priority) + + + _pyangbind_elements = OrderedDict([('range_type', range_type), ('tsg', tsg), ('odu_type_list', odu_type_list), ('priority', priority), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..0660881e28b783a340f6606fea9afba596749800 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/__init__.py @@ -0,0 +1,326 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 primary_path +from . import backup_path +from . import tunnel_termination_points +from . import tunnels +class underlay(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/connectivity-matrix/underlay. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Attributes of the TE link underlay. + """ + __slots__ = ('_path_helper', '_extmethods', '__enabled','__primary_path','__backup_path','__protection_type','__tunnel_termination_points','__tunnels',) + + _yang_name = 'underlay' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__enabled = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="enabled", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='boolean', is_config=False) + self.__primary_path = YANGDynClass(base=primary_path.primary_path, is_container='container', yang_name="primary-path", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__backup_path = YANGDynClass(base=YANGListType("index",backup_path.backup_path, yang_name="backup-path", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='index', extensions=None), is_container='list', yang_name="backup-path", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + self.__protection_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'lsp-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-reroute-extra': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-reroute-extra': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-reroute-extra': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-reroute': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-reroute': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-reroute': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-1-for-n': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-1-for-n': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-1-for-n': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-unidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-unidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-unidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-bidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-bidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-bidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="protection-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + self.__tunnel_termination_points = YANGDynClass(base=tunnel_termination_points.tunnel_termination_points, is_container='container', yang_name="tunnel-termination-points", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__tunnels = YANGDynClass(base=tunnels.tunnels, is_container='container', yang_name="tunnels", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', 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 ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'connectivity-matrix', 'underlay'] + + def _get_enabled(self): + """ + Getter method for enabled, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/enabled (boolean) + + YANG Description: 'true' if the underlay is enabled. +'false' if the underlay is disabled. + """ + return self.__enabled + + def _set_enabled(self, v, load=False): + """ + Setter method for enabled, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/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: 'true' if the underlay is enabled. +'false' if the underlay is disabled. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBool, is_leaf=True, yang_name="enabled", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', 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, is_leaf=True, yang_name="enabled", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='boolean', is_config=False)""", + }) + + self.__enabled = t + if hasattr(self, '_set'): + self._set() + + def _unset_enabled(self): + self.__enabled = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="enabled", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='boolean', is_config=False) + + + def _get_primary_path(self): + """ + Getter method for primary_path, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/primary_path (container) + + YANG Description: The service path on the underlay topology that +supports this link. + """ + return self.__primary_path + + def _set_primary_path(self, v, load=False): + """ + Setter method for primary_path, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/primary_path (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_primary_path is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_primary_path() directly. + + YANG Description: The service path on the underlay topology that +supports this link. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=primary_path.primary_path, is_container='container', yang_name="primary-path", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """primary_path must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=primary_path.primary_path, is_container='container', yang_name="primary-path", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__primary_path = t + if hasattr(self, '_set'): + self._set() + + def _unset_primary_path(self): + self.__primary_path = YANGDynClass(base=primary_path.primary_path, is_container='container', yang_name="primary-path", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_backup_path(self): + """ + Getter method for backup_path, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/backup_path (list) + + YANG Description: A list of backup service paths on the underlay topology that +protect the underlay primary path. If the primary path is +not protected, the list contains zero elements. If the +primary path is protected, the list contains one or more +elements. + """ + return self.__backup_path + + def _set_backup_path(self, v, load=False): + """ + Setter method for backup_path, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/backup_path (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_backup_path is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_backup_path() directly. + + YANG Description: A list of backup service paths on the underlay topology that +protect the underlay primary path. If the primary path is +not protected, the list contains zero elements. If the +primary path is protected, the list contains one or more +elements. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("index",backup_path.backup_path, yang_name="backup-path", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='index', extensions=None), is_container='list', yang_name="backup-path", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """backup_path must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("index",backup_path.backup_path, yang_name="backup-path", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='index', extensions=None), is_container='list', yang_name="backup-path", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False)""", + }) + + self.__backup_path = t + if hasattr(self, '_set'): + self._set() + + def _unset_backup_path(self): + self.__backup_path = YANGDynClass(base=YANGListType("index",backup_path.backup_path, yang_name="backup-path", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='index', extensions=None), is_container='list', yang_name="backup-path", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + + + def _get_protection_type(self): + """ + Getter method for protection_type, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/protection_type (identityref) + + YANG Description: Underlay protection type desired for this link. + """ + return self.__protection_type + + def _set_protection_type(self, v, load=False): + """ + Setter method for protection_type, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/protection_type (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_protection_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_protection_type() directly. + + YANG Description: Underlay protection type desired for this link. + """ + 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={'lsp-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-reroute-extra': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-reroute-extra': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-reroute-extra': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-reroute': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-reroute': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-reroute': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-1-for-n': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-1-for-n': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-1-for-n': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-unidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-unidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-unidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-bidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-bidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-bidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="protection-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """protection_type must be of a type compatible with identityref""", + 'defined-type': "ietf-te-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'lsp-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-reroute-extra': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-reroute-extra': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-reroute-extra': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-reroute': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-reroute': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-reroute': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-1-for-n': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-1-for-n': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-1-for-n': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-unidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-unidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-unidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-bidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-bidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-bidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="protection-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False)""", + }) + + self.__protection_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_protection_type(self): + self.__protection_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'lsp-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-reroute-extra': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-reroute-extra': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-reroute-extra': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-reroute': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-reroute': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-reroute': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-1-for-n': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-1-for-n': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-1-for-n': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-unidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-unidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-unidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-bidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-bidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-bidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="protection-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + + + def _get_tunnel_termination_points(self): + """ + Getter method for tunnel_termination_points, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/tunnel_termination_points (container) + + YANG Description: Underlay TTPs desired for this link. + """ + return self.__tunnel_termination_points + + def _set_tunnel_termination_points(self, v, load=False): + """ + Setter method for tunnel_termination_points, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/tunnel_termination_points (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_tunnel_termination_points is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tunnel_termination_points() directly. + + YANG Description: Underlay TTPs desired for this link. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=tunnel_termination_points.tunnel_termination_points, is_container='container', yang_name="tunnel-termination-points", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tunnel_termination_points must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=tunnel_termination_points.tunnel_termination_points, is_container='container', yang_name="tunnel-termination-points", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__tunnel_termination_points = t + if hasattr(self, '_set'): + self._set() + + def _unset_tunnel_termination_points(self): + self.__tunnel_termination_points = YANGDynClass(base=tunnel_termination_points.tunnel_termination_points, is_container='container', yang_name="tunnel-termination-points", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_tunnels(self): + """ + Getter method for tunnels, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/tunnels (container) + + YANG Description: Underlay TE tunnels supporting this TE link. + """ + return self.__tunnels + + def _set_tunnels(self, v, load=False): + """ + Setter method for tunnels, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/tunnels (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_tunnels is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tunnels() directly. + + YANG Description: Underlay TE tunnels supporting this TE link. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=tunnels.tunnels, is_container='container', yang_name="tunnels", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tunnels must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=tunnels.tunnels, is_container='container', yang_name="tunnels", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__tunnels = t + if hasattr(self, '_set'): + self._set() + + def _unset_tunnels(self): + self.__tunnels = YANGDynClass(base=tunnels.tunnels, is_container='container', yang_name="tunnels", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + enabled = __builtin__.property(_get_enabled) + primary_path = __builtin__.property(_get_primary_path) + backup_path = __builtin__.property(_get_backup_path) + protection_type = __builtin__.property(_get_protection_type) + tunnel_termination_points = __builtin__.property(_get_tunnel_termination_points) + tunnels = __builtin__.property(_get_tunnels) + + + _pyangbind_elements = OrderedDict([('enabled', enabled), ('primary_path', primary_path), ('backup_path', backup_path), ('protection_type', protection_type), ('tunnel_termination_points', tunnel_termination_points), ('tunnels', tunnels), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/backup_path/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/backup_path/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..5e6da0327b6950bdd578cd2cc890a0ec097c053a --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/backup_path/__init__.py @@ -0,0 +1,207 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 path_element +class backup_path(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/connectivity-matrix/underlay/backup-path. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: A list of backup service paths on the underlay topology that +protect the underlay primary path. If the primary path is +not protected, the list contains zero elements. If the +primary path is protected, the list contains one or more +elements. + """ + __slots__ = ('_path_helper', '_extmethods', '__index','__network_ref','__path_element',) + + _yang_name = 'backup-path' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _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), is_leaf=True, yang_name="index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=False) + self.__network_ref = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="network-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=False) + self.__path_element = YANGDynClass(base=YANGListType("path_element_id",path_element.path_element, yang_name="path-element", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='path-element-id', extensions=None), is_container='list', yang_name="path-element", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', 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 ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'connectivity-matrix', 'underlay', 'backup-path'] + + def _get_index(self): + """ + Getter method for index, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/backup_path/index (uint32) + + YANG Description: A sequence number to identify a backup path. + """ + return self.__index + + def _set_index(self, v, load=False): + """ + Setter method for index, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/backup_path/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: A sequence number to identify a backup path. + """ + 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=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', 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), is_leaf=True, yang_name="index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', 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), is_leaf=True, yang_name="index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=False) + + + def _get_network_ref(self): + """ + Getter method for network_ref, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/backup_path/network_ref (leafref) + + YANG Description: Used to reference a network -- for example, an underlay +network. + """ + return self.__network_ref + + def _set_network_ref(self, v, load=False): + """ + Setter method for network_ref, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/backup_path/network_ref (leafref) + If this variable is read-only (config: false) in the + source YANG file, then _set_network_ref is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_network_ref() directly. + + YANG Description: Used to reference a network -- for example, an underlay +network. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="network-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """network_ref must be of a type compatible with leafref""", + 'defined-type': "leafref", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="network-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=False)""", + }) + + self.__network_ref = t + if hasattr(self, '_set'): + self._set() + + def _unset_network_ref(self): + self.__network_ref = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="network-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=False) + + + def _get_path_element(self): + """ + Getter method for path_element, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element (list) + + YANG Description: A list of path elements describing the backup service +path. + """ + return self.__path_element + + def _set_path_element(self, v, load=False): + """ + Setter method for path_element, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_element is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_element() directly. + + YANG Description: A list of path elements describing the backup service +path. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("path_element_id",path_element.path_element, yang_name="path-element", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='path-element-id', extensions=None), is_container='list', yang_name="path-element", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_element must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("path_element_id",path_element.path_element, yang_name="path-element", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='path-element-id', extensions=None), is_container='list', yang_name="path-element", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False)""", + }) + + self.__path_element = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_element(self): + self.__path_element = YANGDynClass(base=YANGListType("path_element_id",path_element.path_element, yang_name="path-element", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='path-element-id', extensions=None), is_container='list', yang_name="path-element", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + + index = __builtin__.property(_get_index) + network_ref = __builtin__.property(_get_network_ref) + path_element = __builtin__.property(_get_path_element) + + + _pyangbind_elements = OrderedDict([('index', index), ('network_ref', network_ref), ('path_element', path_element), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..0e6bea8896fa5f3727db9b64111d928a2379b296 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/__init__.py @@ -0,0 +1,321 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 numbered_node_hop +from . import numbered_link_hop +from . import unnumbered_link_hop +from . import as_number_hop +from . import label_hop +class path_element(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/connectivity-matrix/underlay/backup-path/path-element. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: A list of path elements describing the backup service +path. + """ + __slots__ = ('_path_helper', '_extmethods', '__path_element_id','__numbered_node_hop','__numbered_link_hop','__unnumbered_link_hop','__as_number_hop','__label_hop',) + + _yang_name = 'path-element' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__path_element_id = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="path-element-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=False) + self.__numbered_node_hop = YANGDynClass(base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__numbered_link_hop = YANGDynClass(base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__unnumbered_link_hop = YANGDynClass(base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__as_number_hop = YANGDynClass(base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__label_hop = YANGDynClass(base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', 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 ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'connectivity-matrix', 'underlay', 'backup-path', 'path-element'] + + def _get_path_element_id(self): + """ + Getter method for path_element_id, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/path_element_id (uint32) + + YANG Description: To identify the element in a path. + """ + return self.__path_element_id + + def _set_path_element_id(self, v, load=False): + """ + Setter method for path_element_id, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/path_element_id (uint32) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_element_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_element_id() directly. + + YANG Description: To identify the element in a path. + """ + 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=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="path-element-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_element_id 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="path-element-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=False)""", + }) + + self.__path_element_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_element_id(self): + self.__path_element_id = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="path-element-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=False) + + + def _get_numbered_node_hop(self): + """ + Getter method for numbered_node_hop, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/numbered_node_hop (container) + + YANG Description: Numbered node route hop. + """ + return self.__numbered_node_hop + + def _set_numbered_node_hop(self, v, load=False): + """ + Setter method for numbered_node_hop, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/numbered_node_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_numbered_node_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_numbered_node_hop() directly. + + YANG Description: Numbered node route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """numbered_node_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__numbered_node_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_numbered_node_hop(self): + self.__numbered_node_hop = YANGDynClass(base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_numbered_link_hop(self): + """ + Getter method for numbered_link_hop, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/numbered_link_hop (container) + + YANG Description: Numbered link explicit route hop. + """ + return self.__numbered_link_hop + + def _set_numbered_link_hop(self, v, load=False): + """ + Setter method for numbered_link_hop, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/numbered_link_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_numbered_link_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_numbered_link_hop() directly. + + YANG Description: Numbered link explicit route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """numbered_link_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__numbered_link_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_numbered_link_hop(self): + self.__numbered_link_hop = YANGDynClass(base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_unnumbered_link_hop(self): + """ + Getter method for unnumbered_link_hop, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/unnumbered_link_hop (container) + + YANG Description: Unnumbered link explicit route hop. + """ + return self.__unnumbered_link_hop + + def _set_unnumbered_link_hop(self, v, load=False): + """ + Setter method for unnumbered_link_hop, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/unnumbered_link_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_unnumbered_link_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_unnumbered_link_hop() directly. + + YANG Description: Unnumbered link explicit route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """unnumbered_link_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__unnumbered_link_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_unnumbered_link_hop(self): + self.__unnumbered_link_hop = YANGDynClass(base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_as_number_hop(self): + """ + Getter method for as_number_hop, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/as_number_hop (container) + + YANG Description: AS explicit route hop. + """ + return self.__as_number_hop + + def _set_as_number_hop(self, v, load=False): + """ + Setter method for as_number_hop, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/as_number_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_as_number_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_as_number_hop() directly. + + YANG Description: AS explicit route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """as_number_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__as_number_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_as_number_hop(self): + self.__as_number_hop = YANGDynClass(base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_label_hop(self): + """ + Getter method for label_hop, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/label_hop (container) + + YANG Description: Label hop type. + """ + return self.__label_hop + + def _set_label_hop(self, v, load=False): + """ + Setter method for label_hop, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/label_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_label_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_label_hop() directly. + + YANG Description: Label hop type. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """label_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__label_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_label_hop(self): + self.__label_hop = YANGDynClass(base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + path_element_id = __builtin__.property(_get_path_element_id) + numbered_node_hop = __builtin__.property(_get_numbered_node_hop) + numbered_link_hop = __builtin__.property(_get_numbered_link_hop) + unnumbered_link_hop = __builtin__.property(_get_unnumbered_link_hop) + as_number_hop = __builtin__.property(_get_as_number_hop) + label_hop = __builtin__.property(_get_label_hop) + + __choices__ = {'type': {'numbered-node-hop': ['numbered_node_hop'], 'numbered-link-hop': ['numbered_link_hop'], 'unnumbered-link-hop': ['unnumbered_link_hop'], 'as-number': ['as_number_hop'], 'label': ['label_hop']}} + _pyangbind_elements = OrderedDict([('path_element_id', path_element_id), ('numbered_node_hop', numbered_node_hop), ('numbered_link_hop', numbered_link_hop), ('unnumbered_link_hop', unnumbered_link_hop), ('as_number_hop', as_number_hop), ('label_hop', label_hop), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/as_number_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/as_number_hop/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..2245d0d0e8d8c9c9bf932710b86966781ee377e7 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/as_number_hop/__init__.py @@ -0,0 +1,154 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 as_number_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/connectivity-matrix/underlay/backup-path/path-element/as-number-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: AS explicit route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__as_number','__hop_type',) + + _yang_name = 'as-number-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__as_number = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=False) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', 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 ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'connectivity-matrix', 'underlay', 'backup-path', 'path-element', 'as-number-hop'] + + def _get_as_number(self): + """ + Getter method for as_number, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/as_number_hop/as_number (inet:as-number) + + YANG Description: The Autonomous System (AS) number. + """ + return self.__as_number + + def _set_as_number(self, v, load=False): + """ + Setter method for as_number, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/as_number_hop/as_number (inet:as-number) + If this variable is read-only (config: false) in the + source YANG file, then _set_as_number is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_as_number() directly. + + YANG Description: The Autonomous System (AS) number. + """ + 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="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """as_number must be of a type compatible with inet:as-number""", + 'defined-type': "inet:as-number", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=False)""", + }) + + self.__as_number = t + if hasattr(self, '_set'): + self._set() + + def _unset_as_number(self): + self.__as_number = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=False) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/as_number_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/as_number_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + 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={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + + as_number = __builtin__.property(_get_as_number) + hop_type = __builtin__.property(_get_hop_type) + + __choices__ = {'type': {'as-number': ['as_number', 'hop_type']}} + _pyangbind_elements = OrderedDict([('as_number', as_number), ('hop_type', hop_type), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/label_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/label_hop/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..9fc0b539a612836fa7eb19f48cf7ec6e6d2eebd6 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/label_hop/__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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 te_label +class label_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/connectivity-matrix/underlay/backup-path/path-element/label-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Label hop type. + """ + __slots__ = ('_path_helper', '_extmethods', '__te_label',) + + _yang_name = 'label-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__te_label = YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', 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 ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'connectivity-matrix', 'underlay', 'backup-path', 'path-element', 'label-hop'] + + def _get_te_label(self): + """ + Getter method for te_label, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/label_hop/te_label (container) + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + return self.__te_label + + def _set_te_label(self, v, load=False): + """ + Setter method for te_label, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/label_hop/te_label (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_te_label is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_te_label() directly. + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """te_label must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__te_label = t + if hasattr(self, '_set'): + self._set() + + def _unset_te_label(self): + self.__te_label = YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + te_label = __builtin__.property(_get_te_label) + + __choices__ = {'type': {'label': ['te_label']}} + _pyangbind_elements = OrderedDict([('te_label', te_label), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/label_hop/te_label/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/label_hop/te_label/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..6ed428029fc87f2785219c0de6190431190da50b --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/label_hop/te_label/__init__.py @@ -0,0 +1,234 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 otn +class te_label(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/connectivity-matrix/underlay/backup-path/path-element/label-hop/te-label. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + __slots__ = ('_path_helper', '_extmethods', '__generic','__otn','__vlanid','__direction',) + + _yang_name = 'te-label' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__generic = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=False) + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False) + self.__vlanid = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=False) + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', 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 ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'connectivity-matrix', 'underlay', 'backup-path', 'path-element', 'label-hop', 'te-label'] + + def _get_generic(self): + """ + Getter method for generic, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/label_hop/te_label/generic (rt-types:generalized-label) + + YANG Description: TE label specified in a generic format. + """ + return self.__generic + + def _set_generic(self, v, load=False): + """ + Setter method for generic, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/label_hop/te_label/generic (rt-types:generalized-label) + If this variable is read-only (config: false) in the + source YANG file, then _set_generic is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_generic() directly. + + YANG Description: TE label specified in a generic format. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """generic must be of a type compatible with rt-types:generalized-label""", + 'defined-type': "rt-types:generalized-label", + 'generated-type': """YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=False)""", + }) + + self.__generic = t + if hasattr(self, '_set'): + self._set() + + def _unset_generic(self): + self.__generic = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=False) + + + def _get_otn(self): + """ + Getter method for otn, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/label_hop/te_label/otn (container) + + YANG Description: Label hop for OTN. + """ + return self.__otn + + def _set_otn(self, v, load=False): + """ + Setter method for otn, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/label_hop/te_label/otn (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_otn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_otn() directly. + + YANG Description: Label hop for OTN. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """otn must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False)""", + }) + + self.__otn = t + if hasattr(self, '_set'): + self._set() + + def _unset_otn(self): + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False) + + + def _get_vlanid(self): + """ + Getter method for vlanid, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/label_hop/te_label/vlanid (etht-types:vlanid) + + YANG Description: VLAN tag id. + """ + return self.__vlanid + + def _set_vlanid(self, v, load=False): + """ + Setter method for vlanid, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/label_hop/te_label/vlanid (etht-types:vlanid) + If this variable is read-only (config: false) in the + source YANG file, then _set_vlanid is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_vlanid() directly. + + YANG Description: VLAN tag id. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """vlanid must be of a type compatible with etht-types:vlanid""", + 'defined-type': "etht-types:vlanid", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=False)""", + }) + + self.__vlanid = t + if hasattr(self, '_set'): + self._set() + + def _unset_vlanid(self): + self.__vlanid = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=False) + + + def _get_direction(self): + """ + Getter method for direction, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/label_hop/te_label/direction (te-label-direction) + + YANG Description: Label direction. + """ + return self.__direction + + def _set_direction(self, v, load=False): + """ + Setter method for direction, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/label_hop/te_label/direction (te-label-direction) + If this variable is read-only (config: false) in the + source YANG file, then _set_direction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_direction() directly. + + YANG Description: Label direction. + """ + 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={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """direction must be of a type compatible with te-label-direction""", + 'defined-type': "ietf-te-topology:te-label-direction", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=False)""", + }) + + self.__direction = t + if hasattr(self, '_set'): + self._set() + + def _unset_direction(self): + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=False) + + generic = __builtin__.property(_get_generic) + otn = __builtin__.property(_get_otn) + vlanid = __builtin__.property(_get_vlanid) + direction = __builtin__.property(_get_direction) + + __choices__ = {'technology': {'generic': ['generic'], 'otn': ['otn'], 'eth': ['vlanid']}, 'type': {'label': ['direction']}} + _pyangbind_elements = OrderedDict([('generic', generic), ('otn', otn), ('vlanid', vlanid), ('direction', direction), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/label_hop/te_label/otn/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/label_hop/te_label/otn/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..242d6f3f26a1fca1fd0985db7a4b0ecd3cd3fa9d --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/label_hop/te_label/otn/__init__.py @@ -0,0 +1,209 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 otn(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/connectivity-matrix/underlay/backup-path/path-element/label-hop/te-label/otn. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Label hop for OTN. + """ + __slots__ = ('_path_helper', '_extmethods', '__tpn','__tsg','__ts_list',) + + _yang_name = 'otn' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__tpn = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=False) + self.__tsg = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=False) + self.__ts_list = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', 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 ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'connectivity-matrix', 'underlay', 'backup-path', 'path-element', 'label-hop', 'te-label', 'otn'] + + def _get_tpn(self): + """ + Getter method for tpn, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/label_hop/te_label/otn/tpn (otn-tpn) + + YANG Description: Tributary Port Number (TPN). + """ + return self.__tpn + + def _set_tpn(self, v, load=False): + """ + Setter method for tpn, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/label_hop/te_label/otn/tpn (otn-tpn) + If this variable is read-only (config: false) in the + source YANG file, then _set_tpn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tpn() directly. + + YANG Description: Tributary Port Number (TPN). + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tpn must be of a type compatible with otn-tpn""", + 'defined-type': "ietf-otn-topology:otn-tpn", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=False)""", + }) + + self.__tpn = t + if hasattr(self, '_set'): + self._set() + + def _unset_tpn(self): + self.__tpn = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=False) + + + def _get_tsg(self): + """ + Getter method for tsg, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/label_hop/te_label/otn/tsg (identityref) + + YANG Description: Tributary Slot Granularity (TSG). + """ + return self.__tsg + + def _set_tsg(self, v, load=False): + """ + Setter method for tsg, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/label_hop/te_label/otn/tsg (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_tsg is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tsg() directly. + + YANG Description: Tributary Slot Granularity (TSG). + """ + 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={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tsg must be of a type compatible with identityref""", + 'defined-type': "ietf-otn-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=False)""", + }) + + self.__tsg = t + if hasattr(self, '_set'): + self._set() + + def _unset_tsg(self): + self.__tsg = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=False) + + + def _get_ts_list(self): + """ + Getter method for ts_list, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/label_hop/te_label/otn/ts_list (string) + + YANG Description: A list of available Tributary Slots (TS) ranging + + + + +between 1 and 4095. If multiple values or +ranges are given, they all MUST be disjoint +and MUST be in ascending order. +For example 1-20,25,50-1000. + """ + return self.__ts_list + + def _set_ts_list(self, v, load=False): + """ + Setter method for ts_list, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/label_hop/te_label/otn/ts_list (string) + If this variable is read-only (config: false) in the + source YANG file, then _set_ts_list is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_ts_list() directly. + + YANG Description: A list of available Tributary Slots (TS) ranging + + + + +between 1 and 4095. If multiple values or +ranges are given, they all MUST be disjoint +and MUST be in ascending order. +For example 1-20,25,50-1000. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='string', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """ts_list must be of a type compatible with string""", + 'defined-type': "string", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='string', is_config=False)""", + }) + + self.__ts_list = t + if hasattr(self, '_set'): + self._set() + + def _unset_ts_list(self): + self.__ts_list = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='string', is_config=False) + + tpn = __builtin__.property(_get_tpn) + tsg = __builtin__.property(_get_tsg) + ts_list = __builtin__.property(_get_ts_list) + + __choices__ = {'technology': {'otn': ['tpn', 'tsg', 'ts_list']}} + _pyangbind_elements = OrderedDict([('tpn', tpn), ('tsg', tsg), ('ts_list', ts_list), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/numbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/numbered_link_hop/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..f6c47d4644ff1e8e6dbc3b5422b039b024780012 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/numbered_link_hop/__init__.py @@ -0,0 +1,193 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 numbered_link_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/connectivity-matrix/underlay/backup-path/path-element/numbered-link-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Numbered link explicit route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__link_tp_id','__hop_type','__direction',) + + _yang_name = 'numbered-link-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=False) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', 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 ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'connectivity-matrix', 'underlay', 'backup-path', 'path-element', 'numbered-link-hop'] + + def _get_link_tp_id(self): + """ + Getter method for link_tp_id, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/numbered_link_hop/link_tp_id (te-tp-id) + + YANG Description: TE Link Termination Point (LTP) identifier. + """ + return self.__link_tp_id + + def _set_link_tp_id(self, v, load=False): + """ + Setter method for link_tp_id, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/numbered_link_hop/link_tp_id (te-tp-id) + If this variable is read-only (config: false) in the + source YANG file, then _set_link_tp_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_link_tp_id() directly. + + YANG Description: TE Link Termination Point (LTP) identifier. + """ + 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),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """link_tp_id must be of a type compatible with te-tp-id""", + 'defined-type': "ietf-te-topology:te-tp-id", + 'generated-type': """YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=False)""", + }) + + self.__link_tp_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_link_tp_id(self): + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=False) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/numbered_link_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/numbered_link_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + 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={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + + + def _get_direction(self): + """ + Getter method for direction, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/numbered_link_hop/direction (te-link-direction) + + YANG Description: Link route object direction. + """ + return self.__direction + + def _set_direction(self, v, load=False): + """ + Setter method for direction, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/numbered_link_hop/direction (te-link-direction) + If this variable is read-only (config: false) in the + source YANG file, then _set_direction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_direction() directly. + + YANG Description: Link route object direction. + """ + 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={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """direction must be of a type compatible with te-link-direction""", + 'defined-type': "ietf-te-topology:te-link-direction", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=False)""", + }) + + self.__direction = t + if hasattr(self, '_set'): + self._set() + + def _unset_direction(self): + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=False) + + link_tp_id = __builtin__.property(_get_link_tp_id) + hop_type = __builtin__.property(_get_hop_type) + direction = __builtin__.property(_get_direction) + + __choices__ = {'type': {'numbered-link-hop': ['link_tp_id', 'hop_type', 'direction']}} + _pyangbind_elements = OrderedDict([('link_tp_id', link_tp_id), ('hop_type', hop_type), ('direction', direction), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/numbered_node_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/numbered_node_hop/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..ba3dfc1f6132e0eae9787117f7147932e0cdb340 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/numbered_node_hop/__init__.py @@ -0,0 +1,154 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 numbered_node_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/connectivity-matrix/underlay/backup-path/path-element/numbered-node-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Numbered node route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__node_id','__hop_type',) + + _yang_name = 'numbered-node-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=False) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', 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 ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'connectivity-matrix', 'underlay', 'backup-path', 'path-element', 'numbered-node-hop'] + + def _get_node_id(self): + """ + Getter method for node_id, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/numbered_node_hop/node_id (te-node-id) + + YANG Description: The identifier of a node in the TE topology. + """ + return self.__node_id + + def _set_node_id(self, v, load=False): + """ + Setter method for node_id, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/numbered_node_hop/node_id (te-node-id) + 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. + + YANG Description: The identifier of a node in the TE topology. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """node_id must be of a type compatible with te-node-id""", + 'defined-type': "ietf-te-topology:te-node-id", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=False)""", + }) + + self.__node_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_node_id(self): + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=False) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/numbered_node_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/numbered_node_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + 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={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + + node_id = __builtin__.property(_get_node_id) + hop_type = __builtin__.property(_get_hop_type) + + __choices__ = {'type': {'numbered-node-hop': ['node_id', 'hop_type']}} + _pyangbind_elements = OrderedDict([('node_id', node_id), ('hop_type', hop_type), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/unnumbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/unnumbered_link_hop/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..b5d313c9bba771f10a758ef1e31743617b93da4f --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/unnumbered_link_hop/__init__.py @@ -0,0 +1,236 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 unnumbered_link_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/connectivity-matrix/underlay/backup-path/path-element/unnumbered-link-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Unnumbered link explicit route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__link_tp_id','__node_id','__hop_type','__direction',) + + _yang_name = 'unnumbered-link-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=False) + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=False) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', 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 ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'connectivity-matrix', 'underlay', 'backup-path', 'path-element', 'unnumbered-link-hop'] + + def _get_link_tp_id(self): + """ + Getter method for link_tp_id, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/unnumbered_link_hop/link_tp_id (te-tp-id) + + YANG Description: TE LTP identifier. The combination of the TE link ID +and the TE node ID is used to identify an unnumbered +TE link. + """ + return self.__link_tp_id + + def _set_link_tp_id(self, v, load=False): + """ + Setter method for link_tp_id, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/unnumbered_link_hop/link_tp_id (te-tp-id) + If this variable is read-only (config: false) in the + source YANG file, then _set_link_tp_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_link_tp_id() directly. + + YANG Description: TE LTP identifier. The combination of the TE link ID +and the TE node ID is used to identify an unnumbered +TE link. + """ + 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),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """link_tp_id must be of a type compatible with te-tp-id""", + 'defined-type': "ietf-te-topology:te-tp-id", + 'generated-type': """YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=False)""", + }) + + self.__link_tp_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_link_tp_id(self): + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=False) + + + def _get_node_id(self): + """ + Getter method for node_id, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/unnumbered_link_hop/node_id (te-node-id) + + YANG Description: The identifier of a node in the TE topology. + """ + return self.__node_id + + def _set_node_id(self, v, load=False): + """ + Setter method for node_id, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/unnumbered_link_hop/node_id (te-node-id) + 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. + + YANG Description: The identifier of a node in the TE topology. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """node_id must be of a type compatible with te-node-id""", + 'defined-type': "ietf-te-topology:te-node-id", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=False)""", + }) + + self.__node_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_node_id(self): + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=False) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/unnumbered_link_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/unnumbered_link_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + 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={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + + + def _get_direction(self): + """ + Getter method for direction, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/unnumbered_link_hop/direction (te-link-direction) + + YANG Description: Link route object direction. + """ + return self.__direction + + def _set_direction(self, v, load=False): + """ + Setter method for direction, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/unnumbered_link_hop/direction (te-link-direction) + If this variable is read-only (config: false) in the + source YANG file, then _set_direction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_direction() directly. + + YANG Description: Link route object direction. + """ + 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={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """direction must be of a type compatible with te-link-direction""", + 'defined-type': "ietf-te-topology:te-link-direction", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=False)""", + }) + + self.__direction = t + if hasattr(self, '_set'): + self._set() + + def _unset_direction(self): + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=False) + + link_tp_id = __builtin__.property(_get_link_tp_id) + node_id = __builtin__.property(_get_node_id) + hop_type = __builtin__.property(_get_hop_type) + direction = __builtin__.property(_get_direction) + + __choices__ = {'type': {'unnumbered-link-hop': ['link_tp_id', 'node_id', 'hop_type', 'direction']}} + _pyangbind_elements = OrderedDict([('link_tp_id', link_tp_id), ('node_id', node_id), ('hop_type', hop_type), ('direction', direction), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/primary_path/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/primary_path/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..9efabfdc9833d3db3530bf4bc67801e8de97d09a --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/primary_path/__init__.py @@ -0,0 +1,158 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 path_element +class primary_path(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/connectivity-matrix/underlay/primary-path. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: The service path on the underlay topology that +supports this link. + """ + __slots__ = ('_path_helper', '_extmethods', '__network_ref','__path_element',) + + _yang_name = 'primary-path' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__network_ref = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="network-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=False) + self.__path_element = YANGDynClass(base=YANGListType("path_element_id",path_element.path_element, yang_name="path-element", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='path-element-id', extensions=None), is_container='list', yang_name="path-element", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', 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 ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'connectivity-matrix', 'underlay', 'primary-path'] + + def _get_network_ref(self): + """ + Getter method for network_ref, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/primary_path/network_ref (leafref) + + YANG Description: Used to reference a network -- for example, an underlay +network. + """ + return self.__network_ref + + def _set_network_ref(self, v, load=False): + """ + Setter method for network_ref, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/primary_path/network_ref (leafref) + If this variable is read-only (config: false) in the + source YANG file, then _set_network_ref is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_network_ref() directly. + + YANG Description: Used to reference a network -- for example, an underlay +network. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="network-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """network_ref must be of a type compatible with leafref""", + 'defined-type': "leafref", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="network-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=False)""", + }) + + self.__network_ref = t + if hasattr(self, '_set'): + self._set() + + def _unset_network_ref(self): + self.__network_ref = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="network-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=False) + + + def _get_path_element(self): + """ + Getter method for path_element, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element (list) + + YANG Description: A list of path elements describing the service path. + """ + return self.__path_element + + def _set_path_element(self, v, load=False): + """ + Setter method for path_element, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_element is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_element() directly. + + YANG Description: A list of path elements describing the service path. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("path_element_id",path_element.path_element, yang_name="path-element", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='path-element-id', extensions=None), is_container='list', yang_name="path-element", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_element must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("path_element_id",path_element.path_element, yang_name="path-element", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='path-element-id', extensions=None), is_container='list', yang_name="path-element", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False)""", + }) + + self.__path_element = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_element(self): + self.__path_element = YANGDynClass(base=YANGListType("path_element_id",path_element.path_element, yang_name="path-element", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='path-element-id', extensions=None), is_container='list', yang_name="path-element", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + + network_ref = __builtin__.property(_get_network_ref) + path_element = __builtin__.property(_get_path_element) + + + _pyangbind_elements = OrderedDict([('network_ref', network_ref), ('path_element', path_element), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..c680af6e0cbb613d71b8eb8896295cdbeef0fabc --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/__init__.py @@ -0,0 +1,320 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 numbered_node_hop +from . import numbered_link_hop +from . import unnumbered_link_hop +from . import as_number_hop +from . import label_hop +class path_element(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/connectivity-matrix/underlay/primary-path/path-element. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: A list of path elements describing the service path. + """ + __slots__ = ('_path_helper', '_extmethods', '__path_element_id','__numbered_node_hop','__numbered_link_hop','__unnumbered_link_hop','__as_number_hop','__label_hop',) + + _yang_name = 'path-element' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__path_element_id = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="path-element-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=False) + self.__numbered_node_hop = YANGDynClass(base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__numbered_link_hop = YANGDynClass(base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__unnumbered_link_hop = YANGDynClass(base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__as_number_hop = YANGDynClass(base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__label_hop = YANGDynClass(base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', 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 ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'connectivity-matrix', 'underlay', 'primary-path', 'path-element'] + + def _get_path_element_id(self): + """ + Getter method for path_element_id, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/path_element_id (uint32) + + YANG Description: To identify the element in a path. + """ + return self.__path_element_id + + def _set_path_element_id(self, v, load=False): + """ + Setter method for path_element_id, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/path_element_id (uint32) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_element_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_element_id() directly. + + YANG Description: To identify the element in a path. + """ + 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=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="path-element-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_element_id 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="path-element-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=False)""", + }) + + self.__path_element_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_element_id(self): + self.__path_element_id = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="path-element-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=False) + + + def _get_numbered_node_hop(self): + """ + Getter method for numbered_node_hop, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/numbered_node_hop (container) + + YANG Description: Numbered node route hop. + """ + return self.__numbered_node_hop + + def _set_numbered_node_hop(self, v, load=False): + """ + Setter method for numbered_node_hop, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/numbered_node_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_numbered_node_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_numbered_node_hop() directly. + + YANG Description: Numbered node route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """numbered_node_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__numbered_node_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_numbered_node_hop(self): + self.__numbered_node_hop = YANGDynClass(base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_numbered_link_hop(self): + """ + Getter method for numbered_link_hop, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/numbered_link_hop (container) + + YANG Description: Numbered link explicit route hop. + """ + return self.__numbered_link_hop + + def _set_numbered_link_hop(self, v, load=False): + """ + Setter method for numbered_link_hop, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/numbered_link_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_numbered_link_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_numbered_link_hop() directly. + + YANG Description: Numbered link explicit route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """numbered_link_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__numbered_link_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_numbered_link_hop(self): + self.__numbered_link_hop = YANGDynClass(base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_unnumbered_link_hop(self): + """ + Getter method for unnumbered_link_hop, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/unnumbered_link_hop (container) + + YANG Description: Unnumbered link explicit route hop. + """ + return self.__unnumbered_link_hop + + def _set_unnumbered_link_hop(self, v, load=False): + """ + Setter method for unnumbered_link_hop, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/unnumbered_link_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_unnumbered_link_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_unnumbered_link_hop() directly. + + YANG Description: Unnumbered link explicit route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """unnumbered_link_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__unnumbered_link_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_unnumbered_link_hop(self): + self.__unnumbered_link_hop = YANGDynClass(base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_as_number_hop(self): + """ + Getter method for as_number_hop, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/as_number_hop (container) + + YANG Description: AS explicit route hop. + """ + return self.__as_number_hop + + def _set_as_number_hop(self, v, load=False): + """ + Setter method for as_number_hop, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/as_number_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_as_number_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_as_number_hop() directly. + + YANG Description: AS explicit route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """as_number_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__as_number_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_as_number_hop(self): + self.__as_number_hop = YANGDynClass(base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_label_hop(self): + """ + Getter method for label_hop, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/label_hop (container) + + YANG Description: Label hop type. + """ + return self.__label_hop + + def _set_label_hop(self, v, load=False): + """ + Setter method for label_hop, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/label_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_label_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_label_hop() directly. + + YANG Description: Label hop type. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """label_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__label_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_label_hop(self): + self.__label_hop = YANGDynClass(base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + path_element_id = __builtin__.property(_get_path_element_id) + numbered_node_hop = __builtin__.property(_get_numbered_node_hop) + numbered_link_hop = __builtin__.property(_get_numbered_link_hop) + unnumbered_link_hop = __builtin__.property(_get_unnumbered_link_hop) + as_number_hop = __builtin__.property(_get_as_number_hop) + label_hop = __builtin__.property(_get_label_hop) + + __choices__ = {'type': {'numbered-node-hop': ['numbered_node_hop'], 'numbered-link-hop': ['numbered_link_hop'], 'unnumbered-link-hop': ['unnumbered_link_hop'], 'as-number': ['as_number_hop'], 'label': ['label_hop']}} + _pyangbind_elements = OrderedDict([('path_element_id', path_element_id), ('numbered_node_hop', numbered_node_hop), ('numbered_link_hop', numbered_link_hop), ('unnumbered_link_hop', unnumbered_link_hop), ('as_number_hop', as_number_hop), ('label_hop', label_hop), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/as_number_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/as_number_hop/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..33f85e5281febfd6058e42db3c836b9fc230f533 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/as_number_hop/__init__.py @@ -0,0 +1,154 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 as_number_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/connectivity-matrix/underlay/primary-path/path-element/as-number-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: AS explicit route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__as_number','__hop_type',) + + _yang_name = 'as-number-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__as_number = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=False) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', 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 ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'connectivity-matrix', 'underlay', 'primary-path', 'path-element', 'as-number-hop'] + + def _get_as_number(self): + """ + Getter method for as_number, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/as_number_hop/as_number (inet:as-number) + + YANG Description: The Autonomous System (AS) number. + """ + return self.__as_number + + def _set_as_number(self, v, load=False): + """ + Setter method for as_number, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/as_number_hop/as_number (inet:as-number) + If this variable is read-only (config: false) in the + source YANG file, then _set_as_number is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_as_number() directly. + + YANG Description: The Autonomous System (AS) number. + """ + 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="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """as_number must be of a type compatible with inet:as-number""", + 'defined-type': "inet:as-number", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=False)""", + }) + + self.__as_number = t + if hasattr(self, '_set'): + self._set() + + def _unset_as_number(self): + self.__as_number = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=False) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/as_number_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/as_number_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + 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={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + + as_number = __builtin__.property(_get_as_number) + hop_type = __builtin__.property(_get_hop_type) + + __choices__ = {'type': {'as-number': ['as_number', 'hop_type']}} + _pyangbind_elements = OrderedDict([('as_number', as_number), ('hop_type', hop_type), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/label_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/label_hop/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..6cb0c9c11a2e435e7fcf1c672056a63d8e81606a --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/label_hop/__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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 te_label +class label_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/connectivity-matrix/underlay/primary-path/path-element/label-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Label hop type. + """ + __slots__ = ('_path_helper', '_extmethods', '__te_label',) + + _yang_name = 'label-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__te_label = YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', 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 ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'connectivity-matrix', 'underlay', 'primary-path', 'path-element', 'label-hop'] + + def _get_te_label(self): + """ + Getter method for te_label, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/label_hop/te_label (container) + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + return self.__te_label + + def _set_te_label(self, v, load=False): + """ + Setter method for te_label, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/label_hop/te_label (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_te_label is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_te_label() directly. + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """te_label must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__te_label = t + if hasattr(self, '_set'): + self._set() + + def _unset_te_label(self): + self.__te_label = YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + te_label = __builtin__.property(_get_te_label) + + __choices__ = {'type': {'label': ['te_label']}} + _pyangbind_elements = OrderedDict([('te_label', te_label), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/label_hop/te_label/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/label_hop/te_label/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..04bb5f8c62618ae918ebff9c8eb0e03069bc41b7 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/label_hop/te_label/__init__.py @@ -0,0 +1,234 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 otn +class te_label(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/connectivity-matrix/underlay/primary-path/path-element/label-hop/te-label. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + __slots__ = ('_path_helper', '_extmethods', '__generic','__otn','__vlanid','__direction',) + + _yang_name = 'te-label' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__generic = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=False) + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False) + self.__vlanid = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=False) + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', 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 ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'connectivity-matrix', 'underlay', 'primary-path', 'path-element', 'label-hop', 'te-label'] + + def _get_generic(self): + """ + Getter method for generic, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/label_hop/te_label/generic (rt-types:generalized-label) + + YANG Description: TE label specified in a generic format. + """ + return self.__generic + + def _set_generic(self, v, load=False): + """ + Setter method for generic, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/label_hop/te_label/generic (rt-types:generalized-label) + If this variable is read-only (config: false) in the + source YANG file, then _set_generic is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_generic() directly. + + YANG Description: TE label specified in a generic format. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """generic must be of a type compatible with rt-types:generalized-label""", + 'defined-type': "rt-types:generalized-label", + 'generated-type': """YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=False)""", + }) + + self.__generic = t + if hasattr(self, '_set'): + self._set() + + def _unset_generic(self): + self.__generic = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=False) + + + def _get_otn(self): + """ + Getter method for otn, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/label_hop/te_label/otn (container) + + YANG Description: Label hop for OTN. + """ + return self.__otn + + def _set_otn(self, v, load=False): + """ + Setter method for otn, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/label_hop/te_label/otn (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_otn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_otn() directly. + + YANG Description: Label hop for OTN. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """otn must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False)""", + }) + + self.__otn = t + if hasattr(self, '_set'): + self._set() + + def _unset_otn(self): + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False) + + + def _get_vlanid(self): + """ + Getter method for vlanid, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/label_hop/te_label/vlanid (etht-types:vlanid) + + YANG Description: VLAN tag id. + """ + return self.__vlanid + + def _set_vlanid(self, v, load=False): + """ + Setter method for vlanid, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/label_hop/te_label/vlanid (etht-types:vlanid) + If this variable is read-only (config: false) in the + source YANG file, then _set_vlanid is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_vlanid() directly. + + YANG Description: VLAN tag id. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """vlanid must be of a type compatible with etht-types:vlanid""", + 'defined-type': "etht-types:vlanid", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=False)""", + }) + + self.__vlanid = t + if hasattr(self, '_set'): + self._set() + + def _unset_vlanid(self): + self.__vlanid = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=False) + + + def _get_direction(self): + """ + Getter method for direction, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/label_hop/te_label/direction (te-label-direction) + + YANG Description: Label direction. + """ + return self.__direction + + def _set_direction(self, v, load=False): + """ + Setter method for direction, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/label_hop/te_label/direction (te-label-direction) + If this variable is read-only (config: false) in the + source YANG file, then _set_direction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_direction() directly. + + YANG Description: Label direction. + """ + 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={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """direction must be of a type compatible with te-label-direction""", + 'defined-type': "ietf-te-topology:te-label-direction", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=False)""", + }) + + self.__direction = t + if hasattr(self, '_set'): + self._set() + + def _unset_direction(self): + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=False) + + generic = __builtin__.property(_get_generic) + otn = __builtin__.property(_get_otn) + vlanid = __builtin__.property(_get_vlanid) + direction = __builtin__.property(_get_direction) + + __choices__ = {'technology': {'generic': ['generic'], 'otn': ['otn'], 'eth': ['vlanid']}, 'type': {'label': ['direction']}} + _pyangbind_elements = OrderedDict([('generic', generic), ('otn', otn), ('vlanid', vlanid), ('direction', direction), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/label_hop/te_label/otn/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/label_hop/te_label/otn/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e0b0c85c53b809acc7e6c4300a557335aef6dca8 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/label_hop/te_label/otn/__init__.py @@ -0,0 +1,209 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 otn(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/connectivity-matrix/underlay/primary-path/path-element/label-hop/te-label/otn. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Label hop for OTN. + """ + __slots__ = ('_path_helper', '_extmethods', '__tpn','__tsg','__ts_list',) + + _yang_name = 'otn' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__tpn = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=False) + self.__tsg = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=False) + self.__ts_list = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', 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 ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'connectivity-matrix', 'underlay', 'primary-path', 'path-element', 'label-hop', 'te-label', 'otn'] + + def _get_tpn(self): + """ + Getter method for tpn, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/label_hop/te_label/otn/tpn (otn-tpn) + + YANG Description: Tributary Port Number (TPN). + """ + return self.__tpn + + def _set_tpn(self, v, load=False): + """ + Setter method for tpn, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/label_hop/te_label/otn/tpn (otn-tpn) + If this variable is read-only (config: false) in the + source YANG file, then _set_tpn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tpn() directly. + + YANG Description: Tributary Port Number (TPN). + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tpn must be of a type compatible with otn-tpn""", + 'defined-type': "ietf-otn-topology:otn-tpn", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=False)""", + }) + + self.__tpn = t + if hasattr(self, '_set'): + self._set() + + def _unset_tpn(self): + self.__tpn = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=False) + + + def _get_tsg(self): + """ + Getter method for tsg, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/label_hop/te_label/otn/tsg (identityref) + + YANG Description: Tributary Slot Granularity (TSG). + """ + return self.__tsg + + def _set_tsg(self, v, load=False): + """ + Setter method for tsg, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/label_hop/te_label/otn/tsg (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_tsg is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tsg() directly. + + YANG Description: Tributary Slot Granularity (TSG). + """ + 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={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tsg must be of a type compatible with identityref""", + 'defined-type': "ietf-otn-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=False)""", + }) + + self.__tsg = t + if hasattr(self, '_set'): + self._set() + + def _unset_tsg(self): + self.__tsg = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=False) + + + def _get_ts_list(self): + """ + Getter method for ts_list, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/label_hop/te_label/otn/ts_list (string) + + YANG Description: A list of available Tributary Slots (TS) ranging + + + + +between 1 and 4095. If multiple values or +ranges are given, they all MUST be disjoint +and MUST be in ascending order. +For example 1-20,25,50-1000. + """ + return self.__ts_list + + def _set_ts_list(self, v, load=False): + """ + Setter method for ts_list, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/label_hop/te_label/otn/ts_list (string) + If this variable is read-only (config: false) in the + source YANG file, then _set_ts_list is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_ts_list() directly. + + YANG Description: A list of available Tributary Slots (TS) ranging + + + + +between 1 and 4095. If multiple values or +ranges are given, they all MUST be disjoint +and MUST be in ascending order. +For example 1-20,25,50-1000. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='string', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """ts_list must be of a type compatible with string""", + 'defined-type': "string", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='string', is_config=False)""", + }) + + self.__ts_list = t + if hasattr(self, '_set'): + self._set() + + def _unset_ts_list(self): + self.__ts_list = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='string', is_config=False) + + tpn = __builtin__.property(_get_tpn) + tsg = __builtin__.property(_get_tsg) + ts_list = __builtin__.property(_get_ts_list) + + __choices__ = {'technology': {'otn': ['tpn', 'tsg', 'ts_list']}} + _pyangbind_elements = OrderedDict([('tpn', tpn), ('tsg', tsg), ('ts_list', ts_list), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/numbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/numbered_link_hop/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..bc4a1ad284407efff0c694b6f25dc14134a1127f --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/numbered_link_hop/__init__.py @@ -0,0 +1,193 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 numbered_link_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/connectivity-matrix/underlay/primary-path/path-element/numbered-link-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Numbered link explicit route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__link_tp_id','__hop_type','__direction',) + + _yang_name = 'numbered-link-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=False) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', 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 ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'connectivity-matrix', 'underlay', 'primary-path', 'path-element', 'numbered-link-hop'] + + def _get_link_tp_id(self): + """ + Getter method for link_tp_id, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/numbered_link_hop/link_tp_id (te-tp-id) + + YANG Description: TE Link Termination Point (LTP) identifier. + """ + return self.__link_tp_id + + def _set_link_tp_id(self, v, load=False): + """ + Setter method for link_tp_id, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/numbered_link_hop/link_tp_id (te-tp-id) + If this variable is read-only (config: false) in the + source YANG file, then _set_link_tp_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_link_tp_id() directly. + + YANG Description: TE Link Termination Point (LTP) identifier. + """ + 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),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """link_tp_id must be of a type compatible with te-tp-id""", + 'defined-type': "ietf-te-topology:te-tp-id", + 'generated-type': """YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=False)""", + }) + + self.__link_tp_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_link_tp_id(self): + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=False) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/numbered_link_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/numbered_link_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + 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={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + + + def _get_direction(self): + """ + Getter method for direction, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/numbered_link_hop/direction (te-link-direction) + + YANG Description: Link route object direction. + """ + return self.__direction + + def _set_direction(self, v, load=False): + """ + Setter method for direction, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/numbered_link_hop/direction (te-link-direction) + If this variable is read-only (config: false) in the + source YANG file, then _set_direction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_direction() directly. + + YANG Description: Link route object direction. + """ + 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={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """direction must be of a type compatible with te-link-direction""", + 'defined-type': "ietf-te-topology:te-link-direction", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=False)""", + }) + + self.__direction = t + if hasattr(self, '_set'): + self._set() + + def _unset_direction(self): + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=False) + + link_tp_id = __builtin__.property(_get_link_tp_id) + hop_type = __builtin__.property(_get_hop_type) + direction = __builtin__.property(_get_direction) + + __choices__ = {'type': {'numbered-link-hop': ['link_tp_id', 'hop_type', 'direction']}} + _pyangbind_elements = OrderedDict([('link_tp_id', link_tp_id), ('hop_type', hop_type), ('direction', direction), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/numbered_node_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/numbered_node_hop/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..1f6120bd56e1d699d796b29a921ac4cea947bb7d --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/numbered_node_hop/__init__.py @@ -0,0 +1,154 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 numbered_node_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/connectivity-matrix/underlay/primary-path/path-element/numbered-node-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Numbered node route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__node_id','__hop_type',) + + _yang_name = 'numbered-node-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=False) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', 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 ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'connectivity-matrix', 'underlay', 'primary-path', 'path-element', 'numbered-node-hop'] + + def _get_node_id(self): + """ + Getter method for node_id, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/numbered_node_hop/node_id (te-node-id) + + YANG Description: The identifier of a node in the TE topology. + """ + return self.__node_id + + def _set_node_id(self, v, load=False): + """ + Setter method for node_id, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/numbered_node_hop/node_id (te-node-id) + 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. + + YANG Description: The identifier of a node in the TE topology. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """node_id must be of a type compatible with te-node-id""", + 'defined-type': "ietf-te-topology:te-node-id", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=False)""", + }) + + self.__node_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_node_id(self): + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=False) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/numbered_node_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/numbered_node_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + 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={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + + node_id = __builtin__.property(_get_node_id) + hop_type = __builtin__.property(_get_hop_type) + + __choices__ = {'type': {'numbered-node-hop': ['node_id', 'hop_type']}} + _pyangbind_elements = OrderedDict([('node_id', node_id), ('hop_type', hop_type), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/unnumbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/unnumbered_link_hop/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..7f75c01074c5ce8e457f5e725599b90212576766 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/unnumbered_link_hop/__init__.py @@ -0,0 +1,236 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 unnumbered_link_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/connectivity-matrix/underlay/primary-path/path-element/unnumbered-link-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Unnumbered link explicit route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__link_tp_id','__node_id','__hop_type','__direction',) + + _yang_name = 'unnumbered-link-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=False) + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=False) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', 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 ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'connectivity-matrix', 'underlay', 'primary-path', 'path-element', 'unnumbered-link-hop'] + + def _get_link_tp_id(self): + """ + Getter method for link_tp_id, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/unnumbered_link_hop/link_tp_id (te-tp-id) + + YANG Description: TE LTP identifier. The combination of the TE link ID +and the TE node ID is used to identify an unnumbered +TE link. + """ + return self.__link_tp_id + + def _set_link_tp_id(self, v, load=False): + """ + Setter method for link_tp_id, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/unnumbered_link_hop/link_tp_id (te-tp-id) + If this variable is read-only (config: false) in the + source YANG file, then _set_link_tp_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_link_tp_id() directly. + + YANG Description: TE LTP identifier. The combination of the TE link ID +and the TE node ID is used to identify an unnumbered +TE link. + """ + 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),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """link_tp_id must be of a type compatible with te-tp-id""", + 'defined-type': "ietf-te-topology:te-tp-id", + 'generated-type': """YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=False)""", + }) + + self.__link_tp_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_link_tp_id(self): + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=False) + + + def _get_node_id(self): + """ + Getter method for node_id, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/unnumbered_link_hop/node_id (te-node-id) + + YANG Description: The identifier of a node in the TE topology. + """ + return self.__node_id + + def _set_node_id(self, v, load=False): + """ + Setter method for node_id, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/unnumbered_link_hop/node_id (te-node-id) + 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. + + YANG Description: The identifier of a node in the TE topology. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """node_id must be of a type compatible with te-node-id""", + 'defined-type': "ietf-te-topology:te-node-id", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=False)""", + }) + + self.__node_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_node_id(self): + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=False) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/unnumbered_link_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/unnumbered_link_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + 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={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + + + def _get_direction(self): + """ + Getter method for direction, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/unnumbered_link_hop/direction (te-link-direction) + + YANG Description: Link route object direction. + """ + return self.__direction + + def _set_direction(self, v, load=False): + """ + Setter method for direction, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/unnumbered_link_hop/direction (te-link-direction) + If this variable is read-only (config: false) in the + source YANG file, then _set_direction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_direction() directly. + + YANG Description: Link route object direction. + """ + 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={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """direction must be of a type compatible with te-link-direction""", + 'defined-type': "ietf-te-topology:te-link-direction", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=False)""", + }) + + self.__direction = t + if hasattr(self, '_set'): + self._set() + + def _unset_direction(self): + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=False) + + link_tp_id = __builtin__.property(_get_link_tp_id) + node_id = __builtin__.property(_get_node_id) + hop_type = __builtin__.property(_get_hop_type) + direction = __builtin__.property(_get_direction) + + __choices__ = {'type': {'unnumbered-link-hop': ['link_tp_id', 'node_id', 'hop_type', 'direction']}} + _pyangbind_elements = OrderedDict([('link_tp_id', link_tp_id), ('node_id', node_id), ('hop_type', hop_type), ('direction', direction), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/tunnel_termination_points/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/tunnel_termination_points/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..fe1f4b85508ac28b5a0f20bb1ea55bd1332d446a --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/tunnel_termination_points/__init__.py @@ -0,0 +1,154 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 tunnel_termination_points(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/connectivity-matrix/underlay/tunnel-termination-points. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Underlay TTPs desired for this link. + """ + __slots__ = ('_path_helper', '_extmethods', '__source','__destination',) + + _yang_name = 'tunnel-termination-points' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__source = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="source", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='binary', is_config=False) + self.__destination = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="destination", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='binary', 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 ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'connectivity-matrix', 'underlay', 'tunnel-termination-points'] + + def _get_source(self): + """ + Getter method for source, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/tunnel_termination_points/source (binary) + + YANG Description: Source TTP identifier. + """ + return self.__source + + def _set_source(self, v, load=False): + """ + Setter method for source, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/tunnel_termination_points/source (binary) + If this variable is read-only (config: false) in the + source YANG file, then _set_source is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_source() directly. + + YANG Description: Source TTP identifier. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBinary, is_leaf=True, yang_name="source", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='binary', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """source must be of a type compatible with binary""", + 'defined-type': "binary", + 'generated-type': """YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="source", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='binary', is_config=False)""", + }) + + self.__source = t + if hasattr(self, '_set'): + self._set() + + def _unset_source(self): + self.__source = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="source", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='binary', is_config=False) + + + def _get_destination(self): + """ + Getter method for destination, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/tunnel_termination_points/destination (binary) + + YANG Description: Destination TTP identifier. + """ + return self.__destination + + def _set_destination(self, v, load=False): + """ + Setter method for destination, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/tunnel_termination_points/destination (binary) + If this variable is read-only (config: false) in the + source YANG file, then _set_destination is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_destination() directly. + + YANG Description: Destination TTP identifier. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBinary, is_leaf=True, yang_name="destination", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='binary', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """destination must be of a type compatible with binary""", + 'defined-type': "binary", + 'generated-type': """YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="destination", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='binary', is_config=False)""", + }) + + self.__destination = t + if hasattr(self, '_set'): + self._set() + + def _unset_destination(self): + self.__destination = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="destination", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='binary', is_config=False) + + source = __builtin__.property(_get_source) + destination = __builtin__.property(_get_destination) + + + _pyangbind_elements = OrderedDict([('source', source), ('destination', destination), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/tunnels/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/tunnels/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..0493843c740539cbe3763507f281d8120730bdb6 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/tunnels/__init__.py @@ -0,0 +1,167 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 tunnel +class tunnels(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/connectivity-matrix/underlay/tunnels. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Underlay TE tunnels supporting this TE link. + """ + __slots__ = ('_path_helper', '_extmethods', '__sharing','__tunnel',) + + _yang_name = 'tunnels' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__sharing = YANGDynClass(base=YANGBool, default=YANGBool("true"), is_leaf=True, yang_name="sharing", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='boolean', is_config=False) + self.__tunnel = YANGDynClass(base=YANGListType("tunnel_name",tunnel.tunnel, yang_name="tunnel", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='tunnel-name', extensions=None), is_container='list', yang_name="tunnel", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', 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 ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'connectivity-matrix', 'underlay', 'tunnels'] + + def _get_sharing(self): + """ + Getter method for sharing, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/tunnels/sharing (boolean) + + YANG Description: 'true' if the underlay tunnel can be shared with other +TE links; +'false' if the underlay tunnel is dedicated to this +TE link. +This leaf is the default option for all TE tunnels +and may be overridden by the per-TE-tunnel value. + """ + return self.__sharing + + def _set_sharing(self, v, load=False): + """ + Setter method for sharing, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/tunnels/sharing (boolean) + If this variable is read-only (config: false) in the + source YANG file, then _set_sharing is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_sharing() directly. + + YANG Description: 'true' if the underlay tunnel can be shared with other +TE links; +'false' if the underlay tunnel is dedicated to this +TE link. +This leaf is the default option for all TE tunnels +and may be overridden by the per-TE-tunnel value. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBool, default=YANGBool("true"), is_leaf=True, yang_name="sharing", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='boolean', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """sharing must be of a type compatible with boolean""", + 'defined-type': "boolean", + 'generated-type': """YANGDynClass(base=YANGBool, default=YANGBool("true"), is_leaf=True, yang_name="sharing", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='boolean', is_config=False)""", + }) + + self.__sharing = t + if hasattr(self, '_set'): + self._set() + + def _unset_sharing(self): + self.__sharing = YANGDynClass(base=YANGBool, default=YANGBool("true"), is_leaf=True, yang_name="sharing", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='boolean', is_config=False) + + + def _get_tunnel(self): + """ + Getter method for tunnel, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/tunnels/tunnel (list) + + YANG Description: Zero, one, or more underlay TE tunnels that support this +TE link. + """ + return self.__tunnel + + def _set_tunnel(self, v, load=False): + """ + Setter method for tunnel, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/tunnels/tunnel (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_tunnel is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tunnel() directly. + + YANG Description: Zero, one, or more underlay TE tunnels that support this +TE link. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("tunnel_name",tunnel.tunnel, yang_name="tunnel", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='tunnel-name', extensions=None), is_container='list', yang_name="tunnel", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tunnel must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("tunnel_name",tunnel.tunnel, yang_name="tunnel", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='tunnel-name', extensions=None), is_container='list', yang_name="tunnel", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False)""", + }) + + self.__tunnel = t + if hasattr(self, '_set'): + self._set() + + def _unset_tunnel(self): + self.__tunnel = YANGDynClass(base=YANGListType("tunnel_name",tunnel.tunnel, yang_name="tunnel", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='tunnel-name', extensions=None), is_container='list', yang_name="tunnel", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + + sharing = __builtin__.property(_get_sharing) + tunnel = __builtin__.property(_get_tunnel) + + + _pyangbind_elements = OrderedDict([('sharing', sharing), ('tunnel', tunnel), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/tunnels/tunnel/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/tunnels/tunnel/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..0bade453763a51c761470543982308e483db615b --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/tunnels/tunnel/__init__.py @@ -0,0 +1,170 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 tunnel(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/connectivity-matrix/underlay/tunnels/tunnel. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Zero, one, or more underlay TE tunnels that support this +TE link. + """ + __slots__ = ('_path_helper', '_extmethods', '__tunnel_name','__sharing',) + + _yang_name = 'tunnel' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__tunnel_name = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="tunnel-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=False) + self.__sharing = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="sharing", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', 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 ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'connectivity-matrix', 'underlay', 'tunnels', 'tunnel'] + + def _get_tunnel_name(self): + """ + Getter method for tunnel_name, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/tunnels/tunnel/tunnel_name (string) + + YANG Description: A tunnel name uniquely identifies an underlay TE tunnel, +used together with the 'source-node' value for this +link. + """ + return self.__tunnel_name + + def _set_tunnel_name(self, v, load=False): + """ + Setter method for tunnel_name, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/tunnels/tunnel/tunnel_name (string) + If this variable is read-only (config: false) in the + source YANG file, then _set_tunnel_name is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tunnel_name() directly. + + YANG Description: A tunnel name uniquely identifies an underlay TE tunnel, +used together with the 'source-node' value for this +link. + """ + 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="tunnel-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tunnel_name must be of a type compatible with string""", + 'defined-type': "string", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="tunnel-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=False)""", + }) + + self.__tunnel_name = t + if hasattr(self, '_set'): + self._set() + + def _unset_tunnel_name(self): + self.__tunnel_name = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="tunnel-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=False) + + + def _get_sharing(self): + """ + Getter method for sharing, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/tunnels/tunnel/sharing (boolean) + + YANG Description: 'true' if the underlay tunnel can be shared with other +TE links; +'false' if the underlay tunnel is dedicated to this +TE link. + """ + return self.__sharing + + def _set_sharing(self, v, load=False): + """ + Setter method for sharing, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/tunnels/tunnel/sharing (boolean) + If this variable is read-only (config: false) in the + source YANG file, then _set_sharing is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_sharing() directly. + + YANG Description: 'true' if the underlay tunnel can be shared with other +TE links; +'false' if the underlay tunnel is dedicated to this +TE link. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBool, is_leaf=True, yang_name="sharing", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='boolean', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """sharing must be of a type compatible with boolean""", + 'defined-type': "boolean", + 'generated-type': """YANGDynClass(base=YANGBool, is_leaf=True, yang_name="sharing", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='boolean', is_config=False)""", + }) + + self.__sharing = t + if hasattr(self, '_set'): + self._set() + + def _unset_sharing(self): + self.__sharing = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="sharing", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='boolean', is_config=False) + + tunnel_name = __builtin__.property(_get_tunnel_name) + sharing = __builtin__.property(_get_sharing) + + + _pyangbind_elements = OrderedDict([('tunnel_name', tunnel_name), ('sharing', sharing), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..6d7414731add908d5a234b2d980bc2c34f2c199e --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/__init__.py @@ -0,0 +1,120 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 label_restriction +class label_restrictions(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/label-restrictions. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: The label restrictions container. + """ + __slots__ = ('_path_helper', '_extmethods', '__label_restriction',) + + _yang_name = 'label-restrictions' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__label_restriction = YANGDynClass(base=YANGListType("index",label_restriction.label_restriction, yang_name="label-restriction", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='index', extensions=None), is_container='list', yang_name="label-restriction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', 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 ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'label-restrictions'] + + def _get_label_restriction(self): + """ + Getter method for label_restriction, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/label_restriction (list) + + YANG Description: The absence of the label restrictions container implies +that all labels are acceptable; otherwise, only restricted +labels are available. + """ + return self.__label_restriction + + def _set_label_restriction(self, v, load=False): + """ + Setter method for label_restriction, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/label_restriction (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_label_restriction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_label_restriction() directly. + + YANG Description: The absence of the label restrictions container implies +that all labels are acceptable; otherwise, only restricted +labels are available. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("index",label_restriction.label_restriction, yang_name="label-restriction", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='index', extensions=None), is_container='list', yang_name="label-restriction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """label_restriction must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("index",label_restriction.label_restriction, yang_name="label-restriction", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='index', extensions=None), is_container='list', yang_name="label-restriction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False)""", + }) + + self.__label_restriction = t + if hasattr(self, '_set'): + self._set() + + def _unset_label_restriction(self): + self.__label_restriction = YANGDynClass(base=YANGListType("index",label_restriction.label_restriction, yang_name="label-restriction", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='index', extensions=None), is_container='list', yang_name="label-restriction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + + label_restriction = __builtin__.property(_get_label_restriction) + + + _pyangbind_elements = OrderedDict([('label_restriction', label_restriction), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/label_restriction/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/label_restriction/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..39cb5bdabbe35e56a81c00f4ec938e75f1d83fcd --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/label_restriction/__init__.py @@ -0,0 +1,450 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 label_start +from . import label_end +from . import label_step +from . import otn_label_range +from . import ethernet_label_range +class label_restriction(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/label-restrictions/label-restriction. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: The absence of the label restrictions container implies +that all labels are acceptable; otherwise, only restricted +labels are available. + """ + __slots__ = ('_path_helper', '_extmethods', '__restriction','__index','__label_start','__label_end','__label_step','__range_bitmap','__otn_label_range','__ethernet_label_range',) + + _yang_name = 'label-restriction' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__restriction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'inclusive': {}, 'exclusive': {}},), default=six.text_type("inclusive"), is_leaf=True, yang_name="restriction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='enumeration', is_config=False) + self.__index = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=False) + self.__label_start = YANGDynClass(base=label_start.label_start, is_container='container', yang_name="label-start", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__label_end = YANGDynClass(base=label_end.label_end, is_container='container', yang_name="label-end", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__label_step = YANGDynClass(base=label_step.label_step, is_container='container', yang_name="label-step", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__range_bitmap = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}), is_leaf=True, yang_name="range-bitmap", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:hex-string', is_config=False) + self.__otn_label_range = YANGDynClass(base=otn_label_range.otn_label_range, is_container='container', yang_name="otn-label-range", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False) + self.__ethernet_label_range = YANGDynClass(base=ethernet_label_range.ethernet_label_range, is_container='container', yang_name="ethernet-label-range", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', 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 ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'label-restrictions', 'label-restriction'] + + def _get_restriction(self): + """ + Getter method for restriction, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/label_restriction/restriction (enumeration) + + YANG Description: Indicates whether the list item is inclusive or exclusive. + """ + return self.__restriction + + def _set_restriction(self, v, load=False): + """ + Setter method for restriction, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/label_restriction/restriction (enumeration) + If this variable is read-only (config: false) in the + source YANG file, then _set_restriction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_restriction() directly. + + YANG Description: Indicates whether the list item is inclusive or exclusive. + """ + 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={'inclusive': {}, 'exclusive': {}},), default=six.text_type("inclusive"), is_leaf=True, yang_name="restriction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='enumeration', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """restriction must be of a type compatible with enumeration""", + 'defined-type': "ietf-te-topology:enumeration", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'inclusive': {}, 'exclusive': {}},), default=six.text_type("inclusive"), is_leaf=True, yang_name="restriction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='enumeration', is_config=False)""", + }) + + self.__restriction = t + if hasattr(self, '_set'): + self._set() + + def _unset_restriction(self): + self.__restriction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'inclusive': {}, 'exclusive': {}},), default=six.text_type("inclusive"), is_leaf=True, yang_name="restriction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='enumeration', is_config=False) + + + def _get_index(self): + """ + Getter method for index, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/label_restriction/index (uint32) + + YANG Description: The index of the label restriction list entry. + """ + return self.__index + + def _set_index(self, v, load=False): + """ + Setter method for index, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/label_restriction/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 label restriction list entry. + """ + 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=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', 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), is_leaf=True, yang_name="index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', 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), is_leaf=True, yang_name="index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=False) + + + def _get_label_start(self): + """ + Getter method for label_start, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/label_restriction/label_start (container) + + YANG Description: This is the starting label if a label range is specified. +This is the label value if a single label is specified, +in which case the 'label-end' attribute is not set. + """ + return self.__label_start + + def _set_label_start(self, v, load=False): + """ + Setter method for label_start, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/label_restriction/label_start (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_label_start is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_label_start() directly. + + YANG Description: This is the starting label if a label range is specified. +This is the label value if a single label is specified, +in which case the 'label-end' attribute is not set. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=label_start.label_start, is_container='container', yang_name="label-start", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """label_start must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=label_start.label_start, is_container='container', yang_name="label-start", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__label_start = t + if hasattr(self, '_set'): + self._set() + + def _unset_label_start(self): + self.__label_start = YANGDynClass(base=label_start.label_start, is_container='container', yang_name="label-start", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_label_end(self): + """ + Getter method for label_end, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/label_restriction/label_end (container) + + YANG Description: This is the ending label if a label range is specified. +This attribute is not set if a single label is specified. + """ + return self.__label_end + + def _set_label_end(self, v, load=False): + """ + Setter method for label_end, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/label_restriction/label_end (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_label_end is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_label_end() directly. + + YANG Description: This is the ending label if a label range is specified. +This attribute is not set if a single label is specified. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=label_end.label_end, is_container='container', yang_name="label-end", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """label_end must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=label_end.label_end, is_container='container', yang_name="label-end", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__label_end = t + if hasattr(self, '_set'): + self._set() + + def _unset_label_end(self): + self.__label_end = YANGDynClass(base=label_end.label_end, is_container='container', yang_name="label-end", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_label_step(self): + """ + Getter method for label_step, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/label_restriction/label_step (container) + + YANG Description: The step increment between labels in the label range. +The label start/end values will have to be consistent +with the sign of label step. For example, +'label-start' < 'label-end' enforces 'label-step' > 0 +'label-start' > 'label-end' enforces 'label-step' < 0. + """ + return self.__label_step + + def _set_label_step(self, v, load=False): + """ + Setter method for label_step, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/label_restriction/label_step (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_label_step is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_label_step() directly. + + YANG Description: The step increment between labels in the label range. +The label start/end values will have to be consistent +with the sign of label step. For example, +'label-start' < 'label-end' enforces 'label-step' > 0 +'label-start' > 'label-end' enforces 'label-step' < 0. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=label_step.label_step, is_container='container', yang_name="label-step", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """label_step must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=label_step.label_step, is_container='container', yang_name="label-step", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__label_step = t + if hasattr(self, '_set'): + self._set() + + def _unset_label_step(self): + self.__label_step = YANGDynClass(base=label_step.label_step, is_container='container', yang_name="label-step", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_range_bitmap(self): + """ + Getter method for range_bitmap, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/label_restriction/range_bitmap (yang:hex-string) + + YANG Description: When there are gaps between 'label-start' and 'label-end', +this attribute is used to specify the positions +of the used labels. This is represented in big endian as +'hex-string'. +The most significant byte in the hex-string is the farthest +to the left in the byte sequence. Leading zero bytes in the +configured value may be omitted for brevity. +Each bit position in the 'range-bitmap' 'hex-string' maps +to a label in the range derived from 'label-start'. + +For example, assuming that 'label-start' = 16000 and +'range-bitmap' = 0x01000001, then: + +- bit position (0) is set, and the corresponding mapped + label from the range is 16000 + (0 * 'label-step') or + 16000 for default 'label-step' = 1. +- bit position (24) is set, and the corresponding mapped + label from the range is 16000 + (24 * 'label-step') or + 16024 for default 'label-step' = 1. + """ + return self.__range_bitmap + + def _set_range_bitmap(self, v, load=False): + """ + Setter method for range_bitmap, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/label_restriction/range_bitmap (yang:hex-string) + If this variable is read-only (config: false) in the + source YANG file, then _set_range_bitmap is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_range_bitmap() directly. + + YANG Description: When there are gaps between 'label-start' and 'label-end', +this attribute is used to specify the positions +of the used labels. This is represented in big endian as +'hex-string'. +The most significant byte in the hex-string is the farthest +to the left in the byte sequence. Leading zero bytes in the +configured value may be omitted for brevity. +Each bit position in the 'range-bitmap' 'hex-string' maps +to a label in the range derived from 'label-start'. + +For example, assuming that 'label-start' = 16000 and +'range-bitmap' = 0x01000001, then: + +- bit position (0) is set, and the corresponding mapped + label from the range is 16000 + (0 * 'label-step') or + 16000 for default 'label-step' = 1. +- bit position (24) is set, and the corresponding mapped + label from the range is 16000 + (24 * 'label-step') or + 16024 for default 'label-step' = 1. + """ + 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})*)?'}), is_leaf=True, yang_name="range-bitmap", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:hex-string', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """range_bitmap must be of a type compatible with yang:hex-string""", + 'defined-type': "yang:hex-string", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}), is_leaf=True, yang_name="range-bitmap", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:hex-string', is_config=False)""", + }) + + self.__range_bitmap = t + if hasattr(self, '_set'): + self._set() + + def _unset_range_bitmap(self): + self.__range_bitmap = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}), is_leaf=True, yang_name="range-bitmap", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:hex-string', is_config=False) + + + def _get_otn_label_range(self): + """ + Getter method for otn_label_range, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/label_restriction/otn_label_range (container) + + YANG Description: Label range information for OTN. + """ + return self.__otn_label_range + + def _set_otn_label_range(self, v, load=False): + """ + Setter method for otn_label_range, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/label_restriction/otn_label_range (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_otn_label_range is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_otn_label_range() directly. + + YANG Description: Label range information for OTN. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=otn_label_range.otn_label_range, is_container='container', yang_name="otn-label-range", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """otn_label_range must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=otn_label_range.otn_label_range, is_container='container', yang_name="otn-label-range", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False)""", + }) + + self.__otn_label_range = t + if hasattr(self, '_set'): + self._set() + + def _unset_otn_label_range(self): + self.__otn_label_range = YANGDynClass(base=otn_label_range.otn_label_range, is_container='container', yang_name="otn-label-range", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False) + + + def _get_ethernet_label_range(self): + """ + Getter method for ethernet_label_range, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/label_restriction/ethernet_label_range (container) + + YANG Description: Ethernet-specific label range related information. + """ + return self.__ethernet_label_range + + def _set_ethernet_label_range(self, v, load=False): + """ + Setter method for ethernet_label_range, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/label_restriction/ethernet_label_range (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_ethernet_label_range is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_ethernet_label_range() directly. + + YANG Description: Ethernet-specific label range related information. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=ethernet_label_range.ethernet_label_range, is_container='container', yang_name="ethernet-label-range", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """ethernet_label_range must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=ethernet_label_range.ethernet_label_range, is_container='container', yang_name="ethernet-label-range", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='container', is_config=False)""", + }) + + self.__ethernet_label_range = t + if hasattr(self, '_set'): + self._set() + + def _unset_ethernet_label_range(self): + self.__ethernet_label_range = YANGDynClass(base=ethernet_label_range.ethernet_label_range, is_container='container', yang_name="ethernet-label-range", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='container', is_config=False) + + restriction = __builtin__.property(_get_restriction) + index = __builtin__.property(_get_index) + label_start = __builtin__.property(_get_label_start) + label_end = __builtin__.property(_get_label_end) + label_step = __builtin__.property(_get_label_step) + range_bitmap = __builtin__.property(_get_range_bitmap) + otn_label_range = __builtin__.property(_get_otn_label_range) + ethernet_label_range = __builtin__.property(_get_ethernet_label_range) + + + _pyangbind_elements = OrderedDict([('restriction', restriction), ('index', index), ('label_start', label_start), ('label_end', label_end), ('label_step', label_step), ('range_bitmap', range_bitmap), ('otn_label_range', otn_label_range), ('ethernet_label_range', ethernet_label_range), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/label_restriction/ethernet_label_range/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/label_restriction/ethernet_label_range/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..5cfb573c3d6407b1d27f175d7a3fb6e0909fe780 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/label_restriction/ethernet_label_range/__init__.py @@ -0,0 +1,154 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 ethernet_label_range(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/label-restrictions/label-restriction/ethernet-label-range. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Ethernet-specific label range related information. + """ + __slots__ = ('_path_helper', '_extmethods', '__tag_type','__priority',) + + _yang_name = 'ethernet-label-range' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__tag_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 's-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:s-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:s-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}},), is_leaf=True, yang_name="tag-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:eth-tag-type', is_config=False) + self.__priority = YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), is_leaf=True, yang_name="priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', 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 ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'label-restrictions', 'label-restriction', 'ethernet-label-range'] + + def _get_tag_type(self): + """ + Getter method for tag_type, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/label_restriction/ethernet_label_range/tag_type (etht-types:eth-tag-type) + + YANG Description: VLAN tag type. + """ + return self.__tag_type + + def _set_tag_type(self, v, load=False): + """ + Setter method for tag_type, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/label_restriction/ethernet_label_range/tag_type (etht-types:eth-tag-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_tag_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tag_type() directly. + + YANG Description: VLAN tag type. + """ + 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={'c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 's-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:s-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:s-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}},), is_leaf=True, yang_name="tag-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:eth-tag-type', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tag_type must be of a type compatible with etht-types:eth-tag-type""", + 'defined-type': "etht-types:eth-tag-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 's-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:s-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:s-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}},), is_leaf=True, yang_name="tag-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:eth-tag-type', is_config=False)""", + }) + + self.__tag_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_tag_type(self): + self.__tag_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 's-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:s-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:s-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}},), is_leaf=True, yang_name="tag-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:eth-tag-type', is_config=False) + + + def _get_priority(self): + """ + Getter method for priority, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/label_restriction/ethernet_label_range/priority (uint8) + + YANG Description: priority. + """ + return self.__priority + + def _set_priority(self, v, load=False): + """ + Setter method for priority, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/label_restriction/ethernet_label_range/priority (uint8) + If this variable is read-only (config: false) in the + source YANG file, then _set_priority is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_priority() directly. + + YANG Description: priority. + """ + 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="priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint8', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """priority 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="priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint8', is_config=False)""", + }) + + self.__priority = t + if hasattr(self, '_set'): + self._set() + + def _unset_priority(self): + self.__priority = YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), is_leaf=True, yang_name="priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint8', is_config=False) + + tag_type = __builtin__.property(_get_tag_type) + priority = __builtin__.property(_get_priority) + + + _pyangbind_elements = OrderedDict([('tag_type', tag_type), ('priority', priority), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/label_restriction/label_end/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/label_restriction/label_end/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..8c503e2b257aeee411091790f42ec349eee349c0 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/label_restriction/label_end/__init__.py @@ -0,0 +1,119 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 te_label +class label_end(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/label-restrictions/label-restriction/label-end. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: This is the ending label if a label range is specified. +This attribute is not set if a single label is specified. + """ + __slots__ = ('_path_helper', '_extmethods', '__te_label',) + + _yang_name = 'label-end' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__te_label = YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', 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 ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'label-restrictions', 'label-restriction', 'label-end'] + + def _get_te_label(self): + """ + Getter method for te_label, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/label_restriction/label_end/te_label (container) + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + return self.__te_label + + def _set_te_label(self, v, load=False): + """ + Setter method for te_label, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/label_restriction/label_end/te_label (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_te_label is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_te_label() directly. + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """te_label must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__te_label = t + if hasattr(self, '_set'): + self._set() + + def _unset_te_label(self): + self.__te_label = YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + te_label = __builtin__.property(_get_te_label) + + + _pyangbind_elements = OrderedDict([('te_label', te_label), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/label_restriction/label_end/te_label/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/label_restriction/label_end/te_label/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..de17adeb4459dd104de1cde30c405cf5a023583b --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/label_restriction/label_end/te_label/__init__.py @@ -0,0 +1,234 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 otn +class te_label(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/label-restrictions/label-restriction/label-end/te-label. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + __slots__ = ('_path_helper', '_extmethods', '__generic','__otn','__vlanid','__direction',) + + _yang_name = 'te-label' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__generic = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=False) + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False) + self.__vlanid = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=False) + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', 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 ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'label-restrictions', 'label-restriction', 'label-end', 'te-label'] + + def _get_generic(self): + """ + Getter method for generic, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/label_restriction/label_end/te_label/generic (rt-types:generalized-label) + + YANG Description: TE label specified in a generic format. + """ + return self.__generic + + def _set_generic(self, v, load=False): + """ + Setter method for generic, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/label_restriction/label_end/te_label/generic (rt-types:generalized-label) + If this variable is read-only (config: false) in the + source YANG file, then _set_generic is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_generic() directly. + + YANG Description: TE label specified in a generic format. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """generic must be of a type compatible with rt-types:generalized-label""", + 'defined-type': "rt-types:generalized-label", + 'generated-type': """YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=False)""", + }) + + self.__generic = t + if hasattr(self, '_set'): + self._set() + + def _unset_generic(self): + self.__generic = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=False) + + + def _get_otn(self): + """ + Getter method for otn, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/label_restriction/label_end/te_label/otn (container) + + YANG Description: Label start or label end for OTN. + """ + return self.__otn + + def _set_otn(self, v, load=False): + """ + Setter method for otn, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/label_restriction/label_end/te_label/otn (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_otn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_otn() directly. + + YANG Description: Label start or label end for OTN. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """otn must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False)""", + }) + + self.__otn = t + if hasattr(self, '_set'): + self._set() + + def _unset_otn(self): + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False) + + + def _get_vlanid(self): + """ + Getter method for vlanid, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/label_restriction/label_end/te_label/vlanid (etht-types:vlanid) + + YANG Description: VLAN tag id. + """ + return self.__vlanid + + def _set_vlanid(self, v, load=False): + """ + Setter method for vlanid, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/label_restriction/label_end/te_label/vlanid (etht-types:vlanid) + If this variable is read-only (config: false) in the + source YANG file, then _set_vlanid is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_vlanid() directly. + + YANG Description: VLAN tag id. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """vlanid must be of a type compatible with etht-types:vlanid""", + 'defined-type': "etht-types:vlanid", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=False)""", + }) + + self.__vlanid = t + if hasattr(self, '_set'): + self._set() + + def _unset_vlanid(self): + self.__vlanid = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=False) + + + def _get_direction(self): + """ + Getter method for direction, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/label_restriction/label_end/te_label/direction (te-label-direction) + + YANG Description: Label direction. + """ + return self.__direction + + def _set_direction(self, v, load=False): + """ + Setter method for direction, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/label_restriction/label_end/te_label/direction (te-label-direction) + If this variable is read-only (config: false) in the + source YANG file, then _set_direction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_direction() directly. + + YANG Description: Label direction. + """ + 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={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """direction must be of a type compatible with te-label-direction""", + 'defined-type': "ietf-te-topology:te-label-direction", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=False)""", + }) + + self.__direction = t + if hasattr(self, '_set'): + self._set() + + def _unset_direction(self): + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=False) + + generic = __builtin__.property(_get_generic) + otn = __builtin__.property(_get_otn) + vlanid = __builtin__.property(_get_vlanid) + direction = __builtin__.property(_get_direction) + + __choices__ = {'technology': {'generic': ['generic'], 'otn': ['otn'], 'eth': ['vlanid']}} + _pyangbind_elements = OrderedDict([('generic', generic), ('otn', otn), ('vlanid', vlanid), ('direction', direction), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/label_restriction/label_end/te_label/otn/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/label_restriction/label_end/te_label/otn/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..459dceb1d30e33d8699064985129d362e7a114b3 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/label_restriction/label_end/te_label/otn/__init__.py @@ -0,0 +1,154 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 otn(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/label-restrictions/label-restriction/label-end/te-label/otn. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Label start or label end for OTN. + """ + __slots__ = ('_path_helper', '_extmethods', '__tpn','__ts',) + + _yang_name = 'otn' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__tpn = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('range-type', 'trib-port'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=False) + self.__ts = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts", parent=self, choice=('range-type', 'trib-slot'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-ts', 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 ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'label-restrictions', 'label-restriction', 'label-end', 'te-label', 'otn'] + + def _get_tpn(self): + """ + Getter method for tpn, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/label_restriction/label_end/te_label/otn/tpn (otn-tpn) + + YANG Description: Tributary Port Number (TPN). + """ + return self.__tpn + + def _set_tpn(self, v, load=False): + """ + Setter method for tpn, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/label_restriction/label_end/te_label/otn/tpn (otn-tpn) + If this variable is read-only (config: false) in the + source YANG file, then _set_tpn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tpn() directly. + + YANG Description: Tributary Port Number (TPN). + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('range-type', 'trib-port'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tpn must be of a type compatible with otn-tpn""", + 'defined-type': "ietf-otn-topology:otn-tpn", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('range-type', 'trib-port'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=False)""", + }) + + self.__tpn = t + if hasattr(self, '_set'): + self._set() + + def _unset_tpn(self): + self.__tpn = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('range-type', 'trib-port'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=False) + + + def _get_ts(self): + """ + Getter method for ts, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/label_restriction/label_end/te_label/otn/ts (otn-ts) + + YANG Description: Tributary Slot (TS) number. + """ + return self.__ts + + def _set_ts(self, v, load=False): + """ + Setter method for ts, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/label_restriction/label_end/te_label/otn/ts (otn-ts) + If this variable is read-only (config: false) in the + source YANG file, then _set_ts is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_ts() directly. + + YANG Description: Tributary Slot (TS) number. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts", parent=self, choice=('range-type', 'trib-slot'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-ts', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """ts must be of a type compatible with otn-ts""", + 'defined-type': "ietf-otn-topology:otn-ts", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts", parent=self, choice=('range-type', 'trib-slot'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-ts', is_config=False)""", + }) + + self.__ts = t + if hasattr(self, '_set'): + self._set() + + def _unset_ts(self): + self.__ts = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts", parent=self, choice=('range-type', 'trib-slot'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-ts', is_config=False) + + tpn = __builtin__.property(_get_tpn) + ts = __builtin__.property(_get_ts) + + __choices__ = {'range-type': {'trib-port': ['tpn'], 'trib-slot': ['ts']}} + _pyangbind_elements = OrderedDict([('tpn', tpn), ('ts', ts), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/label_restriction/label_start/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/label_restriction/label_start/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..1a8e4c4dccf50bade3f069f5f589d4bc274aa444 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/label_restriction/label_start/__init__.py @@ -0,0 +1,120 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 te_label +class label_start(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/label-restrictions/label-restriction/label-start. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: This is the starting label if a label range is specified. +This is the label value if a single label is specified, +in which case the 'label-end' attribute is not set. + """ + __slots__ = ('_path_helper', '_extmethods', '__te_label',) + + _yang_name = 'label-start' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__te_label = YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', 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 ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'label-restrictions', 'label-restriction', 'label-start'] + + def _get_te_label(self): + """ + Getter method for te_label, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/label_restriction/label_start/te_label (container) + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + return self.__te_label + + def _set_te_label(self, v, load=False): + """ + Setter method for te_label, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/label_restriction/label_start/te_label (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_te_label is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_te_label() directly. + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """te_label must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__te_label = t + if hasattr(self, '_set'): + self._set() + + def _unset_te_label(self): + self.__te_label = YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + te_label = __builtin__.property(_get_te_label) + + + _pyangbind_elements = OrderedDict([('te_label', te_label), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/label_restriction/label_start/te_label/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/label_restriction/label_start/te_label/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..1f66e6dae904e15a1f49b0c58b5b64a535a5e33f --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/label_restriction/label_start/te_label/__init__.py @@ -0,0 +1,234 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 otn +class te_label(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/label-restrictions/label-restriction/label-start/te-label. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + __slots__ = ('_path_helper', '_extmethods', '__generic','__otn','__vlanid','__direction',) + + _yang_name = 'te-label' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__generic = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=False) + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False) + self.__vlanid = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=False) + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', 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 ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'label-restrictions', 'label-restriction', 'label-start', 'te-label'] + + def _get_generic(self): + """ + Getter method for generic, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/label_restriction/label_start/te_label/generic (rt-types:generalized-label) + + YANG Description: TE label specified in a generic format. + """ + return self.__generic + + def _set_generic(self, v, load=False): + """ + Setter method for generic, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/label_restriction/label_start/te_label/generic (rt-types:generalized-label) + If this variable is read-only (config: false) in the + source YANG file, then _set_generic is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_generic() directly. + + YANG Description: TE label specified in a generic format. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """generic must be of a type compatible with rt-types:generalized-label""", + 'defined-type': "rt-types:generalized-label", + 'generated-type': """YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=False)""", + }) + + self.__generic = t + if hasattr(self, '_set'): + self._set() + + def _unset_generic(self): + self.__generic = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=False) + + + def _get_otn(self): + """ + Getter method for otn, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/label_restriction/label_start/te_label/otn (container) + + YANG Description: Label start or label end for OTN. + """ + return self.__otn + + def _set_otn(self, v, load=False): + """ + Setter method for otn, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/label_restriction/label_start/te_label/otn (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_otn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_otn() directly. + + YANG Description: Label start or label end for OTN. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """otn must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False)""", + }) + + self.__otn = t + if hasattr(self, '_set'): + self._set() + + def _unset_otn(self): + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False) + + + def _get_vlanid(self): + """ + Getter method for vlanid, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/label_restriction/label_start/te_label/vlanid (etht-types:vlanid) + + YANG Description: VLAN tag id. + """ + return self.__vlanid + + def _set_vlanid(self, v, load=False): + """ + Setter method for vlanid, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/label_restriction/label_start/te_label/vlanid (etht-types:vlanid) + If this variable is read-only (config: false) in the + source YANG file, then _set_vlanid is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_vlanid() directly. + + YANG Description: VLAN tag id. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """vlanid must be of a type compatible with etht-types:vlanid""", + 'defined-type': "etht-types:vlanid", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=False)""", + }) + + self.__vlanid = t + if hasattr(self, '_set'): + self._set() + + def _unset_vlanid(self): + self.__vlanid = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=False) + + + def _get_direction(self): + """ + Getter method for direction, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/label_restriction/label_start/te_label/direction (te-label-direction) + + YANG Description: Label direction. + """ + return self.__direction + + def _set_direction(self, v, load=False): + """ + Setter method for direction, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/label_restriction/label_start/te_label/direction (te-label-direction) + If this variable is read-only (config: false) in the + source YANG file, then _set_direction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_direction() directly. + + YANG Description: Label direction. + """ + 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={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """direction must be of a type compatible with te-label-direction""", + 'defined-type': "ietf-te-topology:te-label-direction", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=False)""", + }) + + self.__direction = t + if hasattr(self, '_set'): + self._set() + + def _unset_direction(self): + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=False) + + generic = __builtin__.property(_get_generic) + otn = __builtin__.property(_get_otn) + vlanid = __builtin__.property(_get_vlanid) + direction = __builtin__.property(_get_direction) + + __choices__ = {'technology': {'generic': ['generic'], 'otn': ['otn'], 'eth': ['vlanid']}} + _pyangbind_elements = OrderedDict([('generic', generic), ('otn', otn), ('vlanid', vlanid), ('direction', direction), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/label_restriction/label_start/te_label/otn/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/label_restriction/label_start/te_label/otn/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..ad22f6a1525b4023d92360870cbe758a06dc3566 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/label_restriction/label_start/te_label/otn/__init__.py @@ -0,0 +1,154 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 otn(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/label-restrictions/label-restriction/label-start/te-label/otn. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Label start or label end for OTN. + """ + __slots__ = ('_path_helper', '_extmethods', '__tpn','__ts',) + + _yang_name = 'otn' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__tpn = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('range-type', 'trib-port'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=False) + self.__ts = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts", parent=self, choice=('range-type', 'trib-slot'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-ts', 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 ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'label-restrictions', 'label-restriction', 'label-start', 'te-label', 'otn'] + + def _get_tpn(self): + """ + Getter method for tpn, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/label_restriction/label_start/te_label/otn/tpn (otn-tpn) + + YANG Description: Tributary Port Number (TPN). + """ + return self.__tpn + + def _set_tpn(self, v, load=False): + """ + Setter method for tpn, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/label_restriction/label_start/te_label/otn/tpn (otn-tpn) + If this variable is read-only (config: false) in the + source YANG file, then _set_tpn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tpn() directly. + + YANG Description: Tributary Port Number (TPN). + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('range-type', 'trib-port'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tpn must be of a type compatible with otn-tpn""", + 'defined-type': "ietf-otn-topology:otn-tpn", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('range-type', 'trib-port'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=False)""", + }) + + self.__tpn = t + if hasattr(self, '_set'): + self._set() + + def _unset_tpn(self): + self.__tpn = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('range-type', 'trib-port'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=False) + + + def _get_ts(self): + """ + Getter method for ts, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/label_restriction/label_start/te_label/otn/ts (otn-ts) + + YANG Description: Tributary Slot (TS) number. + """ + return self.__ts + + def _set_ts(self, v, load=False): + """ + Setter method for ts, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/label_restriction/label_start/te_label/otn/ts (otn-ts) + If this variable is read-only (config: false) in the + source YANG file, then _set_ts is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_ts() directly. + + YANG Description: Tributary Slot (TS) number. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts", parent=self, choice=('range-type', 'trib-slot'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-ts', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """ts must be of a type compatible with otn-ts""", + 'defined-type': "ietf-otn-topology:otn-ts", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts", parent=self, choice=('range-type', 'trib-slot'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-ts', is_config=False)""", + }) + + self.__ts = t + if hasattr(self, '_set'): + self._set() + + def _unset_ts(self): + self.__ts = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts", parent=self, choice=('range-type', 'trib-slot'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-ts', is_config=False) + + tpn = __builtin__.property(_get_tpn) + ts = __builtin__.property(_get_ts) + + __choices__ = {'range-type': {'trib-port': ['tpn'], 'trib-slot': ['ts']}} + _pyangbind_elements = OrderedDict([('tpn', tpn), ('ts', ts), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/label_restriction/label_step/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/label_restriction/label_step/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..42085f541bcef1d3b09ca52af3574985b0df17a7 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/label_restriction/label_step/__init__.py @@ -0,0 +1,200 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 otn +class label_step(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/label-restrictions/label-restriction/label-step. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: The step increment between labels in the label range. +The label start/end values will have to be consistent +with the sign of label step. For example, +'label-start' < 'label-end' enforces 'label-step' > 0 +'label-start' > 'label-end' enforces 'label-step' < 0. + """ + __slots__ = ('_path_helper', '_extmethods', '__generic','__otn','__eth_step',) + + _yang_name = 'label-step' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__generic = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['-2147483648..2147483647']}, int_size=32), default=RestrictedClassType(base_type=long, restriction_dict={'range': ['-2147483648..2147483647']}, int_size=32)(1), is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='int32', is_config=False) + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False) + self.__eth_step = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), default=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16)(1), is_leaf=True, yang_name="eth-step", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint16', 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 ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'label-restrictions', 'label-restriction', 'label-step'] + + def _get_generic(self): + """ + Getter method for generic, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/label_restriction/label_step/generic (int32) + + YANG Description: Label range step. + """ + return self.__generic + + def _set_generic(self, v, load=False): + """ + Setter method for generic, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/label_restriction/label_step/generic (int32) + If this variable is read-only (config: false) in the + source YANG file, then _set_generic is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_generic() directly. + + YANG Description: Label range step. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['-2147483648..2147483647']}, int_size=32), default=RestrictedClassType(base_type=long, restriction_dict={'range': ['-2147483648..2147483647']}, int_size=32)(1), is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='int32', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """generic must be of a type compatible with int32""", + 'defined-type': "int32", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['-2147483648..2147483647']}, int_size=32), default=RestrictedClassType(base_type=long, restriction_dict={'range': ['-2147483648..2147483647']}, int_size=32)(1), is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='int32', is_config=False)""", + }) + + self.__generic = t + if hasattr(self, '_set'): + self._set() + + def _unset_generic(self): + self.__generic = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['-2147483648..2147483647']}, int_size=32), default=RestrictedClassType(base_type=long, restriction_dict={'range': ['-2147483648..2147483647']}, int_size=32)(1), is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='int32', is_config=False) + + + def _get_otn(self): + """ + Getter method for otn, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/label_restriction/label_step/otn (container) + + YANG Description: Label step for OTN + """ + return self.__otn + + def _set_otn(self, v, load=False): + """ + Setter method for otn, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/label_restriction/label_step/otn (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_otn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_otn() directly. + + YANG Description: Label step for OTN + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """otn must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False)""", + }) + + self.__otn = t + if hasattr(self, '_set'): + self._set() + + def _unset_otn(self): + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False) + + + def _get_eth_step(self): + """ + Getter method for eth_step, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/label_restriction/label_step/eth_step (uint16) + + YANG Description: Label step which represent possible increments for +an Ethernet VLAN tag. + """ + return self.__eth_step + + def _set_eth_step(self, v, load=False): + """ + Setter method for eth_step, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/label_restriction/label_step/eth_step (uint16) + If this variable is read-only (config: false) in the + source YANG file, then _set_eth_step is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_eth_step() directly. + + YANG Description: Label step which represent possible increments for +an Ethernet VLAN tag. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), default=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16)(1), is_leaf=True, yang_name="eth-step", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint16', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """eth_step must be of a type compatible with uint16""", + 'defined-type': "uint16", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), default=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16)(1), is_leaf=True, yang_name="eth-step", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint16', is_config=False)""", + }) + + self.__eth_step = t + if hasattr(self, '_set'): + self._set() + + def _unset_eth_step(self): + self.__eth_step = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), default=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16)(1), is_leaf=True, yang_name="eth-step", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint16', is_config=False) + + generic = __builtin__.property(_get_generic) + otn = __builtin__.property(_get_otn) + eth_step = __builtin__.property(_get_eth_step) + + __choices__ = {'technology': {'generic': ['generic'], 'otn': ['otn'], 'eth': ['eth_step']}} + _pyangbind_elements = OrderedDict([('generic', generic), ('otn', otn), ('eth_step', eth_step), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/label_restriction/label_step/otn/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/label_restriction/label_step/otn/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..138aacf1b355262ce5289a44e237e6a3b9d21278 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/label_restriction/label_step/otn/__init__.py @@ -0,0 +1,158 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 otn(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/label-restrictions/label-restriction/label-step/otn. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Label step for OTN + """ + __slots__ = ('_path_helper', '_extmethods', '__tpn','__ts',) + + _yang_name = 'otn' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__tpn = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('range-type', 'trib-port'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=False) + self.__ts = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts", parent=self, choice=('range-type', 'trib-slot'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-ts', 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 ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'label-restrictions', 'label-restriction', 'label-step', 'otn'] + + def _get_tpn(self): + """ + Getter method for tpn, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/label_restriction/label_step/otn/tpn (otn-tpn) + + YANG Description: Label step which represents possible increments for +Tributary Port Number (TPN). + """ + return self.__tpn + + def _set_tpn(self, v, load=False): + """ + Setter method for tpn, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/label_restriction/label_step/otn/tpn (otn-tpn) + If this variable is read-only (config: false) in the + source YANG file, then _set_tpn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tpn() directly. + + YANG Description: Label step which represents possible increments for +Tributary Port Number (TPN). + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('range-type', 'trib-port'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tpn must be of a type compatible with otn-tpn""", + 'defined-type': "ietf-otn-topology:otn-tpn", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('range-type', 'trib-port'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=False)""", + }) + + self.__tpn = t + if hasattr(self, '_set'): + self._set() + + def _unset_tpn(self): + self.__tpn = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('range-type', 'trib-port'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=False) + + + def _get_ts(self): + """ + Getter method for ts, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/label_restriction/label_step/otn/ts (otn-ts) + + YANG Description: Label step which represents possible increments for +Tributary Slot (TS) number. + """ + return self.__ts + + def _set_ts(self, v, load=False): + """ + Setter method for ts, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/label_restriction/label_step/otn/ts (otn-ts) + If this variable is read-only (config: false) in the + source YANG file, then _set_ts is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_ts() directly. + + YANG Description: Label step which represents possible increments for +Tributary Slot (TS) number. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts", parent=self, choice=('range-type', 'trib-slot'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-ts', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """ts must be of a type compatible with otn-ts""", + 'defined-type': "ietf-otn-topology:otn-ts", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts", parent=self, choice=('range-type', 'trib-slot'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-ts', is_config=False)""", + }) + + self.__ts = t + if hasattr(self, '_set'): + self._set() + + def _unset_ts(self): + self.__ts = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts", parent=self, choice=('range-type', 'trib-slot'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-ts', is_config=False) + + tpn = __builtin__.property(_get_tpn) + ts = __builtin__.property(_get_ts) + + __choices__ = {'range-type': {'trib-port': ['tpn'], 'trib-slot': ['ts']}} + _pyangbind_elements = OrderedDict([('tpn', tpn), ('ts', ts), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/label_restriction/otn_label_range/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/label_restriction/otn_label_range/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..b951f71cba2de3f0fe8ee95b5f197ca2dcd856a7 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/label_restriction/otn_label_range/__init__.py @@ -0,0 +1,256 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 otn_label_range(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/label-restrictions/label-restriction/otn-label-range. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Label range information for OTN. + """ + __slots__ = ('_path_helper', '_extmethods', '__range_type','__tsg','__odu_type_list','__priority',) + + _yang_name = 'otn-label-range' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__range_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'trib-slot': {}, 'trib-port': {}},), is_leaf=True, yang_name="range-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-label-range-type', is_config=False) + self.__tsg = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=False) + self.__odu_type_list = YANGDynClass(unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},)), is_leaf=False, yang_name="odu-type-list", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=False) + self.__priority = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..7']}), is_leaf=True, yang_name="priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', 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 ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'label-restrictions', 'label-restriction', 'otn-label-range'] + + def _get_range_type(self): + """ + Getter method for range_type, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/label_restriction/otn_label_range/range_type (otn-label-range-type) + + YANG Description: The type of range (e.g., TPN or TS) +to which the label range applies + """ + return self.__range_type + + def _set_range_type(self, v, load=False): + """ + Setter method for range_type, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/label_restriction/otn_label_range/range_type (otn-label-range-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_range_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_range_type() directly. + + YANG Description: The type of range (e.g., TPN or TS) +to which the label range applies + """ + 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={'trib-slot': {}, 'trib-port': {}},), is_leaf=True, yang_name="range-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-label-range-type', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """range_type must be of a type compatible with otn-label-range-type""", + 'defined-type': "ietf-otn-topology:otn-label-range-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'trib-slot': {}, 'trib-port': {}},), is_leaf=True, yang_name="range-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-label-range-type', is_config=False)""", + }) + + self.__range_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_range_type(self): + self.__range_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'trib-slot': {}, 'trib-port': {}},), is_leaf=True, yang_name="range-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-label-range-type', is_config=False) + + + def _get_tsg(self): + """ + Getter method for tsg, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/label_restriction/otn_label_range/tsg (identityref) + + YANG Description: Tributary slot granularity (TSG) to which the label range +applies. + +This leaf MUST be present when the range-type is TS. + +This leaf MAY be omitted when mapping an ODUk over an OTUk +Link. In this case the range-type is tpn, with only one +entry (ODUk), and the tpn range has only one value (1). + """ + return self.__tsg + + def _set_tsg(self, v, load=False): + """ + Setter method for tsg, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/label_restriction/otn_label_range/tsg (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_tsg is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tsg() directly. + + YANG Description: Tributary slot granularity (TSG) to which the label range +applies. + +This leaf MUST be present when the range-type is TS. + +This leaf MAY be omitted when mapping an ODUk over an OTUk +Link. In this case the range-type is tpn, with only one +entry (ODUk), and the tpn range has only one value (1). + """ + 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={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tsg must be of a type compatible with identityref""", + 'defined-type': "ietf-otn-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=False)""", + }) + + self.__tsg = t + if hasattr(self, '_set'): + self._set() + + def _unset_tsg(self): + self.__tsg = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=False) + + + def _get_odu_type_list(self): + """ + Getter method for odu_type_list, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/label_restriction/otn_label_range/odu_type_list (identityref) + + YANG Description: List of ODU types to which the label range applies. + +An Empty odu-type-list means that the label range +applies to all the supported ODU types. + """ + return self.__odu_type_list + + def _set_odu_type_list(self, v, load=False): + """ + Setter method for odu_type_list, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/label_restriction/otn_label_range/odu_type_list (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_odu_type_list is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_odu_type_list() directly. + + YANG Description: List of ODU types to which the label range applies. + +An Empty odu-type-list means that the label range +applies to all the supported ODU types. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},)), is_leaf=False, yang_name="odu-type-list", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """odu_type_list must be of a type compatible with identityref""", + 'defined-type': "ietf-otn-topology:identityref", + 'generated-type': """YANGDynClass(unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},)), is_leaf=False, yang_name="odu-type-list", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=False)""", + }) + + self.__odu_type_list = t + if hasattr(self, '_set'): + self._set() + + def _unset_odu_type_list(self): + self.__odu_type_list = YANGDynClass(unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},)), is_leaf=False, yang_name="odu-type-list", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=False) + + + def _get_priority(self): + """ + Getter method for priority, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/label_restriction/otn_label_range/priority (uint8) + + YANG Description: Priority in Interface Switching Capability +Descriptor (ISCD). + """ + return self.__priority + + def _set_priority(self, v, load=False): + """ + Setter method for priority, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/label_restriction/otn_label_range/priority (uint8) + If this variable is read-only (config: false) in the + source YANG file, then _set_priority is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_priority() directly. + + YANG Description: Priority in Interface Switching Capability +Descriptor (ISCD). + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..7']}), is_leaf=True, yang_name="priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint8', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """priority must be of a type compatible with uint8""", + 'defined-type': "uint8", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..7']}), is_leaf=True, yang_name="priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint8', is_config=False)""", + }) + + self.__priority = t + if hasattr(self, '_set'): + self._set() + + def _unset_priority(self): + self.__priority = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..7']}), is_leaf=True, yang_name="priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint8', is_config=False) + + range_type = __builtin__.property(_get_range_type) + tsg = __builtin__.property(_get_tsg) + odu_type_list = __builtin__.property(_get_odu_type_list) + priority = __builtin__.property(_get_priority) + + + _pyangbind_elements = OrderedDict([('range_type', range_type), ('tsg', tsg), ('odu_type_list', odu_type_list), ('priority', priority), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..a561f8138342940ab3183618f6add0ee154b46d8 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/__init__.py @@ -0,0 +1,199 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 optimization_metric +from . import tiebreakers +from . import objective_function +class optimizations(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/optimizations. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: The objective function container that includes +attributes to impose when computing a TE path. + """ + __slots__ = ('_path_helper', '_extmethods', '__optimization_metric','__tiebreakers','__objective_function',) + + _yang_name = 'optimizations' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__optimization_metric = YANGDynClass(base=YANGListType("metric_type",optimization_metric.optimization_metric, yang_name="optimization-metric", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='metric-type', extensions=None, choice=False), is_container='list', yang_name="optimization-metric", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + self.__tiebreakers = YANGDynClass(base=tiebreakers.tiebreakers, is_container='container', yang_name="tiebreakers", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__objective_function = YANGDynClass(base=objective_function.objective_function, is_container='container', yang_name="objective-function", parent=self, choice=('algorithm', 'objective-function'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', 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 ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'optimizations'] + + def _get_optimization_metric(self): + """ + Getter method for optimization_metric, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric (list) + + YANG Description: TE path metric type. + """ + return self.__optimization_metric + + def _set_optimization_metric(self, v, load=False): + """ + Setter method for optimization_metric, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_optimization_metric is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_optimization_metric() directly. + + YANG Description: TE path metric type. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("metric_type",optimization_metric.optimization_metric, yang_name="optimization-metric", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='metric-type', extensions=None, choice=False), is_container='list', yang_name="optimization-metric", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """optimization_metric must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("metric_type",optimization_metric.optimization_metric, yang_name="optimization-metric", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='metric-type', extensions=None, choice=False), is_container='list', yang_name="optimization-metric", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False)""", + }) + + self.__optimization_metric = t + if hasattr(self, '_set'): + self._set() + + def _unset_optimization_metric(self): + self.__optimization_metric = YANGDynClass(base=YANGListType("metric_type",optimization_metric.optimization_metric, yang_name="optimization-metric", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='metric-type', extensions=None, choice=False), is_container='list', yang_name="optimization-metric", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + + + def _get_tiebreakers(self): + """ + Getter method for tiebreakers, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/tiebreakers (container) + + YANG Description: Container for the list of tiebreakers. + """ + return self.__tiebreakers + + def _set_tiebreakers(self, v, load=False): + """ + Setter method for tiebreakers, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/tiebreakers (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_tiebreakers is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tiebreakers() directly. + + YANG Description: Container for the list of tiebreakers. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=tiebreakers.tiebreakers, is_container='container', yang_name="tiebreakers", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tiebreakers must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=tiebreakers.tiebreakers, is_container='container', yang_name="tiebreakers", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__tiebreakers = t + if hasattr(self, '_set'): + self._set() + + def _unset_tiebreakers(self): + self.__tiebreakers = YANGDynClass(base=tiebreakers.tiebreakers, is_container='container', yang_name="tiebreakers", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_objective_function(self): + """ + Getter method for objective_function, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/objective_function (container) + + YANG Description: The objective function container that includes +attributes to impose when computing a TE path. + """ + return self.__objective_function + + def _set_objective_function(self, v, load=False): + """ + Setter method for objective_function, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/objective_function (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_objective_function is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_objective_function() directly. + + YANG Description: The objective function container that includes +attributes to impose when computing a TE path. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=objective_function.objective_function, is_container='container', yang_name="objective-function", parent=self, choice=('algorithm', 'objective-function'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """objective_function must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=objective_function.objective_function, is_container='container', yang_name="objective-function", parent=self, choice=('algorithm', 'objective-function'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__objective_function = t + if hasattr(self, '_set'): + self._set() + + def _unset_objective_function(self): + self.__objective_function = YANGDynClass(base=objective_function.objective_function, is_container='container', yang_name="objective-function", parent=self, choice=('algorithm', 'objective-function'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + optimization_metric = __builtin__.property(_get_optimization_metric) + tiebreakers = __builtin__.property(_get_tiebreakers) + objective_function = __builtin__.property(_get_objective_function) + + __choices__ = {'algorithm': {'metric': ['optimization_metric', 'tiebreakers'], 'objective-function': ['objective_function']}} + _pyangbind_elements = OrderedDict([('optimization_metric', optimization_metric), ('tiebreakers', tiebreakers), ('objective_function', objective_function), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/objective_function/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/objective_function/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..a5742ea3002afa82d4263d295667918e31d3ffec --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/objective_function/__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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 objective_function(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/optimizations/objective-function. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: The objective function container that includes +attributes to impose when computing a TE path. + """ + __slots__ = ('_path_helper', '_extmethods', '__objective_function_type',) + + _yang_name = 'objective-function' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__objective_function_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'of-minimize-cost-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-cost-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-cost-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-minimize-load-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-load-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-load-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-maximize-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-maximize-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-maximize-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-minimize-agg-bandwidth-consumption': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-agg-bandwidth-consumption': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-agg-bandwidth-consumption': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-minimize-load-most-loaded-link': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-load-most-loaded-link': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-load-most-loaded-link': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-minimize-cost-path-set': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-cost-path-set': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-cost-path-set': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), default=six.text_type("te-types:of-minimize-cost-path"), is_leaf=True, yang_name="objective-function-type", parent=self, choice=('algorithm', 'objective-function'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', 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 ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'optimizations', 'objective-function'] + + def _get_objective_function_type(self): + """ + Getter method for objective_function_type, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/objective_function/objective_function_type (identityref) + + YANG Description: Objective function entry. + """ + return self.__objective_function_type + + def _set_objective_function_type(self, v, load=False): + """ + Setter method for objective_function_type, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/objective_function/objective_function_type (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_objective_function_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_objective_function_type() directly. + + YANG Description: Objective function entry. + """ + 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={'of-minimize-cost-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-cost-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-cost-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-minimize-load-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-load-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-load-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-maximize-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-maximize-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-maximize-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-minimize-agg-bandwidth-consumption': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-agg-bandwidth-consumption': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-agg-bandwidth-consumption': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-minimize-load-most-loaded-link': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-load-most-loaded-link': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-load-most-loaded-link': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-minimize-cost-path-set': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-cost-path-set': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-cost-path-set': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), default=six.text_type("te-types:of-minimize-cost-path"), is_leaf=True, yang_name="objective-function-type", parent=self, choice=('algorithm', 'objective-function'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """objective_function_type must be of a type compatible with identityref""", + 'defined-type': "ietf-te-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'of-minimize-cost-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-cost-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-cost-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-minimize-load-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-load-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-load-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-maximize-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-maximize-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-maximize-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-minimize-agg-bandwidth-consumption': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-agg-bandwidth-consumption': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-agg-bandwidth-consumption': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-minimize-load-most-loaded-link': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-load-most-loaded-link': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-load-most-loaded-link': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-minimize-cost-path-set': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-cost-path-set': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-cost-path-set': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), default=six.text_type("te-types:of-minimize-cost-path"), is_leaf=True, yang_name="objective-function-type", parent=self, choice=('algorithm', 'objective-function'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False)""", + }) + + self.__objective_function_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_objective_function_type(self): + self.__objective_function_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'of-minimize-cost-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-cost-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-cost-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-minimize-load-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-load-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-load-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-maximize-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-maximize-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-maximize-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-minimize-agg-bandwidth-consumption': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-agg-bandwidth-consumption': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-agg-bandwidth-consumption': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-minimize-load-most-loaded-link': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-load-most-loaded-link': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-load-most-loaded-link': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-minimize-cost-path-set': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-cost-path-set': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-cost-path-set': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), default=six.text_type("te-types:of-minimize-cost-path"), is_leaf=True, yang_name="objective-function-type", parent=self, choice=('algorithm', 'objective-function'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + + objective_function_type = __builtin__.property(_get_objective_function_type) + + __choices__ = {'algorithm': {'objective-function': ['objective_function_type']}} + _pyangbind_elements = OrderedDict([('objective_function_type', objective_function_type), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..de3425526bf502146628f83fc80526b1867f3ff0 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/__init__.py @@ -0,0 +1,241 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 explicit_route_exclude_objects +from . import explicit_route_include_objects +class optimization_metric(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/optimizations/optimization-metric. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: TE path metric type. + """ + __slots__ = ('_path_helper', '_extmethods', '__metric_type','__weight','__explicit_route_exclude_objects','__explicit_route_include_objects',) + + _yang_name = 'optimization-metric' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__metric_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="metric-type", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + self.__weight = YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), default=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8)(1), is_leaf=True, yang_name="weight", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint8', is_config=False) + self.__explicit_route_exclude_objects = YANGDynClass(base=explicit_route_exclude_objects.explicit_route_exclude_objects, is_container='container', yang_name="explicit-route-exclude-objects", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__explicit_route_include_objects = YANGDynClass(base=explicit_route_include_objects.explicit_route_include_objects, is_container='container', yang_name="explicit-route-include-objects", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', 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 ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'optimizations', 'optimization-metric'] + + def _get_metric_type(self): + """ + Getter method for metric_type, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/metric_type (identityref) + + YANG Description: Identifies the 'metric-type' that the path computation +process uses for optimization. + """ + return self.__metric_type + + def _set_metric_type(self, v, load=False): + """ + Setter method for metric_type, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/metric_type (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_metric_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_metric_type() directly. + + YANG Description: Identifies the 'metric-type' that the path computation +process uses for optimization. + """ + 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=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="metric-type", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """metric_type must be of a type compatible with identityref""", + 'defined-type': "ietf-te-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="metric-type", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False)""", + }) + + self.__metric_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_metric_type(self): + self.__metric_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="metric-type", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + + + def _get_weight(self): + """ + Getter method for weight, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/weight (uint8) + + YANG Description: TE path metric normalization weight. + """ + return self.__weight + + def _set_weight(self, v, load=False): + """ + Setter method for weight, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/weight (uint8) + If this variable is read-only (config: false) in the + source YANG file, then _set_weight is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_weight() directly. + + YANG Description: TE path metric normalization weight. + """ + 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), default=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8)(1), is_leaf=True, yang_name="weight", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint8', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """weight 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), default=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8)(1), is_leaf=True, yang_name="weight", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint8', is_config=False)""", + }) + + self.__weight = t + if hasattr(self, '_set'): + self._set() + + def _unset_weight(self): + self.__weight = YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), default=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8)(1), is_leaf=True, yang_name="weight", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint8', is_config=False) + + + def _get_explicit_route_exclude_objects(self): + """ + Getter method for explicit_route_exclude_objects, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects (container) + + YANG Description: Container for the 'exclude route' object list. + """ + return self.__explicit_route_exclude_objects + + def _set_explicit_route_exclude_objects(self, v, load=False): + """ + Setter method for explicit_route_exclude_objects, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_explicit_route_exclude_objects is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_explicit_route_exclude_objects() directly. + + YANG Description: Container for the 'exclude route' object list. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=explicit_route_exclude_objects.explicit_route_exclude_objects, is_container='container', yang_name="explicit-route-exclude-objects", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """explicit_route_exclude_objects must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=explicit_route_exclude_objects.explicit_route_exclude_objects, is_container='container', yang_name="explicit-route-exclude-objects", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__explicit_route_exclude_objects = t + if hasattr(self, '_set'): + self._set() + + def _unset_explicit_route_exclude_objects(self): + self.__explicit_route_exclude_objects = YANGDynClass(base=explicit_route_exclude_objects.explicit_route_exclude_objects, is_container='container', yang_name="explicit-route-exclude-objects", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_explicit_route_include_objects(self): + """ + Getter method for explicit_route_include_objects, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects (container) + + YANG Description: Container for the 'include route' object list. + """ + return self.__explicit_route_include_objects + + def _set_explicit_route_include_objects(self, v, load=False): + """ + Setter method for explicit_route_include_objects, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_explicit_route_include_objects is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_explicit_route_include_objects() directly. + + YANG Description: Container for the 'include route' object list. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=explicit_route_include_objects.explicit_route_include_objects, is_container='container', yang_name="explicit-route-include-objects", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """explicit_route_include_objects must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=explicit_route_include_objects.explicit_route_include_objects, is_container='container', yang_name="explicit-route-include-objects", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__explicit_route_include_objects = t + if hasattr(self, '_set'): + self._set() + + def _unset_explicit_route_include_objects(self): + self.__explicit_route_include_objects = YANGDynClass(base=explicit_route_include_objects.explicit_route_include_objects, is_container='container', yang_name="explicit-route-include-objects", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + metric_type = __builtin__.property(_get_metric_type) + weight = __builtin__.property(_get_weight) + explicit_route_exclude_objects = __builtin__.property(_get_explicit_route_exclude_objects) + explicit_route_include_objects = __builtin__.property(_get_explicit_route_include_objects) + + __choices__ = {'algorithm': {'metric': ['metric_type', 'weight', 'explicit_route_exclude_objects', 'explicit_route_include_objects']}} + _pyangbind_elements = OrderedDict([('metric_type', metric_type), ('weight', weight), ('explicit_route_exclude_objects', explicit_route_exclude_objects), ('explicit_route_include_objects', explicit_route_include_objects), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..6df6741a983f17df9525a546bcc24f6392f9a5f8 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/__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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 route_object_exclude_object +class explicit_route_exclude_objects(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/optimizations/optimization-metric/explicit-route-exclude-objects. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Container for the 'exclude route' object list. + """ + __slots__ = ('_path_helper', '_extmethods', '__route_object_exclude_object',) + + _yang_name = 'explicit-route-exclude-objects' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__route_object_exclude_object = YANGDynClass(base=YANGListType("index",route_object_exclude_object.route_object_exclude_object, yang_name="route-object-exclude-object", parent=self, is_container='list', user_ordered=True, path_helper=self._path_helper, yang_keys='index', extensions=None, choice=('algorithm', 'metric')), is_container='list', yang_name="route-object-exclude-object", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', 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 ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'optimizations', 'optimization-metric', 'explicit-route-exclude-objects'] + + def _get_route_object_exclude_object(self): + """ + Getter method for route_object_exclude_object, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object (list) + + YANG Description: List of Explicit Route Objects to be excluded in the +path computation. + """ + return self.__route_object_exclude_object + + def _set_route_object_exclude_object(self, v, load=False): + """ + Setter method for route_object_exclude_object, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_route_object_exclude_object is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_route_object_exclude_object() directly. + + YANG Description: List of Explicit Route Objects to be excluded in the +path computation. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("index",route_object_exclude_object.route_object_exclude_object, yang_name="route-object-exclude-object", parent=self, is_container='list', user_ordered=True, path_helper=self._path_helper, yang_keys='index', extensions=None, choice=('algorithm', 'metric')), is_container='list', yang_name="route-object-exclude-object", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """route_object_exclude_object must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("index",route_object_exclude_object.route_object_exclude_object, yang_name="route-object-exclude-object", parent=self, is_container='list', user_ordered=True, path_helper=self._path_helper, yang_keys='index', extensions=None, choice=('algorithm', 'metric')), is_container='list', yang_name="route-object-exclude-object", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False)""", + }) + + self.__route_object_exclude_object = t + if hasattr(self, '_set'): + self._set() + + def _unset_route_object_exclude_object(self): + self.__route_object_exclude_object = YANGDynClass(base=YANGListType("index",route_object_exclude_object.route_object_exclude_object, yang_name="route-object-exclude-object", parent=self, is_container='list', user_ordered=True, path_helper=self._path_helper, yang_keys='index', extensions=None, choice=('algorithm', 'metric')), is_container='list', yang_name="route-object-exclude-object", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + + route_object_exclude_object = __builtin__.property(_get_route_object_exclude_object) + + __choices__ = {'algorithm': {'metric': ['route_object_exclude_object']}} + _pyangbind_elements = OrderedDict([('route_object_exclude_object', route_object_exclude_object), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..66415fe3b314536e9002f7a0276f0ef532da821c --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/__init__.py @@ -0,0 +1,365 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 numbered_node_hop +from . import numbered_link_hop +from . import unnumbered_link_hop +from . import as_number_hop +from . import label_hop +from . import srlg +class route_object_exclude_object(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/optimizations/optimization-metric/explicit-route-exclude-objects/route-object-exclude-object. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: List of Explicit Route Objects to be excluded in the +path computation. + """ + __slots__ = ('_path_helper', '_extmethods', '__index','__numbered_node_hop','__numbered_link_hop','__unnumbered_link_hop','__as_number_hop','__label_hop','__srlg',) + + _yang_name = 'route-object-exclude-object' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _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), is_leaf=True, yang_name="index", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=False) + self.__numbered_node_hop = YANGDynClass(base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__numbered_link_hop = YANGDynClass(base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__unnumbered_link_hop = YANGDynClass(base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__as_number_hop = YANGDynClass(base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__label_hop = YANGDynClass(base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__srlg = YANGDynClass(base=srlg.srlg, is_container='container', yang_name="srlg", parent=self, choice=('type', 'srlg'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', 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 ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'optimizations', 'optimization-metric', 'explicit-route-exclude-objects', 'route-object-exclude-object'] + + def _get_index(self): + """ + Getter method for index, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/index (uint32) + + YANG Description: Route object entry index. The index is used to +identify an entry in the list. The order of entries +is defined by the user without relying on key values. + """ + return self.__index + + def _set_index(self, v, load=False): + """ + Setter method for index, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/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: Route object entry index. The index is used to +identify an entry in the list. The order of entries +is defined by the user without relying on key values. + """ + 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=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="index", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', 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), is_leaf=True, yang_name="index", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', 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), is_leaf=True, yang_name="index", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=False) + + + def _get_numbered_node_hop(self): + """ + Getter method for numbered_node_hop, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/numbered_node_hop (container) + + YANG Description: Numbered node route hop. + """ + return self.__numbered_node_hop + + def _set_numbered_node_hop(self, v, load=False): + """ + Setter method for numbered_node_hop, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/numbered_node_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_numbered_node_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_numbered_node_hop() directly. + + YANG Description: Numbered node route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """numbered_node_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__numbered_node_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_numbered_node_hop(self): + self.__numbered_node_hop = YANGDynClass(base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_numbered_link_hop(self): + """ + Getter method for numbered_link_hop, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/numbered_link_hop (container) + + YANG Description: Numbered link explicit route hop. + """ + return self.__numbered_link_hop + + def _set_numbered_link_hop(self, v, load=False): + """ + Setter method for numbered_link_hop, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/numbered_link_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_numbered_link_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_numbered_link_hop() directly. + + YANG Description: Numbered link explicit route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """numbered_link_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__numbered_link_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_numbered_link_hop(self): + self.__numbered_link_hop = YANGDynClass(base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_unnumbered_link_hop(self): + """ + Getter method for unnumbered_link_hop, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/unnumbered_link_hop (container) + + YANG Description: Unnumbered link explicit route hop. + """ + return self.__unnumbered_link_hop + + def _set_unnumbered_link_hop(self, v, load=False): + """ + Setter method for unnumbered_link_hop, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/unnumbered_link_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_unnumbered_link_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_unnumbered_link_hop() directly. + + YANG Description: Unnumbered link explicit route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """unnumbered_link_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__unnumbered_link_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_unnumbered_link_hop(self): + self.__unnumbered_link_hop = YANGDynClass(base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_as_number_hop(self): + """ + Getter method for as_number_hop, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/as_number_hop (container) + + YANG Description: AS explicit route hop. + """ + return self.__as_number_hop + + def _set_as_number_hop(self, v, load=False): + """ + Setter method for as_number_hop, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/as_number_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_as_number_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_as_number_hop() directly. + + YANG Description: AS explicit route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """as_number_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__as_number_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_as_number_hop(self): + self.__as_number_hop = YANGDynClass(base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_label_hop(self): + """ + Getter method for label_hop, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop (container) + + YANG Description: Label hop type. + """ + return self.__label_hop + + def _set_label_hop(self, v, load=False): + """ + Setter method for label_hop, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_label_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_label_hop() directly. + + YANG Description: Label hop type. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """label_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__label_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_label_hop(self): + self.__label_hop = YANGDynClass(base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_srlg(self): + """ + Getter method for srlg, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/srlg (container) + + YANG Description: SRLG container. + """ + return self.__srlg + + def _set_srlg(self, v, load=False): + """ + Setter method for srlg, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/srlg (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_srlg is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_srlg() directly. + + YANG Description: SRLG container. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=srlg.srlg, is_container='container', yang_name="srlg", parent=self, choice=('type', 'srlg'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """srlg must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=srlg.srlg, is_container='container', yang_name="srlg", parent=self, choice=('type', 'srlg'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__srlg = t + if hasattr(self, '_set'): + self._set() + + def _unset_srlg(self): + self.__srlg = YANGDynClass(base=srlg.srlg, is_container='container', yang_name="srlg", parent=self, choice=('type', 'srlg'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + index = __builtin__.property(_get_index) + numbered_node_hop = __builtin__.property(_get_numbered_node_hop) + numbered_link_hop = __builtin__.property(_get_numbered_link_hop) + unnumbered_link_hop = __builtin__.property(_get_unnumbered_link_hop) + as_number_hop = __builtin__.property(_get_as_number_hop) + label_hop = __builtin__.property(_get_label_hop) + srlg = __builtin__.property(_get_srlg) + + __choices__ = {'algorithm': {'metric': ['index']}, 'type': {'numbered-node-hop': ['numbered_node_hop'], 'numbered-link-hop': ['numbered_link_hop'], 'unnumbered-link-hop': ['unnumbered_link_hop'], 'as-number': ['as_number_hop'], 'label': ['label_hop'], 'srlg': ['srlg']}} + _pyangbind_elements = OrderedDict([('index', index), ('numbered_node_hop', numbered_node_hop), ('numbered_link_hop', numbered_link_hop), ('unnumbered_link_hop', unnumbered_link_hop), ('as_number_hop', as_number_hop), ('label_hop', label_hop), ('srlg', srlg), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/as_number_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/as_number_hop/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..267567f74521ce6b6ae6ba71a95183bebc1823b8 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/as_number_hop/__init__.py @@ -0,0 +1,154 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 as_number_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/optimizations/optimization-metric/explicit-route-exclude-objects/route-object-exclude-object/as-number-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: AS explicit route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__as_number','__hop_type',) + + _yang_name = 'as-number-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__as_number = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=False) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', 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 ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'optimizations', 'optimization-metric', 'explicit-route-exclude-objects', 'route-object-exclude-object', 'as-number-hop'] + + def _get_as_number(self): + """ + Getter method for as_number, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/as_number_hop/as_number (inet:as-number) + + YANG Description: The Autonomous System (AS) number. + """ + return self.__as_number + + def _set_as_number(self, v, load=False): + """ + Setter method for as_number, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/as_number_hop/as_number (inet:as-number) + If this variable is read-only (config: false) in the + source YANG file, then _set_as_number is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_as_number() directly. + + YANG Description: The Autonomous System (AS) number. + """ + 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="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """as_number must be of a type compatible with inet:as-number""", + 'defined-type': "inet:as-number", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=False)""", + }) + + self.__as_number = t + if hasattr(self, '_set'): + self._set() + + def _unset_as_number(self): + self.__as_number = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=False) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/as_number_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/as_number_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + 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={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + + as_number = __builtin__.property(_get_as_number) + hop_type = __builtin__.property(_get_hop_type) + + __choices__ = {'type': {'as-number': ['as_number', 'hop_type']}} + _pyangbind_elements = OrderedDict([('as_number', as_number), ('hop_type', hop_type), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..dfb42f946181c167785c0e3b563f8144ebd893c5 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/__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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 te_label +class label_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/optimizations/optimization-metric/explicit-route-exclude-objects/route-object-exclude-object/label-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Label hop type. + """ + __slots__ = ('_path_helper', '_extmethods', '__te_label',) + + _yang_name = 'label-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__te_label = YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', 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 ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'optimizations', 'optimization-metric', 'explicit-route-exclude-objects', 'route-object-exclude-object', 'label-hop'] + + def _get_te_label(self): + """ + Getter method for te_label, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label (container) + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + return self.__te_label + + def _set_te_label(self, v, load=False): + """ + Setter method for te_label, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_te_label is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_te_label() directly. + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """te_label must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__te_label = t + if hasattr(self, '_set'): + self._set() + + def _unset_te_label(self): + self.__te_label = YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + te_label = __builtin__.property(_get_te_label) + + __choices__ = {'type': {'label': ['te_label']}} + _pyangbind_elements = OrderedDict([('te_label', te_label), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..22dc3125e462c1a4216a16adbafed71103cdc1dd --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label/__init__.py @@ -0,0 +1,234 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 otn +class te_label(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/optimizations/optimization-metric/explicit-route-exclude-objects/route-object-exclude-object/label-hop/te-label. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + __slots__ = ('_path_helper', '_extmethods', '__generic','__otn','__vlanid','__direction',) + + _yang_name = 'te-label' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__generic = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=False) + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False) + self.__vlanid = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=False) + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', 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 ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'optimizations', 'optimization-metric', 'explicit-route-exclude-objects', 'route-object-exclude-object', 'label-hop', 'te-label'] + + def _get_generic(self): + """ + Getter method for generic, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label/generic (rt-types:generalized-label) + + YANG Description: TE label specified in a generic format. + """ + return self.__generic + + def _set_generic(self, v, load=False): + """ + Setter method for generic, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label/generic (rt-types:generalized-label) + If this variable is read-only (config: false) in the + source YANG file, then _set_generic is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_generic() directly. + + YANG Description: TE label specified in a generic format. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """generic must be of a type compatible with rt-types:generalized-label""", + 'defined-type': "rt-types:generalized-label", + 'generated-type': """YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=False)""", + }) + + self.__generic = t + if hasattr(self, '_set'): + self._set() + + def _unset_generic(self): + self.__generic = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=False) + + + def _get_otn(self): + """ + Getter method for otn, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label/otn (container) + + YANG Description: Label hop for OTN. + """ + return self.__otn + + def _set_otn(self, v, load=False): + """ + Setter method for otn, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label/otn (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_otn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_otn() directly. + + YANG Description: Label hop for OTN. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """otn must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False)""", + }) + + self.__otn = t + if hasattr(self, '_set'): + self._set() + + def _unset_otn(self): + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False) + + + def _get_vlanid(self): + """ + Getter method for vlanid, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label/vlanid (etht-types:vlanid) + + YANG Description: VLAN tag id. + """ + return self.__vlanid + + def _set_vlanid(self, v, load=False): + """ + Setter method for vlanid, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label/vlanid (etht-types:vlanid) + If this variable is read-only (config: false) in the + source YANG file, then _set_vlanid is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_vlanid() directly. + + YANG Description: VLAN tag id. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """vlanid must be of a type compatible with etht-types:vlanid""", + 'defined-type': "etht-types:vlanid", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=False)""", + }) + + self.__vlanid = t + if hasattr(self, '_set'): + self._set() + + def _unset_vlanid(self): + self.__vlanid = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=False) + + + def _get_direction(self): + """ + Getter method for direction, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label/direction (te-label-direction) + + YANG Description: Label direction. + """ + return self.__direction + + def _set_direction(self, v, load=False): + """ + Setter method for direction, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label/direction (te-label-direction) + If this variable is read-only (config: false) in the + source YANG file, then _set_direction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_direction() directly. + + YANG Description: Label direction. + """ + 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={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """direction must be of a type compatible with te-label-direction""", + 'defined-type': "ietf-te-topology:te-label-direction", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=False)""", + }) + + self.__direction = t + if hasattr(self, '_set'): + self._set() + + def _unset_direction(self): + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=False) + + generic = __builtin__.property(_get_generic) + otn = __builtin__.property(_get_otn) + vlanid = __builtin__.property(_get_vlanid) + direction = __builtin__.property(_get_direction) + + __choices__ = {'technology': {'generic': ['generic'], 'otn': ['otn'], 'eth': ['vlanid']}, 'type': {'label': ['direction']}} + _pyangbind_elements = OrderedDict([('generic', generic), ('otn', otn), ('vlanid', vlanid), ('direction', direction), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label/otn/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label/otn/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..68706941449f6359d729a9ca9a6062eebc717c72 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label/otn/__init__.py @@ -0,0 +1,209 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 otn(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/optimizations/optimization-metric/explicit-route-exclude-objects/route-object-exclude-object/label-hop/te-label/otn. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Label hop for OTN. + """ + __slots__ = ('_path_helper', '_extmethods', '__tpn','__tsg','__ts_list',) + + _yang_name = 'otn' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__tpn = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=False) + self.__tsg = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=False) + self.__ts_list = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', 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 ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'optimizations', 'optimization-metric', 'explicit-route-exclude-objects', 'route-object-exclude-object', 'label-hop', 'te-label', 'otn'] + + def _get_tpn(self): + """ + Getter method for tpn, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label/otn/tpn (otn-tpn) + + YANG Description: Tributary Port Number (TPN). + """ + return self.__tpn + + def _set_tpn(self, v, load=False): + """ + Setter method for tpn, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label/otn/tpn (otn-tpn) + If this variable is read-only (config: false) in the + source YANG file, then _set_tpn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tpn() directly. + + YANG Description: Tributary Port Number (TPN). + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tpn must be of a type compatible with otn-tpn""", + 'defined-type': "ietf-otn-topology:otn-tpn", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=False)""", + }) + + self.__tpn = t + if hasattr(self, '_set'): + self._set() + + def _unset_tpn(self): + self.__tpn = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=False) + + + def _get_tsg(self): + """ + Getter method for tsg, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label/otn/tsg (identityref) + + YANG Description: Tributary Slot Granularity (TSG). + """ + return self.__tsg + + def _set_tsg(self, v, load=False): + """ + Setter method for tsg, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label/otn/tsg (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_tsg is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tsg() directly. + + YANG Description: Tributary Slot Granularity (TSG). + """ + 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={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tsg must be of a type compatible with identityref""", + 'defined-type': "ietf-otn-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=False)""", + }) + + self.__tsg = t + if hasattr(self, '_set'): + self._set() + + def _unset_tsg(self): + self.__tsg = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=False) + + + def _get_ts_list(self): + """ + Getter method for ts_list, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label/otn/ts_list (string) + + YANG Description: A list of available Tributary Slots (TS) ranging + + + + +between 1 and 4095. If multiple values or +ranges are given, they all MUST be disjoint +and MUST be in ascending order. +For example 1-20,25,50-1000. + """ + return self.__ts_list + + def _set_ts_list(self, v, load=False): + """ + Setter method for ts_list, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label/otn/ts_list (string) + If this variable is read-only (config: false) in the + source YANG file, then _set_ts_list is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_ts_list() directly. + + YANG Description: A list of available Tributary Slots (TS) ranging + + + + +between 1 and 4095. If multiple values or +ranges are given, they all MUST be disjoint +and MUST be in ascending order. +For example 1-20,25,50-1000. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='string', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """ts_list must be of a type compatible with string""", + 'defined-type': "string", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='string', is_config=False)""", + }) + + self.__ts_list = t + if hasattr(self, '_set'): + self._set() + + def _unset_ts_list(self): + self.__ts_list = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='string', is_config=False) + + tpn = __builtin__.property(_get_tpn) + tsg = __builtin__.property(_get_tsg) + ts_list = __builtin__.property(_get_ts_list) + + __choices__ = {'technology': {'otn': ['tpn', 'tsg', 'ts_list']}} + _pyangbind_elements = OrderedDict([('tpn', tpn), ('tsg', tsg), ('ts_list', ts_list), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/numbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/numbered_link_hop/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..5981ace6489abb54c1b6951a02ab855ba6d8c09e --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/numbered_link_hop/__init__.py @@ -0,0 +1,193 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 numbered_link_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/optimizations/optimization-metric/explicit-route-exclude-objects/route-object-exclude-object/numbered-link-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Numbered link explicit route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__link_tp_id','__hop_type','__direction',) + + _yang_name = 'numbered-link-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=False) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', 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 ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'optimizations', 'optimization-metric', 'explicit-route-exclude-objects', 'route-object-exclude-object', 'numbered-link-hop'] + + def _get_link_tp_id(self): + """ + Getter method for link_tp_id, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/numbered_link_hop/link_tp_id (te-tp-id) + + YANG Description: TE Link Termination Point (LTP) identifier. + """ + return self.__link_tp_id + + def _set_link_tp_id(self, v, load=False): + """ + Setter method for link_tp_id, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/numbered_link_hop/link_tp_id (te-tp-id) + If this variable is read-only (config: false) in the + source YANG file, then _set_link_tp_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_link_tp_id() directly. + + YANG Description: TE Link Termination Point (LTP) identifier. + """ + 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),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """link_tp_id must be of a type compatible with te-tp-id""", + 'defined-type': "ietf-te-topology:te-tp-id", + 'generated-type': """YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=False)""", + }) + + self.__link_tp_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_link_tp_id(self): + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=False) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/numbered_link_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/numbered_link_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + 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={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + + + def _get_direction(self): + """ + Getter method for direction, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/numbered_link_hop/direction (te-link-direction) + + YANG Description: Link route object direction. + """ + return self.__direction + + def _set_direction(self, v, load=False): + """ + Setter method for direction, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/numbered_link_hop/direction (te-link-direction) + If this variable is read-only (config: false) in the + source YANG file, then _set_direction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_direction() directly. + + YANG Description: Link route object direction. + """ + 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={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """direction must be of a type compatible with te-link-direction""", + 'defined-type': "ietf-te-topology:te-link-direction", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=False)""", + }) + + self.__direction = t + if hasattr(self, '_set'): + self._set() + + def _unset_direction(self): + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=False) + + link_tp_id = __builtin__.property(_get_link_tp_id) + hop_type = __builtin__.property(_get_hop_type) + direction = __builtin__.property(_get_direction) + + __choices__ = {'type': {'numbered-link-hop': ['link_tp_id', 'hop_type', 'direction']}} + _pyangbind_elements = OrderedDict([('link_tp_id', link_tp_id), ('hop_type', hop_type), ('direction', direction), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/numbered_node_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/numbered_node_hop/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e42736cbe14ffb31bd0d0d2cc3a3e4c321b4804d --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/numbered_node_hop/__init__.py @@ -0,0 +1,154 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 numbered_node_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/optimizations/optimization-metric/explicit-route-exclude-objects/route-object-exclude-object/numbered-node-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Numbered node route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__node_id','__hop_type',) + + _yang_name = 'numbered-node-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=False) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', 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 ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'optimizations', 'optimization-metric', 'explicit-route-exclude-objects', 'route-object-exclude-object', 'numbered-node-hop'] + + def _get_node_id(self): + """ + Getter method for node_id, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/numbered_node_hop/node_id (te-node-id) + + YANG Description: The identifier of a node in the TE topology. + """ + return self.__node_id + + def _set_node_id(self, v, load=False): + """ + Setter method for node_id, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/numbered_node_hop/node_id (te-node-id) + 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. + + YANG Description: The identifier of a node in the TE topology. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """node_id must be of a type compatible with te-node-id""", + 'defined-type': "ietf-te-topology:te-node-id", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=False)""", + }) + + self.__node_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_node_id(self): + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=False) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/numbered_node_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/numbered_node_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + 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={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + + node_id = __builtin__.property(_get_node_id) + hop_type = __builtin__.property(_get_hop_type) + + __choices__ = {'type': {'numbered-node-hop': ['node_id', 'hop_type']}} + _pyangbind_elements = OrderedDict([('node_id', node_id), ('hop_type', hop_type), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/srlg/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/srlg/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..fcd5a3c7e35e6bcad9f087d0c9b69c0ba3ed3ce7 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/srlg/__init__.py @@ -0,0 +1,115 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 srlg(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/optimizations/optimization-metric/explicit-route-exclude-objects/route-object-exclude-object/srlg. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: SRLG container. + """ + __slots__ = ('_path_helper', '_extmethods', '__srlg',) + + _yang_name = 'srlg' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__srlg = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="srlg", parent=self, choice=('type', 'srlg'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', 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 ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'optimizations', 'optimization-metric', 'explicit-route-exclude-objects', 'route-object-exclude-object', 'srlg'] + + def _get_srlg(self): + """ + Getter method for srlg, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/srlg/srlg (uint32) + + YANG Description: SRLG value. + """ + return self.__srlg + + def _set_srlg(self, v, load=False): + """ + Setter method for srlg, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/srlg/srlg (uint32) + If this variable is read-only (config: false) in the + source YANG file, then _set_srlg is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_srlg() directly. + + YANG Description: SRLG value. + """ + 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="srlg", parent=self, choice=('type', 'srlg'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """srlg 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="srlg", parent=self, choice=('type', 'srlg'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=False)""", + }) + + self.__srlg = t + if hasattr(self, '_set'): + self._set() + + def _unset_srlg(self): + self.__srlg = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="srlg", parent=self, choice=('type', 'srlg'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=False) + + srlg = __builtin__.property(_get_srlg) + + __choices__ = {'type': {'srlg': ['srlg']}} + _pyangbind_elements = OrderedDict([('srlg', srlg), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/unnumbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/unnumbered_link_hop/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..487e25e737837b9b9475ef95d6ceec25c1d81744 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/unnumbered_link_hop/__init__.py @@ -0,0 +1,236 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 unnumbered_link_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/optimizations/optimization-metric/explicit-route-exclude-objects/route-object-exclude-object/unnumbered-link-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Unnumbered link explicit route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__link_tp_id','__node_id','__hop_type','__direction',) + + _yang_name = 'unnumbered-link-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=False) + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=False) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', 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 ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'optimizations', 'optimization-metric', 'explicit-route-exclude-objects', 'route-object-exclude-object', 'unnumbered-link-hop'] + + def _get_link_tp_id(self): + """ + Getter method for link_tp_id, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/unnumbered_link_hop/link_tp_id (te-tp-id) + + YANG Description: TE LTP identifier. The combination of the TE link ID +and the TE node ID is used to identify an unnumbered +TE link. + """ + return self.__link_tp_id + + def _set_link_tp_id(self, v, load=False): + """ + Setter method for link_tp_id, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/unnumbered_link_hop/link_tp_id (te-tp-id) + If this variable is read-only (config: false) in the + source YANG file, then _set_link_tp_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_link_tp_id() directly. + + YANG Description: TE LTP identifier. The combination of the TE link ID +and the TE node ID is used to identify an unnumbered +TE link. + """ + 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),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """link_tp_id must be of a type compatible with te-tp-id""", + 'defined-type': "ietf-te-topology:te-tp-id", + 'generated-type': """YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=False)""", + }) + + self.__link_tp_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_link_tp_id(self): + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=False) + + + def _get_node_id(self): + """ + Getter method for node_id, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/unnumbered_link_hop/node_id (te-node-id) + + YANG Description: The identifier of a node in the TE topology. + """ + return self.__node_id + + def _set_node_id(self, v, load=False): + """ + Setter method for node_id, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/unnumbered_link_hop/node_id (te-node-id) + 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. + + YANG Description: The identifier of a node in the TE topology. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """node_id must be of a type compatible with te-node-id""", + 'defined-type': "ietf-te-topology:te-node-id", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=False)""", + }) + + self.__node_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_node_id(self): + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=False) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/unnumbered_link_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/unnumbered_link_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + 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={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + + + def _get_direction(self): + """ + Getter method for direction, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/unnumbered_link_hop/direction (te-link-direction) + + YANG Description: Link route object direction. + """ + return self.__direction + + def _set_direction(self, v, load=False): + """ + Setter method for direction, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/unnumbered_link_hop/direction (te-link-direction) + If this variable is read-only (config: false) in the + source YANG file, then _set_direction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_direction() directly. + + YANG Description: Link route object direction. + """ + 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={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """direction must be of a type compatible with te-link-direction""", + 'defined-type': "ietf-te-topology:te-link-direction", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=False)""", + }) + + self.__direction = t + if hasattr(self, '_set'): + self._set() + + def _unset_direction(self): + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=False) + + link_tp_id = __builtin__.property(_get_link_tp_id) + node_id = __builtin__.property(_get_node_id) + hop_type = __builtin__.property(_get_hop_type) + direction = __builtin__.property(_get_direction) + + __choices__ = {'type': {'unnumbered-link-hop': ['link_tp_id', 'node_id', 'hop_type', 'direction']}} + _pyangbind_elements = OrderedDict([('link_tp_id', link_tp_id), ('node_id', node_id), ('hop_type', hop_type), ('direction', direction), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..06b2702da984d8ed2355683f3603f538efc430c0 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/__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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 route_object_include_object +class explicit_route_include_objects(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/optimizations/optimization-metric/explicit-route-include-objects. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Container for the 'include route' object list. + """ + __slots__ = ('_path_helper', '_extmethods', '__route_object_include_object',) + + _yang_name = 'explicit-route-include-objects' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__route_object_include_object = YANGDynClass(base=YANGListType("index",route_object_include_object.route_object_include_object, yang_name="route-object-include-object", parent=self, is_container='list', user_ordered=True, path_helper=self._path_helper, yang_keys='index', extensions=None, choice=('algorithm', 'metric')), is_container='list', yang_name="route-object-include-object", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', 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 ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'optimizations', 'optimization-metric', 'explicit-route-include-objects'] + + def _get_route_object_include_object(self): + """ + Getter method for route_object_include_object, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object (list) + + YANG Description: List of Explicit Route Objects to be included in the +path computation. + """ + return self.__route_object_include_object + + def _set_route_object_include_object(self, v, load=False): + """ + Setter method for route_object_include_object, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_route_object_include_object is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_route_object_include_object() directly. + + YANG Description: List of Explicit Route Objects to be included in the +path computation. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("index",route_object_include_object.route_object_include_object, yang_name="route-object-include-object", parent=self, is_container='list', user_ordered=True, path_helper=self._path_helper, yang_keys='index', extensions=None, choice=('algorithm', 'metric')), is_container='list', yang_name="route-object-include-object", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """route_object_include_object must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("index",route_object_include_object.route_object_include_object, yang_name="route-object-include-object", parent=self, is_container='list', user_ordered=True, path_helper=self._path_helper, yang_keys='index', extensions=None, choice=('algorithm', 'metric')), is_container='list', yang_name="route-object-include-object", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False)""", + }) + + self.__route_object_include_object = t + if hasattr(self, '_set'): + self._set() + + def _unset_route_object_include_object(self): + self.__route_object_include_object = YANGDynClass(base=YANGListType("index",route_object_include_object.route_object_include_object, yang_name="route-object-include-object", parent=self, is_container='list', user_ordered=True, path_helper=self._path_helper, yang_keys='index', extensions=None, choice=('algorithm', 'metric')), is_container='list', yang_name="route-object-include-object", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + + route_object_include_object = __builtin__.property(_get_route_object_include_object) + + __choices__ = {'algorithm': {'metric': ['route_object_include_object']}} + _pyangbind_elements = OrderedDict([('route_object_include_object', route_object_include_object), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..0b7b9e7e8bae1e6642dbab091b56fafaafaa9382 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/__init__.py @@ -0,0 +1,325 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 numbered_node_hop +from . import numbered_link_hop +from . import unnumbered_link_hop +from . import as_number_hop +from . import label_hop +class route_object_include_object(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/optimizations/optimization-metric/explicit-route-include-objects/route-object-include-object. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: List of Explicit Route Objects to be included in the +path computation. + """ + __slots__ = ('_path_helper', '_extmethods', '__index','__numbered_node_hop','__numbered_link_hop','__unnumbered_link_hop','__as_number_hop','__label_hop',) + + _yang_name = 'route-object-include-object' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _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), is_leaf=True, yang_name="index", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=False) + self.__numbered_node_hop = YANGDynClass(base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__numbered_link_hop = YANGDynClass(base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__unnumbered_link_hop = YANGDynClass(base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__as_number_hop = YANGDynClass(base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__label_hop = YANGDynClass(base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', 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 ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'optimizations', 'optimization-metric', 'explicit-route-include-objects', 'route-object-include-object'] + + def _get_index(self): + """ + Getter method for index, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/index (uint32) + + YANG Description: Route object entry index. The index is used to +identify an entry in the list. The order of entries +is defined by the user without relying on key values. + """ + return self.__index + + def _set_index(self, v, load=False): + """ + Setter method for index, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/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: Route object entry index. The index is used to +identify an entry in the list. The order of entries +is defined by the user without relying on key values. + """ + 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=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="index", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', 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), is_leaf=True, yang_name="index", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', 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), is_leaf=True, yang_name="index", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=False) + + + def _get_numbered_node_hop(self): + """ + Getter method for numbered_node_hop, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/numbered_node_hop (container) + + YANG Description: Numbered node route hop. + """ + return self.__numbered_node_hop + + def _set_numbered_node_hop(self, v, load=False): + """ + Setter method for numbered_node_hop, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/numbered_node_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_numbered_node_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_numbered_node_hop() directly. + + YANG Description: Numbered node route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """numbered_node_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__numbered_node_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_numbered_node_hop(self): + self.__numbered_node_hop = YANGDynClass(base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_numbered_link_hop(self): + """ + Getter method for numbered_link_hop, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/numbered_link_hop (container) + + YANG Description: Numbered link explicit route hop. + """ + return self.__numbered_link_hop + + def _set_numbered_link_hop(self, v, load=False): + """ + Setter method for numbered_link_hop, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/numbered_link_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_numbered_link_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_numbered_link_hop() directly. + + YANG Description: Numbered link explicit route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """numbered_link_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__numbered_link_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_numbered_link_hop(self): + self.__numbered_link_hop = YANGDynClass(base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_unnumbered_link_hop(self): + """ + Getter method for unnumbered_link_hop, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/unnumbered_link_hop (container) + + YANG Description: Unnumbered link explicit route hop. + """ + return self.__unnumbered_link_hop + + def _set_unnumbered_link_hop(self, v, load=False): + """ + Setter method for unnumbered_link_hop, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/unnumbered_link_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_unnumbered_link_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_unnumbered_link_hop() directly. + + YANG Description: Unnumbered link explicit route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """unnumbered_link_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__unnumbered_link_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_unnumbered_link_hop(self): + self.__unnumbered_link_hop = YANGDynClass(base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_as_number_hop(self): + """ + Getter method for as_number_hop, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/as_number_hop (container) + + YANG Description: AS explicit route hop. + """ + return self.__as_number_hop + + def _set_as_number_hop(self, v, load=False): + """ + Setter method for as_number_hop, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/as_number_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_as_number_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_as_number_hop() directly. + + YANG Description: AS explicit route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """as_number_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__as_number_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_as_number_hop(self): + self.__as_number_hop = YANGDynClass(base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_label_hop(self): + """ + Getter method for label_hop, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop (container) + + YANG Description: Label hop type. + """ + return self.__label_hop + + def _set_label_hop(self, v, load=False): + """ + Setter method for label_hop, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_label_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_label_hop() directly. + + YANG Description: Label hop type. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """label_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__label_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_label_hop(self): + self.__label_hop = YANGDynClass(base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + index = __builtin__.property(_get_index) + numbered_node_hop = __builtin__.property(_get_numbered_node_hop) + numbered_link_hop = __builtin__.property(_get_numbered_link_hop) + unnumbered_link_hop = __builtin__.property(_get_unnumbered_link_hop) + as_number_hop = __builtin__.property(_get_as_number_hop) + label_hop = __builtin__.property(_get_label_hop) + + __choices__ = {'algorithm': {'metric': ['index']}, 'type': {'numbered-node-hop': ['numbered_node_hop'], 'numbered-link-hop': ['numbered_link_hop'], 'unnumbered-link-hop': ['unnumbered_link_hop'], 'as-number': ['as_number_hop'], 'label': ['label_hop']}} + _pyangbind_elements = OrderedDict([('index', index), ('numbered_node_hop', numbered_node_hop), ('numbered_link_hop', numbered_link_hop), ('unnumbered_link_hop', unnumbered_link_hop), ('as_number_hop', as_number_hop), ('label_hop', label_hop), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/as_number_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/as_number_hop/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..a30ba2c884047e7c1188f2db95c140614bad05d0 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/as_number_hop/__init__.py @@ -0,0 +1,154 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 as_number_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/optimizations/optimization-metric/explicit-route-include-objects/route-object-include-object/as-number-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: AS explicit route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__as_number','__hop_type',) + + _yang_name = 'as-number-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__as_number = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=False) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', 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 ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'optimizations', 'optimization-metric', 'explicit-route-include-objects', 'route-object-include-object', 'as-number-hop'] + + def _get_as_number(self): + """ + Getter method for as_number, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/as_number_hop/as_number (inet:as-number) + + YANG Description: The Autonomous System (AS) number. + """ + return self.__as_number + + def _set_as_number(self, v, load=False): + """ + Setter method for as_number, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/as_number_hop/as_number (inet:as-number) + If this variable is read-only (config: false) in the + source YANG file, then _set_as_number is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_as_number() directly. + + YANG Description: The Autonomous System (AS) number. + """ + 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="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """as_number must be of a type compatible with inet:as-number""", + 'defined-type': "inet:as-number", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=False)""", + }) + + self.__as_number = t + if hasattr(self, '_set'): + self._set() + + def _unset_as_number(self): + self.__as_number = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=False) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/as_number_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/as_number_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + 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={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + + as_number = __builtin__.property(_get_as_number) + hop_type = __builtin__.property(_get_hop_type) + + __choices__ = {'type': {'as-number': ['as_number', 'hop_type']}} + _pyangbind_elements = OrderedDict([('as_number', as_number), ('hop_type', hop_type), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..5adb8788e175b1dee82e2e76374fb88c16a4f7d6 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/__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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 te_label +class label_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/optimizations/optimization-metric/explicit-route-include-objects/route-object-include-object/label-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Label hop type. + """ + __slots__ = ('_path_helper', '_extmethods', '__te_label',) + + _yang_name = 'label-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__te_label = YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', 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 ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'optimizations', 'optimization-metric', 'explicit-route-include-objects', 'route-object-include-object', 'label-hop'] + + def _get_te_label(self): + """ + Getter method for te_label, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label (container) + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + return self.__te_label + + def _set_te_label(self, v, load=False): + """ + Setter method for te_label, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_te_label is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_te_label() directly. + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """te_label must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__te_label = t + if hasattr(self, '_set'): + self._set() + + def _unset_te_label(self): + self.__te_label = YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + te_label = __builtin__.property(_get_te_label) + + __choices__ = {'type': {'label': ['te_label']}} + _pyangbind_elements = OrderedDict([('te_label', te_label), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..9494b4fda980a14f82d2595fb76717aba610b2c4 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label/__init__.py @@ -0,0 +1,234 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 otn +class te_label(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/optimizations/optimization-metric/explicit-route-include-objects/route-object-include-object/label-hop/te-label. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + __slots__ = ('_path_helper', '_extmethods', '__generic','__otn','__vlanid','__direction',) + + _yang_name = 'te-label' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__generic = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=False) + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False) + self.__vlanid = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=False) + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', 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 ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'optimizations', 'optimization-metric', 'explicit-route-include-objects', 'route-object-include-object', 'label-hop', 'te-label'] + + def _get_generic(self): + """ + Getter method for generic, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label/generic (rt-types:generalized-label) + + YANG Description: TE label specified in a generic format. + """ + return self.__generic + + def _set_generic(self, v, load=False): + """ + Setter method for generic, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label/generic (rt-types:generalized-label) + If this variable is read-only (config: false) in the + source YANG file, then _set_generic is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_generic() directly. + + YANG Description: TE label specified in a generic format. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """generic must be of a type compatible with rt-types:generalized-label""", + 'defined-type': "rt-types:generalized-label", + 'generated-type': """YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=False)""", + }) + + self.__generic = t + if hasattr(self, '_set'): + self._set() + + def _unset_generic(self): + self.__generic = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=False) + + + def _get_otn(self): + """ + Getter method for otn, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label/otn (container) + + YANG Description: Label hop for OTN. + """ + return self.__otn + + def _set_otn(self, v, load=False): + """ + Setter method for otn, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label/otn (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_otn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_otn() directly. + + YANG Description: Label hop for OTN. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """otn must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False)""", + }) + + self.__otn = t + if hasattr(self, '_set'): + self._set() + + def _unset_otn(self): + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False) + + + def _get_vlanid(self): + """ + Getter method for vlanid, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label/vlanid (etht-types:vlanid) + + YANG Description: VLAN tag id. + """ + return self.__vlanid + + def _set_vlanid(self, v, load=False): + """ + Setter method for vlanid, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label/vlanid (etht-types:vlanid) + If this variable is read-only (config: false) in the + source YANG file, then _set_vlanid is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_vlanid() directly. + + YANG Description: VLAN tag id. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """vlanid must be of a type compatible with etht-types:vlanid""", + 'defined-type': "etht-types:vlanid", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=False)""", + }) + + self.__vlanid = t + if hasattr(self, '_set'): + self._set() + + def _unset_vlanid(self): + self.__vlanid = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=False) + + + def _get_direction(self): + """ + Getter method for direction, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label/direction (te-label-direction) + + YANG Description: Label direction. + """ + return self.__direction + + def _set_direction(self, v, load=False): + """ + Setter method for direction, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label/direction (te-label-direction) + If this variable is read-only (config: false) in the + source YANG file, then _set_direction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_direction() directly. + + YANG Description: Label direction. + """ + 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={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """direction must be of a type compatible with te-label-direction""", + 'defined-type': "ietf-te-topology:te-label-direction", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=False)""", + }) + + self.__direction = t + if hasattr(self, '_set'): + self._set() + + def _unset_direction(self): + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=False) + + generic = __builtin__.property(_get_generic) + otn = __builtin__.property(_get_otn) + vlanid = __builtin__.property(_get_vlanid) + direction = __builtin__.property(_get_direction) + + __choices__ = {'technology': {'generic': ['generic'], 'otn': ['otn'], 'eth': ['vlanid']}, 'type': {'label': ['direction']}} + _pyangbind_elements = OrderedDict([('generic', generic), ('otn', otn), ('vlanid', vlanid), ('direction', direction), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label/otn/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label/otn/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..030f51b1f4b7cfd10ef486db089420efe0635d75 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label/otn/__init__.py @@ -0,0 +1,209 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 otn(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/optimizations/optimization-metric/explicit-route-include-objects/route-object-include-object/label-hop/te-label/otn. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Label hop for OTN. + """ + __slots__ = ('_path_helper', '_extmethods', '__tpn','__tsg','__ts_list',) + + _yang_name = 'otn' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__tpn = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=False) + self.__tsg = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=False) + self.__ts_list = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', 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 ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'optimizations', 'optimization-metric', 'explicit-route-include-objects', 'route-object-include-object', 'label-hop', 'te-label', 'otn'] + + def _get_tpn(self): + """ + Getter method for tpn, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label/otn/tpn (otn-tpn) + + YANG Description: Tributary Port Number (TPN). + """ + return self.__tpn + + def _set_tpn(self, v, load=False): + """ + Setter method for tpn, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label/otn/tpn (otn-tpn) + If this variable is read-only (config: false) in the + source YANG file, then _set_tpn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tpn() directly. + + YANG Description: Tributary Port Number (TPN). + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tpn must be of a type compatible with otn-tpn""", + 'defined-type': "ietf-otn-topology:otn-tpn", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=False)""", + }) + + self.__tpn = t + if hasattr(self, '_set'): + self._set() + + def _unset_tpn(self): + self.__tpn = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=False) + + + def _get_tsg(self): + """ + Getter method for tsg, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label/otn/tsg (identityref) + + YANG Description: Tributary Slot Granularity (TSG). + """ + return self.__tsg + + def _set_tsg(self, v, load=False): + """ + Setter method for tsg, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label/otn/tsg (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_tsg is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tsg() directly. + + YANG Description: Tributary Slot Granularity (TSG). + """ + 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={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tsg must be of a type compatible with identityref""", + 'defined-type': "ietf-otn-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=False)""", + }) + + self.__tsg = t + if hasattr(self, '_set'): + self._set() + + def _unset_tsg(self): + self.__tsg = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=False) + + + def _get_ts_list(self): + """ + Getter method for ts_list, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label/otn/ts_list (string) + + YANG Description: A list of available Tributary Slots (TS) ranging + + + + +between 1 and 4095. If multiple values or +ranges are given, they all MUST be disjoint +and MUST be in ascending order. +For example 1-20,25,50-1000. + """ + return self.__ts_list + + def _set_ts_list(self, v, load=False): + """ + Setter method for ts_list, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label/otn/ts_list (string) + If this variable is read-only (config: false) in the + source YANG file, then _set_ts_list is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_ts_list() directly. + + YANG Description: A list of available Tributary Slots (TS) ranging + + + + +between 1 and 4095. If multiple values or +ranges are given, they all MUST be disjoint +and MUST be in ascending order. +For example 1-20,25,50-1000. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='string', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """ts_list must be of a type compatible with string""", + 'defined-type': "string", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='string', is_config=False)""", + }) + + self.__ts_list = t + if hasattr(self, '_set'): + self._set() + + def _unset_ts_list(self): + self.__ts_list = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='string', is_config=False) + + tpn = __builtin__.property(_get_tpn) + tsg = __builtin__.property(_get_tsg) + ts_list = __builtin__.property(_get_ts_list) + + __choices__ = {'technology': {'otn': ['tpn', 'tsg', 'ts_list']}} + _pyangbind_elements = OrderedDict([('tpn', tpn), ('tsg', tsg), ('ts_list', ts_list), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/numbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/numbered_link_hop/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..50a4caad878397da24119fbe69d64d45bced9a14 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/numbered_link_hop/__init__.py @@ -0,0 +1,193 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 numbered_link_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/optimizations/optimization-metric/explicit-route-include-objects/route-object-include-object/numbered-link-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Numbered link explicit route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__link_tp_id','__hop_type','__direction',) + + _yang_name = 'numbered-link-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=False) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', 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 ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'optimizations', 'optimization-metric', 'explicit-route-include-objects', 'route-object-include-object', 'numbered-link-hop'] + + def _get_link_tp_id(self): + """ + Getter method for link_tp_id, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/numbered_link_hop/link_tp_id (te-tp-id) + + YANG Description: TE Link Termination Point (LTP) identifier. + """ + return self.__link_tp_id + + def _set_link_tp_id(self, v, load=False): + """ + Setter method for link_tp_id, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/numbered_link_hop/link_tp_id (te-tp-id) + If this variable is read-only (config: false) in the + source YANG file, then _set_link_tp_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_link_tp_id() directly. + + YANG Description: TE Link Termination Point (LTP) identifier. + """ + 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),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """link_tp_id must be of a type compatible with te-tp-id""", + 'defined-type': "ietf-te-topology:te-tp-id", + 'generated-type': """YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=False)""", + }) + + self.__link_tp_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_link_tp_id(self): + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=False) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/numbered_link_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/numbered_link_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + 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={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + + + def _get_direction(self): + """ + Getter method for direction, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/numbered_link_hop/direction (te-link-direction) + + YANG Description: Link route object direction. + """ + return self.__direction + + def _set_direction(self, v, load=False): + """ + Setter method for direction, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/numbered_link_hop/direction (te-link-direction) + If this variable is read-only (config: false) in the + source YANG file, then _set_direction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_direction() directly. + + YANG Description: Link route object direction. + """ + 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={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """direction must be of a type compatible with te-link-direction""", + 'defined-type': "ietf-te-topology:te-link-direction", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=False)""", + }) + + self.__direction = t + if hasattr(self, '_set'): + self._set() + + def _unset_direction(self): + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=False) + + link_tp_id = __builtin__.property(_get_link_tp_id) + hop_type = __builtin__.property(_get_hop_type) + direction = __builtin__.property(_get_direction) + + __choices__ = {'type': {'numbered-link-hop': ['link_tp_id', 'hop_type', 'direction']}} + _pyangbind_elements = OrderedDict([('link_tp_id', link_tp_id), ('hop_type', hop_type), ('direction', direction), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/numbered_node_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/numbered_node_hop/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..6952ba89be848862056de6f9baed16e7ef90df0e --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/numbered_node_hop/__init__.py @@ -0,0 +1,154 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 numbered_node_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/optimizations/optimization-metric/explicit-route-include-objects/route-object-include-object/numbered-node-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Numbered node route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__node_id','__hop_type',) + + _yang_name = 'numbered-node-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=False) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', 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 ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'optimizations', 'optimization-metric', 'explicit-route-include-objects', 'route-object-include-object', 'numbered-node-hop'] + + def _get_node_id(self): + """ + Getter method for node_id, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/numbered_node_hop/node_id (te-node-id) + + YANG Description: The identifier of a node in the TE topology. + """ + return self.__node_id + + def _set_node_id(self, v, load=False): + """ + Setter method for node_id, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/numbered_node_hop/node_id (te-node-id) + 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. + + YANG Description: The identifier of a node in the TE topology. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """node_id must be of a type compatible with te-node-id""", + 'defined-type': "ietf-te-topology:te-node-id", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=False)""", + }) + + self.__node_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_node_id(self): + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=False) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/numbered_node_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/numbered_node_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + 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={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + + node_id = __builtin__.property(_get_node_id) + hop_type = __builtin__.property(_get_hop_type) + + __choices__ = {'type': {'numbered-node-hop': ['node_id', 'hop_type']}} + _pyangbind_elements = OrderedDict([('node_id', node_id), ('hop_type', hop_type), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/unnumbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/unnumbered_link_hop/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..a4ec3b3a951b016b6fb8df74c6e6e4ba551fbcb9 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/unnumbered_link_hop/__init__.py @@ -0,0 +1,236 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 unnumbered_link_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/optimizations/optimization-metric/explicit-route-include-objects/route-object-include-object/unnumbered-link-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Unnumbered link explicit route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__link_tp_id','__node_id','__hop_type','__direction',) + + _yang_name = 'unnumbered-link-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=False) + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=False) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', 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 ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'optimizations', 'optimization-metric', 'explicit-route-include-objects', 'route-object-include-object', 'unnumbered-link-hop'] + + def _get_link_tp_id(self): + """ + Getter method for link_tp_id, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/unnumbered_link_hop/link_tp_id (te-tp-id) + + YANG Description: TE LTP identifier. The combination of the TE link ID +and the TE node ID is used to identify an unnumbered +TE link. + """ + return self.__link_tp_id + + def _set_link_tp_id(self, v, load=False): + """ + Setter method for link_tp_id, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/unnumbered_link_hop/link_tp_id (te-tp-id) + If this variable is read-only (config: false) in the + source YANG file, then _set_link_tp_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_link_tp_id() directly. + + YANG Description: TE LTP identifier. The combination of the TE link ID +and the TE node ID is used to identify an unnumbered +TE link. + """ + 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),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """link_tp_id must be of a type compatible with te-tp-id""", + 'defined-type': "ietf-te-topology:te-tp-id", + 'generated-type': """YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=False)""", + }) + + self.__link_tp_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_link_tp_id(self): + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=False) + + + def _get_node_id(self): + """ + Getter method for node_id, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/unnumbered_link_hop/node_id (te-node-id) + + YANG Description: The identifier of a node in the TE topology. + """ + return self.__node_id + + def _set_node_id(self, v, load=False): + """ + Setter method for node_id, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/unnumbered_link_hop/node_id (te-node-id) + 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. + + YANG Description: The identifier of a node in the TE topology. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """node_id must be of a type compatible with te-node-id""", + 'defined-type': "ietf-te-topology:te-node-id", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=False)""", + }) + + self.__node_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_node_id(self): + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=False) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/unnumbered_link_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/unnumbered_link_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + 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={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + + + def _get_direction(self): + """ + Getter method for direction, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/unnumbered_link_hop/direction (te-link-direction) + + YANG Description: Link route object direction. + """ + return self.__direction + + def _set_direction(self, v, load=False): + """ + Setter method for direction, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/unnumbered_link_hop/direction (te-link-direction) + If this variable is read-only (config: false) in the + source YANG file, then _set_direction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_direction() directly. + + YANG Description: Link route object direction. + """ + 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={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """direction must be of a type compatible with te-link-direction""", + 'defined-type': "ietf-te-topology:te-link-direction", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=False)""", + }) + + self.__direction = t + if hasattr(self, '_set'): + self._set() + + def _unset_direction(self): + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=False) + + link_tp_id = __builtin__.property(_get_link_tp_id) + node_id = __builtin__.property(_get_node_id) + hop_type = __builtin__.property(_get_hop_type) + direction = __builtin__.property(_get_direction) + + __choices__ = {'type': {'unnumbered-link-hop': ['link_tp_id', 'node_id', 'hop_type', 'direction']}} + _pyangbind_elements = OrderedDict([('link_tp_id', link_tp_id), ('node_id', node_id), ('hop_type', hop_type), ('direction', direction), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/tiebreakers/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/tiebreakers/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..3357913dd0b1bbfc42da56f04599ff3c4a2372da --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/tiebreakers/__init__.py @@ -0,0 +1,120 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 tiebreaker +class tiebreakers(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/optimizations/tiebreakers. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Container for the list of tiebreakers. + """ + __slots__ = ('_path_helper', '_extmethods', '__tiebreaker',) + + _yang_name = 'tiebreakers' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__tiebreaker = YANGDynClass(base=YANGListType("tiebreaker_type",tiebreaker.tiebreaker, yang_name="tiebreaker", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='tiebreaker-type', extensions=None, choice=('algorithm', 'metric')), is_container='list', yang_name="tiebreaker", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', 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 ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'optimizations', 'tiebreakers'] + + def _get_tiebreaker(self): + """ + Getter method for tiebreaker, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/tiebreakers/tiebreaker (list) + + YANG Description: The list of tiebreaker criteria to apply on an +equally favored set of paths, in order to pick +the best. + """ + return self.__tiebreaker + + def _set_tiebreaker(self, v, load=False): + """ + Setter method for tiebreaker, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/tiebreakers/tiebreaker (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_tiebreaker is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tiebreaker() directly. + + YANG Description: The list of tiebreaker criteria to apply on an +equally favored set of paths, in order to pick +the best. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("tiebreaker_type",tiebreaker.tiebreaker, yang_name="tiebreaker", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='tiebreaker-type', extensions=None, choice=('algorithm', 'metric')), is_container='list', yang_name="tiebreaker", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tiebreaker must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("tiebreaker_type",tiebreaker.tiebreaker, yang_name="tiebreaker", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='tiebreaker-type', extensions=None, choice=('algorithm', 'metric')), is_container='list', yang_name="tiebreaker", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False)""", + }) + + self.__tiebreaker = t + if hasattr(self, '_set'): + self._set() + + def _unset_tiebreaker(self): + self.__tiebreaker = YANGDynClass(base=YANGListType("tiebreaker_type",tiebreaker.tiebreaker, yang_name="tiebreaker", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='tiebreaker-type', extensions=None, choice=('algorithm', 'metric')), is_container='list', yang_name="tiebreaker", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + + tiebreaker = __builtin__.property(_get_tiebreaker) + + __choices__ = {'algorithm': {'metric': ['tiebreaker']}} + _pyangbind_elements = OrderedDict([('tiebreaker', tiebreaker), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/tiebreakers/tiebreaker/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/tiebreakers/tiebreaker/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..4478acced1f4548ce3090a00bef95a37125c4386 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/tiebreakers/tiebreaker/__init__.py @@ -0,0 +1,122 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 tiebreaker(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/optimizations/tiebreakers/tiebreaker. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: The list of tiebreaker criteria to apply on an +equally favored set of paths, in order to pick +the best. + """ + __slots__ = ('_path_helper', '_extmethods', '__tiebreaker_type',) + + _yang_name = 'tiebreaker' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__tiebreaker_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="tiebreaker-type", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', 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 ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'optimizations', 'tiebreakers', 'tiebreaker'] + + def _get_tiebreaker_type(self): + """ + Getter method for tiebreaker_type, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/tiebreakers/tiebreaker/tiebreaker_type (identityref) + + YANG Description: Identifies an entry in the list of tiebreakers. + """ + return self.__tiebreaker_type + + def _set_tiebreaker_type(self, v, load=False): + """ + Setter method for tiebreaker_type, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/tiebreakers/tiebreaker/tiebreaker_type (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_tiebreaker_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tiebreaker_type() directly. + + YANG Description: Identifies an entry in the list of tiebreakers. + """ + 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=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="tiebreaker-type", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tiebreaker_type must be of a type compatible with identityref""", + 'defined-type': "ietf-te-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="tiebreaker-type", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False)""", + }) + + self.__tiebreaker_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_tiebreaker_type(self): + self.__tiebreaker_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="tiebreaker-type", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + + tiebreaker_type = __builtin__.property(_get_tiebreaker_type) + + __choices__ = {'algorithm': {'metric': ['tiebreaker_type']}} + _pyangbind_elements = OrderedDict([('tiebreaker_type', tiebreaker_type), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..74807897d04dcf0f8eb598293612b0e0447a003d --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/__init__.py @@ -0,0 +1,523 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 te_bandwidth +from . import path_metric_bounds +from . import path_affinities_values +from . import path_affinity_names +from . import path_srlgs_lists +from . import path_srlgs_names +class path_constraints(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/path-constraints. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: TE named path constraints container. + """ + __slots__ = ('_path_helper', '_extmethods', '__te_bandwidth','__link_protection','__setup_priority','__hold_priority','__signaling_type','__path_metric_bounds','__path_affinities_values','__path_affinity_names','__path_srlgs_lists','__path_srlgs_names','__disjointness',) + + _yang_name = 'path-constraints' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__te_bandwidth = YANGDynClass(base=te_bandwidth.te_bandwidth, is_container='container', yang_name="te-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__link_protection = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'link-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-shared': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-shared': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-shared': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-enhanced': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-enhanced': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-enhanced': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), default=six.text_type("te-types:link-protection-unprotected"), is_leaf=True, yang_name="link-protection", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + self.__setup_priority = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..7']}), default=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8)(7), is_leaf=True, yang_name="setup-priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint8', is_config=False) + self.__hold_priority = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..7']}), default=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8)(7), is_leaf=True, yang_name="hold-priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint8', is_config=False) + self.__signaling_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'path-setup-static': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-setup-static': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-setup-static': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-setup-rsvp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-setup-rsvp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-setup-rsvp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-setup-sr': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-setup-sr': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-setup-sr': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), default=six.text_type("te-types:path-setup-rsvp"), is_leaf=True, yang_name="signaling-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + self.__path_metric_bounds = YANGDynClass(base=path_metric_bounds.path_metric_bounds, is_container='container', yang_name="path-metric-bounds", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__path_affinities_values = YANGDynClass(base=path_affinities_values.path_affinities_values, is_container='container', yang_name="path-affinities-values", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__path_affinity_names = YANGDynClass(base=path_affinity_names.path_affinity_names, is_container='container', yang_name="path-affinity-names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__path_srlgs_lists = YANGDynClass(base=path_srlgs_lists.path_srlgs_lists, is_container='container', yang_name="path-srlgs-lists", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__path_srlgs_names = YANGDynClass(base=path_srlgs_names.path_srlgs_names, is_container='container', yang_name="path-srlgs-names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__disjointness = YANGDynClass(base=YANGBitsType(allowed_bits={'node': '0', 'link': '1', 'srlg': '2'}), is_leaf=True, yang_name="disjointness", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-path-disjointness', 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 ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'path-constraints'] + + def _get_te_bandwidth(self): + """ + Getter method for te_bandwidth, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/te_bandwidth (container) + + YANG Description: Container that specifies TE bandwidth. The choices +can be augmented for specific data-plane technologies. + """ + return self.__te_bandwidth + + def _set_te_bandwidth(self, v, load=False): + """ + Setter method for te_bandwidth, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/te_bandwidth (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_te_bandwidth is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_te_bandwidth() directly. + + YANG Description: Container that specifies TE bandwidth. The choices +can be augmented for specific data-plane technologies. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=te_bandwidth.te_bandwidth, is_container='container', yang_name="te-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """te_bandwidth must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=te_bandwidth.te_bandwidth, is_container='container', yang_name="te-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__te_bandwidth = t + if hasattr(self, '_set'): + self._set() + + def _unset_te_bandwidth(self): + self.__te_bandwidth = YANGDynClass(base=te_bandwidth.te_bandwidth, is_container='container', yang_name="te-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_link_protection(self): + """ + Getter method for link_protection, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/link_protection (identityref) + + YANG Description: Link protection type required for the links included +in the computed path. + """ + return self.__link_protection + + def _set_link_protection(self, v, load=False): + """ + Setter method for link_protection, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/link_protection (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_link_protection is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_link_protection() directly. + + YANG Description: Link protection type required for the links included +in the computed path. + """ + 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={'link-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-shared': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-shared': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-shared': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-enhanced': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-enhanced': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-enhanced': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), default=six.text_type("te-types:link-protection-unprotected"), is_leaf=True, yang_name="link-protection", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """link_protection must be of a type compatible with identityref""", + 'defined-type': "ietf-te-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'link-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-shared': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-shared': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-shared': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-enhanced': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-enhanced': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-enhanced': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), default=six.text_type("te-types:link-protection-unprotected"), is_leaf=True, yang_name="link-protection", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False)""", + }) + + self.__link_protection = t + if hasattr(self, '_set'): + self._set() + + def _unset_link_protection(self): + self.__link_protection = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'link-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-shared': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-shared': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-shared': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-enhanced': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-enhanced': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-enhanced': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), default=six.text_type("te-types:link-protection-unprotected"), is_leaf=True, yang_name="link-protection", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + + + def _get_setup_priority(self): + """ + Getter method for setup_priority, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/setup_priority (uint8) + + YANG Description: TE LSP requested setup priority. + """ + return self.__setup_priority + + def _set_setup_priority(self, v, load=False): + """ + Setter method for setup_priority, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/setup_priority (uint8) + If this variable is read-only (config: false) in the + source YANG file, then _set_setup_priority is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_setup_priority() directly. + + YANG Description: TE LSP requested setup priority. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..7']}), default=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8)(7), is_leaf=True, yang_name="setup-priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint8', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """setup_priority must be of a type compatible with uint8""", + 'defined-type': "uint8", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..7']}), default=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8)(7), is_leaf=True, yang_name="setup-priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint8', is_config=False)""", + }) + + self.__setup_priority = t + if hasattr(self, '_set'): + self._set() + + def _unset_setup_priority(self): + self.__setup_priority = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..7']}), default=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8)(7), is_leaf=True, yang_name="setup-priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint8', is_config=False) + + + def _get_hold_priority(self): + """ + Getter method for hold_priority, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/hold_priority (uint8) + + YANG Description: TE LSP requested hold priority. + """ + return self.__hold_priority + + def _set_hold_priority(self, v, load=False): + """ + Setter method for hold_priority, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/hold_priority (uint8) + If this variable is read-only (config: false) in the + source YANG file, then _set_hold_priority is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hold_priority() directly. + + YANG Description: TE LSP requested hold priority. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..7']}), default=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8)(7), is_leaf=True, yang_name="hold-priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint8', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hold_priority must be of a type compatible with uint8""", + 'defined-type': "uint8", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..7']}), default=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8)(7), is_leaf=True, yang_name="hold-priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint8', is_config=False)""", + }) + + self.__hold_priority = t + if hasattr(self, '_set'): + self._set() + + def _unset_hold_priority(self): + self.__hold_priority = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..7']}), default=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8)(7), is_leaf=True, yang_name="hold-priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint8', is_config=False) + + + def _get_signaling_type(self): + """ + Getter method for signaling_type, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/signaling_type (identityref) + + YANG Description: TE tunnel path signaling type. + """ + return self.__signaling_type + + def _set_signaling_type(self, v, load=False): + """ + Setter method for signaling_type, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/signaling_type (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_signaling_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_signaling_type() directly. + + YANG Description: TE tunnel path signaling type. + """ + 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={'path-setup-static': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-setup-static': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-setup-static': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-setup-rsvp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-setup-rsvp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-setup-rsvp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-setup-sr': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-setup-sr': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-setup-sr': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), default=six.text_type("te-types:path-setup-rsvp"), is_leaf=True, yang_name="signaling-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """signaling_type must be of a type compatible with identityref""", + 'defined-type': "ietf-te-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'path-setup-static': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-setup-static': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-setup-static': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-setup-rsvp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-setup-rsvp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-setup-rsvp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-setup-sr': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-setup-sr': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-setup-sr': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), default=six.text_type("te-types:path-setup-rsvp"), is_leaf=True, yang_name="signaling-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False)""", + }) + + self.__signaling_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_signaling_type(self): + self.__signaling_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'path-setup-static': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-setup-static': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-setup-static': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-setup-rsvp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-setup-rsvp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-setup-rsvp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-setup-sr': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-setup-sr': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-setup-sr': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), default=six.text_type("te-types:path-setup-rsvp"), is_leaf=True, yang_name="signaling-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + + + def _get_path_metric_bounds(self): + """ + Getter method for path_metric_bounds, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/path_metric_bounds (container) + + YANG Description: TE path metric bounds container. + """ + return self.__path_metric_bounds + + def _set_path_metric_bounds(self, v, load=False): + """ + Setter method for path_metric_bounds, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/path_metric_bounds (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_metric_bounds is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_metric_bounds() directly. + + YANG Description: TE path metric bounds container. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=path_metric_bounds.path_metric_bounds, is_container='container', yang_name="path-metric-bounds", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_metric_bounds must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=path_metric_bounds.path_metric_bounds, is_container='container', yang_name="path-metric-bounds", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__path_metric_bounds = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_metric_bounds(self): + self.__path_metric_bounds = YANGDynClass(base=path_metric_bounds.path_metric_bounds, is_container='container', yang_name="path-metric-bounds", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_path_affinities_values(self): + """ + Getter method for path_affinities_values, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/path_affinities_values (container) + + YANG Description: Path affinities represented as values. + """ + return self.__path_affinities_values + + def _set_path_affinities_values(self, v, load=False): + """ + Setter method for path_affinities_values, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/path_affinities_values (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_affinities_values is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_affinities_values() directly. + + YANG Description: Path affinities represented as values. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=path_affinities_values.path_affinities_values, is_container='container', yang_name="path-affinities-values", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_affinities_values must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=path_affinities_values.path_affinities_values, is_container='container', yang_name="path-affinities-values", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__path_affinities_values = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_affinities_values(self): + self.__path_affinities_values = YANGDynClass(base=path_affinities_values.path_affinities_values, is_container='container', yang_name="path-affinities-values", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_path_affinity_names(self): + """ + Getter method for path_affinity_names, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/path_affinity_names (container) + + YANG Description: Path affinities represented as names. + """ + return self.__path_affinity_names + + def _set_path_affinity_names(self, v, load=False): + """ + Setter method for path_affinity_names, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/path_affinity_names (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_affinity_names is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_affinity_names() directly. + + YANG Description: Path affinities represented as names. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=path_affinity_names.path_affinity_names, is_container='container', yang_name="path-affinity-names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_affinity_names must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=path_affinity_names.path_affinity_names, is_container='container', yang_name="path-affinity-names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__path_affinity_names = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_affinity_names(self): + self.__path_affinity_names = YANGDynClass(base=path_affinity_names.path_affinity_names, is_container='container', yang_name="path-affinity-names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_path_srlgs_lists(self): + """ + Getter method for path_srlgs_lists, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/path_srlgs_lists (container) + + YANG Description: Path SRLG properties container. + """ + return self.__path_srlgs_lists + + def _set_path_srlgs_lists(self, v, load=False): + """ + Setter method for path_srlgs_lists, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/path_srlgs_lists (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_srlgs_lists is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_srlgs_lists() directly. + + YANG Description: Path SRLG properties container. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=path_srlgs_lists.path_srlgs_lists, is_container='container', yang_name="path-srlgs-lists", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_srlgs_lists must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=path_srlgs_lists.path_srlgs_lists, is_container='container', yang_name="path-srlgs-lists", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__path_srlgs_lists = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_srlgs_lists(self): + self.__path_srlgs_lists = YANGDynClass(base=path_srlgs_lists.path_srlgs_lists, is_container='container', yang_name="path-srlgs-lists", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_path_srlgs_names(self): + """ + Getter method for path_srlgs_names, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/path_srlgs_names (container) + + YANG Description: Container for the list of named SRLGs. + """ + return self.__path_srlgs_names + + def _set_path_srlgs_names(self, v, load=False): + """ + Setter method for path_srlgs_names, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/path_srlgs_names (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_srlgs_names is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_srlgs_names() directly. + + YANG Description: Container for the list of named SRLGs. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=path_srlgs_names.path_srlgs_names, is_container='container', yang_name="path-srlgs-names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_srlgs_names must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=path_srlgs_names.path_srlgs_names, is_container='container', yang_name="path-srlgs-names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__path_srlgs_names = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_srlgs_names(self): + self.__path_srlgs_names = YANGDynClass(base=path_srlgs_names.path_srlgs_names, is_container='container', yang_name="path-srlgs-names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_disjointness(self): + """ + Getter method for disjointness, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/disjointness (te-path-disjointness) + + YANG Description: The type of resource disjointness. +When configured for a primary path, the disjointness level +applies to all secondary LSPs. When configured for a +secondary path, the disjointness level overrides the level +configured for the primary path. + """ + return self.__disjointness + + def _set_disjointness(self, v, load=False): + """ + Setter method for disjointness, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/disjointness (te-path-disjointness) + If this variable is read-only (config: false) in the + source YANG file, then _set_disjointness is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_disjointness() directly. + + YANG Description: The type of resource disjointness. +When configured for a primary path, the disjointness level +applies to all secondary LSPs. When configured for a +secondary path, the disjointness level overrides the level +configured for the primary path. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBitsType(allowed_bits={'node': '0', 'link': '1', 'srlg': '2'}), is_leaf=True, yang_name="disjointness", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-path-disjointness', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """disjointness must be of a type compatible with te-path-disjointness""", + 'defined-type': "ietf-te-topology:te-path-disjointness", + 'generated-type': """YANGDynClass(base=YANGBitsType(allowed_bits={'node': '0', 'link': '1', 'srlg': '2'}), is_leaf=True, yang_name="disjointness", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-path-disjointness', is_config=False)""", + }) + + self.__disjointness = t + if hasattr(self, '_set'): + self._set() + + def _unset_disjointness(self): + self.__disjointness = YANGDynClass(base=YANGBitsType(allowed_bits={'node': '0', 'link': '1', 'srlg': '2'}), is_leaf=True, yang_name="disjointness", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-path-disjointness', is_config=False) + + te_bandwidth = __builtin__.property(_get_te_bandwidth) + link_protection = __builtin__.property(_get_link_protection) + setup_priority = __builtin__.property(_get_setup_priority) + hold_priority = __builtin__.property(_get_hold_priority) + signaling_type = __builtin__.property(_get_signaling_type) + path_metric_bounds = __builtin__.property(_get_path_metric_bounds) + path_affinities_values = __builtin__.property(_get_path_affinities_values) + path_affinity_names = __builtin__.property(_get_path_affinity_names) + path_srlgs_lists = __builtin__.property(_get_path_srlgs_lists) + path_srlgs_names = __builtin__.property(_get_path_srlgs_names) + disjointness = __builtin__.property(_get_disjointness) + + + _pyangbind_elements = OrderedDict([('te_bandwidth', te_bandwidth), ('link_protection', link_protection), ('setup_priority', setup_priority), ('hold_priority', hold_priority), ('signaling_type', signaling_type), ('path_metric_bounds', path_metric_bounds), ('path_affinities_values', path_affinities_values), ('path_affinity_names', path_affinity_names), ('path_srlgs_lists', path_srlgs_lists), ('path_srlgs_names', path_srlgs_names), ('disjointness', disjointness), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/path_affinities_values/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/path_affinities_values/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..4f42a2ac965c4fa925ad1564a0c10ecfb740670a --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/path_affinities_values/__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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 path_affinities_value +class path_affinities_values(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/path-constraints/path-affinities-values. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Path affinities represented as values. + """ + __slots__ = ('_path_helper', '_extmethods', '__path_affinities_value',) + + _yang_name = 'path-affinities-values' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__path_affinities_value = YANGDynClass(base=YANGListType("usage",path_affinities_value.path_affinities_value, yang_name="path-affinities-value", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-affinities-value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', 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 ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'path-constraints', 'path-affinities-values'] + + def _get_path_affinities_value(self): + """ + Getter method for path_affinities_value, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/path_affinities_values/path_affinities_value (list) + + YANG Description: List of named affinity constraints. + """ + return self.__path_affinities_value + + def _set_path_affinities_value(self, v, load=False): + """ + Setter method for path_affinities_value, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/path_affinities_values/path_affinities_value (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_affinities_value is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_affinities_value() directly. + + YANG Description: List of named affinity constraints. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("usage",path_affinities_value.path_affinities_value, yang_name="path-affinities-value", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-affinities-value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_affinities_value must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("usage",path_affinities_value.path_affinities_value, yang_name="path-affinities-value", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-affinities-value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False)""", + }) + + self.__path_affinities_value = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_affinities_value(self): + self.__path_affinities_value = YANGDynClass(base=YANGListType("usage",path_affinities_value.path_affinities_value, yang_name="path-affinities-value", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-affinities-value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + + path_affinities_value = __builtin__.property(_get_path_affinities_value) + + + _pyangbind_elements = OrderedDict([('path_affinities_value', path_affinities_value), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/path_affinities_values/path_affinities_value/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/path_affinities_values/path_affinities_value/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..cd1a2c6ed9f2b3f51b99eece2887f868581e32dc --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/path_affinities_values/path_affinities_value/__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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 path_affinities_value(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/path-constraints/path-affinities-values/path-affinities-value. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: List of named affinity constraints. + """ + __slots__ = ('_path_helper', '_extmethods', '__usage','__value',) + + _yang_name = 'path-affinities-value' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__usage = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + self.__value = YANGDynClass(base=[RestrictedClassType(base_type=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}), restriction_dict={'length': ['1..11']}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}),], default=six.text_type(""), is_leaf=True, yang_name="value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='admin-groups', 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 ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'path-constraints', 'path-affinities-values', 'path-affinities-value'] + + def _get_usage(self): + """ + Getter method for usage, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/path_affinities_values/path_affinities_value/usage (identityref) + + YANG Description: Identifies an entry in the list of value affinity +constraints. + """ + return self.__usage + + def _set_usage(self, v, load=False): + """ + Setter method for usage, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/path_affinities_values/path_affinities_value/usage (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_usage is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_usage() directly. + + YANG Description: Identifies an entry in the list of value affinity +constraints. + """ + 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=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """usage must be of a type compatible with identityref""", + 'defined-type': "ietf-te-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False)""", + }) + + self.__usage = t + if hasattr(self, '_set'): + self._set() + + def _unset_usage(self): + self.__usage = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + + + def _get_value(self): + """ + Getter method for value, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/path_affinities_values/path_affinities_value/value (admin-groups) + + YANG Description: The affinity value. The default is empty. + """ + return self.__value + + def _set_value(self, v, load=False): + """ + Setter method for value, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/path_affinities_values/path_affinities_value/value (admin-groups) + 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: The affinity value. The default is empty. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=[RestrictedClassType(base_type=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}), restriction_dict={'length': ['1..11']}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}),], default=six.text_type(""), is_leaf=True, yang_name="value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='admin-groups', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """value must be of a type compatible with admin-groups""", + 'defined-type': "ietf-te-topology:admin-groups", + 'generated-type': """YANGDynClass(base=[RestrictedClassType(base_type=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}), restriction_dict={'length': ['1..11']}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}),], default=six.text_type(""), is_leaf=True, yang_name="value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='admin-groups', is_config=False)""", + }) + + self.__value = t + if hasattr(self, '_set'): + self._set() + + def _unset_value(self): + self.__value = YANGDynClass(base=[RestrictedClassType(base_type=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}), restriction_dict={'length': ['1..11']}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}),], default=six.text_type(""), is_leaf=True, yang_name="value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='admin-groups', is_config=False) + + usage = __builtin__.property(_get_usage) + value = __builtin__.property(_get_value) + + + _pyangbind_elements = OrderedDict([('usage', usage), ('value', value), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/path_affinity_names/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/path_affinity_names/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..a7f5be85bb568b148da298ab2f818f682b5ddc88 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/path_affinity_names/__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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 path_affinity_name +class path_affinity_names(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/path-constraints/path-affinity-names. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Path affinities represented as names. + """ + __slots__ = ('_path_helper', '_extmethods', '__path_affinity_name',) + + _yang_name = 'path-affinity-names' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__path_affinity_name = YANGDynClass(base=YANGListType("usage",path_affinity_name.path_affinity_name, yang_name="path-affinity-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-affinity-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', 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 ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'path-constraints', 'path-affinity-names'] + + def _get_path_affinity_name(self): + """ + Getter method for path_affinity_name, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/path_affinity_names/path_affinity_name (list) + + YANG Description: List of named affinity constraints. + """ + return self.__path_affinity_name + + def _set_path_affinity_name(self, v, load=False): + """ + Setter method for path_affinity_name, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/path_affinity_names/path_affinity_name (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_affinity_name is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_affinity_name() directly. + + YANG Description: List of named affinity constraints. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("usage",path_affinity_name.path_affinity_name, yang_name="path-affinity-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-affinity-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_affinity_name must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("usage",path_affinity_name.path_affinity_name, yang_name="path-affinity-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-affinity-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False)""", + }) + + self.__path_affinity_name = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_affinity_name(self): + self.__path_affinity_name = YANGDynClass(base=YANGListType("usage",path_affinity_name.path_affinity_name, yang_name="path-affinity-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-affinity-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + + path_affinity_name = __builtin__.property(_get_path_affinity_name) + + + _pyangbind_elements = OrderedDict([('path_affinity_name', path_affinity_name), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/path_affinity_names/path_affinity_name/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/path_affinity_names/path_affinity_name/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..67a1ea760eb104298fb4c25115dc5f8fe023984e --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/path_affinity_names/path_affinity_name/__init__.py @@ -0,0 +1,162 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 affinity_name +class path_affinity_name(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/path-constraints/path-affinity-names/path-affinity-name. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: List of named affinity constraints. + """ + __slots__ = ('_path_helper', '_extmethods', '__usage','__affinity_name',) + + _yang_name = 'path-affinity-name' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__usage = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + self.__affinity_name = YANGDynClass(base=YANGListType("name",affinity_name.affinity_name, yang_name="affinity-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='name', extensions=None), is_container='list', yang_name="affinity-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', 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 ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'path-constraints', 'path-affinity-names', 'path-affinity-name'] + + def _get_usage(self): + """ + Getter method for usage, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/path_affinity_names/path_affinity_name/usage (identityref) + + YANG Description: Identifies an entry in the list of named affinity +constraints. + """ + return self.__usage + + def _set_usage(self, v, load=False): + """ + Setter method for usage, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/path_affinity_names/path_affinity_name/usage (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_usage is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_usage() directly. + + YANG Description: Identifies an entry in the list of named affinity +constraints. + """ + 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=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """usage must be of a type compatible with identityref""", + 'defined-type': "ietf-te-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False)""", + }) + + self.__usage = t + if hasattr(self, '_set'): + self._set() + + def _unset_usage(self): + self.__usage = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + + + def _get_affinity_name(self): + """ + Getter method for affinity_name, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/path_affinity_names/path_affinity_name/affinity_name (list) + + YANG Description: List of named affinities. + """ + return self.__affinity_name + + def _set_affinity_name(self, v, load=False): + """ + Setter method for affinity_name, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/path_affinity_names/path_affinity_name/affinity_name (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_affinity_name is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_affinity_name() directly. + + YANG Description: List of named affinities. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("name",affinity_name.affinity_name, yang_name="affinity-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='name', extensions=None), is_container='list', yang_name="affinity-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """affinity_name must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("name",affinity_name.affinity_name, yang_name="affinity-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='name', extensions=None), is_container='list', yang_name="affinity-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False)""", + }) + + self.__affinity_name = t + if hasattr(self, '_set'): + self._set() + + def _unset_affinity_name(self): + self.__affinity_name = YANGDynClass(base=YANGListType("name",affinity_name.affinity_name, yang_name="affinity-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='name', extensions=None), is_container='list', yang_name="affinity-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + + usage = __builtin__.property(_get_usage) + affinity_name = __builtin__.property(_get_affinity_name) + + + _pyangbind_elements = OrderedDict([('usage', usage), ('affinity_name', affinity_name), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/path_affinity_names/path_affinity_name/affinity_name/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/path_affinity_names/path_affinity_name/affinity_name/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e97d6d57e18426e05dd89e861117a2a2a45beb45 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/path_affinity_names/path_affinity_name/affinity_name/__init__.py @@ -0,0 +1,120 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 affinity_name(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/path-constraints/path-affinity-names/path-affinity-name/affinity-name. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: List of named affinities. + """ + __slots__ = ('_path_helper', '_extmethods', '__name',) + + _yang_name = 'affinity-name' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _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='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', 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 ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'path-constraints', 'path-affinity-names', 'path-affinity-name', 'affinity-name'] + + def _get_name(self): + """ + Getter method for name, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/path_affinity_names/path_affinity_name/affinity_name/name (string) + + YANG Description: Identifies a named affinity entry. + """ + return self.__name + + def _set_name(self, v, load=False): + """ + Setter method for name, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/path_affinity_names/path_affinity_name/affinity_name/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: Identifies a named affinity entry. + """ + 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='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', 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, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', 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, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=False) + + name = __builtin__.property(_get_name) + + + _pyangbind_elements = OrderedDict([('name', name), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/path_metric_bounds/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/path_metric_bounds/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..92e0cb519c0177c3546d84266e0e3e52d26e02e1 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/path_metric_bounds/__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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 path_metric_bound +class path_metric_bounds(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/path-constraints/path-metric-bounds. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: TE path metric bounds container. + """ + __slots__ = ('_path_helper', '_extmethods', '__path_metric_bound',) + + _yang_name = 'path-metric-bounds' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__path_metric_bound = YANGDynClass(base=YANGListType("metric_type",path_metric_bound.path_metric_bound, yang_name="path-metric-bound", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='metric-type', extensions=None), is_container='list', yang_name="path-metric-bound", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', 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 ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'path-constraints', 'path-metric-bounds'] + + def _get_path_metric_bound(self): + """ + Getter method for path_metric_bound, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/path_metric_bounds/path_metric_bound (list) + + YANG Description: List of TE path metric bounds. + """ + return self.__path_metric_bound + + def _set_path_metric_bound(self, v, load=False): + """ + Setter method for path_metric_bound, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/path_metric_bounds/path_metric_bound (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_metric_bound is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_metric_bound() directly. + + YANG Description: List of TE path metric bounds. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("metric_type",path_metric_bound.path_metric_bound, yang_name="path-metric-bound", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='metric-type', extensions=None), is_container='list', yang_name="path-metric-bound", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_metric_bound must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("metric_type",path_metric_bound.path_metric_bound, yang_name="path-metric-bound", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='metric-type', extensions=None), is_container='list', yang_name="path-metric-bound", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False)""", + }) + + self.__path_metric_bound = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_metric_bound(self): + self.__path_metric_bound = YANGDynClass(base=YANGListType("metric_type",path_metric_bound.path_metric_bound, yang_name="path-metric-bound", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='metric-type', extensions=None), is_container='list', yang_name="path-metric-bound", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + + path_metric_bound = __builtin__.property(_get_path_metric_bound) + + + _pyangbind_elements = OrderedDict([('path_metric_bound', path_metric_bound), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/path_metric_bounds/path_metric_bound/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/path_metric_bounds/path_metric_bound/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..74b7fca4e30b04b4713e4661b04e8fc25f1ceb0f --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/path_metric_bounds/path_metric_bound/__init__.py @@ -0,0 +1,165 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 path_metric_bound(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/path-constraints/path-metric-bounds/path-metric-bound. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: List of TE path metric bounds. + """ + __slots__ = ('_path_helper', '_extmethods', '__metric_type','__upper_bound',) + + _yang_name = 'path-metric-bound' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__metric_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="metric-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + self.__upper_bound = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), default=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64)(0), is_leaf=True, yang_name="upper-bound", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', 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 ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'path-constraints', 'path-metric-bounds', 'path-metric-bound'] + + def _get_metric_type(self): + """ + Getter method for metric_type, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/path_metric_bounds/path_metric_bound/metric_type (identityref) + + YANG Description: Identifies an entry in the list of 'metric-type' items +bound for the TE path. + """ + return self.__metric_type + + def _set_metric_type(self, v, load=False): + """ + Setter method for metric_type, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/path_metric_bounds/path_metric_bound/metric_type (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_metric_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_metric_type() directly. + + YANG Description: Identifies an entry in the list of 'metric-type' items +bound for the TE path. + """ + 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=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="metric-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """metric_type must be of a type compatible with identityref""", + 'defined-type': "ietf-te-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="metric-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False)""", + }) + + self.__metric_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_metric_type(self): + self.__metric_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="metric-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + + + def _get_upper_bound(self): + """ + Getter method for upper_bound, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/path_metric_bounds/path_metric_bound/upper_bound (uint64) + + YANG Description: Upper bound on the end-to-end TE path metric. A zero +indicates an unbounded upper limit for the specific +'metric-type'. + """ + return self.__upper_bound + + def _set_upper_bound(self, v, load=False): + """ + Setter method for upper_bound, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/path_metric_bounds/path_metric_bound/upper_bound (uint64) + If this variable is read-only (config: false) in the + source YANG file, then _set_upper_bound is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_upper_bound() directly. + + YANG Description: Upper bound on the end-to-end TE path metric. A zero +indicates an unbounded upper limit for the specific +'metric-type'. + """ + 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), default=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64)(0), is_leaf=True, yang_name="upper-bound", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint64', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """upper_bound 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), default=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64)(0), is_leaf=True, yang_name="upper-bound", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint64', is_config=False)""", + }) + + self.__upper_bound = t + if hasattr(self, '_set'): + self._set() + + def _unset_upper_bound(self): + self.__upper_bound = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), default=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64)(0), is_leaf=True, yang_name="upper-bound", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint64', is_config=False) + + metric_type = __builtin__.property(_get_metric_type) + upper_bound = __builtin__.property(_get_upper_bound) + + + _pyangbind_elements = OrderedDict([('metric_type', metric_type), ('upper_bound', upper_bound), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/path_srlgs_lists/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/path_srlgs_lists/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..8c1eb4e15c50fb4b2b179a918715e3d1bff3da85 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/path_srlgs_lists/__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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 path_srlgs_list +class path_srlgs_lists(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/path-constraints/path-srlgs-lists. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Path SRLG properties container. + """ + __slots__ = ('_path_helper', '_extmethods', '__path_srlgs_list',) + + _yang_name = 'path-srlgs-lists' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__path_srlgs_list = YANGDynClass(base=YANGListType("usage",path_srlgs_list.path_srlgs_list, yang_name="path-srlgs-list", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-srlgs-list", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', 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 ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'path-constraints', 'path-srlgs-lists'] + + def _get_path_srlgs_list(self): + """ + Getter method for path_srlgs_list, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/path_srlgs_lists/path_srlgs_list (list) + + YANG Description: List of SRLG values to be included or excluded. + """ + return self.__path_srlgs_list + + def _set_path_srlgs_list(self, v, load=False): + """ + Setter method for path_srlgs_list, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/path_srlgs_lists/path_srlgs_list (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_srlgs_list is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_srlgs_list() directly. + + YANG Description: List of SRLG values to be included or excluded. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("usage",path_srlgs_list.path_srlgs_list, yang_name="path-srlgs-list", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-srlgs-list", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_srlgs_list must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("usage",path_srlgs_list.path_srlgs_list, yang_name="path-srlgs-list", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-srlgs-list", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False)""", + }) + + self.__path_srlgs_list = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_srlgs_list(self): + self.__path_srlgs_list = YANGDynClass(base=YANGListType("usage",path_srlgs_list.path_srlgs_list, yang_name="path-srlgs-list", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-srlgs-list", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + + path_srlgs_list = __builtin__.property(_get_path_srlgs_list) + + + _pyangbind_elements = OrderedDict([('path_srlgs_list', path_srlgs_list), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/path_srlgs_lists/path_srlgs_list/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/path_srlgs_lists/path_srlgs_list/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..7ee7c8defc5c952669b20e50d97763f85e0c04bd --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/path_srlgs_lists/path_srlgs_list/__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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 path_srlgs_list(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/path-constraints/path-srlgs-lists/path-srlgs-list. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: List of SRLG values to be included or excluded. + """ + __slots__ = ('_path_helper', '_extmethods', '__usage','__values',) + + _yang_name = 'path-srlgs-list' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__usage = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + self.__values = YANGDynClass(unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32)), is_leaf=False, yang_name="values", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='srlg', 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 ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'path-constraints', 'path-srlgs-lists', 'path-srlgs-list'] + + def _get_usage(self): + """ + Getter method for usage, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/path_srlgs_lists/path_srlgs_list/usage (identityref) + + YANG Description: Identifies an entry in a list of SRLGs to either +include or exclude. + """ + return self.__usage + + def _set_usage(self, v, load=False): + """ + Setter method for usage, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/path_srlgs_lists/path_srlgs_list/usage (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_usage is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_usage() directly. + + YANG Description: Identifies an entry in a list of SRLGs to either +include or exclude. + """ + 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=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """usage must be of a type compatible with identityref""", + 'defined-type': "ietf-te-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False)""", + }) + + self.__usage = t + if hasattr(self, '_set'): + self._set() + + def _unset_usage(self): + self.__usage = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + + + def _get_values(self): + """ + Getter method for values, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/path_srlgs_lists/path_srlgs_list/values (srlg) + + YANG Description: List of SRLG values. + """ + return self.__values + + def _set_values(self, v, load=False): + """ + Setter method for values, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/path_srlgs_lists/path_srlgs_list/values (srlg) + If this variable is read-only (config: false) in the + source YANG file, then _set_values is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_values() directly. + + YANG Description: List of SRLG values. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32)), is_leaf=False, yang_name="values", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='srlg', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """values must be of a type compatible with srlg""", + 'defined-type': "ietf-te-topology:srlg", + 'generated-type': """YANGDynClass(unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32)), is_leaf=False, yang_name="values", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='srlg', is_config=False)""", + }) + + self.__values = t + if hasattr(self, '_set'): + self._set() + + def _unset_values(self): + self.__values = YANGDynClass(unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32)), is_leaf=False, yang_name="values", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='srlg', is_config=False) + + usage = __builtin__.property(_get_usage) + values = __builtin__.property(_get_values) + + + _pyangbind_elements = OrderedDict([('usage', usage), ('values', values), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/path_srlgs_names/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/path_srlgs_names/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..20ff89122cfb45e1661dc65ccc76397966048a27 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/path_srlgs_names/__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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 path_srlgs_name +class path_srlgs_names(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/path-constraints/path-srlgs-names. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Container for the list of named SRLGs. + """ + __slots__ = ('_path_helper', '_extmethods', '__path_srlgs_name',) + + _yang_name = 'path-srlgs-names' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__path_srlgs_name = YANGDynClass(base=YANGListType("usage",path_srlgs_name.path_srlgs_name, yang_name="path-srlgs-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-srlgs-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', 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 ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'path-constraints', 'path-srlgs-names'] + + def _get_path_srlgs_name(self): + """ + Getter method for path_srlgs_name, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/path_srlgs_names/path_srlgs_name (list) + + YANG Description: List of named SRLGs to be included or excluded. + """ + return self.__path_srlgs_name + + def _set_path_srlgs_name(self, v, load=False): + """ + Setter method for path_srlgs_name, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/path_srlgs_names/path_srlgs_name (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_srlgs_name is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_srlgs_name() directly. + + YANG Description: List of named SRLGs to be included or excluded. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("usage",path_srlgs_name.path_srlgs_name, yang_name="path-srlgs-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-srlgs-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_srlgs_name must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("usage",path_srlgs_name.path_srlgs_name, yang_name="path-srlgs-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-srlgs-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False)""", + }) + + self.__path_srlgs_name = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_srlgs_name(self): + self.__path_srlgs_name = YANGDynClass(base=YANGListType("usage",path_srlgs_name.path_srlgs_name, yang_name="path-srlgs-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-srlgs-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + + path_srlgs_name = __builtin__.property(_get_path_srlgs_name) + + + _pyangbind_elements = OrderedDict([('path_srlgs_name', path_srlgs_name), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/path_srlgs_names/path_srlgs_name/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/path_srlgs_names/path_srlgs_name/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e04c9a2781da176ef3d1222c83f85681406e79a9 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/path_srlgs_names/path_srlgs_name/__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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 path_srlgs_name(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/path-constraints/path-srlgs-names/path-srlgs-name. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: List of named SRLGs to be included or excluded. + """ + __slots__ = ('_path_helper', '_extmethods', '__usage','__names',) + + _yang_name = 'path-srlgs-name' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__usage = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + self.__names = YANGDynClass(unique=True, base=TypedListType(allowed_type=six.text_type), is_leaf=False, yang_name="names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', 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 ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'path-constraints', 'path-srlgs-names', 'path-srlgs-name'] + + def _get_usage(self): + """ + Getter method for usage, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/path_srlgs_names/path_srlgs_name/usage (identityref) + + YANG Description: Identifies an entry in a list of named SRLGs to either +include or exclude. + """ + return self.__usage + + def _set_usage(self, v, load=False): + """ + Setter method for usage, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/path_srlgs_names/path_srlgs_name/usage (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_usage is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_usage() directly. + + YANG Description: Identifies an entry in a list of named SRLGs to either +include or exclude. + """ + 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=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """usage must be of a type compatible with identityref""", + 'defined-type': "ietf-te-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False)""", + }) + + self.__usage = t + if hasattr(self, '_set'): + self._set() + + def _unset_usage(self): + self.__usage = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + + + def _get_names(self): + """ + Getter method for names, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/path_srlgs_names/path_srlgs_name/names (string) + + YANG Description: List of named SRLGs. + """ + return self.__names + + def _set_names(self, v, load=False): + """ + Setter method for names, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/path_srlgs_names/path_srlgs_name/names (string) + If this variable is read-only (config: false) in the + source YANG file, then _set_names is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_names() directly. + + YANG Description: List of named SRLGs. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,unique=True, base=TypedListType(allowed_type=six.text_type), is_leaf=False, yang_name="names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """names must be of a type compatible with string""", + 'defined-type': "string", + 'generated-type': """YANGDynClass(unique=True, base=TypedListType(allowed_type=six.text_type), is_leaf=False, yang_name="names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=False)""", + }) + + self.__names = t + if hasattr(self, '_set'): + self._set() + + def _unset_names(self): + self.__names = YANGDynClass(unique=True, base=TypedListType(allowed_type=six.text_type), is_leaf=False, yang_name="names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=False) + + usage = __builtin__.property(_get_usage) + names = __builtin__.property(_get_names) + + + _pyangbind_elements = OrderedDict([('usage', usage), ('names', names), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/te_bandwidth/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/te_bandwidth/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..04440580661e25de34ef575a3dfbbae674d36f17 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/te_bandwidth/__init__.py @@ -0,0 +1,195 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 otn +class te_bandwidth(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/path-constraints/te-bandwidth. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Container that specifies TE bandwidth. The choices +can be augmented for specific data-plane technologies. + """ + __slots__ = ('_path_helper', '_extmethods', '__generic','__otn','__eth_bandwidth',) + + _yang_name = 'te-bandwidth' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__generic = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+(,(0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+))*'}), is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-bandwidth', is_config=False) + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False) + self.__eth_bandwidth = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), restriction_dict={'range': ['0..10000000000']}), is_leaf=True, yang_name="eth-bandwidth", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', 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 ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'path-constraints', 'te-bandwidth'] + + def _get_generic(self): + """ + Getter method for generic, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/te_bandwidth/generic (te-bandwidth) + + YANG Description: Bandwidth specified in a generic format. + """ + return self.__generic + + def _set_generic(self, v, load=False): + """ + Setter method for generic, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/te_bandwidth/generic (te-bandwidth) + If this variable is read-only (config: false) in the + source YANG file, then _set_generic is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_generic() directly. + + YANG Description: Bandwidth specified in a generic format. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+(,(0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+))*'}), is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-bandwidth', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """generic must be of a type compatible with te-bandwidth""", + 'defined-type': "ietf-te-topology:te-bandwidth", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+(,(0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+))*'}), is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-bandwidth', is_config=False)""", + }) + + self.__generic = t + if hasattr(self, '_set'): + self._set() + + def _unset_generic(self): + self.__generic = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+(,(0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+))*'}), is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-bandwidth', is_config=False) + + + def _get_otn(self): + """ + Getter method for otn, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/te_bandwidth/otn (container) + + YANG Description: Bandwidth attributes for OTN links + """ + return self.__otn + + def _set_otn(self, v, load=False): + """ + Setter method for otn, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/te_bandwidth/otn (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_otn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_otn() directly. + + YANG Description: Bandwidth attributes for OTN links + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """otn must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False)""", + }) + + self.__otn = t + if hasattr(self, '_set'): + self._set() + + def _unset_otn(self): + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False) + + + def _get_eth_bandwidth(self): + """ + Getter method for eth_bandwidth, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/te_bandwidth/eth_bandwidth (uint64) + + YANG Description: Available bandwith value expressed in kilobits per second + """ + return self.__eth_bandwidth + + def _set_eth_bandwidth(self, v, load=False): + """ + Setter method for eth_bandwidth, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/te_bandwidth/eth_bandwidth (uint64) + If this variable is read-only (config: false) in the + source YANG file, then _set_eth_bandwidth is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_eth_bandwidth() directly. + + YANG Description: Available bandwith value expressed in kilobits per second + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), restriction_dict={'range': ['0..10000000000']}), is_leaf=True, yang_name="eth-bandwidth", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint64', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """eth_bandwidth must be of a type compatible with uint64""", + 'defined-type': "uint64", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), restriction_dict={'range': ['0..10000000000']}), is_leaf=True, yang_name="eth-bandwidth", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint64', is_config=False)""", + }) + + self.__eth_bandwidth = t + if hasattr(self, '_set'): + self._set() + + def _unset_eth_bandwidth(self): + self.__eth_bandwidth = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), restriction_dict={'range': ['0..10000000000']}), is_leaf=True, yang_name="eth-bandwidth", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint64', is_config=False) + + generic = __builtin__.property(_get_generic) + otn = __builtin__.property(_get_otn) + eth_bandwidth = __builtin__.property(_get_eth_bandwidth) + + __choices__ = {'technology': {'generic': ['generic'], 'otn': ['otn'], 'eth': ['eth_bandwidth']}} + _pyangbind_elements = OrderedDict([('generic', generic), ('otn', otn), ('eth_bandwidth', eth_bandwidth), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/te_bandwidth/otn/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/te_bandwidth/otn/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..cf1f3bd4cf63ab45b04b7246e08f9355ffa9beec --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/te_bandwidth/otn/__init__.py @@ -0,0 +1,163 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 odulist +class otn(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/path-constraints/te-bandwidth/otn. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Bandwidth attributes for OTN links + """ + __slots__ = ('_path_helper', '_extmethods', '__odulist','__odtu_flex_type',) + + _yang_name = 'otn' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__odulist = YANGDynClass(base=YANGListType("odu_type",odulist.odulist, yang_name="odulist", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='odu-type', extensions=None, choice=('technology', 'otn')), is_container='list', yang_name="odulist", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='list', is_config=False) + self.__odtu_flex_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'2': {}, '3': {}, '4': {}, 'Cn': {}},), is_leaf=True, yang_name="odtu-flex-type", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='l1-types:odtu-flex-type', 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 ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'path-constraints', 'te-bandwidth', 'otn'] + + def _get_odulist(self): + """ + Getter method for odulist, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/te_bandwidth/otn/odulist (list) + + YANG Description: OTN bandwidth definition + """ + return self.__odulist + + def _set_odulist(self, v, load=False): + """ + Setter method for odulist, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/te_bandwidth/otn/odulist (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_odulist is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_odulist() directly. + + YANG Description: OTN bandwidth definition + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("odu_type",odulist.odulist, yang_name="odulist", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='odu-type', extensions=None, choice=('technology', 'otn')), is_container='list', yang_name="odulist", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='list', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """odulist must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("odu_type",odulist.odulist, yang_name="odulist", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='odu-type', extensions=None, choice=('technology', 'otn')), is_container='list', yang_name="odulist", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='list', is_config=False)""", + }) + + self.__odulist = t + if hasattr(self, '_set'): + self._set() + + def _unset_odulist(self): + self.__odulist = YANGDynClass(base=YANGListType("odu_type",odulist.odulist, yang_name="odulist", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='odu-type', extensions=None, choice=('technology', 'otn')), is_container='list', yang_name="odulist", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='list', is_config=False) + + + def _get_odtu_flex_type(self): + """ + Getter method for odtu_flex_type, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/te_bandwidth/otn/odtu_flex_type (l1-types:odtu-flex-type) + + YANG Description: The type of Optical Data Tributary Unit (ODTU) +whose nominal bitrate is used to compute the number of +Tributary Slots (TS) required by the ODUflex LSPs +set up along the underlay paths of these OTN +connectivity matrices. + """ + return self.__odtu_flex_type + + def _set_odtu_flex_type(self, v, load=False): + """ + Setter method for odtu_flex_type, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/te_bandwidth/otn/odtu_flex_type (l1-types:odtu-flex-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_odtu_flex_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_odtu_flex_type() directly. + + YANG Description: The type of Optical Data Tributary Unit (ODTU) +whose nominal bitrate is used to compute the number of +Tributary Slots (TS) required by the ODUflex LSPs +set up along the underlay paths of these OTN +connectivity matrices. + """ + 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={'2': {}, '3': {}, '4': {}, 'Cn': {}},), is_leaf=True, yang_name="odtu-flex-type", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='l1-types:odtu-flex-type', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """odtu_flex_type must be of a type compatible with l1-types:odtu-flex-type""", + 'defined-type': "l1-types:odtu-flex-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'2': {}, '3': {}, '4': {}, 'Cn': {}},), is_leaf=True, yang_name="odtu-flex-type", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='l1-types:odtu-flex-type', is_config=False)""", + }) + + self.__odtu_flex_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_odtu_flex_type(self): + self.__odtu_flex_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'2': {}, '3': {}, '4': {}, 'Cn': {}},), is_leaf=True, yang_name="odtu-flex-type", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='l1-types:odtu-flex-type', is_config=False) + + odulist = __builtin__.property(_get_odulist) + odtu_flex_type = __builtin__.property(_get_odtu_flex_type) + + __choices__ = {'technology': {'otn': ['odulist', 'odtu_flex_type']}} + _pyangbind_elements = OrderedDict([('odulist', odulist), ('odtu_flex_type', odtu_flex_type), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/te_bandwidth/otn/odulist/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/te_bandwidth/otn/odulist/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..4e9960a676e9d864f505ae65a0d66de711d9b9cd --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/te_bandwidth/otn/odulist/__init__.py @@ -0,0 +1,200 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 odulist(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/path-constraints/te-bandwidth/otn/odulist. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: OTN bandwidth definition + """ + __slots__ = ('_path_helper', '_extmethods', '__odu_type','__number','__ts_number',) + + _yang_name = 'odulist' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__odu_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="odu-type", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=False) + self.__number = YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), is_leaf=True, yang_name="number", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', is_config=False) + self.__ts_number = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts-number", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', 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 ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'path-constraints', 'te-bandwidth', 'otn', 'odulist'] + + def _get_odu_type(self): + """ + Getter method for odu_type, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/te_bandwidth/otn/odulist/odu_type (identityref) + + YANG Description: ODU type + """ + return self.__odu_type + + def _set_odu_type(self, v, load=False): + """ + Setter method for odu_type, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/te_bandwidth/otn/odulist/odu_type (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_odu_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_odu_type() directly. + + YANG Description: ODU type + """ + 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=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="odu-type", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """odu_type must be of a type compatible with identityref""", + 'defined-type': "ietf-otn-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="odu-type", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=False)""", + }) + + self.__odu_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_odu_type(self): + self.__odu_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="odu-type", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=False) + + + def _get_number(self): + """ + Getter method for number, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/te_bandwidth/otn/odulist/number (uint16) + + YANG Description: Number of ODUs + """ + return self.__number + + def _set_number(self, v, load=False): + """ + Setter method for number, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/te_bandwidth/otn/odulist/number (uint16) + If this variable is read-only (config: false) in the + source YANG file, then _set_number is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_number() directly. + + YANG Description: Number of ODUs + """ + 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="number", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """number 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="number", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', is_config=False)""", + }) + + self.__number = t + if hasattr(self, '_set'): + self._set() + + def _unset_number(self): + self.__number = YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), is_leaf=True, yang_name="number", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', is_config=False) + + + def _get_ts_number(self): + """ + Getter method for ts_number, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/te_bandwidth/otn/odulist/ts_number (uint16) + + YANG Description: The number of Tributary Slots (TS) that +could be used by all the ODUflex LSPs. + """ + return self.__ts_number + + def _set_ts_number(self, v, load=False): + """ + Setter method for ts_number, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/te_bandwidth/otn/odulist/ts_number (uint16) + If this variable is read-only (config: false) in the + source YANG file, then _set_ts_number is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_ts_number() directly. + + YANG Description: The number of Tributary Slots (TS) that +could be used by all the ODUflex LSPs. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts-number", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """ts_number must be of a type compatible with uint16""", + 'defined-type': "uint16", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts-number", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', is_config=False)""", + }) + + self.__ts_number = t + if hasattr(self, '_set'): + self._set() + + def _unset_ts_number(self): + self.__ts_number = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts-number", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', is_config=False) + + odu_type = __builtin__.property(_get_odu_type) + number = __builtin__.property(_get_number) + ts_number = __builtin__.property(_get_ts_number) + + __choices__ = {'technology': {'otn': ['odu_type', 'number', 'ts_number']}} + _pyangbind_elements = OrderedDict([('odu_type', odu_type), ('number', number), ('ts_number', ts_number), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..dfb5797aa3d093195bd4cb1933b18ef5a5a577ff --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/__init__.py @@ -0,0 +1,318 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 path_metric +from . import path_affinities_values +from . import path_affinity_names +from . import path_srlgs_lists +from . import path_srlgs_names +from . import path_route_objects +class path_properties(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/path-properties. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: The TE path properties. + """ + __slots__ = ('_path_helper', '_extmethods', '__path_metric','__path_affinities_values','__path_affinity_names','__path_srlgs_lists','__path_srlgs_names','__path_route_objects',) + + _yang_name = 'path-properties' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__path_metric = YANGDynClass(base=YANGListType("metric_type",path_metric.path_metric, yang_name="path-metric", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='metric-type', extensions=None), is_container='list', yang_name="path-metric", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + self.__path_affinities_values = YANGDynClass(base=path_affinities_values.path_affinities_values, is_container='container', yang_name="path-affinities-values", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__path_affinity_names = YANGDynClass(base=path_affinity_names.path_affinity_names, is_container='container', yang_name="path-affinity-names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__path_srlgs_lists = YANGDynClass(base=path_srlgs_lists.path_srlgs_lists, is_container='container', yang_name="path-srlgs-lists", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__path_srlgs_names = YANGDynClass(base=path_srlgs_names.path_srlgs_names, is_container='container', yang_name="path-srlgs-names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__path_route_objects = YANGDynClass(base=path_route_objects.path_route_objects, is_container='container', yang_name="path-route-objects", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', 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 ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'path-properties'] + + def _get_path_metric(self): + """ + Getter method for path_metric, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_metric (list) + + YANG Description: TE path metric type. + """ + return self.__path_metric + + def _set_path_metric(self, v, load=False): + """ + Setter method for path_metric, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_metric (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_metric is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_metric() directly. + + YANG Description: TE path metric type. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("metric_type",path_metric.path_metric, yang_name="path-metric", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='metric-type', extensions=None), is_container='list', yang_name="path-metric", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_metric must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("metric_type",path_metric.path_metric, yang_name="path-metric", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='metric-type', extensions=None), is_container='list', yang_name="path-metric", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False)""", + }) + + self.__path_metric = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_metric(self): + self.__path_metric = YANGDynClass(base=YANGListType("metric_type",path_metric.path_metric, yang_name="path-metric", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='metric-type', extensions=None), is_container='list', yang_name="path-metric", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + + + def _get_path_affinities_values(self): + """ + Getter method for path_affinities_values, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_affinities_values (container) + + YANG Description: Path affinities represented as values. + """ + return self.__path_affinities_values + + def _set_path_affinities_values(self, v, load=False): + """ + Setter method for path_affinities_values, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_affinities_values (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_affinities_values is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_affinities_values() directly. + + YANG Description: Path affinities represented as values. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=path_affinities_values.path_affinities_values, is_container='container', yang_name="path-affinities-values", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_affinities_values must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=path_affinities_values.path_affinities_values, is_container='container', yang_name="path-affinities-values", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__path_affinities_values = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_affinities_values(self): + self.__path_affinities_values = YANGDynClass(base=path_affinities_values.path_affinities_values, is_container='container', yang_name="path-affinities-values", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_path_affinity_names(self): + """ + Getter method for path_affinity_names, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_affinity_names (container) + + YANG Description: Path affinities represented as names. + """ + return self.__path_affinity_names + + def _set_path_affinity_names(self, v, load=False): + """ + Setter method for path_affinity_names, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_affinity_names (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_affinity_names is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_affinity_names() directly. + + YANG Description: Path affinities represented as names. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=path_affinity_names.path_affinity_names, is_container='container', yang_name="path-affinity-names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_affinity_names must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=path_affinity_names.path_affinity_names, is_container='container', yang_name="path-affinity-names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__path_affinity_names = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_affinity_names(self): + self.__path_affinity_names = YANGDynClass(base=path_affinity_names.path_affinity_names, is_container='container', yang_name="path-affinity-names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_path_srlgs_lists(self): + """ + Getter method for path_srlgs_lists, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_srlgs_lists (container) + + YANG Description: Path SRLG properties container. + """ + return self.__path_srlgs_lists + + def _set_path_srlgs_lists(self, v, load=False): + """ + Setter method for path_srlgs_lists, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_srlgs_lists (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_srlgs_lists is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_srlgs_lists() directly. + + YANG Description: Path SRLG properties container. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=path_srlgs_lists.path_srlgs_lists, is_container='container', yang_name="path-srlgs-lists", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_srlgs_lists must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=path_srlgs_lists.path_srlgs_lists, is_container='container', yang_name="path-srlgs-lists", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__path_srlgs_lists = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_srlgs_lists(self): + self.__path_srlgs_lists = YANGDynClass(base=path_srlgs_lists.path_srlgs_lists, is_container='container', yang_name="path-srlgs-lists", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_path_srlgs_names(self): + """ + Getter method for path_srlgs_names, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_srlgs_names (container) + + YANG Description: Container for the list of named SRLGs. + """ + return self.__path_srlgs_names + + def _set_path_srlgs_names(self, v, load=False): + """ + Setter method for path_srlgs_names, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_srlgs_names (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_srlgs_names is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_srlgs_names() directly. + + YANG Description: Container for the list of named SRLGs. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=path_srlgs_names.path_srlgs_names, is_container='container', yang_name="path-srlgs-names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_srlgs_names must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=path_srlgs_names.path_srlgs_names, is_container='container', yang_name="path-srlgs-names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__path_srlgs_names = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_srlgs_names(self): + self.__path_srlgs_names = YANGDynClass(base=path_srlgs_names.path_srlgs_names, is_container='container', yang_name="path-srlgs-names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_path_route_objects(self): + """ + Getter method for path_route_objects, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_route_objects (container) + + YANG Description: Container for the list of route objects either returned by +the computation engine or actually used by an LSP. + """ + return self.__path_route_objects + + def _set_path_route_objects(self, v, load=False): + """ + Setter method for path_route_objects, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_route_objects (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_route_objects is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_route_objects() directly. + + YANG Description: Container for the list of route objects either returned by +the computation engine or actually used by an LSP. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=path_route_objects.path_route_objects, is_container='container', yang_name="path-route-objects", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_route_objects must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=path_route_objects.path_route_objects, is_container='container', yang_name="path-route-objects", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__path_route_objects = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_route_objects(self): + self.__path_route_objects = YANGDynClass(base=path_route_objects.path_route_objects, is_container='container', yang_name="path-route-objects", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + path_metric = __builtin__.property(_get_path_metric) + path_affinities_values = __builtin__.property(_get_path_affinities_values) + path_affinity_names = __builtin__.property(_get_path_affinity_names) + path_srlgs_lists = __builtin__.property(_get_path_srlgs_lists) + path_srlgs_names = __builtin__.property(_get_path_srlgs_names) + path_route_objects = __builtin__.property(_get_path_route_objects) + + + _pyangbind_elements = OrderedDict([('path_metric', path_metric), ('path_affinities_values', path_affinities_values), ('path_affinity_names', path_affinity_names), ('path_srlgs_lists', path_srlgs_lists), ('path_srlgs_names', path_srlgs_names), ('path_route_objects', path_route_objects), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_affinities_values/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_affinities_values/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..88aefb9b671fbdd1c8720152972b52e5271fbf68 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_affinities_values/__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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 path_affinities_value +class path_affinities_values(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/path-properties/path-affinities-values. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Path affinities represented as values. + """ + __slots__ = ('_path_helper', '_extmethods', '__path_affinities_value',) + + _yang_name = 'path-affinities-values' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__path_affinities_value = YANGDynClass(base=YANGListType("usage",path_affinities_value.path_affinities_value, yang_name="path-affinities-value", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-affinities-value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', 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 ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'path-properties', 'path-affinities-values'] + + def _get_path_affinities_value(self): + """ + Getter method for path_affinities_value, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_affinities_values/path_affinities_value (list) + + YANG Description: List of named affinity constraints. + """ + return self.__path_affinities_value + + def _set_path_affinities_value(self, v, load=False): + """ + Setter method for path_affinities_value, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_affinities_values/path_affinities_value (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_affinities_value is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_affinities_value() directly. + + YANG Description: List of named affinity constraints. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("usage",path_affinities_value.path_affinities_value, yang_name="path-affinities-value", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-affinities-value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_affinities_value must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("usage",path_affinities_value.path_affinities_value, yang_name="path-affinities-value", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-affinities-value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False)""", + }) + + self.__path_affinities_value = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_affinities_value(self): + self.__path_affinities_value = YANGDynClass(base=YANGListType("usage",path_affinities_value.path_affinities_value, yang_name="path-affinities-value", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-affinities-value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + + path_affinities_value = __builtin__.property(_get_path_affinities_value) + + + _pyangbind_elements = OrderedDict([('path_affinities_value', path_affinities_value), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_affinities_values/path_affinities_value/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_affinities_values/path_affinities_value/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..92f7c32355251a17b249c68bc1e6ccf202951ddb --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_affinities_values/path_affinities_value/__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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 path_affinities_value(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/path-properties/path-affinities-values/path-affinities-value. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: List of named affinity constraints. + """ + __slots__ = ('_path_helper', '_extmethods', '__usage','__value',) + + _yang_name = 'path-affinities-value' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__usage = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + self.__value = YANGDynClass(base=[RestrictedClassType(base_type=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}), restriction_dict={'length': ['1..11']}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}),], default=six.text_type(""), is_leaf=True, yang_name="value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='admin-groups', 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 ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'path-properties', 'path-affinities-values', 'path-affinities-value'] + + def _get_usage(self): + """ + Getter method for usage, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_affinities_values/path_affinities_value/usage (identityref) + + YANG Description: Identifies an entry in the list of value affinity +constraints. + """ + return self.__usage + + def _set_usage(self, v, load=False): + """ + Setter method for usage, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_affinities_values/path_affinities_value/usage (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_usage is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_usage() directly. + + YANG Description: Identifies an entry in the list of value affinity +constraints. + """ + 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=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """usage must be of a type compatible with identityref""", + 'defined-type': "ietf-te-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False)""", + }) + + self.__usage = t + if hasattr(self, '_set'): + self._set() + + def _unset_usage(self): + self.__usage = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + + + def _get_value(self): + """ + Getter method for value, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_affinities_values/path_affinities_value/value (admin-groups) + + YANG Description: The affinity value. The default is empty. + """ + return self.__value + + def _set_value(self, v, load=False): + """ + Setter method for value, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_affinities_values/path_affinities_value/value (admin-groups) + 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: The affinity value. The default is empty. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=[RestrictedClassType(base_type=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}), restriction_dict={'length': ['1..11']}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}),], default=six.text_type(""), is_leaf=True, yang_name="value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='admin-groups', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """value must be of a type compatible with admin-groups""", + 'defined-type': "ietf-te-topology:admin-groups", + 'generated-type': """YANGDynClass(base=[RestrictedClassType(base_type=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}), restriction_dict={'length': ['1..11']}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}),], default=six.text_type(""), is_leaf=True, yang_name="value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='admin-groups', is_config=False)""", + }) + + self.__value = t + if hasattr(self, '_set'): + self._set() + + def _unset_value(self): + self.__value = YANGDynClass(base=[RestrictedClassType(base_type=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}), restriction_dict={'length': ['1..11']}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}),], default=six.text_type(""), is_leaf=True, yang_name="value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='admin-groups', is_config=False) + + usage = __builtin__.property(_get_usage) + value = __builtin__.property(_get_value) + + + _pyangbind_elements = OrderedDict([('usage', usage), ('value', value), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_affinity_names/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_affinity_names/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..9b9de5d168552bfa7fbc459f2c5205ebeba73ca7 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_affinity_names/__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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 path_affinity_name +class path_affinity_names(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/path-properties/path-affinity-names. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Path affinities represented as names. + """ + __slots__ = ('_path_helper', '_extmethods', '__path_affinity_name',) + + _yang_name = 'path-affinity-names' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__path_affinity_name = YANGDynClass(base=YANGListType("usage",path_affinity_name.path_affinity_name, yang_name="path-affinity-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-affinity-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', 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 ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'path-properties', 'path-affinity-names'] + + def _get_path_affinity_name(self): + """ + Getter method for path_affinity_name, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_affinity_names/path_affinity_name (list) + + YANG Description: List of named affinity constraints. + """ + return self.__path_affinity_name + + def _set_path_affinity_name(self, v, load=False): + """ + Setter method for path_affinity_name, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_affinity_names/path_affinity_name (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_affinity_name is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_affinity_name() directly. + + YANG Description: List of named affinity constraints. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("usage",path_affinity_name.path_affinity_name, yang_name="path-affinity-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-affinity-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_affinity_name must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("usage",path_affinity_name.path_affinity_name, yang_name="path-affinity-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-affinity-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False)""", + }) + + self.__path_affinity_name = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_affinity_name(self): + self.__path_affinity_name = YANGDynClass(base=YANGListType("usage",path_affinity_name.path_affinity_name, yang_name="path-affinity-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-affinity-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + + path_affinity_name = __builtin__.property(_get_path_affinity_name) + + + _pyangbind_elements = OrderedDict([('path_affinity_name', path_affinity_name), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_affinity_names/path_affinity_name/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_affinity_names/path_affinity_name/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..ae1ed41e1af5db040ceabf8a54508fed604daebe --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_affinity_names/path_affinity_name/__init__.py @@ -0,0 +1,162 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 affinity_name +class path_affinity_name(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/path-properties/path-affinity-names/path-affinity-name. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: List of named affinity constraints. + """ + __slots__ = ('_path_helper', '_extmethods', '__usage','__affinity_name',) + + _yang_name = 'path-affinity-name' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__usage = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + self.__affinity_name = YANGDynClass(base=YANGListType("name",affinity_name.affinity_name, yang_name="affinity-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='name', extensions=None), is_container='list', yang_name="affinity-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', 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 ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'path-properties', 'path-affinity-names', 'path-affinity-name'] + + def _get_usage(self): + """ + Getter method for usage, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_affinity_names/path_affinity_name/usage (identityref) + + YANG Description: Identifies an entry in the list of named affinity +constraints. + """ + return self.__usage + + def _set_usage(self, v, load=False): + """ + Setter method for usage, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_affinity_names/path_affinity_name/usage (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_usage is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_usage() directly. + + YANG Description: Identifies an entry in the list of named affinity +constraints. + """ + 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=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """usage must be of a type compatible with identityref""", + 'defined-type': "ietf-te-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False)""", + }) + + self.__usage = t + if hasattr(self, '_set'): + self._set() + + def _unset_usage(self): + self.__usage = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + + + def _get_affinity_name(self): + """ + Getter method for affinity_name, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_affinity_names/path_affinity_name/affinity_name (list) + + YANG Description: List of named affinities. + """ + return self.__affinity_name + + def _set_affinity_name(self, v, load=False): + """ + Setter method for affinity_name, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_affinity_names/path_affinity_name/affinity_name (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_affinity_name is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_affinity_name() directly. + + YANG Description: List of named affinities. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("name",affinity_name.affinity_name, yang_name="affinity-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='name', extensions=None), is_container='list', yang_name="affinity-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """affinity_name must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("name",affinity_name.affinity_name, yang_name="affinity-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='name', extensions=None), is_container='list', yang_name="affinity-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False)""", + }) + + self.__affinity_name = t + if hasattr(self, '_set'): + self._set() + + def _unset_affinity_name(self): + self.__affinity_name = YANGDynClass(base=YANGListType("name",affinity_name.affinity_name, yang_name="affinity-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='name', extensions=None), is_container='list', yang_name="affinity-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + + usage = __builtin__.property(_get_usage) + affinity_name = __builtin__.property(_get_affinity_name) + + + _pyangbind_elements = OrderedDict([('usage', usage), ('affinity_name', affinity_name), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_affinity_names/path_affinity_name/affinity_name/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_affinity_names/path_affinity_name/affinity_name/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..73aa7bee9ec3a83fb61ab5e3219952f8af45524b --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_affinity_names/path_affinity_name/affinity_name/__init__.py @@ -0,0 +1,120 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 affinity_name(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/path-properties/path-affinity-names/path-affinity-name/affinity-name. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: List of named affinities. + """ + __slots__ = ('_path_helper', '_extmethods', '__name',) + + _yang_name = 'affinity-name' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _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='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', 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 ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'path-properties', 'path-affinity-names', 'path-affinity-name', 'affinity-name'] + + def _get_name(self): + """ + Getter method for name, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_affinity_names/path_affinity_name/affinity_name/name (string) + + YANG Description: Identifies a named affinity entry. + """ + return self.__name + + def _set_name(self, v, load=False): + """ + Setter method for name, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_affinity_names/path_affinity_name/affinity_name/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: Identifies a named affinity entry. + """ + 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='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', 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, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', 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, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=False) + + name = __builtin__.property(_get_name) + + + _pyangbind_elements = OrderedDict([('name', name), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_metric/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_metric/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..71b3184bdcc6e82a69a7839b674e70a57f1e92a9 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_metric/__init__.py @@ -0,0 +1,159 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 path_metric(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/path-properties/path-metric. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: TE path metric type. + """ + __slots__ = ('_path_helper', '_extmethods', '__metric_type','__accumulative_value',) + + _yang_name = 'path-metric' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__metric_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="metric-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + self.__accumulative_value = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="accumulative-value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', 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 ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'path-properties', 'path-metric'] + + def _get_metric_type(self): + """ + Getter method for metric_type, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_metric/metric_type (identityref) + + YANG Description: TE path metric type. + """ + return self.__metric_type + + def _set_metric_type(self, v, load=False): + """ + Setter method for metric_type, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_metric/metric_type (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_metric_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_metric_type() directly. + + YANG Description: TE path metric type. + """ + 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=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="metric-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """metric_type must be of a type compatible with identityref""", + 'defined-type': "ietf-te-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="metric-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False)""", + }) + + self.__metric_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_metric_type(self): + self.__metric_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="metric-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + + + def _get_accumulative_value(self): + """ + Getter method for accumulative_value, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_metric/accumulative_value (uint64) + + YANG Description: TE path metric accumulative value. + """ + return self.__accumulative_value + + def _set_accumulative_value(self, v, load=False): + """ + Setter method for accumulative_value, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_metric/accumulative_value (uint64) + If this variable is read-only (config: false) in the + source YANG file, then _set_accumulative_value is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_accumulative_value() directly. + + YANG Description: TE path metric accumulative value. + """ + 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="accumulative-value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint64', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """accumulative_value 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="accumulative-value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint64', is_config=False)""", + }) + + self.__accumulative_value = t + if hasattr(self, '_set'): + self._set() + + def _unset_accumulative_value(self): + self.__accumulative_value = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="accumulative-value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint64', is_config=False) + + metric_type = __builtin__.property(_get_metric_type) + accumulative_value = __builtin__.property(_get_accumulative_value) + + + _pyangbind_elements = OrderedDict([('metric_type', metric_type), ('accumulative_value', accumulative_value), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_route_objects/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_route_objects/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..b21cd85db7343db1d0f947229cd1d08910d6fb9f --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_route_objects/__init__.py @@ -0,0 +1,119 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 path_route_object +class path_route_objects(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/path-properties/path-route-objects. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Container for the list of route objects either returned by +the computation engine or actually used by an LSP. + """ + __slots__ = ('_path_helper', '_extmethods', '__path_route_object',) + + _yang_name = 'path-route-objects' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__path_route_object = YANGDynClass(base=YANGListType("index",path_route_object.path_route_object, yang_name="path-route-object", parent=self, is_container='list', user_ordered=True, path_helper=self._path_helper, yang_keys='index', extensions=None), is_container='list', yang_name="path-route-object", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', 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 ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'path-properties', 'path-route-objects'] + + def _get_path_route_object(self): + """ + Getter method for path_route_object, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_route_objects/path_route_object (list) + + YANG Description: List of route objects either returned by the computation +engine or actually used by an LSP. + """ + return self.__path_route_object + + def _set_path_route_object(self, v, load=False): + """ + Setter method for path_route_object, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_route_objects/path_route_object (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_route_object is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_route_object() directly. + + YANG Description: List of route objects either returned by the computation +engine or actually used by an LSP. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("index",path_route_object.path_route_object, yang_name="path-route-object", parent=self, is_container='list', user_ordered=True, path_helper=self._path_helper, yang_keys='index', extensions=None), is_container='list', yang_name="path-route-object", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_route_object must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("index",path_route_object.path_route_object, yang_name="path-route-object", parent=self, is_container='list', user_ordered=True, path_helper=self._path_helper, yang_keys='index', extensions=None), is_container='list', yang_name="path-route-object", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False)""", + }) + + self.__path_route_object = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_route_object(self): + self.__path_route_object = YANGDynClass(base=YANGListType("index",path_route_object.path_route_object, yang_name="path-route-object", parent=self, is_container='list', user_ordered=True, path_helper=self._path_helper, yang_keys='index', extensions=None), is_container='list', yang_name="path-route-object", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + + path_route_object = __builtin__.property(_get_path_route_object) + + + _pyangbind_elements = OrderedDict([('path_route_object', path_route_object), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_route_objects/path_route_object/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_route_objects/path_route_object/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..c2331faf9d4ed964e117e9a2bbc7d1d954f54248 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_route_objects/path_route_object/__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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 numbered_node_hop +from . import numbered_link_hop +from . import unnumbered_link_hop +from . import as_number_hop +from . import label_hop +class path_route_object(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/path-properties/path-route-objects/path-route-object. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: List of route objects either returned by the computation +engine or actually used by an LSP. + """ + __slots__ = ('_path_helper', '_extmethods', '__index','__numbered_node_hop','__numbered_link_hop','__unnumbered_link_hop','__as_number_hop','__label_hop',) + + _yang_name = 'path-route-object' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _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), is_leaf=True, yang_name="index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=False) + self.__numbered_node_hop = YANGDynClass(base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__numbered_link_hop = YANGDynClass(base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__unnumbered_link_hop = YANGDynClass(base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__as_number_hop = YANGDynClass(base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__label_hop = YANGDynClass(base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', 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 ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'path-properties', 'path-route-objects', 'path-route-object'] + + def _get_index(self): + """ + Getter method for index, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_route_objects/path_route_object/index (uint32) + + YANG Description: Route object entry index. The index is used to +identify an entry in the list. The order of entries +is defined by the user without relying on key +values. + """ + return self.__index + + def _set_index(self, v, load=False): + """ + Setter method for index, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_route_objects/path_route_object/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: Route object entry index. The index is used to +identify an entry in the list. The order of entries +is defined by the user without relying on key +values. + """ + 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=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', 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), is_leaf=True, yang_name="index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', 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), is_leaf=True, yang_name="index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=False) + + + def _get_numbered_node_hop(self): + """ + Getter method for numbered_node_hop, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_route_objects/path_route_object/numbered_node_hop (container) + + YANG Description: Numbered node route hop. + """ + return self.__numbered_node_hop + + def _set_numbered_node_hop(self, v, load=False): + """ + Setter method for numbered_node_hop, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_route_objects/path_route_object/numbered_node_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_numbered_node_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_numbered_node_hop() directly. + + YANG Description: Numbered node route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """numbered_node_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__numbered_node_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_numbered_node_hop(self): + self.__numbered_node_hop = YANGDynClass(base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_numbered_link_hop(self): + """ + Getter method for numbered_link_hop, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_route_objects/path_route_object/numbered_link_hop (container) + + YANG Description: Numbered link explicit route hop. + """ + return self.__numbered_link_hop + + def _set_numbered_link_hop(self, v, load=False): + """ + Setter method for numbered_link_hop, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_route_objects/path_route_object/numbered_link_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_numbered_link_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_numbered_link_hop() directly. + + YANG Description: Numbered link explicit route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """numbered_link_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__numbered_link_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_numbered_link_hop(self): + self.__numbered_link_hop = YANGDynClass(base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_unnumbered_link_hop(self): + """ + Getter method for unnumbered_link_hop, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_route_objects/path_route_object/unnumbered_link_hop (container) + + YANG Description: Unnumbered link explicit route hop. + """ + return self.__unnumbered_link_hop + + def _set_unnumbered_link_hop(self, v, load=False): + """ + Setter method for unnumbered_link_hop, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_route_objects/path_route_object/unnumbered_link_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_unnumbered_link_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_unnumbered_link_hop() directly. + + YANG Description: Unnumbered link explicit route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """unnumbered_link_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__unnumbered_link_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_unnumbered_link_hop(self): + self.__unnumbered_link_hop = YANGDynClass(base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_as_number_hop(self): + """ + Getter method for as_number_hop, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_route_objects/path_route_object/as_number_hop (container) + + YANG Description: AS explicit route hop. + """ + return self.__as_number_hop + + def _set_as_number_hop(self, v, load=False): + """ + Setter method for as_number_hop, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_route_objects/path_route_object/as_number_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_as_number_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_as_number_hop() directly. + + YANG Description: AS explicit route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """as_number_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__as_number_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_as_number_hop(self): + self.__as_number_hop = YANGDynClass(base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_label_hop(self): + """ + Getter method for label_hop, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_route_objects/path_route_object/label_hop (container) + + YANG Description: Label hop type. + """ + return self.__label_hop + + def _set_label_hop(self, v, load=False): + """ + Setter method for label_hop, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_route_objects/path_route_object/label_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_label_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_label_hop() directly. + + YANG Description: Label hop type. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """label_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__label_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_label_hop(self): + self.__label_hop = YANGDynClass(base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + index = __builtin__.property(_get_index) + numbered_node_hop = __builtin__.property(_get_numbered_node_hop) + numbered_link_hop = __builtin__.property(_get_numbered_link_hop) + unnumbered_link_hop = __builtin__.property(_get_unnumbered_link_hop) + as_number_hop = __builtin__.property(_get_as_number_hop) + label_hop = __builtin__.property(_get_label_hop) + + __choices__ = {'type': {'numbered-node-hop': ['numbered_node_hop'], 'numbered-link-hop': ['numbered_link_hop'], 'unnumbered-link-hop': ['unnumbered_link_hop'], 'as-number': ['as_number_hop'], 'label': ['label_hop']}} + _pyangbind_elements = OrderedDict([('index', index), ('numbered_node_hop', numbered_node_hop), ('numbered_link_hop', numbered_link_hop), ('unnumbered_link_hop', unnumbered_link_hop), ('as_number_hop', as_number_hop), ('label_hop', label_hop), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_route_objects/path_route_object/as_number_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_route_objects/path_route_object/as_number_hop/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..86c07902e489a6b644175e85dfa9403080123188 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_route_objects/path_route_object/as_number_hop/__init__.py @@ -0,0 +1,154 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 as_number_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/path-properties/path-route-objects/path-route-object/as-number-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: AS explicit route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__as_number','__hop_type',) + + _yang_name = 'as-number-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__as_number = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=False) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', 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 ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'path-properties', 'path-route-objects', 'path-route-object', 'as-number-hop'] + + def _get_as_number(self): + """ + Getter method for as_number, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_route_objects/path_route_object/as_number_hop/as_number (inet:as-number) + + YANG Description: The Autonomous System (AS) number. + """ + return self.__as_number + + def _set_as_number(self, v, load=False): + """ + Setter method for as_number, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_route_objects/path_route_object/as_number_hop/as_number (inet:as-number) + If this variable is read-only (config: false) in the + source YANG file, then _set_as_number is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_as_number() directly. + + YANG Description: The Autonomous System (AS) number. + """ + 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="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """as_number must be of a type compatible with inet:as-number""", + 'defined-type': "inet:as-number", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=False)""", + }) + + self.__as_number = t + if hasattr(self, '_set'): + self._set() + + def _unset_as_number(self): + self.__as_number = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=False) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_route_objects/path_route_object/as_number_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_route_objects/path_route_object/as_number_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + 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={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + + as_number = __builtin__.property(_get_as_number) + hop_type = __builtin__.property(_get_hop_type) + + __choices__ = {'type': {'as-number': ['as_number', 'hop_type']}} + _pyangbind_elements = OrderedDict([('as_number', as_number), ('hop_type', hop_type), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_route_objects/path_route_object/label_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_route_objects/path_route_object/label_hop/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..07d9666aeff4da55b1a95cf98bcdfa5c36c5ae28 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_route_objects/path_route_object/label_hop/__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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 te_label +class label_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/path-properties/path-route-objects/path-route-object/label-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Label hop type. + """ + __slots__ = ('_path_helper', '_extmethods', '__te_label',) + + _yang_name = 'label-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__te_label = YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', 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 ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'path-properties', 'path-route-objects', 'path-route-object', 'label-hop'] + + def _get_te_label(self): + """ + Getter method for te_label, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_route_objects/path_route_object/label_hop/te_label (container) + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + return self.__te_label + + def _set_te_label(self, v, load=False): + """ + Setter method for te_label, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_route_objects/path_route_object/label_hop/te_label (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_te_label is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_te_label() directly. + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """te_label must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__te_label = t + if hasattr(self, '_set'): + self._set() + + def _unset_te_label(self): + self.__te_label = YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + te_label = __builtin__.property(_get_te_label) + + __choices__ = {'type': {'label': ['te_label']}} + _pyangbind_elements = OrderedDict([('te_label', te_label), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_route_objects/path_route_object/label_hop/te_label/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_route_objects/path_route_object/label_hop/te_label/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..1204a2ff489ba4a972aab5ea983aa0a736a420b8 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_route_objects/path_route_object/label_hop/te_label/__init__.py @@ -0,0 +1,234 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 otn +class te_label(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/path-properties/path-route-objects/path-route-object/label-hop/te-label. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + __slots__ = ('_path_helper', '_extmethods', '__generic','__otn','__vlanid','__direction',) + + _yang_name = 'te-label' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__generic = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=False) + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False) + self.__vlanid = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=False) + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', 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 ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'path-properties', 'path-route-objects', 'path-route-object', 'label-hop', 'te-label'] + + def _get_generic(self): + """ + Getter method for generic, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_route_objects/path_route_object/label_hop/te_label/generic (rt-types:generalized-label) + + YANG Description: TE label specified in a generic format. + """ + return self.__generic + + def _set_generic(self, v, load=False): + """ + Setter method for generic, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_route_objects/path_route_object/label_hop/te_label/generic (rt-types:generalized-label) + If this variable is read-only (config: false) in the + source YANG file, then _set_generic is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_generic() directly. + + YANG Description: TE label specified in a generic format. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """generic must be of a type compatible with rt-types:generalized-label""", + 'defined-type': "rt-types:generalized-label", + 'generated-type': """YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=False)""", + }) + + self.__generic = t + if hasattr(self, '_set'): + self._set() + + def _unset_generic(self): + self.__generic = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=False) + + + def _get_otn(self): + """ + Getter method for otn, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_route_objects/path_route_object/label_hop/te_label/otn (container) + + YANG Description: Label hop for OTN. + """ + return self.__otn + + def _set_otn(self, v, load=False): + """ + Setter method for otn, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_route_objects/path_route_object/label_hop/te_label/otn (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_otn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_otn() directly. + + YANG Description: Label hop for OTN. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """otn must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False)""", + }) + + self.__otn = t + if hasattr(self, '_set'): + self._set() + + def _unset_otn(self): + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False) + + + def _get_vlanid(self): + """ + Getter method for vlanid, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_route_objects/path_route_object/label_hop/te_label/vlanid (etht-types:vlanid) + + YANG Description: VLAN tag id. + """ + return self.__vlanid + + def _set_vlanid(self, v, load=False): + """ + Setter method for vlanid, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_route_objects/path_route_object/label_hop/te_label/vlanid (etht-types:vlanid) + If this variable is read-only (config: false) in the + source YANG file, then _set_vlanid is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_vlanid() directly. + + YANG Description: VLAN tag id. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """vlanid must be of a type compatible with etht-types:vlanid""", + 'defined-type': "etht-types:vlanid", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=False)""", + }) + + self.__vlanid = t + if hasattr(self, '_set'): + self._set() + + def _unset_vlanid(self): + self.__vlanid = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=False) + + + def _get_direction(self): + """ + Getter method for direction, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_route_objects/path_route_object/label_hop/te_label/direction (te-label-direction) + + YANG Description: Label direction. + """ + return self.__direction + + def _set_direction(self, v, load=False): + """ + Setter method for direction, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_route_objects/path_route_object/label_hop/te_label/direction (te-label-direction) + If this variable is read-only (config: false) in the + source YANG file, then _set_direction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_direction() directly. + + YANG Description: Label direction. + """ + 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={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """direction must be of a type compatible with te-label-direction""", + 'defined-type': "ietf-te-topology:te-label-direction", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=False)""", + }) + + self.__direction = t + if hasattr(self, '_set'): + self._set() + + def _unset_direction(self): + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=False) + + generic = __builtin__.property(_get_generic) + otn = __builtin__.property(_get_otn) + vlanid = __builtin__.property(_get_vlanid) + direction = __builtin__.property(_get_direction) + + __choices__ = {'technology': {'generic': ['generic'], 'otn': ['otn'], 'eth': ['vlanid']}, 'type': {'label': ['direction']}} + _pyangbind_elements = OrderedDict([('generic', generic), ('otn', otn), ('vlanid', vlanid), ('direction', direction), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_route_objects/path_route_object/label_hop/te_label/otn/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_route_objects/path_route_object/label_hop/te_label/otn/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..874d8ed5f8beeaea05b47fa8354ab2b0fb293122 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_route_objects/path_route_object/label_hop/te_label/otn/__init__.py @@ -0,0 +1,209 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 otn(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/path-properties/path-route-objects/path-route-object/label-hop/te-label/otn. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Label hop for OTN. + """ + __slots__ = ('_path_helper', '_extmethods', '__tpn','__tsg','__ts_list',) + + _yang_name = 'otn' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__tpn = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=False) + self.__tsg = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=False) + self.__ts_list = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', 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 ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'path-properties', 'path-route-objects', 'path-route-object', 'label-hop', 'te-label', 'otn'] + + def _get_tpn(self): + """ + Getter method for tpn, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_route_objects/path_route_object/label_hop/te_label/otn/tpn (otn-tpn) + + YANG Description: Tributary Port Number (TPN). + """ + return self.__tpn + + def _set_tpn(self, v, load=False): + """ + Setter method for tpn, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_route_objects/path_route_object/label_hop/te_label/otn/tpn (otn-tpn) + If this variable is read-only (config: false) in the + source YANG file, then _set_tpn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tpn() directly. + + YANG Description: Tributary Port Number (TPN). + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tpn must be of a type compatible with otn-tpn""", + 'defined-type': "ietf-otn-topology:otn-tpn", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=False)""", + }) + + self.__tpn = t + if hasattr(self, '_set'): + self._set() + + def _unset_tpn(self): + self.__tpn = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=False) + + + def _get_tsg(self): + """ + Getter method for tsg, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_route_objects/path_route_object/label_hop/te_label/otn/tsg (identityref) + + YANG Description: Tributary Slot Granularity (TSG). + """ + return self.__tsg + + def _set_tsg(self, v, load=False): + """ + Setter method for tsg, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_route_objects/path_route_object/label_hop/te_label/otn/tsg (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_tsg is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tsg() directly. + + YANG Description: Tributary Slot Granularity (TSG). + """ + 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={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tsg must be of a type compatible with identityref""", + 'defined-type': "ietf-otn-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=False)""", + }) + + self.__tsg = t + if hasattr(self, '_set'): + self._set() + + def _unset_tsg(self): + self.__tsg = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=False) + + + def _get_ts_list(self): + """ + Getter method for ts_list, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_route_objects/path_route_object/label_hop/te_label/otn/ts_list (string) + + YANG Description: A list of available Tributary Slots (TS) ranging + + + + +between 1 and 4095. If multiple values or +ranges are given, they all MUST be disjoint +and MUST be in ascending order. +For example 1-20,25,50-1000. + """ + return self.__ts_list + + def _set_ts_list(self, v, load=False): + """ + Setter method for ts_list, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_route_objects/path_route_object/label_hop/te_label/otn/ts_list (string) + If this variable is read-only (config: false) in the + source YANG file, then _set_ts_list is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_ts_list() directly. + + YANG Description: A list of available Tributary Slots (TS) ranging + + + + +between 1 and 4095. If multiple values or +ranges are given, they all MUST be disjoint +and MUST be in ascending order. +For example 1-20,25,50-1000. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='string', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """ts_list must be of a type compatible with string""", + 'defined-type': "string", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='string', is_config=False)""", + }) + + self.__ts_list = t + if hasattr(self, '_set'): + self._set() + + def _unset_ts_list(self): + self.__ts_list = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='string', is_config=False) + + tpn = __builtin__.property(_get_tpn) + tsg = __builtin__.property(_get_tsg) + ts_list = __builtin__.property(_get_ts_list) + + __choices__ = {'technology': {'otn': ['tpn', 'tsg', 'ts_list']}} + _pyangbind_elements = OrderedDict([('tpn', tpn), ('tsg', tsg), ('ts_list', ts_list), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_route_objects/path_route_object/numbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_route_objects/path_route_object/numbered_link_hop/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e41be3b4cf2553fa1abc7ba1b37299f045418107 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_route_objects/path_route_object/numbered_link_hop/__init__.py @@ -0,0 +1,193 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 numbered_link_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/path-properties/path-route-objects/path-route-object/numbered-link-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Numbered link explicit route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__link_tp_id','__hop_type','__direction',) + + _yang_name = 'numbered-link-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=False) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', 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 ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'path-properties', 'path-route-objects', 'path-route-object', 'numbered-link-hop'] + + def _get_link_tp_id(self): + """ + Getter method for link_tp_id, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_route_objects/path_route_object/numbered_link_hop/link_tp_id (te-tp-id) + + YANG Description: TE Link Termination Point (LTP) identifier. + """ + return self.__link_tp_id + + def _set_link_tp_id(self, v, load=False): + """ + Setter method for link_tp_id, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_route_objects/path_route_object/numbered_link_hop/link_tp_id (te-tp-id) + If this variable is read-only (config: false) in the + source YANG file, then _set_link_tp_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_link_tp_id() directly. + + YANG Description: TE Link Termination Point (LTP) identifier. + """ + 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),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """link_tp_id must be of a type compatible with te-tp-id""", + 'defined-type': "ietf-te-topology:te-tp-id", + 'generated-type': """YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=False)""", + }) + + self.__link_tp_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_link_tp_id(self): + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=False) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_route_objects/path_route_object/numbered_link_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_route_objects/path_route_object/numbered_link_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + 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={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + + + def _get_direction(self): + """ + Getter method for direction, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_route_objects/path_route_object/numbered_link_hop/direction (te-link-direction) + + YANG Description: Link route object direction. + """ + return self.__direction + + def _set_direction(self, v, load=False): + """ + Setter method for direction, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_route_objects/path_route_object/numbered_link_hop/direction (te-link-direction) + If this variable is read-only (config: false) in the + source YANG file, then _set_direction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_direction() directly. + + YANG Description: Link route object direction. + """ + 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={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """direction must be of a type compatible with te-link-direction""", + 'defined-type': "ietf-te-topology:te-link-direction", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=False)""", + }) + + self.__direction = t + if hasattr(self, '_set'): + self._set() + + def _unset_direction(self): + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=False) + + link_tp_id = __builtin__.property(_get_link_tp_id) + hop_type = __builtin__.property(_get_hop_type) + direction = __builtin__.property(_get_direction) + + __choices__ = {'type': {'numbered-link-hop': ['link_tp_id', 'hop_type', 'direction']}} + _pyangbind_elements = OrderedDict([('link_tp_id', link_tp_id), ('hop_type', hop_type), ('direction', direction), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_route_objects/path_route_object/numbered_node_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_route_objects/path_route_object/numbered_node_hop/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..eb07641c0e179c250c88dff9fe363c1959ee12dd --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_route_objects/path_route_object/numbered_node_hop/__init__.py @@ -0,0 +1,154 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 numbered_node_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/path-properties/path-route-objects/path-route-object/numbered-node-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Numbered node route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__node_id','__hop_type',) + + _yang_name = 'numbered-node-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=False) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', 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 ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'path-properties', 'path-route-objects', 'path-route-object', 'numbered-node-hop'] + + def _get_node_id(self): + """ + Getter method for node_id, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_route_objects/path_route_object/numbered_node_hop/node_id (te-node-id) + + YANG Description: The identifier of a node in the TE topology. + """ + return self.__node_id + + def _set_node_id(self, v, load=False): + """ + Setter method for node_id, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_route_objects/path_route_object/numbered_node_hop/node_id (te-node-id) + 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. + + YANG Description: The identifier of a node in the TE topology. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """node_id must be of a type compatible with te-node-id""", + 'defined-type': "ietf-te-topology:te-node-id", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=False)""", + }) + + self.__node_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_node_id(self): + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=False) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_route_objects/path_route_object/numbered_node_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_route_objects/path_route_object/numbered_node_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + 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={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + + node_id = __builtin__.property(_get_node_id) + hop_type = __builtin__.property(_get_hop_type) + + __choices__ = {'type': {'numbered-node-hop': ['node_id', 'hop_type']}} + _pyangbind_elements = OrderedDict([('node_id', node_id), ('hop_type', hop_type), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_route_objects/path_route_object/unnumbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_route_objects/path_route_object/unnumbered_link_hop/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e8eab3fc14c4aa1803298ceedfdd3f6c9047501c --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_route_objects/path_route_object/unnumbered_link_hop/__init__.py @@ -0,0 +1,236 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 unnumbered_link_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/path-properties/path-route-objects/path-route-object/unnumbered-link-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Unnumbered link explicit route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__link_tp_id','__node_id','__hop_type','__direction',) + + _yang_name = 'unnumbered-link-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=False) + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=False) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', 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 ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'path-properties', 'path-route-objects', 'path-route-object', 'unnumbered-link-hop'] + + def _get_link_tp_id(self): + """ + Getter method for link_tp_id, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_route_objects/path_route_object/unnumbered_link_hop/link_tp_id (te-tp-id) + + YANG Description: TE LTP identifier. The combination of the TE link ID +and the TE node ID is used to identify an unnumbered +TE link. + """ + return self.__link_tp_id + + def _set_link_tp_id(self, v, load=False): + """ + Setter method for link_tp_id, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_route_objects/path_route_object/unnumbered_link_hop/link_tp_id (te-tp-id) + If this variable is read-only (config: false) in the + source YANG file, then _set_link_tp_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_link_tp_id() directly. + + YANG Description: TE LTP identifier. The combination of the TE link ID +and the TE node ID is used to identify an unnumbered +TE link. + """ + 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),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """link_tp_id must be of a type compatible with te-tp-id""", + 'defined-type': "ietf-te-topology:te-tp-id", + 'generated-type': """YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=False)""", + }) + + self.__link_tp_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_link_tp_id(self): + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=False) + + + def _get_node_id(self): + """ + Getter method for node_id, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_route_objects/path_route_object/unnumbered_link_hop/node_id (te-node-id) + + YANG Description: The identifier of a node in the TE topology. + """ + return self.__node_id + + def _set_node_id(self, v, load=False): + """ + Setter method for node_id, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_route_objects/path_route_object/unnumbered_link_hop/node_id (te-node-id) + 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. + + YANG Description: The identifier of a node in the TE topology. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """node_id must be of a type compatible with te-node-id""", + 'defined-type': "ietf-te-topology:te-node-id", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=False)""", + }) + + self.__node_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_node_id(self): + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=False) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_route_objects/path_route_object/unnumbered_link_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_route_objects/path_route_object/unnumbered_link_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + 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={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + + + def _get_direction(self): + """ + Getter method for direction, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_route_objects/path_route_object/unnumbered_link_hop/direction (te-link-direction) + + YANG Description: Link route object direction. + """ + return self.__direction + + def _set_direction(self, v, load=False): + """ + Setter method for direction, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_route_objects/path_route_object/unnumbered_link_hop/direction (te-link-direction) + If this variable is read-only (config: false) in the + source YANG file, then _set_direction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_direction() directly. + + YANG Description: Link route object direction. + """ + 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={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """direction must be of a type compatible with te-link-direction""", + 'defined-type': "ietf-te-topology:te-link-direction", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=False)""", + }) + + self.__direction = t + if hasattr(self, '_set'): + self._set() + + def _unset_direction(self): + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=False) + + link_tp_id = __builtin__.property(_get_link_tp_id) + node_id = __builtin__.property(_get_node_id) + hop_type = __builtin__.property(_get_hop_type) + direction = __builtin__.property(_get_direction) + + __choices__ = {'type': {'unnumbered-link-hop': ['link_tp_id', 'node_id', 'hop_type', 'direction']}} + _pyangbind_elements = OrderedDict([('link_tp_id', link_tp_id), ('node_id', node_id), ('hop_type', hop_type), ('direction', direction), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_srlgs_lists/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_srlgs_lists/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..a1b457c6c30bb26bde6c4faa632f66d6b65fa9c2 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_srlgs_lists/__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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 path_srlgs_list +class path_srlgs_lists(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/path-properties/path-srlgs-lists. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Path SRLG properties container. + """ + __slots__ = ('_path_helper', '_extmethods', '__path_srlgs_list',) + + _yang_name = 'path-srlgs-lists' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__path_srlgs_list = YANGDynClass(base=YANGListType("usage",path_srlgs_list.path_srlgs_list, yang_name="path-srlgs-list", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-srlgs-list", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', 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 ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'path-properties', 'path-srlgs-lists'] + + def _get_path_srlgs_list(self): + """ + Getter method for path_srlgs_list, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_srlgs_lists/path_srlgs_list (list) + + YANG Description: List of SRLG values to be included or excluded. + """ + return self.__path_srlgs_list + + def _set_path_srlgs_list(self, v, load=False): + """ + Setter method for path_srlgs_list, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_srlgs_lists/path_srlgs_list (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_srlgs_list is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_srlgs_list() directly. + + YANG Description: List of SRLG values to be included or excluded. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("usage",path_srlgs_list.path_srlgs_list, yang_name="path-srlgs-list", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-srlgs-list", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_srlgs_list must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("usage",path_srlgs_list.path_srlgs_list, yang_name="path-srlgs-list", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-srlgs-list", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False)""", + }) + + self.__path_srlgs_list = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_srlgs_list(self): + self.__path_srlgs_list = YANGDynClass(base=YANGListType("usage",path_srlgs_list.path_srlgs_list, yang_name="path-srlgs-list", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-srlgs-list", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + + path_srlgs_list = __builtin__.property(_get_path_srlgs_list) + + + _pyangbind_elements = OrderedDict([('path_srlgs_list', path_srlgs_list), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_srlgs_lists/path_srlgs_list/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_srlgs_lists/path_srlgs_list/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..977077b1f8045674eca865b10934c0bb5431a5e1 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_srlgs_lists/path_srlgs_list/__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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 path_srlgs_list(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/path-properties/path-srlgs-lists/path-srlgs-list. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: List of SRLG values to be included or excluded. + """ + __slots__ = ('_path_helper', '_extmethods', '__usage','__values',) + + _yang_name = 'path-srlgs-list' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__usage = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + self.__values = YANGDynClass(unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32)), is_leaf=False, yang_name="values", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='srlg', 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 ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'path-properties', 'path-srlgs-lists', 'path-srlgs-list'] + + def _get_usage(self): + """ + Getter method for usage, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_srlgs_lists/path_srlgs_list/usage (identityref) + + YANG Description: Identifies an entry in a list of SRLGs to either +include or exclude. + """ + return self.__usage + + def _set_usage(self, v, load=False): + """ + Setter method for usage, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_srlgs_lists/path_srlgs_list/usage (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_usage is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_usage() directly. + + YANG Description: Identifies an entry in a list of SRLGs to either +include or exclude. + """ + 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=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """usage must be of a type compatible with identityref""", + 'defined-type': "ietf-te-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False)""", + }) + + self.__usage = t + if hasattr(self, '_set'): + self._set() + + def _unset_usage(self): + self.__usage = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + + + def _get_values(self): + """ + Getter method for values, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_srlgs_lists/path_srlgs_list/values (srlg) + + YANG Description: List of SRLG values. + """ + return self.__values + + def _set_values(self, v, load=False): + """ + Setter method for values, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_srlgs_lists/path_srlgs_list/values (srlg) + If this variable is read-only (config: false) in the + source YANG file, then _set_values is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_values() directly. + + YANG Description: List of SRLG values. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32)), is_leaf=False, yang_name="values", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='srlg', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """values must be of a type compatible with srlg""", + 'defined-type': "ietf-te-topology:srlg", + 'generated-type': """YANGDynClass(unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32)), is_leaf=False, yang_name="values", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='srlg', is_config=False)""", + }) + + self.__values = t + if hasattr(self, '_set'): + self._set() + + def _unset_values(self): + self.__values = YANGDynClass(unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32)), is_leaf=False, yang_name="values", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='srlg', is_config=False) + + usage = __builtin__.property(_get_usage) + values = __builtin__.property(_get_values) + + + _pyangbind_elements = OrderedDict([('usage', usage), ('values', values), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_srlgs_names/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_srlgs_names/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..219ef7d2740f50432e47cdd50e0c5a53aaada3fe --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_srlgs_names/__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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 path_srlgs_name +class path_srlgs_names(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/path-properties/path-srlgs-names. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Container for the list of named SRLGs. + """ + __slots__ = ('_path_helper', '_extmethods', '__path_srlgs_name',) + + _yang_name = 'path-srlgs-names' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__path_srlgs_name = YANGDynClass(base=YANGListType("usage",path_srlgs_name.path_srlgs_name, yang_name="path-srlgs-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-srlgs-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', 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 ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'path-properties', 'path-srlgs-names'] + + def _get_path_srlgs_name(self): + """ + Getter method for path_srlgs_name, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_srlgs_names/path_srlgs_name (list) + + YANG Description: List of named SRLGs to be included or excluded. + """ + return self.__path_srlgs_name + + def _set_path_srlgs_name(self, v, load=False): + """ + Setter method for path_srlgs_name, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_srlgs_names/path_srlgs_name (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_srlgs_name is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_srlgs_name() directly. + + YANG Description: List of named SRLGs to be included or excluded. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("usage",path_srlgs_name.path_srlgs_name, yang_name="path-srlgs-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-srlgs-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_srlgs_name must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("usage",path_srlgs_name.path_srlgs_name, yang_name="path-srlgs-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-srlgs-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False)""", + }) + + self.__path_srlgs_name = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_srlgs_name(self): + self.__path_srlgs_name = YANGDynClass(base=YANGListType("usage",path_srlgs_name.path_srlgs_name, yang_name="path-srlgs-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-srlgs-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + + path_srlgs_name = __builtin__.property(_get_path_srlgs_name) + + + _pyangbind_elements = OrderedDict([('path_srlgs_name', path_srlgs_name), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_srlgs_names/path_srlgs_name/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_srlgs_names/path_srlgs_name/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..3f83850b901e1bb7f6ada7ff0652fb47cf930794 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_srlgs_names/path_srlgs_name/__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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 path_srlgs_name(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/path-properties/path-srlgs-names/path-srlgs-name. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: List of named SRLGs to be included or excluded. + """ + __slots__ = ('_path_helper', '_extmethods', '__usage','__names',) + + _yang_name = 'path-srlgs-name' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__usage = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + self.__names = YANGDynClass(unique=True, base=TypedListType(allowed_type=six.text_type), is_leaf=False, yang_name="names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', 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 ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'path-properties', 'path-srlgs-names', 'path-srlgs-name'] + + def _get_usage(self): + """ + Getter method for usage, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_srlgs_names/path_srlgs_name/usage (identityref) + + YANG Description: Identifies an entry in a list of named SRLGs to either +include or exclude. + """ + return self.__usage + + def _set_usage(self, v, load=False): + """ + Setter method for usage, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_srlgs_names/path_srlgs_name/usage (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_usage is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_usage() directly. + + YANG Description: Identifies an entry in a list of named SRLGs to either +include or exclude. + """ + 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=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """usage must be of a type compatible with identityref""", + 'defined-type': "ietf-te-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False)""", + }) + + self.__usage = t + if hasattr(self, '_set'): + self._set() + + def _unset_usage(self): + self.__usage = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + + + def _get_names(self): + """ + Getter method for names, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_srlgs_names/path_srlgs_name/names (string) + + YANG Description: List of named SRLGs. + """ + return self.__names + + def _set_names(self, v, load=False): + """ + Setter method for names, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_srlgs_names/path_srlgs_name/names (string) + If this variable is read-only (config: false) in the + source YANG file, then _set_names is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_names() directly. + + YANG Description: List of named SRLGs. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,unique=True, base=TypedListType(allowed_type=six.text_type), is_leaf=False, yang_name="names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """names must be of a type compatible with string""", + 'defined-type': "string", + 'generated-type': """YANGDynClass(unique=True, base=TypedListType(allowed_type=six.text_type), is_leaf=False, yang_name="names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=False)""", + }) + + self.__names = t + if hasattr(self, '_set'): + self._set() + + def _unset_names(self): + self.__names = YANGDynClass(unique=True, base=TypedListType(allowed_type=six.text_type), is_leaf=False, yang_name="names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=False) + + usage = __builtin__.property(_get_usage) + names = __builtin__.property(_get_names) + + + _pyangbind_elements = OrderedDict([('usage', usage), ('names', names), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..1c61ee40638fd59c1c8254666641420e56be09a8 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/__init__.py @@ -0,0 +1,326 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 primary_path +from . import backup_path +from . import tunnel_termination_points +from . import tunnels +class underlay(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/underlay. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Attributes of the TE link underlay. + """ + __slots__ = ('_path_helper', '_extmethods', '__enabled','__primary_path','__backup_path','__protection_type','__tunnel_termination_points','__tunnels',) + + _yang_name = 'underlay' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__enabled = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="enabled", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='boolean', is_config=False) + self.__primary_path = YANGDynClass(base=primary_path.primary_path, is_container='container', yang_name="primary-path", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__backup_path = YANGDynClass(base=YANGListType("index",backup_path.backup_path, yang_name="backup-path", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='index', extensions=None), is_container='list', yang_name="backup-path", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + self.__protection_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'lsp-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-reroute-extra': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-reroute-extra': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-reroute-extra': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-reroute': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-reroute': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-reroute': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-1-for-n': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-1-for-n': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-1-for-n': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-unidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-unidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-unidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-bidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-bidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-bidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="protection-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + self.__tunnel_termination_points = YANGDynClass(base=tunnel_termination_points.tunnel_termination_points, is_container='container', yang_name="tunnel-termination-points", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__tunnels = YANGDynClass(base=tunnels.tunnels, is_container='container', yang_name="tunnels", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', 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 ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'underlay'] + + def _get_enabled(self): + """ + Getter method for enabled, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay/enabled (boolean) + + YANG Description: 'true' if the underlay is enabled. +'false' if the underlay is disabled. + """ + return self.__enabled + + def _set_enabled(self, v, load=False): + """ + Setter method for enabled, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay/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: 'true' if the underlay is enabled. +'false' if the underlay is disabled. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBool, is_leaf=True, yang_name="enabled", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', 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, is_leaf=True, yang_name="enabled", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='boolean', is_config=False)""", + }) + + self.__enabled = t + if hasattr(self, '_set'): + self._set() + + def _unset_enabled(self): + self.__enabled = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="enabled", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='boolean', is_config=False) + + + def _get_primary_path(self): + """ + Getter method for primary_path, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay/primary_path (container) + + YANG Description: The service path on the underlay topology that +supports this link. + """ + return self.__primary_path + + def _set_primary_path(self, v, load=False): + """ + Setter method for primary_path, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay/primary_path (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_primary_path is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_primary_path() directly. + + YANG Description: The service path on the underlay topology that +supports this link. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=primary_path.primary_path, is_container='container', yang_name="primary-path", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """primary_path must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=primary_path.primary_path, is_container='container', yang_name="primary-path", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__primary_path = t + if hasattr(self, '_set'): + self._set() + + def _unset_primary_path(self): + self.__primary_path = YANGDynClass(base=primary_path.primary_path, is_container='container', yang_name="primary-path", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_backup_path(self): + """ + Getter method for backup_path, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay/backup_path (list) + + YANG Description: A list of backup service paths on the underlay topology that +protect the underlay primary path. If the primary path is +not protected, the list contains zero elements. If the +primary path is protected, the list contains one or more +elements. + """ + return self.__backup_path + + def _set_backup_path(self, v, load=False): + """ + Setter method for backup_path, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay/backup_path (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_backup_path is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_backup_path() directly. + + YANG Description: A list of backup service paths on the underlay topology that +protect the underlay primary path. If the primary path is +not protected, the list contains zero elements. If the +primary path is protected, the list contains one or more +elements. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("index",backup_path.backup_path, yang_name="backup-path", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='index', extensions=None), is_container='list', yang_name="backup-path", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """backup_path must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("index",backup_path.backup_path, yang_name="backup-path", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='index', extensions=None), is_container='list', yang_name="backup-path", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False)""", + }) + + self.__backup_path = t + if hasattr(self, '_set'): + self._set() + + def _unset_backup_path(self): + self.__backup_path = YANGDynClass(base=YANGListType("index",backup_path.backup_path, yang_name="backup-path", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='index', extensions=None), is_container='list', yang_name="backup-path", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + + + def _get_protection_type(self): + """ + Getter method for protection_type, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay/protection_type (identityref) + + YANG Description: Underlay protection type desired for this link. + """ + return self.__protection_type + + def _set_protection_type(self, v, load=False): + """ + Setter method for protection_type, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay/protection_type (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_protection_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_protection_type() directly. + + YANG Description: Underlay protection type desired for this link. + """ + 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={'lsp-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-reroute-extra': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-reroute-extra': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-reroute-extra': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-reroute': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-reroute': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-reroute': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-1-for-n': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-1-for-n': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-1-for-n': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-unidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-unidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-unidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-bidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-bidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-bidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="protection-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """protection_type must be of a type compatible with identityref""", + 'defined-type': "ietf-te-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'lsp-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-reroute-extra': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-reroute-extra': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-reroute-extra': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-reroute': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-reroute': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-reroute': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-1-for-n': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-1-for-n': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-1-for-n': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-unidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-unidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-unidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-bidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-bidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-bidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="protection-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False)""", + }) + + self.__protection_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_protection_type(self): + self.__protection_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'lsp-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-reroute-extra': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-reroute-extra': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-reroute-extra': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-reroute': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-reroute': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-reroute': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-1-for-n': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-1-for-n': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-1-for-n': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-unidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-unidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-unidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-bidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-bidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-bidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="protection-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + + + def _get_tunnel_termination_points(self): + """ + Getter method for tunnel_termination_points, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay/tunnel_termination_points (container) + + YANG Description: Underlay TTPs desired for this link. + """ + return self.__tunnel_termination_points + + def _set_tunnel_termination_points(self, v, load=False): + """ + Setter method for tunnel_termination_points, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay/tunnel_termination_points (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_tunnel_termination_points is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tunnel_termination_points() directly. + + YANG Description: Underlay TTPs desired for this link. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=tunnel_termination_points.tunnel_termination_points, is_container='container', yang_name="tunnel-termination-points", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tunnel_termination_points must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=tunnel_termination_points.tunnel_termination_points, is_container='container', yang_name="tunnel-termination-points", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__tunnel_termination_points = t + if hasattr(self, '_set'): + self._set() + + def _unset_tunnel_termination_points(self): + self.__tunnel_termination_points = YANGDynClass(base=tunnel_termination_points.tunnel_termination_points, is_container='container', yang_name="tunnel-termination-points", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_tunnels(self): + """ + Getter method for tunnels, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay/tunnels (container) + + YANG Description: Underlay TE tunnels supporting this TE link. + """ + return self.__tunnels + + def _set_tunnels(self, v, load=False): + """ + Setter method for tunnels, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay/tunnels (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_tunnels is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tunnels() directly. + + YANG Description: Underlay TE tunnels supporting this TE link. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=tunnels.tunnels, is_container='container', yang_name="tunnels", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tunnels must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=tunnels.tunnels, is_container='container', yang_name="tunnels", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__tunnels = t + if hasattr(self, '_set'): + self._set() + + def _unset_tunnels(self): + self.__tunnels = YANGDynClass(base=tunnels.tunnels, is_container='container', yang_name="tunnels", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + enabled = __builtin__.property(_get_enabled) + primary_path = __builtin__.property(_get_primary_path) + backup_path = __builtin__.property(_get_backup_path) + protection_type = __builtin__.property(_get_protection_type) + tunnel_termination_points = __builtin__.property(_get_tunnel_termination_points) + tunnels = __builtin__.property(_get_tunnels) + + + _pyangbind_elements = OrderedDict([('enabled', enabled), ('primary_path', primary_path), ('backup_path', backup_path), ('protection_type', protection_type), ('tunnel_termination_points', tunnel_termination_points), ('tunnels', tunnels), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/backup_path/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/backup_path/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..92cc327172f3b1fff0e55b235e17bb9467e8d365 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/backup_path/__init__.py @@ -0,0 +1,207 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 path_element +class backup_path(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/underlay/backup-path. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: A list of backup service paths on the underlay topology that +protect the underlay primary path. If the primary path is +not protected, the list contains zero elements. If the +primary path is protected, the list contains one or more +elements. + """ + __slots__ = ('_path_helper', '_extmethods', '__index','__network_ref','__path_element',) + + _yang_name = 'backup-path' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _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), is_leaf=True, yang_name="index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=False) + self.__network_ref = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="network-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=False) + self.__path_element = YANGDynClass(base=YANGListType("path_element_id",path_element.path_element, yang_name="path-element", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='path-element-id', extensions=None), is_container='list', yang_name="path-element", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', 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 ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'underlay', 'backup-path'] + + def _get_index(self): + """ + Getter method for index, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay/backup_path/index (uint32) + + YANG Description: A sequence number to identify a backup path. + """ + return self.__index + + def _set_index(self, v, load=False): + """ + Setter method for index, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay/backup_path/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: A sequence number to identify a backup path. + """ + 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=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', 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), is_leaf=True, yang_name="index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', 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), is_leaf=True, yang_name="index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=False) + + + def _get_network_ref(self): + """ + Getter method for network_ref, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay/backup_path/network_ref (leafref) + + YANG Description: Used to reference a network -- for example, an underlay +network. + """ + return self.__network_ref + + def _set_network_ref(self, v, load=False): + """ + Setter method for network_ref, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay/backup_path/network_ref (leafref) + If this variable is read-only (config: false) in the + source YANG file, then _set_network_ref is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_network_ref() directly. + + YANG Description: Used to reference a network -- for example, an underlay +network. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="network-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """network_ref must be of a type compatible with leafref""", + 'defined-type': "leafref", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="network-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=False)""", + }) + + self.__network_ref = t + if hasattr(self, '_set'): + self._set() + + def _unset_network_ref(self): + self.__network_ref = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="network-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=False) + + + def _get_path_element(self): + """ + Getter method for path_element, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay/backup_path/path_element (list) + + YANG Description: A list of path elements describing the backup service +path. + """ + return self.__path_element + + def _set_path_element(self, v, load=False): + """ + Setter method for path_element, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay/backup_path/path_element (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_element is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_element() directly. + + YANG Description: A list of path elements describing the backup service +path. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("path_element_id",path_element.path_element, yang_name="path-element", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='path-element-id', extensions=None), is_container='list', yang_name="path-element", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_element must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("path_element_id",path_element.path_element, yang_name="path-element", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='path-element-id', extensions=None), is_container='list', yang_name="path-element", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False)""", + }) + + self.__path_element = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_element(self): + self.__path_element = YANGDynClass(base=YANGListType("path_element_id",path_element.path_element, yang_name="path-element", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='path-element-id', extensions=None), is_container='list', yang_name="path-element", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + + index = __builtin__.property(_get_index) + network_ref = __builtin__.property(_get_network_ref) + path_element = __builtin__.property(_get_path_element) + + + _pyangbind_elements = OrderedDict([('index', index), ('network_ref', network_ref), ('path_element', path_element), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/backup_path/path_element/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/backup_path/path_element/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..782347073fd2268022355fceb1a528d9b27cd338 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/backup_path/path_element/__init__.py @@ -0,0 +1,321 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 numbered_node_hop +from . import numbered_link_hop +from . import unnumbered_link_hop +from . import as_number_hop +from . import label_hop +class path_element(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/underlay/backup-path/path-element. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: A list of path elements describing the backup service +path. + """ + __slots__ = ('_path_helper', '_extmethods', '__path_element_id','__numbered_node_hop','__numbered_link_hop','__unnumbered_link_hop','__as_number_hop','__label_hop',) + + _yang_name = 'path-element' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__path_element_id = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="path-element-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=False) + self.__numbered_node_hop = YANGDynClass(base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__numbered_link_hop = YANGDynClass(base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__unnumbered_link_hop = YANGDynClass(base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__as_number_hop = YANGDynClass(base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__label_hop = YANGDynClass(base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', 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 ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'underlay', 'backup-path', 'path-element'] + + def _get_path_element_id(self): + """ + Getter method for path_element_id, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay/backup_path/path_element/path_element_id (uint32) + + YANG Description: To identify the element in a path. + """ + return self.__path_element_id + + def _set_path_element_id(self, v, load=False): + """ + Setter method for path_element_id, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay/backup_path/path_element/path_element_id (uint32) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_element_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_element_id() directly. + + YANG Description: To identify the element in a path. + """ + 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=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="path-element-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_element_id 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="path-element-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=False)""", + }) + + self.__path_element_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_element_id(self): + self.__path_element_id = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="path-element-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=False) + + + def _get_numbered_node_hop(self): + """ + Getter method for numbered_node_hop, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay/backup_path/path_element/numbered_node_hop (container) + + YANG Description: Numbered node route hop. + """ + return self.__numbered_node_hop + + def _set_numbered_node_hop(self, v, load=False): + """ + Setter method for numbered_node_hop, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay/backup_path/path_element/numbered_node_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_numbered_node_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_numbered_node_hop() directly. + + YANG Description: Numbered node route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """numbered_node_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__numbered_node_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_numbered_node_hop(self): + self.__numbered_node_hop = YANGDynClass(base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_numbered_link_hop(self): + """ + Getter method for numbered_link_hop, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay/backup_path/path_element/numbered_link_hop (container) + + YANG Description: Numbered link explicit route hop. + """ + return self.__numbered_link_hop + + def _set_numbered_link_hop(self, v, load=False): + """ + Setter method for numbered_link_hop, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay/backup_path/path_element/numbered_link_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_numbered_link_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_numbered_link_hop() directly. + + YANG Description: Numbered link explicit route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """numbered_link_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__numbered_link_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_numbered_link_hop(self): + self.__numbered_link_hop = YANGDynClass(base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_unnumbered_link_hop(self): + """ + Getter method for unnumbered_link_hop, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay/backup_path/path_element/unnumbered_link_hop (container) + + YANG Description: Unnumbered link explicit route hop. + """ + return self.__unnumbered_link_hop + + def _set_unnumbered_link_hop(self, v, load=False): + """ + Setter method for unnumbered_link_hop, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay/backup_path/path_element/unnumbered_link_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_unnumbered_link_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_unnumbered_link_hop() directly. + + YANG Description: Unnumbered link explicit route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """unnumbered_link_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__unnumbered_link_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_unnumbered_link_hop(self): + self.__unnumbered_link_hop = YANGDynClass(base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_as_number_hop(self): + """ + Getter method for as_number_hop, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay/backup_path/path_element/as_number_hop (container) + + YANG Description: AS explicit route hop. + """ + return self.__as_number_hop + + def _set_as_number_hop(self, v, load=False): + """ + Setter method for as_number_hop, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay/backup_path/path_element/as_number_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_as_number_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_as_number_hop() directly. + + YANG Description: AS explicit route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """as_number_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__as_number_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_as_number_hop(self): + self.__as_number_hop = YANGDynClass(base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_label_hop(self): + """ + Getter method for label_hop, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay/backup_path/path_element/label_hop (container) + + YANG Description: Label hop type. + """ + return self.__label_hop + + def _set_label_hop(self, v, load=False): + """ + Setter method for label_hop, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay/backup_path/path_element/label_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_label_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_label_hop() directly. + + YANG Description: Label hop type. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """label_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__label_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_label_hop(self): + self.__label_hop = YANGDynClass(base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + path_element_id = __builtin__.property(_get_path_element_id) + numbered_node_hop = __builtin__.property(_get_numbered_node_hop) + numbered_link_hop = __builtin__.property(_get_numbered_link_hop) + unnumbered_link_hop = __builtin__.property(_get_unnumbered_link_hop) + as_number_hop = __builtin__.property(_get_as_number_hop) + label_hop = __builtin__.property(_get_label_hop) + + __choices__ = {'type': {'numbered-node-hop': ['numbered_node_hop'], 'numbered-link-hop': ['numbered_link_hop'], 'unnumbered-link-hop': ['unnumbered_link_hop'], 'as-number': ['as_number_hop'], 'label': ['label_hop']}} + _pyangbind_elements = OrderedDict([('path_element_id', path_element_id), ('numbered_node_hop', numbered_node_hop), ('numbered_link_hop', numbered_link_hop), ('unnumbered_link_hop', unnumbered_link_hop), ('as_number_hop', as_number_hop), ('label_hop', label_hop), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/backup_path/path_element/as_number_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/backup_path/path_element/as_number_hop/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..75444961d2181499b1641c904b83653ee41e3f66 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/backup_path/path_element/as_number_hop/__init__.py @@ -0,0 +1,154 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 as_number_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/underlay/backup-path/path-element/as-number-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: AS explicit route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__as_number','__hop_type',) + + _yang_name = 'as-number-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__as_number = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=False) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', 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 ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'underlay', 'backup-path', 'path-element', 'as-number-hop'] + + def _get_as_number(self): + """ + Getter method for as_number, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay/backup_path/path_element/as_number_hop/as_number (inet:as-number) + + YANG Description: The Autonomous System (AS) number. + """ + return self.__as_number + + def _set_as_number(self, v, load=False): + """ + Setter method for as_number, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay/backup_path/path_element/as_number_hop/as_number (inet:as-number) + If this variable is read-only (config: false) in the + source YANG file, then _set_as_number is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_as_number() directly. + + YANG Description: The Autonomous System (AS) number. + """ + 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="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """as_number must be of a type compatible with inet:as-number""", + 'defined-type': "inet:as-number", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=False)""", + }) + + self.__as_number = t + if hasattr(self, '_set'): + self._set() + + def _unset_as_number(self): + self.__as_number = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=False) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay/backup_path/path_element/as_number_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay/backup_path/path_element/as_number_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + 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={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + + as_number = __builtin__.property(_get_as_number) + hop_type = __builtin__.property(_get_hop_type) + + __choices__ = {'type': {'as-number': ['as_number', 'hop_type']}} + _pyangbind_elements = OrderedDict([('as_number', as_number), ('hop_type', hop_type), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/backup_path/path_element/label_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/backup_path/path_element/label_hop/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..77ca590bd1d952e1bb07d94ea8fc90b05820a919 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/backup_path/path_element/label_hop/__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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 te_label +class label_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/underlay/backup-path/path-element/label-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Label hop type. + """ + __slots__ = ('_path_helper', '_extmethods', '__te_label',) + + _yang_name = 'label-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__te_label = YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', 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 ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'underlay', 'backup-path', 'path-element', 'label-hop'] + + def _get_te_label(self): + """ + Getter method for te_label, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay/backup_path/path_element/label_hop/te_label (container) + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + return self.__te_label + + def _set_te_label(self, v, load=False): + """ + Setter method for te_label, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay/backup_path/path_element/label_hop/te_label (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_te_label is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_te_label() directly. + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """te_label must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__te_label = t + if hasattr(self, '_set'): + self._set() + + def _unset_te_label(self): + self.__te_label = YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + te_label = __builtin__.property(_get_te_label) + + __choices__ = {'type': {'label': ['te_label']}} + _pyangbind_elements = OrderedDict([('te_label', te_label), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/backup_path/path_element/label_hop/te_label/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/backup_path/path_element/label_hop/te_label/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..ecefaca5fee07186c0d0e4bd6d8db385434194eb --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/backup_path/path_element/label_hop/te_label/__init__.py @@ -0,0 +1,234 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 otn +class te_label(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/underlay/backup-path/path-element/label-hop/te-label. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + __slots__ = ('_path_helper', '_extmethods', '__generic','__otn','__vlanid','__direction',) + + _yang_name = 'te-label' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__generic = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=False) + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False) + self.__vlanid = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=False) + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', 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 ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'underlay', 'backup-path', 'path-element', 'label-hop', 'te-label'] + + def _get_generic(self): + """ + Getter method for generic, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay/backup_path/path_element/label_hop/te_label/generic (rt-types:generalized-label) + + YANG Description: TE label specified in a generic format. + """ + return self.__generic + + def _set_generic(self, v, load=False): + """ + Setter method for generic, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay/backup_path/path_element/label_hop/te_label/generic (rt-types:generalized-label) + If this variable is read-only (config: false) in the + source YANG file, then _set_generic is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_generic() directly. + + YANG Description: TE label specified in a generic format. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """generic must be of a type compatible with rt-types:generalized-label""", + 'defined-type': "rt-types:generalized-label", + 'generated-type': """YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=False)""", + }) + + self.__generic = t + if hasattr(self, '_set'): + self._set() + + def _unset_generic(self): + self.__generic = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=False) + + + def _get_otn(self): + """ + Getter method for otn, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay/backup_path/path_element/label_hop/te_label/otn (container) + + YANG Description: Label hop for OTN. + """ + return self.__otn + + def _set_otn(self, v, load=False): + """ + Setter method for otn, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay/backup_path/path_element/label_hop/te_label/otn (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_otn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_otn() directly. + + YANG Description: Label hop for OTN. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """otn must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False)""", + }) + + self.__otn = t + if hasattr(self, '_set'): + self._set() + + def _unset_otn(self): + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False) + + + def _get_vlanid(self): + """ + Getter method for vlanid, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay/backup_path/path_element/label_hop/te_label/vlanid (etht-types:vlanid) + + YANG Description: VLAN tag id. + """ + return self.__vlanid + + def _set_vlanid(self, v, load=False): + """ + Setter method for vlanid, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay/backup_path/path_element/label_hop/te_label/vlanid (etht-types:vlanid) + If this variable is read-only (config: false) in the + source YANG file, then _set_vlanid is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_vlanid() directly. + + YANG Description: VLAN tag id. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """vlanid must be of a type compatible with etht-types:vlanid""", + 'defined-type': "etht-types:vlanid", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=False)""", + }) + + self.__vlanid = t + if hasattr(self, '_set'): + self._set() + + def _unset_vlanid(self): + self.__vlanid = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=False) + + + def _get_direction(self): + """ + Getter method for direction, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay/backup_path/path_element/label_hop/te_label/direction (te-label-direction) + + YANG Description: Label direction. + """ + return self.__direction + + def _set_direction(self, v, load=False): + """ + Setter method for direction, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay/backup_path/path_element/label_hop/te_label/direction (te-label-direction) + If this variable is read-only (config: false) in the + source YANG file, then _set_direction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_direction() directly. + + YANG Description: Label direction. + """ + 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={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """direction must be of a type compatible with te-label-direction""", + 'defined-type': "ietf-te-topology:te-label-direction", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=False)""", + }) + + self.__direction = t + if hasattr(self, '_set'): + self._set() + + def _unset_direction(self): + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=False) + + generic = __builtin__.property(_get_generic) + otn = __builtin__.property(_get_otn) + vlanid = __builtin__.property(_get_vlanid) + direction = __builtin__.property(_get_direction) + + __choices__ = {'technology': {'generic': ['generic'], 'otn': ['otn'], 'eth': ['vlanid']}, 'type': {'label': ['direction']}} + _pyangbind_elements = OrderedDict([('generic', generic), ('otn', otn), ('vlanid', vlanid), ('direction', direction), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/backup_path/path_element/label_hop/te_label/otn/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/backup_path/path_element/label_hop/te_label/otn/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..f9e7d7a3d8ddfa7c1667c07438782a3485d87368 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/backup_path/path_element/label_hop/te_label/otn/__init__.py @@ -0,0 +1,209 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 otn(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/underlay/backup-path/path-element/label-hop/te-label/otn. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Label hop for OTN. + """ + __slots__ = ('_path_helper', '_extmethods', '__tpn','__tsg','__ts_list',) + + _yang_name = 'otn' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__tpn = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=False) + self.__tsg = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=False) + self.__ts_list = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', 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 ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'underlay', 'backup-path', 'path-element', 'label-hop', 'te-label', 'otn'] + + def _get_tpn(self): + """ + Getter method for tpn, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay/backup_path/path_element/label_hop/te_label/otn/tpn (otn-tpn) + + YANG Description: Tributary Port Number (TPN). + """ + return self.__tpn + + def _set_tpn(self, v, load=False): + """ + Setter method for tpn, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay/backup_path/path_element/label_hop/te_label/otn/tpn (otn-tpn) + If this variable is read-only (config: false) in the + source YANG file, then _set_tpn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tpn() directly. + + YANG Description: Tributary Port Number (TPN). + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tpn must be of a type compatible with otn-tpn""", + 'defined-type': "ietf-otn-topology:otn-tpn", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=False)""", + }) + + self.__tpn = t + if hasattr(self, '_set'): + self._set() + + def _unset_tpn(self): + self.__tpn = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=False) + + + def _get_tsg(self): + """ + Getter method for tsg, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay/backup_path/path_element/label_hop/te_label/otn/tsg (identityref) + + YANG Description: Tributary Slot Granularity (TSG). + """ + return self.__tsg + + def _set_tsg(self, v, load=False): + """ + Setter method for tsg, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay/backup_path/path_element/label_hop/te_label/otn/tsg (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_tsg is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tsg() directly. + + YANG Description: Tributary Slot Granularity (TSG). + """ + 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={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tsg must be of a type compatible with identityref""", + 'defined-type': "ietf-otn-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=False)""", + }) + + self.__tsg = t + if hasattr(self, '_set'): + self._set() + + def _unset_tsg(self): + self.__tsg = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=False) + + + def _get_ts_list(self): + """ + Getter method for ts_list, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay/backup_path/path_element/label_hop/te_label/otn/ts_list (string) + + YANG Description: A list of available Tributary Slots (TS) ranging + + + + +between 1 and 4095. If multiple values or +ranges are given, they all MUST be disjoint +and MUST be in ascending order. +For example 1-20,25,50-1000. + """ + return self.__ts_list + + def _set_ts_list(self, v, load=False): + """ + Setter method for ts_list, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay/backup_path/path_element/label_hop/te_label/otn/ts_list (string) + If this variable is read-only (config: false) in the + source YANG file, then _set_ts_list is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_ts_list() directly. + + YANG Description: A list of available Tributary Slots (TS) ranging + + + + +between 1 and 4095. If multiple values or +ranges are given, they all MUST be disjoint +and MUST be in ascending order. +For example 1-20,25,50-1000. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='string', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """ts_list must be of a type compatible with string""", + 'defined-type': "string", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='string', is_config=False)""", + }) + + self.__ts_list = t + if hasattr(self, '_set'): + self._set() + + def _unset_ts_list(self): + self.__ts_list = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='string', is_config=False) + + tpn = __builtin__.property(_get_tpn) + tsg = __builtin__.property(_get_tsg) + ts_list = __builtin__.property(_get_ts_list) + + __choices__ = {'technology': {'otn': ['tpn', 'tsg', 'ts_list']}} + _pyangbind_elements = OrderedDict([('tpn', tpn), ('tsg', tsg), ('ts_list', ts_list), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/backup_path/path_element/numbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/backup_path/path_element/numbered_link_hop/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..b1433a162123e59c7f146f26b69731aa9b12ffe9 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/backup_path/path_element/numbered_link_hop/__init__.py @@ -0,0 +1,193 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 numbered_link_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/underlay/backup-path/path-element/numbered-link-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Numbered link explicit route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__link_tp_id','__hop_type','__direction',) + + _yang_name = 'numbered-link-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=False) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', 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 ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'underlay', 'backup-path', 'path-element', 'numbered-link-hop'] + + def _get_link_tp_id(self): + """ + Getter method for link_tp_id, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay/backup_path/path_element/numbered_link_hop/link_tp_id (te-tp-id) + + YANG Description: TE Link Termination Point (LTP) identifier. + """ + return self.__link_tp_id + + def _set_link_tp_id(self, v, load=False): + """ + Setter method for link_tp_id, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay/backup_path/path_element/numbered_link_hop/link_tp_id (te-tp-id) + If this variable is read-only (config: false) in the + source YANG file, then _set_link_tp_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_link_tp_id() directly. + + YANG Description: TE Link Termination Point (LTP) identifier. + """ + 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),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """link_tp_id must be of a type compatible with te-tp-id""", + 'defined-type': "ietf-te-topology:te-tp-id", + 'generated-type': """YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=False)""", + }) + + self.__link_tp_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_link_tp_id(self): + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=False) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay/backup_path/path_element/numbered_link_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay/backup_path/path_element/numbered_link_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + 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={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + + + def _get_direction(self): + """ + Getter method for direction, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay/backup_path/path_element/numbered_link_hop/direction (te-link-direction) + + YANG Description: Link route object direction. + """ + return self.__direction + + def _set_direction(self, v, load=False): + """ + Setter method for direction, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay/backup_path/path_element/numbered_link_hop/direction (te-link-direction) + If this variable is read-only (config: false) in the + source YANG file, then _set_direction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_direction() directly. + + YANG Description: Link route object direction. + """ + 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={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """direction must be of a type compatible with te-link-direction""", + 'defined-type': "ietf-te-topology:te-link-direction", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=False)""", + }) + + self.__direction = t + if hasattr(self, '_set'): + self._set() + + def _unset_direction(self): + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=False) + + link_tp_id = __builtin__.property(_get_link_tp_id) + hop_type = __builtin__.property(_get_hop_type) + direction = __builtin__.property(_get_direction) + + __choices__ = {'type': {'numbered-link-hop': ['link_tp_id', 'hop_type', 'direction']}} + _pyangbind_elements = OrderedDict([('link_tp_id', link_tp_id), ('hop_type', hop_type), ('direction', direction), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/backup_path/path_element/numbered_node_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/backup_path/path_element/numbered_node_hop/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..919cb958e08e703c306b0b3c5f63bf665efb40b6 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/backup_path/path_element/numbered_node_hop/__init__.py @@ -0,0 +1,154 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 numbered_node_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/underlay/backup-path/path-element/numbered-node-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Numbered node route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__node_id','__hop_type',) + + _yang_name = 'numbered-node-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=False) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', 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 ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'underlay', 'backup-path', 'path-element', 'numbered-node-hop'] + + def _get_node_id(self): + """ + Getter method for node_id, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay/backup_path/path_element/numbered_node_hop/node_id (te-node-id) + + YANG Description: The identifier of a node in the TE topology. + """ + return self.__node_id + + def _set_node_id(self, v, load=False): + """ + Setter method for node_id, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay/backup_path/path_element/numbered_node_hop/node_id (te-node-id) + 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. + + YANG Description: The identifier of a node in the TE topology. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """node_id must be of a type compatible with te-node-id""", + 'defined-type': "ietf-te-topology:te-node-id", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=False)""", + }) + + self.__node_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_node_id(self): + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=False) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay/backup_path/path_element/numbered_node_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay/backup_path/path_element/numbered_node_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + 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={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + + node_id = __builtin__.property(_get_node_id) + hop_type = __builtin__.property(_get_hop_type) + + __choices__ = {'type': {'numbered-node-hop': ['node_id', 'hop_type']}} + _pyangbind_elements = OrderedDict([('node_id', node_id), ('hop_type', hop_type), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/backup_path/path_element/unnumbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/backup_path/path_element/unnumbered_link_hop/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..4268b048907964b9dac84106f985afad78ad95fc --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/backup_path/path_element/unnumbered_link_hop/__init__.py @@ -0,0 +1,236 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 unnumbered_link_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/underlay/backup-path/path-element/unnumbered-link-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Unnumbered link explicit route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__link_tp_id','__node_id','__hop_type','__direction',) + + _yang_name = 'unnumbered-link-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=False) + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=False) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', 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 ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'underlay', 'backup-path', 'path-element', 'unnumbered-link-hop'] + + def _get_link_tp_id(self): + """ + Getter method for link_tp_id, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay/backup_path/path_element/unnumbered_link_hop/link_tp_id (te-tp-id) + + YANG Description: TE LTP identifier. The combination of the TE link ID +and the TE node ID is used to identify an unnumbered +TE link. + """ + return self.__link_tp_id + + def _set_link_tp_id(self, v, load=False): + """ + Setter method for link_tp_id, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay/backup_path/path_element/unnumbered_link_hop/link_tp_id (te-tp-id) + If this variable is read-only (config: false) in the + source YANG file, then _set_link_tp_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_link_tp_id() directly. + + YANG Description: TE LTP identifier. The combination of the TE link ID +and the TE node ID is used to identify an unnumbered +TE link. + """ + 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),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """link_tp_id must be of a type compatible with te-tp-id""", + 'defined-type': "ietf-te-topology:te-tp-id", + 'generated-type': """YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=False)""", + }) + + self.__link_tp_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_link_tp_id(self): + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=False) + + + def _get_node_id(self): + """ + Getter method for node_id, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay/backup_path/path_element/unnumbered_link_hop/node_id (te-node-id) + + YANG Description: The identifier of a node in the TE topology. + """ + return self.__node_id + + def _set_node_id(self, v, load=False): + """ + Setter method for node_id, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay/backup_path/path_element/unnumbered_link_hop/node_id (te-node-id) + 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. + + YANG Description: The identifier of a node in the TE topology. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """node_id must be of a type compatible with te-node-id""", + 'defined-type': "ietf-te-topology:te-node-id", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=False)""", + }) + + self.__node_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_node_id(self): + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=False) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay/backup_path/path_element/unnumbered_link_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay/backup_path/path_element/unnumbered_link_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + 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={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + + + def _get_direction(self): + """ + Getter method for direction, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay/backup_path/path_element/unnumbered_link_hop/direction (te-link-direction) + + YANG Description: Link route object direction. + """ + return self.__direction + + def _set_direction(self, v, load=False): + """ + Setter method for direction, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay/backup_path/path_element/unnumbered_link_hop/direction (te-link-direction) + If this variable is read-only (config: false) in the + source YANG file, then _set_direction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_direction() directly. + + YANG Description: Link route object direction. + """ + 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={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """direction must be of a type compatible with te-link-direction""", + 'defined-type': "ietf-te-topology:te-link-direction", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=False)""", + }) + + self.__direction = t + if hasattr(self, '_set'): + self._set() + + def _unset_direction(self): + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=False) + + link_tp_id = __builtin__.property(_get_link_tp_id) + node_id = __builtin__.property(_get_node_id) + hop_type = __builtin__.property(_get_hop_type) + direction = __builtin__.property(_get_direction) + + __choices__ = {'type': {'unnumbered-link-hop': ['link_tp_id', 'node_id', 'hop_type', 'direction']}} + _pyangbind_elements = OrderedDict([('link_tp_id', link_tp_id), ('node_id', node_id), ('hop_type', hop_type), ('direction', direction), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/primary_path/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/primary_path/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..6f8297c2428b23508a5b81f759e727afb707535a --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/primary_path/__init__.py @@ -0,0 +1,158 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 path_element +class primary_path(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/underlay/primary-path. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: The service path on the underlay topology that +supports this link. + """ + __slots__ = ('_path_helper', '_extmethods', '__network_ref','__path_element',) + + _yang_name = 'primary-path' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__network_ref = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="network-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=False) + self.__path_element = YANGDynClass(base=YANGListType("path_element_id",path_element.path_element, yang_name="path-element", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='path-element-id', extensions=None), is_container='list', yang_name="path-element", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', 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 ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'underlay', 'primary-path'] + + def _get_network_ref(self): + """ + Getter method for network_ref, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay/primary_path/network_ref (leafref) + + YANG Description: Used to reference a network -- for example, an underlay +network. + """ + return self.__network_ref + + def _set_network_ref(self, v, load=False): + """ + Setter method for network_ref, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay/primary_path/network_ref (leafref) + If this variable is read-only (config: false) in the + source YANG file, then _set_network_ref is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_network_ref() directly. + + YANG Description: Used to reference a network -- for example, an underlay +network. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="network-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """network_ref must be of a type compatible with leafref""", + 'defined-type': "leafref", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="network-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=False)""", + }) + + self.__network_ref = t + if hasattr(self, '_set'): + self._set() + + def _unset_network_ref(self): + self.__network_ref = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="network-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=False) + + + def _get_path_element(self): + """ + Getter method for path_element, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay/primary_path/path_element (list) + + YANG Description: A list of path elements describing the service path. + """ + return self.__path_element + + def _set_path_element(self, v, load=False): + """ + Setter method for path_element, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay/primary_path/path_element (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_element is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_element() directly. + + YANG Description: A list of path elements describing the service path. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("path_element_id",path_element.path_element, yang_name="path-element", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='path-element-id', extensions=None), is_container='list', yang_name="path-element", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_element must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("path_element_id",path_element.path_element, yang_name="path-element", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='path-element-id', extensions=None), is_container='list', yang_name="path-element", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False)""", + }) + + self.__path_element = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_element(self): + self.__path_element = YANGDynClass(base=YANGListType("path_element_id",path_element.path_element, yang_name="path-element", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='path-element-id', extensions=None), is_container='list', yang_name="path-element", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + + network_ref = __builtin__.property(_get_network_ref) + path_element = __builtin__.property(_get_path_element) + + + _pyangbind_elements = OrderedDict([('network_ref', network_ref), ('path_element', path_element), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/primary_path/path_element/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/primary_path/path_element/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..0c5b869f6aab42d30032b0d62c28653cfd1ceab7 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/primary_path/path_element/__init__.py @@ -0,0 +1,320 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 numbered_node_hop +from . import numbered_link_hop +from . import unnumbered_link_hop +from . import as_number_hop +from . import label_hop +class path_element(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/underlay/primary-path/path-element. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: A list of path elements describing the service path. + """ + __slots__ = ('_path_helper', '_extmethods', '__path_element_id','__numbered_node_hop','__numbered_link_hop','__unnumbered_link_hop','__as_number_hop','__label_hop',) + + _yang_name = 'path-element' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__path_element_id = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="path-element-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=False) + self.__numbered_node_hop = YANGDynClass(base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__numbered_link_hop = YANGDynClass(base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__unnumbered_link_hop = YANGDynClass(base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__as_number_hop = YANGDynClass(base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__label_hop = YANGDynClass(base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', 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 ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'underlay', 'primary-path', 'path-element'] + + def _get_path_element_id(self): + """ + Getter method for path_element_id, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay/primary_path/path_element/path_element_id (uint32) + + YANG Description: To identify the element in a path. + """ + return self.__path_element_id + + def _set_path_element_id(self, v, load=False): + """ + Setter method for path_element_id, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay/primary_path/path_element/path_element_id (uint32) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_element_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_element_id() directly. + + YANG Description: To identify the element in a path. + """ + 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=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="path-element-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_element_id 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="path-element-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=False)""", + }) + + self.__path_element_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_element_id(self): + self.__path_element_id = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="path-element-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=False) + + + def _get_numbered_node_hop(self): + """ + Getter method for numbered_node_hop, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay/primary_path/path_element/numbered_node_hop (container) + + YANG Description: Numbered node route hop. + """ + return self.__numbered_node_hop + + def _set_numbered_node_hop(self, v, load=False): + """ + Setter method for numbered_node_hop, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay/primary_path/path_element/numbered_node_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_numbered_node_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_numbered_node_hop() directly. + + YANG Description: Numbered node route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """numbered_node_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__numbered_node_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_numbered_node_hop(self): + self.__numbered_node_hop = YANGDynClass(base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_numbered_link_hop(self): + """ + Getter method for numbered_link_hop, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay/primary_path/path_element/numbered_link_hop (container) + + YANG Description: Numbered link explicit route hop. + """ + return self.__numbered_link_hop + + def _set_numbered_link_hop(self, v, load=False): + """ + Setter method for numbered_link_hop, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay/primary_path/path_element/numbered_link_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_numbered_link_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_numbered_link_hop() directly. + + YANG Description: Numbered link explicit route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """numbered_link_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__numbered_link_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_numbered_link_hop(self): + self.__numbered_link_hop = YANGDynClass(base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_unnumbered_link_hop(self): + """ + Getter method for unnumbered_link_hop, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay/primary_path/path_element/unnumbered_link_hop (container) + + YANG Description: Unnumbered link explicit route hop. + """ + return self.__unnumbered_link_hop + + def _set_unnumbered_link_hop(self, v, load=False): + """ + Setter method for unnumbered_link_hop, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay/primary_path/path_element/unnumbered_link_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_unnumbered_link_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_unnumbered_link_hop() directly. + + YANG Description: Unnumbered link explicit route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """unnumbered_link_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__unnumbered_link_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_unnumbered_link_hop(self): + self.__unnumbered_link_hop = YANGDynClass(base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_as_number_hop(self): + """ + Getter method for as_number_hop, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay/primary_path/path_element/as_number_hop (container) + + YANG Description: AS explicit route hop. + """ + return self.__as_number_hop + + def _set_as_number_hop(self, v, load=False): + """ + Setter method for as_number_hop, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay/primary_path/path_element/as_number_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_as_number_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_as_number_hop() directly. + + YANG Description: AS explicit route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """as_number_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__as_number_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_as_number_hop(self): + self.__as_number_hop = YANGDynClass(base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_label_hop(self): + """ + Getter method for label_hop, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay/primary_path/path_element/label_hop (container) + + YANG Description: Label hop type. + """ + return self.__label_hop + + def _set_label_hop(self, v, load=False): + """ + Setter method for label_hop, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay/primary_path/path_element/label_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_label_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_label_hop() directly. + + YANG Description: Label hop type. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """label_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__label_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_label_hop(self): + self.__label_hop = YANGDynClass(base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + path_element_id = __builtin__.property(_get_path_element_id) + numbered_node_hop = __builtin__.property(_get_numbered_node_hop) + numbered_link_hop = __builtin__.property(_get_numbered_link_hop) + unnumbered_link_hop = __builtin__.property(_get_unnumbered_link_hop) + as_number_hop = __builtin__.property(_get_as_number_hop) + label_hop = __builtin__.property(_get_label_hop) + + __choices__ = {'type': {'numbered-node-hop': ['numbered_node_hop'], 'numbered-link-hop': ['numbered_link_hop'], 'unnumbered-link-hop': ['unnumbered_link_hop'], 'as-number': ['as_number_hop'], 'label': ['label_hop']}} + _pyangbind_elements = OrderedDict([('path_element_id', path_element_id), ('numbered_node_hop', numbered_node_hop), ('numbered_link_hop', numbered_link_hop), ('unnumbered_link_hop', unnumbered_link_hop), ('as_number_hop', as_number_hop), ('label_hop', label_hop), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/primary_path/path_element/as_number_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/primary_path/path_element/as_number_hop/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..f66d7136eb30f450c4e858c6105cda2616a650b8 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/primary_path/path_element/as_number_hop/__init__.py @@ -0,0 +1,154 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 as_number_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/underlay/primary-path/path-element/as-number-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: AS explicit route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__as_number','__hop_type',) + + _yang_name = 'as-number-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__as_number = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=False) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', 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 ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'underlay', 'primary-path', 'path-element', 'as-number-hop'] + + def _get_as_number(self): + """ + Getter method for as_number, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay/primary_path/path_element/as_number_hop/as_number (inet:as-number) + + YANG Description: The Autonomous System (AS) number. + """ + return self.__as_number + + def _set_as_number(self, v, load=False): + """ + Setter method for as_number, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay/primary_path/path_element/as_number_hop/as_number (inet:as-number) + If this variable is read-only (config: false) in the + source YANG file, then _set_as_number is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_as_number() directly. + + YANG Description: The Autonomous System (AS) number. + """ + 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="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """as_number must be of a type compatible with inet:as-number""", + 'defined-type': "inet:as-number", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=False)""", + }) + + self.__as_number = t + if hasattr(self, '_set'): + self._set() + + def _unset_as_number(self): + self.__as_number = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=False) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay/primary_path/path_element/as_number_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay/primary_path/path_element/as_number_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + 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={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + + as_number = __builtin__.property(_get_as_number) + hop_type = __builtin__.property(_get_hop_type) + + __choices__ = {'type': {'as-number': ['as_number', 'hop_type']}} + _pyangbind_elements = OrderedDict([('as_number', as_number), ('hop_type', hop_type), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/primary_path/path_element/label_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/primary_path/path_element/label_hop/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..5913384044adca0adc530c78228b13ef40ee3520 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/primary_path/path_element/label_hop/__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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 te_label +class label_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/underlay/primary-path/path-element/label-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Label hop type. + """ + __slots__ = ('_path_helper', '_extmethods', '__te_label',) + + _yang_name = 'label-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__te_label = YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', 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 ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'underlay', 'primary-path', 'path-element', 'label-hop'] + + def _get_te_label(self): + """ + Getter method for te_label, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay/primary_path/path_element/label_hop/te_label (container) + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + return self.__te_label + + def _set_te_label(self, v, load=False): + """ + Setter method for te_label, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay/primary_path/path_element/label_hop/te_label (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_te_label is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_te_label() directly. + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """te_label must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__te_label = t + if hasattr(self, '_set'): + self._set() + + def _unset_te_label(self): + self.__te_label = YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + te_label = __builtin__.property(_get_te_label) + + __choices__ = {'type': {'label': ['te_label']}} + _pyangbind_elements = OrderedDict([('te_label', te_label), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/primary_path/path_element/label_hop/te_label/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/primary_path/path_element/label_hop/te_label/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..5702d315008463d772546a497f5499a610f291e8 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/primary_path/path_element/label_hop/te_label/__init__.py @@ -0,0 +1,234 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 otn +class te_label(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/underlay/primary-path/path-element/label-hop/te-label. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + __slots__ = ('_path_helper', '_extmethods', '__generic','__otn','__vlanid','__direction',) + + _yang_name = 'te-label' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__generic = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=False) + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False) + self.__vlanid = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=False) + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', 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 ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'underlay', 'primary-path', 'path-element', 'label-hop', 'te-label'] + + def _get_generic(self): + """ + Getter method for generic, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay/primary_path/path_element/label_hop/te_label/generic (rt-types:generalized-label) + + YANG Description: TE label specified in a generic format. + """ + return self.__generic + + def _set_generic(self, v, load=False): + """ + Setter method for generic, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay/primary_path/path_element/label_hop/te_label/generic (rt-types:generalized-label) + If this variable is read-only (config: false) in the + source YANG file, then _set_generic is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_generic() directly. + + YANG Description: TE label specified in a generic format. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """generic must be of a type compatible with rt-types:generalized-label""", + 'defined-type': "rt-types:generalized-label", + 'generated-type': """YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=False)""", + }) + + self.__generic = t + if hasattr(self, '_set'): + self._set() + + def _unset_generic(self): + self.__generic = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=False) + + + def _get_otn(self): + """ + Getter method for otn, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay/primary_path/path_element/label_hop/te_label/otn (container) + + YANG Description: Label hop for OTN. + """ + return self.__otn + + def _set_otn(self, v, load=False): + """ + Setter method for otn, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay/primary_path/path_element/label_hop/te_label/otn (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_otn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_otn() directly. + + YANG Description: Label hop for OTN. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """otn must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False)""", + }) + + self.__otn = t + if hasattr(self, '_set'): + self._set() + + def _unset_otn(self): + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False) + + + def _get_vlanid(self): + """ + Getter method for vlanid, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay/primary_path/path_element/label_hop/te_label/vlanid (etht-types:vlanid) + + YANG Description: VLAN tag id. + """ + return self.__vlanid + + def _set_vlanid(self, v, load=False): + """ + Setter method for vlanid, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay/primary_path/path_element/label_hop/te_label/vlanid (etht-types:vlanid) + If this variable is read-only (config: false) in the + source YANG file, then _set_vlanid is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_vlanid() directly. + + YANG Description: VLAN tag id. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """vlanid must be of a type compatible with etht-types:vlanid""", + 'defined-type': "etht-types:vlanid", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=False)""", + }) + + self.__vlanid = t + if hasattr(self, '_set'): + self._set() + + def _unset_vlanid(self): + self.__vlanid = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=False) + + + def _get_direction(self): + """ + Getter method for direction, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay/primary_path/path_element/label_hop/te_label/direction (te-label-direction) + + YANG Description: Label direction. + """ + return self.__direction + + def _set_direction(self, v, load=False): + """ + Setter method for direction, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay/primary_path/path_element/label_hop/te_label/direction (te-label-direction) + If this variable is read-only (config: false) in the + source YANG file, then _set_direction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_direction() directly. + + YANG Description: Label direction. + """ + 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={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """direction must be of a type compatible with te-label-direction""", + 'defined-type': "ietf-te-topology:te-label-direction", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=False)""", + }) + + self.__direction = t + if hasattr(self, '_set'): + self._set() + + def _unset_direction(self): + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=False) + + generic = __builtin__.property(_get_generic) + otn = __builtin__.property(_get_otn) + vlanid = __builtin__.property(_get_vlanid) + direction = __builtin__.property(_get_direction) + + __choices__ = {'technology': {'generic': ['generic'], 'otn': ['otn'], 'eth': ['vlanid']}, 'type': {'label': ['direction']}} + _pyangbind_elements = OrderedDict([('generic', generic), ('otn', otn), ('vlanid', vlanid), ('direction', direction), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/primary_path/path_element/label_hop/te_label/otn/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/primary_path/path_element/label_hop/te_label/otn/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..7d8a5775c84e518b9848dcf49bd6f5767e34134f --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/primary_path/path_element/label_hop/te_label/otn/__init__.py @@ -0,0 +1,209 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 otn(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/underlay/primary-path/path-element/label-hop/te-label/otn. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Label hop for OTN. + """ + __slots__ = ('_path_helper', '_extmethods', '__tpn','__tsg','__ts_list',) + + _yang_name = 'otn' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__tpn = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=False) + self.__tsg = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=False) + self.__ts_list = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', 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 ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'underlay', 'primary-path', 'path-element', 'label-hop', 'te-label', 'otn'] + + def _get_tpn(self): + """ + Getter method for tpn, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay/primary_path/path_element/label_hop/te_label/otn/tpn (otn-tpn) + + YANG Description: Tributary Port Number (TPN). + """ + return self.__tpn + + def _set_tpn(self, v, load=False): + """ + Setter method for tpn, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay/primary_path/path_element/label_hop/te_label/otn/tpn (otn-tpn) + If this variable is read-only (config: false) in the + source YANG file, then _set_tpn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tpn() directly. + + YANG Description: Tributary Port Number (TPN). + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tpn must be of a type compatible with otn-tpn""", + 'defined-type': "ietf-otn-topology:otn-tpn", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=False)""", + }) + + self.__tpn = t + if hasattr(self, '_set'): + self._set() + + def _unset_tpn(self): + self.__tpn = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=False) + + + def _get_tsg(self): + """ + Getter method for tsg, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay/primary_path/path_element/label_hop/te_label/otn/tsg (identityref) + + YANG Description: Tributary Slot Granularity (TSG). + """ + return self.__tsg + + def _set_tsg(self, v, load=False): + """ + Setter method for tsg, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay/primary_path/path_element/label_hop/te_label/otn/tsg (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_tsg is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tsg() directly. + + YANG Description: Tributary Slot Granularity (TSG). + """ + 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={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tsg must be of a type compatible with identityref""", + 'defined-type': "ietf-otn-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=False)""", + }) + + self.__tsg = t + if hasattr(self, '_set'): + self._set() + + def _unset_tsg(self): + self.__tsg = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=False) + + + def _get_ts_list(self): + """ + Getter method for ts_list, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay/primary_path/path_element/label_hop/te_label/otn/ts_list (string) + + YANG Description: A list of available Tributary Slots (TS) ranging + + + + +between 1 and 4095. If multiple values or +ranges are given, they all MUST be disjoint +and MUST be in ascending order. +For example 1-20,25,50-1000. + """ + return self.__ts_list + + def _set_ts_list(self, v, load=False): + """ + Setter method for ts_list, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay/primary_path/path_element/label_hop/te_label/otn/ts_list (string) + If this variable is read-only (config: false) in the + source YANG file, then _set_ts_list is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_ts_list() directly. + + YANG Description: A list of available Tributary Slots (TS) ranging + + + + +between 1 and 4095. If multiple values or +ranges are given, they all MUST be disjoint +and MUST be in ascending order. +For example 1-20,25,50-1000. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='string', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """ts_list must be of a type compatible with string""", + 'defined-type': "string", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='string', is_config=False)""", + }) + + self.__ts_list = t + if hasattr(self, '_set'): + self._set() + + def _unset_ts_list(self): + self.__ts_list = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='string', is_config=False) + + tpn = __builtin__.property(_get_tpn) + tsg = __builtin__.property(_get_tsg) + ts_list = __builtin__.property(_get_ts_list) + + __choices__ = {'technology': {'otn': ['tpn', 'tsg', 'ts_list']}} + _pyangbind_elements = OrderedDict([('tpn', tpn), ('tsg', tsg), ('ts_list', ts_list), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/primary_path/path_element/numbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/primary_path/path_element/numbered_link_hop/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..ef124eada429f941ecb01207e1f66cb3cca0bdb1 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/primary_path/path_element/numbered_link_hop/__init__.py @@ -0,0 +1,193 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 numbered_link_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/underlay/primary-path/path-element/numbered-link-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Numbered link explicit route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__link_tp_id','__hop_type','__direction',) + + _yang_name = 'numbered-link-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=False) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', 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 ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'underlay', 'primary-path', 'path-element', 'numbered-link-hop'] + + def _get_link_tp_id(self): + """ + Getter method for link_tp_id, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay/primary_path/path_element/numbered_link_hop/link_tp_id (te-tp-id) + + YANG Description: TE Link Termination Point (LTP) identifier. + """ + return self.__link_tp_id + + def _set_link_tp_id(self, v, load=False): + """ + Setter method for link_tp_id, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay/primary_path/path_element/numbered_link_hop/link_tp_id (te-tp-id) + If this variable is read-only (config: false) in the + source YANG file, then _set_link_tp_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_link_tp_id() directly. + + YANG Description: TE Link Termination Point (LTP) identifier. + """ + 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),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """link_tp_id must be of a type compatible with te-tp-id""", + 'defined-type': "ietf-te-topology:te-tp-id", + 'generated-type': """YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=False)""", + }) + + self.__link_tp_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_link_tp_id(self): + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=False) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay/primary_path/path_element/numbered_link_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay/primary_path/path_element/numbered_link_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + 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={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + + + def _get_direction(self): + """ + Getter method for direction, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay/primary_path/path_element/numbered_link_hop/direction (te-link-direction) + + YANG Description: Link route object direction. + """ + return self.__direction + + def _set_direction(self, v, load=False): + """ + Setter method for direction, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay/primary_path/path_element/numbered_link_hop/direction (te-link-direction) + If this variable is read-only (config: false) in the + source YANG file, then _set_direction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_direction() directly. + + YANG Description: Link route object direction. + """ + 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={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """direction must be of a type compatible with te-link-direction""", + 'defined-type': "ietf-te-topology:te-link-direction", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=False)""", + }) + + self.__direction = t + if hasattr(self, '_set'): + self._set() + + def _unset_direction(self): + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=False) + + link_tp_id = __builtin__.property(_get_link_tp_id) + hop_type = __builtin__.property(_get_hop_type) + direction = __builtin__.property(_get_direction) + + __choices__ = {'type': {'numbered-link-hop': ['link_tp_id', 'hop_type', 'direction']}} + _pyangbind_elements = OrderedDict([('link_tp_id', link_tp_id), ('hop_type', hop_type), ('direction', direction), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/primary_path/path_element/numbered_node_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/primary_path/path_element/numbered_node_hop/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..15377f86d5771b06091695253a7beae8cc48f982 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/primary_path/path_element/numbered_node_hop/__init__.py @@ -0,0 +1,154 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 numbered_node_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/underlay/primary-path/path-element/numbered-node-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Numbered node route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__node_id','__hop_type',) + + _yang_name = 'numbered-node-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=False) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', 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 ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'underlay', 'primary-path', 'path-element', 'numbered-node-hop'] + + def _get_node_id(self): + """ + Getter method for node_id, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay/primary_path/path_element/numbered_node_hop/node_id (te-node-id) + + YANG Description: The identifier of a node in the TE topology. + """ + return self.__node_id + + def _set_node_id(self, v, load=False): + """ + Setter method for node_id, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay/primary_path/path_element/numbered_node_hop/node_id (te-node-id) + 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. + + YANG Description: The identifier of a node in the TE topology. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """node_id must be of a type compatible with te-node-id""", + 'defined-type': "ietf-te-topology:te-node-id", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=False)""", + }) + + self.__node_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_node_id(self): + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=False) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay/primary_path/path_element/numbered_node_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay/primary_path/path_element/numbered_node_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + 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={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + + node_id = __builtin__.property(_get_node_id) + hop_type = __builtin__.property(_get_hop_type) + + __choices__ = {'type': {'numbered-node-hop': ['node_id', 'hop_type']}} + _pyangbind_elements = OrderedDict([('node_id', node_id), ('hop_type', hop_type), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/primary_path/path_element/unnumbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/primary_path/path_element/unnumbered_link_hop/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..b950c235885e4c2afd13af722f71f644f565c472 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/primary_path/path_element/unnumbered_link_hop/__init__.py @@ -0,0 +1,236 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 unnumbered_link_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/underlay/primary-path/path-element/unnumbered-link-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Unnumbered link explicit route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__link_tp_id','__node_id','__hop_type','__direction',) + + _yang_name = 'unnumbered-link-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=False) + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=False) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', 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 ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'underlay', 'primary-path', 'path-element', 'unnumbered-link-hop'] + + def _get_link_tp_id(self): + """ + Getter method for link_tp_id, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay/primary_path/path_element/unnumbered_link_hop/link_tp_id (te-tp-id) + + YANG Description: TE LTP identifier. The combination of the TE link ID +and the TE node ID is used to identify an unnumbered +TE link. + """ + return self.__link_tp_id + + def _set_link_tp_id(self, v, load=False): + """ + Setter method for link_tp_id, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay/primary_path/path_element/unnumbered_link_hop/link_tp_id (te-tp-id) + If this variable is read-only (config: false) in the + source YANG file, then _set_link_tp_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_link_tp_id() directly. + + YANG Description: TE LTP identifier. The combination of the TE link ID +and the TE node ID is used to identify an unnumbered +TE link. + """ + 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),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """link_tp_id must be of a type compatible with te-tp-id""", + 'defined-type': "ietf-te-topology:te-tp-id", + 'generated-type': """YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=False)""", + }) + + self.__link_tp_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_link_tp_id(self): + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=False) + + + def _get_node_id(self): + """ + Getter method for node_id, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay/primary_path/path_element/unnumbered_link_hop/node_id (te-node-id) + + YANG Description: The identifier of a node in the TE topology. + """ + return self.__node_id + + def _set_node_id(self, v, load=False): + """ + Setter method for node_id, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay/primary_path/path_element/unnumbered_link_hop/node_id (te-node-id) + 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. + + YANG Description: The identifier of a node in the TE topology. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """node_id must be of a type compatible with te-node-id""", + 'defined-type': "ietf-te-topology:te-node-id", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=False)""", + }) + + self.__node_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_node_id(self): + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=False) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay/primary_path/path_element/unnumbered_link_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay/primary_path/path_element/unnumbered_link_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + 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={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + + + def _get_direction(self): + """ + Getter method for direction, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay/primary_path/path_element/unnumbered_link_hop/direction (te-link-direction) + + YANG Description: Link route object direction. + """ + return self.__direction + + def _set_direction(self, v, load=False): + """ + Setter method for direction, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay/primary_path/path_element/unnumbered_link_hop/direction (te-link-direction) + If this variable is read-only (config: false) in the + source YANG file, then _set_direction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_direction() directly. + + YANG Description: Link route object direction. + """ + 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={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """direction must be of a type compatible with te-link-direction""", + 'defined-type': "ietf-te-topology:te-link-direction", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=False)""", + }) + + self.__direction = t + if hasattr(self, '_set'): + self._set() + + def _unset_direction(self): + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=False) + + link_tp_id = __builtin__.property(_get_link_tp_id) + node_id = __builtin__.property(_get_node_id) + hop_type = __builtin__.property(_get_hop_type) + direction = __builtin__.property(_get_direction) + + __choices__ = {'type': {'unnumbered-link-hop': ['link_tp_id', 'node_id', 'hop_type', 'direction']}} + _pyangbind_elements = OrderedDict([('link_tp_id', link_tp_id), ('node_id', node_id), ('hop_type', hop_type), ('direction', direction), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/tunnel_termination_points/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/tunnel_termination_points/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..f6a6987ff720aa02066efd5ad34ce63d2f50c600 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/tunnel_termination_points/__init__.py @@ -0,0 +1,154 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 tunnel_termination_points(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/underlay/tunnel-termination-points. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Underlay TTPs desired for this link. + """ + __slots__ = ('_path_helper', '_extmethods', '__source','__destination',) + + _yang_name = 'tunnel-termination-points' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__source = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="source", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='binary', is_config=False) + self.__destination = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="destination", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='binary', 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 ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'underlay', 'tunnel-termination-points'] + + def _get_source(self): + """ + Getter method for source, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay/tunnel_termination_points/source (binary) + + YANG Description: Source TTP identifier. + """ + return self.__source + + def _set_source(self, v, load=False): + """ + Setter method for source, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay/tunnel_termination_points/source (binary) + If this variable is read-only (config: false) in the + source YANG file, then _set_source is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_source() directly. + + YANG Description: Source TTP identifier. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBinary, is_leaf=True, yang_name="source", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='binary', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """source must be of a type compatible with binary""", + 'defined-type': "binary", + 'generated-type': """YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="source", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='binary', is_config=False)""", + }) + + self.__source = t + if hasattr(self, '_set'): + self._set() + + def _unset_source(self): + self.__source = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="source", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='binary', is_config=False) + + + def _get_destination(self): + """ + Getter method for destination, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay/tunnel_termination_points/destination (binary) + + YANG Description: Destination TTP identifier. + """ + return self.__destination + + def _set_destination(self, v, load=False): + """ + Setter method for destination, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay/tunnel_termination_points/destination (binary) + If this variable is read-only (config: false) in the + source YANG file, then _set_destination is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_destination() directly. + + YANG Description: Destination TTP identifier. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBinary, is_leaf=True, yang_name="destination", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='binary', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """destination must be of a type compatible with binary""", + 'defined-type': "binary", + 'generated-type': """YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="destination", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='binary', is_config=False)""", + }) + + self.__destination = t + if hasattr(self, '_set'): + self._set() + + def _unset_destination(self): + self.__destination = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="destination", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='binary', is_config=False) + + source = __builtin__.property(_get_source) + destination = __builtin__.property(_get_destination) + + + _pyangbind_elements = OrderedDict([('source', source), ('destination', destination), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/tunnels/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/tunnels/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..b1d6cf9df47fb52c6b856d53f9de35da976c8754 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/tunnels/__init__.py @@ -0,0 +1,167 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 tunnel +class tunnels(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/underlay/tunnels. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Underlay TE tunnels supporting this TE link. + """ + __slots__ = ('_path_helper', '_extmethods', '__sharing','__tunnel',) + + _yang_name = 'tunnels' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__sharing = YANGDynClass(base=YANGBool, default=YANGBool("true"), is_leaf=True, yang_name="sharing", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='boolean', is_config=False) + self.__tunnel = YANGDynClass(base=YANGListType("tunnel_name",tunnel.tunnel, yang_name="tunnel", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='tunnel-name', extensions=None), is_container='list', yang_name="tunnel", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', 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 ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'underlay', 'tunnels'] + + def _get_sharing(self): + """ + Getter method for sharing, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay/tunnels/sharing (boolean) + + YANG Description: 'true' if the underlay tunnel can be shared with other +TE links; +'false' if the underlay tunnel is dedicated to this +TE link. +This leaf is the default option for all TE tunnels +and may be overridden by the per-TE-tunnel value. + """ + return self.__sharing + + def _set_sharing(self, v, load=False): + """ + Setter method for sharing, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay/tunnels/sharing (boolean) + If this variable is read-only (config: false) in the + source YANG file, then _set_sharing is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_sharing() directly. + + YANG Description: 'true' if the underlay tunnel can be shared with other +TE links; +'false' if the underlay tunnel is dedicated to this +TE link. +This leaf is the default option for all TE tunnels +and may be overridden by the per-TE-tunnel value. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBool, default=YANGBool("true"), is_leaf=True, yang_name="sharing", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='boolean', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """sharing must be of a type compatible with boolean""", + 'defined-type': "boolean", + 'generated-type': """YANGDynClass(base=YANGBool, default=YANGBool("true"), is_leaf=True, yang_name="sharing", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='boolean', is_config=False)""", + }) + + self.__sharing = t + if hasattr(self, '_set'): + self._set() + + def _unset_sharing(self): + self.__sharing = YANGDynClass(base=YANGBool, default=YANGBool("true"), is_leaf=True, yang_name="sharing", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='boolean', is_config=False) + + + def _get_tunnel(self): + """ + Getter method for tunnel, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay/tunnels/tunnel (list) + + YANG Description: Zero, one, or more underlay TE tunnels that support this +TE link. + """ + return self.__tunnel + + def _set_tunnel(self, v, load=False): + """ + Setter method for tunnel, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay/tunnels/tunnel (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_tunnel is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tunnel() directly. + + YANG Description: Zero, one, or more underlay TE tunnels that support this +TE link. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("tunnel_name",tunnel.tunnel, yang_name="tunnel", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='tunnel-name', extensions=None), is_container='list', yang_name="tunnel", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tunnel must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("tunnel_name",tunnel.tunnel, yang_name="tunnel", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='tunnel-name', extensions=None), is_container='list', yang_name="tunnel", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False)""", + }) + + self.__tunnel = t + if hasattr(self, '_set'): + self._set() + + def _unset_tunnel(self): + self.__tunnel = YANGDynClass(base=YANGListType("tunnel_name",tunnel.tunnel, yang_name="tunnel", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='tunnel-name', extensions=None), is_container='list', yang_name="tunnel", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + + sharing = __builtin__.property(_get_sharing) + tunnel = __builtin__.property(_get_tunnel) + + + _pyangbind_elements = OrderedDict([('sharing', sharing), ('tunnel', tunnel), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/tunnels/tunnel/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/tunnels/tunnel/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..8f8593123c741f78bb9c17df2ff37cbdc7671475 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/tunnels/tunnel/__init__.py @@ -0,0 +1,170 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 tunnel(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/underlay/tunnels/tunnel. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Zero, one, or more underlay TE tunnels that support this +TE link. + """ + __slots__ = ('_path_helper', '_extmethods', '__tunnel_name','__sharing',) + + _yang_name = 'tunnel' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__tunnel_name = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="tunnel-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=False) + self.__sharing = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="sharing", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', 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 ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'underlay', 'tunnels', 'tunnel'] + + def _get_tunnel_name(self): + """ + Getter method for tunnel_name, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay/tunnels/tunnel/tunnel_name (string) + + YANG Description: A tunnel name uniquely identifies an underlay TE tunnel, +used together with the 'source-node' value for this +link. + """ + return self.__tunnel_name + + def _set_tunnel_name(self, v, load=False): + """ + Setter method for tunnel_name, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay/tunnels/tunnel/tunnel_name (string) + If this variable is read-only (config: false) in the + source YANG file, then _set_tunnel_name is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tunnel_name() directly. + + YANG Description: A tunnel name uniquely identifies an underlay TE tunnel, +used together with the 'source-node' value for this +link. + """ + 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="tunnel-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tunnel_name must be of a type compatible with string""", + 'defined-type': "string", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="tunnel-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=False)""", + }) + + self.__tunnel_name = t + if hasattr(self, '_set'): + self._set() + + def _unset_tunnel_name(self): + self.__tunnel_name = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="tunnel-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=False) + + + def _get_sharing(self): + """ + Getter method for sharing, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay/tunnels/tunnel/sharing (boolean) + + YANG Description: 'true' if the underlay tunnel can be shared with other +TE links; +'false' if the underlay tunnel is dedicated to this +TE link. + """ + return self.__sharing + + def _set_sharing(self, v, load=False): + """ + Setter method for sharing, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay/tunnels/tunnel/sharing (boolean) + If this variable is read-only (config: false) in the + source YANG file, then _set_sharing is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_sharing() directly. + + YANG Description: 'true' if the underlay tunnel can be shared with other +TE links; +'false' if the underlay tunnel is dedicated to this +TE link. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBool, is_leaf=True, yang_name="sharing", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='boolean', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """sharing must be of a type compatible with boolean""", + 'defined-type': "boolean", + 'generated-type': """YANGDynClass(base=YANGBool, is_leaf=True, yang_name="sharing", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='boolean', is_config=False)""", + }) + + self.__sharing = t + if hasattr(self, '_set'): + self._set() + + def _unset_sharing(self): + self.__sharing = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="sharing", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='boolean', is_config=False) + + tunnel_name = __builtin__.property(_get_tunnel_name) + sharing = __builtin__.property(_get_sharing) + + + _pyangbind_elements = OrderedDict([('tunnel_name', tunnel_name), ('sharing', sharing), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/information_source_state/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/information_source_state/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..1ee93c90fde18dc4423f1d361606db1723c677c6 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/information_source_state/__init__.py @@ -0,0 +1,248 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 topology +class information_source_state(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/information-source-state. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Contains state attributes related to the information +source. + """ + __slots__ = ('_path_helper', '_extmethods', '__credibility_preference','__logical_network_element','__network_instance','__topology',) + + _yang_name = 'information-source-state' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__credibility_preference = YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), is_leaf=True, yang_name="credibility-preference", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint16', is_config=False) + self.__logical_network_element = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="logical-network-element", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=False) + self.__network_instance = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="network-instance", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=False) + self.__topology = YANGDynClass(base=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:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', 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 ['networks', 'network', 'node', 'te', 'information-source-entry', 'information-source-state'] + + def _get_credibility_preference(self): + """ + Getter method for credibility_preference, mapped from YANG variable /networks/network/node/te/information_source_entry/information_source_state/credibility_preference (uint16) + + YANG Description: The preference value for calculating the Traffic +Engineering database credibility value used for +tie-break selection between different information-source +values. A higher value is preferable. + """ + return self.__credibility_preference + + def _set_credibility_preference(self, v, load=False): + """ + Setter method for credibility_preference, mapped from YANG variable /networks/network/node/te/information_source_entry/information_source_state/credibility_preference (uint16) + If this variable is read-only (config: false) in the + source YANG file, then _set_credibility_preference is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_credibility_preference() directly. + + YANG Description: The preference value for calculating the Traffic +Engineering database credibility value used for +tie-break selection between different information-source +values. A higher value is preferable. + """ + 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="credibility-preference", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint16', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """credibility_preference 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="credibility-preference", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint16', is_config=False)""", + }) + + self.__credibility_preference = t + if hasattr(self, '_set'): + self._set() + + def _unset_credibility_preference(self): + self.__credibility_preference = YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), is_leaf=True, yang_name="credibility-preference", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint16', is_config=False) + + + def _get_logical_network_element(self): + """ + Getter method for logical_network_element, mapped from YANG variable /networks/network/node/te/information_source_entry/information_source_state/logical_network_element (string) + + YANG Description: When applicable, this is the name of a logical network +element from which the information is learned. + """ + return self.__logical_network_element + + def _set_logical_network_element(self, v, load=False): + """ + Setter method for logical_network_element, mapped from YANG variable /networks/network/node/te/information_source_entry/information_source_state/logical_network_element (string) + If this variable is read-only (config: false) in the + source YANG file, then _set_logical_network_element is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_logical_network_element() directly. + + YANG Description: When applicable, this is the name of a logical network +element from which the information is learned. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="logical-network-element", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """logical_network_element must be of a type compatible with string""", + 'defined-type': "string", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="logical-network-element", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=False)""", + }) + + self.__logical_network_element = t + if hasattr(self, '_set'): + self._set() + + def _unset_logical_network_element(self): + self.__logical_network_element = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="logical-network-element", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=False) + + + def _get_network_instance(self): + """ + Getter method for network_instance, mapped from YANG variable /networks/network/node/te/information_source_entry/information_source_state/network_instance (string) + + YANG Description: When applicable, this is the name of a network instance +from which the information is learned. + """ + return self.__network_instance + + def _set_network_instance(self, v, load=False): + """ + Setter method for network_instance, mapped from YANG variable /networks/network/node/te/information_source_entry/information_source_state/network_instance (string) + If this variable is read-only (config: false) in the + source YANG file, then _set_network_instance is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_network_instance() directly. + + YANG Description: When applicable, this is the name of a network instance +from which the information is learned. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="network-instance", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """network_instance must be of a type compatible with string""", + 'defined-type': "string", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="network-instance", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=False)""", + }) + + self.__network_instance = t + if hasattr(self, '_set'): + self._set() + + def _unset_network_instance(self): + self.__network_instance = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="network-instance", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=False) + + + def _get_topology(self): + """ + Getter method for topology, mapped from YANG variable /networks/network/node/te/information_source_entry/information_source_state/topology (container) + + YANG Description: When the information is processed by the system, +the attributes in this container indicate which topology +is used to generate the result information. + """ + return self.__topology + + def _set_topology(self, v, load=False): + """ + Setter method for topology, mapped from YANG variable /networks/network/node/te/information_source_entry/information_source_state/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. + + YANG Description: When the information is processed by the system, +the attributes in this container indicate which topology +is used to generate the result information. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=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:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """topology must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=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:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__topology = t + if hasattr(self, '_set'): + self._set() + + def _unset_topology(self): + self.__topology = YANGDynClass(base=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:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + credibility_preference = __builtin__.property(_get_credibility_preference) + logical_network_element = __builtin__.property(_get_logical_network_element) + network_instance = __builtin__.property(_get_network_instance) + topology = __builtin__.property(_get_topology) + + + _pyangbind_elements = OrderedDict([('credibility_preference', credibility_preference), ('logical_network_element', logical_network_element), ('network_instance', network_instance), ('topology', topology), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/information_source_state/topology/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/information_source_state/topology/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..5fc5e047ba0e0fb15046e73a564e3b8ddafe61b7 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/information_source_state/topology/__init__.py @@ -0,0 +1,162 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 topology(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/information-source-state/topology. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: When the information is processed by the system, +the attributes in this container indicate which topology +is used to generate the result information. + """ + __slots__ = ('_path_helper', '_extmethods', '__node_ref','__network_ref',) + + _yang_name = 'topology' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__node_ref = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="node-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=False) + self.__network_ref = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="network-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', 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 ['networks', 'network', 'node', 'te', 'information-source-entry', 'information-source-state', 'topology'] + + def _get_node_ref(self): + """ + Getter method for node_ref, mapped from YANG variable /networks/network/node/te/information_source_entry/information_source_state/topology/node_ref (leafref) + + YANG Description: Used to reference a node. +Nodes are identified relative to the network that +contains them. + """ + return self.__node_ref + + def _set_node_ref(self, v, load=False): + """ + Setter method for node_ref, mapped from YANG variable /networks/network/node/te/information_source_entry/information_source_state/topology/node_ref (leafref) + If this variable is read-only (config: false) in the + source YANG file, then _set_node_ref is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_node_ref() directly. + + YANG Description: Used to reference a node. +Nodes are identified relative to the network that +contains them. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="node-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """node_ref must be of a type compatible with leafref""", + 'defined-type': "leafref", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="node-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=False)""", + }) + + self.__node_ref = t + if hasattr(self, '_set'): + self._set() + + def _unset_node_ref(self): + self.__node_ref = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="node-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=False) + + + def _get_network_ref(self): + """ + Getter method for network_ref, mapped from YANG variable /networks/network/node/te/information_source_entry/information_source_state/topology/network_ref (leafref) + + YANG Description: Used to reference a network -- for example, an underlay +network. + """ + return self.__network_ref + + def _set_network_ref(self, v, load=False): + """ + Setter method for network_ref, mapped from YANG variable /networks/network/node/te/information_source_entry/information_source_state/topology/network_ref (leafref) + If this variable is read-only (config: false) in the + source YANG file, then _set_network_ref is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_network_ref() directly. + + YANG Description: Used to reference a network -- for example, an underlay +network. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="network-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """network_ref must be of a type compatible with leafref""", + 'defined-type': "leafref", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="network-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=False)""", + }) + + self.__network_ref = t + if hasattr(self, '_set'): + self._set() + + def _unset_network_ref(self): + self.__network_ref = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="network-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=False) + + node_ref = __builtin__.property(_get_node_ref) + network_ref = __builtin__.property(_get_network_ref) + + + _pyangbind_elements = OrderedDict([('node_ref', node_ref), ('network_ref', network_ref), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/underlay_topology/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/underlay_topology/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..c0d77ce6f2e10688d323486da70dcf638c78a689 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/underlay_topology/__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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 underlay_topology(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/underlay-topology. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: When an abstract node encapsulates a topology, the +attributes in this container point to said topology. + """ + __slots__ = ('_path_helper', '_extmethods', '__network_ref',) + + _yang_name = 'underlay-topology' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__network_ref = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="network-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', 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 ['networks', 'network', 'node', 'te', 'information-source-entry', 'underlay-topology'] + + def _get_network_ref(self): + """ + Getter method for network_ref, mapped from YANG variable /networks/network/node/te/information_source_entry/underlay_topology/network_ref (leafref) + + YANG Description: Used to reference a network -- for example, an underlay +network. + """ + return self.__network_ref + + def _set_network_ref(self, v, load=False): + """ + Setter method for network_ref, mapped from YANG variable /networks/network/node/te/information_source_entry/underlay_topology/network_ref (leafref) + If this variable is read-only (config: false) in the + source YANG file, then _set_network_ref is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_network_ref() directly. + + YANG Description: Used to reference a network -- for example, an underlay +network. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="network-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """network_ref must be of a type compatible with leafref""", + 'defined-type': "leafref", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="network-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=False)""", + }) + + self.__network_ref = t + if hasattr(self, '_set'): + self._set() + + def _unset_network_ref(self): + self.__network_ref = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="network-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=False) + + network_ref = __builtin__.property(_get_network_ref) + + + _pyangbind_elements = OrderedDict([('network_ref', network_ref), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_state/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_state/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..7767ff2b6caded6441d09a3195e7ded1c7ef40fa --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_state/__init__.py @@ -0,0 +1,248 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 topology +class information_source_state(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-state. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Contains state attributes related to the information +source. + """ + __slots__ = ('_path_helper', '_extmethods', '__credibility_preference','__logical_network_element','__network_instance','__topology',) + + _yang_name = 'information-source-state' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__credibility_preference = YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), is_leaf=True, yang_name="credibility-preference", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint16', is_config=False) + self.__logical_network_element = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="logical-network-element", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=False) + self.__network_instance = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="network-instance", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=False) + self.__topology = YANGDynClass(base=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:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', 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 ['networks', 'network', 'node', 'te', 'information-source-state'] + + def _get_credibility_preference(self): + """ + Getter method for credibility_preference, mapped from YANG variable /networks/network/node/te/information_source_state/credibility_preference (uint16) + + YANG Description: The preference value for calculating the Traffic +Engineering database credibility value used for +tie-break selection between different information-source +values. A higher value is preferable. + """ + return self.__credibility_preference + + def _set_credibility_preference(self, v, load=False): + """ + Setter method for credibility_preference, mapped from YANG variable /networks/network/node/te/information_source_state/credibility_preference (uint16) + If this variable is read-only (config: false) in the + source YANG file, then _set_credibility_preference is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_credibility_preference() directly. + + YANG Description: The preference value for calculating the Traffic +Engineering database credibility value used for +tie-break selection between different information-source +values. A higher value is preferable. + """ + 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="credibility-preference", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint16', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """credibility_preference 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="credibility-preference", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint16', is_config=False)""", + }) + + self.__credibility_preference = t + if hasattr(self, '_set'): + self._set() + + def _unset_credibility_preference(self): + self.__credibility_preference = YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), is_leaf=True, yang_name="credibility-preference", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint16', is_config=False) + + + def _get_logical_network_element(self): + """ + Getter method for logical_network_element, mapped from YANG variable /networks/network/node/te/information_source_state/logical_network_element (string) + + YANG Description: When applicable, this is the name of a logical network +element from which the information is learned. + """ + return self.__logical_network_element + + def _set_logical_network_element(self, v, load=False): + """ + Setter method for logical_network_element, mapped from YANG variable /networks/network/node/te/information_source_state/logical_network_element (string) + If this variable is read-only (config: false) in the + source YANG file, then _set_logical_network_element is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_logical_network_element() directly. + + YANG Description: When applicable, this is the name of a logical network +element from which the information is learned. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="logical-network-element", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """logical_network_element must be of a type compatible with string""", + 'defined-type': "string", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="logical-network-element", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=False)""", + }) + + self.__logical_network_element = t + if hasattr(self, '_set'): + self._set() + + def _unset_logical_network_element(self): + self.__logical_network_element = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="logical-network-element", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=False) + + + def _get_network_instance(self): + """ + Getter method for network_instance, mapped from YANG variable /networks/network/node/te/information_source_state/network_instance (string) + + YANG Description: When applicable, this is the name of a network instance +from which the information is learned. + """ + return self.__network_instance + + def _set_network_instance(self, v, load=False): + """ + Setter method for network_instance, mapped from YANG variable /networks/network/node/te/information_source_state/network_instance (string) + If this variable is read-only (config: false) in the + source YANG file, then _set_network_instance is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_network_instance() directly. + + YANG Description: When applicable, this is the name of a network instance +from which the information is learned. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="network-instance", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """network_instance must be of a type compatible with string""", + 'defined-type': "string", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="network-instance", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=False)""", + }) + + self.__network_instance = t + if hasattr(self, '_set'): + self._set() + + def _unset_network_instance(self): + self.__network_instance = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="network-instance", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=False) + + + def _get_topology(self): + """ + Getter method for topology, mapped from YANG variable /networks/network/node/te/information_source_state/topology (container) + + YANG Description: When the information is processed by the system, +the attributes in this container indicate which topology +is used to generate the result information. + """ + return self.__topology + + def _set_topology(self, v, load=False): + """ + Setter method for topology, mapped from YANG variable /networks/network/node/te/information_source_state/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. + + YANG Description: When the information is processed by the system, +the attributes in this container indicate which topology +is used to generate the result information. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=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:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """topology must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=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:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__topology = t + if hasattr(self, '_set'): + self._set() + + def _unset_topology(self): + self.__topology = YANGDynClass(base=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:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + credibility_preference = __builtin__.property(_get_credibility_preference) + logical_network_element = __builtin__.property(_get_logical_network_element) + network_instance = __builtin__.property(_get_network_instance) + topology = __builtin__.property(_get_topology) + + + _pyangbind_elements = OrderedDict([('credibility_preference', credibility_preference), ('logical_network_element', logical_network_element), ('network_instance', network_instance), ('topology', topology), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_state/topology/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_state/topology/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..6562d900333f751e9b819293eaf11322757eeaf0 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_state/topology/__init__.py @@ -0,0 +1,162 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 topology(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-state/topology. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: When the information is processed by the system, +the attributes in this container indicate which topology +is used to generate the result information. + """ + __slots__ = ('_path_helper', '_extmethods', '__node_ref','__network_ref',) + + _yang_name = 'topology' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__node_ref = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="node-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=False) + self.__network_ref = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="network-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', 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 ['networks', 'network', 'node', 'te', 'information-source-state', 'topology'] + + def _get_node_ref(self): + """ + Getter method for node_ref, mapped from YANG variable /networks/network/node/te/information_source_state/topology/node_ref (leafref) + + YANG Description: Used to reference a node. +Nodes are identified relative to the network that +contains them. + """ + return self.__node_ref + + def _set_node_ref(self, v, load=False): + """ + Setter method for node_ref, mapped from YANG variable /networks/network/node/te/information_source_state/topology/node_ref (leafref) + If this variable is read-only (config: false) in the + source YANG file, then _set_node_ref is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_node_ref() directly. + + YANG Description: Used to reference a node. +Nodes are identified relative to the network that +contains them. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="node-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """node_ref must be of a type compatible with leafref""", + 'defined-type': "leafref", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="node-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=False)""", + }) + + self.__node_ref = t + if hasattr(self, '_set'): + self._set() + + def _unset_node_ref(self): + self.__node_ref = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="node-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=False) + + + def _get_network_ref(self): + """ + Getter method for network_ref, mapped from YANG variable /networks/network/node/te/information_source_state/topology/network_ref (leafref) + + YANG Description: Used to reference a network -- for example, an underlay +network. + """ + return self.__network_ref + + def _set_network_ref(self, v, load=False): + """ + Setter method for network_ref, mapped from YANG variable /networks/network/node/te/information_source_state/topology/network_ref (leafref) + If this variable is read-only (config: false) in the + source YANG file, then _set_network_ref is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_network_ref() directly. + + YANG Description: Used to reference a network -- for example, an underlay +network. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="network-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """network_ref must be of a type compatible with leafref""", + 'defined-type': "leafref", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="network-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=False)""", + }) + + self.__network_ref = t + if hasattr(self, '_set'): + self._set() + + def _unset_network_ref(self): + self.__network_ref = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="network-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=False) + + node_ref = __builtin__.property(_get_node_ref) + network_ref = __builtin__.property(_get_network_ref) + + + _pyangbind_elements = OrderedDict([('node_ref', node_ref), ('network_ref', network_ref), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/statistics/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/statistics/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..6741fb0fd254c5a6f683304025aed5da58832b0f --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/statistics/__init__.py @@ -0,0 +1,207 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 node +from . import connectivity_matrix_entry +class statistics(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/statistics. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Statistics data. + """ + __slots__ = ('_path_helper', '_extmethods', '__discontinuity_time','__node','__connectivity_matrix_entry',) + + _yang_name = 'statistics' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__discontinuity_time = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(Z|[\\+\\-]\\d{2}:\\d{2})'}), is_leaf=True, yang_name="discontinuity-time", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:date-and-time', is_config=False) + self.__node = YANGDynClass(base=node.node, is_container='container', yang_name="node", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__connectivity_matrix_entry = YANGDynClass(base=connectivity_matrix_entry.connectivity_matrix_entry, is_container='container', yang_name="connectivity-matrix-entry", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', 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 ['networks', 'network', 'node', 'te', 'statistics'] + + def _get_discontinuity_time(self): + """ + Getter method for discontinuity_time, mapped from YANG variable /networks/network/node/te/statistics/discontinuity_time (yang:date-and-time) + + YANG Description: The time of the most recent occasion at which any one or +more of this interface's counters suffered a +discontinuity. If no such discontinuities have occurred +since the last re-initialization of the local management +subsystem, then this node contains the time the local +management subsystem re-initialized itself. + """ + return self.__discontinuity_time + + def _set_discontinuity_time(self, v, load=False): + """ + Setter method for discontinuity_time, mapped from YANG variable /networks/network/node/te/statistics/discontinuity_time (yang:date-and-time) + If this variable is read-only (config: false) in the + source YANG file, then _set_discontinuity_time is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_discontinuity_time() directly. + + YANG Description: The time of the most recent occasion at which any one or +more of this interface's counters suffered a +discontinuity. If no such discontinuities have occurred +since the last re-initialization of the local management +subsystem, then this node contains the time the local +management subsystem re-initialized itself. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(Z|[\\+\\-]\\d{2}:\\d{2})'}), is_leaf=True, yang_name="discontinuity-time", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:date-and-time', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """discontinuity_time must be of a type compatible with yang:date-and-time""", + 'defined-type': "yang:date-and-time", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(Z|[\\+\\-]\\d{2}:\\d{2})'}), is_leaf=True, yang_name="discontinuity-time", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:date-and-time', is_config=False)""", + }) + + self.__discontinuity_time = t + if hasattr(self, '_set'): + self._set() + + def _unset_discontinuity_time(self): + self.__discontinuity_time = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(Z|[\\+\\-]\\d{2}:\\d{2})'}), is_leaf=True, yang_name="discontinuity-time", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:date-and-time', is_config=False) + + + def _get_node(self): + """ + Getter method for node, mapped from YANG variable /networks/network/node/te/statistics/node (container) + + YANG Description: Contains statistics attributes at the TE node level. + """ + return self.__node + + def _set_node(self, v, load=False): + """ + Setter method for node, mapped from YANG variable /networks/network/node/te/statistics/node (container) + 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. + + YANG Description: Contains statistics attributes at the TE node level. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=node.node, is_container='container', yang_name="node", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """node must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=node.node, is_container='container', yang_name="node", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__node = t + if hasattr(self, '_set'): + self._set() + + def _unset_node(self): + self.__node = YANGDynClass(base=node.node, is_container='container', yang_name="node", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_connectivity_matrix_entry(self): + """ + Getter method for connectivity_matrix_entry, mapped from YANG variable /networks/network/node/te/statistics/connectivity_matrix_entry (container) + + YANG Description: Contains statistics attributes at the level of a +connectivity matrix entry. + """ + return self.__connectivity_matrix_entry + + def _set_connectivity_matrix_entry(self, v, load=False): + """ + Setter method for connectivity_matrix_entry, mapped from YANG variable /networks/network/node/te/statistics/connectivity_matrix_entry (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_connectivity_matrix_entry is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_connectivity_matrix_entry() directly. + + YANG Description: Contains statistics attributes at the level of a +connectivity matrix entry. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=connectivity_matrix_entry.connectivity_matrix_entry, is_container='container', yang_name="connectivity-matrix-entry", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """connectivity_matrix_entry must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=connectivity_matrix_entry.connectivity_matrix_entry, is_container='container', yang_name="connectivity-matrix-entry", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__connectivity_matrix_entry = t + if hasattr(self, '_set'): + self._set() + + def _unset_connectivity_matrix_entry(self): + self.__connectivity_matrix_entry = YANGDynClass(base=connectivity_matrix_entry.connectivity_matrix_entry, is_container='container', yang_name="connectivity-matrix-entry", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + discontinuity_time = __builtin__.property(_get_discontinuity_time) + node = __builtin__.property(_get_node) + connectivity_matrix_entry = __builtin__.property(_get_connectivity_matrix_entry) + + + _pyangbind_elements = OrderedDict([('discontinuity_time', discontinuity_time), ('node', node), ('connectivity_matrix_entry', connectivity_matrix_entry), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/statistics/connectivity_matrix_entry/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/statistics/connectivity_matrix_entry/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..7c96f28c4c8867f027fead21227e752e58f4a950 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/statistics/connectivity_matrix_entry/__init__.py @@ -0,0 +1,282 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 connectivity_matrix_entry(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/statistics/connectivity-matrix-entry. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Contains statistics attributes at the level of a +connectivity matrix entry. + """ + __slots__ = ('_path_helper', '_extmethods', '__creates','__deletes','__disables','__enables','__modifies',) + + _yang_name = 'connectivity-matrix-entry' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__creates = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="creates", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False) + self.__deletes = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="deletes", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False) + self.__disables = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="disables", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False) + self.__enables = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="enables", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False) + self.__modifies = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="modifies", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', 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 ['networks', 'network', 'node', 'te', 'statistics', 'connectivity-matrix-entry'] + + def _get_creates(self): + """ + Getter method for creates, mapped from YANG variable /networks/network/node/te/statistics/connectivity_matrix_entry/creates (yang:counter32) + + YANG Description: Number of times that a connectivity matrix entry was +created. + """ + return self.__creates + + def _set_creates(self, v, load=False): + """ + Setter method for creates, mapped from YANG variable /networks/network/node/te/statistics/connectivity_matrix_entry/creates (yang:counter32) + If this variable is read-only (config: false) in the + source YANG file, then _set_creates is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_creates() directly. + + YANG Description: Number of times that a connectivity matrix entry was +created. + """ + 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="creates", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """creates must be of a type compatible with yang:counter32""", + 'defined-type': "yang:counter32", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="creates", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False)""", + }) + + self.__creates = t + if hasattr(self, '_set'): + self._set() + + def _unset_creates(self): + self.__creates = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="creates", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False) + + + def _get_deletes(self): + """ + Getter method for deletes, mapped from YANG variable /networks/network/node/te/statistics/connectivity_matrix_entry/deletes (yang:counter32) + + YANG Description: Number of times that a connectivity matrix entry was +deleted. + """ + return self.__deletes + + def _set_deletes(self, v, load=False): + """ + Setter method for deletes, mapped from YANG variable /networks/network/node/te/statistics/connectivity_matrix_entry/deletes (yang:counter32) + If this variable is read-only (config: false) in the + source YANG file, then _set_deletes is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_deletes() directly. + + YANG Description: Number of times that a connectivity matrix entry was +deleted. + """ + 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="deletes", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """deletes must be of a type compatible with yang:counter32""", + 'defined-type': "yang:counter32", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="deletes", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False)""", + }) + + self.__deletes = t + if hasattr(self, '_set'): + self._set() + + def _unset_deletes(self): + self.__deletes = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="deletes", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False) + + + def _get_disables(self): + """ + Getter method for disables, mapped from YANG variable /networks/network/node/te/statistics/connectivity_matrix_entry/disables (yang:counter32) + + YANG Description: Number of times that a connectivity matrix entry was +disabled. + """ + return self.__disables + + def _set_disables(self, v, load=False): + """ + Setter method for disables, mapped from YANG variable /networks/network/node/te/statistics/connectivity_matrix_entry/disables (yang:counter32) + If this variable is read-only (config: false) in the + source YANG file, then _set_disables is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_disables() directly. + + YANG Description: Number of times that a connectivity matrix entry was +disabled. + """ + 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="disables", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """disables must be of a type compatible with yang:counter32""", + 'defined-type': "yang:counter32", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="disables", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False)""", + }) + + self.__disables = t + if hasattr(self, '_set'): + self._set() + + def _unset_disables(self): + self.__disables = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="disables", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False) + + + def _get_enables(self): + """ + Getter method for enables, mapped from YANG variable /networks/network/node/te/statistics/connectivity_matrix_entry/enables (yang:counter32) + + YANG Description: Number of times that a connectivity matrix entry was +enabled. + """ + return self.__enables + + def _set_enables(self, v, load=False): + """ + Setter method for enables, mapped from YANG variable /networks/network/node/te/statistics/connectivity_matrix_entry/enables (yang:counter32) + If this variable is read-only (config: false) in the + source YANG file, then _set_enables is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_enables() directly. + + YANG Description: Number of times that a connectivity matrix entry was +enabled. + """ + 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="enables", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """enables must be of a type compatible with yang:counter32""", + 'defined-type': "yang:counter32", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="enables", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False)""", + }) + + self.__enables = t + if hasattr(self, '_set'): + self._set() + + def _unset_enables(self): + self.__enables = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="enables", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False) + + + def _get_modifies(self): + """ + Getter method for modifies, mapped from YANG variable /networks/network/node/te/statistics/connectivity_matrix_entry/modifies (yang:counter32) + + YANG Description: Number of times that a connectivity matrix entry was +modified. + """ + return self.__modifies + + def _set_modifies(self, v, load=False): + """ + Setter method for modifies, mapped from YANG variable /networks/network/node/te/statistics/connectivity_matrix_entry/modifies (yang:counter32) + If this variable is read-only (config: false) in the + source YANG file, then _set_modifies is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_modifies() directly. + + YANG Description: Number of times that a connectivity matrix entry was +modified. + """ + 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="modifies", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """modifies must be of a type compatible with yang:counter32""", + 'defined-type': "yang:counter32", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="modifies", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False)""", + }) + + self.__modifies = t + if hasattr(self, '_set'): + self._set() + + def _unset_modifies(self): + self.__modifies = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="modifies", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False) + + creates = __builtin__.property(_get_creates) + deletes = __builtin__.property(_get_deletes) + disables = __builtin__.property(_get_disables) + enables = __builtin__.property(_get_enables) + modifies = __builtin__.property(_get_modifies) + + + _pyangbind_elements = OrderedDict([('creates', creates), ('deletes', deletes), ('disables', disables), ('enables', enables), ('modifies', modifies), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/statistics/node/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/statistics/node/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..4d1e11b5e10ceff699b7ddaf2a947af002a18db6 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/statistics/node/__init__.py @@ -0,0 +1,273 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 node(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/statistics/node. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Contains statistics attributes at the TE node level. + """ + __slots__ = ('_path_helper', '_extmethods', '__disables','__enables','__maintenance_sets','__maintenance_clears','__modifies',) + + _yang_name = 'node' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__disables = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="disables", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False) + self.__enables = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="enables", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False) + self.__maintenance_sets = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="maintenance-sets", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False) + self.__maintenance_clears = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="maintenance-clears", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False) + self.__modifies = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="modifies", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', 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 ['networks', 'network', 'node', 'te', 'statistics', 'node'] + + def _get_disables(self): + """ + Getter method for disables, mapped from YANG variable /networks/network/node/te/statistics/node/disables (yang:counter32) + + YANG Description: Number of times that a node was disabled. + """ + return self.__disables + + def _set_disables(self, v, load=False): + """ + Setter method for disables, mapped from YANG variable /networks/network/node/te/statistics/node/disables (yang:counter32) + If this variable is read-only (config: false) in the + source YANG file, then _set_disables is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_disables() directly. + + YANG Description: Number of times that a node was disabled. + """ + 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="disables", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """disables must be of a type compatible with yang:counter32""", + 'defined-type': "yang:counter32", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="disables", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False)""", + }) + + self.__disables = t + if hasattr(self, '_set'): + self._set() + + def _unset_disables(self): + self.__disables = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="disables", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False) + + + def _get_enables(self): + """ + Getter method for enables, mapped from YANG variable /networks/network/node/te/statistics/node/enables (yang:counter32) + + YANG Description: Number of times that a node was enabled. + """ + return self.__enables + + def _set_enables(self, v, load=False): + """ + Setter method for enables, mapped from YANG variable /networks/network/node/te/statistics/node/enables (yang:counter32) + If this variable is read-only (config: false) in the + source YANG file, then _set_enables is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_enables() directly. + + YANG Description: Number of times that a node was enabled. + """ + 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="enables", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """enables must be of a type compatible with yang:counter32""", + 'defined-type': "yang:counter32", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="enables", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False)""", + }) + + self.__enables = t + if hasattr(self, '_set'): + self._set() + + def _unset_enables(self): + self.__enables = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="enables", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False) + + + def _get_maintenance_sets(self): + """ + Getter method for maintenance_sets, mapped from YANG variable /networks/network/node/te/statistics/node/maintenance_sets (yang:counter32) + + YANG Description: Number of times that a node was put in maintenance. + """ + return self.__maintenance_sets + + def _set_maintenance_sets(self, v, load=False): + """ + Setter method for maintenance_sets, mapped from YANG variable /networks/network/node/te/statistics/node/maintenance_sets (yang:counter32) + If this variable is read-only (config: false) in the + source YANG file, then _set_maintenance_sets is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_maintenance_sets() directly. + + YANG Description: Number of times that a node was put in maintenance. + """ + 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="maintenance-sets", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """maintenance_sets must be of a type compatible with yang:counter32""", + 'defined-type': "yang:counter32", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="maintenance-sets", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False)""", + }) + + self.__maintenance_sets = t + if hasattr(self, '_set'): + self._set() + + def _unset_maintenance_sets(self): + self.__maintenance_sets = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="maintenance-sets", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False) + + + def _get_maintenance_clears(self): + """ + Getter method for maintenance_clears, mapped from YANG variable /networks/network/node/te/statistics/node/maintenance_clears (yang:counter32) + + YANG Description: Number of times that a node was taken out of +maintenance. + """ + return self.__maintenance_clears + + def _set_maintenance_clears(self, v, load=False): + """ + Setter method for maintenance_clears, mapped from YANG variable /networks/network/node/te/statistics/node/maintenance_clears (yang:counter32) + If this variable is read-only (config: false) in the + source YANG file, then _set_maintenance_clears is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_maintenance_clears() directly. + + YANG Description: Number of times that a node was taken out of +maintenance. + """ + 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="maintenance-clears", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """maintenance_clears must be of a type compatible with yang:counter32""", + 'defined-type': "yang:counter32", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="maintenance-clears", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False)""", + }) + + self.__maintenance_clears = t + if hasattr(self, '_set'): + self._set() + + def _unset_maintenance_clears(self): + self.__maintenance_clears = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="maintenance-clears", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False) + + + def _get_modifies(self): + """ + Getter method for modifies, mapped from YANG variable /networks/network/node/te/statistics/node/modifies (yang:counter32) + + YANG Description: Number of times that a node was modified. + """ + return self.__modifies + + def _set_modifies(self, v, load=False): + """ + Setter method for modifies, mapped from YANG variable /networks/network/node/te/statistics/node/modifies (yang:counter32) + If this variable is read-only (config: false) in the + source YANG file, then _set_modifies is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_modifies() directly. + + YANG Description: Number of times that a node was modified. + """ + 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="modifies", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """modifies must be of a type compatible with yang:counter32""", + 'defined-type': "yang:counter32", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="modifies", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False)""", + }) + + self.__modifies = t + if hasattr(self, '_set'): + self._set() + + def _unset_modifies(self): + self.__modifies = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="modifies", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False) + + disables = __builtin__.property(_get_disables) + enables = __builtin__.property(_get_enables) + maintenance_sets = __builtin__.property(_get_maintenance_sets) + maintenance_clears = __builtin__.property(_get_maintenance_clears) + modifies = __builtin__.property(_get_modifies) + + + _pyangbind_elements = OrderedDict([('disables', disables), ('enables', enables), ('maintenance_sets', maintenance_sets), ('maintenance_clears', maintenance_clears), ('modifies', modifies), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..08e7f93bea49d7c90b4edd56733e6f13dfdbc845 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/__init__.py @@ -0,0 +1,357 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 connectivity_matrices +from . import underlay_topology +class te_node_attributes(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Contains node attributes in a TE topology. + """ + __slots__ = ('_path_helper', '_extmethods', '__admin_status','__connectivity_matrices','__domain_id','__is_abstract','__name','__signaling_address','__underlay_topology',) + + _yang_name = 'te-node-attributes' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__admin_status = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'up': {}, 'down': {}, 'testing': {}, 'preparing-maintenance': {}, 'maintenance': {}, 'unknown': {}},), is_leaf=True, yang_name="admin-status", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-types:te-admin-status', is_config=True) + self.__connectivity_matrices = YANGDynClass(base=connectivity_matrices.connectivity_matrices, is_container='container', yang_name="connectivity-matrices", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__domain_id = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="domain-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + self.__is_abstract = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="is-abstract", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='empty', is_config=True) + 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='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=True) + self.__signaling_address = YANGDynClass(unique=True, base=TypedListType(allowed_type=[RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),]), is_leaf=False, yang_name="signaling-address", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:ip-address', is_config=True) + self.__underlay_topology = YANGDynClass(base=underlay_topology.underlay_topology, is_container='container', yang_name="underlay-topology", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-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 ['networks', 'network', 'node', 'te', 'te-node-attributes'] + + def _get_admin_status(self): + """ + Getter method for admin_status, mapped from YANG variable /networks/network/node/te/te_node_attributes/admin_status (te-types:te-admin-status) + + YANG Description: The administrative state of the link. + """ + return self.__admin_status + + def _set_admin_status(self, v, load=False): + """ + Setter method for admin_status, mapped from YANG variable /networks/network/node/te/te_node_attributes/admin_status (te-types:te-admin-status) + 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 administrative state of the link. + """ + 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': {}, 'preparing-maintenance': {}, 'maintenance': {}, 'unknown': {}},), is_leaf=True, yang_name="admin-status", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-types:te-admin-status', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """admin_status must be of a type compatible with te-types:te-admin-status""", + 'defined-type': "te-types:te-admin-status", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'up': {}, 'down': {}, 'testing': {}, 'preparing-maintenance': {}, 'maintenance': {}, 'unknown': {}},), is_leaf=True, yang_name="admin-status", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-types:te-admin-status', is_config=True)""", + }) + + 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': {}, 'preparing-maintenance': {}, 'maintenance': {}, 'unknown': {}},), is_leaf=True, yang_name="admin-status", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-types:te-admin-status', is_config=True) + + + def _get_connectivity_matrices(self): + """ + Getter method for connectivity_matrices, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices (container) + + YANG Description: Contains a connectivity matrix on a TE node. + """ + return self.__connectivity_matrices + + def _set_connectivity_matrices(self, v, load=False): + """ + Setter method for connectivity_matrices, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_connectivity_matrices is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_connectivity_matrices() directly. + + YANG Description: Contains a connectivity matrix on a TE node. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=connectivity_matrices.connectivity_matrices, is_container='container', yang_name="connectivity-matrices", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """connectivity_matrices must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=connectivity_matrices.connectivity_matrices, is_container='container', yang_name="connectivity-matrices", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__connectivity_matrices = t + if hasattr(self, '_set'): + self._set() + + def _unset_connectivity_matrices(self): + self.__connectivity_matrices = YANGDynClass(base=connectivity_matrices.connectivity_matrices, is_container='container', yang_name="connectivity-matrices", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_domain_id(self): + """ + Getter method for domain_id, mapped from YANG variable /networks/network/node/te/te_node_attributes/domain_id (uint32) + + YANG Description: Identifies the domain to which this node belongs. +This attribute is used to support inter-domain links. + """ + return self.__domain_id + + def _set_domain_id(self, v, load=False): + """ + Setter method for domain_id, mapped from YANG variable /networks/network/node/te/te_node_attributes/domain_id (uint32) + If this variable is read-only (config: false) in the + source YANG file, then _set_domain_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_domain_id() directly. + + YANG Description: Identifies the domain to which this node belongs. +This attribute is used to support inter-domain links. + """ + 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="domain-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """domain_id 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="domain-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True)""", + }) + + self.__domain_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_domain_id(self): + self.__domain_id = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="domain-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + + + def _get_is_abstract(self): + """ + Getter method for is_abstract, mapped from YANG variable /networks/network/node/te/te_node_attributes/is_abstract (empty) + + YANG Description: Present if the node is abstract; not present if the node +is actual. + """ + return self.__is_abstract + + def _set_is_abstract(self, v, load=False): + """ + Setter method for is_abstract, mapped from YANG variable /networks/network/node/te/te_node_attributes/is_abstract (empty) + If this variable is read-only (config: false) in the + source YANG file, then _set_is_abstract is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_is_abstract() directly. + + YANG Description: Present if the node is abstract; not present if the node +is actual. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBool, is_leaf=True, yang_name="is-abstract", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='empty', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """is_abstract must be of a type compatible with empty""", + 'defined-type': "empty", + 'generated-type': """YANGDynClass(base=YANGBool, is_leaf=True, yang_name="is-abstract", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='empty', is_config=True)""", + }) + + self.__is_abstract = t + if hasattr(self, '_set'): + self._set() + + def _unset_is_abstract(self): + self.__is_abstract = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="is-abstract", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='empty', is_config=True) + + + def _get_name(self): + """ + Getter method for name, mapped from YANG variable /networks/network/node/te/te_node_attributes/name (string) + + YANG Description: Node name. + """ + return self.__name + + def _set_name(self, v, load=False): + """ + Setter method for name, mapped from YANG variable /networks/network/node/te/te_node_attributes/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: Node name. + """ + 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='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', 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='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', 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='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=True) + + + def _get_signaling_address(self): + """ + Getter method for signaling_address, mapped from YANG variable /networks/network/node/te/te_node_attributes/signaling_address (inet:ip-address) + + YANG Description: The node's signaling address. + """ + return self.__signaling_address + + def _set_signaling_address(self, v, load=False): + """ + Setter method for signaling_address, mapped from YANG variable /networks/network/node/te/te_node_attributes/signaling_address (inet:ip-address) + If this variable is read-only (config: false) in the + source YANG file, then _set_signaling_address is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_signaling_address() directly. + + YANG Description: The node's signaling address. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,unique=True, base=TypedListType(allowed_type=[RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),]), is_leaf=False, yang_name="signaling-address", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:ip-address', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """signaling_address must be of a type compatible with inet:ip-address""", + 'defined-type': "inet:ip-address", + 'generated-type': """YANGDynClass(unique=True, base=TypedListType(allowed_type=[RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),]), is_leaf=False, yang_name="signaling-address", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:ip-address', is_config=True)""", + }) + + self.__signaling_address = t + if hasattr(self, '_set'): + self._set() + + def _unset_signaling_address(self): + self.__signaling_address = YANGDynClass(unique=True, base=TypedListType(allowed_type=[RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),]), is_leaf=False, yang_name="signaling-address", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:ip-address', is_config=True) + + + def _get_underlay_topology(self): + """ + Getter method for underlay_topology, mapped from YANG variable /networks/network/node/te/te_node_attributes/underlay_topology (container) + + YANG Description: When an abstract node encapsulates a topology, the +attributes in this container point to said topology. + """ + return self.__underlay_topology + + def _set_underlay_topology(self, v, load=False): + """ + Setter method for underlay_topology, mapped from YANG variable /networks/network/node/te/te_node_attributes/underlay_topology (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_underlay_topology is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_underlay_topology() directly. + + YANG Description: When an abstract node encapsulates a topology, the +attributes in this container point to said topology. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=underlay_topology.underlay_topology, is_container='container', yang_name="underlay-topology", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """underlay_topology must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=underlay_topology.underlay_topology, is_container='container', yang_name="underlay-topology", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__underlay_topology = t + if hasattr(self, '_set'): + self._set() + + def _unset_underlay_topology(self): + self.__underlay_topology = YANGDynClass(base=underlay_topology.underlay_topology, is_container='container', yang_name="underlay-topology", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + admin_status = __builtin__.property(_get_admin_status, _set_admin_status) + connectivity_matrices = __builtin__.property(_get_connectivity_matrices, _set_connectivity_matrices) + domain_id = __builtin__.property(_get_domain_id, _set_domain_id) + is_abstract = __builtin__.property(_get_is_abstract, _set_is_abstract) + name = __builtin__.property(_get_name, _set_name) + signaling_address = __builtin__.property(_get_signaling_address, _set_signaling_address) + underlay_topology = __builtin__.property(_get_underlay_topology, _set_underlay_topology) + + + _pyangbind_elements = OrderedDict([('admin_status', admin_status), ('connectivity_matrices', connectivity_matrices), ('domain_id', domain_id), ('is_abstract', is_abstract), ('name', name), ('signaling_address', signaling_address), ('underlay_topology', underlay_topology), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e1a23ffc8361fba2a308618e731f8f2dd3e20f1b --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/__init__.py @@ -0,0 +1,412 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 label_restrictions +from . import underlay +from . import path_constraints +from . import optimizations +from . import path_properties +from . import connectivity_matrix +class connectivity_matrices(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Contains a connectivity matrix on a TE node. + """ + __slots__ = ('_path_helper', '_extmethods', '__number_of_entries','__label_restrictions','__is_allowed','__underlay','__path_constraints','__optimizations','__path_properties','__connectivity_matrix',) + + _yang_name = 'connectivity-matrices' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__number_of_entries = YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), is_leaf=True, yang_name="number-of-entries", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint16', is_config=True) + self.__label_restrictions = YANGDynClass(base=label_restrictions.label_restrictions, is_container='container', yang_name="label-restrictions", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__is_allowed = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="is-allowed", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='boolean', is_config=True) + self.__underlay = YANGDynClass(base=underlay.underlay, is_container='container', yang_name="underlay", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__path_constraints = YANGDynClass(base=path_constraints.path_constraints, is_container='container', yang_name="path-constraints", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__optimizations = YANGDynClass(base=optimizations.optimizations, is_container='container', yang_name="optimizations", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__path_properties = YANGDynClass(base=path_properties.path_properties, is_container='container', yang_name="path-properties", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__connectivity_matrix = YANGDynClass(base=YANGListType("id",connectivity_matrix.connectivity_matrix, yang_name="connectivity-matrix", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='id', extensions=None), is_container='list', yang_name="connectivity-matrix", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-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 ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices'] + + def _get_number_of_entries(self): + """ + Getter method for number_of_entries, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/number_of_entries (uint16) + + YANG Description: The number of connectivity matrix entries. +If this number is specified in the configuration request, +the number is the requested number of entries, which may +not all be listed in the list; +if this number is reported in the state data, +the number is the current number of operational entries. + """ + return self.__number_of_entries + + def _set_number_of_entries(self, v, load=False): + """ + Setter method for number_of_entries, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/number_of_entries (uint16) + If this variable is read-only (config: false) in the + source YANG file, then _set_number_of_entries is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_number_of_entries() directly. + + YANG Description: The number of connectivity matrix entries. +If this number is specified in the configuration request, +the number is the requested number of entries, which may +not all be listed in the list; +if this number is reported in the state data, +the number is the current number of operational entries. + """ + 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="number-of-entries", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint16', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """number_of_entries 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="number-of-entries", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint16', is_config=True)""", + }) + + self.__number_of_entries = t + if hasattr(self, '_set'): + self._set() + + def _unset_number_of_entries(self): + self.__number_of_entries = YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), is_leaf=True, yang_name="number-of-entries", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint16', is_config=True) + + + def _get_label_restrictions(self): + """ + Getter method for label_restrictions, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions (container) + + YANG Description: The label restrictions container. + """ + return self.__label_restrictions + + def _set_label_restrictions(self, v, load=False): + """ + Setter method for label_restrictions, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_label_restrictions is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_label_restrictions() directly. + + YANG Description: The label restrictions container. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=label_restrictions.label_restrictions, is_container='container', yang_name="label-restrictions", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """label_restrictions must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=label_restrictions.label_restrictions, is_container='container', yang_name="label-restrictions", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__label_restrictions = t + if hasattr(self, '_set'): + self._set() + + def _unset_label_restrictions(self): + self.__label_restrictions = YANGDynClass(base=label_restrictions.label_restrictions, is_container='container', yang_name="label-restrictions", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_is_allowed(self): + """ + Getter method for is_allowed, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/is_allowed (boolean) + + YANG Description: 'true' - switching is allowed; +'false' - switching is disallowed. + """ + return self.__is_allowed + + def _set_is_allowed(self, v, load=False): + """ + Setter method for is_allowed, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/is_allowed (boolean) + If this variable is read-only (config: false) in the + source YANG file, then _set_is_allowed is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_is_allowed() directly. + + YANG Description: 'true' - switching is allowed; +'false' - switching is disallowed. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBool, is_leaf=True, yang_name="is-allowed", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='boolean', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """is_allowed must be of a type compatible with boolean""", + 'defined-type': "boolean", + 'generated-type': """YANGDynClass(base=YANGBool, is_leaf=True, yang_name="is-allowed", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='boolean', is_config=True)""", + }) + + self.__is_allowed = t + if hasattr(self, '_set'): + self._set() + + def _unset_is_allowed(self): + self.__is_allowed = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="is-allowed", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='boolean', is_config=True) + + + def _get_underlay(self): + """ + Getter method for underlay, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay (container) + + YANG Description: Attributes of the TE link underlay. + """ + return self.__underlay + + def _set_underlay(self, v, load=False): + """ + Setter method for underlay, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_underlay is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_underlay() directly. + + YANG Description: Attributes of the TE link underlay. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=underlay.underlay, is_container='container', yang_name="underlay", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """underlay must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=underlay.underlay, is_container='container', yang_name="underlay", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__underlay = t + if hasattr(self, '_set'): + self._set() + + def _unset_underlay(self): + self.__underlay = YANGDynClass(base=underlay.underlay, is_container='container', yang_name="underlay", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_path_constraints(self): + """ + Getter method for path_constraints, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints (container) + + YANG Description: TE named path constraints container. + """ + return self.__path_constraints + + def _set_path_constraints(self, v, load=False): + """ + Setter method for path_constraints, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_constraints is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_constraints() directly. + + YANG Description: TE named path constraints container. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=path_constraints.path_constraints, is_container='container', yang_name="path-constraints", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_constraints must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=path_constraints.path_constraints, is_container='container', yang_name="path-constraints", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__path_constraints = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_constraints(self): + self.__path_constraints = YANGDynClass(base=path_constraints.path_constraints, is_container='container', yang_name="path-constraints", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_optimizations(self): + """ + Getter method for optimizations, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations (container) + + YANG Description: The objective function container that includes +attributes to impose when computing a TE path. + """ + return self.__optimizations + + def _set_optimizations(self, v, load=False): + """ + Setter method for optimizations, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_optimizations is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_optimizations() directly. + + YANG Description: The objective function container that includes +attributes to impose when computing a TE path. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=optimizations.optimizations, is_container='container', yang_name="optimizations", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """optimizations must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=optimizations.optimizations, is_container='container', yang_name="optimizations", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__optimizations = t + if hasattr(self, '_set'): + self._set() + + def _unset_optimizations(self): + self.__optimizations = YANGDynClass(base=optimizations.optimizations, is_container='container', yang_name="optimizations", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_path_properties(self): + """ + Getter method for path_properties, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties (container) + + YANG Description: The TE path properties. + """ + return self.__path_properties + + def _set_path_properties(self, v, load=False): + """ + Setter method for path_properties, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_properties is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_properties() directly. + + YANG Description: The TE path properties. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=path_properties.path_properties, is_container='container', yang_name="path-properties", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_properties must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=path_properties.path_properties, is_container='container', yang_name="path-properties", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__path_properties = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_properties(self): + self.__path_properties = YANGDynClass(base=path_properties.path_properties, is_container='container', yang_name="path-properties", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_connectivity_matrix(self): + """ + Getter method for connectivity_matrix, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix (list) + + YANG Description: Represents a node's switching limitations, i.e., +limitations in the interconnecting network TE links +across the node. + """ + return self.__connectivity_matrix + + def _set_connectivity_matrix(self, v, load=False): + """ + Setter method for connectivity_matrix, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_connectivity_matrix is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_connectivity_matrix() directly. + + YANG Description: Represents a node's switching limitations, i.e., +limitations in the interconnecting network TE links +across the node. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("id",connectivity_matrix.connectivity_matrix, yang_name="connectivity-matrix", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='id', extensions=None), is_container='list', yang_name="connectivity-matrix", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """connectivity_matrix must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("id",connectivity_matrix.connectivity_matrix, yang_name="connectivity-matrix", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='id', extensions=None), is_container='list', yang_name="connectivity-matrix", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True)""", + }) + + self.__connectivity_matrix = t + if hasattr(self, '_set'): + self._set() + + def _unset_connectivity_matrix(self): + self.__connectivity_matrix = YANGDynClass(base=YANGListType("id",connectivity_matrix.connectivity_matrix, yang_name="connectivity-matrix", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='id', extensions=None), is_container='list', yang_name="connectivity-matrix", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + + number_of_entries = __builtin__.property(_get_number_of_entries, _set_number_of_entries) + label_restrictions = __builtin__.property(_get_label_restrictions, _set_label_restrictions) + is_allowed = __builtin__.property(_get_is_allowed, _set_is_allowed) + underlay = __builtin__.property(_get_underlay, _set_underlay) + path_constraints = __builtin__.property(_get_path_constraints, _set_path_constraints) + optimizations = __builtin__.property(_get_optimizations, _set_optimizations) + path_properties = __builtin__.property(_get_path_properties) + connectivity_matrix = __builtin__.property(_get_connectivity_matrix, _set_connectivity_matrix) + + + _pyangbind_elements = OrderedDict([('number_of_entries', number_of_entries), ('label_restrictions', label_restrictions), ('is_allowed', is_allowed), ('underlay', underlay), ('path_constraints', path_constraints), ('optimizations', optimizations), ('path_properties', path_properties), ('connectivity_matrix', connectivity_matrix), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..704040fa4ee6069477ddbfb7ad51bdbd33ca4ba5 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/__init__.py @@ -0,0 +1,405 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 from_ +from . import to +from . import underlay +from . import path_constraints +from . import optimizations +from . import path_properties +class connectivity_matrix(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/connectivity-matrix. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Represents a node's switching limitations, i.e., +limitations in the interconnecting network TE links +across the node. + """ + __slots__ = ('_path_helper', '_extmethods', '__id','__from_','__to','__is_allowed','__underlay','__path_constraints','__optimizations','__path_properties',) + + _yang_name = 'connectivity-matrix' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__id = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + self.__from_ = YANGDynClass(base=from_.from_, is_container='container', yang_name="from", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__to = YANGDynClass(base=to.to, is_container='container', yang_name="to", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__is_allowed = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="is-allowed", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='boolean', is_config=True) + self.__underlay = YANGDynClass(base=underlay.underlay, is_container='container', yang_name="underlay", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__path_constraints = YANGDynClass(base=path_constraints.path_constraints, is_container='container', yang_name="path-constraints", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__optimizations = YANGDynClass(base=optimizations.optimizations, is_container='container', yang_name="optimizations", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__path_properties = YANGDynClass(base=path_properties.path_properties, is_container='container', yang_name="path-properties", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', 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 ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'connectivity-matrix'] + + def _get_id(self): + """ + Getter method for id, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/id (uint32) + + YANG Description: Identifies the connectivity matrix entry. + """ + return self.__id + + def _set_id(self, v, load=False): + """ + Setter method for id, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/id (uint32) + 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: Identifies the connectivity matrix entry. + """ + 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=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """id 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="id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True)""", + }) + + self.__id = t + if hasattr(self, '_set'): + self._set() + + def _unset_id(self): + self.__id = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + + + def _get_from_(self): + """ + Getter method for from_, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from (container) + + YANG Description: Reference to a source LTP. + """ + return self.__from_ + + def _set_from_(self, v, load=False): + """ + Setter method for from_, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_from_ is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_from_() directly. + + YANG Description: Reference to a source LTP. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=from_.from_, is_container='container', yang_name="from", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """from_ must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=from_.from_, is_container='container', yang_name="from", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__from_ = t + if hasattr(self, '_set'): + self._set() + + def _unset_from_(self): + self.__from_ = YANGDynClass(base=from_.from_, is_container='container', yang_name="from", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_to(self): + """ + Getter method for to, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to (container) + + YANG Description: Reference to a destination LTP. + """ + return self.__to + + def _set_to(self, v, load=False): + """ + Setter method for to, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_to is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_to() directly. + + YANG Description: Reference to a destination LTP. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=to.to, is_container='container', yang_name="to", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """to must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=to.to, is_container='container', yang_name="to", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__to = t + if hasattr(self, '_set'): + self._set() + + def _unset_to(self): + self.__to = YANGDynClass(base=to.to, is_container='container', yang_name="to", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_is_allowed(self): + """ + Getter method for is_allowed, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/is_allowed (boolean) + + YANG Description: 'true' - switching is allowed; +'false' - switching is disallowed. + """ + return self.__is_allowed + + def _set_is_allowed(self, v, load=False): + """ + Setter method for is_allowed, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/is_allowed (boolean) + If this variable is read-only (config: false) in the + source YANG file, then _set_is_allowed is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_is_allowed() directly. + + YANG Description: 'true' - switching is allowed; +'false' - switching is disallowed. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBool, is_leaf=True, yang_name="is-allowed", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='boolean', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """is_allowed must be of a type compatible with boolean""", + 'defined-type': "boolean", + 'generated-type': """YANGDynClass(base=YANGBool, is_leaf=True, yang_name="is-allowed", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='boolean', is_config=True)""", + }) + + self.__is_allowed = t + if hasattr(self, '_set'): + self._set() + + def _unset_is_allowed(self): + self.__is_allowed = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="is-allowed", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='boolean', is_config=True) + + + def _get_underlay(self): + """ + Getter method for underlay, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay (container) + + YANG Description: Attributes of the TE link underlay. + """ + return self.__underlay + + def _set_underlay(self, v, load=False): + """ + Setter method for underlay, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_underlay is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_underlay() directly. + + YANG Description: Attributes of the TE link underlay. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=underlay.underlay, is_container='container', yang_name="underlay", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """underlay must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=underlay.underlay, is_container='container', yang_name="underlay", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__underlay = t + if hasattr(self, '_set'): + self._set() + + def _unset_underlay(self): + self.__underlay = YANGDynClass(base=underlay.underlay, is_container='container', yang_name="underlay", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_path_constraints(self): + """ + Getter method for path_constraints, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints (container) + + YANG Description: TE named path constraints container. + """ + return self.__path_constraints + + def _set_path_constraints(self, v, load=False): + """ + Setter method for path_constraints, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_constraints is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_constraints() directly. + + YANG Description: TE named path constraints container. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=path_constraints.path_constraints, is_container='container', yang_name="path-constraints", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_constraints must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=path_constraints.path_constraints, is_container='container', yang_name="path-constraints", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__path_constraints = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_constraints(self): + self.__path_constraints = YANGDynClass(base=path_constraints.path_constraints, is_container='container', yang_name="path-constraints", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_optimizations(self): + """ + Getter method for optimizations, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations (container) + + YANG Description: The objective function container that includes +attributes to impose when computing a TE path. + """ + return self.__optimizations + + def _set_optimizations(self, v, load=False): + """ + Setter method for optimizations, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_optimizations is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_optimizations() directly. + + YANG Description: The objective function container that includes +attributes to impose when computing a TE path. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=optimizations.optimizations, is_container='container', yang_name="optimizations", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """optimizations must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=optimizations.optimizations, is_container='container', yang_name="optimizations", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__optimizations = t + if hasattr(self, '_set'): + self._set() + + def _unset_optimizations(self): + self.__optimizations = YANGDynClass(base=optimizations.optimizations, is_container='container', yang_name="optimizations", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_path_properties(self): + """ + Getter method for path_properties, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties (container) + + YANG Description: The TE path properties. + """ + return self.__path_properties + + def _set_path_properties(self, v, load=False): + """ + Setter method for path_properties, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_properties is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_properties() directly. + + YANG Description: The TE path properties. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=path_properties.path_properties, is_container='container', yang_name="path-properties", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_properties must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=path_properties.path_properties, is_container='container', yang_name="path-properties", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__path_properties = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_properties(self): + self.__path_properties = YANGDynClass(base=path_properties.path_properties, is_container='container', yang_name="path-properties", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + id = __builtin__.property(_get_id, _set_id) + from_ = __builtin__.property(_get_from_, _set_from_) + to = __builtin__.property(_get_to, _set_to) + is_allowed = __builtin__.property(_get_is_allowed, _set_is_allowed) + underlay = __builtin__.property(_get_underlay, _set_underlay) + path_constraints = __builtin__.property(_get_path_constraints, _set_path_constraints) + optimizations = __builtin__.property(_get_optimizations, _set_optimizations) + path_properties = __builtin__.property(_get_path_properties) + + + _pyangbind_elements = OrderedDict([('id', id), ('from_', from_), ('to', to), ('is_allowed', is_allowed), ('underlay', underlay), ('path_constraints', path_constraints), ('optimizations', optimizations), ('path_properties', path_properties), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from_/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from_/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..40157c9047e4ea2039558fa9dfbb4eb1349046b3 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from_/__init__.py @@ -0,0 +1,155 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 label_restrictions +class from_(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/connectivity-matrix/from. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Reference to a source LTP. + """ + __slots__ = ('_path_helper', '_extmethods', '__tp_ref','__label_restrictions',) + + _yang_name = 'from' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__tp_ref = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="tp-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=True) + self.__label_restrictions = YANGDynClass(base=label_restrictions.label_restrictions, is_container='container', yang_name="label-restrictions", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-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 ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'connectivity-matrix', 'from'] + + def _get_tp_ref(self): + """ + Getter method for tp_ref, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from/tp_ref (leafref) + + YANG Description: Relative reference to a termination point. + """ + return self.__tp_ref + + def _set_tp_ref(self, v, load=False): + """ + Setter method for tp_ref, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from/tp_ref (leafref) + If this variable is read-only (config: false) in the + source YANG file, then _set_tp_ref is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tp_ref() directly. + + YANG Description: Relative reference to a termination point. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="tp-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tp_ref must be of a type compatible with leafref""", + 'defined-type': "leafref", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="tp-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=True)""", + }) + + self.__tp_ref = t + if hasattr(self, '_set'): + self._set() + + def _unset_tp_ref(self): + self.__tp_ref = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="tp-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=True) + + + def _get_label_restrictions(self): + """ + Getter method for label_restrictions, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from/label_restrictions (container) + + YANG Description: The label restrictions container. + """ + return self.__label_restrictions + + def _set_label_restrictions(self, v, load=False): + """ + Setter method for label_restrictions, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from/label_restrictions (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_label_restrictions is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_label_restrictions() directly. + + YANG Description: The label restrictions container. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=label_restrictions.label_restrictions, is_container='container', yang_name="label-restrictions", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """label_restrictions must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=label_restrictions.label_restrictions, is_container='container', yang_name="label-restrictions", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__label_restrictions = t + if hasattr(self, '_set'): + self._set() + + def _unset_label_restrictions(self): + self.__label_restrictions = YANGDynClass(base=label_restrictions.label_restrictions, is_container='container', yang_name="label-restrictions", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + tp_ref = __builtin__.property(_get_tp_ref, _set_tp_ref) + label_restrictions = __builtin__.property(_get_label_restrictions, _set_label_restrictions) + + + _pyangbind_elements = OrderedDict([('tp_ref', tp_ref), ('label_restrictions', label_restrictions), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from_/label_restrictions/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from_/label_restrictions/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..5a441f8e0c6c181850335c85898e65d7ab956970 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from_/label_restrictions/__init__.py @@ -0,0 +1,120 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 label_restriction +class label_restrictions(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/connectivity-matrix/from/label-restrictions. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: The label restrictions container. + """ + __slots__ = ('_path_helper', '_extmethods', '__label_restriction',) + + _yang_name = 'label-restrictions' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__label_restriction = YANGDynClass(base=YANGListType("index",label_restriction.label_restriction, yang_name="label-restriction", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='index', extensions=None), is_container='list', yang_name="label-restriction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-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 ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'connectivity-matrix', 'from', 'label-restrictions'] + + def _get_label_restriction(self): + """ + Getter method for label_restriction, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction (list) + + YANG Description: The absence of the label restrictions container implies +that all labels are acceptable; otherwise, only restricted +labels are available. + """ + return self.__label_restriction + + def _set_label_restriction(self, v, load=False): + """ + Setter method for label_restriction, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_label_restriction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_label_restriction() directly. + + YANG Description: The absence of the label restrictions container implies +that all labels are acceptable; otherwise, only restricted +labels are available. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("index",label_restriction.label_restriction, yang_name="label-restriction", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='index', extensions=None), is_container='list', yang_name="label-restriction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """label_restriction must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("index",label_restriction.label_restriction, yang_name="label-restriction", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='index', extensions=None), is_container='list', yang_name="label-restriction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True)""", + }) + + self.__label_restriction = t + if hasattr(self, '_set'): + self._set() + + def _unset_label_restriction(self): + self.__label_restriction = YANGDynClass(base=YANGListType("index",label_restriction.label_restriction, yang_name="label-restriction", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='index', extensions=None), is_container='list', yang_name="label-restriction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + + label_restriction = __builtin__.property(_get_label_restriction, _set_label_restriction) + + + _pyangbind_elements = OrderedDict([('label_restriction', label_restriction), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from_/label_restrictions/label_restriction/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from_/label_restrictions/label_restriction/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..be63791cbe8b06eb5b5c2f33c44b63bc06497851 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from_/label_restrictions/label_restriction/__init__.py @@ -0,0 +1,450 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 label_start +from . import label_end +from . import label_step +from . import otn_label_range +from . import ethernet_label_range +class label_restriction(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/connectivity-matrix/from/label-restrictions/label-restriction. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: The absence of the label restrictions container implies +that all labels are acceptable; otherwise, only restricted +labels are available. + """ + __slots__ = ('_path_helper', '_extmethods', '__restriction','__index','__label_start','__label_end','__label_step','__range_bitmap','__otn_label_range','__ethernet_label_range',) + + _yang_name = 'label-restriction' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__restriction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'inclusive': {}, 'exclusive': {}},), default=six.text_type("inclusive"), is_leaf=True, yang_name="restriction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='enumeration', is_config=True) + self.__index = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + self.__label_start = YANGDynClass(base=label_start.label_start, is_container='container', yang_name="label-start", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__label_end = YANGDynClass(base=label_end.label_end, is_container='container', yang_name="label-end", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__label_step = YANGDynClass(base=label_step.label_step, is_container='container', yang_name="label-step", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__range_bitmap = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}), is_leaf=True, yang_name="range-bitmap", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:hex-string', is_config=True) + self.__otn_label_range = YANGDynClass(base=otn_label_range.otn_label_range, is_container='container', yang_name="otn-label-range", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + self.__ethernet_label_range = YANGDynClass(base=ethernet_label_range.ethernet_label_range, is_container='container', yang_name="ethernet-label-range", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-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 ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'connectivity-matrix', 'from', 'label-restrictions', 'label-restriction'] + + def _get_restriction(self): + """ + Getter method for restriction, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/restriction (enumeration) + + YANG Description: Indicates whether the list item is inclusive or exclusive. + """ + return self.__restriction + + def _set_restriction(self, v, load=False): + """ + Setter method for restriction, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/restriction (enumeration) + If this variable is read-only (config: false) in the + source YANG file, then _set_restriction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_restriction() directly. + + YANG Description: Indicates whether the list item is inclusive or exclusive. + """ + 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={'inclusive': {}, 'exclusive': {}},), default=six.text_type("inclusive"), is_leaf=True, yang_name="restriction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='enumeration', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """restriction must be of a type compatible with enumeration""", + 'defined-type': "ietf-te-topology:enumeration", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'inclusive': {}, 'exclusive': {}},), default=six.text_type("inclusive"), is_leaf=True, yang_name="restriction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='enumeration', is_config=True)""", + }) + + self.__restriction = t + if hasattr(self, '_set'): + self._set() + + def _unset_restriction(self): + self.__restriction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'inclusive': {}, 'exclusive': {}},), default=six.text_type("inclusive"), is_leaf=True, yang_name="restriction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='enumeration', is_config=True) + + + def _get_index(self): + """ + Getter method for index, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/index (uint32) + + YANG Description: The index of the label restriction list entry. + """ + return self.__index + + def _set_index(self, v, load=False): + """ + Setter method for index, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/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 label restriction list entry. + """ + 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=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', 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), is_leaf=True, yang_name="index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', 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), is_leaf=True, yang_name="index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + + + def _get_label_start(self): + """ + Getter method for label_start, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/label_start (container) + + YANG Description: This is the starting label if a label range is specified. +This is the label value if a single label is specified, +in which case the 'label-end' attribute is not set. + """ + return self.__label_start + + def _set_label_start(self, v, load=False): + """ + Setter method for label_start, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/label_start (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_label_start is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_label_start() directly. + + YANG Description: This is the starting label if a label range is specified. +This is the label value if a single label is specified, +in which case the 'label-end' attribute is not set. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=label_start.label_start, is_container='container', yang_name="label-start", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """label_start must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=label_start.label_start, is_container='container', yang_name="label-start", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__label_start = t + if hasattr(self, '_set'): + self._set() + + def _unset_label_start(self): + self.__label_start = YANGDynClass(base=label_start.label_start, is_container='container', yang_name="label-start", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_label_end(self): + """ + Getter method for label_end, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/label_end (container) + + YANG Description: This is the ending label if a label range is specified. +This attribute is not set if a single label is specified. + """ + return self.__label_end + + def _set_label_end(self, v, load=False): + """ + Setter method for label_end, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/label_end (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_label_end is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_label_end() directly. + + YANG Description: This is the ending label if a label range is specified. +This attribute is not set if a single label is specified. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=label_end.label_end, is_container='container', yang_name="label-end", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """label_end must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=label_end.label_end, is_container='container', yang_name="label-end", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__label_end = t + if hasattr(self, '_set'): + self._set() + + def _unset_label_end(self): + self.__label_end = YANGDynClass(base=label_end.label_end, is_container='container', yang_name="label-end", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_label_step(self): + """ + Getter method for label_step, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/label_step (container) + + YANG Description: The step increment between labels in the label range. +The label start/end values will have to be consistent +with the sign of label step. For example, +'label-start' < 'label-end' enforces 'label-step' > 0 +'label-start' > 'label-end' enforces 'label-step' < 0. + """ + return self.__label_step + + def _set_label_step(self, v, load=False): + """ + Setter method for label_step, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/label_step (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_label_step is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_label_step() directly. + + YANG Description: The step increment between labels in the label range. +The label start/end values will have to be consistent +with the sign of label step. For example, +'label-start' < 'label-end' enforces 'label-step' > 0 +'label-start' > 'label-end' enforces 'label-step' < 0. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=label_step.label_step, is_container='container', yang_name="label-step", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """label_step must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=label_step.label_step, is_container='container', yang_name="label-step", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__label_step = t + if hasattr(self, '_set'): + self._set() + + def _unset_label_step(self): + self.__label_step = YANGDynClass(base=label_step.label_step, is_container='container', yang_name="label-step", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_range_bitmap(self): + """ + Getter method for range_bitmap, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/range_bitmap (yang:hex-string) + + YANG Description: When there are gaps between 'label-start' and 'label-end', +this attribute is used to specify the positions +of the used labels. This is represented in big endian as +'hex-string'. +The most significant byte in the hex-string is the farthest +to the left in the byte sequence. Leading zero bytes in the +configured value may be omitted for brevity. +Each bit position in the 'range-bitmap' 'hex-string' maps +to a label in the range derived from 'label-start'. + +For example, assuming that 'label-start' = 16000 and +'range-bitmap' = 0x01000001, then: + +- bit position (0) is set, and the corresponding mapped + label from the range is 16000 + (0 * 'label-step') or + 16000 for default 'label-step' = 1. +- bit position (24) is set, and the corresponding mapped + label from the range is 16000 + (24 * 'label-step') or + 16024 for default 'label-step' = 1. + """ + return self.__range_bitmap + + def _set_range_bitmap(self, v, load=False): + """ + Setter method for range_bitmap, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/range_bitmap (yang:hex-string) + If this variable is read-only (config: false) in the + source YANG file, then _set_range_bitmap is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_range_bitmap() directly. + + YANG Description: When there are gaps between 'label-start' and 'label-end', +this attribute is used to specify the positions +of the used labels. This is represented in big endian as +'hex-string'. +The most significant byte in the hex-string is the farthest +to the left in the byte sequence. Leading zero bytes in the +configured value may be omitted for brevity. +Each bit position in the 'range-bitmap' 'hex-string' maps +to a label in the range derived from 'label-start'. + +For example, assuming that 'label-start' = 16000 and +'range-bitmap' = 0x01000001, then: + +- bit position (0) is set, and the corresponding mapped + label from the range is 16000 + (0 * 'label-step') or + 16000 for default 'label-step' = 1. +- bit position (24) is set, and the corresponding mapped + label from the range is 16000 + (24 * 'label-step') or + 16024 for default 'label-step' = 1. + """ + 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})*)?'}), is_leaf=True, yang_name="range-bitmap", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:hex-string', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """range_bitmap must be of a type compatible with yang:hex-string""", + 'defined-type': "yang:hex-string", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}), is_leaf=True, yang_name="range-bitmap", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:hex-string', is_config=True)""", + }) + + self.__range_bitmap = t + if hasattr(self, '_set'): + self._set() + + def _unset_range_bitmap(self): + self.__range_bitmap = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}), is_leaf=True, yang_name="range-bitmap", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:hex-string', is_config=True) + + + def _get_otn_label_range(self): + """ + Getter method for otn_label_range, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/otn_label_range (container) + + YANG Description: Label range information for OTN. + """ + return self.__otn_label_range + + def _set_otn_label_range(self, v, load=False): + """ + Setter method for otn_label_range, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/otn_label_range (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_otn_label_range is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_otn_label_range() directly. + + YANG Description: Label range information for OTN. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=otn_label_range.otn_label_range, is_container='container', yang_name="otn-label-range", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """otn_label_range must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=otn_label_range.otn_label_range, is_container='container', yang_name="otn-label-range", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True)""", + }) + + self.__otn_label_range = t + if hasattr(self, '_set'): + self._set() + + def _unset_otn_label_range(self): + self.__otn_label_range = YANGDynClass(base=otn_label_range.otn_label_range, is_container='container', yang_name="otn-label-range", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + + + def _get_ethernet_label_range(self): + """ + Getter method for ethernet_label_range, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/ethernet_label_range (container) + + YANG Description: Ethernet-specific label range related information. + """ + return self.__ethernet_label_range + + def _set_ethernet_label_range(self, v, load=False): + """ + Setter method for ethernet_label_range, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/ethernet_label_range (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_ethernet_label_range is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_ethernet_label_range() directly. + + YANG Description: Ethernet-specific label range related information. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=ethernet_label_range.ethernet_label_range, is_container='container', yang_name="ethernet-label-range", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """ethernet_label_range must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=ethernet_label_range.ethernet_label_range, is_container='container', yang_name="ethernet-label-range", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='container', is_config=True)""", + }) + + self.__ethernet_label_range = t + if hasattr(self, '_set'): + self._set() + + def _unset_ethernet_label_range(self): + self.__ethernet_label_range = YANGDynClass(base=ethernet_label_range.ethernet_label_range, is_container='container', yang_name="ethernet-label-range", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='container', is_config=True) + + restriction = __builtin__.property(_get_restriction, _set_restriction) + index = __builtin__.property(_get_index, _set_index) + label_start = __builtin__.property(_get_label_start, _set_label_start) + label_end = __builtin__.property(_get_label_end, _set_label_end) + label_step = __builtin__.property(_get_label_step, _set_label_step) + range_bitmap = __builtin__.property(_get_range_bitmap, _set_range_bitmap) + otn_label_range = __builtin__.property(_get_otn_label_range, _set_otn_label_range) + ethernet_label_range = __builtin__.property(_get_ethernet_label_range, _set_ethernet_label_range) + + + _pyangbind_elements = OrderedDict([('restriction', restriction), ('index', index), ('label_start', label_start), ('label_end', label_end), ('label_step', label_step), ('range_bitmap', range_bitmap), ('otn_label_range', otn_label_range), ('ethernet_label_range', ethernet_label_range), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from_/label_restrictions/label_restriction/ethernet_label_range/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from_/label_restrictions/label_restriction/ethernet_label_range/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..85fe797a51b6fa7885f89cd65cf364ff57198576 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from_/label_restrictions/label_restriction/ethernet_label_range/__init__.py @@ -0,0 +1,154 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 ethernet_label_range(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/connectivity-matrix/from/label-restrictions/label-restriction/ethernet-label-range. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Ethernet-specific label range related information. + """ + __slots__ = ('_path_helper', '_extmethods', '__tag_type','__priority',) + + _yang_name = 'ethernet-label-range' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__tag_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 's-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:s-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:s-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}},), is_leaf=True, yang_name="tag-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:eth-tag-type', is_config=True) + self.__priority = YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), is_leaf=True, yang_name="priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', 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 ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'connectivity-matrix', 'from', 'label-restrictions', 'label-restriction', 'ethernet-label-range'] + + def _get_tag_type(self): + """ + Getter method for tag_type, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/ethernet_label_range/tag_type (etht-types:eth-tag-type) + + YANG Description: VLAN tag type. + """ + return self.__tag_type + + def _set_tag_type(self, v, load=False): + """ + Setter method for tag_type, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/ethernet_label_range/tag_type (etht-types:eth-tag-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_tag_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tag_type() directly. + + YANG Description: VLAN tag type. + """ + 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={'c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 's-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:s-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:s-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}},), is_leaf=True, yang_name="tag-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:eth-tag-type', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tag_type must be of a type compatible with etht-types:eth-tag-type""", + 'defined-type': "etht-types:eth-tag-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 's-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:s-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:s-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}},), is_leaf=True, yang_name="tag-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:eth-tag-type', is_config=True)""", + }) + + self.__tag_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_tag_type(self): + self.__tag_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 's-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:s-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:s-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}},), is_leaf=True, yang_name="tag-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:eth-tag-type', is_config=True) + + + def _get_priority(self): + """ + Getter method for priority, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/ethernet_label_range/priority (uint8) + + YANG Description: priority. + """ + return self.__priority + + def _set_priority(self, v, load=False): + """ + Setter method for priority, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/ethernet_label_range/priority (uint8) + If this variable is read-only (config: false) in the + source YANG file, then _set_priority is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_priority() directly. + + YANG Description: priority. + """ + 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="priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint8', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """priority 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="priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint8', is_config=True)""", + }) + + self.__priority = t + if hasattr(self, '_set'): + self._set() + + def _unset_priority(self): + self.__priority = YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), is_leaf=True, yang_name="priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint8', is_config=True) + + tag_type = __builtin__.property(_get_tag_type, _set_tag_type) + priority = __builtin__.property(_get_priority, _set_priority) + + + _pyangbind_elements = OrderedDict([('tag_type', tag_type), ('priority', priority), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from_/label_restrictions/label_restriction/label_end/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from_/label_restrictions/label_restriction/label_end/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..3d944dc6d944eab6e6dac30513295005989a6f10 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from_/label_restrictions/label_restriction/label_end/__init__.py @@ -0,0 +1,119 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 te_label +class label_end(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/connectivity-matrix/from/label-restrictions/label-restriction/label-end. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: This is the ending label if a label range is specified. +This attribute is not set if a single label is specified. + """ + __slots__ = ('_path_helper', '_extmethods', '__te_label',) + + _yang_name = 'label-end' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__te_label = YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-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 ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'connectivity-matrix', 'from', 'label-restrictions', 'label-restriction', 'label-end'] + + def _get_te_label(self): + """ + Getter method for te_label, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/label_end/te_label (container) + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + return self.__te_label + + def _set_te_label(self, v, load=False): + """ + Setter method for te_label, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/label_end/te_label (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_te_label is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_te_label() directly. + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """te_label must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__te_label = t + if hasattr(self, '_set'): + self._set() + + def _unset_te_label(self): + self.__te_label = YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + te_label = __builtin__.property(_get_te_label, _set_te_label) + + + _pyangbind_elements = OrderedDict([('te_label', te_label), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from_/label_restrictions/label_restriction/label_end/te_label/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from_/label_restrictions/label_restriction/label_end/te_label/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..c0f426a02bd5be6f416217e24fbadf1b3f034ec2 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from_/label_restrictions/label_restriction/label_end/te_label/__init__.py @@ -0,0 +1,234 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 otn +class te_label(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/connectivity-matrix/from/label-restrictions/label-restriction/label-end/te-label. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + __slots__ = ('_path_helper', '_extmethods', '__generic','__otn','__vlanid','__direction',) + + _yang_name = 'te-label' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__generic = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True) + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + self.__vlanid = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True) + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', 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 ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'connectivity-matrix', 'from', 'label-restrictions', 'label-restriction', 'label-end', 'te-label'] + + def _get_generic(self): + """ + Getter method for generic, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/label_end/te_label/generic (rt-types:generalized-label) + + YANG Description: TE label specified in a generic format. + """ + return self.__generic + + def _set_generic(self, v, load=False): + """ + Setter method for generic, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/label_end/te_label/generic (rt-types:generalized-label) + If this variable is read-only (config: false) in the + source YANG file, then _set_generic is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_generic() directly. + + YANG Description: TE label specified in a generic format. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """generic must be of a type compatible with rt-types:generalized-label""", + 'defined-type': "rt-types:generalized-label", + 'generated-type': """YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True)""", + }) + + self.__generic = t + if hasattr(self, '_set'): + self._set() + + def _unset_generic(self): + self.__generic = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True) + + + def _get_otn(self): + """ + Getter method for otn, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/label_end/te_label/otn (container) + + YANG Description: Label start or label end for OTN. + """ + return self.__otn + + def _set_otn(self, v, load=False): + """ + Setter method for otn, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/label_end/te_label/otn (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_otn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_otn() directly. + + YANG Description: Label start or label end for OTN. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """otn must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True)""", + }) + + self.__otn = t + if hasattr(self, '_set'): + self._set() + + def _unset_otn(self): + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + + + def _get_vlanid(self): + """ + Getter method for vlanid, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/label_end/te_label/vlanid (etht-types:vlanid) + + YANG Description: VLAN tag id. + """ + return self.__vlanid + + def _set_vlanid(self, v, load=False): + """ + Setter method for vlanid, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/label_end/te_label/vlanid (etht-types:vlanid) + If this variable is read-only (config: false) in the + source YANG file, then _set_vlanid is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_vlanid() directly. + + YANG Description: VLAN tag id. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """vlanid must be of a type compatible with etht-types:vlanid""", + 'defined-type': "etht-types:vlanid", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True)""", + }) + + self.__vlanid = t + if hasattr(self, '_set'): + self._set() + + def _unset_vlanid(self): + self.__vlanid = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True) + + + def _get_direction(self): + """ + Getter method for direction, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/label_end/te_label/direction (te-label-direction) + + YANG Description: Label direction. + """ + return self.__direction + + def _set_direction(self, v, load=False): + """ + Setter method for direction, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/label_end/te_label/direction (te-label-direction) + If this variable is read-only (config: false) in the + source YANG file, then _set_direction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_direction() directly. + + YANG Description: Label direction. + """ + 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={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """direction must be of a type compatible with te-label-direction""", + 'defined-type': "ietf-te-topology:te-label-direction", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=True)""", + }) + + self.__direction = t + if hasattr(self, '_set'): + self._set() + + def _unset_direction(self): + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=True) + + generic = __builtin__.property(_get_generic, _set_generic) + otn = __builtin__.property(_get_otn, _set_otn) + vlanid = __builtin__.property(_get_vlanid, _set_vlanid) + direction = __builtin__.property(_get_direction, _set_direction) + + __choices__ = {'technology': {'generic': ['generic'], 'otn': ['otn'], 'eth': ['vlanid']}} + _pyangbind_elements = OrderedDict([('generic', generic), ('otn', otn), ('vlanid', vlanid), ('direction', direction), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from_/label_restrictions/label_restriction/label_end/te_label/otn/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from_/label_restrictions/label_restriction/label_end/te_label/otn/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..252392100dcf49782a2bf23a6abccca7c1af85c2 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from_/label_restrictions/label_restriction/label_end/te_label/otn/__init__.py @@ -0,0 +1,154 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 otn(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/connectivity-matrix/from/label-restrictions/label-restriction/label-end/te-label/otn. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Label start or label end for OTN. + """ + __slots__ = ('_path_helper', '_extmethods', '__tpn','__ts',) + + _yang_name = 'otn' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__tpn = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('range-type', 'trib-port'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True) + self.__ts = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts", parent=self, choice=('range-type', 'trib-slot'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-ts', 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 ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'connectivity-matrix', 'from', 'label-restrictions', 'label-restriction', 'label-end', 'te-label', 'otn'] + + def _get_tpn(self): + """ + Getter method for tpn, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/label_end/te_label/otn/tpn (otn-tpn) + + YANG Description: Tributary Port Number (TPN). + """ + return self.__tpn + + def _set_tpn(self, v, load=False): + """ + Setter method for tpn, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/label_end/te_label/otn/tpn (otn-tpn) + If this variable is read-only (config: false) in the + source YANG file, then _set_tpn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tpn() directly. + + YANG Description: Tributary Port Number (TPN). + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('range-type', 'trib-port'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tpn must be of a type compatible with otn-tpn""", + 'defined-type': "ietf-otn-topology:otn-tpn", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('range-type', 'trib-port'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True)""", + }) + + self.__tpn = t + if hasattr(self, '_set'): + self._set() + + def _unset_tpn(self): + self.__tpn = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('range-type', 'trib-port'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True) + + + def _get_ts(self): + """ + Getter method for ts, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/label_end/te_label/otn/ts (otn-ts) + + YANG Description: Tributary Slot (TS) number. + """ + return self.__ts + + def _set_ts(self, v, load=False): + """ + Setter method for ts, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/label_end/te_label/otn/ts (otn-ts) + If this variable is read-only (config: false) in the + source YANG file, then _set_ts is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_ts() directly. + + YANG Description: Tributary Slot (TS) number. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts", parent=self, choice=('range-type', 'trib-slot'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-ts', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """ts must be of a type compatible with otn-ts""", + 'defined-type': "ietf-otn-topology:otn-ts", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts", parent=self, choice=('range-type', 'trib-slot'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-ts', is_config=True)""", + }) + + self.__ts = t + if hasattr(self, '_set'): + self._set() + + def _unset_ts(self): + self.__ts = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts", parent=self, choice=('range-type', 'trib-slot'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-ts', is_config=True) + + tpn = __builtin__.property(_get_tpn, _set_tpn) + ts = __builtin__.property(_get_ts, _set_ts) + + __choices__ = {'range-type': {'trib-port': ['tpn'], 'trib-slot': ['ts']}} + _pyangbind_elements = OrderedDict([('tpn', tpn), ('ts', ts), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from_/label_restrictions/label_restriction/label_start/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from_/label_restrictions/label_restriction/label_start/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..7233908c119432a428f57f6e909caff23ae57867 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from_/label_restrictions/label_restriction/label_start/__init__.py @@ -0,0 +1,120 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 te_label +class label_start(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/connectivity-matrix/from/label-restrictions/label-restriction/label-start. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: This is the starting label if a label range is specified. +This is the label value if a single label is specified, +in which case the 'label-end' attribute is not set. + """ + __slots__ = ('_path_helper', '_extmethods', '__te_label',) + + _yang_name = 'label-start' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__te_label = YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-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 ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'connectivity-matrix', 'from', 'label-restrictions', 'label-restriction', 'label-start'] + + def _get_te_label(self): + """ + Getter method for te_label, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/label_start/te_label (container) + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + return self.__te_label + + def _set_te_label(self, v, load=False): + """ + Setter method for te_label, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/label_start/te_label (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_te_label is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_te_label() directly. + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """te_label must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__te_label = t + if hasattr(self, '_set'): + self._set() + + def _unset_te_label(self): + self.__te_label = YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + te_label = __builtin__.property(_get_te_label, _set_te_label) + + + _pyangbind_elements = OrderedDict([('te_label', te_label), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from_/label_restrictions/label_restriction/label_start/te_label/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from_/label_restrictions/label_restriction/label_start/te_label/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..c15cb8c1bb129f85fe29101fc8b1da2a3574ddc6 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from_/label_restrictions/label_restriction/label_start/te_label/__init__.py @@ -0,0 +1,234 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 otn +class te_label(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/connectivity-matrix/from/label-restrictions/label-restriction/label-start/te-label. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + __slots__ = ('_path_helper', '_extmethods', '__generic','__otn','__vlanid','__direction',) + + _yang_name = 'te-label' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__generic = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True) + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + self.__vlanid = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True) + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', 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 ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'connectivity-matrix', 'from', 'label-restrictions', 'label-restriction', 'label-start', 'te-label'] + + def _get_generic(self): + """ + Getter method for generic, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/label_start/te_label/generic (rt-types:generalized-label) + + YANG Description: TE label specified in a generic format. + """ + return self.__generic + + def _set_generic(self, v, load=False): + """ + Setter method for generic, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/label_start/te_label/generic (rt-types:generalized-label) + If this variable is read-only (config: false) in the + source YANG file, then _set_generic is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_generic() directly. + + YANG Description: TE label specified in a generic format. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """generic must be of a type compatible with rt-types:generalized-label""", + 'defined-type': "rt-types:generalized-label", + 'generated-type': """YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True)""", + }) + + self.__generic = t + if hasattr(self, '_set'): + self._set() + + def _unset_generic(self): + self.__generic = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True) + + + def _get_otn(self): + """ + Getter method for otn, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/label_start/te_label/otn (container) + + YANG Description: Label start or label end for OTN. + """ + return self.__otn + + def _set_otn(self, v, load=False): + """ + Setter method for otn, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/label_start/te_label/otn (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_otn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_otn() directly. + + YANG Description: Label start or label end for OTN. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """otn must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True)""", + }) + + self.__otn = t + if hasattr(self, '_set'): + self._set() + + def _unset_otn(self): + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + + + def _get_vlanid(self): + """ + Getter method for vlanid, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/label_start/te_label/vlanid (etht-types:vlanid) + + YANG Description: VLAN tag id. + """ + return self.__vlanid + + def _set_vlanid(self, v, load=False): + """ + Setter method for vlanid, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/label_start/te_label/vlanid (etht-types:vlanid) + If this variable is read-only (config: false) in the + source YANG file, then _set_vlanid is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_vlanid() directly. + + YANG Description: VLAN tag id. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """vlanid must be of a type compatible with etht-types:vlanid""", + 'defined-type': "etht-types:vlanid", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True)""", + }) + + self.__vlanid = t + if hasattr(self, '_set'): + self._set() + + def _unset_vlanid(self): + self.__vlanid = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True) + + + def _get_direction(self): + """ + Getter method for direction, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/label_start/te_label/direction (te-label-direction) + + YANG Description: Label direction. + """ + return self.__direction + + def _set_direction(self, v, load=False): + """ + Setter method for direction, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/label_start/te_label/direction (te-label-direction) + If this variable is read-only (config: false) in the + source YANG file, then _set_direction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_direction() directly. + + YANG Description: Label direction. + """ + 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={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """direction must be of a type compatible with te-label-direction""", + 'defined-type': "ietf-te-topology:te-label-direction", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=True)""", + }) + + self.__direction = t + if hasattr(self, '_set'): + self._set() + + def _unset_direction(self): + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=True) + + generic = __builtin__.property(_get_generic, _set_generic) + otn = __builtin__.property(_get_otn, _set_otn) + vlanid = __builtin__.property(_get_vlanid, _set_vlanid) + direction = __builtin__.property(_get_direction, _set_direction) + + __choices__ = {'technology': {'generic': ['generic'], 'otn': ['otn'], 'eth': ['vlanid']}} + _pyangbind_elements = OrderedDict([('generic', generic), ('otn', otn), ('vlanid', vlanid), ('direction', direction), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from_/label_restrictions/label_restriction/label_start/te_label/otn/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from_/label_restrictions/label_restriction/label_start/te_label/otn/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..29741fa5ec6c5d3bdaec7180d7371e8cd25a2aad --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from_/label_restrictions/label_restriction/label_start/te_label/otn/__init__.py @@ -0,0 +1,154 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 otn(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/connectivity-matrix/from/label-restrictions/label-restriction/label-start/te-label/otn. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Label start or label end for OTN. + """ + __slots__ = ('_path_helper', '_extmethods', '__tpn','__ts',) + + _yang_name = 'otn' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__tpn = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('range-type', 'trib-port'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True) + self.__ts = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts", parent=self, choice=('range-type', 'trib-slot'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-ts', 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 ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'connectivity-matrix', 'from', 'label-restrictions', 'label-restriction', 'label-start', 'te-label', 'otn'] + + def _get_tpn(self): + """ + Getter method for tpn, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/label_start/te_label/otn/tpn (otn-tpn) + + YANG Description: Tributary Port Number (TPN). + """ + return self.__tpn + + def _set_tpn(self, v, load=False): + """ + Setter method for tpn, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/label_start/te_label/otn/tpn (otn-tpn) + If this variable is read-only (config: false) in the + source YANG file, then _set_tpn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tpn() directly. + + YANG Description: Tributary Port Number (TPN). + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('range-type', 'trib-port'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tpn must be of a type compatible with otn-tpn""", + 'defined-type': "ietf-otn-topology:otn-tpn", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('range-type', 'trib-port'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True)""", + }) + + self.__tpn = t + if hasattr(self, '_set'): + self._set() + + def _unset_tpn(self): + self.__tpn = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('range-type', 'trib-port'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True) + + + def _get_ts(self): + """ + Getter method for ts, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/label_start/te_label/otn/ts (otn-ts) + + YANG Description: Tributary Slot (TS) number. + """ + return self.__ts + + def _set_ts(self, v, load=False): + """ + Setter method for ts, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/label_start/te_label/otn/ts (otn-ts) + If this variable is read-only (config: false) in the + source YANG file, then _set_ts is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_ts() directly. + + YANG Description: Tributary Slot (TS) number. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts", parent=self, choice=('range-type', 'trib-slot'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-ts', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """ts must be of a type compatible with otn-ts""", + 'defined-type': "ietf-otn-topology:otn-ts", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts", parent=self, choice=('range-type', 'trib-slot'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-ts', is_config=True)""", + }) + + self.__ts = t + if hasattr(self, '_set'): + self._set() + + def _unset_ts(self): + self.__ts = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts", parent=self, choice=('range-type', 'trib-slot'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-ts', is_config=True) + + tpn = __builtin__.property(_get_tpn, _set_tpn) + ts = __builtin__.property(_get_ts, _set_ts) + + __choices__ = {'range-type': {'trib-port': ['tpn'], 'trib-slot': ['ts']}} + _pyangbind_elements = OrderedDict([('tpn', tpn), ('ts', ts), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from_/label_restrictions/label_restriction/label_step/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from_/label_restrictions/label_restriction/label_step/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..076a06d963d8ae945ad667fc4e57b3c7367688a6 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from_/label_restrictions/label_restriction/label_step/__init__.py @@ -0,0 +1,200 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 otn +class label_step(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/connectivity-matrix/from/label-restrictions/label-restriction/label-step. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: The step increment between labels in the label range. +The label start/end values will have to be consistent +with the sign of label step. For example, +'label-start' < 'label-end' enforces 'label-step' > 0 +'label-start' > 'label-end' enforces 'label-step' < 0. + """ + __slots__ = ('_path_helper', '_extmethods', '__generic','__otn','__eth_step',) + + _yang_name = 'label-step' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__generic = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['-2147483648..2147483647']}, int_size=32), default=RestrictedClassType(base_type=long, restriction_dict={'range': ['-2147483648..2147483647']}, int_size=32)(1), is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='int32', is_config=True) + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + self.__eth_step = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), default=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16)(1), is_leaf=True, yang_name="eth-step", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint16', 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 ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'connectivity-matrix', 'from', 'label-restrictions', 'label-restriction', 'label-step'] + + def _get_generic(self): + """ + Getter method for generic, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/label_step/generic (int32) + + YANG Description: Label range step. + """ + return self.__generic + + def _set_generic(self, v, load=False): + """ + Setter method for generic, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/label_step/generic (int32) + If this variable is read-only (config: false) in the + source YANG file, then _set_generic is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_generic() directly. + + YANG Description: Label range step. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['-2147483648..2147483647']}, int_size=32), default=RestrictedClassType(base_type=long, restriction_dict={'range': ['-2147483648..2147483647']}, int_size=32)(1), is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='int32', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """generic must be of a type compatible with int32""", + 'defined-type': "int32", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['-2147483648..2147483647']}, int_size=32), default=RestrictedClassType(base_type=long, restriction_dict={'range': ['-2147483648..2147483647']}, int_size=32)(1), is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='int32', is_config=True)""", + }) + + self.__generic = t + if hasattr(self, '_set'): + self._set() + + def _unset_generic(self): + self.__generic = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['-2147483648..2147483647']}, int_size=32), default=RestrictedClassType(base_type=long, restriction_dict={'range': ['-2147483648..2147483647']}, int_size=32)(1), is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='int32', is_config=True) + + + def _get_otn(self): + """ + Getter method for otn, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/label_step/otn (container) + + YANG Description: Label step for OTN + """ + return self.__otn + + def _set_otn(self, v, load=False): + """ + Setter method for otn, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/label_step/otn (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_otn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_otn() directly. + + YANG Description: Label step for OTN + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """otn must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True)""", + }) + + self.__otn = t + if hasattr(self, '_set'): + self._set() + + def _unset_otn(self): + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + + + def _get_eth_step(self): + """ + Getter method for eth_step, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/label_step/eth_step (uint16) + + YANG Description: Label step which represent possible increments for +an Ethernet VLAN tag. + """ + return self.__eth_step + + def _set_eth_step(self, v, load=False): + """ + Setter method for eth_step, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/label_step/eth_step (uint16) + If this variable is read-only (config: false) in the + source YANG file, then _set_eth_step is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_eth_step() directly. + + YANG Description: Label step which represent possible increments for +an Ethernet VLAN tag. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), default=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16)(1), is_leaf=True, yang_name="eth-step", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint16', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """eth_step must be of a type compatible with uint16""", + 'defined-type': "uint16", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), default=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16)(1), is_leaf=True, yang_name="eth-step", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint16', is_config=True)""", + }) + + self.__eth_step = t + if hasattr(self, '_set'): + self._set() + + def _unset_eth_step(self): + self.__eth_step = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), default=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16)(1), is_leaf=True, yang_name="eth-step", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint16', is_config=True) + + generic = __builtin__.property(_get_generic, _set_generic) + otn = __builtin__.property(_get_otn, _set_otn) + eth_step = __builtin__.property(_get_eth_step, _set_eth_step) + + __choices__ = {'technology': {'generic': ['generic'], 'otn': ['otn'], 'eth': ['eth_step']}} + _pyangbind_elements = OrderedDict([('generic', generic), ('otn', otn), ('eth_step', eth_step), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from_/label_restrictions/label_restriction/label_step/otn/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from_/label_restrictions/label_restriction/label_step/otn/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..023f3d7553a6098ca6ace33091cb75002b4d0b52 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from_/label_restrictions/label_restriction/label_step/otn/__init__.py @@ -0,0 +1,158 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 otn(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/connectivity-matrix/from/label-restrictions/label-restriction/label-step/otn. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Label step for OTN + """ + __slots__ = ('_path_helper', '_extmethods', '__tpn','__ts',) + + _yang_name = 'otn' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__tpn = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('range-type', 'trib-port'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True) + self.__ts = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts", parent=self, choice=('range-type', 'trib-slot'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-ts', 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 ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'connectivity-matrix', 'from', 'label-restrictions', 'label-restriction', 'label-step', 'otn'] + + def _get_tpn(self): + """ + Getter method for tpn, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/label_step/otn/tpn (otn-tpn) + + YANG Description: Label step which represents possible increments for +Tributary Port Number (TPN). + """ + return self.__tpn + + def _set_tpn(self, v, load=False): + """ + Setter method for tpn, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/label_step/otn/tpn (otn-tpn) + If this variable is read-only (config: false) in the + source YANG file, then _set_tpn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tpn() directly. + + YANG Description: Label step which represents possible increments for +Tributary Port Number (TPN). + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('range-type', 'trib-port'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tpn must be of a type compatible with otn-tpn""", + 'defined-type': "ietf-otn-topology:otn-tpn", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('range-type', 'trib-port'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True)""", + }) + + self.__tpn = t + if hasattr(self, '_set'): + self._set() + + def _unset_tpn(self): + self.__tpn = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('range-type', 'trib-port'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True) + + + def _get_ts(self): + """ + Getter method for ts, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/label_step/otn/ts (otn-ts) + + YANG Description: Label step which represents possible increments for +Tributary Slot (TS) number. + """ + return self.__ts + + def _set_ts(self, v, load=False): + """ + Setter method for ts, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/label_step/otn/ts (otn-ts) + If this variable is read-only (config: false) in the + source YANG file, then _set_ts is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_ts() directly. + + YANG Description: Label step which represents possible increments for +Tributary Slot (TS) number. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts", parent=self, choice=('range-type', 'trib-slot'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-ts', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """ts must be of a type compatible with otn-ts""", + 'defined-type': "ietf-otn-topology:otn-ts", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts", parent=self, choice=('range-type', 'trib-slot'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-ts', is_config=True)""", + }) + + self.__ts = t + if hasattr(self, '_set'): + self._set() + + def _unset_ts(self): + self.__ts = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts", parent=self, choice=('range-type', 'trib-slot'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-ts', is_config=True) + + tpn = __builtin__.property(_get_tpn, _set_tpn) + ts = __builtin__.property(_get_ts, _set_ts) + + __choices__ = {'range-type': {'trib-port': ['tpn'], 'trib-slot': ['ts']}} + _pyangbind_elements = OrderedDict([('tpn', tpn), ('ts', ts), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from_/label_restrictions/label_restriction/otn_label_range/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from_/label_restrictions/label_restriction/otn_label_range/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..9e9f6bb66d506fa8ba26e0593d32ba8d4e697bfd --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from_/label_restrictions/label_restriction/otn_label_range/__init__.py @@ -0,0 +1,256 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 otn_label_range(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/connectivity-matrix/from/label-restrictions/label-restriction/otn-label-range. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Label range information for OTN. + """ + __slots__ = ('_path_helper', '_extmethods', '__range_type','__tsg','__odu_type_list','__priority',) + + _yang_name = 'otn-label-range' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__range_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'trib-slot': {}, 'trib-port': {}},), is_leaf=True, yang_name="range-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-label-range-type', is_config=True) + self.__tsg = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + self.__odu_type_list = YANGDynClass(unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},)), is_leaf=False, yang_name="odu-type-list", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + self.__priority = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..7']}), is_leaf=True, yang_name="priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', 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 ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'connectivity-matrix', 'from', 'label-restrictions', 'label-restriction', 'otn-label-range'] + + def _get_range_type(self): + """ + Getter method for range_type, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/otn_label_range/range_type (otn-label-range-type) + + YANG Description: The type of range (e.g., TPN or TS) +to which the label range applies + """ + return self.__range_type + + def _set_range_type(self, v, load=False): + """ + Setter method for range_type, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/otn_label_range/range_type (otn-label-range-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_range_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_range_type() directly. + + YANG Description: The type of range (e.g., TPN or TS) +to which the label range applies + """ + 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={'trib-slot': {}, 'trib-port': {}},), is_leaf=True, yang_name="range-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-label-range-type', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """range_type must be of a type compatible with otn-label-range-type""", + 'defined-type': "ietf-otn-topology:otn-label-range-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'trib-slot': {}, 'trib-port': {}},), is_leaf=True, yang_name="range-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-label-range-type', is_config=True)""", + }) + + self.__range_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_range_type(self): + self.__range_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'trib-slot': {}, 'trib-port': {}},), is_leaf=True, yang_name="range-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-label-range-type', is_config=True) + + + def _get_tsg(self): + """ + Getter method for tsg, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/otn_label_range/tsg (identityref) + + YANG Description: Tributary slot granularity (TSG) to which the label range +applies. + +This leaf MUST be present when the range-type is TS. + +This leaf MAY be omitted when mapping an ODUk over an OTUk +Link. In this case the range-type is tpn, with only one +entry (ODUk), and the tpn range has only one value (1). + """ + return self.__tsg + + def _set_tsg(self, v, load=False): + """ + Setter method for tsg, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/otn_label_range/tsg (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_tsg is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tsg() directly. + + YANG Description: Tributary slot granularity (TSG) to which the label range +applies. + +This leaf MUST be present when the range-type is TS. + +This leaf MAY be omitted when mapping an ODUk over an OTUk +Link. In this case the range-type is tpn, with only one +entry (ODUk), and the tpn range has only one value (1). + """ + 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={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tsg must be of a type compatible with identityref""", + 'defined-type': "ietf-otn-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True)""", + }) + + self.__tsg = t + if hasattr(self, '_set'): + self._set() + + def _unset_tsg(self): + self.__tsg = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + + + def _get_odu_type_list(self): + """ + Getter method for odu_type_list, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/otn_label_range/odu_type_list (identityref) + + YANG Description: List of ODU types to which the label range applies. + +An Empty odu-type-list means that the label range +applies to all the supported ODU types. + """ + return self.__odu_type_list + + def _set_odu_type_list(self, v, load=False): + """ + Setter method for odu_type_list, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/otn_label_range/odu_type_list (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_odu_type_list is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_odu_type_list() directly. + + YANG Description: List of ODU types to which the label range applies. + +An Empty odu-type-list means that the label range +applies to all the supported ODU types. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},)), is_leaf=False, yang_name="odu-type-list", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """odu_type_list must be of a type compatible with identityref""", + 'defined-type': "ietf-otn-topology:identityref", + 'generated-type': """YANGDynClass(unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},)), is_leaf=False, yang_name="odu-type-list", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True)""", + }) + + self.__odu_type_list = t + if hasattr(self, '_set'): + self._set() + + def _unset_odu_type_list(self): + self.__odu_type_list = YANGDynClass(unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},)), is_leaf=False, yang_name="odu-type-list", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + + + def _get_priority(self): + """ + Getter method for priority, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/otn_label_range/priority (uint8) + + YANG Description: Priority in Interface Switching Capability +Descriptor (ISCD). + """ + return self.__priority + + def _set_priority(self, v, load=False): + """ + Setter method for priority, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/otn_label_range/priority (uint8) + If this variable is read-only (config: false) in the + source YANG file, then _set_priority is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_priority() directly. + + YANG Description: Priority in Interface Switching Capability +Descriptor (ISCD). + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..7']}), is_leaf=True, yang_name="priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint8', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """priority must be of a type compatible with uint8""", + 'defined-type': "uint8", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..7']}), is_leaf=True, yang_name="priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint8', is_config=True)""", + }) + + self.__priority = t + if hasattr(self, '_set'): + self._set() + + def _unset_priority(self): + self.__priority = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..7']}), is_leaf=True, yang_name="priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint8', is_config=True) + + range_type = __builtin__.property(_get_range_type, _set_range_type) + tsg = __builtin__.property(_get_tsg, _set_tsg) + odu_type_list = __builtin__.property(_get_odu_type_list, _set_odu_type_list) + priority = __builtin__.property(_get_priority, _set_priority) + + + _pyangbind_elements = OrderedDict([('range_type', range_type), ('tsg', tsg), ('odu_type_list', odu_type_list), ('priority', priority), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..dccc4ecbe42042d4634c694abf84c3a7b85602eb --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/__init__.py @@ -0,0 +1,199 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 optimization_metric +from . import tiebreakers +from . import objective_function +class optimizations(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/connectivity-matrix/optimizations. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: The objective function container that includes +attributes to impose when computing a TE path. + """ + __slots__ = ('_path_helper', '_extmethods', '__optimization_metric','__tiebreakers','__objective_function',) + + _yang_name = 'optimizations' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__optimization_metric = YANGDynClass(base=YANGListType("metric_type",optimization_metric.optimization_metric, yang_name="optimization-metric", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='metric-type', extensions=None, choice=False), is_container='list', yang_name="optimization-metric", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + self.__tiebreakers = YANGDynClass(base=tiebreakers.tiebreakers, is_container='container', yang_name="tiebreakers", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__objective_function = YANGDynClass(base=objective_function.objective_function, is_container='container', yang_name="objective-function", parent=self, choice=('algorithm', 'objective-function'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-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 ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'connectivity-matrix', 'optimizations'] + + def _get_optimization_metric(self): + """ + Getter method for optimization_metric, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric (list) + + YANG Description: TE path metric type. + """ + return self.__optimization_metric + + def _set_optimization_metric(self, v, load=False): + """ + Setter method for optimization_metric, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_optimization_metric is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_optimization_metric() directly. + + YANG Description: TE path metric type. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("metric_type",optimization_metric.optimization_metric, yang_name="optimization-metric", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='metric-type', extensions=None, choice=False), is_container='list', yang_name="optimization-metric", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """optimization_metric must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("metric_type",optimization_metric.optimization_metric, yang_name="optimization-metric", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='metric-type', extensions=None, choice=False), is_container='list', yang_name="optimization-metric", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True)""", + }) + + self.__optimization_metric = t + if hasattr(self, '_set'): + self._set() + + def _unset_optimization_metric(self): + self.__optimization_metric = YANGDynClass(base=YANGListType("metric_type",optimization_metric.optimization_metric, yang_name="optimization-metric", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='metric-type', extensions=None, choice=False), is_container='list', yang_name="optimization-metric", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + + + def _get_tiebreakers(self): + """ + Getter method for tiebreakers, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/tiebreakers (container) + + YANG Description: Container for the list of tiebreakers. + """ + return self.__tiebreakers + + def _set_tiebreakers(self, v, load=False): + """ + Setter method for tiebreakers, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/tiebreakers (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_tiebreakers is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tiebreakers() directly. + + YANG Description: Container for the list of tiebreakers. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=tiebreakers.tiebreakers, is_container='container', yang_name="tiebreakers", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tiebreakers must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=tiebreakers.tiebreakers, is_container='container', yang_name="tiebreakers", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__tiebreakers = t + if hasattr(self, '_set'): + self._set() + + def _unset_tiebreakers(self): + self.__tiebreakers = YANGDynClass(base=tiebreakers.tiebreakers, is_container='container', yang_name="tiebreakers", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_objective_function(self): + """ + Getter method for objective_function, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/objective_function (container) + + YANG Description: The objective function container that includes +attributes to impose when computing a TE path. + """ + return self.__objective_function + + def _set_objective_function(self, v, load=False): + """ + Setter method for objective_function, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/objective_function (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_objective_function is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_objective_function() directly. + + YANG Description: The objective function container that includes +attributes to impose when computing a TE path. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=objective_function.objective_function, is_container='container', yang_name="objective-function", parent=self, choice=('algorithm', 'objective-function'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """objective_function must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=objective_function.objective_function, is_container='container', yang_name="objective-function", parent=self, choice=('algorithm', 'objective-function'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__objective_function = t + if hasattr(self, '_set'): + self._set() + + def _unset_objective_function(self): + self.__objective_function = YANGDynClass(base=objective_function.objective_function, is_container='container', yang_name="objective-function", parent=self, choice=('algorithm', 'objective-function'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + optimization_metric = __builtin__.property(_get_optimization_metric, _set_optimization_metric) + tiebreakers = __builtin__.property(_get_tiebreakers, _set_tiebreakers) + objective_function = __builtin__.property(_get_objective_function, _set_objective_function) + + __choices__ = {'algorithm': {'metric': ['optimization_metric', 'tiebreakers'], 'objective-function': ['objective_function']}} + _pyangbind_elements = OrderedDict([('optimization_metric', optimization_metric), ('tiebreakers', tiebreakers), ('objective_function', objective_function), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/objective_function/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/objective_function/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..dd970e56fedbc68b634dc3dca1acb89ed8eb72e0 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/objective_function/__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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 objective_function(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/connectivity-matrix/optimizations/objective-function. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: The objective function container that includes +attributes to impose when computing a TE path. + """ + __slots__ = ('_path_helper', '_extmethods', '__objective_function_type',) + + _yang_name = 'objective-function' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__objective_function_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'of-minimize-cost-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-cost-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-cost-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-minimize-load-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-load-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-load-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-maximize-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-maximize-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-maximize-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-minimize-agg-bandwidth-consumption': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-agg-bandwidth-consumption': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-agg-bandwidth-consumption': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-minimize-load-most-loaded-link': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-load-most-loaded-link': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-load-most-loaded-link': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-minimize-cost-path-set': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-cost-path-set': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-cost-path-set': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), default=six.text_type("te-types:of-minimize-cost-path"), is_leaf=True, yang_name="objective-function-type", parent=self, choice=('algorithm', 'objective-function'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', 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 ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'connectivity-matrix', 'optimizations', 'objective-function'] + + def _get_objective_function_type(self): + """ + Getter method for objective_function_type, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/objective_function/objective_function_type (identityref) + + YANG Description: Objective function entry. + """ + return self.__objective_function_type + + def _set_objective_function_type(self, v, load=False): + """ + Setter method for objective_function_type, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/objective_function/objective_function_type (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_objective_function_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_objective_function_type() directly. + + YANG Description: Objective function entry. + """ + 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={'of-minimize-cost-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-cost-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-cost-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-minimize-load-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-load-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-load-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-maximize-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-maximize-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-maximize-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-minimize-agg-bandwidth-consumption': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-agg-bandwidth-consumption': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-agg-bandwidth-consumption': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-minimize-load-most-loaded-link': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-load-most-loaded-link': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-load-most-loaded-link': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-minimize-cost-path-set': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-cost-path-set': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-cost-path-set': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), default=six.text_type("te-types:of-minimize-cost-path"), is_leaf=True, yang_name="objective-function-type", parent=self, choice=('algorithm', 'objective-function'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """objective_function_type must be of a type compatible with identityref""", + 'defined-type': "ietf-te-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'of-minimize-cost-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-cost-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-cost-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-minimize-load-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-load-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-load-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-maximize-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-maximize-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-maximize-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-minimize-agg-bandwidth-consumption': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-agg-bandwidth-consumption': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-agg-bandwidth-consumption': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-minimize-load-most-loaded-link': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-load-most-loaded-link': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-load-most-loaded-link': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-minimize-cost-path-set': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-cost-path-set': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-cost-path-set': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), default=six.text_type("te-types:of-minimize-cost-path"), is_leaf=True, yang_name="objective-function-type", parent=self, choice=('algorithm', 'objective-function'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True)""", + }) + + self.__objective_function_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_objective_function_type(self): + self.__objective_function_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'of-minimize-cost-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-cost-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-cost-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-minimize-load-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-load-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-load-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-maximize-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-maximize-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-maximize-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-minimize-agg-bandwidth-consumption': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-agg-bandwidth-consumption': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-agg-bandwidth-consumption': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-minimize-load-most-loaded-link': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-load-most-loaded-link': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-load-most-loaded-link': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-minimize-cost-path-set': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-cost-path-set': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-cost-path-set': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), default=six.text_type("te-types:of-minimize-cost-path"), is_leaf=True, yang_name="objective-function-type", parent=self, choice=('algorithm', 'objective-function'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + + objective_function_type = __builtin__.property(_get_objective_function_type, _set_objective_function_type) + + __choices__ = {'algorithm': {'objective-function': ['objective_function_type']}} + _pyangbind_elements = OrderedDict([('objective_function_type', objective_function_type), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..63bedfaf58dd445b7d0fd52595841cada6de1b81 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/__init__.py @@ -0,0 +1,241 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 explicit_route_exclude_objects +from . import explicit_route_include_objects +class optimization_metric(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/connectivity-matrix/optimizations/optimization-metric. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: TE path metric type. + """ + __slots__ = ('_path_helper', '_extmethods', '__metric_type','__weight','__explicit_route_exclude_objects','__explicit_route_include_objects',) + + _yang_name = 'optimization-metric' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__metric_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="metric-type", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + self.__weight = YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), default=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8)(1), is_leaf=True, yang_name="weight", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint8', is_config=True) + self.__explicit_route_exclude_objects = YANGDynClass(base=explicit_route_exclude_objects.explicit_route_exclude_objects, is_container='container', yang_name="explicit-route-exclude-objects", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__explicit_route_include_objects = YANGDynClass(base=explicit_route_include_objects.explicit_route_include_objects, is_container='container', yang_name="explicit-route-include-objects", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-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 ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'connectivity-matrix', 'optimizations', 'optimization-metric'] + + def _get_metric_type(self): + """ + Getter method for metric_type, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/metric_type (identityref) + + YANG Description: Identifies the 'metric-type' that the path computation +process uses for optimization. + """ + return self.__metric_type + + def _set_metric_type(self, v, load=False): + """ + Setter method for metric_type, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/metric_type (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_metric_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_metric_type() directly. + + YANG Description: Identifies the 'metric-type' that the path computation +process uses for optimization. + """ + 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=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="metric-type", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """metric_type must be of a type compatible with identityref""", + 'defined-type': "ietf-te-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="metric-type", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True)""", + }) + + self.__metric_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_metric_type(self): + self.__metric_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="metric-type", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + + + def _get_weight(self): + """ + Getter method for weight, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/weight (uint8) + + YANG Description: TE path metric normalization weight. + """ + return self.__weight + + def _set_weight(self, v, load=False): + """ + Setter method for weight, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/weight (uint8) + If this variable is read-only (config: false) in the + source YANG file, then _set_weight is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_weight() directly. + + YANG Description: TE path metric normalization weight. + """ + 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), default=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8)(1), is_leaf=True, yang_name="weight", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint8', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """weight 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), default=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8)(1), is_leaf=True, yang_name="weight", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint8', is_config=True)""", + }) + + self.__weight = t + if hasattr(self, '_set'): + self._set() + + def _unset_weight(self): + self.__weight = YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), default=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8)(1), is_leaf=True, yang_name="weight", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint8', is_config=True) + + + def _get_explicit_route_exclude_objects(self): + """ + Getter method for explicit_route_exclude_objects, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects (container) + + YANG Description: Container for the 'exclude route' object list. + """ + return self.__explicit_route_exclude_objects + + def _set_explicit_route_exclude_objects(self, v, load=False): + """ + Setter method for explicit_route_exclude_objects, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_explicit_route_exclude_objects is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_explicit_route_exclude_objects() directly. + + YANG Description: Container for the 'exclude route' object list. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=explicit_route_exclude_objects.explicit_route_exclude_objects, is_container='container', yang_name="explicit-route-exclude-objects", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """explicit_route_exclude_objects must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=explicit_route_exclude_objects.explicit_route_exclude_objects, is_container='container', yang_name="explicit-route-exclude-objects", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__explicit_route_exclude_objects = t + if hasattr(self, '_set'): + self._set() + + def _unset_explicit_route_exclude_objects(self): + self.__explicit_route_exclude_objects = YANGDynClass(base=explicit_route_exclude_objects.explicit_route_exclude_objects, is_container='container', yang_name="explicit-route-exclude-objects", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_explicit_route_include_objects(self): + """ + Getter method for explicit_route_include_objects, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects (container) + + YANG Description: Container for the 'include route' object list. + """ + return self.__explicit_route_include_objects + + def _set_explicit_route_include_objects(self, v, load=False): + """ + Setter method for explicit_route_include_objects, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_explicit_route_include_objects is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_explicit_route_include_objects() directly. + + YANG Description: Container for the 'include route' object list. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=explicit_route_include_objects.explicit_route_include_objects, is_container='container', yang_name="explicit-route-include-objects", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """explicit_route_include_objects must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=explicit_route_include_objects.explicit_route_include_objects, is_container='container', yang_name="explicit-route-include-objects", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__explicit_route_include_objects = t + if hasattr(self, '_set'): + self._set() + + def _unset_explicit_route_include_objects(self): + self.__explicit_route_include_objects = YANGDynClass(base=explicit_route_include_objects.explicit_route_include_objects, is_container='container', yang_name="explicit-route-include-objects", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + metric_type = __builtin__.property(_get_metric_type, _set_metric_type) + weight = __builtin__.property(_get_weight, _set_weight) + explicit_route_exclude_objects = __builtin__.property(_get_explicit_route_exclude_objects, _set_explicit_route_exclude_objects) + explicit_route_include_objects = __builtin__.property(_get_explicit_route_include_objects, _set_explicit_route_include_objects) + + __choices__ = {'algorithm': {'metric': ['metric_type', 'weight', 'explicit_route_exclude_objects', 'explicit_route_include_objects']}} + _pyangbind_elements = OrderedDict([('metric_type', metric_type), ('weight', weight), ('explicit_route_exclude_objects', explicit_route_exclude_objects), ('explicit_route_include_objects', explicit_route_include_objects), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..07c1656b94e5163d64b0f1036db0f8140e211e9c --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/__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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 route_object_exclude_object +class explicit_route_exclude_objects(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/connectivity-matrix/optimizations/optimization-metric/explicit-route-exclude-objects. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Container for the 'exclude route' object list. + """ + __slots__ = ('_path_helper', '_extmethods', '__route_object_exclude_object',) + + _yang_name = 'explicit-route-exclude-objects' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__route_object_exclude_object = YANGDynClass(base=YANGListType("index",route_object_exclude_object.route_object_exclude_object, yang_name="route-object-exclude-object", parent=self, is_container='list', user_ordered=True, path_helper=self._path_helper, yang_keys='index', extensions=None, choice=('algorithm', 'metric')), is_container='list', yang_name="route-object-exclude-object", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-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 ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'connectivity-matrix', 'optimizations', 'optimization-metric', 'explicit-route-exclude-objects'] + + def _get_route_object_exclude_object(self): + """ + Getter method for route_object_exclude_object, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object (list) + + YANG Description: List of Explicit Route Objects to be excluded in the +path computation. + """ + return self.__route_object_exclude_object + + def _set_route_object_exclude_object(self, v, load=False): + """ + Setter method for route_object_exclude_object, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_route_object_exclude_object is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_route_object_exclude_object() directly. + + YANG Description: List of Explicit Route Objects to be excluded in the +path computation. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("index",route_object_exclude_object.route_object_exclude_object, yang_name="route-object-exclude-object", parent=self, is_container='list', user_ordered=True, path_helper=self._path_helper, yang_keys='index', extensions=None, choice=('algorithm', 'metric')), is_container='list', yang_name="route-object-exclude-object", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """route_object_exclude_object must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("index",route_object_exclude_object.route_object_exclude_object, yang_name="route-object-exclude-object", parent=self, is_container='list', user_ordered=True, path_helper=self._path_helper, yang_keys='index', extensions=None, choice=('algorithm', 'metric')), is_container='list', yang_name="route-object-exclude-object", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True)""", + }) + + self.__route_object_exclude_object = t + if hasattr(self, '_set'): + self._set() + + def _unset_route_object_exclude_object(self): + self.__route_object_exclude_object = YANGDynClass(base=YANGListType("index",route_object_exclude_object.route_object_exclude_object, yang_name="route-object-exclude-object", parent=self, is_container='list', user_ordered=True, path_helper=self._path_helper, yang_keys='index', extensions=None, choice=('algorithm', 'metric')), is_container='list', yang_name="route-object-exclude-object", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + + route_object_exclude_object = __builtin__.property(_get_route_object_exclude_object, _set_route_object_exclude_object) + + __choices__ = {'algorithm': {'metric': ['route_object_exclude_object']}} + _pyangbind_elements = OrderedDict([('route_object_exclude_object', route_object_exclude_object), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..4a4f8fd0f12da75083b300b981aecd2de0064135 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/__init__.py @@ -0,0 +1,365 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 numbered_node_hop +from . import numbered_link_hop +from . import unnumbered_link_hop +from . import as_number_hop +from . import label_hop +from . import srlg +class route_object_exclude_object(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/connectivity-matrix/optimizations/optimization-metric/explicit-route-exclude-objects/route-object-exclude-object. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: List of Explicit Route Objects to be excluded in the +path computation. + """ + __slots__ = ('_path_helper', '_extmethods', '__index','__numbered_node_hop','__numbered_link_hop','__unnumbered_link_hop','__as_number_hop','__label_hop','__srlg',) + + _yang_name = 'route-object-exclude-object' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _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), is_leaf=True, yang_name="index", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + self.__numbered_node_hop = YANGDynClass(base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__numbered_link_hop = YANGDynClass(base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__unnumbered_link_hop = YANGDynClass(base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__as_number_hop = YANGDynClass(base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__label_hop = YANGDynClass(base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__srlg = YANGDynClass(base=srlg.srlg, is_container='container', yang_name="srlg", parent=self, choice=('type', 'srlg'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-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 ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'connectivity-matrix', 'optimizations', 'optimization-metric', 'explicit-route-exclude-objects', 'route-object-exclude-object'] + + def _get_index(self): + """ + Getter method for index, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/index (uint32) + + YANG Description: Route object entry index. The index is used to +identify an entry in the list. The order of entries +is defined by the user without relying on key values. + """ + return self.__index + + def _set_index(self, v, load=False): + """ + Setter method for index, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/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: Route object entry index. The index is used to +identify an entry in the list. The order of entries +is defined by the user without relying on key values. + """ + 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=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="index", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', 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), is_leaf=True, yang_name="index", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', 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), is_leaf=True, yang_name="index", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + + + def _get_numbered_node_hop(self): + """ + Getter method for numbered_node_hop, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/numbered_node_hop (container) + + YANG Description: Numbered node route hop. + """ + return self.__numbered_node_hop + + def _set_numbered_node_hop(self, v, load=False): + """ + Setter method for numbered_node_hop, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/numbered_node_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_numbered_node_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_numbered_node_hop() directly. + + YANG Description: Numbered node route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """numbered_node_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__numbered_node_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_numbered_node_hop(self): + self.__numbered_node_hop = YANGDynClass(base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_numbered_link_hop(self): + """ + Getter method for numbered_link_hop, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/numbered_link_hop (container) + + YANG Description: Numbered link explicit route hop. + """ + return self.__numbered_link_hop + + def _set_numbered_link_hop(self, v, load=False): + """ + Setter method for numbered_link_hop, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/numbered_link_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_numbered_link_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_numbered_link_hop() directly. + + YANG Description: Numbered link explicit route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """numbered_link_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__numbered_link_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_numbered_link_hop(self): + self.__numbered_link_hop = YANGDynClass(base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_unnumbered_link_hop(self): + """ + Getter method for unnumbered_link_hop, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/unnumbered_link_hop (container) + + YANG Description: Unnumbered link explicit route hop. + """ + return self.__unnumbered_link_hop + + def _set_unnumbered_link_hop(self, v, load=False): + """ + Setter method for unnumbered_link_hop, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/unnumbered_link_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_unnumbered_link_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_unnumbered_link_hop() directly. + + YANG Description: Unnumbered link explicit route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """unnumbered_link_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__unnumbered_link_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_unnumbered_link_hop(self): + self.__unnumbered_link_hop = YANGDynClass(base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_as_number_hop(self): + """ + Getter method for as_number_hop, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/as_number_hop (container) + + YANG Description: AS explicit route hop. + """ + return self.__as_number_hop + + def _set_as_number_hop(self, v, load=False): + """ + Setter method for as_number_hop, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/as_number_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_as_number_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_as_number_hop() directly. + + YANG Description: AS explicit route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """as_number_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__as_number_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_as_number_hop(self): + self.__as_number_hop = YANGDynClass(base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_label_hop(self): + """ + Getter method for label_hop, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop (container) + + YANG Description: Label hop type. + """ + return self.__label_hop + + def _set_label_hop(self, v, load=False): + """ + Setter method for label_hop, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_label_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_label_hop() directly. + + YANG Description: Label hop type. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """label_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__label_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_label_hop(self): + self.__label_hop = YANGDynClass(base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_srlg(self): + """ + Getter method for srlg, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/srlg (container) + + YANG Description: SRLG container. + """ + return self.__srlg + + def _set_srlg(self, v, load=False): + """ + Setter method for srlg, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/srlg (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_srlg is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_srlg() directly. + + YANG Description: SRLG container. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=srlg.srlg, is_container='container', yang_name="srlg", parent=self, choice=('type', 'srlg'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """srlg must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=srlg.srlg, is_container='container', yang_name="srlg", parent=self, choice=('type', 'srlg'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__srlg = t + if hasattr(self, '_set'): + self._set() + + def _unset_srlg(self): + self.__srlg = YANGDynClass(base=srlg.srlg, is_container='container', yang_name="srlg", parent=self, choice=('type', 'srlg'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + index = __builtin__.property(_get_index, _set_index) + numbered_node_hop = __builtin__.property(_get_numbered_node_hop, _set_numbered_node_hop) + numbered_link_hop = __builtin__.property(_get_numbered_link_hop, _set_numbered_link_hop) + unnumbered_link_hop = __builtin__.property(_get_unnumbered_link_hop, _set_unnumbered_link_hop) + as_number_hop = __builtin__.property(_get_as_number_hop, _set_as_number_hop) + label_hop = __builtin__.property(_get_label_hop, _set_label_hop) + srlg = __builtin__.property(_get_srlg, _set_srlg) + + __choices__ = {'algorithm': {'metric': ['index']}, 'type': {'numbered-node-hop': ['numbered_node_hop'], 'numbered-link-hop': ['numbered_link_hop'], 'unnumbered-link-hop': ['unnumbered_link_hop'], 'as-number': ['as_number_hop'], 'label': ['label_hop'], 'srlg': ['srlg']}} + _pyangbind_elements = OrderedDict([('index', index), ('numbered_node_hop', numbered_node_hop), ('numbered_link_hop', numbered_link_hop), ('unnumbered_link_hop', unnumbered_link_hop), ('as_number_hop', as_number_hop), ('label_hop', label_hop), ('srlg', srlg), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/as_number_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/as_number_hop/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..783159e5730b33eac6bc37c7fb7b130788e48fa7 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/as_number_hop/__init__.py @@ -0,0 +1,154 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 as_number_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/connectivity-matrix/optimizations/optimization-metric/explicit-route-exclude-objects/route-object-exclude-object/as-number-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: AS explicit route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__as_number','__hop_type',) + + _yang_name = 'as-number-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__as_number = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=True) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', 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 ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'connectivity-matrix', 'optimizations', 'optimization-metric', 'explicit-route-exclude-objects', 'route-object-exclude-object', 'as-number-hop'] + + def _get_as_number(self): + """ + Getter method for as_number, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/as_number_hop/as_number (inet:as-number) + + YANG Description: The Autonomous System (AS) number. + """ + return self.__as_number + + def _set_as_number(self, v, load=False): + """ + Setter method for as_number, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/as_number_hop/as_number (inet:as-number) + If this variable is read-only (config: false) in the + source YANG file, then _set_as_number is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_as_number() directly. + + YANG Description: The Autonomous System (AS) number. + """ + 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="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """as_number must be of a type compatible with inet:as-number""", + 'defined-type': "inet:as-number", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=True)""", + }) + + self.__as_number = t + if hasattr(self, '_set'): + self._set() + + def _unset_as_number(self): + self.__as_number = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=True) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/as_number_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/as_number_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + 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={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + + as_number = __builtin__.property(_get_as_number, _set_as_number) + hop_type = __builtin__.property(_get_hop_type, _set_hop_type) + + __choices__ = {'type': {'as-number': ['as_number', 'hop_type']}} + _pyangbind_elements = OrderedDict([('as_number', as_number), ('hop_type', hop_type), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..484b23ab16d64fc2e85f2a08d5088a4b720612e7 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/__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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 te_label +class label_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/connectivity-matrix/optimizations/optimization-metric/explicit-route-exclude-objects/route-object-exclude-object/label-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Label hop type. + """ + __slots__ = ('_path_helper', '_extmethods', '__te_label',) + + _yang_name = 'label-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__te_label = YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-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 ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'connectivity-matrix', 'optimizations', 'optimization-metric', 'explicit-route-exclude-objects', 'route-object-exclude-object', 'label-hop'] + + def _get_te_label(self): + """ + Getter method for te_label, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label (container) + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + return self.__te_label + + def _set_te_label(self, v, load=False): + """ + Setter method for te_label, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_te_label is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_te_label() directly. + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """te_label must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__te_label = t + if hasattr(self, '_set'): + self._set() + + def _unset_te_label(self): + self.__te_label = YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + te_label = __builtin__.property(_get_te_label, _set_te_label) + + __choices__ = {'type': {'label': ['te_label']}} + _pyangbind_elements = OrderedDict([('te_label', te_label), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..6b55fb4219df570ca7341320f33241bc39119aa6 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label/__init__.py @@ -0,0 +1,234 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 otn +class te_label(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/connectivity-matrix/optimizations/optimization-metric/explicit-route-exclude-objects/route-object-exclude-object/label-hop/te-label. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + __slots__ = ('_path_helper', '_extmethods', '__generic','__otn','__vlanid','__direction',) + + _yang_name = 'te-label' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__generic = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True) + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + self.__vlanid = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True) + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', 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 ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'connectivity-matrix', 'optimizations', 'optimization-metric', 'explicit-route-exclude-objects', 'route-object-exclude-object', 'label-hop', 'te-label'] + + def _get_generic(self): + """ + Getter method for generic, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label/generic (rt-types:generalized-label) + + YANG Description: TE label specified in a generic format. + """ + return self.__generic + + def _set_generic(self, v, load=False): + """ + Setter method for generic, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label/generic (rt-types:generalized-label) + If this variable is read-only (config: false) in the + source YANG file, then _set_generic is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_generic() directly. + + YANG Description: TE label specified in a generic format. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """generic must be of a type compatible with rt-types:generalized-label""", + 'defined-type': "rt-types:generalized-label", + 'generated-type': """YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True)""", + }) + + self.__generic = t + if hasattr(self, '_set'): + self._set() + + def _unset_generic(self): + self.__generic = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True) + + + def _get_otn(self): + """ + Getter method for otn, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label/otn (container) + + YANG Description: Label hop for OTN. + """ + return self.__otn + + def _set_otn(self, v, load=False): + """ + Setter method for otn, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label/otn (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_otn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_otn() directly. + + YANG Description: Label hop for OTN. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """otn must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True)""", + }) + + self.__otn = t + if hasattr(self, '_set'): + self._set() + + def _unset_otn(self): + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + + + def _get_vlanid(self): + """ + Getter method for vlanid, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label/vlanid (etht-types:vlanid) + + YANG Description: VLAN tag id. + """ + return self.__vlanid + + def _set_vlanid(self, v, load=False): + """ + Setter method for vlanid, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label/vlanid (etht-types:vlanid) + If this variable is read-only (config: false) in the + source YANG file, then _set_vlanid is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_vlanid() directly. + + YANG Description: VLAN tag id. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """vlanid must be of a type compatible with etht-types:vlanid""", + 'defined-type': "etht-types:vlanid", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True)""", + }) + + self.__vlanid = t + if hasattr(self, '_set'): + self._set() + + def _unset_vlanid(self): + self.__vlanid = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True) + + + def _get_direction(self): + """ + Getter method for direction, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label/direction (te-label-direction) + + YANG Description: Label direction. + """ + return self.__direction + + def _set_direction(self, v, load=False): + """ + Setter method for direction, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label/direction (te-label-direction) + If this variable is read-only (config: false) in the + source YANG file, then _set_direction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_direction() directly. + + YANG Description: Label direction. + """ + 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={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """direction must be of a type compatible with te-label-direction""", + 'defined-type': "ietf-te-topology:te-label-direction", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=True)""", + }) + + self.__direction = t + if hasattr(self, '_set'): + self._set() + + def _unset_direction(self): + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=True) + + generic = __builtin__.property(_get_generic, _set_generic) + otn = __builtin__.property(_get_otn, _set_otn) + vlanid = __builtin__.property(_get_vlanid, _set_vlanid) + direction = __builtin__.property(_get_direction, _set_direction) + + __choices__ = {'technology': {'generic': ['generic'], 'otn': ['otn'], 'eth': ['vlanid']}, 'type': {'label': ['direction']}} + _pyangbind_elements = OrderedDict([('generic', generic), ('otn', otn), ('vlanid', vlanid), ('direction', direction), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label/otn/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label/otn/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..f11e3324ce91e692a6c2fd4cc46910282ee81a24 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label/otn/__init__.py @@ -0,0 +1,209 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 otn(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/connectivity-matrix/optimizations/optimization-metric/explicit-route-exclude-objects/route-object-exclude-object/label-hop/te-label/otn. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Label hop for OTN. + """ + __slots__ = ('_path_helper', '_extmethods', '__tpn','__tsg','__ts_list',) + + _yang_name = 'otn' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__tpn = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True) + self.__tsg = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + self.__ts_list = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-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 ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'connectivity-matrix', 'optimizations', 'optimization-metric', 'explicit-route-exclude-objects', 'route-object-exclude-object', 'label-hop', 'te-label', 'otn'] + + def _get_tpn(self): + """ + Getter method for tpn, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label/otn/tpn (otn-tpn) + + YANG Description: Tributary Port Number (TPN). + """ + return self.__tpn + + def _set_tpn(self, v, load=False): + """ + Setter method for tpn, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label/otn/tpn (otn-tpn) + If this variable is read-only (config: false) in the + source YANG file, then _set_tpn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tpn() directly. + + YANG Description: Tributary Port Number (TPN). + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tpn must be of a type compatible with otn-tpn""", + 'defined-type': "ietf-otn-topology:otn-tpn", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True)""", + }) + + self.__tpn = t + if hasattr(self, '_set'): + self._set() + + def _unset_tpn(self): + self.__tpn = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True) + + + def _get_tsg(self): + """ + Getter method for tsg, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label/otn/tsg (identityref) + + YANG Description: Tributary Slot Granularity (TSG). + """ + return self.__tsg + + def _set_tsg(self, v, load=False): + """ + Setter method for tsg, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label/otn/tsg (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_tsg is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tsg() directly. + + YANG Description: Tributary Slot Granularity (TSG). + """ + 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={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tsg must be of a type compatible with identityref""", + 'defined-type': "ietf-otn-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True)""", + }) + + self.__tsg = t + if hasattr(self, '_set'): + self._set() + + def _unset_tsg(self): + self.__tsg = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + + + def _get_ts_list(self): + """ + Getter method for ts_list, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label/otn/ts_list (string) + + YANG Description: A list of available Tributary Slots (TS) ranging + + + + +between 1 and 4095. If multiple values or +ranges are given, they all MUST be disjoint +and MUST be in ascending order. +For example 1-20,25,50-1000. + """ + return self.__ts_list + + def _set_ts_list(self, v, load=False): + """ + Setter method for ts_list, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label/otn/ts_list (string) + If this variable is read-only (config: false) in the + source YANG file, then _set_ts_list is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_ts_list() directly. + + YANG Description: A list of available Tributary Slots (TS) ranging + + + + +between 1 and 4095. If multiple values or +ranges are given, they all MUST be disjoint +and MUST be in ascending order. +For example 1-20,25,50-1000. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='string', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """ts_list must be of a type compatible with string""", + 'defined-type': "string", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='string', is_config=True)""", + }) + + self.__ts_list = t + if hasattr(self, '_set'): + self._set() + + def _unset_ts_list(self): + self.__ts_list = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='string', is_config=True) + + tpn = __builtin__.property(_get_tpn, _set_tpn) + tsg = __builtin__.property(_get_tsg, _set_tsg) + ts_list = __builtin__.property(_get_ts_list, _set_ts_list) + + __choices__ = {'technology': {'otn': ['tpn', 'tsg', 'ts_list']}} + _pyangbind_elements = OrderedDict([('tpn', tpn), ('tsg', tsg), ('ts_list', ts_list), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/numbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/numbered_link_hop/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..80a217af8cb58e9e70d92e7a00bce21021124e1c --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/numbered_link_hop/__init__.py @@ -0,0 +1,193 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 numbered_link_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/connectivity-matrix/optimizations/optimization-metric/explicit-route-exclude-objects/route-object-exclude-object/numbered-link-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Numbered link explicit route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__link_tp_id','__hop_type','__direction',) + + _yang_name = 'numbered-link-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', 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 ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'connectivity-matrix', 'optimizations', 'optimization-metric', 'explicit-route-exclude-objects', 'route-object-exclude-object', 'numbered-link-hop'] + + def _get_link_tp_id(self): + """ + Getter method for link_tp_id, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/numbered_link_hop/link_tp_id (te-tp-id) + + YANG Description: TE Link Termination Point (LTP) identifier. + """ + return self.__link_tp_id + + def _set_link_tp_id(self, v, load=False): + """ + Setter method for link_tp_id, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/numbered_link_hop/link_tp_id (te-tp-id) + If this variable is read-only (config: false) in the + source YANG file, then _set_link_tp_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_link_tp_id() directly. + + YANG Description: TE Link Termination Point (LTP) identifier. + """ + 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),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """link_tp_id must be of a type compatible with te-tp-id""", + 'defined-type': "ietf-te-topology:te-tp-id", + 'generated-type': """YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True)""", + }) + + self.__link_tp_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_link_tp_id(self): + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/numbered_link_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/numbered_link_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + 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={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + + + def _get_direction(self): + """ + Getter method for direction, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/numbered_link_hop/direction (te-link-direction) + + YANG Description: Link route object direction. + """ + return self.__direction + + def _set_direction(self, v, load=False): + """ + Setter method for direction, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/numbered_link_hop/direction (te-link-direction) + If this variable is read-only (config: false) in the + source YANG file, then _set_direction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_direction() directly. + + YANG Description: Link route object direction. + """ + 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={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """direction must be of a type compatible with te-link-direction""", + 'defined-type': "ietf-te-topology:te-link-direction", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True)""", + }) + + self.__direction = t + if hasattr(self, '_set'): + self._set() + + def _unset_direction(self): + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True) + + link_tp_id = __builtin__.property(_get_link_tp_id, _set_link_tp_id) + hop_type = __builtin__.property(_get_hop_type, _set_hop_type) + direction = __builtin__.property(_get_direction, _set_direction) + + __choices__ = {'type': {'numbered-link-hop': ['link_tp_id', 'hop_type', 'direction']}} + _pyangbind_elements = OrderedDict([('link_tp_id', link_tp_id), ('hop_type', hop_type), ('direction', direction), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/numbered_node_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/numbered_node_hop/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..694b6a3c1719ef194c93b7968abed77ee1a6bf4d --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/numbered_node_hop/__init__.py @@ -0,0 +1,154 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 numbered_node_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/connectivity-matrix/optimizations/optimization-metric/explicit-route-exclude-objects/route-object-exclude-object/numbered-node-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Numbered node route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__node_id','__hop_type',) + + _yang_name = 'numbered-node-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', 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 ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'connectivity-matrix', 'optimizations', 'optimization-metric', 'explicit-route-exclude-objects', 'route-object-exclude-object', 'numbered-node-hop'] + + def _get_node_id(self): + """ + Getter method for node_id, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/numbered_node_hop/node_id (te-node-id) + + YANG Description: The identifier of a node in the TE topology. + """ + return self.__node_id + + def _set_node_id(self, v, load=False): + """ + Setter method for node_id, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/numbered_node_hop/node_id (te-node-id) + 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. + + YANG Description: The identifier of a node in the TE topology. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """node_id must be of a type compatible with te-node-id""", + 'defined-type': "ietf-te-topology:te-node-id", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True)""", + }) + + self.__node_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_node_id(self): + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/numbered_node_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/numbered_node_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + 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={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + + node_id = __builtin__.property(_get_node_id, _set_node_id) + hop_type = __builtin__.property(_get_hop_type, _set_hop_type) + + __choices__ = {'type': {'numbered-node-hop': ['node_id', 'hop_type']}} + _pyangbind_elements = OrderedDict([('node_id', node_id), ('hop_type', hop_type), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/srlg/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/srlg/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..9a858772ed1f5c20466f998285c289d49b639c1c --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/srlg/__init__.py @@ -0,0 +1,115 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 srlg(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/connectivity-matrix/optimizations/optimization-metric/explicit-route-exclude-objects/route-object-exclude-object/srlg. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: SRLG container. + """ + __slots__ = ('_path_helper', '_extmethods', '__srlg',) + + _yang_name = 'srlg' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__srlg = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="srlg", parent=self, choice=('type', 'srlg'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', 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 ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'connectivity-matrix', 'optimizations', 'optimization-metric', 'explicit-route-exclude-objects', 'route-object-exclude-object', 'srlg'] + + def _get_srlg(self): + """ + Getter method for srlg, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/srlg/srlg (uint32) + + YANG Description: SRLG value. + """ + return self.__srlg + + def _set_srlg(self, v, load=False): + """ + Setter method for srlg, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/srlg/srlg (uint32) + If this variable is read-only (config: false) in the + source YANG file, then _set_srlg is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_srlg() directly. + + YANG Description: SRLG value. + """ + 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="srlg", parent=self, choice=('type', 'srlg'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """srlg 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="srlg", parent=self, choice=('type', 'srlg'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True)""", + }) + + self.__srlg = t + if hasattr(self, '_set'): + self._set() + + def _unset_srlg(self): + self.__srlg = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="srlg", parent=self, choice=('type', 'srlg'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + + srlg = __builtin__.property(_get_srlg, _set_srlg) + + __choices__ = {'type': {'srlg': ['srlg']}} + _pyangbind_elements = OrderedDict([('srlg', srlg), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/unnumbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/unnumbered_link_hop/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..4a0e2b21eb3ac9bffbea75fc9506ea0515a143ef --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/unnumbered_link_hop/__init__.py @@ -0,0 +1,236 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 unnumbered_link_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/connectivity-matrix/optimizations/optimization-metric/explicit-route-exclude-objects/route-object-exclude-object/unnumbered-link-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Unnumbered link explicit route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__link_tp_id','__node_id','__hop_type','__direction',) + + _yang_name = 'unnumbered-link-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True) + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', 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 ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'connectivity-matrix', 'optimizations', 'optimization-metric', 'explicit-route-exclude-objects', 'route-object-exclude-object', 'unnumbered-link-hop'] + + def _get_link_tp_id(self): + """ + Getter method for link_tp_id, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/unnumbered_link_hop/link_tp_id (te-tp-id) + + YANG Description: TE LTP identifier. The combination of the TE link ID +and the TE node ID is used to identify an unnumbered +TE link. + """ + return self.__link_tp_id + + def _set_link_tp_id(self, v, load=False): + """ + Setter method for link_tp_id, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/unnumbered_link_hop/link_tp_id (te-tp-id) + If this variable is read-only (config: false) in the + source YANG file, then _set_link_tp_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_link_tp_id() directly. + + YANG Description: TE LTP identifier. The combination of the TE link ID +and the TE node ID is used to identify an unnumbered +TE link. + """ + 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),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """link_tp_id must be of a type compatible with te-tp-id""", + 'defined-type': "ietf-te-topology:te-tp-id", + 'generated-type': """YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True)""", + }) + + self.__link_tp_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_link_tp_id(self): + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True) + + + def _get_node_id(self): + """ + Getter method for node_id, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/unnumbered_link_hop/node_id (te-node-id) + + YANG Description: The identifier of a node in the TE topology. + """ + return self.__node_id + + def _set_node_id(self, v, load=False): + """ + Setter method for node_id, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/unnumbered_link_hop/node_id (te-node-id) + 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. + + YANG Description: The identifier of a node in the TE topology. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """node_id must be of a type compatible with te-node-id""", + 'defined-type': "ietf-te-topology:te-node-id", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True)""", + }) + + self.__node_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_node_id(self): + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/unnumbered_link_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/unnumbered_link_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + 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={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + + + def _get_direction(self): + """ + Getter method for direction, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/unnumbered_link_hop/direction (te-link-direction) + + YANG Description: Link route object direction. + """ + return self.__direction + + def _set_direction(self, v, load=False): + """ + Setter method for direction, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/unnumbered_link_hop/direction (te-link-direction) + If this variable is read-only (config: false) in the + source YANG file, then _set_direction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_direction() directly. + + YANG Description: Link route object direction. + """ + 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={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """direction must be of a type compatible with te-link-direction""", + 'defined-type': "ietf-te-topology:te-link-direction", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True)""", + }) + + self.__direction = t + if hasattr(self, '_set'): + self._set() + + def _unset_direction(self): + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True) + + link_tp_id = __builtin__.property(_get_link_tp_id, _set_link_tp_id) + node_id = __builtin__.property(_get_node_id, _set_node_id) + hop_type = __builtin__.property(_get_hop_type, _set_hop_type) + direction = __builtin__.property(_get_direction, _set_direction) + + __choices__ = {'type': {'unnumbered-link-hop': ['link_tp_id', 'node_id', 'hop_type', 'direction']}} + _pyangbind_elements = OrderedDict([('link_tp_id', link_tp_id), ('node_id', node_id), ('hop_type', hop_type), ('direction', direction), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..cea85916d33dd2fabc77825f73e881e870076464 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/__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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 route_object_include_object +class explicit_route_include_objects(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/connectivity-matrix/optimizations/optimization-metric/explicit-route-include-objects. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Container for the 'include route' object list. + """ + __slots__ = ('_path_helper', '_extmethods', '__route_object_include_object',) + + _yang_name = 'explicit-route-include-objects' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__route_object_include_object = YANGDynClass(base=YANGListType("index",route_object_include_object.route_object_include_object, yang_name="route-object-include-object", parent=self, is_container='list', user_ordered=True, path_helper=self._path_helper, yang_keys='index', extensions=None, choice=('algorithm', 'metric')), is_container='list', yang_name="route-object-include-object", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-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 ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'connectivity-matrix', 'optimizations', 'optimization-metric', 'explicit-route-include-objects'] + + def _get_route_object_include_object(self): + """ + Getter method for route_object_include_object, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object (list) + + YANG Description: List of Explicit Route Objects to be included in the +path computation. + """ + return self.__route_object_include_object + + def _set_route_object_include_object(self, v, load=False): + """ + Setter method for route_object_include_object, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_route_object_include_object is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_route_object_include_object() directly. + + YANG Description: List of Explicit Route Objects to be included in the +path computation. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("index",route_object_include_object.route_object_include_object, yang_name="route-object-include-object", parent=self, is_container='list', user_ordered=True, path_helper=self._path_helper, yang_keys='index', extensions=None, choice=('algorithm', 'metric')), is_container='list', yang_name="route-object-include-object", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """route_object_include_object must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("index",route_object_include_object.route_object_include_object, yang_name="route-object-include-object", parent=self, is_container='list', user_ordered=True, path_helper=self._path_helper, yang_keys='index', extensions=None, choice=('algorithm', 'metric')), is_container='list', yang_name="route-object-include-object", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True)""", + }) + + self.__route_object_include_object = t + if hasattr(self, '_set'): + self._set() + + def _unset_route_object_include_object(self): + self.__route_object_include_object = YANGDynClass(base=YANGListType("index",route_object_include_object.route_object_include_object, yang_name="route-object-include-object", parent=self, is_container='list', user_ordered=True, path_helper=self._path_helper, yang_keys='index', extensions=None, choice=('algorithm', 'metric')), is_container='list', yang_name="route-object-include-object", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + + route_object_include_object = __builtin__.property(_get_route_object_include_object, _set_route_object_include_object) + + __choices__ = {'algorithm': {'metric': ['route_object_include_object']}} + _pyangbind_elements = OrderedDict([('route_object_include_object', route_object_include_object), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..1330f425e854ef75382319b9f405d41eb70e5c33 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/__init__.py @@ -0,0 +1,325 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 numbered_node_hop +from . import numbered_link_hop +from . import unnumbered_link_hop +from . import as_number_hop +from . import label_hop +class route_object_include_object(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/connectivity-matrix/optimizations/optimization-metric/explicit-route-include-objects/route-object-include-object. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: List of Explicit Route Objects to be included in the +path computation. + """ + __slots__ = ('_path_helper', '_extmethods', '__index','__numbered_node_hop','__numbered_link_hop','__unnumbered_link_hop','__as_number_hop','__label_hop',) + + _yang_name = 'route-object-include-object' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _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), is_leaf=True, yang_name="index", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + self.__numbered_node_hop = YANGDynClass(base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__numbered_link_hop = YANGDynClass(base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__unnumbered_link_hop = YANGDynClass(base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__as_number_hop = YANGDynClass(base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__label_hop = YANGDynClass(base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-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 ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'connectivity-matrix', 'optimizations', 'optimization-metric', 'explicit-route-include-objects', 'route-object-include-object'] + + def _get_index(self): + """ + Getter method for index, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/index (uint32) + + YANG Description: Route object entry index. The index is used to +identify an entry in the list. The order of entries +is defined by the user without relying on key values. + """ + return self.__index + + def _set_index(self, v, load=False): + """ + Setter method for index, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/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: Route object entry index. The index is used to +identify an entry in the list. The order of entries +is defined by the user without relying on key values. + """ + 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=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="index", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', 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), is_leaf=True, yang_name="index", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', 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), is_leaf=True, yang_name="index", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + + + def _get_numbered_node_hop(self): + """ + Getter method for numbered_node_hop, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/numbered_node_hop (container) + + YANG Description: Numbered node route hop. + """ + return self.__numbered_node_hop + + def _set_numbered_node_hop(self, v, load=False): + """ + Setter method for numbered_node_hop, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/numbered_node_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_numbered_node_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_numbered_node_hop() directly. + + YANG Description: Numbered node route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """numbered_node_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__numbered_node_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_numbered_node_hop(self): + self.__numbered_node_hop = YANGDynClass(base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_numbered_link_hop(self): + """ + Getter method for numbered_link_hop, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/numbered_link_hop (container) + + YANG Description: Numbered link explicit route hop. + """ + return self.__numbered_link_hop + + def _set_numbered_link_hop(self, v, load=False): + """ + Setter method for numbered_link_hop, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/numbered_link_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_numbered_link_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_numbered_link_hop() directly. + + YANG Description: Numbered link explicit route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """numbered_link_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__numbered_link_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_numbered_link_hop(self): + self.__numbered_link_hop = YANGDynClass(base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_unnumbered_link_hop(self): + """ + Getter method for unnumbered_link_hop, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/unnumbered_link_hop (container) + + YANG Description: Unnumbered link explicit route hop. + """ + return self.__unnumbered_link_hop + + def _set_unnumbered_link_hop(self, v, load=False): + """ + Setter method for unnumbered_link_hop, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/unnumbered_link_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_unnumbered_link_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_unnumbered_link_hop() directly. + + YANG Description: Unnumbered link explicit route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """unnumbered_link_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__unnumbered_link_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_unnumbered_link_hop(self): + self.__unnumbered_link_hop = YANGDynClass(base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_as_number_hop(self): + """ + Getter method for as_number_hop, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/as_number_hop (container) + + YANG Description: AS explicit route hop. + """ + return self.__as_number_hop + + def _set_as_number_hop(self, v, load=False): + """ + Setter method for as_number_hop, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/as_number_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_as_number_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_as_number_hop() directly. + + YANG Description: AS explicit route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """as_number_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__as_number_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_as_number_hop(self): + self.__as_number_hop = YANGDynClass(base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_label_hop(self): + """ + Getter method for label_hop, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop (container) + + YANG Description: Label hop type. + """ + return self.__label_hop + + def _set_label_hop(self, v, load=False): + """ + Setter method for label_hop, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_label_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_label_hop() directly. + + YANG Description: Label hop type. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """label_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__label_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_label_hop(self): + self.__label_hop = YANGDynClass(base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + index = __builtin__.property(_get_index, _set_index) + numbered_node_hop = __builtin__.property(_get_numbered_node_hop, _set_numbered_node_hop) + numbered_link_hop = __builtin__.property(_get_numbered_link_hop, _set_numbered_link_hop) + unnumbered_link_hop = __builtin__.property(_get_unnumbered_link_hop, _set_unnumbered_link_hop) + as_number_hop = __builtin__.property(_get_as_number_hop, _set_as_number_hop) + label_hop = __builtin__.property(_get_label_hop, _set_label_hop) + + __choices__ = {'algorithm': {'metric': ['index']}, 'type': {'numbered-node-hop': ['numbered_node_hop'], 'numbered-link-hop': ['numbered_link_hop'], 'unnumbered-link-hop': ['unnumbered_link_hop'], 'as-number': ['as_number_hop'], 'label': ['label_hop']}} + _pyangbind_elements = OrderedDict([('index', index), ('numbered_node_hop', numbered_node_hop), ('numbered_link_hop', numbered_link_hop), ('unnumbered_link_hop', unnumbered_link_hop), ('as_number_hop', as_number_hop), ('label_hop', label_hop), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/as_number_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/as_number_hop/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..edcea596e308c1626e8607c772d43cb059fb63a3 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/as_number_hop/__init__.py @@ -0,0 +1,154 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 as_number_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/connectivity-matrix/optimizations/optimization-metric/explicit-route-include-objects/route-object-include-object/as-number-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: AS explicit route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__as_number','__hop_type',) + + _yang_name = 'as-number-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__as_number = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=True) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', 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 ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'connectivity-matrix', 'optimizations', 'optimization-metric', 'explicit-route-include-objects', 'route-object-include-object', 'as-number-hop'] + + def _get_as_number(self): + """ + Getter method for as_number, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/as_number_hop/as_number (inet:as-number) + + YANG Description: The Autonomous System (AS) number. + """ + return self.__as_number + + def _set_as_number(self, v, load=False): + """ + Setter method for as_number, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/as_number_hop/as_number (inet:as-number) + If this variable is read-only (config: false) in the + source YANG file, then _set_as_number is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_as_number() directly. + + YANG Description: The Autonomous System (AS) number. + """ + 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="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """as_number must be of a type compatible with inet:as-number""", + 'defined-type': "inet:as-number", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=True)""", + }) + + self.__as_number = t + if hasattr(self, '_set'): + self._set() + + def _unset_as_number(self): + self.__as_number = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=True) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/as_number_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/as_number_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + 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={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + + as_number = __builtin__.property(_get_as_number, _set_as_number) + hop_type = __builtin__.property(_get_hop_type, _set_hop_type) + + __choices__ = {'type': {'as-number': ['as_number', 'hop_type']}} + _pyangbind_elements = OrderedDict([('as_number', as_number), ('hop_type', hop_type), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..20d876129a9cfc163b39aadd15711ed2d468f771 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/__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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 te_label +class label_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/connectivity-matrix/optimizations/optimization-metric/explicit-route-include-objects/route-object-include-object/label-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Label hop type. + """ + __slots__ = ('_path_helper', '_extmethods', '__te_label',) + + _yang_name = 'label-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__te_label = YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-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 ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'connectivity-matrix', 'optimizations', 'optimization-metric', 'explicit-route-include-objects', 'route-object-include-object', 'label-hop'] + + def _get_te_label(self): + """ + Getter method for te_label, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label (container) + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + return self.__te_label + + def _set_te_label(self, v, load=False): + """ + Setter method for te_label, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_te_label is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_te_label() directly. + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """te_label must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__te_label = t + if hasattr(self, '_set'): + self._set() + + def _unset_te_label(self): + self.__te_label = YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + te_label = __builtin__.property(_get_te_label, _set_te_label) + + __choices__ = {'type': {'label': ['te_label']}} + _pyangbind_elements = OrderedDict([('te_label', te_label), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..2f3c37938006ce87bdfc57fed9bb4db41aac38ef --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label/__init__.py @@ -0,0 +1,234 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 otn +class te_label(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/connectivity-matrix/optimizations/optimization-metric/explicit-route-include-objects/route-object-include-object/label-hop/te-label. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + __slots__ = ('_path_helper', '_extmethods', '__generic','__otn','__vlanid','__direction',) + + _yang_name = 'te-label' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__generic = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True) + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + self.__vlanid = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True) + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', 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 ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'connectivity-matrix', 'optimizations', 'optimization-metric', 'explicit-route-include-objects', 'route-object-include-object', 'label-hop', 'te-label'] + + def _get_generic(self): + """ + Getter method for generic, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label/generic (rt-types:generalized-label) + + YANG Description: TE label specified in a generic format. + """ + return self.__generic + + def _set_generic(self, v, load=False): + """ + Setter method for generic, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label/generic (rt-types:generalized-label) + If this variable is read-only (config: false) in the + source YANG file, then _set_generic is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_generic() directly. + + YANG Description: TE label specified in a generic format. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """generic must be of a type compatible with rt-types:generalized-label""", + 'defined-type': "rt-types:generalized-label", + 'generated-type': """YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True)""", + }) + + self.__generic = t + if hasattr(self, '_set'): + self._set() + + def _unset_generic(self): + self.__generic = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True) + + + def _get_otn(self): + """ + Getter method for otn, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label/otn (container) + + YANG Description: Label hop for OTN. + """ + return self.__otn + + def _set_otn(self, v, load=False): + """ + Setter method for otn, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label/otn (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_otn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_otn() directly. + + YANG Description: Label hop for OTN. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """otn must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True)""", + }) + + self.__otn = t + if hasattr(self, '_set'): + self._set() + + def _unset_otn(self): + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + + + def _get_vlanid(self): + """ + Getter method for vlanid, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label/vlanid (etht-types:vlanid) + + YANG Description: VLAN tag id. + """ + return self.__vlanid + + def _set_vlanid(self, v, load=False): + """ + Setter method for vlanid, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label/vlanid (etht-types:vlanid) + If this variable is read-only (config: false) in the + source YANG file, then _set_vlanid is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_vlanid() directly. + + YANG Description: VLAN tag id. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """vlanid must be of a type compatible with etht-types:vlanid""", + 'defined-type': "etht-types:vlanid", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True)""", + }) + + self.__vlanid = t + if hasattr(self, '_set'): + self._set() + + def _unset_vlanid(self): + self.__vlanid = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True) + + + def _get_direction(self): + """ + Getter method for direction, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label/direction (te-label-direction) + + YANG Description: Label direction. + """ + return self.__direction + + def _set_direction(self, v, load=False): + """ + Setter method for direction, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label/direction (te-label-direction) + If this variable is read-only (config: false) in the + source YANG file, then _set_direction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_direction() directly. + + YANG Description: Label direction. + """ + 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={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """direction must be of a type compatible with te-label-direction""", + 'defined-type': "ietf-te-topology:te-label-direction", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=True)""", + }) + + self.__direction = t + if hasattr(self, '_set'): + self._set() + + def _unset_direction(self): + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=True) + + generic = __builtin__.property(_get_generic, _set_generic) + otn = __builtin__.property(_get_otn, _set_otn) + vlanid = __builtin__.property(_get_vlanid, _set_vlanid) + direction = __builtin__.property(_get_direction, _set_direction) + + __choices__ = {'technology': {'generic': ['generic'], 'otn': ['otn'], 'eth': ['vlanid']}, 'type': {'label': ['direction']}} + _pyangbind_elements = OrderedDict([('generic', generic), ('otn', otn), ('vlanid', vlanid), ('direction', direction), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label/otn/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label/otn/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..d9361ab75303485dba5e4181cbdb263ebec3d64f --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label/otn/__init__.py @@ -0,0 +1,209 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 otn(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/connectivity-matrix/optimizations/optimization-metric/explicit-route-include-objects/route-object-include-object/label-hop/te-label/otn. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Label hop for OTN. + """ + __slots__ = ('_path_helper', '_extmethods', '__tpn','__tsg','__ts_list',) + + _yang_name = 'otn' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__tpn = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True) + self.__tsg = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + self.__ts_list = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-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 ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'connectivity-matrix', 'optimizations', 'optimization-metric', 'explicit-route-include-objects', 'route-object-include-object', 'label-hop', 'te-label', 'otn'] + + def _get_tpn(self): + """ + Getter method for tpn, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label/otn/tpn (otn-tpn) + + YANG Description: Tributary Port Number (TPN). + """ + return self.__tpn + + def _set_tpn(self, v, load=False): + """ + Setter method for tpn, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label/otn/tpn (otn-tpn) + If this variable is read-only (config: false) in the + source YANG file, then _set_tpn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tpn() directly. + + YANG Description: Tributary Port Number (TPN). + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tpn must be of a type compatible with otn-tpn""", + 'defined-type': "ietf-otn-topology:otn-tpn", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True)""", + }) + + self.__tpn = t + if hasattr(self, '_set'): + self._set() + + def _unset_tpn(self): + self.__tpn = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True) + + + def _get_tsg(self): + """ + Getter method for tsg, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label/otn/tsg (identityref) + + YANG Description: Tributary Slot Granularity (TSG). + """ + return self.__tsg + + def _set_tsg(self, v, load=False): + """ + Setter method for tsg, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label/otn/tsg (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_tsg is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tsg() directly. + + YANG Description: Tributary Slot Granularity (TSG). + """ + 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={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tsg must be of a type compatible with identityref""", + 'defined-type': "ietf-otn-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True)""", + }) + + self.__tsg = t + if hasattr(self, '_set'): + self._set() + + def _unset_tsg(self): + self.__tsg = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + + + def _get_ts_list(self): + """ + Getter method for ts_list, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label/otn/ts_list (string) + + YANG Description: A list of available Tributary Slots (TS) ranging + + + + +between 1 and 4095. If multiple values or +ranges are given, they all MUST be disjoint +and MUST be in ascending order. +For example 1-20,25,50-1000. + """ + return self.__ts_list + + def _set_ts_list(self, v, load=False): + """ + Setter method for ts_list, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label/otn/ts_list (string) + If this variable is read-only (config: false) in the + source YANG file, then _set_ts_list is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_ts_list() directly. + + YANG Description: A list of available Tributary Slots (TS) ranging + + + + +between 1 and 4095. If multiple values or +ranges are given, they all MUST be disjoint +and MUST be in ascending order. +For example 1-20,25,50-1000. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='string', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """ts_list must be of a type compatible with string""", + 'defined-type': "string", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='string', is_config=True)""", + }) + + self.__ts_list = t + if hasattr(self, '_set'): + self._set() + + def _unset_ts_list(self): + self.__ts_list = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='string', is_config=True) + + tpn = __builtin__.property(_get_tpn, _set_tpn) + tsg = __builtin__.property(_get_tsg, _set_tsg) + ts_list = __builtin__.property(_get_ts_list, _set_ts_list) + + __choices__ = {'technology': {'otn': ['tpn', 'tsg', 'ts_list']}} + _pyangbind_elements = OrderedDict([('tpn', tpn), ('tsg', tsg), ('ts_list', ts_list), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/numbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/numbered_link_hop/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e53b4266dbda6de34f5fae4186da419d8b942544 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/numbered_link_hop/__init__.py @@ -0,0 +1,193 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 numbered_link_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/connectivity-matrix/optimizations/optimization-metric/explicit-route-include-objects/route-object-include-object/numbered-link-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Numbered link explicit route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__link_tp_id','__hop_type','__direction',) + + _yang_name = 'numbered-link-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', 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 ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'connectivity-matrix', 'optimizations', 'optimization-metric', 'explicit-route-include-objects', 'route-object-include-object', 'numbered-link-hop'] + + def _get_link_tp_id(self): + """ + Getter method for link_tp_id, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/numbered_link_hop/link_tp_id (te-tp-id) + + YANG Description: TE Link Termination Point (LTP) identifier. + """ + return self.__link_tp_id + + def _set_link_tp_id(self, v, load=False): + """ + Setter method for link_tp_id, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/numbered_link_hop/link_tp_id (te-tp-id) + If this variable is read-only (config: false) in the + source YANG file, then _set_link_tp_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_link_tp_id() directly. + + YANG Description: TE Link Termination Point (LTP) identifier. + """ + 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),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """link_tp_id must be of a type compatible with te-tp-id""", + 'defined-type': "ietf-te-topology:te-tp-id", + 'generated-type': """YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True)""", + }) + + self.__link_tp_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_link_tp_id(self): + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/numbered_link_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/numbered_link_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + 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={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + + + def _get_direction(self): + """ + Getter method for direction, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/numbered_link_hop/direction (te-link-direction) + + YANG Description: Link route object direction. + """ + return self.__direction + + def _set_direction(self, v, load=False): + """ + Setter method for direction, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/numbered_link_hop/direction (te-link-direction) + If this variable is read-only (config: false) in the + source YANG file, then _set_direction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_direction() directly. + + YANG Description: Link route object direction. + """ + 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={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """direction must be of a type compatible with te-link-direction""", + 'defined-type': "ietf-te-topology:te-link-direction", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True)""", + }) + + self.__direction = t + if hasattr(self, '_set'): + self._set() + + def _unset_direction(self): + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True) + + link_tp_id = __builtin__.property(_get_link_tp_id, _set_link_tp_id) + hop_type = __builtin__.property(_get_hop_type, _set_hop_type) + direction = __builtin__.property(_get_direction, _set_direction) + + __choices__ = {'type': {'numbered-link-hop': ['link_tp_id', 'hop_type', 'direction']}} + _pyangbind_elements = OrderedDict([('link_tp_id', link_tp_id), ('hop_type', hop_type), ('direction', direction), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/numbered_node_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/numbered_node_hop/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..f49e95c2a23dbd8805bee95422c2749ed04b9e48 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/numbered_node_hop/__init__.py @@ -0,0 +1,154 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 numbered_node_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/connectivity-matrix/optimizations/optimization-metric/explicit-route-include-objects/route-object-include-object/numbered-node-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Numbered node route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__node_id','__hop_type',) + + _yang_name = 'numbered-node-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', 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 ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'connectivity-matrix', 'optimizations', 'optimization-metric', 'explicit-route-include-objects', 'route-object-include-object', 'numbered-node-hop'] + + def _get_node_id(self): + """ + Getter method for node_id, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/numbered_node_hop/node_id (te-node-id) + + YANG Description: The identifier of a node in the TE topology. + """ + return self.__node_id + + def _set_node_id(self, v, load=False): + """ + Setter method for node_id, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/numbered_node_hop/node_id (te-node-id) + 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. + + YANG Description: The identifier of a node in the TE topology. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """node_id must be of a type compatible with te-node-id""", + 'defined-type': "ietf-te-topology:te-node-id", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True)""", + }) + + self.__node_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_node_id(self): + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/numbered_node_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/numbered_node_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + 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={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + + node_id = __builtin__.property(_get_node_id, _set_node_id) + hop_type = __builtin__.property(_get_hop_type, _set_hop_type) + + __choices__ = {'type': {'numbered-node-hop': ['node_id', 'hop_type']}} + _pyangbind_elements = OrderedDict([('node_id', node_id), ('hop_type', hop_type), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/unnumbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/unnumbered_link_hop/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..f69f0f6b7fba906111181eaa9b1944a184f064d1 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/unnumbered_link_hop/__init__.py @@ -0,0 +1,236 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 unnumbered_link_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/connectivity-matrix/optimizations/optimization-metric/explicit-route-include-objects/route-object-include-object/unnumbered-link-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Unnumbered link explicit route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__link_tp_id','__node_id','__hop_type','__direction',) + + _yang_name = 'unnumbered-link-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True) + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', 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 ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'connectivity-matrix', 'optimizations', 'optimization-metric', 'explicit-route-include-objects', 'route-object-include-object', 'unnumbered-link-hop'] + + def _get_link_tp_id(self): + """ + Getter method for link_tp_id, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/unnumbered_link_hop/link_tp_id (te-tp-id) + + YANG Description: TE LTP identifier. The combination of the TE link ID +and the TE node ID is used to identify an unnumbered +TE link. + """ + return self.__link_tp_id + + def _set_link_tp_id(self, v, load=False): + """ + Setter method for link_tp_id, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/unnumbered_link_hop/link_tp_id (te-tp-id) + If this variable is read-only (config: false) in the + source YANG file, then _set_link_tp_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_link_tp_id() directly. + + YANG Description: TE LTP identifier. The combination of the TE link ID +and the TE node ID is used to identify an unnumbered +TE link. + """ + 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),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """link_tp_id must be of a type compatible with te-tp-id""", + 'defined-type': "ietf-te-topology:te-tp-id", + 'generated-type': """YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True)""", + }) + + self.__link_tp_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_link_tp_id(self): + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True) + + + def _get_node_id(self): + """ + Getter method for node_id, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/unnumbered_link_hop/node_id (te-node-id) + + YANG Description: The identifier of a node in the TE topology. + """ + return self.__node_id + + def _set_node_id(self, v, load=False): + """ + Setter method for node_id, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/unnumbered_link_hop/node_id (te-node-id) + 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. + + YANG Description: The identifier of a node in the TE topology. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """node_id must be of a type compatible with te-node-id""", + 'defined-type': "ietf-te-topology:te-node-id", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True)""", + }) + + self.__node_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_node_id(self): + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/unnumbered_link_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/unnumbered_link_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + 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={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + + + def _get_direction(self): + """ + Getter method for direction, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/unnumbered_link_hop/direction (te-link-direction) + + YANG Description: Link route object direction. + """ + return self.__direction + + def _set_direction(self, v, load=False): + """ + Setter method for direction, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/unnumbered_link_hop/direction (te-link-direction) + If this variable is read-only (config: false) in the + source YANG file, then _set_direction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_direction() directly. + + YANG Description: Link route object direction. + """ + 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={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """direction must be of a type compatible with te-link-direction""", + 'defined-type': "ietf-te-topology:te-link-direction", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True)""", + }) + + self.__direction = t + if hasattr(self, '_set'): + self._set() + + def _unset_direction(self): + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True) + + link_tp_id = __builtin__.property(_get_link_tp_id, _set_link_tp_id) + node_id = __builtin__.property(_get_node_id, _set_node_id) + hop_type = __builtin__.property(_get_hop_type, _set_hop_type) + direction = __builtin__.property(_get_direction, _set_direction) + + __choices__ = {'type': {'unnumbered-link-hop': ['link_tp_id', 'node_id', 'hop_type', 'direction']}} + _pyangbind_elements = OrderedDict([('link_tp_id', link_tp_id), ('node_id', node_id), ('hop_type', hop_type), ('direction', direction), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/tiebreakers/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/tiebreakers/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e0333aee2a52bc97afcc680872104618a2e09197 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/tiebreakers/__init__.py @@ -0,0 +1,120 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 tiebreaker +class tiebreakers(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/connectivity-matrix/optimizations/tiebreakers. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Container for the list of tiebreakers. + """ + __slots__ = ('_path_helper', '_extmethods', '__tiebreaker',) + + _yang_name = 'tiebreakers' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__tiebreaker = YANGDynClass(base=YANGListType("tiebreaker_type",tiebreaker.tiebreaker, yang_name="tiebreaker", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='tiebreaker-type', extensions=None, choice=('algorithm', 'metric')), is_container='list', yang_name="tiebreaker", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-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 ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'connectivity-matrix', 'optimizations', 'tiebreakers'] + + def _get_tiebreaker(self): + """ + Getter method for tiebreaker, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/tiebreakers/tiebreaker (list) + + YANG Description: The list of tiebreaker criteria to apply on an +equally favored set of paths, in order to pick +the best. + """ + return self.__tiebreaker + + def _set_tiebreaker(self, v, load=False): + """ + Setter method for tiebreaker, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/tiebreakers/tiebreaker (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_tiebreaker is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tiebreaker() directly. + + YANG Description: The list of tiebreaker criteria to apply on an +equally favored set of paths, in order to pick +the best. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("tiebreaker_type",tiebreaker.tiebreaker, yang_name="tiebreaker", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='tiebreaker-type', extensions=None, choice=('algorithm', 'metric')), is_container='list', yang_name="tiebreaker", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tiebreaker must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("tiebreaker_type",tiebreaker.tiebreaker, yang_name="tiebreaker", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='tiebreaker-type', extensions=None, choice=('algorithm', 'metric')), is_container='list', yang_name="tiebreaker", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True)""", + }) + + self.__tiebreaker = t + if hasattr(self, '_set'): + self._set() + + def _unset_tiebreaker(self): + self.__tiebreaker = YANGDynClass(base=YANGListType("tiebreaker_type",tiebreaker.tiebreaker, yang_name="tiebreaker", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='tiebreaker-type', extensions=None, choice=('algorithm', 'metric')), is_container='list', yang_name="tiebreaker", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + + tiebreaker = __builtin__.property(_get_tiebreaker, _set_tiebreaker) + + __choices__ = {'algorithm': {'metric': ['tiebreaker']}} + _pyangbind_elements = OrderedDict([('tiebreaker', tiebreaker), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/tiebreakers/tiebreaker/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/tiebreakers/tiebreaker/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..26464cef2cce0bf13cf6b910a5363e5d24215b20 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/tiebreakers/tiebreaker/__init__.py @@ -0,0 +1,122 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 tiebreaker(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/connectivity-matrix/optimizations/tiebreakers/tiebreaker. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: The list of tiebreaker criteria to apply on an +equally favored set of paths, in order to pick +the best. + """ + __slots__ = ('_path_helper', '_extmethods', '__tiebreaker_type',) + + _yang_name = 'tiebreaker' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__tiebreaker_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="tiebreaker-type", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', 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 ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'connectivity-matrix', 'optimizations', 'tiebreakers', 'tiebreaker'] + + def _get_tiebreaker_type(self): + """ + Getter method for tiebreaker_type, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/tiebreakers/tiebreaker/tiebreaker_type (identityref) + + YANG Description: Identifies an entry in the list of tiebreakers. + """ + return self.__tiebreaker_type + + def _set_tiebreaker_type(self, v, load=False): + """ + Setter method for tiebreaker_type, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/tiebreakers/tiebreaker/tiebreaker_type (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_tiebreaker_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tiebreaker_type() directly. + + YANG Description: Identifies an entry in the list of tiebreakers. + """ + 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=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="tiebreaker-type", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tiebreaker_type must be of a type compatible with identityref""", + 'defined-type': "ietf-te-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="tiebreaker-type", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True)""", + }) + + self.__tiebreaker_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_tiebreaker_type(self): + self.__tiebreaker_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="tiebreaker-type", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + + tiebreaker_type = __builtin__.property(_get_tiebreaker_type, _set_tiebreaker_type) + + __choices__ = {'algorithm': {'metric': ['tiebreaker_type']}} + _pyangbind_elements = OrderedDict([('tiebreaker_type', tiebreaker_type), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..2b9f4b692f85c4789a24e5834c7eacdb19bb540f --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/__init__.py @@ -0,0 +1,523 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 te_bandwidth +from . import path_metric_bounds +from . import path_affinities_values +from . import path_affinity_names +from . import path_srlgs_lists +from . import path_srlgs_names +class path_constraints(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/connectivity-matrix/path-constraints. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: TE named path constraints container. + """ + __slots__ = ('_path_helper', '_extmethods', '__te_bandwidth','__link_protection','__setup_priority','__hold_priority','__signaling_type','__path_metric_bounds','__path_affinities_values','__path_affinity_names','__path_srlgs_lists','__path_srlgs_names','__disjointness',) + + _yang_name = 'path-constraints' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__te_bandwidth = YANGDynClass(base=te_bandwidth.te_bandwidth, is_container='container', yang_name="te-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__link_protection = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'link-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-shared': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-shared': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-shared': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-enhanced': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-enhanced': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-enhanced': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), default=six.text_type("te-types:link-protection-unprotected"), is_leaf=True, yang_name="link-protection", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + self.__setup_priority = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..7']}), default=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8)(7), is_leaf=True, yang_name="setup-priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint8', is_config=True) + self.__hold_priority = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..7']}), default=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8)(7), is_leaf=True, yang_name="hold-priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint8', is_config=True) + self.__signaling_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'path-setup-static': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-setup-static': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-setup-static': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-setup-rsvp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-setup-rsvp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-setup-rsvp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-setup-sr': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-setup-sr': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-setup-sr': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), default=six.text_type("te-types:path-setup-rsvp"), is_leaf=True, yang_name="signaling-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + self.__path_metric_bounds = YANGDynClass(base=path_metric_bounds.path_metric_bounds, is_container='container', yang_name="path-metric-bounds", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__path_affinities_values = YANGDynClass(base=path_affinities_values.path_affinities_values, is_container='container', yang_name="path-affinities-values", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__path_affinity_names = YANGDynClass(base=path_affinity_names.path_affinity_names, is_container='container', yang_name="path-affinity-names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__path_srlgs_lists = YANGDynClass(base=path_srlgs_lists.path_srlgs_lists, is_container='container', yang_name="path-srlgs-lists", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__path_srlgs_names = YANGDynClass(base=path_srlgs_names.path_srlgs_names, is_container='container', yang_name="path-srlgs-names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__disjointness = YANGDynClass(base=YANGBitsType(allowed_bits={'node': '0', 'link': '1', 'srlg': '2'}), is_leaf=True, yang_name="disjointness", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-path-disjointness', 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 ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'connectivity-matrix', 'path-constraints'] + + def _get_te_bandwidth(self): + """ + Getter method for te_bandwidth, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/te_bandwidth (container) + + YANG Description: Container that specifies TE bandwidth. The choices +can be augmented for specific data-plane technologies. + """ + return self.__te_bandwidth + + def _set_te_bandwidth(self, v, load=False): + """ + Setter method for te_bandwidth, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/te_bandwidth (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_te_bandwidth is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_te_bandwidth() directly. + + YANG Description: Container that specifies TE bandwidth. The choices +can be augmented for specific data-plane technologies. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=te_bandwidth.te_bandwidth, is_container='container', yang_name="te-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """te_bandwidth must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=te_bandwidth.te_bandwidth, is_container='container', yang_name="te-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__te_bandwidth = t + if hasattr(self, '_set'): + self._set() + + def _unset_te_bandwidth(self): + self.__te_bandwidth = YANGDynClass(base=te_bandwidth.te_bandwidth, is_container='container', yang_name="te-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_link_protection(self): + """ + Getter method for link_protection, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/link_protection (identityref) + + YANG Description: Link protection type required for the links included +in the computed path. + """ + return self.__link_protection + + def _set_link_protection(self, v, load=False): + """ + Setter method for link_protection, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/link_protection (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_link_protection is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_link_protection() directly. + + YANG Description: Link protection type required for the links included +in the computed path. + """ + 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={'link-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-shared': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-shared': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-shared': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-enhanced': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-enhanced': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-enhanced': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), default=six.text_type("te-types:link-protection-unprotected"), is_leaf=True, yang_name="link-protection", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """link_protection must be of a type compatible with identityref""", + 'defined-type': "ietf-te-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'link-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-shared': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-shared': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-shared': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-enhanced': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-enhanced': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-enhanced': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), default=six.text_type("te-types:link-protection-unprotected"), is_leaf=True, yang_name="link-protection", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True)""", + }) + + self.__link_protection = t + if hasattr(self, '_set'): + self._set() + + def _unset_link_protection(self): + self.__link_protection = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'link-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-shared': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-shared': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-shared': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-enhanced': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-enhanced': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-enhanced': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), default=six.text_type("te-types:link-protection-unprotected"), is_leaf=True, yang_name="link-protection", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + + + def _get_setup_priority(self): + """ + Getter method for setup_priority, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/setup_priority (uint8) + + YANG Description: TE LSP requested setup priority. + """ + return self.__setup_priority + + def _set_setup_priority(self, v, load=False): + """ + Setter method for setup_priority, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/setup_priority (uint8) + If this variable is read-only (config: false) in the + source YANG file, then _set_setup_priority is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_setup_priority() directly. + + YANG Description: TE LSP requested setup priority. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..7']}), default=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8)(7), is_leaf=True, yang_name="setup-priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint8', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """setup_priority must be of a type compatible with uint8""", + 'defined-type': "uint8", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..7']}), default=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8)(7), is_leaf=True, yang_name="setup-priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint8', is_config=True)""", + }) + + self.__setup_priority = t + if hasattr(self, '_set'): + self._set() + + def _unset_setup_priority(self): + self.__setup_priority = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..7']}), default=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8)(7), is_leaf=True, yang_name="setup-priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint8', is_config=True) + + + def _get_hold_priority(self): + """ + Getter method for hold_priority, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/hold_priority (uint8) + + YANG Description: TE LSP requested hold priority. + """ + return self.__hold_priority + + def _set_hold_priority(self, v, load=False): + """ + Setter method for hold_priority, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/hold_priority (uint8) + If this variable is read-only (config: false) in the + source YANG file, then _set_hold_priority is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hold_priority() directly. + + YANG Description: TE LSP requested hold priority. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..7']}), default=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8)(7), is_leaf=True, yang_name="hold-priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint8', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hold_priority must be of a type compatible with uint8""", + 'defined-type': "uint8", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..7']}), default=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8)(7), is_leaf=True, yang_name="hold-priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint8', is_config=True)""", + }) + + self.__hold_priority = t + if hasattr(self, '_set'): + self._set() + + def _unset_hold_priority(self): + self.__hold_priority = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..7']}), default=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8)(7), is_leaf=True, yang_name="hold-priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint8', is_config=True) + + + def _get_signaling_type(self): + """ + Getter method for signaling_type, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/signaling_type (identityref) + + YANG Description: TE tunnel path signaling type. + """ + return self.__signaling_type + + def _set_signaling_type(self, v, load=False): + """ + Setter method for signaling_type, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/signaling_type (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_signaling_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_signaling_type() directly. + + YANG Description: TE tunnel path signaling type. + """ + 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={'path-setup-static': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-setup-static': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-setup-static': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-setup-rsvp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-setup-rsvp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-setup-rsvp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-setup-sr': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-setup-sr': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-setup-sr': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), default=six.text_type("te-types:path-setup-rsvp"), is_leaf=True, yang_name="signaling-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """signaling_type must be of a type compatible with identityref""", + 'defined-type': "ietf-te-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'path-setup-static': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-setup-static': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-setup-static': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-setup-rsvp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-setup-rsvp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-setup-rsvp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-setup-sr': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-setup-sr': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-setup-sr': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), default=six.text_type("te-types:path-setup-rsvp"), is_leaf=True, yang_name="signaling-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True)""", + }) + + self.__signaling_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_signaling_type(self): + self.__signaling_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'path-setup-static': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-setup-static': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-setup-static': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-setup-rsvp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-setup-rsvp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-setup-rsvp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-setup-sr': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-setup-sr': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-setup-sr': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), default=six.text_type("te-types:path-setup-rsvp"), is_leaf=True, yang_name="signaling-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + + + def _get_path_metric_bounds(self): + """ + Getter method for path_metric_bounds, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/path_metric_bounds (container) + + YANG Description: TE path metric bounds container. + """ + return self.__path_metric_bounds + + def _set_path_metric_bounds(self, v, load=False): + """ + Setter method for path_metric_bounds, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/path_metric_bounds (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_metric_bounds is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_metric_bounds() directly. + + YANG Description: TE path metric bounds container. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=path_metric_bounds.path_metric_bounds, is_container='container', yang_name="path-metric-bounds", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_metric_bounds must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=path_metric_bounds.path_metric_bounds, is_container='container', yang_name="path-metric-bounds", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__path_metric_bounds = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_metric_bounds(self): + self.__path_metric_bounds = YANGDynClass(base=path_metric_bounds.path_metric_bounds, is_container='container', yang_name="path-metric-bounds", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_path_affinities_values(self): + """ + Getter method for path_affinities_values, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/path_affinities_values (container) + + YANG Description: Path affinities represented as values. + """ + return self.__path_affinities_values + + def _set_path_affinities_values(self, v, load=False): + """ + Setter method for path_affinities_values, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/path_affinities_values (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_affinities_values is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_affinities_values() directly. + + YANG Description: Path affinities represented as values. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=path_affinities_values.path_affinities_values, is_container='container', yang_name="path-affinities-values", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_affinities_values must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=path_affinities_values.path_affinities_values, is_container='container', yang_name="path-affinities-values", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__path_affinities_values = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_affinities_values(self): + self.__path_affinities_values = YANGDynClass(base=path_affinities_values.path_affinities_values, is_container='container', yang_name="path-affinities-values", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_path_affinity_names(self): + """ + Getter method for path_affinity_names, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/path_affinity_names (container) + + YANG Description: Path affinities represented as names. + """ + return self.__path_affinity_names + + def _set_path_affinity_names(self, v, load=False): + """ + Setter method for path_affinity_names, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/path_affinity_names (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_affinity_names is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_affinity_names() directly. + + YANG Description: Path affinities represented as names. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=path_affinity_names.path_affinity_names, is_container='container', yang_name="path-affinity-names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_affinity_names must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=path_affinity_names.path_affinity_names, is_container='container', yang_name="path-affinity-names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__path_affinity_names = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_affinity_names(self): + self.__path_affinity_names = YANGDynClass(base=path_affinity_names.path_affinity_names, is_container='container', yang_name="path-affinity-names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_path_srlgs_lists(self): + """ + Getter method for path_srlgs_lists, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/path_srlgs_lists (container) + + YANG Description: Path SRLG properties container. + """ + return self.__path_srlgs_lists + + def _set_path_srlgs_lists(self, v, load=False): + """ + Setter method for path_srlgs_lists, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/path_srlgs_lists (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_srlgs_lists is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_srlgs_lists() directly. + + YANG Description: Path SRLG properties container. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=path_srlgs_lists.path_srlgs_lists, is_container='container', yang_name="path-srlgs-lists", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_srlgs_lists must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=path_srlgs_lists.path_srlgs_lists, is_container='container', yang_name="path-srlgs-lists", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__path_srlgs_lists = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_srlgs_lists(self): + self.__path_srlgs_lists = YANGDynClass(base=path_srlgs_lists.path_srlgs_lists, is_container='container', yang_name="path-srlgs-lists", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_path_srlgs_names(self): + """ + Getter method for path_srlgs_names, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/path_srlgs_names (container) + + YANG Description: Container for the list of named SRLGs. + """ + return self.__path_srlgs_names + + def _set_path_srlgs_names(self, v, load=False): + """ + Setter method for path_srlgs_names, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/path_srlgs_names (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_srlgs_names is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_srlgs_names() directly. + + YANG Description: Container for the list of named SRLGs. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=path_srlgs_names.path_srlgs_names, is_container='container', yang_name="path-srlgs-names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_srlgs_names must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=path_srlgs_names.path_srlgs_names, is_container='container', yang_name="path-srlgs-names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__path_srlgs_names = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_srlgs_names(self): + self.__path_srlgs_names = YANGDynClass(base=path_srlgs_names.path_srlgs_names, is_container='container', yang_name="path-srlgs-names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_disjointness(self): + """ + Getter method for disjointness, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/disjointness (te-path-disjointness) + + YANG Description: The type of resource disjointness. +When configured for a primary path, the disjointness level +applies to all secondary LSPs. When configured for a +secondary path, the disjointness level overrides the level +configured for the primary path. + """ + return self.__disjointness + + def _set_disjointness(self, v, load=False): + """ + Setter method for disjointness, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/disjointness (te-path-disjointness) + If this variable is read-only (config: false) in the + source YANG file, then _set_disjointness is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_disjointness() directly. + + YANG Description: The type of resource disjointness. +When configured for a primary path, the disjointness level +applies to all secondary LSPs. When configured for a +secondary path, the disjointness level overrides the level +configured for the primary path. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBitsType(allowed_bits={'node': '0', 'link': '1', 'srlg': '2'}), is_leaf=True, yang_name="disjointness", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-path-disjointness', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """disjointness must be of a type compatible with te-path-disjointness""", + 'defined-type': "ietf-te-topology:te-path-disjointness", + 'generated-type': """YANGDynClass(base=YANGBitsType(allowed_bits={'node': '0', 'link': '1', 'srlg': '2'}), is_leaf=True, yang_name="disjointness", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-path-disjointness', is_config=True)""", + }) + + self.__disjointness = t + if hasattr(self, '_set'): + self._set() + + def _unset_disjointness(self): + self.__disjointness = YANGDynClass(base=YANGBitsType(allowed_bits={'node': '0', 'link': '1', 'srlg': '2'}), is_leaf=True, yang_name="disjointness", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-path-disjointness', is_config=True) + + te_bandwidth = __builtin__.property(_get_te_bandwidth, _set_te_bandwidth) + link_protection = __builtin__.property(_get_link_protection, _set_link_protection) + setup_priority = __builtin__.property(_get_setup_priority, _set_setup_priority) + hold_priority = __builtin__.property(_get_hold_priority, _set_hold_priority) + signaling_type = __builtin__.property(_get_signaling_type, _set_signaling_type) + path_metric_bounds = __builtin__.property(_get_path_metric_bounds, _set_path_metric_bounds) + path_affinities_values = __builtin__.property(_get_path_affinities_values, _set_path_affinities_values) + path_affinity_names = __builtin__.property(_get_path_affinity_names, _set_path_affinity_names) + path_srlgs_lists = __builtin__.property(_get_path_srlgs_lists, _set_path_srlgs_lists) + path_srlgs_names = __builtin__.property(_get_path_srlgs_names, _set_path_srlgs_names) + disjointness = __builtin__.property(_get_disjointness, _set_disjointness) + + + _pyangbind_elements = OrderedDict([('te_bandwidth', te_bandwidth), ('link_protection', link_protection), ('setup_priority', setup_priority), ('hold_priority', hold_priority), ('signaling_type', signaling_type), ('path_metric_bounds', path_metric_bounds), ('path_affinities_values', path_affinities_values), ('path_affinity_names', path_affinity_names), ('path_srlgs_lists', path_srlgs_lists), ('path_srlgs_names', path_srlgs_names), ('disjointness', disjointness), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/path_affinities_values/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/path_affinities_values/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..fbd5be1891af26f4906a30d7b8a19d836e7b69b7 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/path_affinities_values/__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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 path_affinities_value +class path_affinities_values(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/connectivity-matrix/path-constraints/path-affinities-values. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Path affinities represented as values. + """ + __slots__ = ('_path_helper', '_extmethods', '__path_affinities_value',) + + _yang_name = 'path-affinities-values' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__path_affinities_value = YANGDynClass(base=YANGListType("usage",path_affinities_value.path_affinities_value, yang_name="path-affinities-value", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-affinities-value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-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 ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'connectivity-matrix', 'path-constraints', 'path-affinities-values'] + + def _get_path_affinities_value(self): + """ + Getter method for path_affinities_value, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/path_affinities_values/path_affinities_value (list) + + YANG Description: List of named affinity constraints. + """ + return self.__path_affinities_value + + def _set_path_affinities_value(self, v, load=False): + """ + Setter method for path_affinities_value, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/path_affinities_values/path_affinities_value (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_affinities_value is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_affinities_value() directly. + + YANG Description: List of named affinity constraints. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("usage",path_affinities_value.path_affinities_value, yang_name="path-affinities-value", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-affinities-value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_affinities_value must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("usage",path_affinities_value.path_affinities_value, yang_name="path-affinities-value", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-affinities-value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True)""", + }) + + self.__path_affinities_value = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_affinities_value(self): + self.__path_affinities_value = YANGDynClass(base=YANGListType("usage",path_affinities_value.path_affinities_value, yang_name="path-affinities-value", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-affinities-value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + + path_affinities_value = __builtin__.property(_get_path_affinities_value, _set_path_affinities_value) + + + _pyangbind_elements = OrderedDict([('path_affinities_value', path_affinities_value), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/path_affinities_values/path_affinities_value/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/path_affinities_values/path_affinities_value/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..8c29e7d9cc37960b0ce075b3133f6ecd8370a441 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/path_affinities_values/path_affinities_value/__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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 path_affinities_value(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/connectivity-matrix/path-constraints/path-affinities-values/path-affinities-value. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: List of named affinity constraints. + """ + __slots__ = ('_path_helper', '_extmethods', '__usage','__value',) + + _yang_name = 'path-affinities-value' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__usage = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + self.__value = YANGDynClass(base=[RestrictedClassType(base_type=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}), restriction_dict={'length': ['1..11']}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}),], default=six.text_type(""), is_leaf=True, yang_name="value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='admin-groups', 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 ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'connectivity-matrix', 'path-constraints', 'path-affinities-values', 'path-affinities-value'] + + def _get_usage(self): + """ + Getter method for usage, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/path_affinities_values/path_affinities_value/usage (identityref) + + YANG Description: Identifies an entry in the list of value affinity +constraints. + """ + return self.__usage + + def _set_usage(self, v, load=False): + """ + Setter method for usage, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/path_affinities_values/path_affinities_value/usage (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_usage is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_usage() directly. + + YANG Description: Identifies an entry in the list of value affinity +constraints. + """ + 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=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """usage must be of a type compatible with identityref""", + 'defined-type': "ietf-te-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True)""", + }) + + self.__usage = t + if hasattr(self, '_set'): + self._set() + + def _unset_usage(self): + self.__usage = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + + + def _get_value(self): + """ + Getter method for value, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/path_affinities_values/path_affinities_value/value (admin-groups) + + YANG Description: The affinity value. The default is empty. + """ + return self.__value + + def _set_value(self, v, load=False): + """ + Setter method for value, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/path_affinities_values/path_affinities_value/value (admin-groups) + 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: The affinity value. The default is empty. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=[RestrictedClassType(base_type=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}), restriction_dict={'length': ['1..11']}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}),], default=six.text_type(""), is_leaf=True, yang_name="value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='admin-groups', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """value must be of a type compatible with admin-groups""", + 'defined-type': "ietf-te-topology:admin-groups", + 'generated-type': """YANGDynClass(base=[RestrictedClassType(base_type=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}), restriction_dict={'length': ['1..11']}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}),], default=six.text_type(""), is_leaf=True, yang_name="value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='admin-groups', is_config=True)""", + }) + + self.__value = t + if hasattr(self, '_set'): + self._set() + + def _unset_value(self): + self.__value = YANGDynClass(base=[RestrictedClassType(base_type=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}), restriction_dict={'length': ['1..11']}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}),], default=six.text_type(""), is_leaf=True, yang_name="value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='admin-groups', is_config=True) + + usage = __builtin__.property(_get_usage, _set_usage) + value = __builtin__.property(_get_value, _set_value) + + + _pyangbind_elements = OrderedDict([('usage', usage), ('value', value), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/path_affinity_names/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/path_affinity_names/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..a8540d0a45dd2c5634ac4da048e47270f0b26782 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/path_affinity_names/__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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 path_affinity_name +class path_affinity_names(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/connectivity-matrix/path-constraints/path-affinity-names. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Path affinities represented as names. + """ + __slots__ = ('_path_helper', '_extmethods', '__path_affinity_name',) + + _yang_name = 'path-affinity-names' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__path_affinity_name = YANGDynClass(base=YANGListType("usage",path_affinity_name.path_affinity_name, yang_name="path-affinity-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-affinity-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-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 ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'connectivity-matrix', 'path-constraints', 'path-affinity-names'] + + def _get_path_affinity_name(self): + """ + Getter method for path_affinity_name, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/path_affinity_names/path_affinity_name (list) + + YANG Description: List of named affinity constraints. + """ + return self.__path_affinity_name + + def _set_path_affinity_name(self, v, load=False): + """ + Setter method for path_affinity_name, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/path_affinity_names/path_affinity_name (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_affinity_name is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_affinity_name() directly. + + YANG Description: List of named affinity constraints. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("usage",path_affinity_name.path_affinity_name, yang_name="path-affinity-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-affinity-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_affinity_name must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("usage",path_affinity_name.path_affinity_name, yang_name="path-affinity-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-affinity-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True)""", + }) + + self.__path_affinity_name = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_affinity_name(self): + self.__path_affinity_name = YANGDynClass(base=YANGListType("usage",path_affinity_name.path_affinity_name, yang_name="path-affinity-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-affinity-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + + path_affinity_name = __builtin__.property(_get_path_affinity_name, _set_path_affinity_name) + + + _pyangbind_elements = OrderedDict([('path_affinity_name', path_affinity_name), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/path_affinity_names/path_affinity_name/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/path_affinity_names/path_affinity_name/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..53d581fd6defd3f4698abb8ca0c2ee751c725608 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/path_affinity_names/path_affinity_name/__init__.py @@ -0,0 +1,162 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 affinity_name +class path_affinity_name(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/connectivity-matrix/path-constraints/path-affinity-names/path-affinity-name. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: List of named affinity constraints. + """ + __slots__ = ('_path_helper', '_extmethods', '__usage','__affinity_name',) + + _yang_name = 'path-affinity-name' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__usage = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + self.__affinity_name = YANGDynClass(base=YANGListType("name",affinity_name.affinity_name, yang_name="affinity-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='name', extensions=None), is_container='list', yang_name="affinity-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-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 ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'connectivity-matrix', 'path-constraints', 'path-affinity-names', 'path-affinity-name'] + + def _get_usage(self): + """ + Getter method for usage, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/path_affinity_names/path_affinity_name/usage (identityref) + + YANG Description: Identifies an entry in the list of named affinity +constraints. + """ + return self.__usage + + def _set_usage(self, v, load=False): + """ + Setter method for usage, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/path_affinity_names/path_affinity_name/usage (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_usage is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_usage() directly. + + YANG Description: Identifies an entry in the list of named affinity +constraints. + """ + 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=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """usage must be of a type compatible with identityref""", + 'defined-type': "ietf-te-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True)""", + }) + + self.__usage = t + if hasattr(self, '_set'): + self._set() + + def _unset_usage(self): + self.__usage = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + + + def _get_affinity_name(self): + """ + Getter method for affinity_name, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/path_affinity_names/path_affinity_name/affinity_name (list) + + YANG Description: List of named affinities. + """ + return self.__affinity_name + + def _set_affinity_name(self, v, load=False): + """ + Setter method for affinity_name, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/path_affinity_names/path_affinity_name/affinity_name (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_affinity_name is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_affinity_name() directly. + + YANG Description: List of named affinities. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("name",affinity_name.affinity_name, yang_name="affinity-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='name', extensions=None), is_container='list', yang_name="affinity-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """affinity_name must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("name",affinity_name.affinity_name, yang_name="affinity-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='name', extensions=None), is_container='list', yang_name="affinity-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True)""", + }) + + self.__affinity_name = t + if hasattr(self, '_set'): + self._set() + + def _unset_affinity_name(self): + self.__affinity_name = YANGDynClass(base=YANGListType("name",affinity_name.affinity_name, yang_name="affinity-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='name', extensions=None), is_container='list', yang_name="affinity-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + + usage = __builtin__.property(_get_usage, _set_usage) + affinity_name = __builtin__.property(_get_affinity_name, _set_affinity_name) + + + _pyangbind_elements = OrderedDict([('usage', usage), ('affinity_name', affinity_name), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/path_affinity_names/path_affinity_name/affinity_name/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/path_affinity_names/path_affinity_name/affinity_name/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..9049a13907bb3f9c4ba5aab6782e77a5a6a26bc1 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/path_affinity_names/path_affinity_name/affinity_name/__init__.py @@ -0,0 +1,120 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 affinity_name(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/connectivity-matrix/path-constraints/path-affinity-names/path-affinity-name/affinity-name. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: List of named affinities. + """ + __slots__ = ('_path_helper', '_extmethods', '__name',) + + _yang_name = 'affinity-name' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _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='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-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 ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'connectivity-matrix', 'path-constraints', 'path-affinity-names', 'path-affinity-name', 'affinity-name'] + + def _get_name(self): + """ + Getter method for name, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/path_affinity_names/path_affinity_name/affinity_name/name (string) + + YANG Description: Identifies a named affinity entry. + """ + return self.__name + + def _set_name(self, v, load=False): + """ + Setter method for name, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/path_affinity_names/path_affinity_name/affinity_name/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: Identifies a named affinity entry. + """ + 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='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', 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, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', 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, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=True) + + name = __builtin__.property(_get_name, _set_name) + + + _pyangbind_elements = OrderedDict([('name', name), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/path_metric_bounds/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/path_metric_bounds/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..7f6acfbb0d20361ab8b7c406ceb4fef2d4a868e9 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/path_metric_bounds/__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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 path_metric_bound +class path_metric_bounds(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/connectivity-matrix/path-constraints/path-metric-bounds. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: TE path metric bounds container. + """ + __slots__ = ('_path_helper', '_extmethods', '__path_metric_bound',) + + _yang_name = 'path-metric-bounds' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__path_metric_bound = YANGDynClass(base=YANGListType("metric_type",path_metric_bound.path_metric_bound, yang_name="path-metric-bound", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='metric-type', extensions=None), is_container='list', yang_name="path-metric-bound", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-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 ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'connectivity-matrix', 'path-constraints', 'path-metric-bounds'] + + def _get_path_metric_bound(self): + """ + Getter method for path_metric_bound, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/path_metric_bounds/path_metric_bound (list) + + YANG Description: List of TE path metric bounds. + """ + return self.__path_metric_bound + + def _set_path_metric_bound(self, v, load=False): + """ + Setter method for path_metric_bound, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/path_metric_bounds/path_metric_bound (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_metric_bound is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_metric_bound() directly. + + YANG Description: List of TE path metric bounds. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("metric_type",path_metric_bound.path_metric_bound, yang_name="path-metric-bound", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='metric-type', extensions=None), is_container='list', yang_name="path-metric-bound", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_metric_bound must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("metric_type",path_metric_bound.path_metric_bound, yang_name="path-metric-bound", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='metric-type', extensions=None), is_container='list', yang_name="path-metric-bound", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True)""", + }) + + self.__path_metric_bound = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_metric_bound(self): + self.__path_metric_bound = YANGDynClass(base=YANGListType("metric_type",path_metric_bound.path_metric_bound, yang_name="path-metric-bound", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='metric-type', extensions=None), is_container='list', yang_name="path-metric-bound", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + + path_metric_bound = __builtin__.property(_get_path_metric_bound, _set_path_metric_bound) + + + _pyangbind_elements = OrderedDict([('path_metric_bound', path_metric_bound), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/path_metric_bounds/path_metric_bound/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/path_metric_bounds/path_metric_bound/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..177598e6cc98b222f75deb7968076fc9fdc39c66 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/path_metric_bounds/path_metric_bound/__init__.py @@ -0,0 +1,165 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 path_metric_bound(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/connectivity-matrix/path-constraints/path-metric-bounds/path-metric-bound. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: List of TE path metric bounds. + """ + __slots__ = ('_path_helper', '_extmethods', '__metric_type','__upper_bound',) + + _yang_name = 'path-metric-bound' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__metric_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="metric-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + self.__upper_bound = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), default=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64)(0), is_leaf=True, yang_name="upper-bound", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint64', 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 ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'connectivity-matrix', 'path-constraints', 'path-metric-bounds', 'path-metric-bound'] + + def _get_metric_type(self): + """ + Getter method for metric_type, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/path_metric_bounds/path_metric_bound/metric_type (identityref) + + YANG Description: Identifies an entry in the list of 'metric-type' items +bound for the TE path. + """ + return self.__metric_type + + def _set_metric_type(self, v, load=False): + """ + Setter method for metric_type, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/path_metric_bounds/path_metric_bound/metric_type (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_metric_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_metric_type() directly. + + YANG Description: Identifies an entry in the list of 'metric-type' items +bound for the TE path. + """ + 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=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="metric-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """metric_type must be of a type compatible with identityref""", + 'defined-type': "ietf-te-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="metric-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True)""", + }) + + self.__metric_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_metric_type(self): + self.__metric_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="metric-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + + + def _get_upper_bound(self): + """ + Getter method for upper_bound, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/path_metric_bounds/path_metric_bound/upper_bound (uint64) + + YANG Description: Upper bound on the end-to-end TE path metric. A zero +indicates an unbounded upper limit for the specific +'metric-type'. + """ + return self.__upper_bound + + def _set_upper_bound(self, v, load=False): + """ + Setter method for upper_bound, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/path_metric_bounds/path_metric_bound/upper_bound (uint64) + If this variable is read-only (config: false) in the + source YANG file, then _set_upper_bound is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_upper_bound() directly. + + YANG Description: Upper bound on the end-to-end TE path metric. A zero +indicates an unbounded upper limit for the specific +'metric-type'. + """ + 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), default=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64)(0), is_leaf=True, yang_name="upper-bound", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint64', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """upper_bound 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), default=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64)(0), is_leaf=True, yang_name="upper-bound", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint64', is_config=True)""", + }) + + self.__upper_bound = t + if hasattr(self, '_set'): + self._set() + + def _unset_upper_bound(self): + self.__upper_bound = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), default=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64)(0), is_leaf=True, yang_name="upper-bound", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint64', is_config=True) + + metric_type = __builtin__.property(_get_metric_type, _set_metric_type) + upper_bound = __builtin__.property(_get_upper_bound, _set_upper_bound) + + + _pyangbind_elements = OrderedDict([('metric_type', metric_type), ('upper_bound', upper_bound), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/path_srlgs_lists/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/path_srlgs_lists/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..9a345c8aea6c5d92701fd78223bdfa27f3a4d1df --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/path_srlgs_lists/__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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 path_srlgs_list +class path_srlgs_lists(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/connectivity-matrix/path-constraints/path-srlgs-lists. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Path SRLG properties container. + """ + __slots__ = ('_path_helper', '_extmethods', '__path_srlgs_list',) + + _yang_name = 'path-srlgs-lists' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__path_srlgs_list = YANGDynClass(base=YANGListType("usage",path_srlgs_list.path_srlgs_list, yang_name="path-srlgs-list", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-srlgs-list", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-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 ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'connectivity-matrix', 'path-constraints', 'path-srlgs-lists'] + + def _get_path_srlgs_list(self): + """ + Getter method for path_srlgs_list, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/path_srlgs_lists/path_srlgs_list (list) + + YANG Description: List of SRLG values to be included or excluded. + """ + return self.__path_srlgs_list + + def _set_path_srlgs_list(self, v, load=False): + """ + Setter method for path_srlgs_list, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/path_srlgs_lists/path_srlgs_list (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_srlgs_list is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_srlgs_list() directly. + + YANG Description: List of SRLG values to be included or excluded. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("usage",path_srlgs_list.path_srlgs_list, yang_name="path-srlgs-list", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-srlgs-list", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_srlgs_list must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("usage",path_srlgs_list.path_srlgs_list, yang_name="path-srlgs-list", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-srlgs-list", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True)""", + }) + + self.__path_srlgs_list = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_srlgs_list(self): + self.__path_srlgs_list = YANGDynClass(base=YANGListType("usage",path_srlgs_list.path_srlgs_list, yang_name="path-srlgs-list", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-srlgs-list", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + + path_srlgs_list = __builtin__.property(_get_path_srlgs_list, _set_path_srlgs_list) + + + _pyangbind_elements = OrderedDict([('path_srlgs_list', path_srlgs_list), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/path_srlgs_lists/path_srlgs_list/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/path_srlgs_lists/path_srlgs_list/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..42bd453b07b8d361fdf87021cebdd01f32a44a50 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/path_srlgs_lists/path_srlgs_list/__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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 path_srlgs_list(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/connectivity-matrix/path-constraints/path-srlgs-lists/path-srlgs-list. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: List of SRLG values to be included or excluded. + """ + __slots__ = ('_path_helper', '_extmethods', '__usage','__values',) + + _yang_name = 'path-srlgs-list' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__usage = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + self.__values = YANGDynClass(unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32)), is_leaf=False, yang_name="values", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='srlg', 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 ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'connectivity-matrix', 'path-constraints', 'path-srlgs-lists', 'path-srlgs-list'] + + def _get_usage(self): + """ + Getter method for usage, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/path_srlgs_lists/path_srlgs_list/usage (identityref) + + YANG Description: Identifies an entry in a list of SRLGs to either +include or exclude. + """ + return self.__usage + + def _set_usage(self, v, load=False): + """ + Setter method for usage, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/path_srlgs_lists/path_srlgs_list/usage (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_usage is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_usage() directly. + + YANG Description: Identifies an entry in a list of SRLGs to either +include or exclude. + """ + 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=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """usage must be of a type compatible with identityref""", + 'defined-type': "ietf-te-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True)""", + }) + + self.__usage = t + if hasattr(self, '_set'): + self._set() + + def _unset_usage(self): + self.__usage = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + + + def _get_values(self): + """ + Getter method for values, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/path_srlgs_lists/path_srlgs_list/values (srlg) + + YANG Description: List of SRLG values. + """ + return self.__values + + def _set_values(self, v, load=False): + """ + Setter method for values, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/path_srlgs_lists/path_srlgs_list/values (srlg) + If this variable is read-only (config: false) in the + source YANG file, then _set_values is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_values() directly. + + YANG Description: List of SRLG values. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32)), is_leaf=False, yang_name="values", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='srlg', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """values must be of a type compatible with srlg""", + 'defined-type': "ietf-te-topology:srlg", + 'generated-type': """YANGDynClass(unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32)), is_leaf=False, yang_name="values", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='srlg', is_config=True)""", + }) + + self.__values = t + if hasattr(self, '_set'): + self._set() + + def _unset_values(self): + self.__values = YANGDynClass(unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32)), is_leaf=False, yang_name="values", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='srlg', is_config=True) + + usage = __builtin__.property(_get_usage, _set_usage) + values = __builtin__.property(_get_values, _set_values) + + + _pyangbind_elements = OrderedDict([('usage', usage), ('values', values), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/path_srlgs_names/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/path_srlgs_names/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..83edd896faaa58e47f59aa341f7656bc96a59e42 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/path_srlgs_names/__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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 path_srlgs_name +class path_srlgs_names(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/connectivity-matrix/path-constraints/path-srlgs-names. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Container for the list of named SRLGs. + """ + __slots__ = ('_path_helper', '_extmethods', '__path_srlgs_name',) + + _yang_name = 'path-srlgs-names' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__path_srlgs_name = YANGDynClass(base=YANGListType("usage",path_srlgs_name.path_srlgs_name, yang_name="path-srlgs-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-srlgs-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-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 ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'connectivity-matrix', 'path-constraints', 'path-srlgs-names'] + + def _get_path_srlgs_name(self): + """ + Getter method for path_srlgs_name, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/path_srlgs_names/path_srlgs_name (list) + + YANG Description: List of named SRLGs to be included or excluded. + """ + return self.__path_srlgs_name + + def _set_path_srlgs_name(self, v, load=False): + """ + Setter method for path_srlgs_name, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/path_srlgs_names/path_srlgs_name (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_srlgs_name is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_srlgs_name() directly. + + YANG Description: List of named SRLGs to be included or excluded. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("usage",path_srlgs_name.path_srlgs_name, yang_name="path-srlgs-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-srlgs-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_srlgs_name must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("usage",path_srlgs_name.path_srlgs_name, yang_name="path-srlgs-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-srlgs-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True)""", + }) + + self.__path_srlgs_name = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_srlgs_name(self): + self.__path_srlgs_name = YANGDynClass(base=YANGListType("usage",path_srlgs_name.path_srlgs_name, yang_name="path-srlgs-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-srlgs-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + + path_srlgs_name = __builtin__.property(_get_path_srlgs_name, _set_path_srlgs_name) + + + _pyangbind_elements = OrderedDict([('path_srlgs_name', path_srlgs_name), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/path_srlgs_names/path_srlgs_name/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/path_srlgs_names/path_srlgs_name/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..7dba34db6f2d139b3396c6fd9a93ce926bab1a69 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/path_srlgs_names/path_srlgs_name/__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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 path_srlgs_name(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/connectivity-matrix/path-constraints/path-srlgs-names/path-srlgs-name. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: List of named SRLGs to be included or excluded. + """ + __slots__ = ('_path_helper', '_extmethods', '__usage','__names',) + + _yang_name = 'path-srlgs-name' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__usage = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + self.__names = YANGDynClass(unique=True, base=TypedListType(allowed_type=six.text_type), is_leaf=False, yang_name="names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-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 ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'connectivity-matrix', 'path-constraints', 'path-srlgs-names', 'path-srlgs-name'] + + def _get_usage(self): + """ + Getter method for usage, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/path_srlgs_names/path_srlgs_name/usage (identityref) + + YANG Description: Identifies an entry in a list of named SRLGs to either +include or exclude. + """ + return self.__usage + + def _set_usage(self, v, load=False): + """ + Setter method for usage, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/path_srlgs_names/path_srlgs_name/usage (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_usage is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_usage() directly. + + YANG Description: Identifies an entry in a list of named SRLGs to either +include or exclude. + """ + 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=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """usage must be of a type compatible with identityref""", + 'defined-type': "ietf-te-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True)""", + }) + + self.__usage = t + if hasattr(self, '_set'): + self._set() + + def _unset_usage(self): + self.__usage = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + + + def _get_names(self): + """ + Getter method for names, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/path_srlgs_names/path_srlgs_name/names (string) + + YANG Description: List of named SRLGs. + """ + return self.__names + + def _set_names(self, v, load=False): + """ + Setter method for names, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/path_srlgs_names/path_srlgs_name/names (string) + If this variable is read-only (config: false) in the + source YANG file, then _set_names is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_names() directly. + + YANG Description: List of named SRLGs. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,unique=True, base=TypedListType(allowed_type=six.text_type), is_leaf=False, yang_name="names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """names must be of a type compatible with string""", + 'defined-type': "string", + 'generated-type': """YANGDynClass(unique=True, base=TypedListType(allowed_type=six.text_type), is_leaf=False, yang_name="names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=True)""", + }) + + self.__names = t + if hasattr(self, '_set'): + self._set() + + def _unset_names(self): + self.__names = YANGDynClass(unique=True, base=TypedListType(allowed_type=six.text_type), is_leaf=False, yang_name="names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=True) + + usage = __builtin__.property(_get_usage, _set_usage) + names = __builtin__.property(_get_names, _set_names) + + + _pyangbind_elements = OrderedDict([('usage', usage), ('names', names), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/te_bandwidth/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/te_bandwidth/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..f4e10c8b6b05ce85c5ec52494d78dd67f10eed2e --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/te_bandwidth/__init__.py @@ -0,0 +1,195 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 otn +class te_bandwidth(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/connectivity-matrix/path-constraints/te-bandwidth. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Container that specifies TE bandwidth. The choices +can be augmented for specific data-plane technologies. + """ + __slots__ = ('_path_helper', '_extmethods', '__generic','__otn','__eth_bandwidth',) + + _yang_name = 'te-bandwidth' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__generic = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+(,(0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+))*'}), is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-bandwidth', is_config=True) + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + self.__eth_bandwidth = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), restriction_dict={'range': ['0..10000000000']}), is_leaf=True, yang_name="eth-bandwidth", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint64', 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 ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'connectivity-matrix', 'path-constraints', 'te-bandwidth'] + + def _get_generic(self): + """ + Getter method for generic, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/te_bandwidth/generic (te-bandwidth) + + YANG Description: Bandwidth specified in a generic format. + """ + return self.__generic + + def _set_generic(self, v, load=False): + """ + Setter method for generic, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/te_bandwidth/generic (te-bandwidth) + If this variable is read-only (config: false) in the + source YANG file, then _set_generic is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_generic() directly. + + YANG Description: Bandwidth specified in a generic format. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+(,(0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+))*'}), is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-bandwidth', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """generic must be of a type compatible with te-bandwidth""", + 'defined-type': "ietf-te-topology:te-bandwidth", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+(,(0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+))*'}), is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-bandwidth', is_config=True)""", + }) + + self.__generic = t + if hasattr(self, '_set'): + self._set() + + def _unset_generic(self): + self.__generic = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+(,(0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+))*'}), is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-bandwidth', is_config=True) + + + def _get_otn(self): + """ + Getter method for otn, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/te_bandwidth/otn (container) + + YANG Description: Bandwidth attributes for OTN links + """ + return self.__otn + + def _set_otn(self, v, load=False): + """ + Setter method for otn, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/te_bandwidth/otn (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_otn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_otn() directly. + + YANG Description: Bandwidth attributes for OTN links + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """otn must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True)""", + }) + + self.__otn = t + if hasattr(self, '_set'): + self._set() + + def _unset_otn(self): + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + + + def _get_eth_bandwidth(self): + """ + Getter method for eth_bandwidth, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/te_bandwidth/eth_bandwidth (uint64) + + YANG Description: Available bandwith value expressed in kilobits per second + """ + return self.__eth_bandwidth + + def _set_eth_bandwidth(self, v, load=False): + """ + Setter method for eth_bandwidth, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/te_bandwidth/eth_bandwidth (uint64) + If this variable is read-only (config: false) in the + source YANG file, then _set_eth_bandwidth is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_eth_bandwidth() directly. + + YANG Description: Available bandwith value expressed in kilobits per second + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), restriction_dict={'range': ['0..10000000000']}), is_leaf=True, yang_name="eth-bandwidth", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint64', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """eth_bandwidth must be of a type compatible with uint64""", + 'defined-type': "uint64", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), restriction_dict={'range': ['0..10000000000']}), is_leaf=True, yang_name="eth-bandwidth", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint64', is_config=True)""", + }) + + self.__eth_bandwidth = t + if hasattr(self, '_set'): + self._set() + + def _unset_eth_bandwidth(self): + self.__eth_bandwidth = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), restriction_dict={'range': ['0..10000000000']}), is_leaf=True, yang_name="eth-bandwidth", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint64', is_config=True) + + generic = __builtin__.property(_get_generic, _set_generic) + otn = __builtin__.property(_get_otn, _set_otn) + eth_bandwidth = __builtin__.property(_get_eth_bandwidth, _set_eth_bandwidth) + + __choices__ = {'technology': {'generic': ['generic'], 'otn': ['otn'], 'eth': ['eth_bandwidth']}} + _pyangbind_elements = OrderedDict([('generic', generic), ('otn', otn), ('eth_bandwidth', eth_bandwidth), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/te_bandwidth/otn/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/te_bandwidth/otn/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..a2a8fce28fa658133b7b416804f64dbe6aa29642 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/te_bandwidth/otn/__init__.py @@ -0,0 +1,163 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 odulist +class otn(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/connectivity-matrix/path-constraints/te-bandwidth/otn. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Bandwidth attributes for OTN links + """ + __slots__ = ('_path_helper', '_extmethods', '__odulist','__odtu_flex_type',) + + _yang_name = 'otn' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__odulist = YANGDynClass(base=YANGListType("odu_type",odulist.odulist, yang_name="odulist", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='odu-type', extensions=None, choice=('technology', 'otn')), is_container='list', yang_name="odulist", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='list', is_config=True) + self.__odtu_flex_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'2': {}, '3': {}, '4': {}, 'Cn': {}},), is_leaf=True, yang_name="odtu-flex-type", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='l1-types:odtu-flex-type', 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 ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'connectivity-matrix', 'path-constraints', 'te-bandwidth', 'otn'] + + def _get_odulist(self): + """ + Getter method for odulist, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/te_bandwidth/otn/odulist (list) + + YANG Description: OTN bandwidth definition + """ + return self.__odulist + + def _set_odulist(self, v, load=False): + """ + Setter method for odulist, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/te_bandwidth/otn/odulist (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_odulist is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_odulist() directly. + + YANG Description: OTN bandwidth definition + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("odu_type",odulist.odulist, yang_name="odulist", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='odu-type', extensions=None, choice=('technology', 'otn')), is_container='list', yang_name="odulist", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='list', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """odulist must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("odu_type",odulist.odulist, yang_name="odulist", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='odu-type', extensions=None, choice=('technology', 'otn')), is_container='list', yang_name="odulist", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='list', is_config=True)""", + }) + + self.__odulist = t + if hasattr(self, '_set'): + self._set() + + def _unset_odulist(self): + self.__odulist = YANGDynClass(base=YANGListType("odu_type",odulist.odulist, yang_name="odulist", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='odu-type', extensions=None, choice=('technology', 'otn')), is_container='list', yang_name="odulist", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='list', is_config=True) + + + def _get_odtu_flex_type(self): + """ + Getter method for odtu_flex_type, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/te_bandwidth/otn/odtu_flex_type (l1-types:odtu-flex-type) + + YANG Description: The type of Optical Data Tributary Unit (ODTU) +whose nominal bitrate is used to compute the number of +Tributary Slots (TS) required by the ODUflex LSPs +set up along the underlay path of this OTN +connectivity matrix entry. + """ + return self.__odtu_flex_type + + def _set_odtu_flex_type(self, v, load=False): + """ + Setter method for odtu_flex_type, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/te_bandwidth/otn/odtu_flex_type (l1-types:odtu-flex-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_odtu_flex_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_odtu_flex_type() directly. + + YANG Description: The type of Optical Data Tributary Unit (ODTU) +whose nominal bitrate is used to compute the number of +Tributary Slots (TS) required by the ODUflex LSPs +set up along the underlay path of this OTN +connectivity matrix entry. + """ + 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={'2': {}, '3': {}, '4': {}, 'Cn': {}},), is_leaf=True, yang_name="odtu-flex-type", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='l1-types:odtu-flex-type', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """odtu_flex_type must be of a type compatible with l1-types:odtu-flex-type""", + 'defined-type': "l1-types:odtu-flex-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'2': {}, '3': {}, '4': {}, 'Cn': {}},), is_leaf=True, yang_name="odtu-flex-type", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='l1-types:odtu-flex-type', is_config=True)""", + }) + + self.__odtu_flex_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_odtu_flex_type(self): + self.__odtu_flex_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'2': {}, '3': {}, '4': {}, 'Cn': {}},), is_leaf=True, yang_name="odtu-flex-type", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='l1-types:odtu-flex-type', is_config=True) + + odulist = __builtin__.property(_get_odulist, _set_odulist) + odtu_flex_type = __builtin__.property(_get_odtu_flex_type, _set_odtu_flex_type) + + __choices__ = {'technology': {'otn': ['odulist', 'odtu_flex_type']}} + _pyangbind_elements = OrderedDict([('odulist', odulist), ('odtu_flex_type', odtu_flex_type), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/te_bandwidth/otn/odulist/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/te_bandwidth/otn/odulist/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..9923938e39446c8970698126ec0670cd424a8b35 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/te_bandwidth/otn/odulist/__init__.py @@ -0,0 +1,200 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 odulist(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/connectivity-matrix/path-constraints/te-bandwidth/otn/odulist. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: OTN bandwidth definition + """ + __slots__ = ('_path_helper', '_extmethods', '__odu_type','__number','__ts_number',) + + _yang_name = 'odulist' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__odu_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="odu-type", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + self.__number = YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), is_leaf=True, yang_name="number", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', is_config=True) + self.__ts_number = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts-number", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', 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 ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'connectivity-matrix', 'path-constraints', 'te-bandwidth', 'otn', 'odulist'] + + def _get_odu_type(self): + """ + Getter method for odu_type, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/te_bandwidth/otn/odulist/odu_type (identityref) + + YANG Description: ODU type + """ + return self.__odu_type + + def _set_odu_type(self, v, load=False): + """ + Setter method for odu_type, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/te_bandwidth/otn/odulist/odu_type (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_odu_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_odu_type() directly. + + YANG Description: ODU type + """ + 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=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="odu-type", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """odu_type must be of a type compatible with identityref""", + 'defined-type': "ietf-otn-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="odu-type", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True)""", + }) + + self.__odu_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_odu_type(self): + self.__odu_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="odu-type", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + + + def _get_number(self): + """ + Getter method for number, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/te_bandwidth/otn/odulist/number (uint16) + + YANG Description: Number of ODUs + """ + return self.__number + + def _set_number(self, v, load=False): + """ + Setter method for number, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/te_bandwidth/otn/odulist/number (uint16) + If this variable is read-only (config: false) in the + source YANG file, then _set_number is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_number() directly. + + YANG Description: Number of ODUs + """ + 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="number", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """number 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="number", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', is_config=True)""", + }) + + self.__number = t + if hasattr(self, '_set'): + self._set() + + def _unset_number(self): + self.__number = YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), is_leaf=True, yang_name="number", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', is_config=True) + + + def _get_ts_number(self): + """ + Getter method for ts_number, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/te_bandwidth/otn/odulist/ts_number (uint16) + + YANG Description: The number of Tributary Slots (TS) that +could be used by all the ODUflex LSPs. + """ + return self.__ts_number + + def _set_ts_number(self, v, load=False): + """ + Setter method for ts_number, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/te_bandwidth/otn/odulist/ts_number (uint16) + If this variable is read-only (config: false) in the + source YANG file, then _set_ts_number is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_ts_number() directly. + + YANG Description: The number of Tributary Slots (TS) that +could be used by all the ODUflex LSPs. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts-number", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """ts_number must be of a type compatible with uint16""", + 'defined-type': "uint16", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts-number", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', is_config=True)""", + }) + + self.__ts_number = t + if hasattr(self, '_set'): + self._set() + + def _unset_ts_number(self): + self.__ts_number = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts-number", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', is_config=True) + + odu_type = __builtin__.property(_get_odu_type, _set_odu_type) + number = __builtin__.property(_get_number, _set_number) + ts_number = __builtin__.property(_get_ts_number, _set_ts_number) + + __choices__ = {'technology': {'otn': ['odu_type', 'number', 'ts_number']}} + _pyangbind_elements = OrderedDict([('odu_type', odu_type), ('number', number), ('ts_number', ts_number), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..32bb9a55344f0995388f9d85a42c05850802c125 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/__init__.py @@ -0,0 +1,318 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 path_metric +from . import path_affinities_values +from . import path_affinity_names +from . import path_srlgs_lists +from . import path_srlgs_names +from . import path_route_objects +class path_properties(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/connectivity-matrix/path-properties. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: The TE path properties. + """ + __slots__ = ('_path_helper', '_extmethods', '__path_metric','__path_affinities_values','__path_affinity_names','__path_srlgs_lists','__path_srlgs_names','__path_route_objects',) + + _yang_name = 'path-properties' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__path_metric = YANGDynClass(base=YANGListType("metric_type",path_metric.path_metric, yang_name="path-metric", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='metric-type', extensions=None), is_container='list', yang_name="path-metric", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + self.__path_affinities_values = YANGDynClass(base=path_affinities_values.path_affinities_values, is_container='container', yang_name="path-affinities-values", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__path_affinity_names = YANGDynClass(base=path_affinity_names.path_affinity_names, is_container='container', yang_name="path-affinity-names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__path_srlgs_lists = YANGDynClass(base=path_srlgs_lists.path_srlgs_lists, is_container='container', yang_name="path-srlgs-lists", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__path_srlgs_names = YANGDynClass(base=path_srlgs_names.path_srlgs_names, is_container='container', yang_name="path-srlgs-names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__path_route_objects = YANGDynClass(base=path_route_objects.path_route_objects, is_container='container', yang_name="path-route-objects", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', 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 ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'connectivity-matrix', 'path-properties'] + + def _get_path_metric(self): + """ + Getter method for path_metric, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_metric (list) + + YANG Description: TE path metric type. + """ + return self.__path_metric + + def _set_path_metric(self, v, load=False): + """ + Setter method for path_metric, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_metric (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_metric is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_metric() directly. + + YANG Description: TE path metric type. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("metric_type",path_metric.path_metric, yang_name="path-metric", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='metric-type', extensions=None), is_container='list', yang_name="path-metric", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_metric must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("metric_type",path_metric.path_metric, yang_name="path-metric", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='metric-type', extensions=None), is_container='list', yang_name="path-metric", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False)""", + }) + + self.__path_metric = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_metric(self): + self.__path_metric = YANGDynClass(base=YANGListType("metric_type",path_metric.path_metric, yang_name="path-metric", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='metric-type', extensions=None), is_container='list', yang_name="path-metric", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + + + def _get_path_affinities_values(self): + """ + Getter method for path_affinities_values, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_affinities_values (container) + + YANG Description: Path affinities represented as values. + """ + return self.__path_affinities_values + + def _set_path_affinities_values(self, v, load=False): + """ + Setter method for path_affinities_values, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_affinities_values (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_affinities_values is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_affinities_values() directly. + + YANG Description: Path affinities represented as values. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=path_affinities_values.path_affinities_values, is_container='container', yang_name="path-affinities-values", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_affinities_values must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=path_affinities_values.path_affinities_values, is_container='container', yang_name="path-affinities-values", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__path_affinities_values = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_affinities_values(self): + self.__path_affinities_values = YANGDynClass(base=path_affinities_values.path_affinities_values, is_container='container', yang_name="path-affinities-values", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_path_affinity_names(self): + """ + Getter method for path_affinity_names, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_affinity_names (container) + + YANG Description: Path affinities represented as names. + """ + return self.__path_affinity_names + + def _set_path_affinity_names(self, v, load=False): + """ + Setter method for path_affinity_names, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_affinity_names (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_affinity_names is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_affinity_names() directly. + + YANG Description: Path affinities represented as names. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=path_affinity_names.path_affinity_names, is_container='container', yang_name="path-affinity-names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_affinity_names must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=path_affinity_names.path_affinity_names, is_container='container', yang_name="path-affinity-names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__path_affinity_names = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_affinity_names(self): + self.__path_affinity_names = YANGDynClass(base=path_affinity_names.path_affinity_names, is_container='container', yang_name="path-affinity-names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_path_srlgs_lists(self): + """ + Getter method for path_srlgs_lists, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_srlgs_lists (container) + + YANG Description: Path SRLG properties container. + """ + return self.__path_srlgs_lists + + def _set_path_srlgs_lists(self, v, load=False): + """ + Setter method for path_srlgs_lists, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_srlgs_lists (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_srlgs_lists is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_srlgs_lists() directly. + + YANG Description: Path SRLG properties container. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=path_srlgs_lists.path_srlgs_lists, is_container='container', yang_name="path-srlgs-lists", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_srlgs_lists must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=path_srlgs_lists.path_srlgs_lists, is_container='container', yang_name="path-srlgs-lists", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__path_srlgs_lists = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_srlgs_lists(self): + self.__path_srlgs_lists = YANGDynClass(base=path_srlgs_lists.path_srlgs_lists, is_container='container', yang_name="path-srlgs-lists", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_path_srlgs_names(self): + """ + Getter method for path_srlgs_names, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_srlgs_names (container) + + YANG Description: Container for the list of named SRLGs. + """ + return self.__path_srlgs_names + + def _set_path_srlgs_names(self, v, load=False): + """ + Setter method for path_srlgs_names, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_srlgs_names (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_srlgs_names is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_srlgs_names() directly. + + YANG Description: Container for the list of named SRLGs. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=path_srlgs_names.path_srlgs_names, is_container='container', yang_name="path-srlgs-names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_srlgs_names must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=path_srlgs_names.path_srlgs_names, is_container='container', yang_name="path-srlgs-names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__path_srlgs_names = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_srlgs_names(self): + self.__path_srlgs_names = YANGDynClass(base=path_srlgs_names.path_srlgs_names, is_container='container', yang_name="path-srlgs-names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_path_route_objects(self): + """ + Getter method for path_route_objects, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects (container) + + YANG Description: Container for the list of route objects either returned by +the computation engine or actually used by an LSP. + """ + return self.__path_route_objects + + def _set_path_route_objects(self, v, load=False): + """ + Setter method for path_route_objects, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_route_objects is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_route_objects() directly. + + YANG Description: Container for the list of route objects either returned by +the computation engine or actually used by an LSP. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=path_route_objects.path_route_objects, is_container='container', yang_name="path-route-objects", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_route_objects must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=path_route_objects.path_route_objects, is_container='container', yang_name="path-route-objects", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__path_route_objects = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_route_objects(self): + self.__path_route_objects = YANGDynClass(base=path_route_objects.path_route_objects, is_container='container', yang_name="path-route-objects", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + path_metric = __builtin__.property(_get_path_metric) + path_affinities_values = __builtin__.property(_get_path_affinities_values) + path_affinity_names = __builtin__.property(_get_path_affinity_names) + path_srlgs_lists = __builtin__.property(_get_path_srlgs_lists) + path_srlgs_names = __builtin__.property(_get_path_srlgs_names) + path_route_objects = __builtin__.property(_get_path_route_objects) + + + _pyangbind_elements = OrderedDict([('path_metric', path_metric), ('path_affinities_values', path_affinities_values), ('path_affinity_names', path_affinity_names), ('path_srlgs_lists', path_srlgs_lists), ('path_srlgs_names', path_srlgs_names), ('path_route_objects', path_route_objects), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_affinities_values/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_affinities_values/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..a7001481d1fe05d745191fdb31eca30831060363 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_affinities_values/__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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 path_affinities_value +class path_affinities_values(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/connectivity-matrix/path-properties/path-affinities-values. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Path affinities represented as values. + """ + __slots__ = ('_path_helper', '_extmethods', '__path_affinities_value',) + + _yang_name = 'path-affinities-values' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__path_affinities_value = YANGDynClass(base=YANGListType("usage",path_affinities_value.path_affinities_value, yang_name="path-affinities-value", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-affinities-value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', 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 ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'connectivity-matrix', 'path-properties', 'path-affinities-values'] + + def _get_path_affinities_value(self): + """ + Getter method for path_affinities_value, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_affinities_values/path_affinities_value (list) + + YANG Description: List of named affinity constraints. + """ + return self.__path_affinities_value + + def _set_path_affinities_value(self, v, load=False): + """ + Setter method for path_affinities_value, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_affinities_values/path_affinities_value (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_affinities_value is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_affinities_value() directly. + + YANG Description: List of named affinity constraints. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("usage",path_affinities_value.path_affinities_value, yang_name="path-affinities-value", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-affinities-value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_affinities_value must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("usage",path_affinities_value.path_affinities_value, yang_name="path-affinities-value", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-affinities-value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False)""", + }) + + self.__path_affinities_value = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_affinities_value(self): + self.__path_affinities_value = YANGDynClass(base=YANGListType("usage",path_affinities_value.path_affinities_value, yang_name="path-affinities-value", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-affinities-value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + + path_affinities_value = __builtin__.property(_get_path_affinities_value) + + + _pyangbind_elements = OrderedDict([('path_affinities_value', path_affinities_value), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_affinities_values/path_affinities_value/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_affinities_values/path_affinities_value/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..d762b99905ba2f4da909cbd5a9598f288201a26a --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_affinities_values/path_affinities_value/__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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 path_affinities_value(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/connectivity-matrix/path-properties/path-affinities-values/path-affinities-value. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: List of named affinity constraints. + """ + __slots__ = ('_path_helper', '_extmethods', '__usage','__value',) + + _yang_name = 'path-affinities-value' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__usage = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + self.__value = YANGDynClass(base=[RestrictedClassType(base_type=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}), restriction_dict={'length': ['1..11']}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}),], default=six.text_type(""), is_leaf=True, yang_name="value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='admin-groups', 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 ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'connectivity-matrix', 'path-properties', 'path-affinities-values', 'path-affinities-value'] + + def _get_usage(self): + """ + Getter method for usage, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_affinities_values/path_affinities_value/usage (identityref) + + YANG Description: Identifies an entry in the list of value affinity +constraints. + """ + return self.__usage + + def _set_usage(self, v, load=False): + """ + Setter method for usage, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_affinities_values/path_affinities_value/usage (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_usage is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_usage() directly. + + YANG Description: Identifies an entry in the list of value affinity +constraints. + """ + 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=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """usage must be of a type compatible with identityref""", + 'defined-type': "ietf-te-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False)""", + }) + + self.__usage = t + if hasattr(self, '_set'): + self._set() + + def _unset_usage(self): + self.__usage = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + + + def _get_value(self): + """ + Getter method for value, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_affinities_values/path_affinities_value/value (admin-groups) + + YANG Description: The affinity value. The default is empty. + """ + return self.__value + + def _set_value(self, v, load=False): + """ + Setter method for value, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_affinities_values/path_affinities_value/value (admin-groups) + 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: The affinity value. The default is empty. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=[RestrictedClassType(base_type=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}), restriction_dict={'length': ['1..11']}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}),], default=six.text_type(""), is_leaf=True, yang_name="value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='admin-groups', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """value must be of a type compatible with admin-groups""", + 'defined-type': "ietf-te-topology:admin-groups", + 'generated-type': """YANGDynClass(base=[RestrictedClassType(base_type=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}), restriction_dict={'length': ['1..11']}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}),], default=six.text_type(""), is_leaf=True, yang_name="value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='admin-groups', is_config=False)""", + }) + + self.__value = t + if hasattr(self, '_set'): + self._set() + + def _unset_value(self): + self.__value = YANGDynClass(base=[RestrictedClassType(base_type=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}), restriction_dict={'length': ['1..11']}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}),], default=six.text_type(""), is_leaf=True, yang_name="value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='admin-groups', is_config=False) + + usage = __builtin__.property(_get_usage) + value = __builtin__.property(_get_value) + + + _pyangbind_elements = OrderedDict([('usage', usage), ('value', value), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_affinity_names/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_affinity_names/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..76beb2d043e11712fd3250aba4b173cb346ef2a2 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_affinity_names/__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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 path_affinity_name +class path_affinity_names(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/connectivity-matrix/path-properties/path-affinity-names. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Path affinities represented as names. + """ + __slots__ = ('_path_helper', '_extmethods', '__path_affinity_name',) + + _yang_name = 'path-affinity-names' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__path_affinity_name = YANGDynClass(base=YANGListType("usage",path_affinity_name.path_affinity_name, yang_name="path-affinity-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-affinity-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', 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 ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'connectivity-matrix', 'path-properties', 'path-affinity-names'] + + def _get_path_affinity_name(self): + """ + Getter method for path_affinity_name, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_affinity_names/path_affinity_name (list) + + YANG Description: List of named affinity constraints. + """ + return self.__path_affinity_name + + def _set_path_affinity_name(self, v, load=False): + """ + Setter method for path_affinity_name, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_affinity_names/path_affinity_name (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_affinity_name is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_affinity_name() directly. + + YANG Description: List of named affinity constraints. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("usage",path_affinity_name.path_affinity_name, yang_name="path-affinity-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-affinity-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_affinity_name must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("usage",path_affinity_name.path_affinity_name, yang_name="path-affinity-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-affinity-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False)""", + }) + + self.__path_affinity_name = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_affinity_name(self): + self.__path_affinity_name = YANGDynClass(base=YANGListType("usage",path_affinity_name.path_affinity_name, yang_name="path-affinity-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-affinity-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + + path_affinity_name = __builtin__.property(_get_path_affinity_name) + + + _pyangbind_elements = OrderedDict([('path_affinity_name', path_affinity_name), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_affinity_names/path_affinity_name/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_affinity_names/path_affinity_name/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..04f8c534e27f69735f535d5f843ca92a6b49cb57 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_affinity_names/path_affinity_name/__init__.py @@ -0,0 +1,162 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 affinity_name +class path_affinity_name(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/connectivity-matrix/path-properties/path-affinity-names/path-affinity-name. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: List of named affinity constraints. + """ + __slots__ = ('_path_helper', '_extmethods', '__usage','__affinity_name',) + + _yang_name = 'path-affinity-name' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__usage = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + self.__affinity_name = YANGDynClass(base=YANGListType("name",affinity_name.affinity_name, yang_name="affinity-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='name', extensions=None), is_container='list', yang_name="affinity-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', 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 ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'connectivity-matrix', 'path-properties', 'path-affinity-names', 'path-affinity-name'] + + def _get_usage(self): + """ + Getter method for usage, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_affinity_names/path_affinity_name/usage (identityref) + + YANG Description: Identifies an entry in the list of named affinity +constraints. + """ + return self.__usage + + def _set_usage(self, v, load=False): + """ + Setter method for usage, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_affinity_names/path_affinity_name/usage (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_usage is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_usage() directly. + + YANG Description: Identifies an entry in the list of named affinity +constraints. + """ + 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=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """usage must be of a type compatible with identityref""", + 'defined-type': "ietf-te-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False)""", + }) + + self.__usage = t + if hasattr(self, '_set'): + self._set() + + def _unset_usage(self): + self.__usage = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + + + def _get_affinity_name(self): + """ + Getter method for affinity_name, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_affinity_names/path_affinity_name/affinity_name (list) + + YANG Description: List of named affinities. + """ + return self.__affinity_name + + def _set_affinity_name(self, v, load=False): + """ + Setter method for affinity_name, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_affinity_names/path_affinity_name/affinity_name (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_affinity_name is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_affinity_name() directly. + + YANG Description: List of named affinities. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("name",affinity_name.affinity_name, yang_name="affinity-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='name', extensions=None), is_container='list', yang_name="affinity-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """affinity_name must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("name",affinity_name.affinity_name, yang_name="affinity-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='name', extensions=None), is_container='list', yang_name="affinity-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False)""", + }) + + self.__affinity_name = t + if hasattr(self, '_set'): + self._set() + + def _unset_affinity_name(self): + self.__affinity_name = YANGDynClass(base=YANGListType("name",affinity_name.affinity_name, yang_name="affinity-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='name', extensions=None), is_container='list', yang_name="affinity-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + + usage = __builtin__.property(_get_usage) + affinity_name = __builtin__.property(_get_affinity_name) + + + _pyangbind_elements = OrderedDict([('usage', usage), ('affinity_name', affinity_name), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_affinity_names/path_affinity_name/affinity_name/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_affinity_names/path_affinity_name/affinity_name/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..c8ffc56297616e8c0ef51adc8c6259cdff46a40c --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_affinity_names/path_affinity_name/affinity_name/__init__.py @@ -0,0 +1,120 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 affinity_name(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/connectivity-matrix/path-properties/path-affinity-names/path-affinity-name/affinity-name. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: List of named affinities. + """ + __slots__ = ('_path_helper', '_extmethods', '__name',) + + _yang_name = 'affinity-name' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _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='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', 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 ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'connectivity-matrix', 'path-properties', 'path-affinity-names', 'path-affinity-name', 'affinity-name'] + + def _get_name(self): + """ + Getter method for name, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_affinity_names/path_affinity_name/affinity_name/name (string) + + YANG Description: Identifies a named affinity entry. + """ + return self.__name + + def _set_name(self, v, load=False): + """ + Setter method for name, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_affinity_names/path_affinity_name/affinity_name/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: Identifies a named affinity entry. + """ + 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='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', 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, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', 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, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=False) + + name = __builtin__.property(_get_name) + + + _pyangbind_elements = OrderedDict([('name', name), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_metric/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_metric/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..6bea27715a4189f606ae688a2d7c9669622fd8eb --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_metric/__init__.py @@ -0,0 +1,159 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 path_metric(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/connectivity-matrix/path-properties/path-metric. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: TE path metric type. + """ + __slots__ = ('_path_helper', '_extmethods', '__metric_type','__accumulative_value',) + + _yang_name = 'path-metric' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__metric_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="metric-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + self.__accumulative_value = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="accumulative-value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', 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 ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'connectivity-matrix', 'path-properties', 'path-metric'] + + def _get_metric_type(self): + """ + Getter method for metric_type, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_metric/metric_type (identityref) + + YANG Description: TE path metric type. + """ + return self.__metric_type + + def _set_metric_type(self, v, load=False): + """ + Setter method for metric_type, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_metric/metric_type (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_metric_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_metric_type() directly. + + YANG Description: TE path metric type. + """ + 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=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="metric-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """metric_type must be of a type compatible with identityref""", + 'defined-type': "ietf-te-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="metric-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False)""", + }) + + self.__metric_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_metric_type(self): + self.__metric_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="metric-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + + + def _get_accumulative_value(self): + """ + Getter method for accumulative_value, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_metric/accumulative_value (uint64) + + YANG Description: TE path metric accumulative value. + """ + return self.__accumulative_value + + def _set_accumulative_value(self, v, load=False): + """ + Setter method for accumulative_value, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_metric/accumulative_value (uint64) + If this variable is read-only (config: false) in the + source YANG file, then _set_accumulative_value is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_accumulative_value() directly. + + YANG Description: TE path metric accumulative value. + """ + 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="accumulative-value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint64', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """accumulative_value 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="accumulative-value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint64', is_config=False)""", + }) + + self.__accumulative_value = t + if hasattr(self, '_set'): + self._set() + + def _unset_accumulative_value(self): + self.__accumulative_value = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="accumulative-value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint64', is_config=False) + + metric_type = __builtin__.property(_get_metric_type) + accumulative_value = __builtin__.property(_get_accumulative_value) + + + _pyangbind_elements = OrderedDict([('metric_type', metric_type), ('accumulative_value', accumulative_value), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..fb3b4a46db89df48d7ecd89e13f170acb5408422 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/__init__.py @@ -0,0 +1,119 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 path_route_object +class path_route_objects(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/connectivity-matrix/path-properties/path-route-objects. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Container for the list of route objects either returned by +the computation engine or actually used by an LSP. + """ + __slots__ = ('_path_helper', '_extmethods', '__path_route_object',) + + _yang_name = 'path-route-objects' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__path_route_object = YANGDynClass(base=YANGListType("index",path_route_object.path_route_object, yang_name="path-route-object", parent=self, is_container='list', user_ordered=True, path_helper=self._path_helper, yang_keys='index', extensions=None), is_container='list', yang_name="path-route-object", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', 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 ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'connectivity-matrix', 'path-properties', 'path-route-objects'] + + def _get_path_route_object(self): + """ + Getter method for path_route_object, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object (list) + + YANG Description: List of route objects either returned by the computation +engine or actually used by an LSP. + """ + return self.__path_route_object + + def _set_path_route_object(self, v, load=False): + """ + Setter method for path_route_object, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_route_object is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_route_object() directly. + + YANG Description: List of route objects either returned by the computation +engine or actually used by an LSP. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("index",path_route_object.path_route_object, yang_name="path-route-object", parent=self, is_container='list', user_ordered=True, path_helper=self._path_helper, yang_keys='index', extensions=None), is_container='list', yang_name="path-route-object", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_route_object must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("index",path_route_object.path_route_object, yang_name="path-route-object", parent=self, is_container='list', user_ordered=True, path_helper=self._path_helper, yang_keys='index', extensions=None), is_container='list', yang_name="path-route-object", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False)""", + }) + + self.__path_route_object = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_route_object(self): + self.__path_route_object = YANGDynClass(base=YANGListType("index",path_route_object.path_route_object, yang_name="path-route-object", parent=self, is_container='list', user_ordered=True, path_helper=self._path_helper, yang_keys='index', extensions=None), is_container='list', yang_name="path-route-object", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + + path_route_object = __builtin__.property(_get_path_route_object) + + + _pyangbind_elements = OrderedDict([('path_route_object', path_route_object), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..4fe9aa220c102f6cab8ad5d063130942e104a057 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/__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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 numbered_node_hop +from . import numbered_link_hop +from . import unnumbered_link_hop +from . import as_number_hop +from . import label_hop +class path_route_object(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/connectivity-matrix/path-properties/path-route-objects/path-route-object. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: List of route objects either returned by the computation +engine or actually used by an LSP. + """ + __slots__ = ('_path_helper', '_extmethods', '__index','__numbered_node_hop','__numbered_link_hop','__unnumbered_link_hop','__as_number_hop','__label_hop',) + + _yang_name = 'path-route-object' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _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), is_leaf=True, yang_name="index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=False) + self.__numbered_node_hop = YANGDynClass(base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__numbered_link_hop = YANGDynClass(base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__unnumbered_link_hop = YANGDynClass(base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__as_number_hop = YANGDynClass(base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__label_hop = YANGDynClass(base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', 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 ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'connectivity-matrix', 'path-properties', 'path-route-objects', 'path-route-object'] + + def _get_index(self): + """ + Getter method for index, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/index (uint32) + + YANG Description: Route object entry index. The index is used to +identify an entry in the list. The order of entries +is defined by the user without relying on key +values. + """ + return self.__index + + def _set_index(self, v, load=False): + """ + Setter method for index, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/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: Route object entry index. The index is used to +identify an entry in the list. The order of entries +is defined by the user without relying on key +values. + """ + 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=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', 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), is_leaf=True, yang_name="index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', 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), is_leaf=True, yang_name="index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=False) + + + def _get_numbered_node_hop(self): + """ + Getter method for numbered_node_hop, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/numbered_node_hop (container) + + YANG Description: Numbered node route hop. + """ + return self.__numbered_node_hop + + def _set_numbered_node_hop(self, v, load=False): + """ + Setter method for numbered_node_hop, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/numbered_node_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_numbered_node_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_numbered_node_hop() directly. + + YANG Description: Numbered node route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """numbered_node_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__numbered_node_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_numbered_node_hop(self): + self.__numbered_node_hop = YANGDynClass(base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_numbered_link_hop(self): + """ + Getter method for numbered_link_hop, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/numbered_link_hop (container) + + YANG Description: Numbered link explicit route hop. + """ + return self.__numbered_link_hop + + def _set_numbered_link_hop(self, v, load=False): + """ + Setter method for numbered_link_hop, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/numbered_link_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_numbered_link_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_numbered_link_hop() directly. + + YANG Description: Numbered link explicit route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """numbered_link_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__numbered_link_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_numbered_link_hop(self): + self.__numbered_link_hop = YANGDynClass(base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_unnumbered_link_hop(self): + """ + Getter method for unnumbered_link_hop, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/unnumbered_link_hop (container) + + YANG Description: Unnumbered link explicit route hop. + """ + return self.__unnumbered_link_hop + + def _set_unnumbered_link_hop(self, v, load=False): + """ + Setter method for unnumbered_link_hop, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/unnumbered_link_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_unnumbered_link_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_unnumbered_link_hop() directly. + + YANG Description: Unnumbered link explicit route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """unnumbered_link_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__unnumbered_link_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_unnumbered_link_hop(self): + self.__unnumbered_link_hop = YANGDynClass(base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_as_number_hop(self): + """ + Getter method for as_number_hop, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/as_number_hop (container) + + YANG Description: AS explicit route hop. + """ + return self.__as_number_hop + + def _set_as_number_hop(self, v, load=False): + """ + Setter method for as_number_hop, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/as_number_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_as_number_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_as_number_hop() directly. + + YANG Description: AS explicit route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """as_number_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__as_number_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_as_number_hop(self): + self.__as_number_hop = YANGDynClass(base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_label_hop(self): + """ + Getter method for label_hop, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/label_hop (container) + + YANG Description: Label hop type. + """ + return self.__label_hop + + def _set_label_hop(self, v, load=False): + """ + Setter method for label_hop, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/label_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_label_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_label_hop() directly. + + YANG Description: Label hop type. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """label_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__label_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_label_hop(self): + self.__label_hop = YANGDynClass(base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + index = __builtin__.property(_get_index) + numbered_node_hop = __builtin__.property(_get_numbered_node_hop) + numbered_link_hop = __builtin__.property(_get_numbered_link_hop) + unnumbered_link_hop = __builtin__.property(_get_unnumbered_link_hop) + as_number_hop = __builtin__.property(_get_as_number_hop) + label_hop = __builtin__.property(_get_label_hop) + + __choices__ = {'type': {'numbered-node-hop': ['numbered_node_hop'], 'numbered-link-hop': ['numbered_link_hop'], 'unnumbered-link-hop': ['unnumbered_link_hop'], 'as-number': ['as_number_hop'], 'label': ['label_hop']}} + _pyangbind_elements = OrderedDict([('index', index), ('numbered_node_hop', numbered_node_hop), ('numbered_link_hop', numbered_link_hop), ('unnumbered_link_hop', unnumbered_link_hop), ('as_number_hop', as_number_hop), ('label_hop', label_hop), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/as_number_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/as_number_hop/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..11ddae41732894db4171b3106af40634574da943 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/as_number_hop/__init__.py @@ -0,0 +1,154 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 as_number_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/connectivity-matrix/path-properties/path-route-objects/path-route-object/as-number-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: AS explicit route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__as_number','__hop_type',) + + _yang_name = 'as-number-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__as_number = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=False) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', 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 ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'connectivity-matrix', 'path-properties', 'path-route-objects', 'path-route-object', 'as-number-hop'] + + def _get_as_number(self): + """ + Getter method for as_number, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/as_number_hop/as_number (inet:as-number) + + YANG Description: The Autonomous System (AS) number. + """ + return self.__as_number + + def _set_as_number(self, v, load=False): + """ + Setter method for as_number, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/as_number_hop/as_number (inet:as-number) + If this variable is read-only (config: false) in the + source YANG file, then _set_as_number is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_as_number() directly. + + YANG Description: The Autonomous System (AS) number. + """ + 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="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """as_number must be of a type compatible with inet:as-number""", + 'defined-type': "inet:as-number", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=False)""", + }) + + self.__as_number = t + if hasattr(self, '_set'): + self._set() + + def _unset_as_number(self): + self.__as_number = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=False) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/as_number_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/as_number_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + 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={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + + as_number = __builtin__.property(_get_as_number) + hop_type = __builtin__.property(_get_hop_type) + + __choices__ = {'type': {'as-number': ['as_number', 'hop_type']}} + _pyangbind_elements = OrderedDict([('as_number', as_number), ('hop_type', hop_type), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/label_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/label_hop/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..7440b873293ac0528b33accb58edf95a7c6a562b --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/label_hop/__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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 te_label +class label_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/connectivity-matrix/path-properties/path-route-objects/path-route-object/label-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Label hop type. + """ + __slots__ = ('_path_helper', '_extmethods', '__te_label',) + + _yang_name = 'label-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__te_label = YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', 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 ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'connectivity-matrix', 'path-properties', 'path-route-objects', 'path-route-object', 'label-hop'] + + def _get_te_label(self): + """ + Getter method for te_label, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/label_hop/te_label (container) + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + return self.__te_label + + def _set_te_label(self, v, load=False): + """ + Setter method for te_label, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/label_hop/te_label (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_te_label is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_te_label() directly. + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """te_label must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__te_label = t + if hasattr(self, '_set'): + self._set() + + def _unset_te_label(self): + self.__te_label = YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + te_label = __builtin__.property(_get_te_label) + + __choices__ = {'type': {'label': ['te_label']}} + _pyangbind_elements = OrderedDict([('te_label', te_label), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/label_hop/te_label/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/label_hop/te_label/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..6fc49cf759876cd11163a8421fb14c132f5d2909 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/label_hop/te_label/__init__.py @@ -0,0 +1,234 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 otn +class te_label(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/connectivity-matrix/path-properties/path-route-objects/path-route-object/label-hop/te-label. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + __slots__ = ('_path_helper', '_extmethods', '__generic','__otn','__vlanid','__direction',) + + _yang_name = 'te-label' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__generic = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=False) + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False) + self.__vlanid = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=False) + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', 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 ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'connectivity-matrix', 'path-properties', 'path-route-objects', 'path-route-object', 'label-hop', 'te-label'] + + def _get_generic(self): + """ + Getter method for generic, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/label_hop/te_label/generic (rt-types:generalized-label) + + YANG Description: TE label specified in a generic format. + """ + return self.__generic + + def _set_generic(self, v, load=False): + """ + Setter method for generic, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/label_hop/te_label/generic (rt-types:generalized-label) + If this variable is read-only (config: false) in the + source YANG file, then _set_generic is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_generic() directly. + + YANG Description: TE label specified in a generic format. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """generic must be of a type compatible with rt-types:generalized-label""", + 'defined-type': "rt-types:generalized-label", + 'generated-type': """YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=False)""", + }) + + self.__generic = t + if hasattr(self, '_set'): + self._set() + + def _unset_generic(self): + self.__generic = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=False) + + + def _get_otn(self): + """ + Getter method for otn, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/label_hop/te_label/otn (container) + + YANG Description: Label hop for OTN. + """ + return self.__otn + + def _set_otn(self, v, load=False): + """ + Setter method for otn, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/label_hop/te_label/otn (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_otn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_otn() directly. + + YANG Description: Label hop for OTN. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """otn must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False)""", + }) + + self.__otn = t + if hasattr(self, '_set'): + self._set() + + def _unset_otn(self): + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False) + + + def _get_vlanid(self): + """ + Getter method for vlanid, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/label_hop/te_label/vlanid (etht-types:vlanid) + + YANG Description: VLAN tag id. + """ + return self.__vlanid + + def _set_vlanid(self, v, load=False): + """ + Setter method for vlanid, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/label_hop/te_label/vlanid (etht-types:vlanid) + If this variable is read-only (config: false) in the + source YANG file, then _set_vlanid is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_vlanid() directly. + + YANG Description: VLAN tag id. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """vlanid must be of a type compatible with etht-types:vlanid""", + 'defined-type': "etht-types:vlanid", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=False)""", + }) + + self.__vlanid = t + if hasattr(self, '_set'): + self._set() + + def _unset_vlanid(self): + self.__vlanid = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=False) + + + def _get_direction(self): + """ + Getter method for direction, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/label_hop/te_label/direction (te-label-direction) + + YANG Description: Label direction. + """ + return self.__direction + + def _set_direction(self, v, load=False): + """ + Setter method for direction, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/label_hop/te_label/direction (te-label-direction) + If this variable is read-only (config: false) in the + source YANG file, then _set_direction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_direction() directly. + + YANG Description: Label direction. + """ + 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={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """direction must be of a type compatible with te-label-direction""", + 'defined-type': "ietf-te-topology:te-label-direction", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=False)""", + }) + + self.__direction = t + if hasattr(self, '_set'): + self._set() + + def _unset_direction(self): + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=False) + + generic = __builtin__.property(_get_generic) + otn = __builtin__.property(_get_otn) + vlanid = __builtin__.property(_get_vlanid) + direction = __builtin__.property(_get_direction) + + __choices__ = {'technology': {'generic': ['generic'], 'otn': ['otn'], 'eth': ['vlanid']}, 'type': {'label': ['direction']}} + _pyangbind_elements = OrderedDict([('generic', generic), ('otn', otn), ('vlanid', vlanid), ('direction', direction), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/label_hop/te_label/otn/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/label_hop/te_label/otn/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..d758b29226ac9b1c81c34b3c87bb7073301fcb4a --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/label_hop/te_label/otn/__init__.py @@ -0,0 +1,209 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 otn(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/connectivity-matrix/path-properties/path-route-objects/path-route-object/label-hop/te-label/otn. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Label hop for OTN. + """ + __slots__ = ('_path_helper', '_extmethods', '__tpn','__tsg','__ts_list',) + + _yang_name = 'otn' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__tpn = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=False) + self.__tsg = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=False) + self.__ts_list = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', 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 ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'connectivity-matrix', 'path-properties', 'path-route-objects', 'path-route-object', 'label-hop', 'te-label', 'otn'] + + def _get_tpn(self): + """ + Getter method for tpn, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/label_hop/te_label/otn/tpn (otn-tpn) + + YANG Description: Tributary Port Number (TPN). + """ + return self.__tpn + + def _set_tpn(self, v, load=False): + """ + Setter method for tpn, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/label_hop/te_label/otn/tpn (otn-tpn) + If this variable is read-only (config: false) in the + source YANG file, then _set_tpn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tpn() directly. + + YANG Description: Tributary Port Number (TPN). + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tpn must be of a type compatible with otn-tpn""", + 'defined-type': "ietf-otn-topology:otn-tpn", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=False)""", + }) + + self.__tpn = t + if hasattr(self, '_set'): + self._set() + + def _unset_tpn(self): + self.__tpn = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=False) + + + def _get_tsg(self): + """ + Getter method for tsg, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/label_hop/te_label/otn/tsg (identityref) + + YANG Description: Tributary Slot Granularity (TSG). + """ + return self.__tsg + + def _set_tsg(self, v, load=False): + """ + Setter method for tsg, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/label_hop/te_label/otn/tsg (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_tsg is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tsg() directly. + + YANG Description: Tributary Slot Granularity (TSG). + """ + 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={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tsg must be of a type compatible with identityref""", + 'defined-type': "ietf-otn-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=False)""", + }) + + self.__tsg = t + if hasattr(self, '_set'): + self._set() + + def _unset_tsg(self): + self.__tsg = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=False) + + + def _get_ts_list(self): + """ + Getter method for ts_list, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/label_hop/te_label/otn/ts_list (string) + + YANG Description: A list of available Tributary Slots (TS) ranging + + + + +between 1 and 4095. If multiple values or +ranges are given, they all MUST be disjoint +and MUST be in ascending order. +For example 1-20,25,50-1000. + """ + return self.__ts_list + + def _set_ts_list(self, v, load=False): + """ + Setter method for ts_list, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/label_hop/te_label/otn/ts_list (string) + If this variable is read-only (config: false) in the + source YANG file, then _set_ts_list is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_ts_list() directly. + + YANG Description: A list of available Tributary Slots (TS) ranging + + + + +between 1 and 4095. If multiple values or +ranges are given, they all MUST be disjoint +and MUST be in ascending order. +For example 1-20,25,50-1000. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='string', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """ts_list must be of a type compatible with string""", + 'defined-type': "string", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='string', is_config=False)""", + }) + + self.__ts_list = t + if hasattr(self, '_set'): + self._set() + + def _unset_ts_list(self): + self.__ts_list = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='string', is_config=False) + + tpn = __builtin__.property(_get_tpn) + tsg = __builtin__.property(_get_tsg) + ts_list = __builtin__.property(_get_ts_list) + + __choices__ = {'technology': {'otn': ['tpn', 'tsg', 'ts_list']}} + _pyangbind_elements = OrderedDict([('tpn', tpn), ('tsg', tsg), ('ts_list', ts_list), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/numbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/numbered_link_hop/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..a1a29aebbc711d38d528577295264d3d5c3dba83 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/numbered_link_hop/__init__.py @@ -0,0 +1,193 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 numbered_link_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/connectivity-matrix/path-properties/path-route-objects/path-route-object/numbered-link-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Numbered link explicit route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__link_tp_id','__hop_type','__direction',) + + _yang_name = 'numbered-link-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=False) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', 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 ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'connectivity-matrix', 'path-properties', 'path-route-objects', 'path-route-object', 'numbered-link-hop'] + + def _get_link_tp_id(self): + """ + Getter method for link_tp_id, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/numbered_link_hop/link_tp_id (te-tp-id) + + YANG Description: TE Link Termination Point (LTP) identifier. + """ + return self.__link_tp_id + + def _set_link_tp_id(self, v, load=False): + """ + Setter method for link_tp_id, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/numbered_link_hop/link_tp_id (te-tp-id) + If this variable is read-only (config: false) in the + source YANG file, then _set_link_tp_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_link_tp_id() directly. + + YANG Description: TE Link Termination Point (LTP) identifier. + """ + 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),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """link_tp_id must be of a type compatible with te-tp-id""", + 'defined-type': "ietf-te-topology:te-tp-id", + 'generated-type': """YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=False)""", + }) + + self.__link_tp_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_link_tp_id(self): + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=False) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/numbered_link_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/numbered_link_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + 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={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + + + def _get_direction(self): + """ + Getter method for direction, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/numbered_link_hop/direction (te-link-direction) + + YANG Description: Link route object direction. + """ + return self.__direction + + def _set_direction(self, v, load=False): + """ + Setter method for direction, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/numbered_link_hop/direction (te-link-direction) + If this variable is read-only (config: false) in the + source YANG file, then _set_direction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_direction() directly. + + YANG Description: Link route object direction. + """ + 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={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """direction must be of a type compatible with te-link-direction""", + 'defined-type': "ietf-te-topology:te-link-direction", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=False)""", + }) + + self.__direction = t + if hasattr(self, '_set'): + self._set() + + def _unset_direction(self): + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=False) + + link_tp_id = __builtin__.property(_get_link_tp_id) + hop_type = __builtin__.property(_get_hop_type) + direction = __builtin__.property(_get_direction) + + __choices__ = {'type': {'numbered-link-hop': ['link_tp_id', 'hop_type', 'direction']}} + _pyangbind_elements = OrderedDict([('link_tp_id', link_tp_id), ('hop_type', hop_type), ('direction', direction), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/numbered_node_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/numbered_node_hop/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..4ca5c4eec4cb58ba2efcd873b465fe51825cc7a2 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/numbered_node_hop/__init__.py @@ -0,0 +1,154 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 numbered_node_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/connectivity-matrix/path-properties/path-route-objects/path-route-object/numbered-node-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Numbered node route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__node_id','__hop_type',) + + _yang_name = 'numbered-node-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=False) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', 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 ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'connectivity-matrix', 'path-properties', 'path-route-objects', 'path-route-object', 'numbered-node-hop'] + + def _get_node_id(self): + """ + Getter method for node_id, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/numbered_node_hop/node_id (te-node-id) + + YANG Description: The identifier of a node in the TE topology. + """ + return self.__node_id + + def _set_node_id(self, v, load=False): + """ + Setter method for node_id, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/numbered_node_hop/node_id (te-node-id) + 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. + + YANG Description: The identifier of a node in the TE topology. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """node_id must be of a type compatible with te-node-id""", + 'defined-type': "ietf-te-topology:te-node-id", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=False)""", + }) + + self.__node_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_node_id(self): + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=False) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/numbered_node_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/numbered_node_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + 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={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + + node_id = __builtin__.property(_get_node_id) + hop_type = __builtin__.property(_get_hop_type) + + __choices__ = {'type': {'numbered-node-hop': ['node_id', 'hop_type']}} + _pyangbind_elements = OrderedDict([('node_id', node_id), ('hop_type', hop_type), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/unnumbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/unnumbered_link_hop/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..3ec157d352f1bbfa6708487d795d11781a395aa0 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/unnumbered_link_hop/__init__.py @@ -0,0 +1,236 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 unnumbered_link_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/connectivity-matrix/path-properties/path-route-objects/path-route-object/unnumbered-link-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Unnumbered link explicit route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__link_tp_id','__node_id','__hop_type','__direction',) + + _yang_name = 'unnumbered-link-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=False) + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=False) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', 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 ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'connectivity-matrix', 'path-properties', 'path-route-objects', 'path-route-object', 'unnumbered-link-hop'] + + def _get_link_tp_id(self): + """ + Getter method for link_tp_id, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/unnumbered_link_hop/link_tp_id (te-tp-id) + + YANG Description: TE LTP identifier. The combination of the TE link ID +and the TE node ID is used to identify an unnumbered +TE link. + """ + return self.__link_tp_id + + def _set_link_tp_id(self, v, load=False): + """ + Setter method for link_tp_id, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/unnumbered_link_hop/link_tp_id (te-tp-id) + If this variable is read-only (config: false) in the + source YANG file, then _set_link_tp_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_link_tp_id() directly. + + YANG Description: TE LTP identifier. The combination of the TE link ID +and the TE node ID is used to identify an unnumbered +TE link. + """ + 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),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """link_tp_id must be of a type compatible with te-tp-id""", + 'defined-type': "ietf-te-topology:te-tp-id", + 'generated-type': """YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=False)""", + }) + + self.__link_tp_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_link_tp_id(self): + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=False) + + + def _get_node_id(self): + """ + Getter method for node_id, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/unnumbered_link_hop/node_id (te-node-id) + + YANG Description: The identifier of a node in the TE topology. + """ + return self.__node_id + + def _set_node_id(self, v, load=False): + """ + Setter method for node_id, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/unnumbered_link_hop/node_id (te-node-id) + 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. + + YANG Description: The identifier of a node in the TE topology. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """node_id must be of a type compatible with te-node-id""", + 'defined-type': "ietf-te-topology:te-node-id", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=False)""", + }) + + self.__node_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_node_id(self): + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=False) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/unnumbered_link_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/unnumbered_link_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + 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={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + + + def _get_direction(self): + """ + Getter method for direction, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/unnumbered_link_hop/direction (te-link-direction) + + YANG Description: Link route object direction. + """ + return self.__direction + + def _set_direction(self, v, load=False): + """ + Setter method for direction, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/unnumbered_link_hop/direction (te-link-direction) + If this variable is read-only (config: false) in the + source YANG file, then _set_direction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_direction() directly. + + YANG Description: Link route object direction. + """ + 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={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """direction must be of a type compatible with te-link-direction""", + 'defined-type': "ietf-te-topology:te-link-direction", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=False)""", + }) + + self.__direction = t + if hasattr(self, '_set'): + self._set() + + def _unset_direction(self): + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=False) + + link_tp_id = __builtin__.property(_get_link_tp_id) + node_id = __builtin__.property(_get_node_id) + hop_type = __builtin__.property(_get_hop_type) + direction = __builtin__.property(_get_direction) + + __choices__ = {'type': {'unnumbered-link-hop': ['link_tp_id', 'node_id', 'hop_type', 'direction']}} + _pyangbind_elements = OrderedDict([('link_tp_id', link_tp_id), ('node_id', node_id), ('hop_type', hop_type), ('direction', direction), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_srlgs_lists/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_srlgs_lists/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e509790c476b91a55c605ae6848e7eb92fa72aaa --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_srlgs_lists/__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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 path_srlgs_list +class path_srlgs_lists(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/connectivity-matrix/path-properties/path-srlgs-lists. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Path SRLG properties container. + """ + __slots__ = ('_path_helper', '_extmethods', '__path_srlgs_list',) + + _yang_name = 'path-srlgs-lists' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__path_srlgs_list = YANGDynClass(base=YANGListType("usage",path_srlgs_list.path_srlgs_list, yang_name="path-srlgs-list", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-srlgs-list", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', 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 ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'connectivity-matrix', 'path-properties', 'path-srlgs-lists'] + + def _get_path_srlgs_list(self): + """ + Getter method for path_srlgs_list, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_srlgs_lists/path_srlgs_list (list) + + YANG Description: List of SRLG values to be included or excluded. + """ + return self.__path_srlgs_list + + def _set_path_srlgs_list(self, v, load=False): + """ + Setter method for path_srlgs_list, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_srlgs_lists/path_srlgs_list (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_srlgs_list is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_srlgs_list() directly. + + YANG Description: List of SRLG values to be included or excluded. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("usage",path_srlgs_list.path_srlgs_list, yang_name="path-srlgs-list", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-srlgs-list", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_srlgs_list must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("usage",path_srlgs_list.path_srlgs_list, yang_name="path-srlgs-list", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-srlgs-list", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False)""", + }) + + self.__path_srlgs_list = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_srlgs_list(self): + self.__path_srlgs_list = YANGDynClass(base=YANGListType("usage",path_srlgs_list.path_srlgs_list, yang_name="path-srlgs-list", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-srlgs-list", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + + path_srlgs_list = __builtin__.property(_get_path_srlgs_list) + + + _pyangbind_elements = OrderedDict([('path_srlgs_list', path_srlgs_list), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_srlgs_lists/path_srlgs_list/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_srlgs_lists/path_srlgs_list/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..37a85c235cb877b698286f524cb2bd949e72954c --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_srlgs_lists/path_srlgs_list/__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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 path_srlgs_list(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/connectivity-matrix/path-properties/path-srlgs-lists/path-srlgs-list. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: List of SRLG values to be included or excluded. + """ + __slots__ = ('_path_helper', '_extmethods', '__usage','__values',) + + _yang_name = 'path-srlgs-list' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__usage = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + self.__values = YANGDynClass(unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32)), is_leaf=False, yang_name="values", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='srlg', 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 ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'connectivity-matrix', 'path-properties', 'path-srlgs-lists', 'path-srlgs-list'] + + def _get_usage(self): + """ + Getter method for usage, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_srlgs_lists/path_srlgs_list/usage (identityref) + + YANG Description: Identifies an entry in a list of SRLGs to either +include or exclude. + """ + return self.__usage + + def _set_usage(self, v, load=False): + """ + Setter method for usage, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_srlgs_lists/path_srlgs_list/usage (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_usage is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_usage() directly. + + YANG Description: Identifies an entry in a list of SRLGs to either +include or exclude. + """ + 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=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """usage must be of a type compatible with identityref""", + 'defined-type': "ietf-te-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False)""", + }) + + self.__usage = t + if hasattr(self, '_set'): + self._set() + + def _unset_usage(self): + self.__usage = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + + + def _get_values(self): + """ + Getter method for values, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_srlgs_lists/path_srlgs_list/values (srlg) + + YANG Description: List of SRLG values. + """ + return self.__values + + def _set_values(self, v, load=False): + """ + Setter method for values, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_srlgs_lists/path_srlgs_list/values (srlg) + If this variable is read-only (config: false) in the + source YANG file, then _set_values is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_values() directly. + + YANG Description: List of SRLG values. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32)), is_leaf=False, yang_name="values", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='srlg', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """values must be of a type compatible with srlg""", + 'defined-type': "ietf-te-topology:srlg", + 'generated-type': """YANGDynClass(unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32)), is_leaf=False, yang_name="values", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='srlg', is_config=False)""", + }) + + self.__values = t + if hasattr(self, '_set'): + self._set() + + def _unset_values(self): + self.__values = YANGDynClass(unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32)), is_leaf=False, yang_name="values", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='srlg', is_config=False) + + usage = __builtin__.property(_get_usage) + values = __builtin__.property(_get_values) + + + _pyangbind_elements = OrderedDict([('usage', usage), ('values', values), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_srlgs_names/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_srlgs_names/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..4e96bae2f4b7f9606d0cfe24d4b04fc9e59dd9f5 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_srlgs_names/__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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 path_srlgs_name +class path_srlgs_names(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/connectivity-matrix/path-properties/path-srlgs-names. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Container for the list of named SRLGs. + """ + __slots__ = ('_path_helper', '_extmethods', '__path_srlgs_name',) + + _yang_name = 'path-srlgs-names' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__path_srlgs_name = YANGDynClass(base=YANGListType("usage",path_srlgs_name.path_srlgs_name, yang_name="path-srlgs-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-srlgs-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', 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 ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'connectivity-matrix', 'path-properties', 'path-srlgs-names'] + + def _get_path_srlgs_name(self): + """ + Getter method for path_srlgs_name, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_srlgs_names/path_srlgs_name (list) + + YANG Description: List of named SRLGs to be included or excluded. + """ + return self.__path_srlgs_name + + def _set_path_srlgs_name(self, v, load=False): + """ + Setter method for path_srlgs_name, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_srlgs_names/path_srlgs_name (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_srlgs_name is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_srlgs_name() directly. + + YANG Description: List of named SRLGs to be included or excluded. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("usage",path_srlgs_name.path_srlgs_name, yang_name="path-srlgs-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-srlgs-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_srlgs_name must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("usage",path_srlgs_name.path_srlgs_name, yang_name="path-srlgs-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-srlgs-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False)""", + }) + + self.__path_srlgs_name = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_srlgs_name(self): + self.__path_srlgs_name = YANGDynClass(base=YANGListType("usage",path_srlgs_name.path_srlgs_name, yang_name="path-srlgs-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-srlgs-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + + path_srlgs_name = __builtin__.property(_get_path_srlgs_name) + + + _pyangbind_elements = OrderedDict([('path_srlgs_name', path_srlgs_name), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_srlgs_names/path_srlgs_name/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_srlgs_names/path_srlgs_name/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..ec8734fe06d3243c84ca236814d5f8b92e86c609 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_srlgs_names/path_srlgs_name/__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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 path_srlgs_name(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/connectivity-matrix/path-properties/path-srlgs-names/path-srlgs-name. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: List of named SRLGs to be included or excluded. + """ + __slots__ = ('_path_helper', '_extmethods', '__usage','__names',) + + _yang_name = 'path-srlgs-name' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__usage = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + self.__names = YANGDynClass(unique=True, base=TypedListType(allowed_type=six.text_type), is_leaf=False, yang_name="names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', 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 ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'connectivity-matrix', 'path-properties', 'path-srlgs-names', 'path-srlgs-name'] + + def _get_usage(self): + """ + Getter method for usage, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_srlgs_names/path_srlgs_name/usage (identityref) + + YANG Description: Identifies an entry in a list of named SRLGs to either +include or exclude. + """ + return self.__usage + + def _set_usage(self, v, load=False): + """ + Setter method for usage, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_srlgs_names/path_srlgs_name/usage (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_usage is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_usage() directly. + + YANG Description: Identifies an entry in a list of named SRLGs to either +include or exclude. + """ + 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=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """usage must be of a type compatible with identityref""", + 'defined-type': "ietf-te-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False)""", + }) + + self.__usage = t + if hasattr(self, '_set'): + self._set() + + def _unset_usage(self): + self.__usage = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + + + def _get_names(self): + """ + Getter method for names, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_srlgs_names/path_srlgs_name/names (string) + + YANG Description: List of named SRLGs. + """ + return self.__names + + def _set_names(self, v, load=False): + """ + Setter method for names, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_srlgs_names/path_srlgs_name/names (string) + If this variable is read-only (config: false) in the + source YANG file, then _set_names is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_names() directly. + + YANG Description: List of named SRLGs. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,unique=True, base=TypedListType(allowed_type=six.text_type), is_leaf=False, yang_name="names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """names must be of a type compatible with string""", + 'defined-type': "string", + 'generated-type': """YANGDynClass(unique=True, base=TypedListType(allowed_type=six.text_type), is_leaf=False, yang_name="names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=False)""", + }) + + self.__names = t + if hasattr(self, '_set'): + self._set() + + def _unset_names(self): + self.__names = YANGDynClass(unique=True, base=TypedListType(allowed_type=six.text_type), is_leaf=False, yang_name="names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=False) + + usage = __builtin__.property(_get_usage) + names = __builtin__.property(_get_names) + + + _pyangbind_elements = OrderedDict([('usage', usage), ('names', names), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..9fb67245815d19b30ad2a40dcfbd566f0bf3cdba --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/__init__.py @@ -0,0 +1,155 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 label_restrictions +class to(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/connectivity-matrix/to. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Reference to a destination LTP. + """ + __slots__ = ('_path_helper', '_extmethods', '__tp_ref','__label_restrictions',) + + _yang_name = 'to' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__tp_ref = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="tp-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=True) + self.__label_restrictions = YANGDynClass(base=label_restrictions.label_restrictions, is_container='container', yang_name="label-restrictions", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-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 ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'connectivity-matrix', 'to'] + + def _get_tp_ref(self): + """ + Getter method for tp_ref, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/tp_ref (leafref) + + YANG Description: Relative reference to a termination point. + """ + return self.__tp_ref + + def _set_tp_ref(self, v, load=False): + """ + Setter method for tp_ref, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/tp_ref (leafref) + If this variable is read-only (config: false) in the + source YANG file, then _set_tp_ref is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tp_ref() directly. + + YANG Description: Relative reference to a termination point. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="tp-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tp_ref must be of a type compatible with leafref""", + 'defined-type': "leafref", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="tp-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=True)""", + }) + + self.__tp_ref = t + if hasattr(self, '_set'): + self._set() + + def _unset_tp_ref(self): + self.__tp_ref = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="tp-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=True) + + + def _get_label_restrictions(self): + """ + Getter method for label_restrictions, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions (container) + + YANG Description: The label restrictions container. + """ + return self.__label_restrictions + + def _set_label_restrictions(self, v, load=False): + """ + Setter method for label_restrictions, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_label_restrictions is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_label_restrictions() directly. + + YANG Description: The label restrictions container. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=label_restrictions.label_restrictions, is_container='container', yang_name="label-restrictions", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """label_restrictions must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=label_restrictions.label_restrictions, is_container='container', yang_name="label-restrictions", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__label_restrictions = t + if hasattr(self, '_set'): + self._set() + + def _unset_label_restrictions(self): + self.__label_restrictions = YANGDynClass(base=label_restrictions.label_restrictions, is_container='container', yang_name="label-restrictions", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + tp_ref = __builtin__.property(_get_tp_ref, _set_tp_ref) + label_restrictions = __builtin__.property(_get_label_restrictions, _set_label_restrictions) + + + _pyangbind_elements = OrderedDict([('tp_ref', tp_ref), ('label_restrictions', label_restrictions), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..8dfdb0a632d537ad52e29f5519c6f72b4dce979d --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/__init__.py @@ -0,0 +1,120 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 label_restriction +class label_restrictions(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/connectivity-matrix/to/label-restrictions. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: The label restrictions container. + """ + __slots__ = ('_path_helper', '_extmethods', '__label_restriction',) + + _yang_name = 'label-restrictions' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__label_restriction = YANGDynClass(base=YANGListType("index",label_restriction.label_restriction, yang_name="label-restriction", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='index', extensions=None), is_container='list', yang_name="label-restriction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-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 ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'connectivity-matrix', 'to', 'label-restrictions'] + + def _get_label_restriction(self): + """ + Getter method for label_restriction, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction (list) + + YANG Description: The absence of the label restrictions container implies +that all labels are acceptable; otherwise, only restricted +labels are available. + """ + return self.__label_restriction + + def _set_label_restriction(self, v, load=False): + """ + Setter method for label_restriction, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_label_restriction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_label_restriction() directly. + + YANG Description: The absence of the label restrictions container implies +that all labels are acceptable; otherwise, only restricted +labels are available. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("index",label_restriction.label_restriction, yang_name="label-restriction", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='index', extensions=None), is_container='list', yang_name="label-restriction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """label_restriction must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("index",label_restriction.label_restriction, yang_name="label-restriction", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='index', extensions=None), is_container='list', yang_name="label-restriction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True)""", + }) + + self.__label_restriction = t + if hasattr(self, '_set'): + self._set() + + def _unset_label_restriction(self): + self.__label_restriction = YANGDynClass(base=YANGListType("index",label_restriction.label_restriction, yang_name="label-restriction", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='index', extensions=None), is_container='list', yang_name="label-restriction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + + label_restriction = __builtin__.property(_get_label_restriction, _set_label_restriction) + + + _pyangbind_elements = OrderedDict([('label_restriction', label_restriction), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..3b116c4b7203064fe2844ac60d195517e8aed8a0 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/__init__.py @@ -0,0 +1,450 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 label_start +from . import label_end +from . import label_step +from . import otn_label_range +from . import ethernet_label_range +class label_restriction(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/connectivity-matrix/to/label-restrictions/label-restriction. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: The absence of the label restrictions container implies +that all labels are acceptable; otherwise, only restricted +labels are available. + """ + __slots__ = ('_path_helper', '_extmethods', '__restriction','__index','__label_start','__label_end','__label_step','__range_bitmap','__otn_label_range','__ethernet_label_range',) + + _yang_name = 'label-restriction' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__restriction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'inclusive': {}, 'exclusive': {}},), default=six.text_type("inclusive"), is_leaf=True, yang_name="restriction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='enumeration', is_config=True) + self.__index = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + self.__label_start = YANGDynClass(base=label_start.label_start, is_container='container', yang_name="label-start", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__label_end = YANGDynClass(base=label_end.label_end, is_container='container', yang_name="label-end", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__label_step = YANGDynClass(base=label_step.label_step, is_container='container', yang_name="label-step", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__range_bitmap = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}), is_leaf=True, yang_name="range-bitmap", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:hex-string', is_config=True) + self.__otn_label_range = YANGDynClass(base=otn_label_range.otn_label_range, is_container='container', yang_name="otn-label-range", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + self.__ethernet_label_range = YANGDynClass(base=ethernet_label_range.ethernet_label_range, is_container='container', yang_name="ethernet-label-range", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-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 ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'connectivity-matrix', 'to', 'label-restrictions', 'label-restriction'] + + def _get_restriction(self): + """ + Getter method for restriction, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/restriction (enumeration) + + YANG Description: Indicates whether the list item is inclusive or exclusive. + """ + return self.__restriction + + def _set_restriction(self, v, load=False): + """ + Setter method for restriction, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/restriction (enumeration) + If this variable is read-only (config: false) in the + source YANG file, then _set_restriction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_restriction() directly. + + YANG Description: Indicates whether the list item is inclusive or exclusive. + """ + 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={'inclusive': {}, 'exclusive': {}},), default=six.text_type("inclusive"), is_leaf=True, yang_name="restriction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='enumeration', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """restriction must be of a type compatible with enumeration""", + 'defined-type': "ietf-te-topology:enumeration", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'inclusive': {}, 'exclusive': {}},), default=six.text_type("inclusive"), is_leaf=True, yang_name="restriction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='enumeration', is_config=True)""", + }) + + self.__restriction = t + if hasattr(self, '_set'): + self._set() + + def _unset_restriction(self): + self.__restriction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'inclusive': {}, 'exclusive': {}},), default=six.text_type("inclusive"), is_leaf=True, yang_name="restriction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='enumeration', is_config=True) + + + def _get_index(self): + """ + Getter method for index, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/index (uint32) + + YANG Description: The index of the label restriction list entry. + """ + return self.__index + + def _set_index(self, v, load=False): + """ + Setter method for index, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/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 label restriction list entry. + """ + 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=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', 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), is_leaf=True, yang_name="index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', 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), is_leaf=True, yang_name="index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + + + def _get_label_start(self): + """ + Getter method for label_start, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_start (container) + + YANG Description: This is the starting label if a label range is specified. +This is the label value if a single label is specified, +in which case the 'label-end' attribute is not set. + """ + return self.__label_start + + def _set_label_start(self, v, load=False): + """ + Setter method for label_start, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_start (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_label_start is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_label_start() directly. + + YANG Description: This is the starting label if a label range is specified. +This is the label value if a single label is specified, +in which case the 'label-end' attribute is not set. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=label_start.label_start, is_container='container', yang_name="label-start", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """label_start must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=label_start.label_start, is_container='container', yang_name="label-start", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__label_start = t + if hasattr(self, '_set'): + self._set() + + def _unset_label_start(self): + self.__label_start = YANGDynClass(base=label_start.label_start, is_container='container', yang_name="label-start", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_label_end(self): + """ + Getter method for label_end, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_end (container) + + YANG Description: This is the ending label if a label range is specified. +This attribute is not set if a single label is specified. + """ + return self.__label_end + + def _set_label_end(self, v, load=False): + """ + Setter method for label_end, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_end (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_label_end is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_label_end() directly. + + YANG Description: This is the ending label if a label range is specified. +This attribute is not set if a single label is specified. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=label_end.label_end, is_container='container', yang_name="label-end", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """label_end must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=label_end.label_end, is_container='container', yang_name="label-end", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__label_end = t + if hasattr(self, '_set'): + self._set() + + def _unset_label_end(self): + self.__label_end = YANGDynClass(base=label_end.label_end, is_container='container', yang_name="label-end", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_label_step(self): + """ + Getter method for label_step, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_step (container) + + YANG Description: The step increment between labels in the label range. +The label start/end values will have to be consistent +with the sign of label step. For example, +'label-start' < 'label-end' enforces 'label-step' > 0 +'label-start' > 'label-end' enforces 'label-step' < 0. + """ + return self.__label_step + + def _set_label_step(self, v, load=False): + """ + Setter method for label_step, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_step (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_label_step is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_label_step() directly. + + YANG Description: The step increment between labels in the label range. +The label start/end values will have to be consistent +with the sign of label step. For example, +'label-start' < 'label-end' enforces 'label-step' > 0 +'label-start' > 'label-end' enforces 'label-step' < 0. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=label_step.label_step, is_container='container', yang_name="label-step", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """label_step must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=label_step.label_step, is_container='container', yang_name="label-step", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__label_step = t + if hasattr(self, '_set'): + self._set() + + def _unset_label_step(self): + self.__label_step = YANGDynClass(base=label_step.label_step, is_container='container', yang_name="label-step", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_range_bitmap(self): + """ + Getter method for range_bitmap, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/range_bitmap (yang:hex-string) + + YANG Description: When there are gaps between 'label-start' and 'label-end', +this attribute is used to specify the positions +of the used labels. This is represented in big endian as +'hex-string'. +The most significant byte in the hex-string is the farthest +to the left in the byte sequence. Leading zero bytes in the +configured value may be omitted for brevity. +Each bit position in the 'range-bitmap' 'hex-string' maps +to a label in the range derived from 'label-start'. + +For example, assuming that 'label-start' = 16000 and +'range-bitmap' = 0x01000001, then: + +- bit position (0) is set, and the corresponding mapped + label from the range is 16000 + (0 * 'label-step') or + 16000 for default 'label-step' = 1. +- bit position (24) is set, and the corresponding mapped + label from the range is 16000 + (24 * 'label-step') or + 16024 for default 'label-step' = 1. + """ + return self.__range_bitmap + + def _set_range_bitmap(self, v, load=False): + """ + Setter method for range_bitmap, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/range_bitmap (yang:hex-string) + If this variable is read-only (config: false) in the + source YANG file, then _set_range_bitmap is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_range_bitmap() directly. + + YANG Description: When there are gaps between 'label-start' and 'label-end', +this attribute is used to specify the positions +of the used labels. This is represented in big endian as +'hex-string'. +The most significant byte in the hex-string is the farthest +to the left in the byte sequence. Leading zero bytes in the +configured value may be omitted for brevity. +Each bit position in the 'range-bitmap' 'hex-string' maps +to a label in the range derived from 'label-start'. + +For example, assuming that 'label-start' = 16000 and +'range-bitmap' = 0x01000001, then: + +- bit position (0) is set, and the corresponding mapped + label from the range is 16000 + (0 * 'label-step') or + 16000 for default 'label-step' = 1. +- bit position (24) is set, and the corresponding mapped + label from the range is 16000 + (24 * 'label-step') or + 16024 for default 'label-step' = 1. + """ + 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})*)?'}), is_leaf=True, yang_name="range-bitmap", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:hex-string', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """range_bitmap must be of a type compatible with yang:hex-string""", + 'defined-type': "yang:hex-string", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}), is_leaf=True, yang_name="range-bitmap", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:hex-string', is_config=True)""", + }) + + self.__range_bitmap = t + if hasattr(self, '_set'): + self._set() + + def _unset_range_bitmap(self): + self.__range_bitmap = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}), is_leaf=True, yang_name="range-bitmap", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:hex-string', is_config=True) + + + def _get_otn_label_range(self): + """ + Getter method for otn_label_range, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/otn_label_range (container) + + YANG Description: Label range information for OTN. + """ + return self.__otn_label_range + + def _set_otn_label_range(self, v, load=False): + """ + Setter method for otn_label_range, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/otn_label_range (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_otn_label_range is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_otn_label_range() directly. + + YANG Description: Label range information for OTN. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=otn_label_range.otn_label_range, is_container='container', yang_name="otn-label-range", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """otn_label_range must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=otn_label_range.otn_label_range, is_container='container', yang_name="otn-label-range", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True)""", + }) + + self.__otn_label_range = t + if hasattr(self, '_set'): + self._set() + + def _unset_otn_label_range(self): + self.__otn_label_range = YANGDynClass(base=otn_label_range.otn_label_range, is_container='container', yang_name="otn-label-range", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + + + def _get_ethernet_label_range(self): + """ + Getter method for ethernet_label_range, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/ethernet_label_range (container) + + YANG Description: Ethernet-specific label range related information. + """ + return self.__ethernet_label_range + + def _set_ethernet_label_range(self, v, load=False): + """ + Setter method for ethernet_label_range, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/ethernet_label_range (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_ethernet_label_range is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_ethernet_label_range() directly. + + YANG Description: Ethernet-specific label range related information. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=ethernet_label_range.ethernet_label_range, is_container='container', yang_name="ethernet-label-range", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """ethernet_label_range must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=ethernet_label_range.ethernet_label_range, is_container='container', yang_name="ethernet-label-range", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='container', is_config=True)""", + }) + + self.__ethernet_label_range = t + if hasattr(self, '_set'): + self._set() + + def _unset_ethernet_label_range(self): + self.__ethernet_label_range = YANGDynClass(base=ethernet_label_range.ethernet_label_range, is_container='container', yang_name="ethernet-label-range", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='container', is_config=True) + + restriction = __builtin__.property(_get_restriction, _set_restriction) + index = __builtin__.property(_get_index, _set_index) + label_start = __builtin__.property(_get_label_start, _set_label_start) + label_end = __builtin__.property(_get_label_end, _set_label_end) + label_step = __builtin__.property(_get_label_step, _set_label_step) + range_bitmap = __builtin__.property(_get_range_bitmap, _set_range_bitmap) + otn_label_range = __builtin__.property(_get_otn_label_range, _set_otn_label_range) + ethernet_label_range = __builtin__.property(_get_ethernet_label_range, _set_ethernet_label_range) + + + _pyangbind_elements = OrderedDict([('restriction', restriction), ('index', index), ('label_start', label_start), ('label_end', label_end), ('label_step', label_step), ('range_bitmap', range_bitmap), ('otn_label_range', otn_label_range), ('ethernet_label_range', ethernet_label_range), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/ethernet_label_range/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/ethernet_label_range/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..c9f4959da8dd27c33cc032ea7aeca7187983defb --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/ethernet_label_range/__init__.py @@ -0,0 +1,154 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 ethernet_label_range(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/connectivity-matrix/to/label-restrictions/label-restriction/ethernet-label-range. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Ethernet-specific label range related information. + """ + __slots__ = ('_path_helper', '_extmethods', '__tag_type','__priority',) + + _yang_name = 'ethernet-label-range' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__tag_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 's-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:s-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:s-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}},), is_leaf=True, yang_name="tag-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:eth-tag-type', is_config=True) + self.__priority = YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), is_leaf=True, yang_name="priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', 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 ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'connectivity-matrix', 'to', 'label-restrictions', 'label-restriction', 'ethernet-label-range'] + + def _get_tag_type(self): + """ + Getter method for tag_type, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/ethernet_label_range/tag_type (etht-types:eth-tag-type) + + YANG Description: VLAN tag type. + """ + return self.__tag_type + + def _set_tag_type(self, v, load=False): + """ + Setter method for tag_type, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/ethernet_label_range/tag_type (etht-types:eth-tag-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_tag_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tag_type() directly. + + YANG Description: VLAN tag type. + """ + 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={'c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 's-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:s-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:s-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}},), is_leaf=True, yang_name="tag-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:eth-tag-type', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tag_type must be of a type compatible with etht-types:eth-tag-type""", + 'defined-type': "etht-types:eth-tag-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 's-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:s-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:s-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}},), is_leaf=True, yang_name="tag-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:eth-tag-type', is_config=True)""", + }) + + self.__tag_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_tag_type(self): + self.__tag_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 's-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:s-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:s-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}},), is_leaf=True, yang_name="tag-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:eth-tag-type', is_config=True) + + + def _get_priority(self): + """ + Getter method for priority, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/ethernet_label_range/priority (uint8) + + YANG Description: priority. + """ + return self.__priority + + def _set_priority(self, v, load=False): + """ + Setter method for priority, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/ethernet_label_range/priority (uint8) + If this variable is read-only (config: false) in the + source YANG file, then _set_priority is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_priority() directly. + + YANG Description: priority. + """ + 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="priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint8', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """priority 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="priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint8', is_config=True)""", + }) + + self.__priority = t + if hasattr(self, '_set'): + self._set() + + def _unset_priority(self): + self.__priority = YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), is_leaf=True, yang_name="priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint8', is_config=True) + + tag_type = __builtin__.property(_get_tag_type, _set_tag_type) + priority = __builtin__.property(_get_priority, _set_priority) + + + _pyangbind_elements = OrderedDict([('tag_type', tag_type), ('priority', priority), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_end/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_end/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..c5f363333d09d75e388c31ad02dc35dd6738a649 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_end/__init__.py @@ -0,0 +1,119 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 te_label +class label_end(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/connectivity-matrix/to/label-restrictions/label-restriction/label-end. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: This is the ending label if a label range is specified. +This attribute is not set if a single label is specified. + """ + __slots__ = ('_path_helper', '_extmethods', '__te_label',) + + _yang_name = 'label-end' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__te_label = YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-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 ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'connectivity-matrix', 'to', 'label-restrictions', 'label-restriction', 'label-end'] + + def _get_te_label(self): + """ + Getter method for te_label, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_end/te_label (container) + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + return self.__te_label + + def _set_te_label(self, v, load=False): + """ + Setter method for te_label, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_end/te_label (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_te_label is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_te_label() directly. + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """te_label must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__te_label = t + if hasattr(self, '_set'): + self._set() + + def _unset_te_label(self): + self.__te_label = YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + te_label = __builtin__.property(_get_te_label, _set_te_label) + + + _pyangbind_elements = OrderedDict([('te_label', te_label), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_end/te_label/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_end/te_label/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..09a0f03ed1a0b6b77fb1d353db37895d11f535cc --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_end/te_label/__init__.py @@ -0,0 +1,234 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 otn +class te_label(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/connectivity-matrix/to/label-restrictions/label-restriction/label-end/te-label. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + __slots__ = ('_path_helper', '_extmethods', '__generic','__otn','__vlanid','__direction',) + + _yang_name = 'te-label' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__generic = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True) + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + self.__vlanid = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True) + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', 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 ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'connectivity-matrix', 'to', 'label-restrictions', 'label-restriction', 'label-end', 'te-label'] + + def _get_generic(self): + """ + Getter method for generic, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_end/te_label/generic (rt-types:generalized-label) + + YANG Description: TE label specified in a generic format. + """ + return self.__generic + + def _set_generic(self, v, load=False): + """ + Setter method for generic, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_end/te_label/generic (rt-types:generalized-label) + If this variable is read-only (config: false) in the + source YANG file, then _set_generic is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_generic() directly. + + YANG Description: TE label specified in a generic format. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """generic must be of a type compatible with rt-types:generalized-label""", + 'defined-type': "rt-types:generalized-label", + 'generated-type': """YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True)""", + }) + + self.__generic = t + if hasattr(self, '_set'): + self._set() + + def _unset_generic(self): + self.__generic = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True) + + + def _get_otn(self): + """ + Getter method for otn, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_end/te_label/otn (container) + + YANG Description: Label start or label end for OTN. + """ + return self.__otn + + def _set_otn(self, v, load=False): + """ + Setter method for otn, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_end/te_label/otn (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_otn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_otn() directly. + + YANG Description: Label start or label end for OTN. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """otn must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True)""", + }) + + self.__otn = t + if hasattr(self, '_set'): + self._set() + + def _unset_otn(self): + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + + + def _get_vlanid(self): + """ + Getter method for vlanid, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_end/te_label/vlanid (etht-types:vlanid) + + YANG Description: VLAN tag id. + """ + return self.__vlanid + + def _set_vlanid(self, v, load=False): + """ + Setter method for vlanid, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_end/te_label/vlanid (etht-types:vlanid) + If this variable is read-only (config: false) in the + source YANG file, then _set_vlanid is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_vlanid() directly. + + YANG Description: VLAN tag id. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """vlanid must be of a type compatible with etht-types:vlanid""", + 'defined-type': "etht-types:vlanid", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True)""", + }) + + self.__vlanid = t + if hasattr(self, '_set'): + self._set() + + def _unset_vlanid(self): + self.__vlanid = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True) + + + def _get_direction(self): + """ + Getter method for direction, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_end/te_label/direction (te-label-direction) + + YANG Description: Label direction. + """ + return self.__direction + + def _set_direction(self, v, load=False): + """ + Setter method for direction, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_end/te_label/direction (te-label-direction) + If this variable is read-only (config: false) in the + source YANG file, then _set_direction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_direction() directly. + + YANG Description: Label direction. + """ + 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={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """direction must be of a type compatible with te-label-direction""", + 'defined-type': "ietf-te-topology:te-label-direction", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=True)""", + }) + + self.__direction = t + if hasattr(self, '_set'): + self._set() + + def _unset_direction(self): + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=True) + + generic = __builtin__.property(_get_generic, _set_generic) + otn = __builtin__.property(_get_otn, _set_otn) + vlanid = __builtin__.property(_get_vlanid, _set_vlanid) + direction = __builtin__.property(_get_direction, _set_direction) + + __choices__ = {'technology': {'generic': ['generic'], 'otn': ['otn'], 'eth': ['vlanid']}} + _pyangbind_elements = OrderedDict([('generic', generic), ('otn', otn), ('vlanid', vlanid), ('direction', direction), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_end/te_label/otn/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_end/te_label/otn/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..74637ab69ead2142e633f02a0086d84b0c7399c5 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_end/te_label/otn/__init__.py @@ -0,0 +1,154 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 otn(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/connectivity-matrix/to/label-restrictions/label-restriction/label-end/te-label/otn. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Label start or label end for OTN. + """ + __slots__ = ('_path_helper', '_extmethods', '__tpn','__ts',) + + _yang_name = 'otn' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__tpn = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('range-type', 'trib-port'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True) + self.__ts = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts", parent=self, choice=('range-type', 'trib-slot'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-ts', 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 ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'connectivity-matrix', 'to', 'label-restrictions', 'label-restriction', 'label-end', 'te-label', 'otn'] + + def _get_tpn(self): + """ + Getter method for tpn, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_end/te_label/otn/tpn (otn-tpn) + + YANG Description: Tributary Port Number (TPN). + """ + return self.__tpn + + def _set_tpn(self, v, load=False): + """ + Setter method for tpn, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_end/te_label/otn/tpn (otn-tpn) + If this variable is read-only (config: false) in the + source YANG file, then _set_tpn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tpn() directly. + + YANG Description: Tributary Port Number (TPN). + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('range-type', 'trib-port'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tpn must be of a type compatible with otn-tpn""", + 'defined-type': "ietf-otn-topology:otn-tpn", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('range-type', 'trib-port'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True)""", + }) + + self.__tpn = t + if hasattr(self, '_set'): + self._set() + + def _unset_tpn(self): + self.__tpn = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('range-type', 'trib-port'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True) + + + def _get_ts(self): + """ + Getter method for ts, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_end/te_label/otn/ts (otn-ts) + + YANG Description: Tributary Slot (TS) number. + """ + return self.__ts + + def _set_ts(self, v, load=False): + """ + Setter method for ts, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_end/te_label/otn/ts (otn-ts) + If this variable is read-only (config: false) in the + source YANG file, then _set_ts is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_ts() directly. + + YANG Description: Tributary Slot (TS) number. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts", parent=self, choice=('range-type', 'trib-slot'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-ts', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """ts must be of a type compatible with otn-ts""", + 'defined-type': "ietf-otn-topology:otn-ts", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts", parent=self, choice=('range-type', 'trib-slot'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-ts', is_config=True)""", + }) + + self.__ts = t + if hasattr(self, '_set'): + self._set() + + def _unset_ts(self): + self.__ts = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts", parent=self, choice=('range-type', 'trib-slot'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-ts', is_config=True) + + tpn = __builtin__.property(_get_tpn, _set_tpn) + ts = __builtin__.property(_get_ts, _set_ts) + + __choices__ = {'range-type': {'trib-port': ['tpn'], 'trib-slot': ['ts']}} + _pyangbind_elements = OrderedDict([('tpn', tpn), ('ts', ts), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_start/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_start/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..55e8ab30e76fcc82c40609ad33db4cdf7a3ae37a --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_start/__init__.py @@ -0,0 +1,120 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 te_label +class label_start(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/connectivity-matrix/to/label-restrictions/label-restriction/label-start. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: This is the starting label if a label range is specified. +This is the label value if a single label is specified, +in which case the 'label-end' attribute is not set. + """ + __slots__ = ('_path_helper', '_extmethods', '__te_label',) + + _yang_name = 'label-start' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__te_label = YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-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 ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'connectivity-matrix', 'to', 'label-restrictions', 'label-restriction', 'label-start'] + + def _get_te_label(self): + """ + Getter method for te_label, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_start/te_label (container) + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + return self.__te_label + + def _set_te_label(self, v, load=False): + """ + Setter method for te_label, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_start/te_label (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_te_label is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_te_label() directly. + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """te_label must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__te_label = t + if hasattr(self, '_set'): + self._set() + + def _unset_te_label(self): + self.__te_label = YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + te_label = __builtin__.property(_get_te_label, _set_te_label) + + + _pyangbind_elements = OrderedDict([('te_label', te_label), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_start/te_label/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_start/te_label/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..c2477e8170b56ab2a83195bd4ad0c64a4bd8e5f0 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_start/te_label/__init__.py @@ -0,0 +1,234 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 otn +class te_label(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/connectivity-matrix/to/label-restrictions/label-restriction/label-start/te-label. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + __slots__ = ('_path_helper', '_extmethods', '__generic','__otn','__vlanid','__direction',) + + _yang_name = 'te-label' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__generic = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True) + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + self.__vlanid = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True) + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', 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 ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'connectivity-matrix', 'to', 'label-restrictions', 'label-restriction', 'label-start', 'te-label'] + + def _get_generic(self): + """ + Getter method for generic, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_start/te_label/generic (rt-types:generalized-label) + + YANG Description: TE label specified in a generic format. + """ + return self.__generic + + def _set_generic(self, v, load=False): + """ + Setter method for generic, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_start/te_label/generic (rt-types:generalized-label) + If this variable is read-only (config: false) in the + source YANG file, then _set_generic is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_generic() directly. + + YANG Description: TE label specified in a generic format. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """generic must be of a type compatible with rt-types:generalized-label""", + 'defined-type': "rt-types:generalized-label", + 'generated-type': """YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True)""", + }) + + self.__generic = t + if hasattr(self, '_set'): + self._set() + + def _unset_generic(self): + self.__generic = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True) + + + def _get_otn(self): + """ + Getter method for otn, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_start/te_label/otn (container) + + YANG Description: Label start or label end for OTN. + """ + return self.__otn + + def _set_otn(self, v, load=False): + """ + Setter method for otn, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_start/te_label/otn (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_otn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_otn() directly. + + YANG Description: Label start or label end for OTN. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """otn must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True)""", + }) + + self.__otn = t + if hasattr(self, '_set'): + self._set() + + def _unset_otn(self): + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + + + def _get_vlanid(self): + """ + Getter method for vlanid, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_start/te_label/vlanid (etht-types:vlanid) + + YANG Description: VLAN tag id. + """ + return self.__vlanid + + def _set_vlanid(self, v, load=False): + """ + Setter method for vlanid, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_start/te_label/vlanid (etht-types:vlanid) + If this variable is read-only (config: false) in the + source YANG file, then _set_vlanid is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_vlanid() directly. + + YANG Description: VLAN tag id. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """vlanid must be of a type compatible with etht-types:vlanid""", + 'defined-type': "etht-types:vlanid", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True)""", + }) + + self.__vlanid = t + if hasattr(self, '_set'): + self._set() + + def _unset_vlanid(self): + self.__vlanid = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True) + + + def _get_direction(self): + """ + Getter method for direction, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_start/te_label/direction (te-label-direction) + + YANG Description: Label direction. + """ + return self.__direction + + def _set_direction(self, v, load=False): + """ + Setter method for direction, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_start/te_label/direction (te-label-direction) + If this variable is read-only (config: false) in the + source YANG file, then _set_direction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_direction() directly. + + YANG Description: Label direction. + """ + 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={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """direction must be of a type compatible with te-label-direction""", + 'defined-type': "ietf-te-topology:te-label-direction", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=True)""", + }) + + self.__direction = t + if hasattr(self, '_set'): + self._set() + + def _unset_direction(self): + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=True) + + generic = __builtin__.property(_get_generic, _set_generic) + otn = __builtin__.property(_get_otn, _set_otn) + vlanid = __builtin__.property(_get_vlanid, _set_vlanid) + direction = __builtin__.property(_get_direction, _set_direction) + + __choices__ = {'technology': {'generic': ['generic'], 'otn': ['otn'], 'eth': ['vlanid']}} + _pyangbind_elements = OrderedDict([('generic', generic), ('otn', otn), ('vlanid', vlanid), ('direction', direction), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_start/te_label/otn/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_start/te_label/otn/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..cbb3ec6163a997eae9f05b52925b3499d13241f4 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_start/te_label/otn/__init__.py @@ -0,0 +1,154 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 otn(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/connectivity-matrix/to/label-restrictions/label-restriction/label-start/te-label/otn. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Label start or label end for OTN. + """ + __slots__ = ('_path_helper', '_extmethods', '__tpn','__ts',) + + _yang_name = 'otn' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__tpn = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('range-type', 'trib-port'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True) + self.__ts = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts", parent=self, choice=('range-type', 'trib-slot'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-ts', 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 ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'connectivity-matrix', 'to', 'label-restrictions', 'label-restriction', 'label-start', 'te-label', 'otn'] + + def _get_tpn(self): + """ + Getter method for tpn, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_start/te_label/otn/tpn (otn-tpn) + + YANG Description: Tributary Port Number (TPN). + """ + return self.__tpn + + def _set_tpn(self, v, load=False): + """ + Setter method for tpn, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_start/te_label/otn/tpn (otn-tpn) + If this variable is read-only (config: false) in the + source YANG file, then _set_tpn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tpn() directly. + + YANG Description: Tributary Port Number (TPN). + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('range-type', 'trib-port'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tpn must be of a type compatible with otn-tpn""", + 'defined-type': "ietf-otn-topology:otn-tpn", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('range-type', 'trib-port'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True)""", + }) + + self.__tpn = t + if hasattr(self, '_set'): + self._set() + + def _unset_tpn(self): + self.__tpn = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('range-type', 'trib-port'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True) + + + def _get_ts(self): + """ + Getter method for ts, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_start/te_label/otn/ts (otn-ts) + + YANG Description: Tributary Slot (TS) number. + """ + return self.__ts + + def _set_ts(self, v, load=False): + """ + Setter method for ts, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_start/te_label/otn/ts (otn-ts) + If this variable is read-only (config: false) in the + source YANG file, then _set_ts is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_ts() directly. + + YANG Description: Tributary Slot (TS) number. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts", parent=self, choice=('range-type', 'trib-slot'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-ts', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """ts must be of a type compatible with otn-ts""", + 'defined-type': "ietf-otn-topology:otn-ts", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts", parent=self, choice=('range-type', 'trib-slot'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-ts', is_config=True)""", + }) + + self.__ts = t + if hasattr(self, '_set'): + self._set() + + def _unset_ts(self): + self.__ts = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts", parent=self, choice=('range-type', 'trib-slot'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-ts', is_config=True) + + tpn = __builtin__.property(_get_tpn, _set_tpn) + ts = __builtin__.property(_get_ts, _set_ts) + + __choices__ = {'range-type': {'trib-port': ['tpn'], 'trib-slot': ['ts']}} + _pyangbind_elements = OrderedDict([('tpn', tpn), ('ts', ts), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_step/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_step/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..570cd69b5233c732d475c31c8e317363f842c6a9 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_step/__init__.py @@ -0,0 +1,200 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 otn +class label_step(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/connectivity-matrix/to/label-restrictions/label-restriction/label-step. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: The step increment between labels in the label range. +The label start/end values will have to be consistent +with the sign of label step. For example, +'label-start' < 'label-end' enforces 'label-step' > 0 +'label-start' > 'label-end' enforces 'label-step' < 0. + """ + __slots__ = ('_path_helper', '_extmethods', '__generic','__otn','__eth_step',) + + _yang_name = 'label-step' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__generic = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['-2147483648..2147483647']}, int_size=32), default=RestrictedClassType(base_type=long, restriction_dict={'range': ['-2147483648..2147483647']}, int_size=32)(1), is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='int32', is_config=True) + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + self.__eth_step = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), default=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16)(1), is_leaf=True, yang_name="eth-step", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint16', 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 ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'connectivity-matrix', 'to', 'label-restrictions', 'label-restriction', 'label-step'] + + def _get_generic(self): + """ + Getter method for generic, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_step/generic (int32) + + YANG Description: Label range step. + """ + return self.__generic + + def _set_generic(self, v, load=False): + """ + Setter method for generic, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_step/generic (int32) + If this variable is read-only (config: false) in the + source YANG file, then _set_generic is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_generic() directly. + + YANG Description: Label range step. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['-2147483648..2147483647']}, int_size=32), default=RestrictedClassType(base_type=long, restriction_dict={'range': ['-2147483648..2147483647']}, int_size=32)(1), is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='int32', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """generic must be of a type compatible with int32""", + 'defined-type': "int32", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['-2147483648..2147483647']}, int_size=32), default=RestrictedClassType(base_type=long, restriction_dict={'range': ['-2147483648..2147483647']}, int_size=32)(1), is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='int32', is_config=True)""", + }) + + self.__generic = t + if hasattr(self, '_set'): + self._set() + + def _unset_generic(self): + self.__generic = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['-2147483648..2147483647']}, int_size=32), default=RestrictedClassType(base_type=long, restriction_dict={'range': ['-2147483648..2147483647']}, int_size=32)(1), is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='int32', is_config=True) + + + def _get_otn(self): + """ + Getter method for otn, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_step/otn (container) + + YANG Description: Label step for OTN + """ + return self.__otn + + def _set_otn(self, v, load=False): + """ + Setter method for otn, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_step/otn (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_otn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_otn() directly. + + YANG Description: Label step for OTN + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """otn must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True)""", + }) + + self.__otn = t + if hasattr(self, '_set'): + self._set() + + def _unset_otn(self): + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + + + def _get_eth_step(self): + """ + Getter method for eth_step, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_step/eth_step (uint16) + + YANG Description: Label step which represent possible increments for +an Ethernet VLAN tag. + """ + return self.__eth_step + + def _set_eth_step(self, v, load=False): + """ + Setter method for eth_step, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_step/eth_step (uint16) + If this variable is read-only (config: false) in the + source YANG file, then _set_eth_step is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_eth_step() directly. + + YANG Description: Label step which represent possible increments for +an Ethernet VLAN tag. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), default=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16)(1), is_leaf=True, yang_name="eth-step", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint16', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """eth_step must be of a type compatible with uint16""", + 'defined-type': "uint16", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), default=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16)(1), is_leaf=True, yang_name="eth-step", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint16', is_config=True)""", + }) + + self.__eth_step = t + if hasattr(self, '_set'): + self._set() + + def _unset_eth_step(self): + self.__eth_step = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), default=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16)(1), is_leaf=True, yang_name="eth-step", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint16', is_config=True) + + generic = __builtin__.property(_get_generic, _set_generic) + otn = __builtin__.property(_get_otn, _set_otn) + eth_step = __builtin__.property(_get_eth_step, _set_eth_step) + + __choices__ = {'technology': {'generic': ['generic'], 'otn': ['otn'], 'eth': ['eth_step']}} + _pyangbind_elements = OrderedDict([('generic', generic), ('otn', otn), ('eth_step', eth_step), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_step/otn/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_step/otn/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..541e342528410f5d656bd32efa173b3db4013a54 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_step/otn/__init__.py @@ -0,0 +1,158 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 otn(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/connectivity-matrix/to/label-restrictions/label-restriction/label-step/otn. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Label step for OTN + """ + __slots__ = ('_path_helper', '_extmethods', '__tpn','__ts',) + + _yang_name = 'otn' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__tpn = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('range-type', 'trib-port'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True) + self.__ts = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts", parent=self, choice=('range-type', 'trib-slot'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-ts', 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 ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'connectivity-matrix', 'to', 'label-restrictions', 'label-restriction', 'label-step', 'otn'] + + def _get_tpn(self): + """ + Getter method for tpn, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_step/otn/tpn (otn-tpn) + + YANG Description: Label step which represents possible increments for +Tributary Port Number (TPN). + """ + return self.__tpn + + def _set_tpn(self, v, load=False): + """ + Setter method for tpn, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_step/otn/tpn (otn-tpn) + If this variable is read-only (config: false) in the + source YANG file, then _set_tpn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tpn() directly. + + YANG Description: Label step which represents possible increments for +Tributary Port Number (TPN). + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('range-type', 'trib-port'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tpn must be of a type compatible with otn-tpn""", + 'defined-type': "ietf-otn-topology:otn-tpn", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('range-type', 'trib-port'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True)""", + }) + + self.__tpn = t + if hasattr(self, '_set'): + self._set() + + def _unset_tpn(self): + self.__tpn = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('range-type', 'trib-port'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True) + + + def _get_ts(self): + """ + Getter method for ts, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_step/otn/ts (otn-ts) + + YANG Description: Label step which represents possible increments for +Tributary Slot (TS) number. + """ + return self.__ts + + def _set_ts(self, v, load=False): + """ + Setter method for ts, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_step/otn/ts (otn-ts) + If this variable is read-only (config: false) in the + source YANG file, then _set_ts is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_ts() directly. + + YANG Description: Label step which represents possible increments for +Tributary Slot (TS) number. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts", parent=self, choice=('range-type', 'trib-slot'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-ts', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """ts must be of a type compatible with otn-ts""", + 'defined-type': "ietf-otn-topology:otn-ts", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts", parent=self, choice=('range-type', 'trib-slot'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-ts', is_config=True)""", + }) + + self.__ts = t + if hasattr(self, '_set'): + self._set() + + def _unset_ts(self): + self.__ts = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts", parent=self, choice=('range-type', 'trib-slot'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-ts', is_config=True) + + tpn = __builtin__.property(_get_tpn, _set_tpn) + ts = __builtin__.property(_get_ts, _set_ts) + + __choices__ = {'range-type': {'trib-port': ['tpn'], 'trib-slot': ['ts']}} + _pyangbind_elements = OrderedDict([('tpn', tpn), ('ts', ts), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/otn_label_range/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/otn_label_range/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..2cae8d9a9e2770de2123e7db9d9bbe96a2864df4 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/otn_label_range/__init__.py @@ -0,0 +1,256 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 otn_label_range(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/connectivity-matrix/to/label-restrictions/label-restriction/otn-label-range. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Label range information for OTN. + """ + __slots__ = ('_path_helper', '_extmethods', '__range_type','__tsg','__odu_type_list','__priority',) + + _yang_name = 'otn-label-range' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__range_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'trib-slot': {}, 'trib-port': {}},), is_leaf=True, yang_name="range-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-label-range-type', is_config=True) + self.__tsg = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + self.__odu_type_list = YANGDynClass(unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},)), is_leaf=False, yang_name="odu-type-list", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + self.__priority = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..7']}), is_leaf=True, yang_name="priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', 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 ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'connectivity-matrix', 'to', 'label-restrictions', 'label-restriction', 'otn-label-range'] + + def _get_range_type(self): + """ + Getter method for range_type, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/otn_label_range/range_type (otn-label-range-type) + + YANG Description: The type of range (e.g., TPN or TS) +to which the label range applies + """ + return self.__range_type + + def _set_range_type(self, v, load=False): + """ + Setter method for range_type, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/otn_label_range/range_type (otn-label-range-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_range_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_range_type() directly. + + YANG Description: The type of range (e.g., TPN or TS) +to which the label range applies + """ + 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={'trib-slot': {}, 'trib-port': {}},), is_leaf=True, yang_name="range-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-label-range-type', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """range_type must be of a type compatible with otn-label-range-type""", + 'defined-type': "ietf-otn-topology:otn-label-range-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'trib-slot': {}, 'trib-port': {}},), is_leaf=True, yang_name="range-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-label-range-type', is_config=True)""", + }) + + self.__range_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_range_type(self): + self.__range_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'trib-slot': {}, 'trib-port': {}},), is_leaf=True, yang_name="range-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-label-range-type', is_config=True) + + + def _get_tsg(self): + """ + Getter method for tsg, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/otn_label_range/tsg (identityref) + + YANG Description: Tributary slot granularity (TSG) to which the label range +applies. + +This leaf MUST be present when the range-type is TS. + +This leaf MAY be omitted when mapping an ODUk over an OTUk +Link. In this case the range-type is tpn, with only one +entry (ODUk), and the tpn range has only one value (1). + """ + return self.__tsg + + def _set_tsg(self, v, load=False): + """ + Setter method for tsg, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/otn_label_range/tsg (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_tsg is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tsg() directly. + + YANG Description: Tributary slot granularity (TSG) to which the label range +applies. + +This leaf MUST be present when the range-type is TS. + +This leaf MAY be omitted when mapping an ODUk over an OTUk +Link. In this case the range-type is tpn, with only one +entry (ODUk), and the tpn range has only one value (1). + """ + 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={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tsg must be of a type compatible with identityref""", + 'defined-type': "ietf-otn-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True)""", + }) + + self.__tsg = t + if hasattr(self, '_set'): + self._set() + + def _unset_tsg(self): + self.__tsg = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + + + def _get_odu_type_list(self): + """ + Getter method for odu_type_list, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/otn_label_range/odu_type_list (identityref) + + YANG Description: List of ODU types to which the label range applies. + +An Empty odu-type-list means that the label range +applies to all the supported ODU types. + """ + return self.__odu_type_list + + def _set_odu_type_list(self, v, load=False): + """ + Setter method for odu_type_list, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/otn_label_range/odu_type_list (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_odu_type_list is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_odu_type_list() directly. + + YANG Description: List of ODU types to which the label range applies. + +An Empty odu-type-list means that the label range +applies to all the supported ODU types. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},)), is_leaf=False, yang_name="odu-type-list", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """odu_type_list must be of a type compatible with identityref""", + 'defined-type': "ietf-otn-topology:identityref", + 'generated-type': """YANGDynClass(unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},)), is_leaf=False, yang_name="odu-type-list", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True)""", + }) + + self.__odu_type_list = t + if hasattr(self, '_set'): + self._set() + + def _unset_odu_type_list(self): + self.__odu_type_list = YANGDynClass(unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},)), is_leaf=False, yang_name="odu-type-list", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + + + def _get_priority(self): + """ + Getter method for priority, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/otn_label_range/priority (uint8) + + YANG Description: Priority in Interface Switching Capability +Descriptor (ISCD). + """ + return self.__priority + + def _set_priority(self, v, load=False): + """ + Setter method for priority, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/otn_label_range/priority (uint8) + If this variable is read-only (config: false) in the + source YANG file, then _set_priority is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_priority() directly. + + YANG Description: Priority in Interface Switching Capability +Descriptor (ISCD). + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..7']}), is_leaf=True, yang_name="priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint8', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """priority must be of a type compatible with uint8""", + 'defined-type': "uint8", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..7']}), is_leaf=True, yang_name="priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint8', is_config=True)""", + }) + + self.__priority = t + if hasattr(self, '_set'): + self._set() + + def _unset_priority(self): + self.__priority = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..7']}), is_leaf=True, yang_name="priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint8', is_config=True) + + range_type = __builtin__.property(_get_range_type, _set_range_type) + tsg = __builtin__.property(_get_tsg, _set_tsg) + odu_type_list = __builtin__.property(_get_odu_type_list, _set_odu_type_list) + priority = __builtin__.property(_get_priority, _set_priority) + + + _pyangbind_elements = OrderedDict([('range_type', range_type), ('tsg', tsg), ('odu_type_list', odu_type_list), ('priority', priority), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..29a2ea0fd8a120ff5357eadcd7a19e02b090f71c --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/__init__.py @@ -0,0 +1,326 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 primary_path +from . import backup_path +from . import tunnel_termination_points +from . import tunnels +class underlay(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/connectivity-matrix/underlay. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Attributes of the TE link underlay. + """ + __slots__ = ('_path_helper', '_extmethods', '__enabled','__primary_path','__backup_path','__protection_type','__tunnel_termination_points','__tunnels',) + + _yang_name = 'underlay' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__enabled = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="enabled", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='boolean', is_config=True) + self.__primary_path = YANGDynClass(base=primary_path.primary_path, is_container='container', yang_name="primary-path", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__backup_path = YANGDynClass(base=YANGListType("index",backup_path.backup_path, yang_name="backup-path", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='index', extensions=None), is_container='list', yang_name="backup-path", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + self.__protection_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'lsp-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-reroute-extra': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-reroute-extra': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-reroute-extra': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-reroute': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-reroute': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-reroute': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-1-for-n': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-1-for-n': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-1-for-n': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-unidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-unidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-unidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-bidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-bidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-bidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="protection-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + self.__tunnel_termination_points = YANGDynClass(base=tunnel_termination_points.tunnel_termination_points, is_container='container', yang_name="tunnel-termination-points", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__tunnels = YANGDynClass(base=tunnels.tunnels, is_container='container', yang_name="tunnels", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-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 ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'connectivity-matrix', 'underlay'] + + def _get_enabled(self): + """ + Getter method for enabled, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/enabled (boolean) + + YANG Description: 'true' if the underlay is enabled. +'false' if the underlay is disabled. + """ + return self.__enabled + + def _set_enabled(self, v, load=False): + """ + Setter method for enabled, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/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: 'true' if the underlay is enabled. +'false' if the underlay is disabled. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBool, is_leaf=True, yang_name="enabled", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', 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, is_leaf=True, yang_name="enabled", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='boolean', is_config=True)""", + }) + + self.__enabled = t + if hasattr(self, '_set'): + self._set() + + def _unset_enabled(self): + self.__enabled = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="enabled", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='boolean', is_config=True) + + + def _get_primary_path(self): + """ + Getter method for primary_path, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/primary_path (container) + + YANG Description: The service path on the underlay topology that +supports this link. + """ + return self.__primary_path + + def _set_primary_path(self, v, load=False): + """ + Setter method for primary_path, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/primary_path (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_primary_path is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_primary_path() directly. + + YANG Description: The service path on the underlay topology that +supports this link. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=primary_path.primary_path, is_container='container', yang_name="primary-path", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """primary_path must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=primary_path.primary_path, is_container='container', yang_name="primary-path", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__primary_path = t + if hasattr(self, '_set'): + self._set() + + def _unset_primary_path(self): + self.__primary_path = YANGDynClass(base=primary_path.primary_path, is_container='container', yang_name="primary-path", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_backup_path(self): + """ + Getter method for backup_path, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/backup_path (list) + + YANG Description: A list of backup service paths on the underlay topology that +protect the underlay primary path. If the primary path is +not protected, the list contains zero elements. If the +primary path is protected, the list contains one or more +elements. + """ + return self.__backup_path + + def _set_backup_path(self, v, load=False): + """ + Setter method for backup_path, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/backup_path (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_backup_path is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_backup_path() directly. + + YANG Description: A list of backup service paths on the underlay topology that +protect the underlay primary path. If the primary path is +not protected, the list contains zero elements. If the +primary path is protected, the list contains one or more +elements. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("index",backup_path.backup_path, yang_name="backup-path", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='index', extensions=None), is_container='list', yang_name="backup-path", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """backup_path must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("index",backup_path.backup_path, yang_name="backup-path", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='index', extensions=None), is_container='list', yang_name="backup-path", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True)""", + }) + + self.__backup_path = t + if hasattr(self, '_set'): + self._set() + + def _unset_backup_path(self): + self.__backup_path = YANGDynClass(base=YANGListType("index",backup_path.backup_path, yang_name="backup-path", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='index', extensions=None), is_container='list', yang_name="backup-path", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + + + def _get_protection_type(self): + """ + Getter method for protection_type, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/protection_type (identityref) + + YANG Description: Underlay protection type desired for this link. + """ + return self.__protection_type + + def _set_protection_type(self, v, load=False): + """ + Setter method for protection_type, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/protection_type (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_protection_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_protection_type() directly. + + YANG Description: Underlay protection type desired for this link. + """ + 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={'lsp-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-reroute-extra': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-reroute-extra': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-reroute-extra': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-reroute': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-reroute': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-reroute': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-1-for-n': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-1-for-n': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-1-for-n': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-unidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-unidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-unidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-bidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-bidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-bidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="protection-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """protection_type must be of a type compatible with identityref""", + 'defined-type': "ietf-te-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'lsp-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-reroute-extra': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-reroute-extra': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-reroute-extra': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-reroute': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-reroute': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-reroute': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-1-for-n': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-1-for-n': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-1-for-n': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-unidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-unidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-unidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-bidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-bidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-bidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="protection-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True)""", + }) + + self.__protection_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_protection_type(self): + self.__protection_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'lsp-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-reroute-extra': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-reroute-extra': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-reroute-extra': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-reroute': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-reroute': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-reroute': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-1-for-n': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-1-for-n': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-1-for-n': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-unidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-unidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-unidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-bidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-bidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-bidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="protection-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + + + def _get_tunnel_termination_points(self): + """ + Getter method for tunnel_termination_points, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/tunnel_termination_points (container) + + YANG Description: Underlay TTPs desired for this link. + """ + return self.__tunnel_termination_points + + def _set_tunnel_termination_points(self, v, load=False): + """ + Setter method for tunnel_termination_points, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/tunnel_termination_points (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_tunnel_termination_points is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tunnel_termination_points() directly. + + YANG Description: Underlay TTPs desired for this link. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=tunnel_termination_points.tunnel_termination_points, is_container='container', yang_name="tunnel-termination-points", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tunnel_termination_points must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=tunnel_termination_points.tunnel_termination_points, is_container='container', yang_name="tunnel-termination-points", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__tunnel_termination_points = t + if hasattr(self, '_set'): + self._set() + + def _unset_tunnel_termination_points(self): + self.__tunnel_termination_points = YANGDynClass(base=tunnel_termination_points.tunnel_termination_points, is_container='container', yang_name="tunnel-termination-points", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_tunnels(self): + """ + Getter method for tunnels, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/tunnels (container) + + YANG Description: Underlay TE tunnels supporting this TE link. + """ + return self.__tunnels + + def _set_tunnels(self, v, load=False): + """ + Setter method for tunnels, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/tunnels (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_tunnels is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tunnels() directly. + + YANG Description: Underlay TE tunnels supporting this TE link. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=tunnels.tunnels, is_container='container', yang_name="tunnels", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tunnels must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=tunnels.tunnels, is_container='container', yang_name="tunnels", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__tunnels = t + if hasattr(self, '_set'): + self._set() + + def _unset_tunnels(self): + self.__tunnels = YANGDynClass(base=tunnels.tunnels, is_container='container', yang_name="tunnels", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + enabled = __builtin__.property(_get_enabled, _set_enabled) + primary_path = __builtin__.property(_get_primary_path, _set_primary_path) + backup_path = __builtin__.property(_get_backup_path, _set_backup_path) + protection_type = __builtin__.property(_get_protection_type, _set_protection_type) + tunnel_termination_points = __builtin__.property(_get_tunnel_termination_points, _set_tunnel_termination_points) + tunnels = __builtin__.property(_get_tunnels, _set_tunnels) + + + _pyangbind_elements = OrderedDict([('enabled', enabled), ('primary_path', primary_path), ('backup_path', backup_path), ('protection_type', protection_type), ('tunnel_termination_points', tunnel_termination_points), ('tunnels', tunnels), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/backup_path/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/backup_path/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..408b97bc6385509bb3f83e109e4e0844f41279c8 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/backup_path/__init__.py @@ -0,0 +1,207 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 path_element +class backup_path(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/connectivity-matrix/underlay/backup-path. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: A list of backup service paths on the underlay topology that +protect the underlay primary path. If the primary path is +not protected, the list contains zero elements. If the +primary path is protected, the list contains one or more +elements. + """ + __slots__ = ('_path_helper', '_extmethods', '__index','__network_ref','__path_element',) + + _yang_name = 'backup-path' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _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), is_leaf=True, yang_name="index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + self.__network_ref = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="network-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=True) + self.__path_element = YANGDynClass(base=YANGListType("path_element_id",path_element.path_element, yang_name="path-element", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='path-element-id', extensions=None), is_container='list', yang_name="path-element", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-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 ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'connectivity-matrix', 'underlay', 'backup-path'] + + def _get_index(self): + """ + Getter method for index, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/backup_path/index (uint32) + + YANG Description: A sequence number to identify a backup path. + """ + return self.__index + + def _set_index(self, v, load=False): + """ + Setter method for index, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/backup_path/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: A sequence number to identify a backup path. + """ + 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=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', 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), is_leaf=True, yang_name="index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', 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), is_leaf=True, yang_name="index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + + + def _get_network_ref(self): + """ + Getter method for network_ref, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/backup_path/network_ref (leafref) + + YANG Description: Used to reference a network -- for example, an underlay +network. + """ + return self.__network_ref + + def _set_network_ref(self, v, load=False): + """ + Setter method for network_ref, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/backup_path/network_ref (leafref) + If this variable is read-only (config: false) in the + source YANG file, then _set_network_ref is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_network_ref() directly. + + YANG Description: Used to reference a network -- for example, an underlay +network. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="network-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """network_ref must be of a type compatible with leafref""", + 'defined-type': "leafref", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="network-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=True)""", + }) + + self.__network_ref = t + if hasattr(self, '_set'): + self._set() + + def _unset_network_ref(self): + self.__network_ref = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="network-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=True) + + + def _get_path_element(self): + """ + Getter method for path_element, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element (list) + + YANG Description: A list of path elements describing the backup service +path. + """ + return self.__path_element + + def _set_path_element(self, v, load=False): + """ + Setter method for path_element, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_element is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_element() directly. + + YANG Description: A list of path elements describing the backup service +path. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("path_element_id",path_element.path_element, yang_name="path-element", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='path-element-id', extensions=None), is_container='list', yang_name="path-element", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_element must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("path_element_id",path_element.path_element, yang_name="path-element", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='path-element-id', extensions=None), is_container='list', yang_name="path-element", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True)""", + }) + + self.__path_element = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_element(self): + self.__path_element = YANGDynClass(base=YANGListType("path_element_id",path_element.path_element, yang_name="path-element", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='path-element-id', extensions=None), is_container='list', yang_name="path-element", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + + index = __builtin__.property(_get_index, _set_index) + network_ref = __builtin__.property(_get_network_ref, _set_network_ref) + path_element = __builtin__.property(_get_path_element, _set_path_element) + + + _pyangbind_elements = OrderedDict([('index', index), ('network_ref', network_ref), ('path_element', path_element), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..53ca0bce54916db7b6469583d2b92a3536e62920 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/__init__.py @@ -0,0 +1,321 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 numbered_node_hop +from . import numbered_link_hop +from . import unnumbered_link_hop +from . import as_number_hop +from . import label_hop +class path_element(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/connectivity-matrix/underlay/backup-path/path-element. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: A list of path elements describing the backup service +path. + """ + __slots__ = ('_path_helper', '_extmethods', '__path_element_id','__numbered_node_hop','__numbered_link_hop','__unnumbered_link_hop','__as_number_hop','__label_hop',) + + _yang_name = 'path-element' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__path_element_id = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="path-element-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + self.__numbered_node_hop = YANGDynClass(base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__numbered_link_hop = YANGDynClass(base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__unnumbered_link_hop = YANGDynClass(base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__as_number_hop = YANGDynClass(base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__label_hop = YANGDynClass(base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-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 ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'connectivity-matrix', 'underlay', 'backup-path', 'path-element'] + + def _get_path_element_id(self): + """ + Getter method for path_element_id, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/path_element_id (uint32) + + YANG Description: To identify the element in a path. + """ + return self.__path_element_id + + def _set_path_element_id(self, v, load=False): + """ + Setter method for path_element_id, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/path_element_id (uint32) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_element_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_element_id() directly. + + YANG Description: To identify the element in a path. + """ + 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=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="path-element-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_element_id 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="path-element-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True)""", + }) + + self.__path_element_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_element_id(self): + self.__path_element_id = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="path-element-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + + + def _get_numbered_node_hop(self): + """ + Getter method for numbered_node_hop, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/numbered_node_hop (container) + + YANG Description: Numbered node route hop. + """ + return self.__numbered_node_hop + + def _set_numbered_node_hop(self, v, load=False): + """ + Setter method for numbered_node_hop, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/numbered_node_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_numbered_node_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_numbered_node_hop() directly. + + YANG Description: Numbered node route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """numbered_node_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__numbered_node_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_numbered_node_hop(self): + self.__numbered_node_hop = YANGDynClass(base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_numbered_link_hop(self): + """ + Getter method for numbered_link_hop, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/numbered_link_hop (container) + + YANG Description: Numbered link explicit route hop. + """ + return self.__numbered_link_hop + + def _set_numbered_link_hop(self, v, load=False): + """ + Setter method for numbered_link_hop, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/numbered_link_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_numbered_link_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_numbered_link_hop() directly. + + YANG Description: Numbered link explicit route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """numbered_link_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__numbered_link_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_numbered_link_hop(self): + self.__numbered_link_hop = YANGDynClass(base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_unnumbered_link_hop(self): + """ + Getter method for unnumbered_link_hop, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/unnumbered_link_hop (container) + + YANG Description: Unnumbered link explicit route hop. + """ + return self.__unnumbered_link_hop + + def _set_unnumbered_link_hop(self, v, load=False): + """ + Setter method for unnumbered_link_hop, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/unnumbered_link_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_unnumbered_link_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_unnumbered_link_hop() directly. + + YANG Description: Unnumbered link explicit route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """unnumbered_link_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__unnumbered_link_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_unnumbered_link_hop(self): + self.__unnumbered_link_hop = YANGDynClass(base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_as_number_hop(self): + """ + Getter method for as_number_hop, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/as_number_hop (container) + + YANG Description: AS explicit route hop. + """ + return self.__as_number_hop + + def _set_as_number_hop(self, v, load=False): + """ + Setter method for as_number_hop, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/as_number_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_as_number_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_as_number_hop() directly. + + YANG Description: AS explicit route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """as_number_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__as_number_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_as_number_hop(self): + self.__as_number_hop = YANGDynClass(base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_label_hop(self): + """ + Getter method for label_hop, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/label_hop (container) + + YANG Description: Label hop type. + """ + return self.__label_hop + + def _set_label_hop(self, v, load=False): + """ + Setter method for label_hop, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/label_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_label_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_label_hop() directly. + + YANG Description: Label hop type. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """label_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__label_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_label_hop(self): + self.__label_hop = YANGDynClass(base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + path_element_id = __builtin__.property(_get_path_element_id, _set_path_element_id) + numbered_node_hop = __builtin__.property(_get_numbered_node_hop, _set_numbered_node_hop) + numbered_link_hop = __builtin__.property(_get_numbered_link_hop, _set_numbered_link_hop) + unnumbered_link_hop = __builtin__.property(_get_unnumbered_link_hop, _set_unnumbered_link_hop) + as_number_hop = __builtin__.property(_get_as_number_hop, _set_as_number_hop) + label_hop = __builtin__.property(_get_label_hop, _set_label_hop) + + __choices__ = {'type': {'numbered-node-hop': ['numbered_node_hop'], 'numbered-link-hop': ['numbered_link_hop'], 'unnumbered-link-hop': ['unnumbered_link_hop'], 'as-number': ['as_number_hop'], 'label': ['label_hop']}} + _pyangbind_elements = OrderedDict([('path_element_id', path_element_id), ('numbered_node_hop', numbered_node_hop), ('numbered_link_hop', numbered_link_hop), ('unnumbered_link_hop', unnumbered_link_hop), ('as_number_hop', as_number_hop), ('label_hop', label_hop), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/as_number_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/as_number_hop/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..b0ecb1150e0d73ba14866319d4cd5f2cd9e58074 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/as_number_hop/__init__.py @@ -0,0 +1,154 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 as_number_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/connectivity-matrix/underlay/backup-path/path-element/as-number-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: AS explicit route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__as_number','__hop_type',) + + _yang_name = 'as-number-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__as_number = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=True) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', 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 ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'connectivity-matrix', 'underlay', 'backup-path', 'path-element', 'as-number-hop'] + + def _get_as_number(self): + """ + Getter method for as_number, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/as_number_hop/as_number (inet:as-number) + + YANG Description: The Autonomous System (AS) number. + """ + return self.__as_number + + def _set_as_number(self, v, load=False): + """ + Setter method for as_number, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/as_number_hop/as_number (inet:as-number) + If this variable is read-only (config: false) in the + source YANG file, then _set_as_number is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_as_number() directly. + + YANG Description: The Autonomous System (AS) number. + """ + 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="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """as_number must be of a type compatible with inet:as-number""", + 'defined-type': "inet:as-number", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=True)""", + }) + + self.__as_number = t + if hasattr(self, '_set'): + self._set() + + def _unset_as_number(self): + self.__as_number = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=True) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/as_number_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/as_number_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + 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={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + + as_number = __builtin__.property(_get_as_number, _set_as_number) + hop_type = __builtin__.property(_get_hop_type, _set_hop_type) + + __choices__ = {'type': {'as-number': ['as_number', 'hop_type']}} + _pyangbind_elements = OrderedDict([('as_number', as_number), ('hop_type', hop_type), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/label_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/label_hop/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..cbd8c31c17338968331ab95064ad2e7cbad80466 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/label_hop/__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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 te_label +class label_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/connectivity-matrix/underlay/backup-path/path-element/label-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Label hop type. + """ + __slots__ = ('_path_helper', '_extmethods', '__te_label',) + + _yang_name = 'label-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__te_label = YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-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 ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'connectivity-matrix', 'underlay', 'backup-path', 'path-element', 'label-hop'] + + def _get_te_label(self): + """ + Getter method for te_label, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/label_hop/te_label (container) + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + return self.__te_label + + def _set_te_label(self, v, load=False): + """ + Setter method for te_label, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/label_hop/te_label (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_te_label is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_te_label() directly. + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """te_label must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__te_label = t + if hasattr(self, '_set'): + self._set() + + def _unset_te_label(self): + self.__te_label = YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + te_label = __builtin__.property(_get_te_label, _set_te_label) + + __choices__ = {'type': {'label': ['te_label']}} + _pyangbind_elements = OrderedDict([('te_label', te_label), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/label_hop/te_label/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/label_hop/te_label/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..3b13105528e3d923437202a96c9dbff4bab19baa --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/label_hop/te_label/__init__.py @@ -0,0 +1,234 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 otn +class te_label(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/connectivity-matrix/underlay/backup-path/path-element/label-hop/te-label. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + __slots__ = ('_path_helper', '_extmethods', '__generic','__otn','__vlanid','__direction',) + + _yang_name = 'te-label' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__generic = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True) + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + self.__vlanid = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True) + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', 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 ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'connectivity-matrix', 'underlay', 'backup-path', 'path-element', 'label-hop', 'te-label'] + + def _get_generic(self): + """ + Getter method for generic, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/label_hop/te_label/generic (rt-types:generalized-label) + + YANG Description: TE label specified in a generic format. + """ + return self.__generic + + def _set_generic(self, v, load=False): + """ + Setter method for generic, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/label_hop/te_label/generic (rt-types:generalized-label) + If this variable is read-only (config: false) in the + source YANG file, then _set_generic is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_generic() directly. + + YANG Description: TE label specified in a generic format. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """generic must be of a type compatible with rt-types:generalized-label""", + 'defined-type': "rt-types:generalized-label", + 'generated-type': """YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True)""", + }) + + self.__generic = t + if hasattr(self, '_set'): + self._set() + + def _unset_generic(self): + self.__generic = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True) + + + def _get_otn(self): + """ + Getter method for otn, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/label_hop/te_label/otn (container) + + YANG Description: Label hop for OTN. + """ + return self.__otn + + def _set_otn(self, v, load=False): + """ + Setter method for otn, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/label_hop/te_label/otn (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_otn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_otn() directly. + + YANG Description: Label hop for OTN. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """otn must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True)""", + }) + + self.__otn = t + if hasattr(self, '_set'): + self._set() + + def _unset_otn(self): + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + + + def _get_vlanid(self): + """ + Getter method for vlanid, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/label_hop/te_label/vlanid (etht-types:vlanid) + + YANG Description: VLAN tag id. + """ + return self.__vlanid + + def _set_vlanid(self, v, load=False): + """ + Setter method for vlanid, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/label_hop/te_label/vlanid (etht-types:vlanid) + If this variable is read-only (config: false) in the + source YANG file, then _set_vlanid is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_vlanid() directly. + + YANG Description: VLAN tag id. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """vlanid must be of a type compatible with etht-types:vlanid""", + 'defined-type': "etht-types:vlanid", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True)""", + }) + + self.__vlanid = t + if hasattr(self, '_set'): + self._set() + + def _unset_vlanid(self): + self.__vlanid = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True) + + + def _get_direction(self): + """ + Getter method for direction, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/label_hop/te_label/direction (te-label-direction) + + YANG Description: Label direction. + """ + return self.__direction + + def _set_direction(self, v, load=False): + """ + Setter method for direction, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/label_hop/te_label/direction (te-label-direction) + If this variable is read-only (config: false) in the + source YANG file, then _set_direction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_direction() directly. + + YANG Description: Label direction. + """ + 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={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """direction must be of a type compatible with te-label-direction""", + 'defined-type': "ietf-te-topology:te-label-direction", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=True)""", + }) + + self.__direction = t + if hasattr(self, '_set'): + self._set() + + def _unset_direction(self): + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=True) + + generic = __builtin__.property(_get_generic, _set_generic) + otn = __builtin__.property(_get_otn, _set_otn) + vlanid = __builtin__.property(_get_vlanid, _set_vlanid) + direction = __builtin__.property(_get_direction, _set_direction) + + __choices__ = {'technology': {'generic': ['generic'], 'otn': ['otn'], 'eth': ['vlanid']}, 'type': {'label': ['direction']}} + _pyangbind_elements = OrderedDict([('generic', generic), ('otn', otn), ('vlanid', vlanid), ('direction', direction), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/label_hop/te_label/otn/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/label_hop/te_label/otn/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..92e4b3b2009cee10fae7ccac4d4d8ddfed3559a1 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/label_hop/te_label/otn/__init__.py @@ -0,0 +1,209 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 otn(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/connectivity-matrix/underlay/backup-path/path-element/label-hop/te-label/otn. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Label hop for OTN. + """ + __slots__ = ('_path_helper', '_extmethods', '__tpn','__tsg','__ts_list',) + + _yang_name = 'otn' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__tpn = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True) + self.__tsg = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + self.__ts_list = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-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 ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'connectivity-matrix', 'underlay', 'backup-path', 'path-element', 'label-hop', 'te-label', 'otn'] + + def _get_tpn(self): + """ + Getter method for tpn, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/label_hop/te_label/otn/tpn (otn-tpn) + + YANG Description: Tributary Port Number (TPN). + """ + return self.__tpn + + def _set_tpn(self, v, load=False): + """ + Setter method for tpn, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/label_hop/te_label/otn/tpn (otn-tpn) + If this variable is read-only (config: false) in the + source YANG file, then _set_tpn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tpn() directly. + + YANG Description: Tributary Port Number (TPN). + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tpn must be of a type compatible with otn-tpn""", + 'defined-type': "ietf-otn-topology:otn-tpn", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True)""", + }) + + self.__tpn = t + if hasattr(self, '_set'): + self._set() + + def _unset_tpn(self): + self.__tpn = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True) + + + def _get_tsg(self): + """ + Getter method for tsg, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/label_hop/te_label/otn/tsg (identityref) + + YANG Description: Tributary Slot Granularity (TSG). + """ + return self.__tsg + + def _set_tsg(self, v, load=False): + """ + Setter method for tsg, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/label_hop/te_label/otn/tsg (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_tsg is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tsg() directly. + + YANG Description: Tributary Slot Granularity (TSG). + """ + 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={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tsg must be of a type compatible with identityref""", + 'defined-type': "ietf-otn-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True)""", + }) + + self.__tsg = t + if hasattr(self, '_set'): + self._set() + + def _unset_tsg(self): + self.__tsg = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + + + def _get_ts_list(self): + """ + Getter method for ts_list, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/label_hop/te_label/otn/ts_list (string) + + YANG Description: A list of available Tributary Slots (TS) ranging + + + + +between 1 and 4095. If multiple values or +ranges are given, they all MUST be disjoint +and MUST be in ascending order. +For example 1-20,25,50-1000. + """ + return self.__ts_list + + def _set_ts_list(self, v, load=False): + """ + Setter method for ts_list, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/label_hop/te_label/otn/ts_list (string) + If this variable is read-only (config: false) in the + source YANG file, then _set_ts_list is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_ts_list() directly. + + YANG Description: A list of available Tributary Slots (TS) ranging + + + + +between 1 and 4095. If multiple values or +ranges are given, they all MUST be disjoint +and MUST be in ascending order. +For example 1-20,25,50-1000. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='string', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """ts_list must be of a type compatible with string""", + 'defined-type': "string", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='string', is_config=True)""", + }) + + self.__ts_list = t + if hasattr(self, '_set'): + self._set() + + def _unset_ts_list(self): + self.__ts_list = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='string', is_config=True) + + tpn = __builtin__.property(_get_tpn, _set_tpn) + tsg = __builtin__.property(_get_tsg, _set_tsg) + ts_list = __builtin__.property(_get_ts_list, _set_ts_list) + + __choices__ = {'technology': {'otn': ['tpn', 'tsg', 'ts_list']}} + _pyangbind_elements = OrderedDict([('tpn', tpn), ('tsg', tsg), ('ts_list', ts_list), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/numbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/numbered_link_hop/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..ee5484d4dc425abb7f30cb8d93b754e6b2c583f2 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/numbered_link_hop/__init__.py @@ -0,0 +1,193 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 numbered_link_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/connectivity-matrix/underlay/backup-path/path-element/numbered-link-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Numbered link explicit route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__link_tp_id','__hop_type','__direction',) + + _yang_name = 'numbered-link-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', 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 ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'connectivity-matrix', 'underlay', 'backup-path', 'path-element', 'numbered-link-hop'] + + def _get_link_tp_id(self): + """ + Getter method for link_tp_id, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/numbered_link_hop/link_tp_id (te-tp-id) + + YANG Description: TE Link Termination Point (LTP) identifier. + """ + return self.__link_tp_id + + def _set_link_tp_id(self, v, load=False): + """ + Setter method for link_tp_id, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/numbered_link_hop/link_tp_id (te-tp-id) + If this variable is read-only (config: false) in the + source YANG file, then _set_link_tp_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_link_tp_id() directly. + + YANG Description: TE Link Termination Point (LTP) identifier. + """ + 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),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """link_tp_id must be of a type compatible with te-tp-id""", + 'defined-type': "ietf-te-topology:te-tp-id", + 'generated-type': """YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True)""", + }) + + self.__link_tp_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_link_tp_id(self): + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/numbered_link_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/numbered_link_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + 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={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + + + def _get_direction(self): + """ + Getter method for direction, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/numbered_link_hop/direction (te-link-direction) + + YANG Description: Link route object direction. + """ + return self.__direction + + def _set_direction(self, v, load=False): + """ + Setter method for direction, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/numbered_link_hop/direction (te-link-direction) + If this variable is read-only (config: false) in the + source YANG file, then _set_direction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_direction() directly. + + YANG Description: Link route object direction. + """ + 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={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """direction must be of a type compatible with te-link-direction""", + 'defined-type': "ietf-te-topology:te-link-direction", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True)""", + }) + + self.__direction = t + if hasattr(self, '_set'): + self._set() + + def _unset_direction(self): + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True) + + link_tp_id = __builtin__.property(_get_link_tp_id, _set_link_tp_id) + hop_type = __builtin__.property(_get_hop_type, _set_hop_type) + direction = __builtin__.property(_get_direction, _set_direction) + + __choices__ = {'type': {'numbered-link-hop': ['link_tp_id', 'hop_type', 'direction']}} + _pyangbind_elements = OrderedDict([('link_tp_id', link_tp_id), ('hop_type', hop_type), ('direction', direction), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/numbered_node_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/numbered_node_hop/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..f2167210db07f6173864a9243c607caf84af8da5 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/numbered_node_hop/__init__.py @@ -0,0 +1,154 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 numbered_node_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/connectivity-matrix/underlay/backup-path/path-element/numbered-node-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Numbered node route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__node_id','__hop_type',) + + _yang_name = 'numbered-node-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', 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 ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'connectivity-matrix', 'underlay', 'backup-path', 'path-element', 'numbered-node-hop'] + + def _get_node_id(self): + """ + Getter method for node_id, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/numbered_node_hop/node_id (te-node-id) + + YANG Description: The identifier of a node in the TE topology. + """ + return self.__node_id + + def _set_node_id(self, v, load=False): + """ + Setter method for node_id, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/numbered_node_hop/node_id (te-node-id) + 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. + + YANG Description: The identifier of a node in the TE topology. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """node_id must be of a type compatible with te-node-id""", + 'defined-type': "ietf-te-topology:te-node-id", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True)""", + }) + + self.__node_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_node_id(self): + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/numbered_node_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/numbered_node_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + 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={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + + node_id = __builtin__.property(_get_node_id, _set_node_id) + hop_type = __builtin__.property(_get_hop_type, _set_hop_type) + + __choices__ = {'type': {'numbered-node-hop': ['node_id', 'hop_type']}} + _pyangbind_elements = OrderedDict([('node_id', node_id), ('hop_type', hop_type), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/unnumbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/unnumbered_link_hop/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..2d48ba9d72ca9ea519dcaf0af21dd99f7f5a8780 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/unnumbered_link_hop/__init__.py @@ -0,0 +1,236 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 unnumbered_link_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/connectivity-matrix/underlay/backup-path/path-element/unnumbered-link-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Unnumbered link explicit route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__link_tp_id','__node_id','__hop_type','__direction',) + + _yang_name = 'unnumbered-link-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True) + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', 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 ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'connectivity-matrix', 'underlay', 'backup-path', 'path-element', 'unnumbered-link-hop'] + + def _get_link_tp_id(self): + """ + Getter method for link_tp_id, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/unnumbered_link_hop/link_tp_id (te-tp-id) + + YANG Description: TE LTP identifier. The combination of the TE link ID +and the TE node ID is used to identify an unnumbered +TE link. + """ + return self.__link_tp_id + + def _set_link_tp_id(self, v, load=False): + """ + Setter method for link_tp_id, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/unnumbered_link_hop/link_tp_id (te-tp-id) + If this variable is read-only (config: false) in the + source YANG file, then _set_link_tp_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_link_tp_id() directly. + + YANG Description: TE LTP identifier. The combination of the TE link ID +and the TE node ID is used to identify an unnumbered +TE link. + """ + 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),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """link_tp_id must be of a type compatible with te-tp-id""", + 'defined-type': "ietf-te-topology:te-tp-id", + 'generated-type': """YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True)""", + }) + + self.__link_tp_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_link_tp_id(self): + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True) + + + def _get_node_id(self): + """ + Getter method for node_id, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/unnumbered_link_hop/node_id (te-node-id) + + YANG Description: The identifier of a node in the TE topology. + """ + return self.__node_id + + def _set_node_id(self, v, load=False): + """ + Setter method for node_id, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/unnumbered_link_hop/node_id (te-node-id) + 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. + + YANG Description: The identifier of a node in the TE topology. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """node_id must be of a type compatible with te-node-id""", + 'defined-type': "ietf-te-topology:te-node-id", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True)""", + }) + + self.__node_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_node_id(self): + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/unnumbered_link_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/unnumbered_link_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + 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={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + + + def _get_direction(self): + """ + Getter method for direction, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/unnumbered_link_hop/direction (te-link-direction) + + YANG Description: Link route object direction. + """ + return self.__direction + + def _set_direction(self, v, load=False): + """ + Setter method for direction, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/unnumbered_link_hop/direction (te-link-direction) + If this variable is read-only (config: false) in the + source YANG file, then _set_direction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_direction() directly. + + YANG Description: Link route object direction. + """ + 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={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """direction must be of a type compatible with te-link-direction""", + 'defined-type': "ietf-te-topology:te-link-direction", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True)""", + }) + + self.__direction = t + if hasattr(self, '_set'): + self._set() + + def _unset_direction(self): + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True) + + link_tp_id = __builtin__.property(_get_link_tp_id, _set_link_tp_id) + node_id = __builtin__.property(_get_node_id, _set_node_id) + hop_type = __builtin__.property(_get_hop_type, _set_hop_type) + direction = __builtin__.property(_get_direction, _set_direction) + + __choices__ = {'type': {'unnumbered-link-hop': ['link_tp_id', 'node_id', 'hop_type', 'direction']}} + _pyangbind_elements = OrderedDict([('link_tp_id', link_tp_id), ('node_id', node_id), ('hop_type', hop_type), ('direction', direction), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/primary_path/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/primary_path/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..f2bbc86b5c77f178913fdd770dc8971277d5c31c --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/primary_path/__init__.py @@ -0,0 +1,158 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 path_element +class primary_path(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/connectivity-matrix/underlay/primary-path. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: The service path on the underlay topology that +supports this link. + """ + __slots__ = ('_path_helper', '_extmethods', '__network_ref','__path_element',) + + _yang_name = 'primary-path' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__network_ref = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="network-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=True) + self.__path_element = YANGDynClass(base=YANGListType("path_element_id",path_element.path_element, yang_name="path-element", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='path-element-id', extensions=None), is_container='list', yang_name="path-element", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-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 ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'connectivity-matrix', 'underlay', 'primary-path'] + + def _get_network_ref(self): + """ + Getter method for network_ref, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/primary_path/network_ref (leafref) + + YANG Description: Used to reference a network -- for example, an underlay +network. + """ + return self.__network_ref + + def _set_network_ref(self, v, load=False): + """ + Setter method for network_ref, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/primary_path/network_ref (leafref) + If this variable is read-only (config: false) in the + source YANG file, then _set_network_ref is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_network_ref() directly. + + YANG Description: Used to reference a network -- for example, an underlay +network. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="network-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """network_ref must be of a type compatible with leafref""", + 'defined-type': "leafref", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="network-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=True)""", + }) + + self.__network_ref = t + if hasattr(self, '_set'): + self._set() + + def _unset_network_ref(self): + self.__network_ref = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="network-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=True) + + + def _get_path_element(self): + """ + Getter method for path_element, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element (list) + + YANG Description: A list of path elements describing the service path. + """ + return self.__path_element + + def _set_path_element(self, v, load=False): + """ + Setter method for path_element, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_element is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_element() directly. + + YANG Description: A list of path elements describing the service path. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("path_element_id",path_element.path_element, yang_name="path-element", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='path-element-id', extensions=None), is_container='list', yang_name="path-element", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_element must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("path_element_id",path_element.path_element, yang_name="path-element", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='path-element-id', extensions=None), is_container='list', yang_name="path-element", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True)""", + }) + + self.__path_element = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_element(self): + self.__path_element = YANGDynClass(base=YANGListType("path_element_id",path_element.path_element, yang_name="path-element", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='path-element-id', extensions=None), is_container='list', yang_name="path-element", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + + network_ref = __builtin__.property(_get_network_ref, _set_network_ref) + path_element = __builtin__.property(_get_path_element, _set_path_element) + + + _pyangbind_elements = OrderedDict([('network_ref', network_ref), ('path_element', path_element), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..fa22d7bbd2819b292006ab4f290008b98fba9a86 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/__init__.py @@ -0,0 +1,320 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 numbered_node_hop +from . import numbered_link_hop +from . import unnumbered_link_hop +from . import as_number_hop +from . import label_hop +class path_element(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/connectivity-matrix/underlay/primary-path/path-element. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: A list of path elements describing the service path. + """ + __slots__ = ('_path_helper', '_extmethods', '__path_element_id','__numbered_node_hop','__numbered_link_hop','__unnumbered_link_hop','__as_number_hop','__label_hop',) + + _yang_name = 'path-element' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__path_element_id = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="path-element-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + self.__numbered_node_hop = YANGDynClass(base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__numbered_link_hop = YANGDynClass(base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__unnumbered_link_hop = YANGDynClass(base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__as_number_hop = YANGDynClass(base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__label_hop = YANGDynClass(base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-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 ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'connectivity-matrix', 'underlay', 'primary-path', 'path-element'] + + def _get_path_element_id(self): + """ + Getter method for path_element_id, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/path_element_id (uint32) + + YANG Description: To identify the element in a path. + """ + return self.__path_element_id + + def _set_path_element_id(self, v, load=False): + """ + Setter method for path_element_id, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/path_element_id (uint32) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_element_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_element_id() directly. + + YANG Description: To identify the element in a path. + """ + 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=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="path-element-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_element_id 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="path-element-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True)""", + }) + + self.__path_element_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_element_id(self): + self.__path_element_id = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="path-element-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + + + def _get_numbered_node_hop(self): + """ + Getter method for numbered_node_hop, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/numbered_node_hop (container) + + YANG Description: Numbered node route hop. + """ + return self.__numbered_node_hop + + def _set_numbered_node_hop(self, v, load=False): + """ + Setter method for numbered_node_hop, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/numbered_node_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_numbered_node_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_numbered_node_hop() directly. + + YANG Description: Numbered node route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """numbered_node_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__numbered_node_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_numbered_node_hop(self): + self.__numbered_node_hop = YANGDynClass(base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_numbered_link_hop(self): + """ + Getter method for numbered_link_hop, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/numbered_link_hop (container) + + YANG Description: Numbered link explicit route hop. + """ + return self.__numbered_link_hop + + def _set_numbered_link_hop(self, v, load=False): + """ + Setter method for numbered_link_hop, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/numbered_link_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_numbered_link_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_numbered_link_hop() directly. + + YANG Description: Numbered link explicit route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """numbered_link_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__numbered_link_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_numbered_link_hop(self): + self.__numbered_link_hop = YANGDynClass(base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_unnumbered_link_hop(self): + """ + Getter method for unnumbered_link_hop, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/unnumbered_link_hop (container) + + YANG Description: Unnumbered link explicit route hop. + """ + return self.__unnumbered_link_hop + + def _set_unnumbered_link_hop(self, v, load=False): + """ + Setter method for unnumbered_link_hop, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/unnumbered_link_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_unnumbered_link_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_unnumbered_link_hop() directly. + + YANG Description: Unnumbered link explicit route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """unnumbered_link_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__unnumbered_link_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_unnumbered_link_hop(self): + self.__unnumbered_link_hop = YANGDynClass(base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_as_number_hop(self): + """ + Getter method for as_number_hop, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/as_number_hop (container) + + YANG Description: AS explicit route hop. + """ + return self.__as_number_hop + + def _set_as_number_hop(self, v, load=False): + """ + Setter method for as_number_hop, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/as_number_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_as_number_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_as_number_hop() directly. + + YANG Description: AS explicit route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """as_number_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__as_number_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_as_number_hop(self): + self.__as_number_hop = YANGDynClass(base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_label_hop(self): + """ + Getter method for label_hop, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/label_hop (container) + + YANG Description: Label hop type. + """ + return self.__label_hop + + def _set_label_hop(self, v, load=False): + """ + Setter method for label_hop, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/label_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_label_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_label_hop() directly. + + YANG Description: Label hop type. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """label_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__label_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_label_hop(self): + self.__label_hop = YANGDynClass(base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + path_element_id = __builtin__.property(_get_path_element_id, _set_path_element_id) + numbered_node_hop = __builtin__.property(_get_numbered_node_hop, _set_numbered_node_hop) + numbered_link_hop = __builtin__.property(_get_numbered_link_hop, _set_numbered_link_hop) + unnumbered_link_hop = __builtin__.property(_get_unnumbered_link_hop, _set_unnumbered_link_hop) + as_number_hop = __builtin__.property(_get_as_number_hop, _set_as_number_hop) + label_hop = __builtin__.property(_get_label_hop, _set_label_hop) + + __choices__ = {'type': {'numbered-node-hop': ['numbered_node_hop'], 'numbered-link-hop': ['numbered_link_hop'], 'unnumbered-link-hop': ['unnumbered_link_hop'], 'as-number': ['as_number_hop'], 'label': ['label_hop']}} + _pyangbind_elements = OrderedDict([('path_element_id', path_element_id), ('numbered_node_hop', numbered_node_hop), ('numbered_link_hop', numbered_link_hop), ('unnumbered_link_hop', unnumbered_link_hop), ('as_number_hop', as_number_hop), ('label_hop', label_hop), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/as_number_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/as_number_hop/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..5bf46184c7e5d536c281b66407774448ecff1a55 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/as_number_hop/__init__.py @@ -0,0 +1,154 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 as_number_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/connectivity-matrix/underlay/primary-path/path-element/as-number-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: AS explicit route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__as_number','__hop_type',) + + _yang_name = 'as-number-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__as_number = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=True) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', 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 ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'connectivity-matrix', 'underlay', 'primary-path', 'path-element', 'as-number-hop'] + + def _get_as_number(self): + """ + Getter method for as_number, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/as_number_hop/as_number (inet:as-number) + + YANG Description: The Autonomous System (AS) number. + """ + return self.__as_number + + def _set_as_number(self, v, load=False): + """ + Setter method for as_number, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/as_number_hop/as_number (inet:as-number) + If this variable is read-only (config: false) in the + source YANG file, then _set_as_number is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_as_number() directly. + + YANG Description: The Autonomous System (AS) number. + """ + 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="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """as_number must be of a type compatible with inet:as-number""", + 'defined-type': "inet:as-number", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=True)""", + }) + + self.__as_number = t + if hasattr(self, '_set'): + self._set() + + def _unset_as_number(self): + self.__as_number = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=True) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/as_number_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/as_number_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + 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={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + + as_number = __builtin__.property(_get_as_number, _set_as_number) + hop_type = __builtin__.property(_get_hop_type, _set_hop_type) + + __choices__ = {'type': {'as-number': ['as_number', 'hop_type']}} + _pyangbind_elements = OrderedDict([('as_number', as_number), ('hop_type', hop_type), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/label_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/label_hop/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..6377790bb6bae1df14603a8b0ac6aeac4067e877 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/label_hop/__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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 te_label +class label_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/connectivity-matrix/underlay/primary-path/path-element/label-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Label hop type. + """ + __slots__ = ('_path_helper', '_extmethods', '__te_label',) + + _yang_name = 'label-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__te_label = YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-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 ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'connectivity-matrix', 'underlay', 'primary-path', 'path-element', 'label-hop'] + + def _get_te_label(self): + """ + Getter method for te_label, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/label_hop/te_label (container) + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + return self.__te_label + + def _set_te_label(self, v, load=False): + """ + Setter method for te_label, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/label_hop/te_label (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_te_label is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_te_label() directly. + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """te_label must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__te_label = t + if hasattr(self, '_set'): + self._set() + + def _unset_te_label(self): + self.__te_label = YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + te_label = __builtin__.property(_get_te_label, _set_te_label) + + __choices__ = {'type': {'label': ['te_label']}} + _pyangbind_elements = OrderedDict([('te_label', te_label), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/label_hop/te_label/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/label_hop/te_label/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..c200f5daec410e22c5714ac6244580fb2af5d8ca --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/label_hop/te_label/__init__.py @@ -0,0 +1,234 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 otn +class te_label(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/connectivity-matrix/underlay/primary-path/path-element/label-hop/te-label. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + __slots__ = ('_path_helper', '_extmethods', '__generic','__otn','__vlanid','__direction',) + + _yang_name = 'te-label' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__generic = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True) + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + self.__vlanid = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True) + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', 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 ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'connectivity-matrix', 'underlay', 'primary-path', 'path-element', 'label-hop', 'te-label'] + + def _get_generic(self): + """ + Getter method for generic, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/label_hop/te_label/generic (rt-types:generalized-label) + + YANG Description: TE label specified in a generic format. + """ + return self.__generic + + def _set_generic(self, v, load=False): + """ + Setter method for generic, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/label_hop/te_label/generic (rt-types:generalized-label) + If this variable is read-only (config: false) in the + source YANG file, then _set_generic is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_generic() directly. + + YANG Description: TE label specified in a generic format. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """generic must be of a type compatible with rt-types:generalized-label""", + 'defined-type': "rt-types:generalized-label", + 'generated-type': """YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True)""", + }) + + self.__generic = t + if hasattr(self, '_set'): + self._set() + + def _unset_generic(self): + self.__generic = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True) + + + def _get_otn(self): + """ + Getter method for otn, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/label_hop/te_label/otn (container) + + YANG Description: Label hop for OTN. + """ + return self.__otn + + def _set_otn(self, v, load=False): + """ + Setter method for otn, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/label_hop/te_label/otn (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_otn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_otn() directly. + + YANG Description: Label hop for OTN. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """otn must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True)""", + }) + + self.__otn = t + if hasattr(self, '_set'): + self._set() + + def _unset_otn(self): + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + + + def _get_vlanid(self): + """ + Getter method for vlanid, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/label_hop/te_label/vlanid (etht-types:vlanid) + + YANG Description: VLAN tag id. + """ + return self.__vlanid + + def _set_vlanid(self, v, load=False): + """ + Setter method for vlanid, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/label_hop/te_label/vlanid (etht-types:vlanid) + If this variable is read-only (config: false) in the + source YANG file, then _set_vlanid is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_vlanid() directly. + + YANG Description: VLAN tag id. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """vlanid must be of a type compatible with etht-types:vlanid""", + 'defined-type': "etht-types:vlanid", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True)""", + }) + + self.__vlanid = t + if hasattr(self, '_set'): + self._set() + + def _unset_vlanid(self): + self.__vlanid = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True) + + + def _get_direction(self): + """ + Getter method for direction, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/label_hop/te_label/direction (te-label-direction) + + YANG Description: Label direction. + """ + return self.__direction + + def _set_direction(self, v, load=False): + """ + Setter method for direction, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/label_hop/te_label/direction (te-label-direction) + If this variable is read-only (config: false) in the + source YANG file, then _set_direction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_direction() directly. + + YANG Description: Label direction. + """ + 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={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """direction must be of a type compatible with te-label-direction""", + 'defined-type': "ietf-te-topology:te-label-direction", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=True)""", + }) + + self.__direction = t + if hasattr(self, '_set'): + self._set() + + def _unset_direction(self): + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=True) + + generic = __builtin__.property(_get_generic, _set_generic) + otn = __builtin__.property(_get_otn, _set_otn) + vlanid = __builtin__.property(_get_vlanid, _set_vlanid) + direction = __builtin__.property(_get_direction, _set_direction) + + __choices__ = {'technology': {'generic': ['generic'], 'otn': ['otn'], 'eth': ['vlanid']}, 'type': {'label': ['direction']}} + _pyangbind_elements = OrderedDict([('generic', generic), ('otn', otn), ('vlanid', vlanid), ('direction', direction), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/label_hop/te_label/otn/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/label_hop/te_label/otn/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..7f897420e3ffe30a72d157d79095f9d5e5287436 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/label_hop/te_label/otn/__init__.py @@ -0,0 +1,209 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 otn(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/connectivity-matrix/underlay/primary-path/path-element/label-hop/te-label/otn. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Label hop for OTN. + """ + __slots__ = ('_path_helper', '_extmethods', '__tpn','__tsg','__ts_list',) + + _yang_name = 'otn' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__tpn = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True) + self.__tsg = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + self.__ts_list = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-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 ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'connectivity-matrix', 'underlay', 'primary-path', 'path-element', 'label-hop', 'te-label', 'otn'] + + def _get_tpn(self): + """ + Getter method for tpn, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/label_hop/te_label/otn/tpn (otn-tpn) + + YANG Description: Tributary Port Number (TPN). + """ + return self.__tpn + + def _set_tpn(self, v, load=False): + """ + Setter method for tpn, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/label_hop/te_label/otn/tpn (otn-tpn) + If this variable is read-only (config: false) in the + source YANG file, then _set_tpn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tpn() directly. + + YANG Description: Tributary Port Number (TPN). + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tpn must be of a type compatible with otn-tpn""", + 'defined-type': "ietf-otn-topology:otn-tpn", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True)""", + }) + + self.__tpn = t + if hasattr(self, '_set'): + self._set() + + def _unset_tpn(self): + self.__tpn = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True) + + + def _get_tsg(self): + """ + Getter method for tsg, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/label_hop/te_label/otn/tsg (identityref) + + YANG Description: Tributary Slot Granularity (TSG). + """ + return self.__tsg + + def _set_tsg(self, v, load=False): + """ + Setter method for tsg, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/label_hop/te_label/otn/tsg (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_tsg is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tsg() directly. + + YANG Description: Tributary Slot Granularity (TSG). + """ + 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={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tsg must be of a type compatible with identityref""", + 'defined-type': "ietf-otn-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True)""", + }) + + self.__tsg = t + if hasattr(self, '_set'): + self._set() + + def _unset_tsg(self): + self.__tsg = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + + + def _get_ts_list(self): + """ + Getter method for ts_list, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/label_hop/te_label/otn/ts_list (string) + + YANG Description: A list of available Tributary Slots (TS) ranging + + + + +between 1 and 4095. If multiple values or +ranges are given, they all MUST be disjoint +and MUST be in ascending order. +For example 1-20,25,50-1000. + """ + return self.__ts_list + + def _set_ts_list(self, v, load=False): + """ + Setter method for ts_list, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/label_hop/te_label/otn/ts_list (string) + If this variable is read-only (config: false) in the + source YANG file, then _set_ts_list is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_ts_list() directly. + + YANG Description: A list of available Tributary Slots (TS) ranging + + + + +between 1 and 4095. If multiple values or +ranges are given, they all MUST be disjoint +and MUST be in ascending order. +For example 1-20,25,50-1000. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='string', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """ts_list must be of a type compatible with string""", + 'defined-type': "string", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='string', is_config=True)""", + }) + + self.__ts_list = t + if hasattr(self, '_set'): + self._set() + + def _unset_ts_list(self): + self.__ts_list = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='string', is_config=True) + + tpn = __builtin__.property(_get_tpn, _set_tpn) + tsg = __builtin__.property(_get_tsg, _set_tsg) + ts_list = __builtin__.property(_get_ts_list, _set_ts_list) + + __choices__ = {'technology': {'otn': ['tpn', 'tsg', 'ts_list']}} + _pyangbind_elements = OrderedDict([('tpn', tpn), ('tsg', tsg), ('ts_list', ts_list), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/numbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/numbered_link_hop/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e1c306281f6a074eb7204e1ab31f818f01529c60 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/numbered_link_hop/__init__.py @@ -0,0 +1,193 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 numbered_link_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/connectivity-matrix/underlay/primary-path/path-element/numbered-link-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Numbered link explicit route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__link_tp_id','__hop_type','__direction',) + + _yang_name = 'numbered-link-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', 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 ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'connectivity-matrix', 'underlay', 'primary-path', 'path-element', 'numbered-link-hop'] + + def _get_link_tp_id(self): + """ + Getter method for link_tp_id, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/numbered_link_hop/link_tp_id (te-tp-id) + + YANG Description: TE Link Termination Point (LTP) identifier. + """ + return self.__link_tp_id + + def _set_link_tp_id(self, v, load=False): + """ + Setter method for link_tp_id, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/numbered_link_hop/link_tp_id (te-tp-id) + If this variable is read-only (config: false) in the + source YANG file, then _set_link_tp_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_link_tp_id() directly. + + YANG Description: TE Link Termination Point (LTP) identifier. + """ + 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),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """link_tp_id must be of a type compatible with te-tp-id""", + 'defined-type': "ietf-te-topology:te-tp-id", + 'generated-type': """YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True)""", + }) + + self.__link_tp_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_link_tp_id(self): + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/numbered_link_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/numbered_link_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + 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={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + + + def _get_direction(self): + """ + Getter method for direction, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/numbered_link_hop/direction (te-link-direction) + + YANG Description: Link route object direction. + """ + return self.__direction + + def _set_direction(self, v, load=False): + """ + Setter method for direction, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/numbered_link_hop/direction (te-link-direction) + If this variable is read-only (config: false) in the + source YANG file, then _set_direction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_direction() directly. + + YANG Description: Link route object direction. + """ + 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={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """direction must be of a type compatible with te-link-direction""", + 'defined-type': "ietf-te-topology:te-link-direction", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True)""", + }) + + self.__direction = t + if hasattr(self, '_set'): + self._set() + + def _unset_direction(self): + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True) + + link_tp_id = __builtin__.property(_get_link_tp_id, _set_link_tp_id) + hop_type = __builtin__.property(_get_hop_type, _set_hop_type) + direction = __builtin__.property(_get_direction, _set_direction) + + __choices__ = {'type': {'numbered-link-hop': ['link_tp_id', 'hop_type', 'direction']}} + _pyangbind_elements = OrderedDict([('link_tp_id', link_tp_id), ('hop_type', hop_type), ('direction', direction), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/numbered_node_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/numbered_node_hop/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..9c043b2727a232d8eb3ccbefecc4ff22b49135b6 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/numbered_node_hop/__init__.py @@ -0,0 +1,154 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 numbered_node_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/connectivity-matrix/underlay/primary-path/path-element/numbered-node-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Numbered node route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__node_id','__hop_type',) + + _yang_name = 'numbered-node-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', 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 ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'connectivity-matrix', 'underlay', 'primary-path', 'path-element', 'numbered-node-hop'] + + def _get_node_id(self): + """ + Getter method for node_id, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/numbered_node_hop/node_id (te-node-id) + + YANG Description: The identifier of a node in the TE topology. + """ + return self.__node_id + + def _set_node_id(self, v, load=False): + """ + Setter method for node_id, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/numbered_node_hop/node_id (te-node-id) + 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. + + YANG Description: The identifier of a node in the TE topology. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """node_id must be of a type compatible with te-node-id""", + 'defined-type': "ietf-te-topology:te-node-id", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True)""", + }) + + self.__node_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_node_id(self): + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/numbered_node_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/numbered_node_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + 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={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + + node_id = __builtin__.property(_get_node_id, _set_node_id) + hop_type = __builtin__.property(_get_hop_type, _set_hop_type) + + __choices__ = {'type': {'numbered-node-hop': ['node_id', 'hop_type']}} + _pyangbind_elements = OrderedDict([('node_id', node_id), ('hop_type', hop_type), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/unnumbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/unnumbered_link_hop/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..4f8f2de6e21f868f30d26149c233125f23b9415f --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/unnumbered_link_hop/__init__.py @@ -0,0 +1,236 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 unnumbered_link_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/connectivity-matrix/underlay/primary-path/path-element/unnumbered-link-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Unnumbered link explicit route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__link_tp_id','__node_id','__hop_type','__direction',) + + _yang_name = 'unnumbered-link-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True) + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', 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 ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'connectivity-matrix', 'underlay', 'primary-path', 'path-element', 'unnumbered-link-hop'] + + def _get_link_tp_id(self): + """ + Getter method for link_tp_id, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/unnumbered_link_hop/link_tp_id (te-tp-id) + + YANG Description: TE LTP identifier. The combination of the TE link ID +and the TE node ID is used to identify an unnumbered +TE link. + """ + return self.__link_tp_id + + def _set_link_tp_id(self, v, load=False): + """ + Setter method for link_tp_id, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/unnumbered_link_hop/link_tp_id (te-tp-id) + If this variable is read-only (config: false) in the + source YANG file, then _set_link_tp_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_link_tp_id() directly. + + YANG Description: TE LTP identifier. The combination of the TE link ID +and the TE node ID is used to identify an unnumbered +TE link. + """ + 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),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """link_tp_id must be of a type compatible with te-tp-id""", + 'defined-type': "ietf-te-topology:te-tp-id", + 'generated-type': """YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True)""", + }) + + self.__link_tp_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_link_tp_id(self): + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True) + + + def _get_node_id(self): + """ + Getter method for node_id, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/unnumbered_link_hop/node_id (te-node-id) + + YANG Description: The identifier of a node in the TE topology. + """ + return self.__node_id + + def _set_node_id(self, v, load=False): + """ + Setter method for node_id, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/unnumbered_link_hop/node_id (te-node-id) + 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. + + YANG Description: The identifier of a node in the TE topology. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """node_id must be of a type compatible with te-node-id""", + 'defined-type': "ietf-te-topology:te-node-id", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True)""", + }) + + self.__node_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_node_id(self): + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/unnumbered_link_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/unnumbered_link_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + 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={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + + + def _get_direction(self): + """ + Getter method for direction, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/unnumbered_link_hop/direction (te-link-direction) + + YANG Description: Link route object direction. + """ + return self.__direction + + def _set_direction(self, v, load=False): + """ + Setter method for direction, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/unnumbered_link_hop/direction (te-link-direction) + If this variable is read-only (config: false) in the + source YANG file, then _set_direction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_direction() directly. + + YANG Description: Link route object direction. + """ + 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={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """direction must be of a type compatible with te-link-direction""", + 'defined-type': "ietf-te-topology:te-link-direction", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True)""", + }) + + self.__direction = t + if hasattr(self, '_set'): + self._set() + + def _unset_direction(self): + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True) + + link_tp_id = __builtin__.property(_get_link_tp_id, _set_link_tp_id) + node_id = __builtin__.property(_get_node_id, _set_node_id) + hop_type = __builtin__.property(_get_hop_type, _set_hop_type) + direction = __builtin__.property(_get_direction, _set_direction) + + __choices__ = {'type': {'unnumbered-link-hop': ['link_tp_id', 'node_id', 'hop_type', 'direction']}} + _pyangbind_elements = OrderedDict([('link_tp_id', link_tp_id), ('node_id', node_id), ('hop_type', hop_type), ('direction', direction), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/tunnel_termination_points/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/tunnel_termination_points/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..6fbb783c1fd354a14fab78d0f5e41ca5efd857a1 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/tunnel_termination_points/__init__.py @@ -0,0 +1,154 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 tunnel_termination_points(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/connectivity-matrix/underlay/tunnel-termination-points. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Underlay TTPs desired for this link. + """ + __slots__ = ('_path_helper', '_extmethods', '__source','__destination',) + + _yang_name = 'tunnel-termination-points' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__source = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="source", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='binary', is_config=True) + self.__destination = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="destination", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='binary', 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 ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'connectivity-matrix', 'underlay', 'tunnel-termination-points'] + + def _get_source(self): + """ + Getter method for source, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/tunnel_termination_points/source (binary) + + YANG Description: Source TTP identifier. + """ + return self.__source + + def _set_source(self, v, load=False): + """ + Setter method for source, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/tunnel_termination_points/source (binary) + If this variable is read-only (config: false) in the + source YANG file, then _set_source is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_source() directly. + + YANG Description: Source TTP identifier. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBinary, is_leaf=True, yang_name="source", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='binary', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """source must be of a type compatible with binary""", + 'defined-type': "binary", + 'generated-type': """YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="source", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='binary', is_config=True)""", + }) + + self.__source = t + if hasattr(self, '_set'): + self._set() + + def _unset_source(self): + self.__source = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="source", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='binary', is_config=True) + + + def _get_destination(self): + """ + Getter method for destination, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/tunnel_termination_points/destination (binary) + + YANG Description: Destination TTP identifier. + """ + return self.__destination + + def _set_destination(self, v, load=False): + """ + Setter method for destination, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/tunnel_termination_points/destination (binary) + If this variable is read-only (config: false) in the + source YANG file, then _set_destination is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_destination() directly. + + YANG Description: Destination TTP identifier. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBinary, is_leaf=True, yang_name="destination", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='binary', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """destination must be of a type compatible with binary""", + 'defined-type': "binary", + 'generated-type': """YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="destination", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='binary', is_config=True)""", + }) + + self.__destination = t + if hasattr(self, '_set'): + self._set() + + def _unset_destination(self): + self.__destination = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="destination", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='binary', is_config=True) + + source = __builtin__.property(_get_source, _set_source) + destination = __builtin__.property(_get_destination, _set_destination) + + + _pyangbind_elements = OrderedDict([('source', source), ('destination', destination), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/tunnels/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/tunnels/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..f5455155f401d092644389695e8ddd28e47cbef6 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/tunnels/__init__.py @@ -0,0 +1,167 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 tunnel +class tunnels(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/connectivity-matrix/underlay/tunnels. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Underlay TE tunnels supporting this TE link. + """ + __slots__ = ('_path_helper', '_extmethods', '__sharing','__tunnel',) + + _yang_name = 'tunnels' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__sharing = YANGDynClass(base=YANGBool, default=YANGBool("true"), is_leaf=True, yang_name="sharing", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='boolean', is_config=True) + self.__tunnel = YANGDynClass(base=YANGListType("tunnel_name",tunnel.tunnel, yang_name="tunnel", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='tunnel-name', extensions=None), is_container='list', yang_name="tunnel", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-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 ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'connectivity-matrix', 'underlay', 'tunnels'] + + def _get_sharing(self): + """ + Getter method for sharing, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/tunnels/sharing (boolean) + + YANG Description: 'true' if the underlay tunnel can be shared with other +TE links; +'false' if the underlay tunnel is dedicated to this +TE link. +This leaf is the default option for all TE tunnels +and may be overridden by the per-TE-tunnel value. + """ + return self.__sharing + + def _set_sharing(self, v, load=False): + """ + Setter method for sharing, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/tunnels/sharing (boolean) + If this variable is read-only (config: false) in the + source YANG file, then _set_sharing is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_sharing() directly. + + YANG Description: 'true' if the underlay tunnel can be shared with other +TE links; +'false' if the underlay tunnel is dedicated to this +TE link. +This leaf is the default option for all TE tunnels +and may be overridden by the per-TE-tunnel value. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBool, default=YANGBool("true"), is_leaf=True, yang_name="sharing", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='boolean', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """sharing must be of a type compatible with boolean""", + 'defined-type': "boolean", + 'generated-type': """YANGDynClass(base=YANGBool, default=YANGBool("true"), is_leaf=True, yang_name="sharing", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='boolean', is_config=True)""", + }) + + self.__sharing = t + if hasattr(self, '_set'): + self._set() + + def _unset_sharing(self): + self.__sharing = YANGDynClass(base=YANGBool, default=YANGBool("true"), is_leaf=True, yang_name="sharing", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='boolean', is_config=True) + + + def _get_tunnel(self): + """ + Getter method for tunnel, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/tunnels/tunnel (list) + + YANG Description: Zero, one, or more underlay TE tunnels that support this +TE link. + """ + return self.__tunnel + + def _set_tunnel(self, v, load=False): + """ + Setter method for tunnel, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/tunnels/tunnel (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_tunnel is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tunnel() directly. + + YANG Description: Zero, one, or more underlay TE tunnels that support this +TE link. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("tunnel_name",tunnel.tunnel, yang_name="tunnel", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='tunnel-name', extensions=None), is_container='list', yang_name="tunnel", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tunnel must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("tunnel_name",tunnel.tunnel, yang_name="tunnel", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='tunnel-name', extensions=None), is_container='list', yang_name="tunnel", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True)""", + }) + + self.__tunnel = t + if hasattr(self, '_set'): + self._set() + + def _unset_tunnel(self): + self.__tunnel = YANGDynClass(base=YANGListType("tunnel_name",tunnel.tunnel, yang_name="tunnel", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='tunnel-name', extensions=None), is_container='list', yang_name="tunnel", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + + sharing = __builtin__.property(_get_sharing, _set_sharing) + tunnel = __builtin__.property(_get_tunnel, _set_tunnel) + + + _pyangbind_elements = OrderedDict([('sharing', sharing), ('tunnel', tunnel), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/tunnels/tunnel/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/tunnels/tunnel/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..58c254b1efbb56273d6c8f522441dd540741f72a --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/tunnels/tunnel/__init__.py @@ -0,0 +1,170 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 tunnel(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/connectivity-matrix/underlay/tunnels/tunnel. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Zero, one, or more underlay TE tunnels that support this +TE link. + """ + __slots__ = ('_path_helper', '_extmethods', '__tunnel_name','__sharing',) + + _yang_name = 'tunnel' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__tunnel_name = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="tunnel-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=True) + self.__sharing = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="sharing", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', 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 ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'connectivity-matrix', 'underlay', 'tunnels', 'tunnel'] + + def _get_tunnel_name(self): + """ + Getter method for tunnel_name, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/tunnels/tunnel/tunnel_name (string) + + YANG Description: A tunnel name uniquely identifies an underlay TE tunnel, +used together with the 'source-node' value for this +link. + """ + return self.__tunnel_name + + def _set_tunnel_name(self, v, load=False): + """ + Setter method for tunnel_name, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/tunnels/tunnel/tunnel_name (string) + If this variable is read-only (config: false) in the + source YANG file, then _set_tunnel_name is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tunnel_name() directly. + + YANG Description: A tunnel name uniquely identifies an underlay TE tunnel, +used together with the 'source-node' value for this +link. + """ + 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="tunnel-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tunnel_name must be of a type compatible with string""", + 'defined-type': "string", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="tunnel-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=True)""", + }) + + self.__tunnel_name = t + if hasattr(self, '_set'): + self._set() + + def _unset_tunnel_name(self): + self.__tunnel_name = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="tunnel-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=True) + + + def _get_sharing(self): + """ + Getter method for sharing, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/tunnels/tunnel/sharing (boolean) + + YANG Description: 'true' if the underlay tunnel can be shared with other +TE links; +'false' if the underlay tunnel is dedicated to this +TE link. + """ + return self.__sharing + + def _set_sharing(self, v, load=False): + """ + Setter method for sharing, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/tunnels/tunnel/sharing (boolean) + If this variable is read-only (config: false) in the + source YANG file, then _set_sharing is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_sharing() directly. + + YANG Description: 'true' if the underlay tunnel can be shared with other +TE links; +'false' if the underlay tunnel is dedicated to this +TE link. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBool, is_leaf=True, yang_name="sharing", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='boolean', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """sharing must be of a type compatible with boolean""", + 'defined-type': "boolean", + 'generated-type': """YANGDynClass(base=YANGBool, is_leaf=True, yang_name="sharing", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='boolean', is_config=True)""", + }) + + self.__sharing = t + if hasattr(self, '_set'): + self._set() + + def _unset_sharing(self): + self.__sharing = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="sharing", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='boolean', is_config=True) + + tunnel_name = __builtin__.property(_get_tunnel_name, _set_tunnel_name) + sharing = __builtin__.property(_get_sharing, _set_sharing) + + + _pyangbind_elements = OrderedDict([('tunnel_name', tunnel_name), ('sharing', sharing), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..c5a9838d5e9285068a7290d0398b8b73f3368bf7 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/__init__.py @@ -0,0 +1,120 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 label_restriction +class label_restrictions(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/label-restrictions. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: The label restrictions container. + """ + __slots__ = ('_path_helper', '_extmethods', '__label_restriction',) + + _yang_name = 'label-restrictions' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__label_restriction = YANGDynClass(base=YANGListType("index",label_restriction.label_restriction, yang_name="label-restriction", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='index', extensions=None), is_container='list', yang_name="label-restriction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-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 ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'label-restrictions'] + + def _get_label_restriction(self): + """ + Getter method for label_restriction, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/label_restriction (list) + + YANG Description: The absence of the label restrictions container implies +that all labels are acceptable; otherwise, only restricted +labels are available. + """ + return self.__label_restriction + + def _set_label_restriction(self, v, load=False): + """ + Setter method for label_restriction, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/label_restriction (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_label_restriction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_label_restriction() directly. + + YANG Description: The absence of the label restrictions container implies +that all labels are acceptable; otherwise, only restricted +labels are available. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("index",label_restriction.label_restriction, yang_name="label-restriction", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='index', extensions=None), is_container='list', yang_name="label-restriction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """label_restriction must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("index",label_restriction.label_restriction, yang_name="label-restriction", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='index', extensions=None), is_container='list', yang_name="label-restriction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True)""", + }) + + self.__label_restriction = t + if hasattr(self, '_set'): + self._set() + + def _unset_label_restriction(self): + self.__label_restriction = YANGDynClass(base=YANGListType("index",label_restriction.label_restriction, yang_name="label-restriction", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='index', extensions=None), is_container='list', yang_name="label-restriction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + + label_restriction = __builtin__.property(_get_label_restriction, _set_label_restriction) + + + _pyangbind_elements = OrderedDict([('label_restriction', label_restriction), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/label_restriction/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/label_restriction/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..1d5b189635af1cbfce81d2c8c81d0f6f3cd60e4e --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/label_restriction/__init__.py @@ -0,0 +1,450 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 label_start +from . import label_end +from . import label_step +from . import otn_label_range +from . import ethernet_label_range +class label_restriction(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/label-restrictions/label-restriction. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: The absence of the label restrictions container implies +that all labels are acceptable; otherwise, only restricted +labels are available. + """ + __slots__ = ('_path_helper', '_extmethods', '__restriction','__index','__label_start','__label_end','__label_step','__range_bitmap','__otn_label_range','__ethernet_label_range',) + + _yang_name = 'label-restriction' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__restriction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'inclusive': {}, 'exclusive': {}},), default=six.text_type("inclusive"), is_leaf=True, yang_name="restriction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='enumeration', is_config=True) + self.__index = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + self.__label_start = YANGDynClass(base=label_start.label_start, is_container='container', yang_name="label-start", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__label_end = YANGDynClass(base=label_end.label_end, is_container='container', yang_name="label-end", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__label_step = YANGDynClass(base=label_step.label_step, is_container='container', yang_name="label-step", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__range_bitmap = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}), is_leaf=True, yang_name="range-bitmap", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:hex-string', is_config=True) + self.__otn_label_range = YANGDynClass(base=otn_label_range.otn_label_range, is_container='container', yang_name="otn-label-range", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + self.__ethernet_label_range = YANGDynClass(base=ethernet_label_range.ethernet_label_range, is_container='container', yang_name="ethernet-label-range", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-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 ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'label-restrictions', 'label-restriction'] + + def _get_restriction(self): + """ + Getter method for restriction, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/label_restriction/restriction (enumeration) + + YANG Description: Indicates whether the list item is inclusive or exclusive. + """ + return self.__restriction + + def _set_restriction(self, v, load=False): + """ + Setter method for restriction, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/label_restriction/restriction (enumeration) + If this variable is read-only (config: false) in the + source YANG file, then _set_restriction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_restriction() directly. + + YANG Description: Indicates whether the list item is inclusive or exclusive. + """ + 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={'inclusive': {}, 'exclusive': {}},), default=six.text_type("inclusive"), is_leaf=True, yang_name="restriction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='enumeration', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """restriction must be of a type compatible with enumeration""", + 'defined-type': "ietf-te-topology:enumeration", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'inclusive': {}, 'exclusive': {}},), default=six.text_type("inclusive"), is_leaf=True, yang_name="restriction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='enumeration', is_config=True)""", + }) + + self.__restriction = t + if hasattr(self, '_set'): + self._set() + + def _unset_restriction(self): + self.__restriction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'inclusive': {}, 'exclusive': {}},), default=six.text_type("inclusive"), is_leaf=True, yang_name="restriction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='enumeration', is_config=True) + + + def _get_index(self): + """ + Getter method for index, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/label_restriction/index (uint32) + + YANG Description: The index of the label restriction list entry. + """ + return self.__index + + def _set_index(self, v, load=False): + """ + Setter method for index, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/label_restriction/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 label restriction list entry. + """ + 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=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', 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), is_leaf=True, yang_name="index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', 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), is_leaf=True, yang_name="index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + + + def _get_label_start(self): + """ + Getter method for label_start, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/label_restriction/label_start (container) + + YANG Description: This is the starting label if a label range is specified. +This is the label value if a single label is specified, +in which case the 'label-end' attribute is not set. + """ + return self.__label_start + + def _set_label_start(self, v, load=False): + """ + Setter method for label_start, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/label_restriction/label_start (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_label_start is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_label_start() directly. + + YANG Description: This is the starting label if a label range is specified. +This is the label value if a single label is specified, +in which case the 'label-end' attribute is not set. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=label_start.label_start, is_container='container', yang_name="label-start", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """label_start must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=label_start.label_start, is_container='container', yang_name="label-start", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__label_start = t + if hasattr(self, '_set'): + self._set() + + def _unset_label_start(self): + self.__label_start = YANGDynClass(base=label_start.label_start, is_container='container', yang_name="label-start", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_label_end(self): + """ + Getter method for label_end, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/label_restriction/label_end (container) + + YANG Description: This is the ending label if a label range is specified. +This attribute is not set if a single label is specified. + """ + return self.__label_end + + def _set_label_end(self, v, load=False): + """ + Setter method for label_end, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/label_restriction/label_end (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_label_end is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_label_end() directly. + + YANG Description: This is the ending label if a label range is specified. +This attribute is not set if a single label is specified. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=label_end.label_end, is_container='container', yang_name="label-end", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """label_end must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=label_end.label_end, is_container='container', yang_name="label-end", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__label_end = t + if hasattr(self, '_set'): + self._set() + + def _unset_label_end(self): + self.__label_end = YANGDynClass(base=label_end.label_end, is_container='container', yang_name="label-end", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_label_step(self): + """ + Getter method for label_step, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/label_restriction/label_step (container) + + YANG Description: The step increment between labels in the label range. +The label start/end values will have to be consistent +with the sign of label step. For example, +'label-start' < 'label-end' enforces 'label-step' > 0 +'label-start' > 'label-end' enforces 'label-step' < 0. + """ + return self.__label_step + + def _set_label_step(self, v, load=False): + """ + Setter method for label_step, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/label_restriction/label_step (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_label_step is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_label_step() directly. + + YANG Description: The step increment between labels in the label range. +The label start/end values will have to be consistent +with the sign of label step. For example, +'label-start' < 'label-end' enforces 'label-step' > 0 +'label-start' > 'label-end' enforces 'label-step' < 0. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=label_step.label_step, is_container='container', yang_name="label-step", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """label_step must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=label_step.label_step, is_container='container', yang_name="label-step", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__label_step = t + if hasattr(self, '_set'): + self._set() + + def _unset_label_step(self): + self.__label_step = YANGDynClass(base=label_step.label_step, is_container='container', yang_name="label-step", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_range_bitmap(self): + """ + Getter method for range_bitmap, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/label_restriction/range_bitmap (yang:hex-string) + + YANG Description: When there are gaps between 'label-start' and 'label-end', +this attribute is used to specify the positions +of the used labels. This is represented in big endian as +'hex-string'. +The most significant byte in the hex-string is the farthest +to the left in the byte sequence. Leading zero bytes in the +configured value may be omitted for brevity. +Each bit position in the 'range-bitmap' 'hex-string' maps +to a label in the range derived from 'label-start'. + +For example, assuming that 'label-start' = 16000 and +'range-bitmap' = 0x01000001, then: + +- bit position (0) is set, and the corresponding mapped + label from the range is 16000 + (0 * 'label-step') or + 16000 for default 'label-step' = 1. +- bit position (24) is set, and the corresponding mapped + label from the range is 16000 + (24 * 'label-step') or + 16024 for default 'label-step' = 1. + """ + return self.__range_bitmap + + def _set_range_bitmap(self, v, load=False): + """ + Setter method for range_bitmap, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/label_restriction/range_bitmap (yang:hex-string) + If this variable is read-only (config: false) in the + source YANG file, then _set_range_bitmap is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_range_bitmap() directly. + + YANG Description: When there are gaps between 'label-start' and 'label-end', +this attribute is used to specify the positions +of the used labels. This is represented in big endian as +'hex-string'. +The most significant byte in the hex-string is the farthest +to the left in the byte sequence. Leading zero bytes in the +configured value may be omitted for brevity. +Each bit position in the 'range-bitmap' 'hex-string' maps +to a label in the range derived from 'label-start'. + +For example, assuming that 'label-start' = 16000 and +'range-bitmap' = 0x01000001, then: + +- bit position (0) is set, and the corresponding mapped + label from the range is 16000 + (0 * 'label-step') or + 16000 for default 'label-step' = 1. +- bit position (24) is set, and the corresponding mapped + label from the range is 16000 + (24 * 'label-step') or + 16024 for default 'label-step' = 1. + """ + 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})*)?'}), is_leaf=True, yang_name="range-bitmap", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:hex-string', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """range_bitmap must be of a type compatible with yang:hex-string""", + 'defined-type': "yang:hex-string", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}), is_leaf=True, yang_name="range-bitmap", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:hex-string', is_config=True)""", + }) + + self.__range_bitmap = t + if hasattr(self, '_set'): + self._set() + + def _unset_range_bitmap(self): + self.__range_bitmap = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}), is_leaf=True, yang_name="range-bitmap", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:hex-string', is_config=True) + + + def _get_otn_label_range(self): + """ + Getter method for otn_label_range, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/label_restriction/otn_label_range (container) + + YANG Description: Label range information for OTN. + """ + return self.__otn_label_range + + def _set_otn_label_range(self, v, load=False): + """ + Setter method for otn_label_range, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/label_restriction/otn_label_range (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_otn_label_range is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_otn_label_range() directly. + + YANG Description: Label range information for OTN. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=otn_label_range.otn_label_range, is_container='container', yang_name="otn-label-range", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """otn_label_range must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=otn_label_range.otn_label_range, is_container='container', yang_name="otn-label-range", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True)""", + }) + + self.__otn_label_range = t + if hasattr(self, '_set'): + self._set() + + def _unset_otn_label_range(self): + self.__otn_label_range = YANGDynClass(base=otn_label_range.otn_label_range, is_container='container', yang_name="otn-label-range", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + + + def _get_ethernet_label_range(self): + """ + Getter method for ethernet_label_range, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/label_restriction/ethernet_label_range (container) + + YANG Description: Ethernet-specific label range related information. + """ + return self.__ethernet_label_range + + def _set_ethernet_label_range(self, v, load=False): + """ + Setter method for ethernet_label_range, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/label_restriction/ethernet_label_range (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_ethernet_label_range is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_ethernet_label_range() directly. + + YANG Description: Ethernet-specific label range related information. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=ethernet_label_range.ethernet_label_range, is_container='container', yang_name="ethernet-label-range", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """ethernet_label_range must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=ethernet_label_range.ethernet_label_range, is_container='container', yang_name="ethernet-label-range", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='container', is_config=True)""", + }) + + self.__ethernet_label_range = t + if hasattr(self, '_set'): + self._set() + + def _unset_ethernet_label_range(self): + self.__ethernet_label_range = YANGDynClass(base=ethernet_label_range.ethernet_label_range, is_container='container', yang_name="ethernet-label-range", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='container', is_config=True) + + restriction = __builtin__.property(_get_restriction, _set_restriction) + index = __builtin__.property(_get_index, _set_index) + label_start = __builtin__.property(_get_label_start, _set_label_start) + label_end = __builtin__.property(_get_label_end, _set_label_end) + label_step = __builtin__.property(_get_label_step, _set_label_step) + range_bitmap = __builtin__.property(_get_range_bitmap, _set_range_bitmap) + otn_label_range = __builtin__.property(_get_otn_label_range, _set_otn_label_range) + ethernet_label_range = __builtin__.property(_get_ethernet_label_range, _set_ethernet_label_range) + + + _pyangbind_elements = OrderedDict([('restriction', restriction), ('index', index), ('label_start', label_start), ('label_end', label_end), ('label_step', label_step), ('range_bitmap', range_bitmap), ('otn_label_range', otn_label_range), ('ethernet_label_range', ethernet_label_range), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/label_restriction/ethernet_label_range/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/label_restriction/ethernet_label_range/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..1204389480fd9b8ed0595d7613aa8b414dbcb477 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/label_restriction/ethernet_label_range/__init__.py @@ -0,0 +1,154 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 ethernet_label_range(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/label-restrictions/label-restriction/ethernet-label-range. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Ethernet-specific label range related information. + """ + __slots__ = ('_path_helper', '_extmethods', '__tag_type','__priority',) + + _yang_name = 'ethernet-label-range' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__tag_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 's-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:s-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:s-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}},), is_leaf=True, yang_name="tag-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:eth-tag-type', is_config=True) + self.__priority = YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), is_leaf=True, yang_name="priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', 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 ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'label-restrictions', 'label-restriction', 'ethernet-label-range'] + + def _get_tag_type(self): + """ + Getter method for tag_type, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/label_restriction/ethernet_label_range/tag_type (etht-types:eth-tag-type) + + YANG Description: VLAN tag type. + """ + return self.__tag_type + + def _set_tag_type(self, v, load=False): + """ + Setter method for tag_type, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/label_restriction/ethernet_label_range/tag_type (etht-types:eth-tag-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_tag_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tag_type() directly. + + YANG Description: VLAN tag type. + """ + 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={'c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 's-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:s-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:s-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}},), is_leaf=True, yang_name="tag-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:eth-tag-type', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tag_type must be of a type compatible with etht-types:eth-tag-type""", + 'defined-type': "etht-types:eth-tag-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 's-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:s-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:s-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}},), is_leaf=True, yang_name="tag-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:eth-tag-type', is_config=True)""", + }) + + self.__tag_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_tag_type(self): + self.__tag_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 's-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:s-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:s-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}},), is_leaf=True, yang_name="tag-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:eth-tag-type', is_config=True) + + + def _get_priority(self): + """ + Getter method for priority, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/label_restriction/ethernet_label_range/priority (uint8) + + YANG Description: priority. + """ + return self.__priority + + def _set_priority(self, v, load=False): + """ + Setter method for priority, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/label_restriction/ethernet_label_range/priority (uint8) + If this variable is read-only (config: false) in the + source YANG file, then _set_priority is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_priority() directly. + + YANG Description: priority. + """ + 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="priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint8', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """priority 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="priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint8', is_config=True)""", + }) + + self.__priority = t + if hasattr(self, '_set'): + self._set() + + def _unset_priority(self): + self.__priority = YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), is_leaf=True, yang_name="priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint8', is_config=True) + + tag_type = __builtin__.property(_get_tag_type, _set_tag_type) + priority = __builtin__.property(_get_priority, _set_priority) + + + _pyangbind_elements = OrderedDict([('tag_type', tag_type), ('priority', priority), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/label_restriction/label_end/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/label_restriction/label_end/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..9986d6a93f699df312ed09304fe1339944875650 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/label_restriction/label_end/__init__.py @@ -0,0 +1,119 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 te_label +class label_end(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/label-restrictions/label-restriction/label-end. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: This is the ending label if a label range is specified. +This attribute is not set if a single label is specified. + """ + __slots__ = ('_path_helper', '_extmethods', '__te_label',) + + _yang_name = 'label-end' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__te_label = YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-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 ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'label-restrictions', 'label-restriction', 'label-end'] + + def _get_te_label(self): + """ + Getter method for te_label, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/label_restriction/label_end/te_label (container) + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + return self.__te_label + + def _set_te_label(self, v, load=False): + """ + Setter method for te_label, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/label_restriction/label_end/te_label (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_te_label is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_te_label() directly. + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """te_label must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__te_label = t + if hasattr(self, '_set'): + self._set() + + def _unset_te_label(self): + self.__te_label = YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + te_label = __builtin__.property(_get_te_label, _set_te_label) + + + _pyangbind_elements = OrderedDict([('te_label', te_label), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/label_restriction/label_end/te_label/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/label_restriction/label_end/te_label/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..29e0c9a994b38322298dd936fd94a24595fdf972 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/label_restriction/label_end/te_label/__init__.py @@ -0,0 +1,234 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 otn +class te_label(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/label-restrictions/label-restriction/label-end/te-label. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + __slots__ = ('_path_helper', '_extmethods', '__generic','__otn','__vlanid','__direction',) + + _yang_name = 'te-label' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__generic = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True) + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + self.__vlanid = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True) + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', 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 ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'label-restrictions', 'label-restriction', 'label-end', 'te-label'] + + def _get_generic(self): + """ + Getter method for generic, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/label_restriction/label_end/te_label/generic (rt-types:generalized-label) + + YANG Description: TE label specified in a generic format. + """ + return self.__generic + + def _set_generic(self, v, load=False): + """ + Setter method for generic, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/label_restriction/label_end/te_label/generic (rt-types:generalized-label) + If this variable is read-only (config: false) in the + source YANG file, then _set_generic is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_generic() directly. + + YANG Description: TE label specified in a generic format. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """generic must be of a type compatible with rt-types:generalized-label""", + 'defined-type': "rt-types:generalized-label", + 'generated-type': """YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True)""", + }) + + self.__generic = t + if hasattr(self, '_set'): + self._set() + + def _unset_generic(self): + self.__generic = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True) + + + def _get_otn(self): + """ + Getter method for otn, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/label_restriction/label_end/te_label/otn (container) + + YANG Description: Label start or label end for OTN. + """ + return self.__otn + + def _set_otn(self, v, load=False): + """ + Setter method for otn, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/label_restriction/label_end/te_label/otn (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_otn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_otn() directly. + + YANG Description: Label start or label end for OTN. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """otn must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True)""", + }) + + self.__otn = t + if hasattr(self, '_set'): + self._set() + + def _unset_otn(self): + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + + + def _get_vlanid(self): + """ + Getter method for vlanid, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/label_restriction/label_end/te_label/vlanid (etht-types:vlanid) + + YANG Description: VLAN tag id. + """ + return self.__vlanid + + def _set_vlanid(self, v, load=False): + """ + Setter method for vlanid, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/label_restriction/label_end/te_label/vlanid (etht-types:vlanid) + If this variable is read-only (config: false) in the + source YANG file, then _set_vlanid is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_vlanid() directly. + + YANG Description: VLAN tag id. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """vlanid must be of a type compatible with etht-types:vlanid""", + 'defined-type': "etht-types:vlanid", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True)""", + }) + + self.__vlanid = t + if hasattr(self, '_set'): + self._set() + + def _unset_vlanid(self): + self.__vlanid = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True) + + + def _get_direction(self): + """ + Getter method for direction, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/label_restriction/label_end/te_label/direction (te-label-direction) + + YANG Description: Label direction. + """ + return self.__direction + + def _set_direction(self, v, load=False): + """ + Setter method for direction, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/label_restriction/label_end/te_label/direction (te-label-direction) + If this variable is read-only (config: false) in the + source YANG file, then _set_direction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_direction() directly. + + YANG Description: Label direction. + """ + 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={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """direction must be of a type compatible with te-label-direction""", + 'defined-type': "ietf-te-topology:te-label-direction", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=True)""", + }) + + self.__direction = t + if hasattr(self, '_set'): + self._set() + + def _unset_direction(self): + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=True) + + generic = __builtin__.property(_get_generic, _set_generic) + otn = __builtin__.property(_get_otn, _set_otn) + vlanid = __builtin__.property(_get_vlanid, _set_vlanid) + direction = __builtin__.property(_get_direction, _set_direction) + + __choices__ = {'technology': {'generic': ['generic'], 'otn': ['otn'], 'eth': ['vlanid']}} + _pyangbind_elements = OrderedDict([('generic', generic), ('otn', otn), ('vlanid', vlanid), ('direction', direction), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/label_restriction/label_end/te_label/otn/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/label_restriction/label_end/te_label/otn/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..1970e3999e8b9955bd6cf74faa612d1173617289 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/label_restriction/label_end/te_label/otn/__init__.py @@ -0,0 +1,154 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 otn(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/label-restrictions/label-restriction/label-end/te-label/otn. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Label start or label end for OTN. + """ + __slots__ = ('_path_helper', '_extmethods', '__tpn','__ts',) + + _yang_name = 'otn' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__tpn = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('range-type', 'trib-port'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True) + self.__ts = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts", parent=self, choice=('range-type', 'trib-slot'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-ts', 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 ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'label-restrictions', 'label-restriction', 'label-end', 'te-label', 'otn'] + + def _get_tpn(self): + """ + Getter method for tpn, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/label_restriction/label_end/te_label/otn/tpn (otn-tpn) + + YANG Description: Tributary Port Number (TPN). + """ + return self.__tpn + + def _set_tpn(self, v, load=False): + """ + Setter method for tpn, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/label_restriction/label_end/te_label/otn/tpn (otn-tpn) + If this variable is read-only (config: false) in the + source YANG file, then _set_tpn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tpn() directly. + + YANG Description: Tributary Port Number (TPN). + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('range-type', 'trib-port'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tpn must be of a type compatible with otn-tpn""", + 'defined-type': "ietf-otn-topology:otn-tpn", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('range-type', 'trib-port'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True)""", + }) + + self.__tpn = t + if hasattr(self, '_set'): + self._set() + + def _unset_tpn(self): + self.__tpn = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('range-type', 'trib-port'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True) + + + def _get_ts(self): + """ + Getter method for ts, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/label_restriction/label_end/te_label/otn/ts (otn-ts) + + YANG Description: Tributary Slot (TS) number. + """ + return self.__ts + + def _set_ts(self, v, load=False): + """ + Setter method for ts, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/label_restriction/label_end/te_label/otn/ts (otn-ts) + If this variable is read-only (config: false) in the + source YANG file, then _set_ts is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_ts() directly. + + YANG Description: Tributary Slot (TS) number. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts", parent=self, choice=('range-type', 'trib-slot'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-ts', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """ts must be of a type compatible with otn-ts""", + 'defined-type': "ietf-otn-topology:otn-ts", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts", parent=self, choice=('range-type', 'trib-slot'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-ts', is_config=True)""", + }) + + self.__ts = t + if hasattr(self, '_set'): + self._set() + + def _unset_ts(self): + self.__ts = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts", parent=self, choice=('range-type', 'trib-slot'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-ts', is_config=True) + + tpn = __builtin__.property(_get_tpn, _set_tpn) + ts = __builtin__.property(_get_ts, _set_ts) + + __choices__ = {'range-type': {'trib-port': ['tpn'], 'trib-slot': ['ts']}} + _pyangbind_elements = OrderedDict([('tpn', tpn), ('ts', ts), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/label_restriction/label_start/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/label_restriction/label_start/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..5d88a176314ea898840f78842a2a4b508c80c989 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/label_restriction/label_start/__init__.py @@ -0,0 +1,120 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 te_label +class label_start(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/label-restrictions/label-restriction/label-start. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: This is the starting label if a label range is specified. +This is the label value if a single label is specified, +in which case the 'label-end' attribute is not set. + """ + __slots__ = ('_path_helper', '_extmethods', '__te_label',) + + _yang_name = 'label-start' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__te_label = YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-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 ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'label-restrictions', 'label-restriction', 'label-start'] + + def _get_te_label(self): + """ + Getter method for te_label, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/label_restriction/label_start/te_label (container) + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + return self.__te_label + + def _set_te_label(self, v, load=False): + """ + Setter method for te_label, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/label_restriction/label_start/te_label (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_te_label is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_te_label() directly. + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """te_label must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__te_label = t + if hasattr(self, '_set'): + self._set() + + def _unset_te_label(self): + self.__te_label = YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + te_label = __builtin__.property(_get_te_label, _set_te_label) + + + _pyangbind_elements = OrderedDict([('te_label', te_label), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/label_restriction/label_start/te_label/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/label_restriction/label_start/te_label/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..3a96742a0b76dff915d9b25a307f30e2893a0756 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/label_restriction/label_start/te_label/__init__.py @@ -0,0 +1,234 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 otn +class te_label(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/label-restrictions/label-restriction/label-start/te-label. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + __slots__ = ('_path_helper', '_extmethods', '__generic','__otn','__vlanid','__direction',) + + _yang_name = 'te-label' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__generic = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True) + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + self.__vlanid = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True) + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', 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 ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'label-restrictions', 'label-restriction', 'label-start', 'te-label'] + + def _get_generic(self): + """ + Getter method for generic, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/label_restriction/label_start/te_label/generic (rt-types:generalized-label) + + YANG Description: TE label specified in a generic format. + """ + return self.__generic + + def _set_generic(self, v, load=False): + """ + Setter method for generic, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/label_restriction/label_start/te_label/generic (rt-types:generalized-label) + If this variable is read-only (config: false) in the + source YANG file, then _set_generic is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_generic() directly. + + YANG Description: TE label specified in a generic format. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """generic must be of a type compatible with rt-types:generalized-label""", + 'defined-type': "rt-types:generalized-label", + 'generated-type': """YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True)""", + }) + + self.__generic = t + if hasattr(self, '_set'): + self._set() + + def _unset_generic(self): + self.__generic = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True) + + + def _get_otn(self): + """ + Getter method for otn, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/label_restriction/label_start/te_label/otn (container) + + YANG Description: Label start or label end for OTN. + """ + return self.__otn + + def _set_otn(self, v, load=False): + """ + Setter method for otn, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/label_restriction/label_start/te_label/otn (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_otn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_otn() directly. + + YANG Description: Label start or label end for OTN. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """otn must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True)""", + }) + + self.__otn = t + if hasattr(self, '_set'): + self._set() + + def _unset_otn(self): + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + + + def _get_vlanid(self): + """ + Getter method for vlanid, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/label_restriction/label_start/te_label/vlanid (etht-types:vlanid) + + YANG Description: VLAN tag id. + """ + return self.__vlanid + + def _set_vlanid(self, v, load=False): + """ + Setter method for vlanid, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/label_restriction/label_start/te_label/vlanid (etht-types:vlanid) + If this variable is read-only (config: false) in the + source YANG file, then _set_vlanid is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_vlanid() directly. + + YANG Description: VLAN tag id. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """vlanid must be of a type compatible with etht-types:vlanid""", + 'defined-type': "etht-types:vlanid", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True)""", + }) + + self.__vlanid = t + if hasattr(self, '_set'): + self._set() + + def _unset_vlanid(self): + self.__vlanid = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True) + + + def _get_direction(self): + """ + Getter method for direction, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/label_restriction/label_start/te_label/direction (te-label-direction) + + YANG Description: Label direction. + """ + return self.__direction + + def _set_direction(self, v, load=False): + """ + Setter method for direction, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/label_restriction/label_start/te_label/direction (te-label-direction) + If this variable is read-only (config: false) in the + source YANG file, then _set_direction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_direction() directly. + + YANG Description: Label direction. + """ + 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={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """direction must be of a type compatible with te-label-direction""", + 'defined-type': "ietf-te-topology:te-label-direction", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=True)""", + }) + + self.__direction = t + if hasattr(self, '_set'): + self._set() + + def _unset_direction(self): + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=True) + + generic = __builtin__.property(_get_generic, _set_generic) + otn = __builtin__.property(_get_otn, _set_otn) + vlanid = __builtin__.property(_get_vlanid, _set_vlanid) + direction = __builtin__.property(_get_direction, _set_direction) + + __choices__ = {'technology': {'generic': ['generic'], 'otn': ['otn'], 'eth': ['vlanid']}} + _pyangbind_elements = OrderedDict([('generic', generic), ('otn', otn), ('vlanid', vlanid), ('direction', direction), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/label_restriction/label_start/te_label/otn/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/label_restriction/label_start/te_label/otn/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..8dede38f39d25e5d7fb826718555365c2d8dc1ed --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/label_restriction/label_start/te_label/otn/__init__.py @@ -0,0 +1,154 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 otn(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/label-restrictions/label-restriction/label-start/te-label/otn. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Label start or label end for OTN. + """ + __slots__ = ('_path_helper', '_extmethods', '__tpn','__ts',) + + _yang_name = 'otn' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__tpn = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('range-type', 'trib-port'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True) + self.__ts = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts", parent=self, choice=('range-type', 'trib-slot'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-ts', 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 ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'label-restrictions', 'label-restriction', 'label-start', 'te-label', 'otn'] + + def _get_tpn(self): + """ + Getter method for tpn, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/label_restriction/label_start/te_label/otn/tpn (otn-tpn) + + YANG Description: Tributary Port Number (TPN). + """ + return self.__tpn + + def _set_tpn(self, v, load=False): + """ + Setter method for tpn, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/label_restriction/label_start/te_label/otn/tpn (otn-tpn) + If this variable is read-only (config: false) in the + source YANG file, then _set_tpn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tpn() directly. + + YANG Description: Tributary Port Number (TPN). + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('range-type', 'trib-port'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tpn must be of a type compatible with otn-tpn""", + 'defined-type': "ietf-otn-topology:otn-tpn", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('range-type', 'trib-port'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True)""", + }) + + self.__tpn = t + if hasattr(self, '_set'): + self._set() + + def _unset_tpn(self): + self.__tpn = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('range-type', 'trib-port'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True) + + + def _get_ts(self): + """ + Getter method for ts, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/label_restriction/label_start/te_label/otn/ts (otn-ts) + + YANG Description: Tributary Slot (TS) number. + """ + return self.__ts + + def _set_ts(self, v, load=False): + """ + Setter method for ts, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/label_restriction/label_start/te_label/otn/ts (otn-ts) + If this variable is read-only (config: false) in the + source YANG file, then _set_ts is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_ts() directly. + + YANG Description: Tributary Slot (TS) number. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts", parent=self, choice=('range-type', 'trib-slot'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-ts', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """ts must be of a type compatible with otn-ts""", + 'defined-type': "ietf-otn-topology:otn-ts", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts", parent=self, choice=('range-type', 'trib-slot'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-ts', is_config=True)""", + }) + + self.__ts = t + if hasattr(self, '_set'): + self._set() + + def _unset_ts(self): + self.__ts = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts", parent=self, choice=('range-type', 'trib-slot'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-ts', is_config=True) + + tpn = __builtin__.property(_get_tpn, _set_tpn) + ts = __builtin__.property(_get_ts, _set_ts) + + __choices__ = {'range-type': {'trib-port': ['tpn'], 'trib-slot': ['ts']}} + _pyangbind_elements = OrderedDict([('tpn', tpn), ('ts', ts), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/label_restriction/label_step/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/label_restriction/label_step/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..6fefc31471c8537d744756122a1b6b4a58a58f7a --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/label_restriction/label_step/__init__.py @@ -0,0 +1,200 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 otn +class label_step(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/label-restrictions/label-restriction/label-step. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: The step increment between labels in the label range. +The label start/end values will have to be consistent +with the sign of label step. For example, +'label-start' < 'label-end' enforces 'label-step' > 0 +'label-start' > 'label-end' enforces 'label-step' < 0. + """ + __slots__ = ('_path_helper', '_extmethods', '__generic','__otn','__eth_step',) + + _yang_name = 'label-step' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__generic = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['-2147483648..2147483647']}, int_size=32), default=RestrictedClassType(base_type=long, restriction_dict={'range': ['-2147483648..2147483647']}, int_size=32)(1), is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='int32', is_config=True) + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + self.__eth_step = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), default=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16)(1), is_leaf=True, yang_name="eth-step", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint16', 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 ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'label-restrictions', 'label-restriction', 'label-step'] + + def _get_generic(self): + """ + Getter method for generic, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/label_restriction/label_step/generic (int32) + + YANG Description: Label range step. + """ + return self.__generic + + def _set_generic(self, v, load=False): + """ + Setter method for generic, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/label_restriction/label_step/generic (int32) + If this variable is read-only (config: false) in the + source YANG file, then _set_generic is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_generic() directly. + + YANG Description: Label range step. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['-2147483648..2147483647']}, int_size=32), default=RestrictedClassType(base_type=long, restriction_dict={'range': ['-2147483648..2147483647']}, int_size=32)(1), is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='int32', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """generic must be of a type compatible with int32""", + 'defined-type': "int32", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['-2147483648..2147483647']}, int_size=32), default=RestrictedClassType(base_type=long, restriction_dict={'range': ['-2147483648..2147483647']}, int_size=32)(1), is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='int32', is_config=True)""", + }) + + self.__generic = t + if hasattr(self, '_set'): + self._set() + + def _unset_generic(self): + self.__generic = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['-2147483648..2147483647']}, int_size=32), default=RestrictedClassType(base_type=long, restriction_dict={'range': ['-2147483648..2147483647']}, int_size=32)(1), is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='int32', is_config=True) + + + def _get_otn(self): + """ + Getter method for otn, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/label_restriction/label_step/otn (container) + + YANG Description: Label step for OTN + """ + return self.__otn + + def _set_otn(self, v, load=False): + """ + Setter method for otn, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/label_restriction/label_step/otn (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_otn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_otn() directly. + + YANG Description: Label step for OTN + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """otn must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True)""", + }) + + self.__otn = t + if hasattr(self, '_set'): + self._set() + + def _unset_otn(self): + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + + + def _get_eth_step(self): + """ + Getter method for eth_step, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/label_restriction/label_step/eth_step (uint16) + + YANG Description: Label step which represent possible increments for +an Ethernet VLAN tag. + """ + return self.__eth_step + + def _set_eth_step(self, v, load=False): + """ + Setter method for eth_step, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/label_restriction/label_step/eth_step (uint16) + If this variable is read-only (config: false) in the + source YANG file, then _set_eth_step is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_eth_step() directly. + + YANG Description: Label step which represent possible increments for +an Ethernet VLAN tag. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), default=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16)(1), is_leaf=True, yang_name="eth-step", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint16', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """eth_step must be of a type compatible with uint16""", + 'defined-type': "uint16", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), default=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16)(1), is_leaf=True, yang_name="eth-step", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint16', is_config=True)""", + }) + + self.__eth_step = t + if hasattr(self, '_set'): + self._set() + + def _unset_eth_step(self): + self.__eth_step = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), default=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16)(1), is_leaf=True, yang_name="eth-step", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint16', is_config=True) + + generic = __builtin__.property(_get_generic, _set_generic) + otn = __builtin__.property(_get_otn, _set_otn) + eth_step = __builtin__.property(_get_eth_step, _set_eth_step) + + __choices__ = {'technology': {'generic': ['generic'], 'otn': ['otn'], 'eth': ['eth_step']}} + _pyangbind_elements = OrderedDict([('generic', generic), ('otn', otn), ('eth_step', eth_step), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/label_restriction/label_step/otn/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/label_restriction/label_step/otn/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..a14b27f40324497c22ee722f9a4c17d2ecc72636 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/label_restriction/label_step/otn/__init__.py @@ -0,0 +1,158 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 otn(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/label-restrictions/label-restriction/label-step/otn. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Label step for OTN + """ + __slots__ = ('_path_helper', '_extmethods', '__tpn','__ts',) + + _yang_name = 'otn' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__tpn = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('range-type', 'trib-port'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True) + self.__ts = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts", parent=self, choice=('range-type', 'trib-slot'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-ts', 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 ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'label-restrictions', 'label-restriction', 'label-step', 'otn'] + + def _get_tpn(self): + """ + Getter method for tpn, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/label_restriction/label_step/otn/tpn (otn-tpn) + + YANG Description: Label step which represents possible increments for +Tributary Port Number (TPN). + """ + return self.__tpn + + def _set_tpn(self, v, load=False): + """ + Setter method for tpn, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/label_restriction/label_step/otn/tpn (otn-tpn) + If this variable is read-only (config: false) in the + source YANG file, then _set_tpn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tpn() directly. + + YANG Description: Label step which represents possible increments for +Tributary Port Number (TPN). + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('range-type', 'trib-port'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tpn must be of a type compatible with otn-tpn""", + 'defined-type': "ietf-otn-topology:otn-tpn", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('range-type', 'trib-port'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True)""", + }) + + self.__tpn = t + if hasattr(self, '_set'): + self._set() + + def _unset_tpn(self): + self.__tpn = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('range-type', 'trib-port'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True) + + + def _get_ts(self): + """ + Getter method for ts, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/label_restriction/label_step/otn/ts (otn-ts) + + YANG Description: Label step which represents possible increments for +Tributary Slot (TS) number. + """ + return self.__ts + + def _set_ts(self, v, load=False): + """ + Setter method for ts, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/label_restriction/label_step/otn/ts (otn-ts) + If this variable is read-only (config: false) in the + source YANG file, then _set_ts is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_ts() directly. + + YANG Description: Label step which represents possible increments for +Tributary Slot (TS) number. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts", parent=self, choice=('range-type', 'trib-slot'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-ts', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """ts must be of a type compatible with otn-ts""", + 'defined-type': "ietf-otn-topology:otn-ts", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts", parent=self, choice=('range-type', 'trib-slot'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-ts', is_config=True)""", + }) + + self.__ts = t + if hasattr(self, '_set'): + self._set() + + def _unset_ts(self): + self.__ts = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts", parent=self, choice=('range-type', 'trib-slot'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-ts', is_config=True) + + tpn = __builtin__.property(_get_tpn, _set_tpn) + ts = __builtin__.property(_get_ts, _set_ts) + + __choices__ = {'range-type': {'trib-port': ['tpn'], 'trib-slot': ['ts']}} + _pyangbind_elements = OrderedDict([('tpn', tpn), ('ts', ts), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/label_restriction/otn_label_range/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/label_restriction/otn_label_range/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..734a4997ea378db0299b1a752f0ae69a5a5b7629 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/label_restriction/otn_label_range/__init__.py @@ -0,0 +1,256 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 otn_label_range(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/label-restrictions/label-restriction/otn-label-range. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Label range information for OTN. + """ + __slots__ = ('_path_helper', '_extmethods', '__range_type','__tsg','__odu_type_list','__priority',) + + _yang_name = 'otn-label-range' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__range_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'trib-slot': {}, 'trib-port': {}},), is_leaf=True, yang_name="range-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-label-range-type', is_config=True) + self.__tsg = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + self.__odu_type_list = YANGDynClass(unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},)), is_leaf=False, yang_name="odu-type-list", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + self.__priority = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..7']}), is_leaf=True, yang_name="priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', 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 ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'label-restrictions', 'label-restriction', 'otn-label-range'] + + def _get_range_type(self): + """ + Getter method for range_type, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/label_restriction/otn_label_range/range_type (otn-label-range-type) + + YANG Description: The type of range (e.g., TPN or TS) +to which the label range applies + """ + return self.__range_type + + def _set_range_type(self, v, load=False): + """ + Setter method for range_type, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/label_restriction/otn_label_range/range_type (otn-label-range-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_range_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_range_type() directly. + + YANG Description: The type of range (e.g., TPN or TS) +to which the label range applies + """ + 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={'trib-slot': {}, 'trib-port': {}},), is_leaf=True, yang_name="range-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-label-range-type', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """range_type must be of a type compatible with otn-label-range-type""", + 'defined-type': "ietf-otn-topology:otn-label-range-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'trib-slot': {}, 'trib-port': {}},), is_leaf=True, yang_name="range-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-label-range-type', is_config=True)""", + }) + + self.__range_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_range_type(self): + self.__range_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'trib-slot': {}, 'trib-port': {}},), is_leaf=True, yang_name="range-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-label-range-type', is_config=True) + + + def _get_tsg(self): + """ + Getter method for tsg, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/label_restriction/otn_label_range/tsg (identityref) + + YANG Description: Tributary slot granularity (TSG) to which the label range +applies. + +This leaf MUST be present when the range-type is TS. + +This leaf MAY be omitted when mapping an ODUk over an OTUk +Link. In this case the range-type is tpn, with only one +entry (ODUk), and the tpn range has only one value (1). + """ + return self.__tsg + + def _set_tsg(self, v, load=False): + """ + Setter method for tsg, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/label_restriction/otn_label_range/tsg (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_tsg is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tsg() directly. + + YANG Description: Tributary slot granularity (TSG) to which the label range +applies. + +This leaf MUST be present when the range-type is TS. + +This leaf MAY be omitted when mapping an ODUk over an OTUk +Link. In this case the range-type is tpn, with only one +entry (ODUk), and the tpn range has only one value (1). + """ + 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={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tsg must be of a type compatible with identityref""", + 'defined-type': "ietf-otn-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True)""", + }) + + self.__tsg = t + if hasattr(self, '_set'): + self._set() + + def _unset_tsg(self): + self.__tsg = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + + + def _get_odu_type_list(self): + """ + Getter method for odu_type_list, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/label_restriction/otn_label_range/odu_type_list (identityref) + + YANG Description: List of ODU types to which the label range applies. + +An Empty odu-type-list means that the label range +applies to all the supported ODU types. + """ + return self.__odu_type_list + + def _set_odu_type_list(self, v, load=False): + """ + Setter method for odu_type_list, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/label_restriction/otn_label_range/odu_type_list (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_odu_type_list is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_odu_type_list() directly. + + YANG Description: List of ODU types to which the label range applies. + +An Empty odu-type-list means that the label range +applies to all the supported ODU types. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},)), is_leaf=False, yang_name="odu-type-list", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """odu_type_list must be of a type compatible with identityref""", + 'defined-type': "ietf-otn-topology:identityref", + 'generated-type': """YANGDynClass(unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},)), is_leaf=False, yang_name="odu-type-list", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True)""", + }) + + self.__odu_type_list = t + if hasattr(self, '_set'): + self._set() + + def _unset_odu_type_list(self): + self.__odu_type_list = YANGDynClass(unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},)), is_leaf=False, yang_name="odu-type-list", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + + + def _get_priority(self): + """ + Getter method for priority, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/label_restriction/otn_label_range/priority (uint8) + + YANG Description: Priority in Interface Switching Capability +Descriptor (ISCD). + """ + return self.__priority + + def _set_priority(self, v, load=False): + """ + Setter method for priority, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/label_restriction/otn_label_range/priority (uint8) + If this variable is read-only (config: false) in the + source YANG file, then _set_priority is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_priority() directly. + + YANG Description: Priority in Interface Switching Capability +Descriptor (ISCD). + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..7']}), is_leaf=True, yang_name="priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint8', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """priority must be of a type compatible with uint8""", + 'defined-type': "uint8", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..7']}), is_leaf=True, yang_name="priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint8', is_config=True)""", + }) + + self.__priority = t + if hasattr(self, '_set'): + self._set() + + def _unset_priority(self): + self.__priority = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..7']}), is_leaf=True, yang_name="priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint8', is_config=True) + + range_type = __builtin__.property(_get_range_type, _set_range_type) + tsg = __builtin__.property(_get_tsg, _set_tsg) + odu_type_list = __builtin__.property(_get_odu_type_list, _set_odu_type_list) + priority = __builtin__.property(_get_priority, _set_priority) + + + _pyangbind_elements = OrderedDict([('range_type', range_type), ('tsg', tsg), ('odu_type_list', odu_type_list), ('priority', priority), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..a38eef90a72f1cdd092ccb8fe5901fee29defdbb --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/__init__.py @@ -0,0 +1,199 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 optimization_metric +from . import tiebreakers +from . import objective_function +class optimizations(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/optimizations. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: The objective function container that includes +attributes to impose when computing a TE path. + """ + __slots__ = ('_path_helper', '_extmethods', '__optimization_metric','__tiebreakers','__objective_function',) + + _yang_name = 'optimizations' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__optimization_metric = YANGDynClass(base=YANGListType("metric_type",optimization_metric.optimization_metric, yang_name="optimization-metric", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='metric-type', extensions=None, choice=False), is_container='list', yang_name="optimization-metric", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + self.__tiebreakers = YANGDynClass(base=tiebreakers.tiebreakers, is_container='container', yang_name="tiebreakers", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__objective_function = YANGDynClass(base=objective_function.objective_function, is_container='container', yang_name="objective-function", parent=self, choice=('algorithm', 'objective-function'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-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 ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'optimizations'] + + def _get_optimization_metric(self): + """ + Getter method for optimization_metric, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric (list) + + YANG Description: TE path metric type. + """ + return self.__optimization_metric + + def _set_optimization_metric(self, v, load=False): + """ + Setter method for optimization_metric, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_optimization_metric is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_optimization_metric() directly. + + YANG Description: TE path metric type. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("metric_type",optimization_metric.optimization_metric, yang_name="optimization-metric", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='metric-type', extensions=None, choice=False), is_container='list', yang_name="optimization-metric", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """optimization_metric must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("metric_type",optimization_metric.optimization_metric, yang_name="optimization-metric", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='metric-type', extensions=None, choice=False), is_container='list', yang_name="optimization-metric", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True)""", + }) + + self.__optimization_metric = t + if hasattr(self, '_set'): + self._set() + + def _unset_optimization_metric(self): + self.__optimization_metric = YANGDynClass(base=YANGListType("metric_type",optimization_metric.optimization_metric, yang_name="optimization-metric", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='metric-type', extensions=None, choice=False), is_container='list', yang_name="optimization-metric", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + + + def _get_tiebreakers(self): + """ + Getter method for tiebreakers, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/tiebreakers (container) + + YANG Description: Container for the list of tiebreakers. + """ + return self.__tiebreakers + + def _set_tiebreakers(self, v, load=False): + """ + Setter method for tiebreakers, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/tiebreakers (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_tiebreakers is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tiebreakers() directly. + + YANG Description: Container for the list of tiebreakers. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=tiebreakers.tiebreakers, is_container='container', yang_name="tiebreakers", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tiebreakers must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=tiebreakers.tiebreakers, is_container='container', yang_name="tiebreakers", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__tiebreakers = t + if hasattr(self, '_set'): + self._set() + + def _unset_tiebreakers(self): + self.__tiebreakers = YANGDynClass(base=tiebreakers.tiebreakers, is_container='container', yang_name="tiebreakers", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_objective_function(self): + """ + Getter method for objective_function, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/objective_function (container) + + YANG Description: The objective function container that includes +attributes to impose when computing a TE path. + """ + return self.__objective_function + + def _set_objective_function(self, v, load=False): + """ + Setter method for objective_function, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/objective_function (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_objective_function is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_objective_function() directly. + + YANG Description: The objective function container that includes +attributes to impose when computing a TE path. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=objective_function.objective_function, is_container='container', yang_name="objective-function", parent=self, choice=('algorithm', 'objective-function'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """objective_function must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=objective_function.objective_function, is_container='container', yang_name="objective-function", parent=self, choice=('algorithm', 'objective-function'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__objective_function = t + if hasattr(self, '_set'): + self._set() + + def _unset_objective_function(self): + self.__objective_function = YANGDynClass(base=objective_function.objective_function, is_container='container', yang_name="objective-function", parent=self, choice=('algorithm', 'objective-function'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + optimization_metric = __builtin__.property(_get_optimization_metric, _set_optimization_metric) + tiebreakers = __builtin__.property(_get_tiebreakers, _set_tiebreakers) + objective_function = __builtin__.property(_get_objective_function, _set_objective_function) + + __choices__ = {'algorithm': {'metric': ['optimization_metric', 'tiebreakers'], 'objective-function': ['objective_function']}} + _pyangbind_elements = OrderedDict([('optimization_metric', optimization_metric), ('tiebreakers', tiebreakers), ('objective_function', objective_function), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/objective_function/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/objective_function/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..3938cadf90bfcb85ebc6fd1c1651aed0364cd241 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/objective_function/__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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 objective_function(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/optimizations/objective-function. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: The objective function container that includes +attributes to impose when computing a TE path. + """ + __slots__ = ('_path_helper', '_extmethods', '__objective_function_type',) + + _yang_name = 'objective-function' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__objective_function_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'of-minimize-cost-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-cost-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-cost-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-minimize-load-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-load-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-load-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-maximize-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-maximize-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-maximize-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-minimize-agg-bandwidth-consumption': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-agg-bandwidth-consumption': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-agg-bandwidth-consumption': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-minimize-load-most-loaded-link': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-load-most-loaded-link': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-load-most-loaded-link': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-minimize-cost-path-set': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-cost-path-set': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-cost-path-set': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), default=six.text_type("te-types:of-minimize-cost-path"), is_leaf=True, yang_name="objective-function-type", parent=self, choice=('algorithm', 'objective-function'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', 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 ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'optimizations', 'objective-function'] + + def _get_objective_function_type(self): + """ + Getter method for objective_function_type, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/objective_function/objective_function_type (identityref) + + YANG Description: Objective function entry. + """ + return self.__objective_function_type + + def _set_objective_function_type(self, v, load=False): + """ + Setter method for objective_function_type, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/objective_function/objective_function_type (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_objective_function_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_objective_function_type() directly. + + YANG Description: Objective function entry. + """ + 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={'of-minimize-cost-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-cost-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-cost-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-minimize-load-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-load-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-load-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-maximize-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-maximize-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-maximize-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-minimize-agg-bandwidth-consumption': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-agg-bandwidth-consumption': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-agg-bandwidth-consumption': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-minimize-load-most-loaded-link': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-load-most-loaded-link': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-load-most-loaded-link': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-minimize-cost-path-set': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-cost-path-set': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-cost-path-set': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), default=six.text_type("te-types:of-minimize-cost-path"), is_leaf=True, yang_name="objective-function-type", parent=self, choice=('algorithm', 'objective-function'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """objective_function_type must be of a type compatible with identityref""", + 'defined-type': "ietf-te-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'of-minimize-cost-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-cost-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-cost-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-minimize-load-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-load-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-load-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-maximize-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-maximize-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-maximize-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-minimize-agg-bandwidth-consumption': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-agg-bandwidth-consumption': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-agg-bandwidth-consumption': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-minimize-load-most-loaded-link': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-load-most-loaded-link': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-load-most-loaded-link': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-minimize-cost-path-set': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-cost-path-set': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-cost-path-set': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), default=six.text_type("te-types:of-minimize-cost-path"), is_leaf=True, yang_name="objective-function-type", parent=self, choice=('algorithm', 'objective-function'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True)""", + }) + + self.__objective_function_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_objective_function_type(self): + self.__objective_function_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'of-minimize-cost-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-cost-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-cost-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-minimize-load-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-load-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-load-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-maximize-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-maximize-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-maximize-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-minimize-agg-bandwidth-consumption': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-agg-bandwidth-consumption': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-agg-bandwidth-consumption': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-minimize-load-most-loaded-link': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-load-most-loaded-link': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-load-most-loaded-link': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-minimize-cost-path-set': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-cost-path-set': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-cost-path-set': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), default=six.text_type("te-types:of-minimize-cost-path"), is_leaf=True, yang_name="objective-function-type", parent=self, choice=('algorithm', 'objective-function'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + + objective_function_type = __builtin__.property(_get_objective_function_type, _set_objective_function_type) + + __choices__ = {'algorithm': {'objective-function': ['objective_function_type']}} + _pyangbind_elements = OrderedDict([('objective_function_type', objective_function_type), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..8594a8e95b12f520dd13bb4dfc882f89e926768e --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/__init__.py @@ -0,0 +1,241 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 explicit_route_exclude_objects +from . import explicit_route_include_objects +class optimization_metric(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/optimizations/optimization-metric. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: TE path metric type. + """ + __slots__ = ('_path_helper', '_extmethods', '__metric_type','__weight','__explicit_route_exclude_objects','__explicit_route_include_objects',) + + _yang_name = 'optimization-metric' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__metric_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="metric-type", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + self.__weight = YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), default=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8)(1), is_leaf=True, yang_name="weight", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint8', is_config=True) + self.__explicit_route_exclude_objects = YANGDynClass(base=explicit_route_exclude_objects.explicit_route_exclude_objects, is_container='container', yang_name="explicit-route-exclude-objects", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__explicit_route_include_objects = YANGDynClass(base=explicit_route_include_objects.explicit_route_include_objects, is_container='container', yang_name="explicit-route-include-objects", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-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 ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'optimizations', 'optimization-metric'] + + def _get_metric_type(self): + """ + Getter method for metric_type, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/metric_type (identityref) + + YANG Description: Identifies the 'metric-type' that the path computation +process uses for optimization. + """ + return self.__metric_type + + def _set_metric_type(self, v, load=False): + """ + Setter method for metric_type, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/metric_type (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_metric_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_metric_type() directly. + + YANG Description: Identifies the 'metric-type' that the path computation +process uses for optimization. + """ + 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=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="metric-type", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """metric_type must be of a type compatible with identityref""", + 'defined-type': "ietf-te-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="metric-type", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True)""", + }) + + self.__metric_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_metric_type(self): + self.__metric_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="metric-type", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + + + def _get_weight(self): + """ + Getter method for weight, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/weight (uint8) + + YANG Description: TE path metric normalization weight. + """ + return self.__weight + + def _set_weight(self, v, load=False): + """ + Setter method for weight, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/weight (uint8) + If this variable is read-only (config: false) in the + source YANG file, then _set_weight is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_weight() directly. + + YANG Description: TE path metric normalization weight. + """ + 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), default=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8)(1), is_leaf=True, yang_name="weight", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint8', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """weight 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), default=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8)(1), is_leaf=True, yang_name="weight", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint8', is_config=True)""", + }) + + self.__weight = t + if hasattr(self, '_set'): + self._set() + + def _unset_weight(self): + self.__weight = YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), default=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8)(1), is_leaf=True, yang_name="weight", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint8', is_config=True) + + + def _get_explicit_route_exclude_objects(self): + """ + Getter method for explicit_route_exclude_objects, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects (container) + + YANG Description: Container for the 'exclude route' object list. + """ + return self.__explicit_route_exclude_objects + + def _set_explicit_route_exclude_objects(self, v, load=False): + """ + Setter method for explicit_route_exclude_objects, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_explicit_route_exclude_objects is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_explicit_route_exclude_objects() directly. + + YANG Description: Container for the 'exclude route' object list. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=explicit_route_exclude_objects.explicit_route_exclude_objects, is_container='container', yang_name="explicit-route-exclude-objects", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """explicit_route_exclude_objects must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=explicit_route_exclude_objects.explicit_route_exclude_objects, is_container='container', yang_name="explicit-route-exclude-objects", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__explicit_route_exclude_objects = t + if hasattr(self, '_set'): + self._set() + + def _unset_explicit_route_exclude_objects(self): + self.__explicit_route_exclude_objects = YANGDynClass(base=explicit_route_exclude_objects.explicit_route_exclude_objects, is_container='container', yang_name="explicit-route-exclude-objects", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_explicit_route_include_objects(self): + """ + Getter method for explicit_route_include_objects, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects (container) + + YANG Description: Container for the 'include route' object list. + """ + return self.__explicit_route_include_objects + + def _set_explicit_route_include_objects(self, v, load=False): + """ + Setter method for explicit_route_include_objects, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_explicit_route_include_objects is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_explicit_route_include_objects() directly. + + YANG Description: Container for the 'include route' object list. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=explicit_route_include_objects.explicit_route_include_objects, is_container='container', yang_name="explicit-route-include-objects", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """explicit_route_include_objects must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=explicit_route_include_objects.explicit_route_include_objects, is_container='container', yang_name="explicit-route-include-objects", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__explicit_route_include_objects = t + if hasattr(self, '_set'): + self._set() + + def _unset_explicit_route_include_objects(self): + self.__explicit_route_include_objects = YANGDynClass(base=explicit_route_include_objects.explicit_route_include_objects, is_container='container', yang_name="explicit-route-include-objects", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + metric_type = __builtin__.property(_get_metric_type, _set_metric_type) + weight = __builtin__.property(_get_weight, _set_weight) + explicit_route_exclude_objects = __builtin__.property(_get_explicit_route_exclude_objects, _set_explicit_route_exclude_objects) + explicit_route_include_objects = __builtin__.property(_get_explicit_route_include_objects, _set_explicit_route_include_objects) + + __choices__ = {'algorithm': {'metric': ['metric_type', 'weight', 'explicit_route_exclude_objects', 'explicit_route_include_objects']}} + _pyangbind_elements = OrderedDict([('metric_type', metric_type), ('weight', weight), ('explicit_route_exclude_objects', explicit_route_exclude_objects), ('explicit_route_include_objects', explicit_route_include_objects), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..d96148db39dd2d186fd6dc788b34c110a4e4c524 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/__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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 route_object_exclude_object +class explicit_route_exclude_objects(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/optimizations/optimization-metric/explicit-route-exclude-objects. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Container for the 'exclude route' object list. + """ + __slots__ = ('_path_helper', '_extmethods', '__route_object_exclude_object',) + + _yang_name = 'explicit-route-exclude-objects' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__route_object_exclude_object = YANGDynClass(base=YANGListType("index",route_object_exclude_object.route_object_exclude_object, yang_name="route-object-exclude-object", parent=self, is_container='list', user_ordered=True, path_helper=self._path_helper, yang_keys='index', extensions=None, choice=('algorithm', 'metric')), is_container='list', yang_name="route-object-exclude-object", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-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 ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'optimizations', 'optimization-metric', 'explicit-route-exclude-objects'] + + def _get_route_object_exclude_object(self): + """ + Getter method for route_object_exclude_object, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object (list) + + YANG Description: List of Explicit Route Objects to be excluded in the +path computation. + """ + return self.__route_object_exclude_object + + def _set_route_object_exclude_object(self, v, load=False): + """ + Setter method for route_object_exclude_object, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_route_object_exclude_object is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_route_object_exclude_object() directly. + + YANG Description: List of Explicit Route Objects to be excluded in the +path computation. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("index",route_object_exclude_object.route_object_exclude_object, yang_name="route-object-exclude-object", parent=self, is_container='list', user_ordered=True, path_helper=self._path_helper, yang_keys='index', extensions=None, choice=('algorithm', 'metric')), is_container='list', yang_name="route-object-exclude-object", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """route_object_exclude_object must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("index",route_object_exclude_object.route_object_exclude_object, yang_name="route-object-exclude-object", parent=self, is_container='list', user_ordered=True, path_helper=self._path_helper, yang_keys='index', extensions=None, choice=('algorithm', 'metric')), is_container='list', yang_name="route-object-exclude-object", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True)""", + }) + + self.__route_object_exclude_object = t + if hasattr(self, '_set'): + self._set() + + def _unset_route_object_exclude_object(self): + self.__route_object_exclude_object = YANGDynClass(base=YANGListType("index",route_object_exclude_object.route_object_exclude_object, yang_name="route-object-exclude-object", parent=self, is_container='list', user_ordered=True, path_helper=self._path_helper, yang_keys='index', extensions=None, choice=('algorithm', 'metric')), is_container='list', yang_name="route-object-exclude-object", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + + route_object_exclude_object = __builtin__.property(_get_route_object_exclude_object, _set_route_object_exclude_object) + + __choices__ = {'algorithm': {'metric': ['route_object_exclude_object']}} + _pyangbind_elements = OrderedDict([('route_object_exclude_object', route_object_exclude_object), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..be837bdc1d2e747ad69d14824dfb5c1abf483f4e --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/__init__.py @@ -0,0 +1,365 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 numbered_node_hop +from . import numbered_link_hop +from . import unnumbered_link_hop +from . import as_number_hop +from . import label_hop +from . import srlg +class route_object_exclude_object(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/optimizations/optimization-metric/explicit-route-exclude-objects/route-object-exclude-object. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: List of Explicit Route Objects to be excluded in the +path computation. + """ + __slots__ = ('_path_helper', '_extmethods', '__index','__numbered_node_hop','__numbered_link_hop','__unnumbered_link_hop','__as_number_hop','__label_hop','__srlg',) + + _yang_name = 'route-object-exclude-object' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _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), is_leaf=True, yang_name="index", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + self.__numbered_node_hop = YANGDynClass(base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__numbered_link_hop = YANGDynClass(base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__unnumbered_link_hop = YANGDynClass(base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__as_number_hop = YANGDynClass(base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__label_hop = YANGDynClass(base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__srlg = YANGDynClass(base=srlg.srlg, is_container='container', yang_name="srlg", parent=self, choice=('type', 'srlg'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-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 ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'optimizations', 'optimization-metric', 'explicit-route-exclude-objects', 'route-object-exclude-object'] + + def _get_index(self): + """ + Getter method for index, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/index (uint32) + + YANG Description: Route object entry index. The index is used to +identify an entry in the list. The order of entries +is defined by the user without relying on key values. + """ + return self.__index + + def _set_index(self, v, load=False): + """ + Setter method for index, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/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: Route object entry index. The index is used to +identify an entry in the list. The order of entries +is defined by the user without relying on key values. + """ + 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=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="index", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', 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), is_leaf=True, yang_name="index", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', 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), is_leaf=True, yang_name="index", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + + + def _get_numbered_node_hop(self): + """ + Getter method for numbered_node_hop, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/numbered_node_hop (container) + + YANG Description: Numbered node route hop. + """ + return self.__numbered_node_hop + + def _set_numbered_node_hop(self, v, load=False): + """ + Setter method for numbered_node_hop, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/numbered_node_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_numbered_node_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_numbered_node_hop() directly. + + YANG Description: Numbered node route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """numbered_node_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__numbered_node_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_numbered_node_hop(self): + self.__numbered_node_hop = YANGDynClass(base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_numbered_link_hop(self): + """ + Getter method for numbered_link_hop, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/numbered_link_hop (container) + + YANG Description: Numbered link explicit route hop. + """ + return self.__numbered_link_hop + + def _set_numbered_link_hop(self, v, load=False): + """ + Setter method for numbered_link_hop, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/numbered_link_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_numbered_link_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_numbered_link_hop() directly. + + YANG Description: Numbered link explicit route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """numbered_link_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__numbered_link_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_numbered_link_hop(self): + self.__numbered_link_hop = YANGDynClass(base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_unnumbered_link_hop(self): + """ + Getter method for unnumbered_link_hop, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/unnumbered_link_hop (container) + + YANG Description: Unnumbered link explicit route hop. + """ + return self.__unnumbered_link_hop + + def _set_unnumbered_link_hop(self, v, load=False): + """ + Setter method for unnumbered_link_hop, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/unnumbered_link_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_unnumbered_link_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_unnumbered_link_hop() directly. + + YANG Description: Unnumbered link explicit route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """unnumbered_link_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__unnumbered_link_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_unnumbered_link_hop(self): + self.__unnumbered_link_hop = YANGDynClass(base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_as_number_hop(self): + """ + Getter method for as_number_hop, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/as_number_hop (container) + + YANG Description: AS explicit route hop. + """ + return self.__as_number_hop + + def _set_as_number_hop(self, v, load=False): + """ + Setter method for as_number_hop, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/as_number_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_as_number_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_as_number_hop() directly. + + YANG Description: AS explicit route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """as_number_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__as_number_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_as_number_hop(self): + self.__as_number_hop = YANGDynClass(base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_label_hop(self): + """ + Getter method for label_hop, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop (container) + + YANG Description: Label hop type. + """ + return self.__label_hop + + def _set_label_hop(self, v, load=False): + """ + Setter method for label_hop, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_label_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_label_hop() directly. + + YANG Description: Label hop type. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """label_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__label_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_label_hop(self): + self.__label_hop = YANGDynClass(base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_srlg(self): + """ + Getter method for srlg, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/srlg (container) + + YANG Description: SRLG container. + """ + return self.__srlg + + def _set_srlg(self, v, load=False): + """ + Setter method for srlg, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/srlg (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_srlg is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_srlg() directly. + + YANG Description: SRLG container. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=srlg.srlg, is_container='container', yang_name="srlg", parent=self, choice=('type', 'srlg'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """srlg must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=srlg.srlg, is_container='container', yang_name="srlg", parent=self, choice=('type', 'srlg'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__srlg = t + if hasattr(self, '_set'): + self._set() + + def _unset_srlg(self): + self.__srlg = YANGDynClass(base=srlg.srlg, is_container='container', yang_name="srlg", parent=self, choice=('type', 'srlg'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + index = __builtin__.property(_get_index, _set_index) + numbered_node_hop = __builtin__.property(_get_numbered_node_hop, _set_numbered_node_hop) + numbered_link_hop = __builtin__.property(_get_numbered_link_hop, _set_numbered_link_hop) + unnumbered_link_hop = __builtin__.property(_get_unnumbered_link_hop, _set_unnumbered_link_hop) + as_number_hop = __builtin__.property(_get_as_number_hop, _set_as_number_hop) + label_hop = __builtin__.property(_get_label_hop, _set_label_hop) + srlg = __builtin__.property(_get_srlg, _set_srlg) + + __choices__ = {'algorithm': {'metric': ['index']}, 'type': {'numbered-node-hop': ['numbered_node_hop'], 'numbered-link-hop': ['numbered_link_hop'], 'unnumbered-link-hop': ['unnumbered_link_hop'], 'as-number': ['as_number_hop'], 'label': ['label_hop'], 'srlg': ['srlg']}} + _pyangbind_elements = OrderedDict([('index', index), ('numbered_node_hop', numbered_node_hop), ('numbered_link_hop', numbered_link_hop), ('unnumbered_link_hop', unnumbered_link_hop), ('as_number_hop', as_number_hop), ('label_hop', label_hop), ('srlg', srlg), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/as_number_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/as_number_hop/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..1e6791351c451cf6b616a6679f1b75616327f0ae --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/as_number_hop/__init__.py @@ -0,0 +1,154 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 as_number_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/optimizations/optimization-metric/explicit-route-exclude-objects/route-object-exclude-object/as-number-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: AS explicit route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__as_number','__hop_type',) + + _yang_name = 'as-number-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__as_number = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=True) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', 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 ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'optimizations', 'optimization-metric', 'explicit-route-exclude-objects', 'route-object-exclude-object', 'as-number-hop'] + + def _get_as_number(self): + """ + Getter method for as_number, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/as_number_hop/as_number (inet:as-number) + + YANG Description: The Autonomous System (AS) number. + """ + return self.__as_number + + def _set_as_number(self, v, load=False): + """ + Setter method for as_number, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/as_number_hop/as_number (inet:as-number) + If this variable is read-only (config: false) in the + source YANG file, then _set_as_number is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_as_number() directly. + + YANG Description: The Autonomous System (AS) number. + """ + 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="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """as_number must be of a type compatible with inet:as-number""", + 'defined-type': "inet:as-number", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=True)""", + }) + + self.__as_number = t + if hasattr(self, '_set'): + self._set() + + def _unset_as_number(self): + self.__as_number = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=True) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/as_number_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/as_number_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + 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={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + + as_number = __builtin__.property(_get_as_number, _set_as_number) + hop_type = __builtin__.property(_get_hop_type, _set_hop_type) + + __choices__ = {'type': {'as-number': ['as_number', 'hop_type']}} + _pyangbind_elements = OrderedDict([('as_number', as_number), ('hop_type', hop_type), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..50003dc6a7a4578fb95ad05dc949bd0098717f06 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/__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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 te_label +class label_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/optimizations/optimization-metric/explicit-route-exclude-objects/route-object-exclude-object/label-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Label hop type. + """ + __slots__ = ('_path_helper', '_extmethods', '__te_label',) + + _yang_name = 'label-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__te_label = YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-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 ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'optimizations', 'optimization-metric', 'explicit-route-exclude-objects', 'route-object-exclude-object', 'label-hop'] + + def _get_te_label(self): + """ + Getter method for te_label, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label (container) + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + return self.__te_label + + def _set_te_label(self, v, load=False): + """ + Setter method for te_label, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_te_label is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_te_label() directly. + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """te_label must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__te_label = t + if hasattr(self, '_set'): + self._set() + + def _unset_te_label(self): + self.__te_label = YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + te_label = __builtin__.property(_get_te_label, _set_te_label) + + __choices__ = {'type': {'label': ['te_label']}} + _pyangbind_elements = OrderedDict([('te_label', te_label), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..b80329a9fed7d51e39a75e8efb2c70b4714c1a4b --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label/__init__.py @@ -0,0 +1,234 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 otn +class te_label(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/optimizations/optimization-metric/explicit-route-exclude-objects/route-object-exclude-object/label-hop/te-label. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + __slots__ = ('_path_helper', '_extmethods', '__generic','__otn','__vlanid','__direction',) + + _yang_name = 'te-label' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__generic = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True) + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + self.__vlanid = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True) + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', 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 ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'optimizations', 'optimization-metric', 'explicit-route-exclude-objects', 'route-object-exclude-object', 'label-hop', 'te-label'] + + def _get_generic(self): + """ + Getter method for generic, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label/generic (rt-types:generalized-label) + + YANG Description: TE label specified in a generic format. + """ + return self.__generic + + def _set_generic(self, v, load=False): + """ + Setter method for generic, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label/generic (rt-types:generalized-label) + If this variable is read-only (config: false) in the + source YANG file, then _set_generic is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_generic() directly. + + YANG Description: TE label specified in a generic format. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """generic must be of a type compatible with rt-types:generalized-label""", + 'defined-type': "rt-types:generalized-label", + 'generated-type': """YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True)""", + }) + + self.__generic = t + if hasattr(self, '_set'): + self._set() + + def _unset_generic(self): + self.__generic = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True) + + + def _get_otn(self): + """ + Getter method for otn, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label/otn (container) + + YANG Description: Label hop for OTN. + """ + return self.__otn + + def _set_otn(self, v, load=False): + """ + Setter method for otn, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label/otn (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_otn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_otn() directly. + + YANG Description: Label hop for OTN. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """otn must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True)""", + }) + + self.__otn = t + if hasattr(self, '_set'): + self._set() + + def _unset_otn(self): + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + + + def _get_vlanid(self): + """ + Getter method for vlanid, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label/vlanid (etht-types:vlanid) + + YANG Description: VLAN tag id. + """ + return self.__vlanid + + def _set_vlanid(self, v, load=False): + """ + Setter method for vlanid, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label/vlanid (etht-types:vlanid) + If this variable is read-only (config: false) in the + source YANG file, then _set_vlanid is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_vlanid() directly. + + YANG Description: VLAN tag id. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """vlanid must be of a type compatible with etht-types:vlanid""", + 'defined-type': "etht-types:vlanid", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True)""", + }) + + self.__vlanid = t + if hasattr(self, '_set'): + self._set() + + def _unset_vlanid(self): + self.__vlanid = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True) + + + def _get_direction(self): + """ + Getter method for direction, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label/direction (te-label-direction) + + YANG Description: Label direction. + """ + return self.__direction + + def _set_direction(self, v, load=False): + """ + Setter method for direction, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label/direction (te-label-direction) + If this variable is read-only (config: false) in the + source YANG file, then _set_direction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_direction() directly. + + YANG Description: Label direction. + """ + 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={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """direction must be of a type compatible with te-label-direction""", + 'defined-type': "ietf-te-topology:te-label-direction", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=True)""", + }) + + self.__direction = t + if hasattr(self, '_set'): + self._set() + + def _unset_direction(self): + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=True) + + generic = __builtin__.property(_get_generic, _set_generic) + otn = __builtin__.property(_get_otn, _set_otn) + vlanid = __builtin__.property(_get_vlanid, _set_vlanid) + direction = __builtin__.property(_get_direction, _set_direction) + + __choices__ = {'technology': {'generic': ['generic'], 'otn': ['otn'], 'eth': ['vlanid']}, 'type': {'label': ['direction']}} + _pyangbind_elements = OrderedDict([('generic', generic), ('otn', otn), ('vlanid', vlanid), ('direction', direction), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label/otn/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label/otn/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..56737e8651ab92ae342efbf5c1b5bd19ebe87edb --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label/otn/__init__.py @@ -0,0 +1,209 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 otn(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/optimizations/optimization-metric/explicit-route-exclude-objects/route-object-exclude-object/label-hop/te-label/otn. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Label hop for OTN. + """ + __slots__ = ('_path_helper', '_extmethods', '__tpn','__tsg','__ts_list',) + + _yang_name = 'otn' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__tpn = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True) + self.__tsg = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + self.__ts_list = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-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 ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'optimizations', 'optimization-metric', 'explicit-route-exclude-objects', 'route-object-exclude-object', 'label-hop', 'te-label', 'otn'] + + def _get_tpn(self): + """ + Getter method for tpn, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label/otn/tpn (otn-tpn) + + YANG Description: Tributary Port Number (TPN). + """ + return self.__tpn + + def _set_tpn(self, v, load=False): + """ + Setter method for tpn, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label/otn/tpn (otn-tpn) + If this variable is read-only (config: false) in the + source YANG file, then _set_tpn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tpn() directly. + + YANG Description: Tributary Port Number (TPN). + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tpn must be of a type compatible with otn-tpn""", + 'defined-type': "ietf-otn-topology:otn-tpn", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True)""", + }) + + self.__tpn = t + if hasattr(self, '_set'): + self._set() + + def _unset_tpn(self): + self.__tpn = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True) + + + def _get_tsg(self): + """ + Getter method for tsg, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label/otn/tsg (identityref) + + YANG Description: Tributary Slot Granularity (TSG). + """ + return self.__tsg + + def _set_tsg(self, v, load=False): + """ + Setter method for tsg, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label/otn/tsg (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_tsg is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tsg() directly. + + YANG Description: Tributary Slot Granularity (TSG). + """ + 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={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tsg must be of a type compatible with identityref""", + 'defined-type': "ietf-otn-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True)""", + }) + + self.__tsg = t + if hasattr(self, '_set'): + self._set() + + def _unset_tsg(self): + self.__tsg = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + + + def _get_ts_list(self): + """ + Getter method for ts_list, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label/otn/ts_list (string) + + YANG Description: A list of available Tributary Slots (TS) ranging + + + + +between 1 and 4095. If multiple values or +ranges are given, they all MUST be disjoint +and MUST be in ascending order. +For example 1-20,25,50-1000. + """ + return self.__ts_list + + def _set_ts_list(self, v, load=False): + """ + Setter method for ts_list, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label/otn/ts_list (string) + If this variable is read-only (config: false) in the + source YANG file, then _set_ts_list is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_ts_list() directly. + + YANG Description: A list of available Tributary Slots (TS) ranging + + + + +between 1 and 4095. If multiple values or +ranges are given, they all MUST be disjoint +and MUST be in ascending order. +For example 1-20,25,50-1000. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='string', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """ts_list must be of a type compatible with string""", + 'defined-type': "string", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='string', is_config=True)""", + }) + + self.__ts_list = t + if hasattr(self, '_set'): + self._set() + + def _unset_ts_list(self): + self.__ts_list = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='string', is_config=True) + + tpn = __builtin__.property(_get_tpn, _set_tpn) + tsg = __builtin__.property(_get_tsg, _set_tsg) + ts_list = __builtin__.property(_get_ts_list, _set_ts_list) + + __choices__ = {'technology': {'otn': ['tpn', 'tsg', 'ts_list']}} + _pyangbind_elements = OrderedDict([('tpn', tpn), ('tsg', tsg), ('ts_list', ts_list), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/numbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/numbered_link_hop/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..c91d34b8b218b01e3c1dbf79f89352fa397954f8 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/numbered_link_hop/__init__.py @@ -0,0 +1,193 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 numbered_link_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/optimizations/optimization-metric/explicit-route-exclude-objects/route-object-exclude-object/numbered-link-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Numbered link explicit route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__link_tp_id','__hop_type','__direction',) + + _yang_name = 'numbered-link-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', 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 ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'optimizations', 'optimization-metric', 'explicit-route-exclude-objects', 'route-object-exclude-object', 'numbered-link-hop'] + + def _get_link_tp_id(self): + """ + Getter method for link_tp_id, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/numbered_link_hop/link_tp_id (te-tp-id) + + YANG Description: TE Link Termination Point (LTP) identifier. + """ + return self.__link_tp_id + + def _set_link_tp_id(self, v, load=False): + """ + Setter method for link_tp_id, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/numbered_link_hop/link_tp_id (te-tp-id) + If this variable is read-only (config: false) in the + source YANG file, then _set_link_tp_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_link_tp_id() directly. + + YANG Description: TE Link Termination Point (LTP) identifier. + """ + 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),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """link_tp_id must be of a type compatible with te-tp-id""", + 'defined-type': "ietf-te-topology:te-tp-id", + 'generated-type': """YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True)""", + }) + + self.__link_tp_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_link_tp_id(self): + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/numbered_link_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/numbered_link_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + 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={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + + + def _get_direction(self): + """ + Getter method for direction, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/numbered_link_hop/direction (te-link-direction) + + YANG Description: Link route object direction. + """ + return self.__direction + + def _set_direction(self, v, load=False): + """ + Setter method for direction, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/numbered_link_hop/direction (te-link-direction) + If this variable is read-only (config: false) in the + source YANG file, then _set_direction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_direction() directly. + + YANG Description: Link route object direction. + """ + 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={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """direction must be of a type compatible with te-link-direction""", + 'defined-type': "ietf-te-topology:te-link-direction", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True)""", + }) + + self.__direction = t + if hasattr(self, '_set'): + self._set() + + def _unset_direction(self): + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True) + + link_tp_id = __builtin__.property(_get_link_tp_id, _set_link_tp_id) + hop_type = __builtin__.property(_get_hop_type, _set_hop_type) + direction = __builtin__.property(_get_direction, _set_direction) + + __choices__ = {'type': {'numbered-link-hop': ['link_tp_id', 'hop_type', 'direction']}} + _pyangbind_elements = OrderedDict([('link_tp_id', link_tp_id), ('hop_type', hop_type), ('direction', direction), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/numbered_node_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/numbered_node_hop/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e9805bcdfcb99c69548e620d2afb8f12c9bfed42 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/numbered_node_hop/__init__.py @@ -0,0 +1,154 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 numbered_node_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/optimizations/optimization-metric/explicit-route-exclude-objects/route-object-exclude-object/numbered-node-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Numbered node route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__node_id','__hop_type',) + + _yang_name = 'numbered-node-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', 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 ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'optimizations', 'optimization-metric', 'explicit-route-exclude-objects', 'route-object-exclude-object', 'numbered-node-hop'] + + def _get_node_id(self): + """ + Getter method for node_id, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/numbered_node_hop/node_id (te-node-id) + + YANG Description: The identifier of a node in the TE topology. + """ + return self.__node_id + + def _set_node_id(self, v, load=False): + """ + Setter method for node_id, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/numbered_node_hop/node_id (te-node-id) + 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. + + YANG Description: The identifier of a node in the TE topology. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """node_id must be of a type compatible with te-node-id""", + 'defined-type': "ietf-te-topology:te-node-id", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True)""", + }) + + self.__node_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_node_id(self): + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/numbered_node_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/numbered_node_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + 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={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + + node_id = __builtin__.property(_get_node_id, _set_node_id) + hop_type = __builtin__.property(_get_hop_type, _set_hop_type) + + __choices__ = {'type': {'numbered-node-hop': ['node_id', 'hop_type']}} + _pyangbind_elements = OrderedDict([('node_id', node_id), ('hop_type', hop_type), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/srlg/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/srlg/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..c5c2961e6aba86a24fa1b7dab66f33b7193d69fc --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/srlg/__init__.py @@ -0,0 +1,115 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 srlg(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/optimizations/optimization-metric/explicit-route-exclude-objects/route-object-exclude-object/srlg. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: SRLG container. + """ + __slots__ = ('_path_helper', '_extmethods', '__srlg',) + + _yang_name = 'srlg' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__srlg = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="srlg", parent=self, choice=('type', 'srlg'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', 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 ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'optimizations', 'optimization-metric', 'explicit-route-exclude-objects', 'route-object-exclude-object', 'srlg'] + + def _get_srlg(self): + """ + Getter method for srlg, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/srlg/srlg (uint32) + + YANG Description: SRLG value. + """ + return self.__srlg + + def _set_srlg(self, v, load=False): + """ + Setter method for srlg, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/srlg/srlg (uint32) + If this variable is read-only (config: false) in the + source YANG file, then _set_srlg is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_srlg() directly. + + YANG Description: SRLG value. + """ + 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="srlg", parent=self, choice=('type', 'srlg'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """srlg 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="srlg", parent=self, choice=('type', 'srlg'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True)""", + }) + + self.__srlg = t + if hasattr(self, '_set'): + self._set() + + def _unset_srlg(self): + self.__srlg = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="srlg", parent=self, choice=('type', 'srlg'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + + srlg = __builtin__.property(_get_srlg, _set_srlg) + + __choices__ = {'type': {'srlg': ['srlg']}} + _pyangbind_elements = OrderedDict([('srlg', srlg), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/unnumbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/unnumbered_link_hop/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..4a5b91f1ccf54c41b173d5eab05969a1d9e2be2f --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/unnumbered_link_hop/__init__.py @@ -0,0 +1,236 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 unnumbered_link_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/optimizations/optimization-metric/explicit-route-exclude-objects/route-object-exclude-object/unnumbered-link-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Unnumbered link explicit route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__link_tp_id','__node_id','__hop_type','__direction',) + + _yang_name = 'unnumbered-link-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True) + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', 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 ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'optimizations', 'optimization-metric', 'explicit-route-exclude-objects', 'route-object-exclude-object', 'unnumbered-link-hop'] + + def _get_link_tp_id(self): + """ + Getter method for link_tp_id, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/unnumbered_link_hop/link_tp_id (te-tp-id) + + YANG Description: TE LTP identifier. The combination of the TE link ID +and the TE node ID is used to identify an unnumbered +TE link. + """ + return self.__link_tp_id + + def _set_link_tp_id(self, v, load=False): + """ + Setter method for link_tp_id, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/unnumbered_link_hop/link_tp_id (te-tp-id) + If this variable is read-only (config: false) in the + source YANG file, then _set_link_tp_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_link_tp_id() directly. + + YANG Description: TE LTP identifier. The combination of the TE link ID +and the TE node ID is used to identify an unnumbered +TE link. + """ + 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),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """link_tp_id must be of a type compatible with te-tp-id""", + 'defined-type': "ietf-te-topology:te-tp-id", + 'generated-type': """YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True)""", + }) + + self.__link_tp_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_link_tp_id(self): + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True) + + + def _get_node_id(self): + """ + Getter method for node_id, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/unnumbered_link_hop/node_id (te-node-id) + + YANG Description: The identifier of a node in the TE topology. + """ + return self.__node_id + + def _set_node_id(self, v, load=False): + """ + Setter method for node_id, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/unnumbered_link_hop/node_id (te-node-id) + 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. + + YANG Description: The identifier of a node in the TE topology. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """node_id must be of a type compatible with te-node-id""", + 'defined-type': "ietf-te-topology:te-node-id", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True)""", + }) + + self.__node_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_node_id(self): + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/unnumbered_link_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/unnumbered_link_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + 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={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + + + def _get_direction(self): + """ + Getter method for direction, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/unnumbered_link_hop/direction (te-link-direction) + + YANG Description: Link route object direction. + """ + return self.__direction + + def _set_direction(self, v, load=False): + """ + Setter method for direction, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/unnumbered_link_hop/direction (te-link-direction) + If this variable is read-only (config: false) in the + source YANG file, then _set_direction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_direction() directly. + + YANG Description: Link route object direction. + """ + 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={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """direction must be of a type compatible with te-link-direction""", + 'defined-type': "ietf-te-topology:te-link-direction", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True)""", + }) + + self.__direction = t + if hasattr(self, '_set'): + self._set() + + def _unset_direction(self): + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True) + + link_tp_id = __builtin__.property(_get_link_tp_id, _set_link_tp_id) + node_id = __builtin__.property(_get_node_id, _set_node_id) + hop_type = __builtin__.property(_get_hop_type, _set_hop_type) + direction = __builtin__.property(_get_direction, _set_direction) + + __choices__ = {'type': {'unnumbered-link-hop': ['link_tp_id', 'node_id', 'hop_type', 'direction']}} + _pyangbind_elements = OrderedDict([('link_tp_id', link_tp_id), ('node_id', node_id), ('hop_type', hop_type), ('direction', direction), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..52d91329d11ca70cbaf141c5ee112fc3cc8437e1 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/__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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 route_object_include_object +class explicit_route_include_objects(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/optimizations/optimization-metric/explicit-route-include-objects. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Container for the 'include route' object list. + """ + __slots__ = ('_path_helper', '_extmethods', '__route_object_include_object',) + + _yang_name = 'explicit-route-include-objects' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__route_object_include_object = YANGDynClass(base=YANGListType("index",route_object_include_object.route_object_include_object, yang_name="route-object-include-object", parent=self, is_container='list', user_ordered=True, path_helper=self._path_helper, yang_keys='index', extensions=None, choice=('algorithm', 'metric')), is_container='list', yang_name="route-object-include-object", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-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 ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'optimizations', 'optimization-metric', 'explicit-route-include-objects'] + + def _get_route_object_include_object(self): + """ + Getter method for route_object_include_object, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object (list) + + YANG Description: List of Explicit Route Objects to be included in the +path computation. + """ + return self.__route_object_include_object + + def _set_route_object_include_object(self, v, load=False): + """ + Setter method for route_object_include_object, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_route_object_include_object is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_route_object_include_object() directly. + + YANG Description: List of Explicit Route Objects to be included in the +path computation. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("index",route_object_include_object.route_object_include_object, yang_name="route-object-include-object", parent=self, is_container='list', user_ordered=True, path_helper=self._path_helper, yang_keys='index', extensions=None, choice=('algorithm', 'metric')), is_container='list', yang_name="route-object-include-object", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """route_object_include_object must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("index",route_object_include_object.route_object_include_object, yang_name="route-object-include-object", parent=self, is_container='list', user_ordered=True, path_helper=self._path_helper, yang_keys='index', extensions=None, choice=('algorithm', 'metric')), is_container='list', yang_name="route-object-include-object", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True)""", + }) + + self.__route_object_include_object = t + if hasattr(self, '_set'): + self._set() + + def _unset_route_object_include_object(self): + self.__route_object_include_object = YANGDynClass(base=YANGListType("index",route_object_include_object.route_object_include_object, yang_name="route-object-include-object", parent=self, is_container='list', user_ordered=True, path_helper=self._path_helper, yang_keys='index', extensions=None, choice=('algorithm', 'metric')), is_container='list', yang_name="route-object-include-object", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + + route_object_include_object = __builtin__.property(_get_route_object_include_object, _set_route_object_include_object) + + __choices__ = {'algorithm': {'metric': ['route_object_include_object']}} + _pyangbind_elements = OrderedDict([('route_object_include_object', route_object_include_object), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..4b596318d6e06716db97ec964b066120ea2dda0d --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/__init__.py @@ -0,0 +1,325 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 numbered_node_hop +from . import numbered_link_hop +from . import unnumbered_link_hop +from . import as_number_hop +from . import label_hop +class route_object_include_object(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/optimizations/optimization-metric/explicit-route-include-objects/route-object-include-object. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: List of Explicit Route Objects to be included in the +path computation. + """ + __slots__ = ('_path_helper', '_extmethods', '__index','__numbered_node_hop','__numbered_link_hop','__unnumbered_link_hop','__as_number_hop','__label_hop',) + + _yang_name = 'route-object-include-object' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _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), is_leaf=True, yang_name="index", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + self.__numbered_node_hop = YANGDynClass(base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__numbered_link_hop = YANGDynClass(base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__unnumbered_link_hop = YANGDynClass(base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__as_number_hop = YANGDynClass(base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__label_hop = YANGDynClass(base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-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 ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'optimizations', 'optimization-metric', 'explicit-route-include-objects', 'route-object-include-object'] + + def _get_index(self): + """ + Getter method for index, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/index (uint32) + + YANG Description: Route object entry index. The index is used to +identify an entry in the list. The order of entries +is defined by the user without relying on key values. + """ + return self.__index + + def _set_index(self, v, load=False): + """ + Setter method for index, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/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: Route object entry index. The index is used to +identify an entry in the list. The order of entries +is defined by the user without relying on key values. + """ + 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=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="index", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', 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), is_leaf=True, yang_name="index", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', 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), is_leaf=True, yang_name="index", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + + + def _get_numbered_node_hop(self): + """ + Getter method for numbered_node_hop, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/numbered_node_hop (container) + + YANG Description: Numbered node route hop. + """ + return self.__numbered_node_hop + + def _set_numbered_node_hop(self, v, load=False): + """ + Setter method for numbered_node_hop, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/numbered_node_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_numbered_node_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_numbered_node_hop() directly. + + YANG Description: Numbered node route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """numbered_node_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__numbered_node_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_numbered_node_hop(self): + self.__numbered_node_hop = YANGDynClass(base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_numbered_link_hop(self): + """ + Getter method for numbered_link_hop, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/numbered_link_hop (container) + + YANG Description: Numbered link explicit route hop. + """ + return self.__numbered_link_hop + + def _set_numbered_link_hop(self, v, load=False): + """ + Setter method for numbered_link_hop, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/numbered_link_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_numbered_link_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_numbered_link_hop() directly. + + YANG Description: Numbered link explicit route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """numbered_link_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__numbered_link_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_numbered_link_hop(self): + self.__numbered_link_hop = YANGDynClass(base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_unnumbered_link_hop(self): + """ + Getter method for unnumbered_link_hop, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/unnumbered_link_hop (container) + + YANG Description: Unnumbered link explicit route hop. + """ + return self.__unnumbered_link_hop + + def _set_unnumbered_link_hop(self, v, load=False): + """ + Setter method for unnumbered_link_hop, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/unnumbered_link_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_unnumbered_link_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_unnumbered_link_hop() directly. + + YANG Description: Unnumbered link explicit route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """unnumbered_link_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__unnumbered_link_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_unnumbered_link_hop(self): + self.__unnumbered_link_hop = YANGDynClass(base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_as_number_hop(self): + """ + Getter method for as_number_hop, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/as_number_hop (container) + + YANG Description: AS explicit route hop. + """ + return self.__as_number_hop + + def _set_as_number_hop(self, v, load=False): + """ + Setter method for as_number_hop, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/as_number_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_as_number_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_as_number_hop() directly. + + YANG Description: AS explicit route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """as_number_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__as_number_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_as_number_hop(self): + self.__as_number_hop = YANGDynClass(base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_label_hop(self): + """ + Getter method for label_hop, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop (container) + + YANG Description: Label hop type. + """ + return self.__label_hop + + def _set_label_hop(self, v, load=False): + """ + Setter method for label_hop, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_label_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_label_hop() directly. + + YANG Description: Label hop type. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """label_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__label_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_label_hop(self): + self.__label_hop = YANGDynClass(base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + index = __builtin__.property(_get_index, _set_index) + numbered_node_hop = __builtin__.property(_get_numbered_node_hop, _set_numbered_node_hop) + numbered_link_hop = __builtin__.property(_get_numbered_link_hop, _set_numbered_link_hop) + unnumbered_link_hop = __builtin__.property(_get_unnumbered_link_hop, _set_unnumbered_link_hop) + as_number_hop = __builtin__.property(_get_as_number_hop, _set_as_number_hop) + label_hop = __builtin__.property(_get_label_hop, _set_label_hop) + + __choices__ = {'algorithm': {'metric': ['index']}, 'type': {'numbered-node-hop': ['numbered_node_hop'], 'numbered-link-hop': ['numbered_link_hop'], 'unnumbered-link-hop': ['unnumbered_link_hop'], 'as-number': ['as_number_hop'], 'label': ['label_hop']}} + _pyangbind_elements = OrderedDict([('index', index), ('numbered_node_hop', numbered_node_hop), ('numbered_link_hop', numbered_link_hop), ('unnumbered_link_hop', unnumbered_link_hop), ('as_number_hop', as_number_hop), ('label_hop', label_hop), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/as_number_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/as_number_hop/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..005900b6dedd25bd5cd711a0945e0c9a9755fa66 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/as_number_hop/__init__.py @@ -0,0 +1,154 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 as_number_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/optimizations/optimization-metric/explicit-route-include-objects/route-object-include-object/as-number-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: AS explicit route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__as_number','__hop_type',) + + _yang_name = 'as-number-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__as_number = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=True) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', 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 ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'optimizations', 'optimization-metric', 'explicit-route-include-objects', 'route-object-include-object', 'as-number-hop'] + + def _get_as_number(self): + """ + Getter method for as_number, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/as_number_hop/as_number (inet:as-number) + + YANG Description: The Autonomous System (AS) number. + """ + return self.__as_number + + def _set_as_number(self, v, load=False): + """ + Setter method for as_number, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/as_number_hop/as_number (inet:as-number) + If this variable is read-only (config: false) in the + source YANG file, then _set_as_number is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_as_number() directly. + + YANG Description: The Autonomous System (AS) number. + """ + 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="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """as_number must be of a type compatible with inet:as-number""", + 'defined-type': "inet:as-number", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=True)""", + }) + + self.__as_number = t + if hasattr(self, '_set'): + self._set() + + def _unset_as_number(self): + self.__as_number = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=True) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/as_number_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/as_number_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + 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={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + + as_number = __builtin__.property(_get_as_number, _set_as_number) + hop_type = __builtin__.property(_get_hop_type, _set_hop_type) + + __choices__ = {'type': {'as-number': ['as_number', 'hop_type']}} + _pyangbind_elements = OrderedDict([('as_number', as_number), ('hop_type', hop_type), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..cec600652c93867f4ddc94bda61ee53ede563677 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/__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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 te_label +class label_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/optimizations/optimization-metric/explicit-route-include-objects/route-object-include-object/label-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Label hop type. + """ + __slots__ = ('_path_helper', '_extmethods', '__te_label',) + + _yang_name = 'label-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__te_label = YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-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 ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'optimizations', 'optimization-metric', 'explicit-route-include-objects', 'route-object-include-object', 'label-hop'] + + def _get_te_label(self): + """ + Getter method for te_label, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label (container) + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + return self.__te_label + + def _set_te_label(self, v, load=False): + """ + Setter method for te_label, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_te_label is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_te_label() directly. + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """te_label must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__te_label = t + if hasattr(self, '_set'): + self._set() + + def _unset_te_label(self): + self.__te_label = YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + te_label = __builtin__.property(_get_te_label, _set_te_label) + + __choices__ = {'type': {'label': ['te_label']}} + _pyangbind_elements = OrderedDict([('te_label', te_label), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..5212e8f5d6939f4929845a9486e70c673c1ffa2b --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label/__init__.py @@ -0,0 +1,234 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 otn +class te_label(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/optimizations/optimization-metric/explicit-route-include-objects/route-object-include-object/label-hop/te-label. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + __slots__ = ('_path_helper', '_extmethods', '__generic','__otn','__vlanid','__direction',) + + _yang_name = 'te-label' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__generic = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True) + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + self.__vlanid = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True) + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', 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 ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'optimizations', 'optimization-metric', 'explicit-route-include-objects', 'route-object-include-object', 'label-hop', 'te-label'] + + def _get_generic(self): + """ + Getter method for generic, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label/generic (rt-types:generalized-label) + + YANG Description: TE label specified in a generic format. + """ + return self.__generic + + def _set_generic(self, v, load=False): + """ + Setter method for generic, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label/generic (rt-types:generalized-label) + If this variable is read-only (config: false) in the + source YANG file, then _set_generic is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_generic() directly. + + YANG Description: TE label specified in a generic format. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """generic must be of a type compatible with rt-types:generalized-label""", + 'defined-type': "rt-types:generalized-label", + 'generated-type': """YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True)""", + }) + + self.__generic = t + if hasattr(self, '_set'): + self._set() + + def _unset_generic(self): + self.__generic = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True) + + + def _get_otn(self): + """ + Getter method for otn, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label/otn (container) + + YANG Description: Label hop for OTN. + """ + return self.__otn + + def _set_otn(self, v, load=False): + """ + Setter method for otn, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label/otn (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_otn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_otn() directly. + + YANG Description: Label hop for OTN. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """otn must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True)""", + }) + + self.__otn = t + if hasattr(self, '_set'): + self._set() + + def _unset_otn(self): + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + + + def _get_vlanid(self): + """ + Getter method for vlanid, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label/vlanid (etht-types:vlanid) + + YANG Description: VLAN tag id. + """ + return self.__vlanid + + def _set_vlanid(self, v, load=False): + """ + Setter method for vlanid, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label/vlanid (etht-types:vlanid) + If this variable is read-only (config: false) in the + source YANG file, then _set_vlanid is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_vlanid() directly. + + YANG Description: VLAN tag id. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """vlanid must be of a type compatible with etht-types:vlanid""", + 'defined-type': "etht-types:vlanid", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True)""", + }) + + self.__vlanid = t + if hasattr(self, '_set'): + self._set() + + def _unset_vlanid(self): + self.__vlanid = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True) + + + def _get_direction(self): + """ + Getter method for direction, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label/direction (te-label-direction) + + YANG Description: Label direction. + """ + return self.__direction + + def _set_direction(self, v, load=False): + """ + Setter method for direction, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label/direction (te-label-direction) + If this variable is read-only (config: false) in the + source YANG file, then _set_direction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_direction() directly. + + YANG Description: Label direction. + """ + 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={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """direction must be of a type compatible with te-label-direction""", + 'defined-type': "ietf-te-topology:te-label-direction", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=True)""", + }) + + self.__direction = t + if hasattr(self, '_set'): + self._set() + + def _unset_direction(self): + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=True) + + generic = __builtin__.property(_get_generic, _set_generic) + otn = __builtin__.property(_get_otn, _set_otn) + vlanid = __builtin__.property(_get_vlanid, _set_vlanid) + direction = __builtin__.property(_get_direction, _set_direction) + + __choices__ = {'technology': {'generic': ['generic'], 'otn': ['otn'], 'eth': ['vlanid']}, 'type': {'label': ['direction']}} + _pyangbind_elements = OrderedDict([('generic', generic), ('otn', otn), ('vlanid', vlanid), ('direction', direction), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label/otn/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label/otn/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..de434357d1096ad61bc755d75a724f06cc38005d --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label/otn/__init__.py @@ -0,0 +1,209 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 otn(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/optimizations/optimization-metric/explicit-route-include-objects/route-object-include-object/label-hop/te-label/otn. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Label hop for OTN. + """ + __slots__ = ('_path_helper', '_extmethods', '__tpn','__tsg','__ts_list',) + + _yang_name = 'otn' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__tpn = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True) + self.__tsg = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + self.__ts_list = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-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 ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'optimizations', 'optimization-metric', 'explicit-route-include-objects', 'route-object-include-object', 'label-hop', 'te-label', 'otn'] + + def _get_tpn(self): + """ + Getter method for tpn, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label/otn/tpn (otn-tpn) + + YANG Description: Tributary Port Number (TPN). + """ + return self.__tpn + + def _set_tpn(self, v, load=False): + """ + Setter method for tpn, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label/otn/tpn (otn-tpn) + If this variable is read-only (config: false) in the + source YANG file, then _set_tpn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tpn() directly. + + YANG Description: Tributary Port Number (TPN). + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tpn must be of a type compatible with otn-tpn""", + 'defined-type': "ietf-otn-topology:otn-tpn", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True)""", + }) + + self.__tpn = t + if hasattr(self, '_set'): + self._set() + + def _unset_tpn(self): + self.__tpn = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True) + + + def _get_tsg(self): + """ + Getter method for tsg, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label/otn/tsg (identityref) + + YANG Description: Tributary Slot Granularity (TSG). + """ + return self.__tsg + + def _set_tsg(self, v, load=False): + """ + Setter method for tsg, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label/otn/tsg (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_tsg is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tsg() directly. + + YANG Description: Tributary Slot Granularity (TSG). + """ + 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={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tsg must be of a type compatible with identityref""", + 'defined-type': "ietf-otn-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True)""", + }) + + self.__tsg = t + if hasattr(self, '_set'): + self._set() + + def _unset_tsg(self): + self.__tsg = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + + + def _get_ts_list(self): + """ + Getter method for ts_list, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label/otn/ts_list (string) + + YANG Description: A list of available Tributary Slots (TS) ranging + + + + +between 1 and 4095. If multiple values or +ranges are given, they all MUST be disjoint +and MUST be in ascending order. +For example 1-20,25,50-1000. + """ + return self.__ts_list + + def _set_ts_list(self, v, load=False): + """ + Setter method for ts_list, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label/otn/ts_list (string) + If this variable is read-only (config: false) in the + source YANG file, then _set_ts_list is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_ts_list() directly. + + YANG Description: A list of available Tributary Slots (TS) ranging + + + + +between 1 and 4095. If multiple values or +ranges are given, they all MUST be disjoint +and MUST be in ascending order. +For example 1-20,25,50-1000. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='string', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """ts_list must be of a type compatible with string""", + 'defined-type': "string", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='string', is_config=True)""", + }) + + self.__ts_list = t + if hasattr(self, '_set'): + self._set() + + def _unset_ts_list(self): + self.__ts_list = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='string', is_config=True) + + tpn = __builtin__.property(_get_tpn, _set_tpn) + tsg = __builtin__.property(_get_tsg, _set_tsg) + ts_list = __builtin__.property(_get_ts_list, _set_ts_list) + + __choices__ = {'technology': {'otn': ['tpn', 'tsg', 'ts_list']}} + _pyangbind_elements = OrderedDict([('tpn', tpn), ('tsg', tsg), ('ts_list', ts_list), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/numbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/numbered_link_hop/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..a4d2fdce18c44d1eb2b425de0a8e33f5b60bffd7 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/numbered_link_hop/__init__.py @@ -0,0 +1,193 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 numbered_link_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/optimizations/optimization-metric/explicit-route-include-objects/route-object-include-object/numbered-link-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Numbered link explicit route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__link_tp_id','__hop_type','__direction',) + + _yang_name = 'numbered-link-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', 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 ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'optimizations', 'optimization-metric', 'explicit-route-include-objects', 'route-object-include-object', 'numbered-link-hop'] + + def _get_link_tp_id(self): + """ + Getter method for link_tp_id, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/numbered_link_hop/link_tp_id (te-tp-id) + + YANG Description: TE Link Termination Point (LTP) identifier. + """ + return self.__link_tp_id + + def _set_link_tp_id(self, v, load=False): + """ + Setter method for link_tp_id, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/numbered_link_hop/link_tp_id (te-tp-id) + If this variable is read-only (config: false) in the + source YANG file, then _set_link_tp_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_link_tp_id() directly. + + YANG Description: TE Link Termination Point (LTP) identifier. + """ + 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),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """link_tp_id must be of a type compatible with te-tp-id""", + 'defined-type': "ietf-te-topology:te-tp-id", + 'generated-type': """YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True)""", + }) + + self.__link_tp_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_link_tp_id(self): + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/numbered_link_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/numbered_link_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + 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={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + + + def _get_direction(self): + """ + Getter method for direction, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/numbered_link_hop/direction (te-link-direction) + + YANG Description: Link route object direction. + """ + return self.__direction + + def _set_direction(self, v, load=False): + """ + Setter method for direction, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/numbered_link_hop/direction (te-link-direction) + If this variable is read-only (config: false) in the + source YANG file, then _set_direction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_direction() directly. + + YANG Description: Link route object direction. + """ + 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={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """direction must be of a type compatible with te-link-direction""", + 'defined-type': "ietf-te-topology:te-link-direction", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True)""", + }) + + self.__direction = t + if hasattr(self, '_set'): + self._set() + + def _unset_direction(self): + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True) + + link_tp_id = __builtin__.property(_get_link_tp_id, _set_link_tp_id) + hop_type = __builtin__.property(_get_hop_type, _set_hop_type) + direction = __builtin__.property(_get_direction, _set_direction) + + __choices__ = {'type': {'numbered-link-hop': ['link_tp_id', 'hop_type', 'direction']}} + _pyangbind_elements = OrderedDict([('link_tp_id', link_tp_id), ('hop_type', hop_type), ('direction', direction), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/numbered_node_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/numbered_node_hop/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..d5f6b873cc2a9134a97adf32b75375df3dc8a1d4 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/numbered_node_hop/__init__.py @@ -0,0 +1,154 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 numbered_node_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/optimizations/optimization-metric/explicit-route-include-objects/route-object-include-object/numbered-node-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Numbered node route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__node_id','__hop_type',) + + _yang_name = 'numbered-node-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', 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 ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'optimizations', 'optimization-metric', 'explicit-route-include-objects', 'route-object-include-object', 'numbered-node-hop'] + + def _get_node_id(self): + """ + Getter method for node_id, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/numbered_node_hop/node_id (te-node-id) + + YANG Description: The identifier of a node in the TE topology. + """ + return self.__node_id + + def _set_node_id(self, v, load=False): + """ + Setter method for node_id, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/numbered_node_hop/node_id (te-node-id) + 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. + + YANG Description: The identifier of a node in the TE topology. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """node_id must be of a type compatible with te-node-id""", + 'defined-type': "ietf-te-topology:te-node-id", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True)""", + }) + + self.__node_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_node_id(self): + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/numbered_node_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/numbered_node_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + 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={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + + node_id = __builtin__.property(_get_node_id, _set_node_id) + hop_type = __builtin__.property(_get_hop_type, _set_hop_type) + + __choices__ = {'type': {'numbered-node-hop': ['node_id', 'hop_type']}} + _pyangbind_elements = OrderedDict([('node_id', node_id), ('hop_type', hop_type), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/unnumbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/unnumbered_link_hop/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..b3cc0d8dec78461878afe20fb2f0c17d96747a9b --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/unnumbered_link_hop/__init__.py @@ -0,0 +1,236 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 unnumbered_link_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/optimizations/optimization-metric/explicit-route-include-objects/route-object-include-object/unnumbered-link-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Unnumbered link explicit route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__link_tp_id','__node_id','__hop_type','__direction',) + + _yang_name = 'unnumbered-link-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True) + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', 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 ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'optimizations', 'optimization-metric', 'explicit-route-include-objects', 'route-object-include-object', 'unnumbered-link-hop'] + + def _get_link_tp_id(self): + """ + Getter method for link_tp_id, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/unnumbered_link_hop/link_tp_id (te-tp-id) + + YANG Description: TE LTP identifier. The combination of the TE link ID +and the TE node ID is used to identify an unnumbered +TE link. + """ + return self.__link_tp_id + + def _set_link_tp_id(self, v, load=False): + """ + Setter method for link_tp_id, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/unnumbered_link_hop/link_tp_id (te-tp-id) + If this variable is read-only (config: false) in the + source YANG file, then _set_link_tp_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_link_tp_id() directly. + + YANG Description: TE LTP identifier. The combination of the TE link ID +and the TE node ID is used to identify an unnumbered +TE link. + """ + 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),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """link_tp_id must be of a type compatible with te-tp-id""", + 'defined-type': "ietf-te-topology:te-tp-id", + 'generated-type': """YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True)""", + }) + + self.__link_tp_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_link_tp_id(self): + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True) + + + def _get_node_id(self): + """ + Getter method for node_id, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/unnumbered_link_hop/node_id (te-node-id) + + YANG Description: The identifier of a node in the TE topology. + """ + return self.__node_id + + def _set_node_id(self, v, load=False): + """ + Setter method for node_id, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/unnumbered_link_hop/node_id (te-node-id) + 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. + + YANG Description: The identifier of a node in the TE topology. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """node_id must be of a type compatible with te-node-id""", + 'defined-type': "ietf-te-topology:te-node-id", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True)""", + }) + + self.__node_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_node_id(self): + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/unnumbered_link_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/unnumbered_link_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + 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={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + + + def _get_direction(self): + """ + Getter method for direction, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/unnumbered_link_hop/direction (te-link-direction) + + YANG Description: Link route object direction. + """ + return self.__direction + + def _set_direction(self, v, load=False): + """ + Setter method for direction, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/unnumbered_link_hop/direction (te-link-direction) + If this variable is read-only (config: false) in the + source YANG file, then _set_direction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_direction() directly. + + YANG Description: Link route object direction. + """ + 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={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """direction must be of a type compatible with te-link-direction""", + 'defined-type': "ietf-te-topology:te-link-direction", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True)""", + }) + + self.__direction = t + if hasattr(self, '_set'): + self._set() + + def _unset_direction(self): + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True) + + link_tp_id = __builtin__.property(_get_link_tp_id, _set_link_tp_id) + node_id = __builtin__.property(_get_node_id, _set_node_id) + hop_type = __builtin__.property(_get_hop_type, _set_hop_type) + direction = __builtin__.property(_get_direction, _set_direction) + + __choices__ = {'type': {'unnumbered-link-hop': ['link_tp_id', 'node_id', 'hop_type', 'direction']}} + _pyangbind_elements = OrderedDict([('link_tp_id', link_tp_id), ('node_id', node_id), ('hop_type', hop_type), ('direction', direction), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/tiebreakers/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/tiebreakers/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..1132534b5ff8e33c85f6856b303b5eb96f851eab --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/tiebreakers/__init__.py @@ -0,0 +1,120 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 tiebreaker +class tiebreakers(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/optimizations/tiebreakers. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Container for the list of tiebreakers. + """ + __slots__ = ('_path_helper', '_extmethods', '__tiebreaker',) + + _yang_name = 'tiebreakers' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__tiebreaker = YANGDynClass(base=YANGListType("tiebreaker_type",tiebreaker.tiebreaker, yang_name="tiebreaker", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='tiebreaker-type', extensions=None, choice=('algorithm', 'metric')), is_container='list', yang_name="tiebreaker", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-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 ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'optimizations', 'tiebreakers'] + + def _get_tiebreaker(self): + """ + Getter method for tiebreaker, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/tiebreakers/tiebreaker (list) + + YANG Description: The list of tiebreaker criteria to apply on an +equally favored set of paths, in order to pick +the best. + """ + return self.__tiebreaker + + def _set_tiebreaker(self, v, load=False): + """ + Setter method for tiebreaker, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/tiebreakers/tiebreaker (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_tiebreaker is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tiebreaker() directly. + + YANG Description: The list of tiebreaker criteria to apply on an +equally favored set of paths, in order to pick +the best. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("tiebreaker_type",tiebreaker.tiebreaker, yang_name="tiebreaker", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='tiebreaker-type', extensions=None, choice=('algorithm', 'metric')), is_container='list', yang_name="tiebreaker", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tiebreaker must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("tiebreaker_type",tiebreaker.tiebreaker, yang_name="tiebreaker", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='tiebreaker-type', extensions=None, choice=('algorithm', 'metric')), is_container='list', yang_name="tiebreaker", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True)""", + }) + + self.__tiebreaker = t + if hasattr(self, '_set'): + self._set() + + def _unset_tiebreaker(self): + self.__tiebreaker = YANGDynClass(base=YANGListType("tiebreaker_type",tiebreaker.tiebreaker, yang_name="tiebreaker", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='tiebreaker-type', extensions=None, choice=('algorithm', 'metric')), is_container='list', yang_name="tiebreaker", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + + tiebreaker = __builtin__.property(_get_tiebreaker, _set_tiebreaker) + + __choices__ = {'algorithm': {'metric': ['tiebreaker']}} + _pyangbind_elements = OrderedDict([('tiebreaker', tiebreaker), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/tiebreakers/tiebreaker/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/tiebreakers/tiebreaker/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..41f4df7a218348839dec615158e0d032b92abb30 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/tiebreakers/tiebreaker/__init__.py @@ -0,0 +1,122 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 tiebreaker(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/optimizations/tiebreakers/tiebreaker. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: The list of tiebreaker criteria to apply on an +equally favored set of paths, in order to pick +the best. + """ + __slots__ = ('_path_helper', '_extmethods', '__tiebreaker_type',) + + _yang_name = 'tiebreaker' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__tiebreaker_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="tiebreaker-type", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', 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 ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'optimizations', 'tiebreakers', 'tiebreaker'] + + def _get_tiebreaker_type(self): + """ + Getter method for tiebreaker_type, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/tiebreakers/tiebreaker/tiebreaker_type (identityref) + + YANG Description: Identifies an entry in the list of tiebreakers. + """ + return self.__tiebreaker_type + + def _set_tiebreaker_type(self, v, load=False): + """ + Setter method for tiebreaker_type, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/tiebreakers/tiebreaker/tiebreaker_type (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_tiebreaker_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tiebreaker_type() directly. + + YANG Description: Identifies an entry in the list of tiebreakers. + """ + 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=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="tiebreaker-type", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tiebreaker_type must be of a type compatible with identityref""", + 'defined-type': "ietf-te-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="tiebreaker-type", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True)""", + }) + + self.__tiebreaker_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_tiebreaker_type(self): + self.__tiebreaker_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="tiebreaker-type", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + + tiebreaker_type = __builtin__.property(_get_tiebreaker_type, _set_tiebreaker_type) + + __choices__ = {'algorithm': {'metric': ['tiebreaker_type']}} + _pyangbind_elements = OrderedDict([('tiebreaker_type', tiebreaker_type), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..f8f93bf028e2a37fe3e5edb85b170f104117a751 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/__init__.py @@ -0,0 +1,523 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 te_bandwidth +from . import path_metric_bounds +from . import path_affinities_values +from . import path_affinity_names +from . import path_srlgs_lists +from . import path_srlgs_names +class path_constraints(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/path-constraints. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: TE named path constraints container. + """ + __slots__ = ('_path_helper', '_extmethods', '__te_bandwidth','__link_protection','__setup_priority','__hold_priority','__signaling_type','__path_metric_bounds','__path_affinities_values','__path_affinity_names','__path_srlgs_lists','__path_srlgs_names','__disjointness',) + + _yang_name = 'path-constraints' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__te_bandwidth = YANGDynClass(base=te_bandwidth.te_bandwidth, is_container='container', yang_name="te-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__link_protection = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'link-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-shared': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-shared': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-shared': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-enhanced': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-enhanced': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-enhanced': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), default=six.text_type("te-types:link-protection-unprotected"), is_leaf=True, yang_name="link-protection", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + self.__setup_priority = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..7']}), default=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8)(7), is_leaf=True, yang_name="setup-priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint8', is_config=True) + self.__hold_priority = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..7']}), default=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8)(7), is_leaf=True, yang_name="hold-priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint8', is_config=True) + self.__signaling_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'path-setup-static': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-setup-static': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-setup-static': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-setup-rsvp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-setup-rsvp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-setup-rsvp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-setup-sr': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-setup-sr': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-setup-sr': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), default=six.text_type("te-types:path-setup-rsvp"), is_leaf=True, yang_name="signaling-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + self.__path_metric_bounds = YANGDynClass(base=path_metric_bounds.path_metric_bounds, is_container='container', yang_name="path-metric-bounds", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__path_affinities_values = YANGDynClass(base=path_affinities_values.path_affinities_values, is_container='container', yang_name="path-affinities-values", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__path_affinity_names = YANGDynClass(base=path_affinity_names.path_affinity_names, is_container='container', yang_name="path-affinity-names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__path_srlgs_lists = YANGDynClass(base=path_srlgs_lists.path_srlgs_lists, is_container='container', yang_name="path-srlgs-lists", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__path_srlgs_names = YANGDynClass(base=path_srlgs_names.path_srlgs_names, is_container='container', yang_name="path-srlgs-names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__disjointness = YANGDynClass(base=YANGBitsType(allowed_bits={'node': '0', 'link': '1', 'srlg': '2'}), is_leaf=True, yang_name="disjointness", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-path-disjointness', 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 ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'path-constraints'] + + def _get_te_bandwidth(self): + """ + Getter method for te_bandwidth, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/te_bandwidth (container) + + YANG Description: Container that specifies TE bandwidth. The choices +can be augmented for specific data-plane technologies. + """ + return self.__te_bandwidth + + def _set_te_bandwidth(self, v, load=False): + """ + Setter method for te_bandwidth, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/te_bandwidth (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_te_bandwidth is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_te_bandwidth() directly. + + YANG Description: Container that specifies TE bandwidth. The choices +can be augmented for specific data-plane technologies. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=te_bandwidth.te_bandwidth, is_container='container', yang_name="te-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """te_bandwidth must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=te_bandwidth.te_bandwidth, is_container='container', yang_name="te-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__te_bandwidth = t + if hasattr(self, '_set'): + self._set() + + def _unset_te_bandwidth(self): + self.__te_bandwidth = YANGDynClass(base=te_bandwidth.te_bandwidth, is_container='container', yang_name="te-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_link_protection(self): + """ + Getter method for link_protection, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/link_protection (identityref) + + YANG Description: Link protection type required for the links included +in the computed path. + """ + return self.__link_protection + + def _set_link_protection(self, v, load=False): + """ + Setter method for link_protection, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/link_protection (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_link_protection is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_link_protection() directly. + + YANG Description: Link protection type required for the links included +in the computed path. + """ + 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={'link-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-shared': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-shared': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-shared': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-enhanced': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-enhanced': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-enhanced': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), default=six.text_type("te-types:link-protection-unprotected"), is_leaf=True, yang_name="link-protection", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """link_protection must be of a type compatible with identityref""", + 'defined-type': "ietf-te-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'link-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-shared': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-shared': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-shared': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-enhanced': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-enhanced': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-enhanced': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), default=six.text_type("te-types:link-protection-unprotected"), is_leaf=True, yang_name="link-protection", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True)""", + }) + + self.__link_protection = t + if hasattr(self, '_set'): + self._set() + + def _unset_link_protection(self): + self.__link_protection = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'link-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-shared': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-shared': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-shared': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-enhanced': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-enhanced': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-enhanced': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), default=six.text_type("te-types:link-protection-unprotected"), is_leaf=True, yang_name="link-protection", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + + + def _get_setup_priority(self): + """ + Getter method for setup_priority, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/setup_priority (uint8) + + YANG Description: TE LSP requested setup priority. + """ + return self.__setup_priority + + def _set_setup_priority(self, v, load=False): + """ + Setter method for setup_priority, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/setup_priority (uint8) + If this variable is read-only (config: false) in the + source YANG file, then _set_setup_priority is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_setup_priority() directly. + + YANG Description: TE LSP requested setup priority. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..7']}), default=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8)(7), is_leaf=True, yang_name="setup-priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint8', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """setup_priority must be of a type compatible with uint8""", + 'defined-type': "uint8", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..7']}), default=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8)(7), is_leaf=True, yang_name="setup-priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint8', is_config=True)""", + }) + + self.__setup_priority = t + if hasattr(self, '_set'): + self._set() + + def _unset_setup_priority(self): + self.__setup_priority = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..7']}), default=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8)(7), is_leaf=True, yang_name="setup-priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint8', is_config=True) + + + def _get_hold_priority(self): + """ + Getter method for hold_priority, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/hold_priority (uint8) + + YANG Description: TE LSP requested hold priority. + """ + return self.__hold_priority + + def _set_hold_priority(self, v, load=False): + """ + Setter method for hold_priority, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/hold_priority (uint8) + If this variable is read-only (config: false) in the + source YANG file, then _set_hold_priority is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hold_priority() directly. + + YANG Description: TE LSP requested hold priority. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..7']}), default=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8)(7), is_leaf=True, yang_name="hold-priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint8', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hold_priority must be of a type compatible with uint8""", + 'defined-type': "uint8", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..7']}), default=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8)(7), is_leaf=True, yang_name="hold-priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint8', is_config=True)""", + }) + + self.__hold_priority = t + if hasattr(self, '_set'): + self._set() + + def _unset_hold_priority(self): + self.__hold_priority = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..7']}), default=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8)(7), is_leaf=True, yang_name="hold-priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint8', is_config=True) + + + def _get_signaling_type(self): + """ + Getter method for signaling_type, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/signaling_type (identityref) + + YANG Description: TE tunnel path signaling type. + """ + return self.__signaling_type + + def _set_signaling_type(self, v, load=False): + """ + Setter method for signaling_type, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/signaling_type (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_signaling_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_signaling_type() directly. + + YANG Description: TE tunnel path signaling type. + """ + 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={'path-setup-static': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-setup-static': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-setup-static': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-setup-rsvp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-setup-rsvp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-setup-rsvp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-setup-sr': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-setup-sr': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-setup-sr': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), default=six.text_type("te-types:path-setup-rsvp"), is_leaf=True, yang_name="signaling-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """signaling_type must be of a type compatible with identityref""", + 'defined-type': "ietf-te-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'path-setup-static': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-setup-static': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-setup-static': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-setup-rsvp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-setup-rsvp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-setup-rsvp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-setup-sr': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-setup-sr': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-setup-sr': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), default=six.text_type("te-types:path-setup-rsvp"), is_leaf=True, yang_name="signaling-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True)""", + }) + + self.__signaling_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_signaling_type(self): + self.__signaling_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'path-setup-static': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-setup-static': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-setup-static': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-setup-rsvp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-setup-rsvp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-setup-rsvp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-setup-sr': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-setup-sr': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-setup-sr': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), default=six.text_type("te-types:path-setup-rsvp"), is_leaf=True, yang_name="signaling-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + + + def _get_path_metric_bounds(self): + """ + Getter method for path_metric_bounds, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/path_metric_bounds (container) + + YANG Description: TE path metric bounds container. + """ + return self.__path_metric_bounds + + def _set_path_metric_bounds(self, v, load=False): + """ + Setter method for path_metric_bounds, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/path_metric_bounds (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_metric_bounds is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_metric_bounds() directly. + + YANG Description: TE path metric bounds container. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=path_metric_bounds.path_metric_bounds, is_container='container', yang_name="path-metric-bounds", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_metric_bounds must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=path_metric_bounds.path_metric_bounds, is_container='container', yang_name="path-metric-bounds", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__path_metric_bounds = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_metric_bounds(self): + self.__path_metric_bounds = YANGDynClass(base=path_metric_bounds.path_metric_bounds, is_container='container', yang_name="path-metric-bounds", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_path_affinities_values(self): + """ + Getter method for path_affinities_values, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/path_affinities_values (container) + + YANG Description: Path affinities represented as values. + """ + return self.__path_affinities_values + + def _set_path_affinities_values(self, v, load=False): + """ + Setter method for path_affinities_values, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/path_affinities_values (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_affinities_values is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_affinities_values() directly. + + YANG Description: Path affinities represented as values. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=path_affinities_values.path_affinities_values, is_container='container', yang_name="path-affinities-values", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_affinities_values must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=path_affinities_values.path_affinities_values, is_container='container', yang_name="path-affinities-values", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__path_affinities_values = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_affinities_values(self): + self.__path_affinities_values = YANGDynClass(base=path_affinities_values.path_affinities_values, is_container='container', yang_name="path-affinities-values", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_path_affinity_names(self): + """ + Getter method for path_affinity_names, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/path_affinity_names (container) + + YANG Description: Path affinities represented as names. + """ + return self.__path_affinity_names + + def _set_path_affinity_names(self, v, load=False): + """ + Setter method for path_affinity_names, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/path_affinity_names (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_affinity_names is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_affinity_names() directly. + + YANG Description: Path affinities represented as names. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=path_affinity_names.path_affinity_names, is_container='container', yang_name="path-affinity-names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_affinity_names must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=path_affinity_names.path_affinity_names, is_container='container', yang_name="path-affinity-names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__path_affinity_names = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_affinity_names(self): + self.__path_affinity_names = YANGDynClass(base=path_affinity_names.path_affinity_names, is_container='container', yang_name="path-affinity-names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_path_srlgs_lists(self): + """ + Getter method for path_srlgs_lists, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/path_srlgs_lists (container) + + YANG Description: Path SRLG properties container. + """ + return self.__path_srlgs_lists + + def _set_path_srlgs_lists(self, v, load=False): + """ + Setter method for path_srlgs_lists, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/path_srlgs_lists (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_srlgs_lists is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_srlgs_lists() directly. + + YANG Description: Path SRLG properties container. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=path_srlgs_lists.path_srlgs_lists, is_container='container', yang_name="path-srlgs-lists", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_srlgs_lists must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=path_srlgs_lists.path_srlgs_lists, is_container='container', yang_name="path-srlgs-lists", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__path_srlgs_lists = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_srlgs_lists(self): + self.__path_srlgs_lists = YANGDynClass(base=path_srlgs_lists.path_srlgs_lists, is_container='container', yang_name="path-srlgs-lists", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_path_srlgs_names(self): + """ + Getter method for path_srlgs_names, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/path_srlgs_names (container) + + YANG Description: Container for the list of named SRLGs. + """ + return self.__path_srlgs_names + + def _set_path_srlgs_names(self, v, load=False): + """ + Setter method for path_srlgs_names, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/path_srlgs_names (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_srlgs_names is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_srlgs_names() directly. + + YANG Description: Container for the list of named SRLGs. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=path_srlgs_names.path_srlgs_names, is_container='container', yang_name="path-srlgs-names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_srlgs_names must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=path_srlgs_names.path_srlgs_names, is_container='container', yang_name="path-srlgs-names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__path_srlgs_names = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_srlgs_names(self): + self.__path_srlgs_names = YANGDynClass(base=path_srlgs_names.path_srlgs_names, is_container='container', yang_name="path-srlgs-names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_disjointness(self): + """ + Getter method for disjointness, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/disjointness (te-path-disjointness) + + YANG Description: The type of resource disjointness. +When configured for a primary path, the disjointness level +applies to all secondary LSPs. When configured for a +secondary path, the disjointness level overrides the level +configured for the primary path. + """ + return self.__disjointness + + def _set_disjointness(self, v, load=False): + """ + Setter method for disjointness, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/disjointness (te-path-disjointness) + If this variable is read-only (config: false) in the + source YANG file, then _set_disjointness is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_disjointness() directly. + + YANG Description: The type of resource disjointness. +When configured for a primary path, the disjointness level +applies to all secondary LSPs. When configured for a +secondary path, the disjointness level overrides the level +configured for the primary path. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBitsType(allowed_bits={'node': '0', 'link': '1', 'srlg': '2'}), is_leaf=True, yang_name="disjointness", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-path-disjointness', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """disjointness must be of a type compatible with te-path-disjointness""", + 'defined-type': "ietf-te-topology:te-path-disjointness", + 'generated-type': """YANGDynClass(base=YANGBitsType(allowed_bits={'node': '0', 'link': '1', 'srlg': '2'}), is_leaf=True, yang_name="disjointness", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-path-disjointness', is_config=True)""", + }) + + self.__disjointness = t + if hasattr(self, '_set'): + self._set() + + def _unset_disjointness(self): + self.__disjointness = YANGDynClass(base=YANGBitsType(allowed_bits={'node': '0', 'link': '1', 'srlg': '2'}), is_leaf=True, yang_name="disjointness", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-path-disjointness', is_config=True) + + te_bandwidth = __builtin__.property(_get_te_bandwidth, _set_te_bandwidth) + link_protection = __builtin__.property(_get_link_protection, _set_link_protection) + setup_priority = __builtin__.property(_get_setup_priority, _set_setup_priority) + hold_priority = __builtin__.property(_get_hold_priority, _set_hold_priority) + signaling_type = __builtin__.property(_get_signaling_type, _set_signaling_type) + path_metric_bounds = __builtin__.property(_get_path_metric_bounds, _set_path_metric_bounds) + path_affinities_values = __builtin__.property(_get_path_affinities_values, _set_path_affinities_values) + path_affinity_names = __builtin__.property(_get_path_affinity_names, _set_path_affinity_names) + path_srlgs_lists = __builtin__.property(_get_path_srlgs_lists, _set_path_srlgs_lists) + path_srlgs_names = __builtin__.property(_get_path_srlgs_names, _set_path_srlgs_names) + disjointness = __builtin__.property(_get_disjointness, _set_disjointness) + + + _pyangbind_elements = OrderedDict([('te_bandwidth', te_bandwidth), ('link_protection', link_protection), ('setup_priority', setup_priority), ('hold_priority', hold_priority), ('signaling_type', signaling_type), ('path_metric_bounds', path_metric_bounds), ('path_affinities_values', path_affinities_values), ('path_affinity_names', path_affinity_names), ('path_srlgs_lists', path_srlgs_lists), ('path_srlgs_names', path_srlgs_names), ('disjointness', disjointness), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/path_affinities_values/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/path_affinities_values/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..b04586e5a02caa02cdba4ade49800cd965d3ef7e --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/path_affinities_values/__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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 path_affinities_value +class path_affinities_values(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/path-constraints/path-affinities-values. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Path affinities represented as values. + """ + __slots__ = ('_path_helper', '_extmethods', '__path_affinities_value',) + + _yang_name = 'path-affinities-values' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__path_affinities_value = YANGDynClass(base=YANGListType("usage",path_affinities_value.path_affinities_value, yang_name="path-affinities-value", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-affinities-value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-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 ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'path-constraints', 'path-affinities-values'] + + def _get_path_affinities_value(self): + """ + Getter method for path_affinities_value, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/path_affinities_values/path_affinities_value (list) + + YANG Description: List of named affinity constraints. + """ + return self.__path_affinities_value + + def _set_path_affinities_value(self, v, load=False): + """ + Setter method for path_affinities_value, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/path_affinities_values/path_affinities_value (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_affinities_value is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_affinities_value() directly. + + YANG Description: List of named affinity constraints. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("usage",path_affinities_value.path_affinities_value, yang_name="path-affinities-value", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-affinities-value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_affinities_value must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("usage",path_affinities_value.path_affinities_value, yang_name="path-affinities-value", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-affinities-value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True)""", + }) + + self.__path_affinities_value = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_affinities_value(self): + self.__path_affinities_value = YANGDynClass(base=YANGListType("usage",path_affinities_value.path_affinities_value, yang_name="path-affinities-value", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-affinities-value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + + path_affinities_value = __builtin__.property(_get_path_affinities_value, _set_path_affinities_value) + + + _pyangbind_elements = OrderedDict([('path_affinities_value', path_affinities_value), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/path_affinities_values/path_affinities_value/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/path_affinities_values/path_affinities_value/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..d4347e12ea53c9cefb7bccada9082f10a464b6b0 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/path_affinities_values/path_affinities_value/__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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 path_affinities_value(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/path-constraints/path-affinities-values/path-affinities-value. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: List of named affinity constraints. + """ + __slots__ = ('_path_helper', '_extmethods', '__usage','__value',) + + _yang_name = 'path-affinities-value' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__usage = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + self.__value = YANGDynClass(base=[RestrictedClassType(base_type=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}), restriction_dict={'length': ['1..11']}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}),], default=six.text_type(""), is_leaf=True, yang_name="value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='admin-groups', 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 ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'path-constraints', 'path-affinities-values', 'path-affinities-value'] + + def _get_usage(self): + """ + Getter method for usage, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/path_affinities_values/path_affinities_value/usage (identityref) + + YANG Description: Identifies an entry in the list of value affinity +constraints. + """ + return self.__usage + + def _set_usage(self, v, load=False): + """ + Setter method for usage, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/path_affinities_values/path_affinities_value/usage (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_usage is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_usage() directly. + + YANG Description: Identifies an entry in the list of value affinity +constraints. + """ + 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=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """usage must be of a type compatible with identityref""", + 'defined-type': "ietf-te-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True)""", + }) + + self.__usage = t + if hasattr(self, '_set'): + self._set() + + def _unset_usage(self): + self.__usage = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + + + def _get_value(self): + """ + Getter method for value, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/path_affinities_values/path_affinities_value/value (admin-groups) + + YANG Description: The affinity value. The default is empty. + """ + return self.__value + + def _set_value(self, v, load=False): + """ + Setter method for value, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/path_affinities_values/path_affinities_value/value (admin-groups) + 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: The affinity value. The default is empty. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=[RestrictedClassType(base_type=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}), restriction_dict={'length': ['1..11']}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}),], default=six.text_type(""), is_leaf=True, yang_name="value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='admin-groups', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """value must be of a type compatible with admin-groups""", + 'defined-type': "ietf-te-topology:admin-groups", + 'generated-type': """YANGDynClass(base=[RestrictedClassType(base_type=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}), restriction_dict={'length': ['1..11']}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}),], default=six.text_type(""), is_leaf=True, yang_name="value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='admin-groups', is_config=True)""", + }) + + self.__value = t + if hasattr(self, '_set'): + self._set() + + def _unset_value(self): + self.__value = YANGDynClass(base=[RestrictedClassType(base_type=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}), restriction_dict={'length': ['1..11']}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}),], default=six.text_type(""), is_leaf=True, yang_name="value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='admin-groups', is_config=True) + + usage = __builtin__.property(_get_usage, _set_usage) + value = __builtin__.property(_get_value, _set_value) + + + _pyangbind_elements = OrderedDict([('usage', usage), ('value', value), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/path_affinity_names/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/path_affinity_names/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..d9511703bf8e9694635ac3c13504148fb1ad95b6 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/path_affinity_names/__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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 path_affinity_name +class path_affinity_names(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/path-constraints/path-affinity-names. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Path affinities represented as names. + """ + __slots__ = ('_path_helper', '_extmethods', '__path_affinity_name',) + + _yang_name = 'path-affinity-names' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__path_affinity_name = YANGDynClass(base=YANGListType("usage",path_affinity_name.path_affinity_name, yang_name="path-affinity-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-affinity-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-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 ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'path-constraints', 'path-affinity-names'] + + def _get_path_affinity_name(self): + """ + Getter method for path_affinity_name, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/path_affinity_names/path_affinity_name (list) + + YANG Description: List of named affinity constraints. + """ + return self.__path_affinity_name + + def _set_path_affinity_name(self, v, load=False): + """ + Setter method for path_affinity_name, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/path_affinity_names/path_affinity_name (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_affinity_name is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_affinity_name() directly. + + YANG Description: List of named affinity constraints. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("usage",path_affinity_name.path_affinity_name, yang_name="path-affinity-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-affinity-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_affinity_name must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("usage",path_affinity_name.path_affinity_name, yang_name="path-affinity-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-affinity-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True)""", + }) + + self.__path_affinity_name = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_affinity_name(self): + self.__path_affinity_name = YANGDynClass(base=YANGListType("usage",path_affinity_name.path_affinity_name, yang_name="path-affinity-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-affinity-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + + path_affinity_name = __builtin__.property(_get_path_affinity_name, _set_path_affinity_name) + + + _pyangbind_elements = OrderedDict([('path_affinity_name', path_affinity_name), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/path_affinity_names/path_affinity_name/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/path_affinity_names/path_affinity_name/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..5bea16d3c52a67c620abb434d7df593984786f32 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/path_affinity_names/path_affinity_name/__init__.py @@ -0,0 +1,162 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 affinity_name +class path_affinity_name(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/path-constraints/path-affinity-names/path-affinity-name. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: List of named affinity constraints. + """ + __slots__ = ('_path_helper', '_extmethods', '__usage','__affinity_name',) + + _yang_name = 'path-affinity-name' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__usage = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + self.__affinity_name = YANGDynClass(base=YANGListType("name",affinity_name.affinity_name, yang_name="affinity-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='name', extensions=None), is_container='list', yang_name="affinity-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-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 ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'path-constraints', 'path-affinity-names', 'path-affinity-name'] + + def _get_usage(self): + """ + Getter method for usage, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/path_affinity_names/path_affinity_name/usage (identityref) + + YANG Description: Identifies an entry in the list of named affinity +constraints. + """ + return self.__usage + + def _set_usage(self, v, load=False): + """ + Setter method for usage, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/path_affinity_names/path_affinity_name/usage (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_usage is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_usage() directly. + + YANG Description: Identifies an entry in the list of named affinity +constraints. + """ + 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=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """usage must be of a type compatible with identityref""", + 'defined-type': "ietf-te-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True)""", + }) + + self.__usage = t + if hasattr(self, '_set'): + self._set() + + def _unset_usage(self): + self.__usage = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + + + def _get_affinity_name(self): + """ + Getter method for affinity_name, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/path_affinity_names/path_affinity_name/affinity_name (list) + + YANG Description: List of named affinities. + """ + return self.__affinity_name + + def _set_affinity_name(self, v, load=False): + """ + Setter method for affinity_name, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/path_affinity_names/path_affinity_name/affinity_name (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_affinity_name is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_affinity_name() directly. + + YANG Description: List of named affinities. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("name",affinity_name.affinity_name, yang_name="affinity-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='name', extensions=None), is_container='list', yang_name="affinity-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """affinity_name must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("name",affinity_name.affinity_name, yang_name="affinity-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='name', extensions=None), is_container='list', yang_name="affinity-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True)""", + }) + + self.__affinity_name = t + if hasattr(self, '_set'): + self._set() + + def _unset_affinity_name(self): + self.__affinity_name = YANGDynClass(base=YANGListType("name",affinity_name.affinity_name, yang_name="affinity-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='name', extensions=None), is_container='list', yang_name="affinity-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + + usage = __builtin__.property(_get_usage, _set_usage) + affinity_name = __builtin__.property(_get_affinity_name, _set_affinity_name) + + + _pyangbind_elements = OrderedDict([('usage', usage), ('affinity_name', affinity_name), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/path_affinity_names/path_affinity_name/affinity_name/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/path_affinity_names/path_affinity_name/affinity_name/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..27b87f524fe2cdfe1696f7320ede4b3f1e92cb83 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/path_affinity_names/path_affinity_name/affinity_name/__init__.py @@ -0,0 +1,120 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 affinity_name(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/path-constraints/path-affinity-names/path-affinity-name/affinity-name. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: List of named affinities. + """ + __slots__ = ('_path_helper', '_extmethods', '__name',) + + _yang_name = 'affinity-name' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _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='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-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 ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'path-constraints', 'path-affinity-names', 'path-affinity-name', 'affinity-name'] + + def _get_name(self): + """ + Getter method for name, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/path_affinity_names/path_affinity_name/affinity_name/name (string) + + YANG Description: Identifies a named affinity entry. + """ + return self.__name + + def _set_name(self, v, load=False): + """ + Setter method for name, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/path_affinity_names/path_affinity_name/affinity_name/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: Identifies a named affinity entry. + """ + 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='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', 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, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', 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, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=True) + + name = __builtin__.property(_get_name, _set_name) + + + _pyangbind_elements = OrderedDict([('name', name), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/path_metric_bounds/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/path_metric_bounds/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..89e9dcde547360b821a9c8c5ee4660edbc4b6c5d --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/path_metric_bounds/__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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 path_metric_bound +class path_metric_bounds(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/path-constraints/path-metric-bounds. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: TE path metric bounds container. + """ + __slots__ = ('_path_helper', '_extmethods', '__path_metric_bound',) + + _yang_name = 'path-metric-bounds' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__path_metric_bound = YANGDynClass(base=YANGListType("metric_type",path_metric_bound.path_metric_bound, yang_name="path-metric-bound", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='metric-type', extensions=None), is_container='list', yang_name="path-metric-bound", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-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 ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'path-constraints', 'path-metric-bounds'] + + def _get_path_metric_bound(self): + """ + Getter method for path_metric_bound, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/path_metric_bounds/path_metric_bound (list) + + YANG Description: List of TE path metric bounds. + """ + return self.__path_metric_bound + + def _set_path_metric_bound(self, v, load=False): + """ + Setter method for path_metric_bound, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/path_metric_bounds/path_metric_bound (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_metric_bound is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_metric_bound() directly. + + YANG Description: List of TE path metric bounds. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("metric_type",path_metric_bound.path_metric_bound, yang_name="path-metric-bound", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='metric-type', extensions=None), is_container='list', yang_name="path-metric-bound", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_metric_bound must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("metric_type",path_metric_bound.path_metric_bound, yang_name="path-metric-bound", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='metric-type', extensions=None), is_container='list', yang_name="path-metric-bound", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True)""", + }) + + self.__path_metric_bound = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_metric_bound(self): + self.__path_metric_bound = YANGDynClass(base=YANGListType("metric_type",path_metric_bound.path_metric_bound, yang_name="path-metric-bound", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='metric-type', extensions=None), is_container='list', yang_name="path-metric-bound", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + + path_metric_bound = __builtin__.property(_get_path_metric_bound, _set_path_metric_bound) + + + _pyangbind_elements = OrderedDict([('path_metric_bound', path_metric_bound), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/path_metric_bounds/path_metric_bound/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/path_metric_bounds/path_metric_bound/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..9e967408a9a763bc5ade1f35fb1b05d53a24dcdd --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/path_metric_bounds/path_metric_bound/__init__.py @@ -0,0 +1,165 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 path_metric_bound(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/path-constraints/path-metric-bounds/path-metric-bound. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: List of TE path metric bounds. + """ + __slots__ = ('_path_helper', '_extmethods', '__metric_type','__upper_bound',) + + _yang_name = 'path-metric-bound' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__metric_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="metric-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + self.__upper_bound = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), default=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64)(0), is_leaf=True, yang_name="upper-bound", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint64', 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 ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'path-constraints', 'path-metric-bounds', 'path-metric-bound'] + + def _get_metric_type(self): + """ + Getter method for metric_type, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/path_metric_bounds/path_metric_bound/metric_type (identityref) + + YANG Description: Identifies an entry in the list of 'metric-type' items +bound for the TE path. + """ + return self.__metric_type + + def _set_metric_type(self, v, load=False): + """ + Setter method for metric_type, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/path_metric_bounds/path_metric_bound/metric_type (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_metric_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_metric_type() directly. + + YANG Description: Identifies an entry in the list of 'metric-type' items +bound for the TE path. + """ + 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=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="metric-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """metric_type must be of a type compatible with identityref""", + 'defined-type': "ietf-te-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="metric-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True)""", + }) + + self.__metric_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_metric_type(self): + self.__metric_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="metric-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + + + def _get_upper_bound(self): + """ + Getter method for upper_bound, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/path_metric_bounds/path_metric_bound/upper_bound (uint64) + + YANG Description: Upper bound on the end-to-end TE path metric. A zero +indicates an unbounded upper limit for the specific +'metric-type'. + """ + return self.__upper_bound + + def _set_upper_bound(self, v, load=False): + """ + Setter method for upper_bound, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/path_metric_bounds/path_metric_bound/upper_bound (uint64) + If this variable is read-only (config: false) in the + source YANG file, then _set_upper_bound is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_upper_bound() directly. + + YANG Description: Upper bound on the end-to-end TE path metric. A zero +indicates an unbounded upper limit for the specific +'metric-type'. + """ + 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), default=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64)(0), is_leaf=True, yang_name="upper-bound", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint64', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """upper_bound 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), default=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64)(0), is_leaf=True, yang_name="upper-bound", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint64', is_config=True)""", + }) + + self.__upper_bound = t + if hasattr(self, '_set'): + self._set() + + def _unset_upper_bound(self): + self.__upper_bound = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), default=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64)(0), is_leaf=True, yang_name="upper-bound", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint64', is_config=True) + + metric_type = __builtin__.property(_get_metric_type, _set_metric_type) + upper_bound = __builtin__.property(_get_upper_bound, _set_upper_bound) + + + _pyangbind_elements = OrderedDict([('metric_type', metric_type), ('upper_bound', upper_bound), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/path_srlgs_lists/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/path_srlgs_lists/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..4a3633c2824838a95ae720bd56f086266676db6c --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/path_srlgs_lists/__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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 path_srlgs_list +class path_srlgs_lists(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/path-constraints/path-srlgs-lists. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Path SRLG properties container. + """ + __slots__ = ('_path_helper', '_extmethods', '__path_srlgs_list',) + + _yang_name = 'path-srlgs-lists' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__path_srlgs_list = YANGDynClass(base=YANGListType("usage",path_srlgs_list.path_srlgs_list, yang_name="path-srlgs-list", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-srlgs-list", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-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 ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'path-constraints', 'path-srlgs-lists'] + + def _get_path_srlgs_list(self): + """ + Getter method for path_srlgs_list, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/path_srlgs_lists/path_srlgs_list (list) + + YANG Description: List of SRLG values to be included or excluded. + """ + return self.__path_srlgs_list + + def _set_path_srlgs_list(self, v, load=False): + """ + Setter method for path_srlgs_list, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/path_srlgs_lists/path_srlgs_list (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_srlgs_list is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_srlgs_list() directly. + + YANG Description: List of SRLG values to be included or excluded. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("usage",path_srlgs_list.path_srlgs_list, yang_name="path-srlgs-list", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-srlgs-list", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_srlgs_list must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("usage",path_srlgs_list.path_srlgs_list, yang_name="path-srlgs-list", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-srlgs-list", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True)""", + }) + + self.__path_srlgs_list = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_srlgs_list(self): + self.__path_srlgs_list = YANGDynClass(base=YANGListType("usage",path_srlgs_list.path_srlgs_list, yang_name="path-srlgs-list", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-srlgs-list", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + + path_srlgs_list = __builtin__.property(_get_path_srlgs_list, _set_path_srlgs_list) + + + _pyangbind_elements = OrderedDict([('path_srlgs_list', path_srlgs_list), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/path_srlgs_lists/path_srlgs_list/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/path_srlgs_lists/path_srlgs_list/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..25eecfaa4a3db913d594884ad74d7f7eecb8a36e --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/path_srlgs_lists/path_srlgs_list/__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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 path_srlgs_list(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/path-constraints/path-srlgs-lists/path-srlgs-list. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: List of SRLG values to be included or excluded. + """ + __slots__ = ('_path_helper', '_extmethods', '__usage','__values',) + + _yang_name = 'path-srlgs-list' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__usage = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + self.__values = YANGDynClass(unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32)), is_leaf=False, yang_name="values", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='srlg', 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 ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'path-constraints', 'path-srlgs-lists', 'path-srlgs-list'] + + def _get_usage(self): + """ + Getter method for usage, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/path_srlgs_lists/path_srlgs_list/usage (identityref) + + YANG Description: Identifies an entry in a list of SRLGs to either +include or exclude. + """ + return self.__usage + + def _set_usage(self, v, load=False): + """ + Setter method for usage, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/path_srlgs_lists/path_srlgs_list/usage (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_usage is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_usage() directly. + + YANG Description: Identifies an entry in a list of SRLGs to either +include or exclude. + """ + 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=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """usage must be of a type compatible with identityref""", + 'defined-type': "ietf-te-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True)""", + }) + + self.__usage = t + if hasattr(self, '_set'): + self._set() + + def _unset_usage(self): + self.__usage = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + + + def _get_values(self): + """ + Getter method for values, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/path_srlgs_lists/path_srlgs_list/values (srlg) + + YANG Description: List of SRLG values. + """ + return self.__values + + def _set_values(self, v, load=False): + """ + Setter method for values, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/path_srlgs_lists/path_srlgs_list/values (srlg) + If this variable is read-only (config: false) in the + source YANG file, then _set_values is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_values() directly. + + YANG Description: List of SRLG values. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32)), is_leaf=False, yang_name="values", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='srlg', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """values must be of a type compatible with srlg""", + 'defined-type': "ietf-te-topology:srlg", + 'generated-type': """YANGDynClass(unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32)), is_leaf=False, yang_name="values", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='srlg', is_config=True)""", + }) + + self.__values = t + if hasattr(self, '_set'): + self._set() + + def _unset_values(self): + self.__values = YANGDynClass(unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32)), is_leaf=False, yang_name="values", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='srlg', is_config=True) + + usage = __builtin__.property(_get_usage, _set_usage) + values = __builtin__.property(_get_values, _set_values) + + + _pyangbind_elements = OrderedDict([('usage', usage), ('values', values), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/path_srlgs_names/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/path_srlgs_names/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..d26858176b971d3c4f3239a8d8bc6292ee672870 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/path_srlgs_names/__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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 path_srlgs_name +class path_srlgs_names(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/path-constraints/path-srlgs-names. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Container for the list of named SRLGs. + """ + __slots__ = ('_path_helper', '_extmethods', '__path_srlgs_name',) + + _yang_name = 'path-srlgs-names' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__path_srlgs_name = YANGDynClass(base=YANGListType("usage",path_srlgs_name.path_srlgs_name, yang_name="path-srlgs-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-srlgs-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-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 ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'path-constraints', 'path-srlgs-names'] + + def _get_path_srlgs_name(self): + """ + Getter method for path_srlgs_name, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/path_srlgs_names/path_srlgs_name (list) + + YANG Description: List of named SRLGs to be included or excluded. + """ + return self.__path_srlgs_name + + def _set_path_srlgs_name(self, v, load=False): + """ + Setter method for path_srlgs_name, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/path_srlgs_names/path_srlgs_name (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_srlgs_name is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_srlgs_name() directly. + + YANG Description: List of named SRLGs to be included or excluded. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("usage",path_srlgs_name.path_srlgs_name, yang_name="path-srlgs-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-srlgs-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_srlgs_name must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("usage",path_srlgs_name.path_srlgs_name, yang_name="path-srlgs-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-srlgs-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True)""", + }) + + self.__path_srlgs_name = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_srlgs_name(self): + self.__path_srlgs_name = YANGDynClass(base=YANGListType("usage",path_srlgs_name.path_srlgs_name, yang_name="path-srlgs-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-srlgs-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + + path_srlgs_name = __builtin__.property(_get_path_srlgs_name, _set_path_srlgs_name) + + + _pyangbind_elements = OrderedDict([('path_srlgs_name', path_srlgs_name), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/path_srlgs_names/path_srlgs_name/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/path_srlgs_names/path_srlgs_name/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..305a401ae4c6bb90679de7e8a1624af89343e824 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/path_srlgs_names/path_srlgs_name/__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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 path_srlgs_name(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/path-constraints/path-srlgs-names/path-srlgs-name. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: List of named SRLGs to be included or excluded. + """ + __slots__ = ('_path_helper', '_extmethods', '__usage','__names',) + + _yang_name = 'path-srlgs-name' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__usage = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + self.__names = YANGDynClass(unique=True, base=TypedListType(allowed_type=six.text_type), is_leaf=False, yang_name="names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-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 ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'path-constraints', 'path-srlgs-names', 'path-srlgs-name'] + + def _get_usage(self): + """ + Getter method for usage, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/path_srlgs_names/path_srlgs_name/usage (identityref) + + YANG Description: Identifies an entry in a list of named SRLGs to either +include or exclude. + """ + return self.__usage + + def _set_usage(self, v, load=False): + """ + Setter method for usage, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/path_srlgs_names/path_srlgs_name/usage (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_usage is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_usage() directly. + + YANG Description: Identifies an entry in a list of named SRLGs to either +include or exclude. + """ + 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=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """usage must be of a type compatible with identityref""", + 'defined-type': "ietf-te-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True)""", + }) + + self.__usage = t + if hasattr(self, '_set'): + self._set() + + def _unset_usage(self): + self.__usage = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + + + def _get_names(self): + """ + Getter method for names, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/path_srlgs_names/path_srlgs_name/names (string) + + YANG Description: List of named SRLGs. + """ + return self.__names + + def _set_names(self, v, load=False): + """ + Setter method for names, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/path_srlgs_names/path_srlgs_name/names (string) + If this variable is read-only (config: false) in the + source YANG file, then _set_names is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_names() directly. + + YANG Description: List of named SRLGs. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,unique=True, base=TypedListType(allowed_type=six.text_type), is_leaf=False, yang_name="names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """names must be of a type compatible with string""", + 'defined-type': "string", + 'generated-type': """YANGDynClass(unique=True, base=TypedListType(allowed_type=six.text_type), is_leaf=False, yang_name="names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=True)""", + }) + + self.__names = t + if hasattr(self, '_set'): + self._set() + + def _unset_names(self): + self.__names = YANGDynClass(unique=True, base=TypedListType(allowed_type=six.text_type), is_leaf=False, yang_name="names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=True) + + usage = __builtin__.property(_get_usage, _set_usage) + names = __builtin__.property(_get_names, _set_names) + + + _pyangbind_elements = OrderedDict([('usage', usage), ('names', names), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/te_bandwidth/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/te_bandwidth/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..040c69e2f13a047ab67829c3afbc07d100255f40 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/te_bandwidth/__init__.py @@ -0,0 +1,195 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 otn +class te_bandwidth(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/path-constraints/te-bandwidth. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Container that specifies TE bandwidth. The choices +can be augmented for specific data-plane technologies. + """ + __slots__ = ('_path_helper', '_extmethods', '__generic','__otn','__eth_bandwidth',) + + _yang_name = 'te-bandwidth' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__generic = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+(,(0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+))*'}), is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-bandwidth', is_config=True) + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + self.__eth_bandwidth = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), restriction_dict={'range': ['0..10000000000']}), is_leaf=True, yang_name="eth-bandwidth", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint64', 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 ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'path-constraints', 'te-bandwidth'] + + def _get_generic(self): + """ + Getter method for generic, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/te_bandwidth/generic (te-bandwidth) + + YANG Description: Bandwidth specified in a generic format. + """ + return self.__generic + + def _set_generic(self, v, load=False): + """ + Setter method for generic, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/te_bandwidth/generic (te-bandwidth) + If this variable is read-only (config: false) in the + source YANG file, then _set_generic is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_generic() directly. + + YANG Description: Bandwidth specified in a generic format. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+(,(0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+))*'}), is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-bandwidth', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """generic must be of a type compatible with te-bandwidth""", + 'defined-type': "ietf-te-topology:te-bandwidth", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+(,(0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+))*'}), is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-bandwidth', is_config=True)""", + }) + + self.__generic = t + if hasattr(self, '_set'): + self._set() + + def _unset_generic(self): + self.__generic = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+(,(0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+))*'}), is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-bandwidth', is_config=True) + + + def _get_otn(self): + """ + Getter method for otn, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/te_bandwidth/otn (container) + + YANG Description: Bandwidth attributes for OTN links + """ + return self.__otn + + def _set_otn(self, v, load=False): + """ + Setter method for otn, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/te_bandwidth/otn (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_otn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_otn() directly. + + YANG Description: Bandwidth attributes for OTN links + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """otn must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True)""", + }) + + self.__otn = t + if hasattr(self, '_set'): + self._set() + + def _unset_otn(self): + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + + + def _get_eth_bandwidth(self): + """ + Getter method for eth_bandwidth, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/te_bandwidth/eth_bandwidth (uint64) + + YANG Description: Available bandwith value expressed in kilobits per second + """ + return self.__eth_bandwidth + + def _set_eth_bandwidth(self, v, load=False): + """ + Setter method for eth_bandwidth, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/te_bandwidth/eth_bandwidth (uint64) + If this variable is read-only (config: false) in the + source YANG file, then _set_eth_bandwidth is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_eth_bandwidth() directly. + + YANG Description: Available bandwith value expressed in kilobits per second + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), restriction_dict={'range': ['0..10000000000']}), is_leaf=True, yang_name="eth-bandwidth", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint64', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """eth_bandwidth must be of a type compatible with uint64""", + 'defined-type': "uint64", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), restriction_dict={'range': ['0..10000000000']}), is_leaf=True, yang_name="eth-bandwidth", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint64', is_config=True)""", + }) + + self.__eth_bandwidth = t + if hasattr(self, '_set'): + self._set() + + def _unset_eth_bandwidth(self): + self.__eth_bandwidth = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), restriction_dict={'range': ['0..10000000000']}), is_leaf=True, yang_name="eth-bandwidth", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint64', is_config=True) + + generic = __builtin__.property(_get_generic, _set_generic) + otn = __builtin__.property(_get_otn, _set_otn) + eth_bandwidth = __builtin__.property(_get_eth_bandwidth, _set_eth_bandwidth) + + __choices__ = {'technology': {'generic': ['generic'], 'otn': ['otn'], 'eth': ['eth_bandwidth']}} + _pyangbind_elements = OrderedDict([('generic', generic), ('otn', otn), ('eth_bandwidth', eth_bandwidth), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/te_bandwidth/otn/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/te_bandwidth/otn/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..a1d6ad9171b4add999a0140df250cb751b300b15 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/te_bandwidth/otn/__init__.py @@ -0,0 +1,163 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 odulist +class otn(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/path-constraints/te-bandwidth/otn. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Bandwidth attributes for OTN links + """ + __slots__ = ('_path_helper', '_extmethods', '__odulist','__odtu_flex_type',) + + _yang_name = 'otn' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__odulist = YANGDynClass(base=YANGListType("odu_type",odulist.odulist, yang_name="odulist", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='odu-type', extensions=None, choice=('technology', 'otn')), is_container='list', yang_name="odulist", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='list', is_config=True) + self.__odtu_flex_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'2': {}, '3': {}, '4': {}, 'Cn': {}},), is_leaf=True, yang_name="odtu-flex-type", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='l1-types:odtu-flex-type', 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 ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'path-constraints', 'te-bandwidth', 'otn'] + + def _get_odulist(self): + """ + Getter method for odulist, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/te_bandwidth/otn/odulist (list) + + YANG Description: OTN bandwidth definition + """ + return self.__odulist + + def _set_odulist(self, v, load=False): + """ + Setter method for odulist, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/te_bandwidth/otn/odulist (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_odulist is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_odulist() directly. + + YANG Description: OTN bandwidth definition + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("odu_type",odulist.odulist, yang_name="odulist", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='odu-type', extensions=None, choice=('technology', 'otn')), is_container='list', yang_name="odulist", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='list', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """odulist must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("odu_type",odulist.odulist, yang_name="odulist", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='odu-type', extensions=None, choice=('technology', 'otn')), is_container='list', yang_name="odulist", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='list', is_config=True)""", + }) + + self.__odulist = t + if hasattr(self, '_set'): + self._set() + + def _unset_odulist(self): + self.__odulist = YANGDynClass(base=YANGListType("odu_type",odulist.odulist, yang_name="odulist", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='odu-type', extensions=None, choice=('technology', 'otn')), is_container='list', yang_name="odulist", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='list', is_config=True) + + + def _get_odtu_flex_type(self): + """ + Getter method for odtu_flex_type, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/te_bandwidth/otn/odtu_flex_type (l1-types:odtu-flex-type) + + YANG Description: The type of Optical Data Tributary Unit (ODTU) +whose nominal bitrate is used to compute the number of +Tributary Slots (TS) required by the ODUflex LSPs +set up along the underlay paths of these OTN +connectivity matrices. + """ + return self.__odtu_flex_type + + def _set_odtu_flex_type(self, v, load=False): + """ + Setter method for odtu_flex_type, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/te_bandwidth/otn/odtu_flex_type (l1-types:odtu-flex-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_odtu_flex_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_odtu_flex_type() directly. + + YANG Description: The type of Optical Data Tributary Unit (ODTU) +whose nominal bitrate is used to compute the number of +Tributary Slots (TS) required by the ODUflex LSPs +set up along the underlay paths of these OTN +connectivity matrices. + """ + 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={'2': {}, '3': {}, '4': {}, 'Cn': {}},), is_leaf=True, yang_name="odtu-flex-type", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='l1-types:odtu-flex-type', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """odtu_flex_type must be of a type compatible with l1-types:odtu-flex-type""", + 'defined-type': "l1-types:odtu-flex-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'2': {}, '3': {}, '4': {}, 'Cn': {}},), is_leaf=True, yang_name="odtu-flex-type", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='l1-types:odtu-flex-type', is_config=True)""", + }) + + self.__odtu_flex_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_odtu_flex_type(self): + self.__odtu_flex_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'2': {}, '3': {}, '4': {}, 'Cn': {}},), is_leaf=True, yang_name="odtu-flex-type", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='l1-types:odtu-flex-type', is_config=True) + + odulist = __builtin__.property(_get_odulist, _set_odulist) + odtu_flex_type = __builtin__.property(_get_odtu_flex_type, _set_odtu_flex_type) + + __choices__ = {'technology': {'otn': ['odulist', 'odtu_flex_type']}} + _pyangbind_elements = OrderedDict([('odulist', odulist), ('odtu_flex_type', odtu_flex_type), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/te_bandwidth/otn/odulist/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/te_bandwidth/otn/odulist/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..c6577089cc08d9214b7aca30ef8bcf76ce08397f --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/te_bandwidth/otn/odulist/__init__.py @@ -0,0 +1,200 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 odulist(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/path-constraints/te-bandwidth/otn/odulist. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: OTN bandwidth definition + """ + __slots__ = ('_path_helper', '_extmethods', '__odu_type','__number','__ts_number',) + + _yang_name = 'odulist' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__odu_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="odu-type", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + self.__number = YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), is_leaf=True, yang_name="number", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', is_config=True) + self.__ts_number = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts-number", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', 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 ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'path-constraints', 'te-bandwidth', 'otn', 'odulist'] + + def _get_odu_type(self): + """ + Getter method for odu_type, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/te_bandwidth/otn/odulist/odu_type (identityref) + + YANG Description: ODU type + """ + return self.__odu_type + + def _set_odu_type(self, v, load=False): + """ + Setter method for odu_type, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/te_bandwidth/otn/odulist/odu_type (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_odu_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_odu_type() directly. + + YANG Description: ODU type + """ + 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=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="odu-type", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """odu_type must be of a type compatible with identityref""", + 'defined-type': "ietf-otn-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="odu-type", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True)""", + }) + + self.__odu_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_odu_type(self): + self.__odu_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="odu-type", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + + + def _get_number(self): + """ + Getter method for number, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/te_bandwidth/otn/odulist/number (uint16) + + YANG Description: Number of ODUs + """ + return self.__number + + def _set_number(self, v, load=False): + """ + Setter method for number, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/te_bandwidth/otn/odulist/number (uint16) + If this variable is read-only (config: false) in the + source YANG file, then _set_number is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_number() directly. + + YANG Description: Number of ODUs + """ + 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="number", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """number 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="number", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', is_config=True)""", + }) + + self.__number = t + if hasattr(self, '_set'): + self._set() + + def _unset_number(self): + self.__number = YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), is_leaf=True, yang_name="number", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', is_config=True) + + + def _get_ts_number(self): + """ + Getter method for ts_number, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/te_bandwidth/otn/odulist/ts_number (uint16) + + YANG Description: The number of Tributary Slots (TS) that +could be used by all the ODUflex LSPs. + """ + return self.__ts_number + + def _set_ts_number(self, v, load=False): + """ + Setter method for ts_number, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/te_bandwidth/otn/odulist/ts_number (uint16) + If this variable is read-only (config: false) in the + source YANG file, then _set_ts_number is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_ts_number() directly. + + YANG Description: The number of Tributary Slots (TS) that +could be used by all the ODUflex LSPs. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts-number", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """ts_number must be of a type compatible with uint16""", + 'defined-type': "uint16", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts-number", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', is_config=True)""", + }) + + self.__ts_number = t + if hasattr(self, '_set'): + self._set() + + def _unset_ts_number(self): + self.__ts_number = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts-number", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', is_config=True) + + odu_type = __builtin__.property(_get_odu_type, _set_odu_type) + number = __builtin__.property(_get_number, _set_number) + ts_number = __builtin__.property(_get_ts_number, _set_ts_number) + + __choices__ = {'technology': {'otn': ['odu_type', 'number', 'ts_number']}} + _pyangbind_elements = OrderedDict([('odu_type', odu_type), ('number', number), ('ts_number', ts_number), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..5633ecb2d25084b568dd17769a8890bb2ca9039c --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/__init__.py @@ -0,0 +1,318 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 path_metric +from . import path_affinities_values +from . import path_affinity_names +from . import path_srlgs_lists +from . import path_srlgs_names +from . import path_route_objects +class path_properties(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/path-properties. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: The TE path properties. + """ + __slots__ = ('_path_helper', '_extmethods', '__path_metric','__path_affinities_values','__path_affinity_names','__path_srlgs_lists','__path_srlgs_names','__path_route_objects',) + + _yang_name = 'path-properties' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__path_metric = YANGDynClass(base=YANGListType("metric_type",path_metric.path_metric, yang_name="path-metric", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='metric-type', extensions=None), is_container='list', yang_name="path-metric", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + self.__path_affinities_values = YANGDynClass(base=path_affinities_values.path_affinities_values, is_container='container', yang_name="path-affinities-values", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__path_affinity_names = YANGDynClass(base=path_affinity_names.path_affinity_names, is_container='container', yang_name="path-affinity-names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__path_srlgs_lists = YANGDynClass(base=path_srlgs_lists.path_srlgs_lists, is_container='container', yang_name="path-srlgs-lists", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__path_srlgs_names = YANGDynClass(base=path_srlgs_names.path_srlgs_names, is_container='container', yang_name="path-srlgs-names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__path_route_objects = YANGDynClass(base=path_route_objects.path_route_objects, is_container='container', yang_name="path-route-objects", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', 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 ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'path-properties'] + + def _get_path_metric(self): + """ + Getter method for path_metric, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_metric (list) + + YANG Description: TE path metric type. + """ + return self.__path_metric + + def _set_path_metric(self, v, load=False): + """ + Setter method for path_metric, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_metric (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_metric is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_metric() directly. + + YANG Description: TE path metric type. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("metric_type",path_metric.path_metric, yang_name="path-metric", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='metric-type', extensions=None), is_container='list', yang_name="path-metric", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_metric must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("metric_type",path_metric.path_metric, yang_name="path-metric", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='metric-type', extensions=None), is_container='list', yang_name="path-metric", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False)""", + }) + + self.__path_metric = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_metric(self): + self.__path_metric = YANGDynClass(base=YANGListType("metric_type",path_metric.path_metric, yang_name="path-metric", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='metric-type', extensions=None), is_container='list', yang_name="path-metric", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + + + def _get_path_affinities_values(self): + """ + Getter method for path_affinities_values, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_affinities_values (container) + + YANG Description: Path affinities represented as values. + """ + return self.__path_affinities_values + + def _set_path_affinities_values(self, v, load=False): + """ + Setter method for path_affinities_values, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_affinities_values (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_affinities_values is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_affinities_values() directly. + + YANG Description: Path affinities represented as values. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=path_affinities_values.path_affinities_values, is_container='container', yang_name="path-affinities-values", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_affinities_values must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=path_affinities_values.path_affinities_values, is_container='container', yang_name="path-affinities-values", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__path_affinities_values = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_affinities_values(self): + self.__path_affinities_values = YANGDynClass(base=path_affinities_values.path_affinities_values, is_container='container', yang_name="path-affinities-values", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_path_affinity_names(self): + """ + Getter method for path_affinity_names, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_affinity_names (container) + + YANG Description: Path affinities represented as names. + """ + return self.__path_affinity_names + + def _set_path_affinity_names(self, v, load=False): + """ + Setter method for path_affinity_names, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_affinity_names (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_affinity_names is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_affinity_names() directly. + + YANG Description: Path affinities represented as names. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=path_affinity_names.path_affinity_names, is_container='container', yang_name="path-affinity-names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_affinity_names must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=path_affinity_names.path_affinity_names, is_container='container', yang_name="path-affinity-names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__path_affinity_names = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_affinity_names(self): + self.__path_affinity_names = YANGDynClass(base=path_affinity_names.path_affinity_names, is_container='container', yang_name="path-affinity-names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_path_srlgs_lists(self): + """ + Getter method for path_srlgs_lists, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_srlgs_lists (container) + + YANG Description: Path SRLG properties container. + """ + return self.__path_srlgs_lists + + def _set_path_srlgs_lists(self, v, load=False): + """ + Setter method for path_srlgs_lists, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_srlgs_lists (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_srlgs_lists is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_srlgs_lists() directly. + + YANG Description: Path SRLG properties container. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=path_srlgs_lists.path_srlgs_lists, is_container='container', yang_name="path-srlgs-lists", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_srlgs_lists must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=path_srlgs_lists.path_srlgs_lists, is_container='container', yang_name="path-srlgs-lists", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__path_srlgs_lists = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_srlgs_lists(self): + self.__path_srlgs_lists = YANGDynClass(base=path_srlgs_lists.path_srlgs_lists, is_container='container', yang_name="path-srlgs-lists", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_path_srlgs_names(self): + """ + Getter method for path_srlgs_names, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_srlgs_names (container) + + YANG Description: Container for the list of named SRLGs. + """ + return self.__path_srlgs_names + + def _set_path_srlgs_names(self, v, load=False): + """ + Setter method for path_srlgs_names, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_srlgs_names (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_srlgs_names is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_srlgs_names() directly. + + YANG Description: Container for the list of named SRLGs. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=path_srlgs_names.path_srlgs_names, is_container='container', yang_name="path-srlgs-names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_srlgs_names must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=path_srlgs_names.path_srlgs_names, is_container='container', yang_name="path-srlgs-names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__path_srlgs_names = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_srlgs_names(self): + self.__path_srlgs_names = YANGDynClass(base=path_srlgs_names.path_srlgs_names, is_container='container', yang_name="path-srlgs-names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_path_route_objects(self): + """ + Getter method for path_route_objects, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_route_objects (container) + + YANG Description: Container for the list of route objects either returned by +the computation engine or actually used by an LSP. + """ + return self.__path_route_objects + + def _set_path_route_objects(self, v, load=False): + """ + Setter method for path_route_objects, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_route_objects (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_route_objects is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_route_objects() directly. + + YANG Description: Container for the list of route objects either returned by +the computation engine or actually used by an LSP. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=path_route_objects.path_route_objects, is_container='container', yang_name="path-route-objects", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_route_objects must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=path_route_objects.path_route_objects, is_container='container', yang_name="path-route-objects", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__path_route_objects = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_route_objects(self): + self.__path_route_objects = YANGDynClass(base=path_route_objects.path_route_objects, is_container='container', yang_name="path-route-objects", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + path_metric = __builtin__.property(_get_path_metric) + path_affinities_values = __builtin__.property(_get_path_affinities_values) + path_affinity_names = __builtin__.property(_get_path_affinity_names) + path_srlgs_lists = __builtin__.property(_get_path_srlgs_lists) + path_srlgs_names = __builtin__.property(_get_path_srlgs_names) + path_route_objects = __builtin__.property(_get_path_route_objects) + + + _pyangbind_elements = OrderedDict([('path_metric', path_metric), ('path_affinities_values', path_affinities_values), ('path_affinity_names', path_affinity_names), ('path_srlgs_lists', path_srlgs_lists), ('path_srlgs_names', path_srlgs_names), ('path_route_objects', path_route_objects), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_affinities_values/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_affinities_values/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..49d1090f243669947bbd030100ad5b132480bce7 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_affinities_values/__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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 path_affinities_value +class path_affinities_values(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/path-properties/path-affinities-values. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Path affinities represented as values. + """ + __slots__ = ('_path_helper', '_extmethods', '__path_affinities_value',) + + _yang_name = 'path-affinities-values' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__path_affinities_value = YANGDynClass(base=YANGListType("usage",path_affinities_value.path_affinities_value, yang_name="path-affinities-value", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-affinities-value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', 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 ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'path-properties', 'path-affinities-values'] + + def _get_path_affinities_value(self): + """ + Getter method for path_affinities_value, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_affinities_values/path_affinities_value (list) + + YANG Description: List of named affinity constraints. + """ + return self.__path_affinities_value + + def _set_path_affinities_value(self, v, load=False): + """ + Setter method for path_affinities_value, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_affinities_values/path_affinities_value (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_affinities_value is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_affinities_value() directly. + + YANG Description: List of named affinity constraints. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("usage",path_affinities_value.path_affinities_value, yang_name="path-affinities-value", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-affinities-value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_affinities_value must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("usage",path_affinities_value.path_affinities_value, yang_name="path-affinities-value", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-affinities-value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False)""", + }) + + self.__path_affinities_value = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_affinities_value(self): + self.__path_affinities_value = YANGDynClass(base=YANGListType("usage",path_affinities_value.path_affinities_value, yang_name="path-affinities-value", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-affinities-value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + + path_affinities_value = __builtin__.property(_get_path_affinities_value) + + + _pyangbind_elements = OrderedDict([('path_affinities_value', path_affinities_value), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_affinities_values/path_affinities_value/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_affinities_values/path_affinities_value/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e387bf9bfbd3c4799f23211105a7a1a91c98c413 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_affinities_values/path_affinities_value/__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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 path_affinities_value(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/path-properties/path-affinities-values/path-affinities-value. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: List of named affinity constraints. + """ + __slots__ = ('_path_helper', '_extmethods', '__usage','__value',) + + _yang_name = 'path-affinities-value' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__usage = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + self.__value = YANGDynClass(base=[RestrictedClassType(base_type=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}), restriction_dict={'length': ['1..11']}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}),], default=six.text_type(""), is_leaf=True, yang_name="value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='admin-groups', 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 ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'path-properties', 'path-affinities-values', 'path-affinities-value'] + + def _get_usage(self): + """ + Getter method for usage, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_affinities_values/path_affinities_value/usage (identityref) + + YANG Description: Identifies an entry in the list of value affinity +constraints. + """ + return self.__usage + + def _set_usage(self, v, load=False): + """ + Setter method for usage, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_affinities_values/path_affinities_value/usage (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_usage is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_usage() directly. + + YANG Description: Identifies an entry in the list of value affinity +constraints. + """ + 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=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """usage must be of a type compatible with identityref""", + 'defined-type': "ietf-te-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False)""", + }) + + self.__usage = t + if hasattr(self, '_set'): + self._set() + + def _unset_usage(self): + self.__usage = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + + + def _get_value(self): + """ + Getter method for value, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_affinities_values/path_affinities_value/value (admin-groups) + + YANG Description: The affinity value. The default is empty. + """ + return self.__value + + def _set_value(self, v, load=False): + """ + Setter method for value, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_affinities_values/path_affinities_value/value (admin-groups) + 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: The affinity value. The default is empty. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=[RestrictedClassType(base_type=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}), restriction_dict={'length': ['1..11']}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}),], default=six.text_type(""), is_leaf=True, yang_name="value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='admin-groups', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """value must be of a type compatible with admin-groups""", + 'defined-type': "ietf-te-topology:admin-groups", + 'generated-type': """YANGDynClass(base=[RestrictedClassType(base_type=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}), restriction_dict={'length': ['1..11']}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}),], default=six.text_type(""), is_leaf=True, yang_name="value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='admin-groups', is_config=False)""", + }) + + self.__value = t + if hasattr(self, '_set'): + self._set() + + def _unset_value(self): + self.__value = YANGDynClass(base=[RestrictedClassType(base_type=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}), restriction_dict={'length': ['1..11']}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}),], default=six.text_type(""), is_leaf=True, yang_name="value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='admin-groups', is_config=False) + + usage = __builtin__.property(_get_usage) + value = __builtin__.property(_get_value) + + + _pyangbind_elements = OrderedDict([('usage', usage), ('value', value), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_affinity_names/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_affinity_names/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..904de87a16de9e7c7870cf3ab2839ab7d7afdf53 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_affinity_names/__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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 path_affinity_name +class path_affinity_names(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/path-properties/path-affinity-names. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Path affinities represented as names. + """ + __slots__ = ('_path_helper', '_extmethods', '__path_affinity_name',) + + _yang_name = 'path-affinity-names' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__path_affinity_name = YANGDynClass(base=YANGListType("usage",path_affinity_name.path_affinity_name, yang_name="path-affinity-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-affinity-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', 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 ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'path-properties', 'path-affinity-names'] + + def _get_path_affinity_name(self): + """ + Getter method for path_affinity_name, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_affinity_names/path_affinity_name (list) + + YANG Description: List of named affinity constraints. + """ + return self.__path_affinity_name + + def _set_path_affinity_name(self, v, load=False): + """ + Setter method for path_affinity_name, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_affinity_names/path_affinity_name (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_affinity_name is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_affinity_name() directly. + + YANG Description: List of named affinity constraints. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("usage",path_affinity_name.path_affinity_name, yang_name="path-affinity-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-affinity-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_affinity_name must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("usage",path_affinity_name.path_affinity_name, yang_name="path-affinity-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-affinity-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False)""", + }) + + self.__path_affinity_name = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_affinity_name(self): + self.__path_affinity_name = YANGDynClass(base=YANGListType("usage",path_affinity_name.path_affinity_name, yang_name="path-affinity-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-affinity-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + + path_affinity_name = __builtin__.property(_get_path_affinity_name) + + + _pyangbind_elements = OrderedDict([('path_affinity_name', path_affinity_name), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_affinity_names/path_affinity_name/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_affinity_names/path_affinity_name/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..c7b9e5faf5d46d9e7ea2f444562672d7b75f9a8c --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_affinity_names/path_affinity_name/__init__.py @@ -0,0 +1,162 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 affinity_name +class path_affinity_name(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/path-properties/path-affinity-names/path-affinity-name. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: List of named affinity constraints. + """ + __slots__ = ('_path_helper', '_extmethods', '__usage','__affinity_name',) + + _yang_name = 'path-affinity-name' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__usage = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + self.__affinity_name = YANGDynClass(base=YANGListType("name",affinity_name.affinity_name, yang_name="affinity-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='name', extensions=None), is_container='list', yang_name="affinity-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', 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 ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'path-properties', 'path-affinity-names', 'path-affinity-name'] + + def _get_usage(self): + """ + Getter method for usage, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_affinity_names/path_affinity_name/usage (identityref) + + YANG Description: Identifies an entry in the list of named affinity +constraints. + """ + return self.__usage + + def _set_usage(self, v, load=False): + """ + Setter method for usage, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_affinity_names/path_affinity_name/usage (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_usage is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_usage() directly. + + YANG Description: Identifies an entry in the list of named affinity +constraints. + """ + 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=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """usage must be of a type compatible with identityref""", + 'defined-type': "ietf-te-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False)""", + }) + + self.__usage = t + if hasattr(self, '_set'): + self._set() + + def _unset_usage(self): + self.__usage = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + + + def _get_affinity_name(self): + """ + Getter method for affinity_name, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_affinity_names/path_affinity_name/affinity_name (list) + + YANG Description: List of named affinities. + """ + return self.__affinity_name + + def _set_affinity_name(self, v, load=False): + """ + Setter method for affinity_name, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_affinity_names/path_affinity_name/affinity_name (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_affinity_name is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_affinity_name() directly. + + YANG Description: List of named affinities. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("name",affinity_name.affinity_name, yang_name="affinity-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='name', extensions=None), is_container='list', yang_name="affinity-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """affinity_name must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("name",affinity_name.affinity_name, yang_name="affinity-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='name', extensions=None), is_container='list', yang_name="affinity-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False)""", + }) + + self.__affinity_name = t + if hasattr(self, '_set'): + self._set() + + def _unset_affinity_name(self): + self.__affinity_name = YANGDynClass(base=YANGListType("name",affinity_name.affinity_name, yang_name="affinity-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='name', extensions=None), is_container='list', yang_name="affinity-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + + usage = __builtin__.property(_get_usage) + affinity_name = __builtin__.property(_get_affinity_name) + + + _pyangbind_elements = OrderedDict([('usage', usage), ('affinity_name', affinity_name), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_affinity_names/path_affinity_name/affinity_name/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_affinity_names/path_affinity_name/affinity_name/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..8e41672e8151473007d724a85f7b4dde8e5f20c2 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_affinity_names/path_affinity_name/affinity_name/__init__.py @@ -0,0 +1,120 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 affinity_name(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/path-properties/path-affinity-names/path-affinity-name/affinity-name. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: List of named affinities. + """ + __slots__ = ('_path_helper', '_extmethods', '__name',) + + _yang_name = 'affinity-name' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _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='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', 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 ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'path-properties', 'path-affinity-names', 'path-affinity-name', 'affinity-name'] + + def _get_name(self): + """ + Getter method for name, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_affinity_names/path_affinity_name/affinity_name/name (string) + + YANG Description: Identifies a named affinity entry. + """ + return self.__name + + def _set_name(self, v, load=False): + """ + Setter method for name, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_affinity_names/path_affinity_name/affinity_name/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: Identifies a named affinity entry. + """ + 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='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', 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, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', 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, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=False) + + name = __builtin__.property(_get_name) + + + _pyangbind_elements = OrderedDict([('name', name), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_metric/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_metric/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..0a8fae1c4a91b30a5b08483906f57eb84c4f2772 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_metric/__init__.py @@ -0,0 +1,159 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 path_metric(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/path-properties/path-metric. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: TE path metric type. + """ + __slots__ = ('_path_helper', '_extmethods', '__metric_type','__accumulative_value',) + + _yang_name = 'path-metric' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__metric_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="metric-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + self.__accumulative_value = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="accumulative-value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', 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 ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'path-properties', 'path-metric'] + + def _get_metric_type(self): + """ + Getter method for metric_type, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_metric/metric_type (identityref) + + YANG Description: TE path metric type. + """ + return self.__metric_type + + def _set_metric_type(self, v, load=False): + """ + Setter method for metric_type, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_metric/metric_type (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_metric_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_metric_type() directly. + + YANG Description: TE path metric type. + """ + 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=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="metric-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """metric_type must be of a type compatible with identityref""", + 'defined-type': "ietf-te-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="metric-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False)""", + }) + + self.__metric_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_metric_type(self): + self.__metric_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="metric-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + + + def _get_accumulative_value(self): + """ + Getter method for accumulative_value, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_metric/accumulative_value (uint64) + + YANG Description: TE path metric accumulative value. + """ + return self.__accumulative_value + + def _set_accumulative_value(self, v, load=False): + """ + Setter method for accumulative_value, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_metric/accumulative_value (uint64) + If this variable is read-only (config: false) in the + source YANG file, then _set_accumulative_value is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_accumulative_value() directly. + + YANG Description: TE path metric accumulative value. + """ + 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="accumulative-value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint64', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """accumulative_value 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="accumulative-value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint64', is_config=False)""", + }) + + self.__accumulative_value = t + if hasattr(self, '_set'): + self._set() + + def _unset_accumulative_value(self): + self.__accumulative_value = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="accumulative-value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint64', is_config=False) + + metric_type = __builtin__.property(_get_metric_type) + accumulative_value = __builtin__.property(_get_accumulative_value) + + + _pyangbind_elements = OrderedDict([('metric_type', metric_type), ('accumulative_value', accumulative_value), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_route_objects/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_route_objects/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..9f30f10e68c50711bfaee7aea0510143e4094481 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_route_objects/__init__.py @@ -0,0 +1,119 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 path_route_object +class path_route_objects(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/path-properties/path-route-objects. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Container for the list of route objects either returned by +the computation engine or actually used by an LSP. + """ + __slots__ = ('_path_helper', '_extmethods', '__path_route_object',) + + _yang_name = 'path-route-objects' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__path_route_object = YANGDynClass(base=YANGListType("index",path_route_object.path_route_object, yang_name="path-route-object", parent=self, is_container='list', user_ordered=True, path_helper=self._path_helper, yang_keys='index', extensions=None), is_container='list', yang_name="path-route-object", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', 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 ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'path-properties', 'path-route-objects'] + + def _get_path_route_object(self): + """ + Getter method for path_route_object, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_route_objects/path_route_object (list) + + YANG Description: List of route objects either returned by the computation +engine or actually used by an LSP. + """ + return self.__path_route_object + + def _set_path_route_object(self, v, load=False): + """ + Setter method for path_route_object, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_route_objects/path_route_object (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_route_object is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_route_object() directly. + + YANG Description: List of route objects either returned by the computation +engine or actually used by an LSP. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("index",path_route_object.path_route_object, yang_name="path-route-object", parent=self, is_container='list', user_ordered=True, path_helper=self._path_helper, yang_keys='index', extensions=None), is_container='list', yang_name="path-route-object", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_route_object must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("index",path_route_object.path_route_object, yang_name="path-route-object", parent=self, is_container='list', user_ordered=True, path_helper=self._path_helper, yang_keys='index', extensions=None), is_container='list', yang_name="path-route-object", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False)""", + }) + + self.__path_route_object = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_route_object(self): + self.__path_route_object = YANGDynClass(base=YANGListType("index",path_route_object.path_route_object, yang_name="path-route-object", parent=self, is_container='list', user_ordered=True, path_helper=self._path_helper, yang_keys='index', extensions=None), is_container='list', yang_name="path-route-object", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + + path_route_object = __builtin__.property(_get_path_route_object) + + + _pyangbind_elements = OrderedDict([('path_route_object', path_route_object), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_route_objects/path_route_object/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_route_objects/path_route_object/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..9e85f737c57910db3b874a5d07f8cb45e3158977 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_route_objects/path_route_object/__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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 numbered_node_hop +from . import numbered_link_hop +from . import unnumbered_link_hop +from . import as_number_hop +from . import label_hop +class path_route_object(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/path-properties/path-route-objects/path-route-object. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: List of route objects either returned by the computation +engine or actually used by an LSP. + """ + __slots__ = ('_path_helper', '_extmethods', '__index','__numbered_node_hop','__numbered_link_hop','__unnumbered_link_hop','__as_number_hop','__label_hop',) + + _yang_name = 'path-route-object' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _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), is_leaf=True, yang_name="index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=False) + self.__numbered_node_hop = YANGDynClass(base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__numbered_link_hop = YANGDynClass(base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__unnumbered_link_hop = YANGDynClass(base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__as_number_hop = YANGDynClass(base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__label_hop = YANGDynClass(base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', 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 ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'path-properties', 'path-route-objects', 'path-route-object'] + + def _get_index(self): + """ + Getter method for index, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_route_objects/path_route_object/index (uint32) + + YANG Description: Route object entry index. The index is used to +identify an entry in the list. The order of entries +is defined by the user without relying on key +values. + """ + return self.__index + + def _set_index(self, v, load=False): + """ + Setter method for index, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_route_objects/path_route_object/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: Route object entry index. The index is used to +identify an entry in the list. The order of entries +is defined by the user without relying on key +values. + """ + 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=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', 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), is_leaf=True, yang_name="index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', 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), is_leaf=True, yang_name="index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=False) + + + def _get_numbered_node_hop(self): + """ + Getter method for numbered_node_hop, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_route_objects/path_route_object/numbered_node_hop (container) + + YANG Description: Numbered node route hop. + """ + return self.__numbered_node_hop + + def _set_numbered_node_hop(self, v, load=False): + """ + Setter method for numbered_node_hop, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_route_objects/path_route_object/numbered_node_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_numbered_node_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_numbered_node_hop() directly. + + YANG Description: Numbered node route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """numbered_node_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__numbered_node_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_numbered_node_hop(self): + self.__numbered_node_hop = YANGDynClass(base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_numbered_link_hop(self): + """ + Getter method for numbered_link_hop, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_route_objects/path_route_object/numbered_link_hop (container) + + YANG Description: Numbered link explicit route hop. + """ + return self.__numbered_link_hop + + def _set_numbered_link_hop(self, v, load=False): + """ + Setter method for numbered_link_hop, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_route_objects/path_route_object/numbered_link_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_numbered_link_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_numbered_link_hop() directly. + + YANG Description: Numbered link explicit route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """numbered_link_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__numbered_link_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_numbered_link_hop(self): + self.__numbered_link_hop = YANGDynClass(base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_unnumbered_link_hop(self): + """ + Getter method for unnumbered_link_hop, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_route_objects/path_route_object/unnumbered_link_hop (container) + + YANG Description: Unnumbered link explicit route hop. + """ + return self.__unnumbered_link_hop + + def _set_unnumbered_link_hop(self, v, load=False): + """ + Setter method for unnumbered_link_hop, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_route_objects/path_route_object/unnumbered_link_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_unnumbered_link_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_unnumbered_link_hop() directly. + + YANG Description: Unnumbered link explicit route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """unnumbered_link_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__unnumbered_link_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_unnumbered_link_hop(self): + self.__unnumbered_link_hop = YANGDynClass(base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_as_number_hop(self): + """ + Getter method for as_number_hop, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_route_objects/path_route_object/as_number_hop (container) + + YANG Description: AS explicit route hop. + """ + return self.__as_number_hop + + def _set_as_number_hop(self, v, load=False): + """ + Setter method for as_number_hop, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_route_objects/path_route_object/as_number_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_as_number_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_as_number_hop() directly. + + YANG Description: AS explicit route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """as_number_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__as_number_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_as_number_hop(self): + self.__as_number_hop = YANGDynClass(base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_label_hop(self): + """ + Getter method for label_hop, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_route_objects/path_route_object/label_hop (container) + + YANG Description: Label hop type. + """ + return self.__label_hop + + def _set_label_hop(self, v, load=False): + """ + Setter method for label_hop, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_route_objects/path_route_object/label_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_label_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_label_hop() directly. + + YANG Description: Label hop type. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """label_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__label_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_label_hop(self): + self.__label_hop = YANGDynClass(base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + index = __builtin__.property(_get_index) + numbered_node_hop = __builtin__.property(_get_numbered_node_hop) + numbered_link_hop = __builtin__.property(_get_numbered_link_hop) + unnumbered_link_hop = __builtin__.property(_get_unnumbered_link_hop) + as_number_hop = __builtin__.property(_get_as_number_hop) + label_hop = __builtin__.property(_get_label_hop) + + __choices__ = {'type': {'numbered-node-hop': ['numbered_node_hop'], 'numbered-link-hop': ['numbered_link_hop'], 'unnumbered-link-hop': ['unnumbered_link_hop'], 'as-number': ['as_number_hop'], 'label': ['label_hop']}} + _pyangbind_elements = OrderedDict([('index', index), ('numbered_node_hop', numbered_node_hop), ('numbered_link_hop', numbered_link_hop), ('unnumbered_link_hop', unnumbered_link_hop), ('as_number_hop', as_number_hop), ('label_hop', label_hop), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_route_objects/path_route_object/as_number_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_route_objects/path_route_object/as_number_hop/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..14f8c67c4ef9c74d8fbd42a4e7a3e9a8c81b505e --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_route_objects/path_route_object/as_number_hop/__init__.py @@ -0,0 +1,154 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 as_number_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/path-properties/path-route-objects/path-route-object/as-number-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: AS explicit route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__as_number','__hop_type',) + + _yang_name = 'as-number-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__as_number = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=False) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', 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 ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'path-properties', 'path-route-objects', 'path-route-object', 'as-number-hop'] + + def _get_as_number(self): + """ + Getter method for as_number, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_route_objects/path_route_object/as_number_hop/as_number (inet:as-number) + + YANG Description: The Autonomous System (AS) number. + """ + return self.__as_number + + def _set_as_number(self, v, load=False): + """ + Setter method for as_number, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_route_objects/path_route_object/as_number_hop/as_number (inet:as-number) + If this variable is read-only (config: false) in the + source YANG file, then _set_as_number is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_as_number() directly. + + YANG Description: The Autonomous System (AS) number. + """ + 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="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """as_number must be of a type compatible with inet:as-number""", + 'defined-type': "inet:as-number", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=False)""", + }) + + self.__as_number = t + if hasattr(self, '_set'): + self._set() + + def _unset_as_number(self): + self.__as_number = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=False) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_route_objects/path_route_object/as_number_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_route_objects/path_route_object/as_number_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + 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={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + + as_number = __builtin__.property(_get_as_number) + hop_type = __builtin__.property(_get_hop_type) + + __choices__ = {'type': {'as-number': ['as_number', 'hop_type']}} + _pyangbind_elements = OrderedDict([('as_number', as_number), ('hop_type', hop_type), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_route_objects/path_route_object/label_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_route_objects/path_route_object/label_hop/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..d816d11be71d3d6e12e7427275b7aba68ea7db7e --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_route_objects/path_route_object/label_hop/__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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 te_label +class label_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/path-properties/path-route-objects/path-route-object/label-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Label hop type. + """ + __slots__ = ('_path_helper', '_extmethods', '__te_label',) + + _yang_name = 'label-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__te_label = YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', 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 ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'path-properties', 'path-route-objects', 'path-route-object', 'label-hop'] + + def _get_te_label(self): + """ + Getter method for te_label, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_route_objects/path_route_object/label_hop/te_label (container) + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + return self.__te_label + + def _set_te_label(self, v, load=False): + """ + Setter method for te_label, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_route_objects/path_route_object/label_hop/te_label (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_te_label is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_te_label() directly. + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """te_label must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__te_label = t + if hasattr(self, '_set'): + self._set() + + def _unset_te_label(self): + self.__te_label = YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + te_label = __builtin__.property(_get_te_label) + + __choices__ = {'type': {'label': ['te_label']}} + _pyangbind_elements = OrderedDict([('te_label', te_label), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_route_objects/path_route_object/label_hop/te_label/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_route_objects/path_route_object/label_hop/te_label/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..2b21aa6b8cd180833494e5203ff9cca2f713a49b --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_route_objects/path_route_object/label_hop/te_label/__init__.py @@ -0,0 +1,234 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 otn +class te_label(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/path-properties/path-route-objects/path-route-object/label-hop/te-label. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + __slots__ = ('_path_helper', '_extmethods', '__generic','__otn','__vlanid','__direction',) + + _yang_name = 'te-label' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__generic = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=False) + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False) + self.__vlanid = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=False) + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', 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 ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'path-properties', 'path-route-objects', 'path-route-object', 'label-hop', 'te-label'] + + def _get_generic(self): + """ + Getter method for generic, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_route_objects/path_route_object/label_hop/te_label/generic (rt-types:generalized-label) + + YANG Description: TE label specified in a generic format. + """ + return self.__generic + + def _set_generic(self, v, load=False): + """ + Setter method for generic, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_route_objects/path_route_object/label_hop/te_label/generic (rt-types:generalized-label) + If this variable is read-only (config: false) in the + source YANG file, then _set_generic is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_generic() directly. + + YANG Description: TE label specified in a generic format. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """generic must be of a type compatible with rt-types:generalized-label""", + 'defined-type': "rt-types:generalized-label", + 'generated-type': """YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=False)""", + }) + + self.__generic = t + if hasattr(self, '_set'): + self._set() + + def _unset_generic(self): + self.__generic = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=False) + + + def _get_otn(self): + """ + Getter method for otn, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_route_objects/path_route_object/label_hop/te_label/otn (container) + + YANG Description: Label hop for OTN. + """ + return self.__otn + + def _set_otn(self, v, load=False): + """ + Setter method for otn, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_route_objects/path_route_object/label_hop/te_label/otn (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_otn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_otn() directly. + + YANG Description: Label hop for OTN. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """otn must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False)""", + }) + + self.__otn = t + if hasattr(self, '_set'): + self._set() + + def _unset_otn(self): + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False) + + + def _get_vlanid(self): + """ + Getter method for vlanid, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_route_objects/path_route_object/label_hop/te_label/vlanid (etht-types:vlanid) + + YANG Description: VLAN tag id. + """ + return self.__vlanid + + def _set_vlanid(self, v, load=False): + """ + Setter method for vlanid, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_route_objects/path_route_object/label_hop/te_label/vlanid (etht-types:vlanid) + If this variable is read-only (config: false) in the + source YANG file, then _set_vlanid is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_vlanid() directly. + + YANG Description: VLAN tag id. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """vlanid must be of a type compatible with etht-types:vlanid""", + 'defined-type': "etht-types:vlanid", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=False)""", + }) + + self.__vlanid = t + if hasattr(self, '_set'): + self._set() + + def _unset_vlanid(self): + self.__vlanid = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=False) + + + def _get_direction(self): + """ + Getter method for direction, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_route_objects/path_route_object/label_hop/te_label/direction (te-label-direction) + + YANG Description: Label direction. + """ + return self.__direction + + def _set_direction(self, v, load=False): + """ + Setter method for direction, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_route_objects/path_route_object/label_hop/te_label/direction (te-label-direction) + If this variable is read-only (config: false) in the + source YANG file, then _set_direction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_direction() directly. + + YANG Description: Label direction. + """ + 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={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """direction must be of a type compatible with te-label-direction""", + 'defined-type': "ietf-te-topology:te-label-direction", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=False)""", + }) + + self.__direction = t + if hasattr(self, '_set'): + self._set() + + def _unset_direction(self): + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=False) + + generic = __builtin__.property(_get_generic) + otn = __builtin__.property(_get_otn) + vlanid = __builtin__.property(_get_vlanid) + direction = __builtin__.property(_get_direction) + + __choices__ = {'technology': {'generic': ['generic'], 'otn': ['otn'], 'eth': ['vlanid']}, 'type': {'label': ['direction']}} + _pyangbind_elements = OrderedDict([('generic', generic), ('otn', otn), ('vlanid', vlanid), ('direction', direction), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_route_objects/path_route_object/label_hop/te_label/otn/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_route_objects/path_route_object/label_hop/te_label/otn/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..f24877ab2ea24a1fb2b4e4f84e35c98c2639ee1b --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_route_objects/path_route_object/label_hop/te_label/otn/__init__.py @@ -0,0 +1,209 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 otn(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/path-properties/path-route-objects/path-route-object/label-hop/te-label/otn. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Label hop for OTN. + """ + __slots__ = ('_path_helper', '_extmethods', '__tpn','__tsg','__ts_list',) + + _yang_name = 'otn' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__tpn = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=False) + self.__tsg = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=False) + self.__ts_list = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', 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 ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'path-properties', 'path-route-objects', 'path-route-object', 'label-hop', 'te-label', 'otn'] + + def _get_tpn(self): + """ + Getter method for tpn, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_route_objects/path_route_object/label_hop/te_label/otn/tpn (otn-tpn) + + YANG Description: Tributary Port Number (TPN). + """ + return self.__tpn + + def _set_tpn(self, v, load=False): + """ + Setter method for tpn, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_route_objects/path_route_object/label_hop/te_label/otn/tpn (otn-tpn) + If this variable is read-only (config: false) in the + source YANG file, then _set_tpn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tpn() directly. + + YANG Description: Tributary Port Number (TPN). + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tpn must be of a type compatible with otn-tpn""", + 'defined-type': "ietf-otn-topology:otn-tpn", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=False)""", + }) + + self.__tpn = t + if hasattr(self, '_set'): + self._set() + + def _unset_tpn(self): + self.__tpn = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=False) + + + def _get_tsg(self): + """ + Getter method for tsg, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_route_objects/path_route_object/label_hop/te_label/otn/tsg (identityref) + + YANG Description: Tributary Slot Granularity (TSG). + """ + return self.__tsg + + def _set_tsg(self, v, load=False): + """ + Setter method for tsg, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_route_objects/path_route_object/label_hop/te_label/otn/tsg (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_tsg is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tsg() directly. + + YANG Description: Tributary Slot Granularity (TSG). + """ + 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={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tsg must be of a type compatible with identityref""", + 'defined-type': "ietf-otn-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=False)""", + }) + + self.__tsg = t + if hasattr(self, '_set'): + self._set() + + def _unset_tsg(self): + self.__tsg = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=False) + + + def _get_ts_list(self): + """ + Getter method for ts_list, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_route_objects/path_route_object/label_hop/te_label/otn/ts_list (string) + + YANG Description: A list of available Tributary Slots (TS) ranging + + + + +between 1 and 4095. If multiple values or +ranges are given, they all MUST be disjoint +and MUST be in ascending order. +For example 1-20,25,50-1000. + """ + return self.__ts_list + + def _set_ts_list(self, v, load=False): + """ + Setter method for ts_list, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_route_objects/path_route_object/label_hop/te_label/otn/ts_list (string) + If this variable is read-only (config: false) in the + source YANG file, then _set_ts_list is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_ts_list() directly. + + YANG Description: A list of available Tributary Slots (TS) ranging + + + + +between 1 and 4095. If multiple values or +ranges are given, they all MUST be disjoint +and MUST be in ascending order. +For example 1-20,25,50-1000. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='string', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """ts_list must be of a type compatible with string""", + 'defined-type': "string", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='string', is_config=False)""", + }) + + self.__ts_list = t + if hasattr(self, '_set'): + self._set() + + def _unset_ts_list(self): + self.__ts_list = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='string', is_config=False) + + tpn = __builtin__.property(_get_tpn) + tsg = __builtin__.property(_get_tsg) + ts_list = __builtin__.property(_get_ts_list) + + __choices__ = {'technology': {'otn': ['tpn', 'tsg', 'ts_list']}} + _pyangbind_elements = OrderedDict([('tpn', tpn), ('tsg', tsg), ('ts_list', ts_list), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_route_objects/path_route_object/numbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_route_objects/path_route_object/numbered_link_hop/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..266d0f1c07b92f372a1f032563aa9420a72467f4 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_route_objects/path_route_object/numbered_link_hop/__init__.py @@ -0,0 +1,193 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 numbered_link_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/path-properties/path-route-objects/path-route-object/numbered-link-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Numbered link explicit route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__link_tp_id','__hop_type','__direction',) + + _yang_name = 'numbered-link-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=False) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', 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 ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'path-properties', 'path-route-objects', 'path-route-object', 'numbered-link-hop'] + + def _get_link_tp_id(self): + """ + Getter method for link_tp_id, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_route_objects/path_route_object/numbered_link_hop/link_tp_id (te-tp-id) + + YANG Description: TE Link Termination Point (LTP) identifier. + """ + return self.__link_tp_id + + def _set_link_tp_id(self, v, load=False): + """ + Setter method for link_tp_id, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_route_objects/path_route_object/numbered_link_hop/link_tp_id (te-tp-id) + If this variable is read-only (config: false) in the + source YANG file, then _set_link_tp_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_link_tp_id() directly. + + YANG Description: TE Link Termination Point (LTP) identifier. + """ + 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),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """link_tp_id must be of a type compatible with te-tp-id""", + 'defined-type': "ietf-te-topology:te-tp-id", + 'generated-type': """YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=False)""", + }) + + self.__link_tp_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_link_tp_id(self): + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=False) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_route_objects/path_route_object/numbered_link_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_route_objects/path_route_object/numbered_link_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + 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={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + + + def _get_direction(self): + """ + Getter method for direction, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_route_objects/path_route_object/numbered_link_hop/direction (te-link-direction) + + YANG Description: Link route object direction. + """ + return self.__direction + + def _set_direction(self, v, load=False): + """ + Setter method for direction, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_route_objects/path_route_object/numbered_link_hop/direction (te-link-direction) + If this variable is read-only (config: false) in the + source YANG file, then _set_direction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_direction() directly. + + YANG Description: Link route object direction. + """ + 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={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """direction must be of a type compatible with te-link-direction""", + 'defined-type': "ietf-te-topology:te-link-direction", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=False)""", + }) + + self.__direction = t + if hasattr(self, '_set'): + self._set() + + def _unset_direction(self): + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=False) + + link_tp_id = __builtin__.property(_get_link_tp_id) + hop_type = __builtin__.property(_get_hop_type) + direction = __builtin__.property(_get_direction) + + __choices__ = {'type': {'numbered-link-hop': ['link_tp_id', 'hop_type', 'direction']}} + _pyangbind_elements = OrderedDict([('link_tp_id', link_tp_id), ('hop_type', hop_type), ('direction', direction), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_route_objects/path_route_object/numbered_node_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_route_objects/path_route_object/numbered_node_hop/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..1e2ef7ce2cf0584b95c92c54f010df7c6ef0b79d --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_route_objects/path_route_object/numbered_node_hop/__init__.py @@ -0,0 +1,154 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 numbered_node_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/path-properties/path-route-objects/path-route-object/numbered-node-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Numbered node route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__node_id','__hop_type',) + + _yang_name = 'numbered-node-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=False) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', 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 ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'path-properties', 'path-route-objects', 'path-route-object', 'numbered-node-hop'] + + def _get_node_id(self): + """ + Getter method for node_id, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_route_objects/path_route_object/numbered_node_hop/node_id (te-node-id) + + YANG Description: The identifier of a node in the TE topology. + """ + return self.__node_id + + def _set_node_id(self, v, load=False): + """ + Setter method for node_id, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_route_objects/path_route_object/numbered_node_hop/node_id (te-node-id) + 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. + + YANG Description: The identifier of a node in the TE topology. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """node_id must be of a type compatible with te-node-id""", + 'defined-type': "ietf-te-topology:te-node-id", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=False)""", + }) + + self.__node_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_node_id(self): + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=False) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_route_objects/path_route_object/numbered_node_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_route_objects/path_route_object/numbered_node_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + 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={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + + node_id = __builtin__.property(_get_node_id) + hop_type = __builtin__.property(_get_hop_type) + + __choices__ = {'type': {'numbered-node-hop': ['node_id', 'hop_type']}} + _pyangbind_elements = OrderedDict([('node_id', node_id), ('hop_type', hop_type), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_route_objects/path_route_object/unnumbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_route_objects/path_route_object/unnumbered_link_hop/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..70b149a486ea4182317a5cc63704beb895960b01 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_route_objects/path_route_object/unnumbered_link_hop/__init__.py @@ -0,0 +1,236 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 unnumbered_link_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/path-properties/path-route-objects/path-route-object/unnumbered-link-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Unnumbered link explicit route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__link_tp_id','__node_id','__hop_type','__direction',) + + _yang_name = 'unnumbered-link-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=False) + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=False) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', 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 ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'path-properties', 'path-route-objects', 'path-route-object', 'unnumbered-link-hop'] + + def _get_link_tp_id(self): + """ + Getter method for link_tp_id, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_route_objects/path_route_object/unnumbered_link_hop/link_tp_id (te-tp-id) + + YANG Description: TE LTP identifier. The combination of the TE link ID +and the TE node ID is used to identify an unnumbered +TE link. + """ + return self.__link_tp_id + + def _set_link_tp_id(self, v, load=False): + """ + Setter method for link_tp_id, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_route_objects/path_route_object/unnumbered_link_hop/link_tp_id (te-tp-id) + If this variable is read-only (config: false) in the + source YANG file, then _set_link_tp_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_link_tp_id() directly. + + YANG Description: TE LTP identifier. The combination of the TE link ID +and the TE node ID is used to identify an unnumbered +TE link. + """ + 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),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """link_tp_id must be of a type compatible with te-tp-id""", + 'defined-type': "ietf-te-topology:te-tp-id", + 'generated-type': """YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=False)""", + }) + + self.__link_tp_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_link_tp_id(self): + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=False) + + + def _get_node_id(self): + """ + Getter method for node_id, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_route_objects/path_route_object/unnumbered_link_hop/node_id (te-node-id) + + YANG Description: The identifier of a node in the TE topology. + """ + return self.__node_id + + def _set_node_id(self, v, load=False): + """ + Setter method for node_id, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_route_objects/path_route_object/unnumbered_link_hop/node_id (te-node-id) + 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. + + YANG Description: The identifier of a node in the TE topology. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """node_id must be of a type compatible with te-node-id""", + 'defined-type': "ietf-te-topology:te-node-id", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=False)""", + }) + + self.__node_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_node_id(self): + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=False) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_route_objects/path_route_object/unnumbered_link_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_route_objects/path_route_object/unnumbered_link_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + 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={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + + + def _get_direction(self): + """ + Getter method for direction, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_route_objects/path_route_object/unnumbered_link_hop/direction (te-link-direction) + + YANG Description: Link route object direction. + """ + return self.__direction + + def _set_direction(self, v, load=False): + """ + Setter method for direction, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_route_objects/path_route_object/unnumbered_link_hop/direction (te-link-direction) + If this variable is read-only (config: false) in the + source YANG file, then _set_direction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_direction() directly. + + YANG Description: Link route object direction. + """ + 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={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """direction must be of a type compatible with te-link-direction""", + 'defined-type': "ietf-te-topology:te-link-direction", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=False)""", + }) + + self.__direction = t + if hasattr(self, '_set'): + self._set() + + def _unset_direction(self): + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=False) + + link_tp_id = __builtin__.property(_get_link_tp_id) + node_id = __builtin__.property(_get_node_id) + hop_type = __builtin__.property(_get_hop_type) + direction = __builtin__.property(_get_direction) + + __choices__ = {'type': {'unnumbered-link-hop': ['link_tp_id', 'node_id', 'hop_type', 'direction']}} + _pyangbind_elements = OrderedDict([('link_tp_id', link_tp_id), ('node_id', node_id), ('hop_type', hop_type), ('direction', direction), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_srlgs_lists/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_srlgs_lists/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..b6b374b8c1e0392f46c09b2b228c69ae59d5cb5f --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_srlgs_lists/__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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 path_srlgs_list +class path_srlgs_lists(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/path-properties/path-srlgs-lists. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Path SRLG properties container. + """ + __slots__ = ('_path_helper', '_extmethods', '__path_srlgs_list',) + + _yang_name = 'path-srlgs-lists' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__path_srlgs_list = YANGDynClass(base=YANGListType("usage",path_srlgs_list.path_srlgs_list, yang_name="path-srlgs-list", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-srlgs-list", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', 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 ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'path-properties', 'path-srlgs-lists'] + + def _get_path_srlgs_list(self): + """ + Getter method for path_srlgs_list, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_srlgs_lists/path_srlgs_list (list) + + YANG Description: List of SRLG values to be included or excluded. + """ + return self.__path_srlgs_list + + def _set_path_srlgs_list(self, v, load=False): + """ + Setter method for path_srlgs_list, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_srlgs_lists/path_srlgs_list (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_srlgs_list is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_srlgs_list() directly. + + YANG Description: List of SRLG values to be included or excluded. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("usage",path_srlgs_list.path_srlgs_list, yang_name="path-srlgs-list", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-srlgs-list", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_srlgs_list must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("usage",path_srlgs_list.path_srlgs_list, yang_name="path-srlgs-list", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-srlgs-list", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False)""", + }) + + self.__path_srlgs_list = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_srlgs_list(self): + self.__path_srlgs_list = YANGDynClass(base=YANGListType("usage",path_srlgs_list.path_srlgs_list, yang_name="path-srlgs-list", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-srlgs-list", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + + path_srlgs_list = __builtin__.property(_get_path_srlgs_list) + + + _pyangbind_elements = OrderedDict([('path_srlgs_list', path_srlgs_list), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_srlgs_lists/path_srlgs_list/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_srlgs_lists/path_srlgs_list/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..59e2a8be232fd3e7b825e5c8f77d34eecbd25490 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_srlgs_lists/path_srlgs_list/__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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 path_srlgs_list(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/path-properties/path-srlgs-lists/path-srlgs-list. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: List of SRLG values to be included or excluded. + """ + __slots__ = ('_path_helper', '_extmethods', '__usage','__values',) + + _yang_name = 'path-srlgs-list' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__usage = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + self.__values = YANGDynClass(unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32)), is_leaf=False, yang_name="values", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='srlg', 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 ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'path-properties', 'path-srlgs-lists', 'path-srlgs-list'] + + def _get_usage(self): + """ + Getter method for usage, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_srlgs_lists/path_srlgs_list/usage (identityref) + + YANG Description: Identifies an entry in a list of SRLGs to either +include or exclude. + """ + return self.__usage + + def _set_usage(self, v, load=False): + """ + Setter method for usage, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_srlgs_lists/path_srlgs_list/usage (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_usage is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_usage() directly. + + YANG Description: Identifies an entry in a list of SRLGs to either +include or exclude. + """ + 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=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """usage must be of a type compatible with identityref""", + 'defined-type': "ietf-te-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False)""", + }) + + self.__usage = t + if hasattr(self, '_set'): + self._set() + + def _unset_usage(self): + self.__usage = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + + + def _get_values(self): + """ + Getter method for values, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_srlgs_lists/path_srlgs_list/values (srlg) + + YANG Description: List of SRLG values. + """ + return self.__values + + def _set_values(self, v, load=False): + """ + Setter method for values, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_srlgs_lists/path_srlgs_list/values (srlg) + If this variable is read-only (config: false) in the + source YANG file, then _set_values is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_values() directly. + + YANG Description: List of SRLG values. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32)), is_leaf=False, yang_name="values", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='srlg', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """values must be of a type compatible with srlg""", + 'defined-type': "ietf-te-topology:srlg", + 'generated-type': """YANGDynClass(unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32)), is_leaf=False, yang_name="values", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='srlg', is_config=False)""", + }) + + self.__values = t + if hasattr(self, '_set'): + self._set() + + def _unset_values(self): + self.__values = YANGDynClass(unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32)), is_leaf=False, yang_name="values", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='srlg', is_config=False) + + usage = __builtin__.property(_get_usage) + values = __builtin__.property(_get_values) + + + _pyangbind_elements = OrderedDict([('usage', usage), ('values', values), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_srlgs_names/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_srlgs_names/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..10673844150c886a74e09133e59d07cd663f56eb --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_srlgs_names/__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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 path_srlgs_name +class path_srlgs_names(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/path-properties/path-srlgs-names. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Container for the list of named SRLGs. + """ + __slots__ = ('_path_helper', '_extmethods', '__path_srlgs_name',) + + _yang_name = 'path-srlgs-names' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__path_srlgs_name = YANGDynClass(base=YANGListType("usage",path_srlgs_name.path_srlgs_name, yang_name="path-srlgs-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-srlgs-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', 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 ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'path-properties', 'path-srlgs-names'] + + def _get_path_srlgs_name(self): + """ + Getter method for path_srlgs_name, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_srlgs_names/path_srlgs_name (list) + + YANG Description: List of named SRLGs to be included or excluded. + """ + return self.__path_srlgs_name + + def _set_path_srlgs_name(self, v, load=False): + """ + Setter method for path_srlgs_name, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_srlgs_names/path_srlgs_name (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_srlgs_name is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_srlgs_name() directly. + + YANG Description: List of named SRLGs to be included or excluded. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("usage",path_srlgs_name.path_srlgs_name, yang_name="path-srlgs-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-srlgs-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_srlgs_name must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("usage",path_srlgs_name.path_srlgs_name, yang_name="path-srlgs-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-srlgs-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False)""", + }) + + self.__path_srlgs_name = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_srlgs_name(self): + self.__path_srlgs_name = YANGDynClass(base=YANGListType("usage",path_srlgs_name.path_srlgs_name, yang_name="path-srlgs-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-srlgs-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + + path_srlgs_name = __builtin__.property(_get_path_srlgs_name) + + + _pyangbind_elements = OrderedDict([('path_srlgs_name', path_srlgs_name), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_srlgs_names/path_srlgs_name/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_srlgs_names/path_srlgs_name/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..20a2aee2aaf4e0712a6c94a1ac22d09a164c253f --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_srlgs_names/path_srlgs_name/__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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 path_srlgs_name(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/path-properties/path-srlgs-names/path-srlgs-name. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: List of named SRLGs to be included or excluded. + """ + __slots__ = ('_path_helper', '_extmethods', '__usage','__names',) + + _yang_name = 'path-srlgs-name' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__usage = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + self.__names = YANGDynClass(unique=True, base=TypedListType(allowed_type=six.text_type), is_leaf=False, yang_name="names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', 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 ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'path-properties', 'path-srlgs-names', 'path-srlgs-name'] + + def _get_usage(self): + """ + Getter method for usage, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_srlgs_names/path_srlgs_name/usage (identityref) + + YANG Description: Identifies an entry in a list of named SRLGs to either +include or exclude. + """ + return self.__usage + + def _set_usage(self, v, load=False): + """ + Setter method for usage, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_srlgs_names/path_srlgs_name/usage (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_usage is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_usage() directly. + + YANG Description: Identifies an entry in a list of named SRLGs to either +include or exclude. + """ + 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=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """usage must be of a type compatible with identityref""", + 'defined-type': "ietf-te-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False)""", + }) + + self.__usage = t + if hasattr(self, '_set'): + self._set() + + def _unset_usage(self): + self.__usage = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + + + def _get_names(self): + """ + Getter method for names, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_srlgs_names/path_srlgs_name/names (string) + + YANG Description: List of named SRLGs. + """ + return self.__names + + def _set_names(self, v, load=False): + """ + Setter method for names, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_srlgs_names/path_srlgs_name/names (string) + If this variable is read-only (config: false) in the + source YANG file, then _set_names is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_names() directly. + + YANG Description: List of named SRLGs. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,unique=True, base=TypedListType(allowed_type=six.text_type), is_leaf=False, yang_name="names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """names must be of a type compatible with string""", + 'defined-type': "string", + 'generated-type': """YANGDynClass(unique=True, base=TypedListType(allowed_type=six.text_type), is_leaf=False, yang_name="names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=False)""", + }) + + self.__names = t + if hasattr(self, '_set'): + self._set() + + def _unset_names(self): + self.__names = YANGDynClass(unique=True, base=TypedListType(allowed_type=six.text_type), is_leaf=False, yang_name="names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=False) + + usage = __builtin__.property(_get_usage) + names = __builtin__.property(_get_names) + + + _pyangbind_elements = OrderedDict([('usage', usage), ('names', names), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..4d1acaeb59c441fc4e85bd31e4b5c959646b4410 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/__init__.py @@ -0,0 +1,326 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 primary_path +from . import backup_path +from . import tunnel_termination_points +from . import tunnels +class underlay(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/underlay. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Attributes of the TE link underlay. + """ + __slots__ = ('_path_helper', '_extmethods', '__enabled','__primary_path','__backup_path','__protection_type','__tunnel_termination_points','__tunnels',) + + _yang_name = 'underlay' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__enabled = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="enabled", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='boolean', is_config=True) + self.__primary_path = YANGDynClass(base=primary_path.primary_path, is_container='container', yang_name="primary-path", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__backup_path = YANGDynClass(base=YANGListType("index",backup_path.backup_path, yang_name="backup-path", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='index', extensions=None), is_container='list', yang_name="backup-path", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + self.__protection_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'lsp-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-reroute-extra': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-reroute-extra': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-reroute-extra': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-reroute': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-reroute': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-reroute': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-1-for-n': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-1-for-n': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-1-for-n': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-unidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-unidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-unidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-bidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-bidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-bidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="protection-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + self.__tunnel_termination_points = YANGDynClass(base=tunnel_termination_points.tunnel_termination_points, is_container='container', yang_name="tunnel-termination-points", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__tunnels = YANGDynClass(base=tunnels.tunnels, is_container='container', yang_name="tunnels", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-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 ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'underlay'] + + def _get_enabled(self): + """ + Getter method for enabled, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/enabled (boolean) + + YANG Description: 'true' if the underlay is enabled. +'false' if the underlay is disabled. + """ + return self.__enabled + + def _set_enabled(self, v, load=False): + """ + Setter method for enabled, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/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: 'true' if the underlay is enabled. +'false' if the underlay is disabled. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBool, is_leaf=True, yang_name="enabled", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', 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, is_leaf=True, yang_name="enabled", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='boolean', is_config=True)""", + }) + + self.__enabled = t + if hasattr(self, '_set'): + self._set() + + def _unset_enabled(self): + self.__enabled = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="enabled", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='boolean', is_config=True) + + + def _get_primary_path(self): + """ + Getter method for primary_path, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/primary_path (container) + + YANG Description: The service path on the underlay topology that +supports this link. + """ + return self.__primary_path + + def _set_primary_path(self, v, load=False): + """ + Setter method for primary_path, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/primary_path (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_primary_path is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_primary_path() directly. + + YANG Description: The service path on the underlay topology that +supports this link. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=primary_path.primary_path, is_container='container', yang_name="primary-path", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """primary_path must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=primary_path.primary_path, is_container='container', yang_name="primary-path", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__primary_path = t + if hasattr(self, '_set'): + self._set() + + def _unset_primary_path(self): + self.__primary_path = YANGDynClass(base=primary_path.primary_path, is_container='container', yang_name="primary-path", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_backup_path(self): + """ + Getter method for backup_path, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/backup_path (list) + + YANG Description: A list of backup service paths on the underlay topology that +protect the underlay primary path. If the primary path is +not protected, the list contains zero elements. If the +primary path is protected, the list contains one or more +elements. + """ + return self.__backup_path + + def _set_backup_path(self, v, load=False): + """ + Setter method for backup_path, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/backup_path (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_backup_path is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_backup_path() directly. + + YANG Description: A list of backup service paths on the underlay topology that +protect the underlay primary path. If the primary path is +not protected, the list contains zero elements. If the +primary path is protected, the list contains one or more +elements. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("index",backup_path.backup_path, yang_name="backup-path", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='index', extensions=None), is_container='list', yang_name="backup-path", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """backup_path must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("index",backup_path.backup_path, yang_name="backup-path", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='index', extensions=None), is_container='list', yang_name="backup-path", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True)""", + }) + + self.__backup_path = t + if hasattr(self, '_set'): + self._set() + + def _unset_backup_path(self): + self.__backup_path = YANGDynClass(base=YANGListType("index",backup_path.backup_path, yang_name="backup-path", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='index', extensions=None), is_container='list', yang_name="backup-path", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + + + def _get_protection_type(self): + """ + Getter method for protection_type, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/protection_type (identityref) + + YANG Description: Underlay protection type desired for this link. + """ + return self.__protection_type + + def _set_protection_type(self, v, load=False): + """ + Setter method for protection_type, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/protection_type (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_protection_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_protection_type() directly. + + YANG Description: Underlay protection type desired for this link. + """ + 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={'lsp-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-reroute-extra': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-reroute-extra': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-reroute-extra': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-reroute': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-reroute': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-reroute': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-1-for-n': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-1-for-n': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-1-for-n': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-unidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-unidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-unidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-bidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-bidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-bidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="protection-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """protection_type must be of a type compatible with identityref""", + 'defined-type': "ietf-te-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'lsp-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-reroute-extra': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-reroute-extra': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-reroute-extra': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-reroute': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-reroute': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-reroute': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-1-for-n': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-1-for-n': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-1-for-n': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-unidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-unidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-unidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-bidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-bidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-bidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="protection-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True)""", + }) + + self.__protection_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_protection_type(self): + self.__protection_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'lsp-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-reroute-extra': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-reroute-extra': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-reroute-extra': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-reroute': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-reroute': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-reroute': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-1-for-n': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-1-for-n': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-1-for-n': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-unidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-unidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-unidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-bidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-bidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-bidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="protection-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + + + def _get_tunnel_termination_points(self): + """ + Getter method for tunnel_termination_points, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/tunnel_termination_points (container) + + YANG Description: Underlay TTPs desired for this link. + """ + return self.__tunnel_termination_points + + def _set_tunnel_termination_points(self, v, load=False): + """ + Setter method for tunnel_termination_points, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/tunnel_termination_points (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_tunnel_termination_points is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tunnel_termination_points() directly. + + YANG Description: Underlay TTPs desired for this link. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=tunnel_termination_points.tunnel_termination_points, is_container='container', yang_name="tunnel-termination-points", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tunnel_termination_points must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=tunnel_termination_points.tunnel_termination_points, is_container='container', yang_name="tunnel-termination-points", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__tunnel_termination_points = t + if hasattr(self, '_set'): + self._set() + + def _unset_tunnel_termination_points(self): + self.__tunnel_termination_points = YANGDynClass(base=tunnel_termination_points.tunnel_termination_points, is_container='container', yang_name="tunnel-termination-points", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_tunnels(self): + """ + Getter method for tunnels, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/tunnels (container) + + YANG Description: Underlay TE tunnels supporting this TE link. + """ + return self.__tunnels + + def _set_tunnels(self, v, load=False): + """ + Setter method for tunnels, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/tunnels (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_tunnels is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tunnels() directly. + + YANG Description: Underlay TE tunnels supporting this TE link. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=tunnels.tunnels, is_container='container', yang_name="tunnels", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tunnels must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=tunnels.tunnels, is_container='container', yang_name="tunnels", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__tunnels = t + if hasattr(self, '_set'): + self._set() + + def _unset_tunnels(self): + self.__tunnels = YANGDynClass(base=tunnels.tunnels, is_container='container', yang_name="tunnels", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + enabled = __builtin__.property(_get_enabled, _set_enabled) + primary_path = __builtin__.property(_get_primary_path, _set_primary_path) + backup_path = __builtin__.property(_get_backup_path, _set_backup_path) + protection_type = __builtin__.property(_get_protection_type, _set_protection_type) + tunnel_termination_points = __builtin__.property(_get_tunnel_termination_points, _set_tunnel_termination_points) + tunnels = __builtin__.property(_get_tunnels, _set_tunnels) + + + _pyangbind_elements = OrderedDict([('enabled', enabled), ('primary_path', primary_path), ('backup_path', backup_path), ('protection_type', protection_type), ('tunnel_termination_points', tunnel_termination_points), ('tunnels', tunnels), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/backup_path/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/backup_path/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..d6dae020814684bdfb0b995cd3112c73fbf7a82e --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/backup_path/__init__.py @@ -0,0 +1,207 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 path_element +class backup_path(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/underlay/backup-path. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: A list of backup service paths on the underlay topology that +protect the underlay primary path. If the primary path is +not protected, the list contains zero elements. If the +primary path is protected, the list contains one or more +elements. + """ + __slots__ = ('_path_helper', '_extmethods', '__index','__network_ref','__path_element',) + + _yang_name = 'backup-path' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _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), is_leaf=True, yang_name="index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + self.__network_ref = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="network-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=True) + self.__path_element = YANGDynClass(base=YANGListType("path_element_id",path_element.path_element, yang_name="path-element", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='path-element-id', extensions=None), is_container='list', yang_name="path-element", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-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 ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'underlay', 'backup-path'] + + def _get_index(self): + """ + Getter method for index, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/backup_path/index (uint32) + + YANG Description: A sequence number to identify a backup path. + """ + return self.__index + + def _set_index(self, v, load=False): + """ + Setter method for index, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/backup_path/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: A sequence number to identify a backup path. + """ + 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=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', 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), is_leaf=True, yang_name="index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', 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), is_leaf=True, yang_name="index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + + + def _get_network_ref(self): + """ + Getter method for network_ref, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/backup_path/network_ref (leafref) + + YANG Description: Used to reference a network -- for example, an underlay +network. + """ + return self.__network_ref + + def _set_network_ref(self, v, load=False): + """ + Setter method for network_ref, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/backup_path/network_ref (leafref) + If this variable is read-only (config: false) in the + source YANG file, then _set_network_ref is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_network_ref() directly. + + YANG Description: Used to reference a network -- for example, an underlay +network. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="network-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """network_ref must be of a type compatible with leafref""", + 'defined-type': "leafref", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="network-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=True)""", + }) + + self.__network_ref = t + if hasattr(self, '_set'): + self._set() + + def _unset_network_ref(self): + self.__network_ref = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="network-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=True) + + + def _get_path_element(self): + """ + Getter method for path_element, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/backup_path/path_element (list) + + YANG Description: A list of path elements describing the backup service +path. + """ + return self.__path_element + + def _set_path_element(self, v, load=False): + """ + Setter method for path_element, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/backup_path/path_element (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_element is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_element() directly. + + YANG Description: A list of path elements describing the backup service +path. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("path_element_id",path_element.path_element, yang_name="path-element", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='path-element-id', extensions=None), is_container='list', yang_name="path-element", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_element must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("path_element_id",path_element.path_element, yang_name="path-element", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='path-element-id', extensions=None), is_container='list', yang_name="path-element", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True)""", + }) + + self.__path_element = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_element(self): + self.__path_element = YANGDynClass(base=YANGListType("path_element_id",path_element.path_element, yang_name="path-element", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='path-element-id', extensions=None), is_container='list', yang_name="path-element", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + + index = __builtin__.property(_get_index, _set_index) + network_ref = __builtin__.property(_get_network_ref, _set_network_ref) + path_element = __builtin__.property(_get_path_element, _set_path_element) + + + _pyangbind_elements = OrderedDict([('index', index), ('network_ref', network_ref), ('path_element', path_element), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/backup_path/path_element/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/backup_path/path_element/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..32f0ddafba5db1546c8ad50177a73780a0b1b5fa --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/backup_path/path_element/__init__.py @@ -0,0 +1,321 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 numbered_node_hop +from . import numbered_link_hop +from . import unnumbered_link_hop +from . import as_number_hop +from . import label_hop +class path_element(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/underlay/backup-path/path-element. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: A list of path elements describing the backup service +path. + """ + __slots__ = ('_path_helper', '_extmethods', '__path_element_id','__numbered_node_hop','__numbered_link_hop','__unnumbered_link_hop','__as_number_hop','__label_hop',) + + _yang_name = 'path-element' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__path_element_id = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="path-element-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + self.__numbered_node_hop = YANGDynClass(base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__numbered_link_hop = YANGDynClass(base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__unnumbered_link_hop = YANGDynClass(base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__as_number_hop = YANGDynClass(base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__label_hop = YANGDynClass(base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-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 ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'underlay', 'backup-path', 'path-element'] + + def _get_path_element_id(self): + """ + Getter method for path_element_id, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/backup_path/path_element/path_element_id (uint32) + + YANG Description: To identify the element in a path. + """ + return self.__path_element_id + + def _set_path_element_id(self, v, load=False): + """ + Setter method for path_element_id, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/backup_path/path_element/path_element_id (uint32) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_element_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_element_id() directly. + + YANG Description: To identify the element in a path. + """ + 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=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="path-element-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_element_id 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="path-element-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True)""", + }) + + self.__path_element_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_element_id(self): + self.__path_element_id = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="path-element-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + + + def _get_numbered_node_hop(self): + """ + Getter method for numbered_node_hop, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/backup_path/path_element/numbered_node_hop (container) + + YANG Description: Numbered node route hop. + """ + return self.__numbered_node_hop + + def _set_numbered_node_hop(self, v, load=False): + """ + Setter method for numbered_node_hop, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/backup_path/path_element/numbered_node_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_numbered_node_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_numbered_node_hop() directly. + + YANG Description: Numbered node route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """numbered_node_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__numbered_node_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_numbered_node_hop(self): + self.__numbered_node_hop = YANGDynClass(base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_numbered_link_hop(self): + """ + Getter method for numbered_link_hop, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/backup_path/path_element/numbered_link_hop (container) + + YANG Description: Numbered link explicit route hop. + """ + return self.__numbered_link_hop + + def _set_numbered_link_hop(self, v, load=False): + """ + Setter method for numbered_link_hop, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/backup_path/path_element/numbered_link_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_numbered_link_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_numbered_link_hop() directly. + + YANG Description: Numbered link explicit route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """numbered_link_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__numbered_link_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_numbered_link_hop(self): + self.__numbered_link_hop = YANGDynClass(base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_unnumbered_link_hop(self): + """ + Getter method for unnumbered_link_hop, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/backup_path/path_element/unnumbered_link_hop (container) + + YANG Description: Unnumbered link explicit route hop. + """ + return self.__unnumbered_link_hop + + def _set_unnumbered_link_hop(self, v, load=False): + """ + Setter method for unnumbered_link_hop, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/backup_path/path_element/unnumbered_link_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_unnumbered_link_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_unnumbered_link_hop() directly. + + YANG Description: Unnumbered link explicit route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """unnumbered_link_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__unnumbered_link_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_unnumbered_link_hop(self): + self.__unnumbered_link_hop = YANGDynClass(base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_as_number_hop(self): + """ + Getter method for as_number_hop, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/backup_path/path_element/as_number_hop (container) + + YANG Description: AS explicit route hop. + """ + return self.__as_number_hop + + def _set_as_number_hop(self, v, load=False): + """ + Setter method for as_number_hop, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/backup_path/path_element/as_number_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_as_number_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_as_number_hop() directly. + + YANG Description: AS explicit route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """as_number_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__as_number_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_as_number_hop(self): + self.__as_number_hop = YANGDynClass(base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_label_hop(self): + """ + Getter method for label_hop, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/backup_path/path_element/label_hop (container) + + YANG Description: Label hop type. + """ + return self.__label_hop + + def _set_label_hop(self, v, load=False): + """ + Setter method for label_hop, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/backup_path/path_element/label_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_label_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_label_hop() directly. + + YANG Description: Label hop type. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """label_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__label_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_label_hop(self): + self.__label_hop = YANGDynClass(base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + path_element_id = __builtin__.property(_get_path_element_id, _set_path_element_id) + numbered_node_hop = __builtin__.property(_get_numbered_node_hop, _set_numbered_node_hop) + numbered_link_hop = __builtin__.property(_get_numbered_link_hop, _set_numbered_link_hop) + unnumbered_link_hop = __builtin__.property(_get_unnumbered_link_hop, _set_unnumbered_link_hop) + as_number_hop = __builtin__.property(_get_as_number_hop, _set_as_number_hop) + label_hop = __builtin__.property(_get_label_hop, _set_label_hop) + + __choices__ = {'type': {'numbered-node-hop': ['numbered_node_hop'], 'numbered-link-hop': ['numbered_link_hop'], 'unnumbered-link-hop': ['unnumbered_link_hop'], 'as-number': ['as_number_hop'], 'label': ['label_hop']}} + _pyangbind_elements = OrderedDict([('path_element_id', path_element_id), ('numbered_node_hop', numbered_node_hop), ('numbered_link_hop', numbered_link_hop), ('unnumbered_link_hop', unnumbered_link_hop), ('as_number_hop', as_number_hop), ('label_hop', label_hop), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/backup_path/path_element/as_number_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/backup_path/path_element/as_number_hop/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..3522a13e96033c1b2936edb56798e8b8c6ecca67 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/backup_path/path_element/as_number_hop/__init__.py @@ -0,0 +1,154 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 as_number_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/underlay/backup-path/path-element/as-number-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: AS explicit route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__as_number','__hop_type',) + + _yang_name = 'as-number-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__as_number = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=True) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', 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 ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'underlay', 'backup-path', 'path-element', 'as-number-hop'] + + def _get_as_number(self): + """ + Getter method for as_number, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/backup_path/path_element/as_number_hop/as_number (inet:as-number) + + YANG Description: The Autonomous System (AS) number. + """ + return self.__as_number + + def _set_as_number(self, v, load=False): + """ + Setter method for as_number, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/backup_path/path_element/as_number_hop/as_number (inet:as-number) + If this variable is read-only (config: false) in the + source YANG file, then _set_as_number is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_as_number() directly. + + YANG Description: The Autonomous System (AS) number. + """ + 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="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """as_number must be of a type compatible with inet:as-number""", + 'defined-type': "inet:as-number", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=True)""", + }) + + self.__as_number = t + if hasattr(self, '_set'): + self._set() + + def _unset_as_number(self): + self.__as_number = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=True) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/backup_path/path_element/as_number_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/backup_path/path_element/as_number_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + 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={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + + as_number = __builtin__.property(_get_as_number, _set_as_number) + hop_type = __builtin__.property(_get_hop_type, _set_hop_type) + + __choices__ = {'type': {'as-number': ['as_number', 'hop_type']}} + _pyangbind_elements = OrderedDict([('as_number', as_number), ('hop_type', hop_type), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/backup_path/path_element/label_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/backup_path/path_element/label_hop/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..ce150a6055725d0d19578db2459899d1890731d3 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/backup_path/path_element/label_hop/__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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 te_label +class label_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/underlay/backup-path/path-element/label-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Label hop type. + """ + __slots__ = ('_path_helper', '_extmethods', '__te_label',) + + _yang_name = 'label-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__te_label = YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-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 ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'underlay', 'backup-path', 'path-element', 'label-hop'] + + def _get_te_label(self): + """ + Getter method for te_label, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/backup_path/path_element/label_hop/te_label (container) + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + return self.__te_label + + def _set_te_label(self, v, load=False): + """ + Setter method for te_label, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/backup_path/path_element/label_hop/te_label (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_te_label is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_te_label() directly. + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """te_label must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__te_label = t + if hasattr(self, '_set'): + self._set() + + def _unset_te_label(self): + self.__te_label = YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + te_label = __builtin__.property(_get_te_label, _set_te_label) + + __choices__ = {'type': {'label': ['te_label']}} + _pyangbind_elements = OrderedDict([('te_label', te_label), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/backup_path/path_element/label_hop/te_label/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/backup_path/path_element/label_hop/te_label/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..ef37b6389233bdb4c07a827476bbe779dc4a3dd1 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/backup_path/path_element/label_hop/te_label/__init__.py @@ -0,0 +1,234 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 otn +class te_label(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/underlay/backup-path/path-element/label-hop/te-label. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + __slots__ = ('_path_helper', '_extmethods', '__generic','__otn','__vlanid','__direction',) + + _yang_name = 'te-label' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__generic = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True) + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + self.__vlanid = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True) + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', 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 ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'underlay', 'backup-path', 'path-element', 'label-hop', 'te-label'] + + def _get_generic(self): + """ + Getter method for generic, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/backup_path/path_element/label_hop/te_label/generic (rt-types:generalized-label) + + YANG Description: TE label specified in a generic format. + """ + return self.__generic + + def _set_generic(self, v, load=False): + """ + Setter method for generic, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/backup_path/path_element/label_hop/te_label/generic (rt-types:generalized-label) + If this variable is read-only (config: false) in the + source YANG file, then _set_generic is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_generic() directly. + + YANG Description: TE label specified in a generic format. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """generic must be of a type compatible with rt-types:generalized-label""", + 'defined-type': "rt-types:generalized-label", + 'generated-type': """YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True)""", + }) + + self.__generic = t + if hasattr(self, '_set'): + self._set() + + def _unset_generic(self): + self.__generic = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True) + + + def _get_otn(self): + """ + Getter method for otn, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/backup_path/path_element/label_hop/te_label/otn (container) + + YANG Description: Label hop for OTN. + """ + return self.__otn + + def _set_otn(self, v, load=False): + """ + Setter method for otn, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/backup_path/path_element/label_hop/te_label/otn (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_otn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_otn() directly. + + YANG Description: Label hop for OTN. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """otn must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True)""", + }) + + self.__otn = t + if hasattr(self, '_set'): + self._set() + + def _unset_otn(self): + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + + + def _get_vlanid(self): + """ + Getter method for vlanid, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/backup_path/path_element/label_hop/te_label/vlanid (etht-types:vlanid) + + YANG Description: VLAN tag id. + """ + return self.__vlanid + + def _set_vlanid(self, v, load=False): + """ + Setter method for vlanid, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/backup_path/path_element/label_hop/te_label/vlanid (etht-types:vlanid) + If this variable is read-only (config: false) in the + source YANG file, then _set_vlanid is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_vlanid() directly. + + YANG Description: VLAN tag id. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """vlanid must be of a type compatible with etht-types:vlanid""", + 'defined-type': "etht-types:vlanid", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True)""", + }) + + self.__vlanid = t + if hasattr(self, '_set'): + self._set() + + def _unset_vlanid(self): + self.__vlanid = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True) + + + def _get_direction(self): + """ + Getter method for direction, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/backup_path/path_element/label_hop/te_label/direction (te-label-direction) + + YANG Description: Label direction. + """ + return self.__direction + + def _set_direction(self, v, load=False): + """ + Setter method for direction, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/backup_path/path_element/label_hop/te_label/direction (te-label-direction) + If this variable is read-only (config: false) in the + source YANG file, then _set_direction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_direction() directly. + + YANG Description: Label direction. + """ + 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={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """direction must be of a type compatible with te-label-direction""", + 'defined-type': "ietf-te-topology:te-label-direction", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=True)""", + }) + + self.__direction = t + if hasattr(self, '_set'): + self._set() + + def _unset_direction(self): + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=True) + + generic = __builtin__.property(_get_generic, _set_generic) + otn = __builtin__.property(_get_otn, _set_otn) + vlanid = __builtin__.property(_get_vlanid, _set_vlanid) + direction = __builtin__.property(_get_direction, _set_direction) + + __choices__ = {'technology': {'generic': ['generic'], 'otn': ['otn'], 'eth': ['vlanid']}, 'type': {'label': ['direction']}} + _pyangbind_elements = OrderedDict([('generic', generic), ('otn', otn), ('vlanid', vlanid), ('direction', direction), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/backup_path/path_element/label_hop/te_label/otn/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/backup_path/path_element/label_hop/te_label/otn/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..64da0e1fd7327284ece6dd1baf8cb7e64314a0d4 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/backup_path/path_element/label_hop/te_label/otn/__init__.py @@ -0,0 +1,209 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 otn(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/underlay/backup-path/path-element/label-hop/te-label/otn. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Label hop for OTN. + """ + __slots__ = ('_path_helper', '_extmethods', '__tpn','__tsg','__ts_list',) + + _yang_name = 'otn' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__tpn = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True) + self.__tsg = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + self.__ts_list = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-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 ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'underlay', 'backup-path', 'path-element', 'label-hop', 'te-label', 'otn'] + + def _get_tpn(self): + """ + Getter method for tpn, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/backup_path/path_element/label_hop/te_label/otn/tpn (otn-tpn) + + YANG Description: Tributary Port Number (TPN). + """ + return self.__tpn + + def _set_tpn(self, v, load=False): + """ + Setter method for tpn, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/backup_path/path_element/label_hop/te_label/otn/tpn (otn-tpn) + If this variable is read-only (config: false) in the + source YANG file, then _set_tpn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tpn() directly. + + YANG Description: Tributary Port Number (TPN). + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tpn must be of a type compatible with otn-tpn""", + 'defined-type': "ietf-otn-topology:otn-tpn", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True)""", + }) + + self.__tpn = t + if hasattr(self, '_set'): + self._set() + + def _unset_tpn(self): + self.__tpn = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True) + + + def _get_tsg(self): + """ + Getter method for tsg, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/backup_path/path_element/label_hop/te_label/otn/tsg (identityref) + + YANG Description: Tributary Slot Granularity (TSG). + """ + return self.__tsg + + def _set_tsg(self, v, load=False): + """ + Setter method for tsg, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/backup_path/path_element/label_hop/te_label/otn/tsg (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_tsg is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tsg() directly. + + YANG Description: Tributary Slot Granularity (TSG). + """ + 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={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tsg must be of a type compatible with identityref""", + 'defined-type': "ietf-otn-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True)""", + }) + + self.__tsg = t + if hasattr(self, '_set'): + self._set() + + def _unset_tsg(self): + self.__tsg = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + + + def _get_ts_list(self): + """ + Getter method for ts_list, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/backup_path/path_element/label_hop/te_label/otn/ts_list (string) + + YANG Description: A list of available Tributary Slots (TS) ranging + + + + +between 1 and 4095. If multiple values or +ranges are given, they all MUST be disjoint +and MUST be in ascending order. +For example 1-20,25,50-1000. + """ + return self.__ts_list + + def _set_ts_list(self, v, load=False): + """ + Setter method for ts_list, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/backup_path/path_element/label_hop/te_label/otn/ts_list (string) + If this variable is read-only (config: false) in the + source YANG file, then _set_ts_list is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_ts_list() directly. + + YANG Description: A list of available Tributary Slots (TS) ranging + + + + +between 1 and 4095. If multiple values or +ranges are given, they all MUST be disjoint +and MUST be in ascending order. +For example 1-20,25,50-1000. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='string', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """ts_list must be of a type compatible with string""", + 'defined-type': "string", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='string', is_config=True)""", + }) + + self.__ts_list = t + if hasattr(self, '_set'): + self._set() + + def _unset_ts_list(self): + self.__ts_list = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='string', is_config=True) + + tpn = __builtin__.property(_get_tpn, _set_tpn) + tsg = __builtin__.property(_get_tsg, _set_tsg) + ts_list = __builtin__.property(_get_ts_list, _set_ts_list) + + __choices__ = {'technology': {'otn': ['tpn', 'tsg', 'ts_list']}} + _pyangbind_elements = OrderedDict([('tpn', tpn), ('tsg', tsg), ('ts_list', ts_list), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/backup_path/path_element/numbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/backup_path/path_element/numbered_link_hop/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..7b441de5c590d046d6c55cff535467fe302fc150 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/backup_path/path_element/numbered_link_hop/__init__.py @@ -0,0 +1,193 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 numbered_link_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/underlay/backup-path/path-element/numbered-link-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Numbered link explicit route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__link_tp_id','__hop_type','__direction',) + + _yang_name = 'numbered-link-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', 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 ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'underlay', 'backup-path', 'path-element', 'numbered-link-hop'] + + def _get_link_tp_id(self): + """ + Getter method for link_tp_id, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/backup_path/path_element/numbered_link_hop/link_tp_id (te-tp-id) + + YANG Description: TE Link Termination Point (LTP) identifier. + """ + return self.__link_tp_id + + def _set_link_tp_id(self, v, load=False): + """ + Setter method for link_tp_id, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/backup_path/path_element/numbered_link_hop/link_tp_id (te-tp-id) + If this variable is read-only (config: false) in the + source YANG file, then _set_link_tp_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_link_tp_id() directly. + + YANG Description: TE Link Termination Point (LTP) identifier. + """ + 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),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """link_tp_id must be of a type compatible with te-tp-id""", + 'defined-type': "ietf-te-topology:te-tp-id", + 'generated-type': """YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True)""", + }) + + self.__link_tp_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_link_tp_id(self): + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/backup_path/path_element/numbered_link_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/backup_path/path_element/numbered_link_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + 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={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + + + def _get_direction(self): + """ + Getter method for direction, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/backup_path/path_element/numbered_link_hop/direction (te-link-direction) + + YANG Description: Link route object direction. + """ + return self.__direction + + def _set_direction(self, v, load=False): + """ + Setter method for direction, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/backup_path/path_element/numbered_link_hop/direction (te-link-direction) + If this variable is read-only (config: false) in the + source YANG file, then _set_direction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_direction() directly. + + YANG Description: Link route object direction. + """ + 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={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """direction must be of a type compatible with te-link-direction""", + 'defined-type': "ietf-te-topology:te-link-direction", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True)""", + }) + + self.__direction = t + if hasattr(self, '_set'): + self._set() + + def _unset_direction(self): + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True) + + link_tp_id = __builtin__.property(_get_link_tp_id, _set_link_tp_id) + hop_type = __builtin__.property(_get_hop_type, _set_hop_type) + direction = __builtin__.property(_get_direction, _set_direction) + + __choices__ = {'type': {'numbered-link-hop': ['link_tp_id', 'hop_type', 'direction']}} + _pyangbind_elements = OrderedDict([('link_tp_id', link_tp_id), ('hop_type', hop_type), ('direction', direction), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/backup_path/path_element/numbered_node_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/backup_path/path_element/numbered_node_hop/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..9a2ff93d585b79da9c7a5a8a5633e1bca804d347 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/backup_path/path_element/numbered_node_hop/__init__.py @@ -0,0 +1,154 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 numbered_node_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/underlay/backup-path/path-element/numbered-node-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Numbered node route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__node_id','__hop_type',) + + _yang_name = 'numbered-node-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', 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 ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'underlay', 'backup-path', 'path-element', 'numbered-node-hop'] + + def _get_node_id(self): + """ + Getter method for node_id, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/backup_path/path_element/numbered_node_hop/node_id (te-node-id) + + YANG Description: The identifier of a node in the TE topology. + """ + return self.__node_id + + def _set_node_id(self, v, load=False): + """ + Setter method for node_id, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/backup_path/path_element/numbered_node_hop/node_id (te-node-id) + 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. + + YANG Description: The identifier of a node in the TE topology. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """node_id must be of a type compatible with te-node-id""", + 'defined-type': "ietf-te-topology:te-node-id", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True)""", + }) + + self.__node_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_node_id(self): + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/backup_path/path_element/numbered_node_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/backup_path/path_element/numbered_node_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + 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={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + + node_id = __builtin__.property(_get_node_id, _set_node_id) + hop_type = __builtin__.property(_get_hop_type, _set_hop_type) + + __choices__ = {'type': {'numbered-node-hop': ['node_id', 'hop_type']}} + _pyangbind_elements = OrderedDict([('node_id', node_id), ('hop_type', hop_type), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/backup_path/path_element/unnumbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/backup_path/path_element/unnumbered_link_hop/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..8f686b596028c476f635af54e3db27df9fd88d30 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/backup_path/path_element/unnumbered_link_hop/__init__.py @@ -0,0 +1,236 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 unnumbered_link_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/underlay/backup-path/path-element/unnumbered-link-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Unnumbered link explicit route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__link_tp_id','__node_id','__hop_type','__direction',) + + _yang_name = 'unnumbered-link-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True) + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', 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 ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'underlay', 'backup-path', 'path-element', 'unnumbered-link-hop'] + + def _get_link_tp_id(self): + """ + Getter method for link_tp_id, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/backup_path/path_element/unnumbered_link_hop/link_tp_id (te-tp-id) + + YANG Description: TE LTP identifier. The combination of the TE link ID +and the TE node ID is used to identify an unnumbered +TE link. + """ + return self.__link_tp_id + + def _set_link_tp_id(self, v, load=False): + """ + Setter method for link_tp_id, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/backup_path/path_element/unnumbered_link_hop/link_tp_id (te-tp-id) + If this variable is read-only (config: false) in the + source YANG file, then _set_link_tp_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_link_tp_id() directly. + + YANG Description: TE LTP identifier. The combination of the TE link ID +and the TE node ID is used to identify an unnumbered +TE link. + """ + 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),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """link_tp_id must be of a type compatible with te-tp-id""", + 'defined-type': "ietf-te-topology:te-tp-id", + 'generated-type': """YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True)""", + }) + + self.__link_tp_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_link_tp_id(self): + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True) + + + def _get_node_id(self): + """ + Getter method for node_id, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/backup_path/path_element/unnumbered_link_hop/node_id (te-node-id) + + YANG Description: The identifier of a node in the TE topology. + """ + return self.__node_id + + def _set_node_id(self, v, load=False): + """ + Setter method for node_id, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/backup_path/path_element/unnumbered_link_hop/node_id (te-node-id) + 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. + + YANG Description: The identifier of a node in the TE topology. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """node_id must be of a type compatible with te-node-id""", + 'defined-type': "ietf-te-topology:te-node-id", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True)""", + }) + + self.__node_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_node_id(self): + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/backup_path/path_element/unnumbered_link_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/backup_path/path_element/unnumbered_link_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + 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={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + + + def _get_direction(self): + """ + Getter method for direction, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/backup_path/path_element/unnumbered_link_hop/direction (te-link-direction) + + YANG Description: Link route object direction. + """ + return self.__direction + + def _set_direction(self, v, load=False): + """ + Setter method for direction, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/backup_path/path_element/unnumbered_link_hop/direction (te-link-direction) + If this variable is read-only (config: false) in the + source YANG file, then _set_direction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_direction() directly. + + YANG Description: Link route object direction. + """ + 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={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """direction must be of a type compatible with te-link-direction""", + 'defined-type': "ietf-te-topology:te-link-direction", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True)""", + }) + + self.__direction = t + if hasattr(self, '_set'): + self._set() + + def _unset_direction(self): + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True) + + link_tp_id = __builtin__.property(_get_link_tp_id, _set_link_tp_id) + node_id = __builtin__.property(_get_node_id, _set_node_id) + hop_type = __builtin__.property(_get_hop_type, _set_hop_type) + direction = __builtin__.property(_get_direction, _set_direction) + + __choices__ = {'type': {'unnumbered-link-hop': ['link_tp_id', 'node_id', 'hop_type', 'direction']}} + _pyangbind_elements = OrderedDict([('link_tp_id', link_tp_id), ('node_id', node_id), ('hop_type', hop_type), ('direction', direction), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/primary_path/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/primary_path/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..c75b0b21600a332b60b58712fdde9934b9547e11 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/primary_path/__init__.py @@ -0,0 +1,158 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 path_element +class primary_path(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/underlay/primary-path. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: The service path on the underlay topology that +supports this link. + """ + __slots__ = ('_path_helper', '_extmethods', '__network_ref','__path_element',) + + _yang_name = 'primary-path' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__network_ref = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="network-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=True) + self.__path_element = YANGDynClass(base=YANGListType("path_element_id",path_element.path_element, yang_name="path-element", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='path-element-id', extensions=None), is_container='list', yang_name="path-element", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-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 ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'underlay', 'primary-path'] + + def _get_network_ref(self): + """ + Getter method for network_ref, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/primary_path/network_ref (leafref) + + YANG Description: Used to reference a network -- for example, an underlay +network. + """ + return self.__network_ref + + def _set_network_ref(self, v, load=False): + """ + Setter method for network_ref, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/primary_path/network_ref (leafref) + If this variable is read-only (config: false) in the + source YANG file, then _set_network_ref is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_network_ref() directly. + + YANG Description: Used to reference a network -- for example, an underlay +network. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="network-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """network_ref must be of a type compatible with leafref""", + 'defined-type': "leafref", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="network-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=True)""", + }) + + self.__network_ref = t + if hasattr(self, '_set'): + self._set() + + def _unset_network_ref(self): + self.__network_ref = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="network-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=True) + + + def _get_path_element(self): + """ + Getter method for path_element, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/primary_path/path_element (list) + + YANG Description: A list of path elements describing the service path. + """ + return self.__path_element + + def _set_path_element(self, v, load=False): + """ + Setter method for path_element, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/primary_path/path_element (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_element is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_element() directly. + + YANG Description: A list of path elements describing the service path. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("path_element_id",path_element.path_element, yang_name="path-element", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='path-element-id', extensions=None), is_container='list', yang_name="path-element", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_element must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("path_element_id",path_element.path_element, yang_name="path-element", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='path-element-id', extensions=None), is_container='list', yang_name="path-element", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True)""", + }) + + self.__path_element = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_element(self): + self.__path_element = YANGDynClass(base=YANGListType("path_element_id",path_element.path_element, yang_name="path-element", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='path-element-id', extensions=None), is_container='list', yang_name="path-element", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + + network_ref = __builtin__.property(_get_network_ref, _set_network_ref) + path_element = __builtin__.property(_get_path_element, _set_path_element) + + + _pyangbind_elements = OrderedDict([('network_ref', network_ref), ('path_element', path_element), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/primary_path/path_element/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/primary_path/path_element/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e9c1a617001c158d8c9a6f74f7a0414356e9e111 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/primary_path/path_element/__init__.py @@ -0,0 +1,320 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 numbered_node_hop +from . import numbered_link_hop +from . import unnumbered_link_hop +from . import as_number_hop +from . import label_hop +class path_element(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/underlay/primary-path/path-element. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: A list of path elements describing the service path. + """ + __slots__ = ('_path_helper', '_extmethods', '__path_element_id','__numbered_node_hop','__numbered_link_hop','__unnumbered_link_hop','__as_number_hop','__label_hop',) + + _yang_name = 'path-element' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__path_element_id = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="path-element-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + self.__numbered_node_hop = YANGDynClass(base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__numbered_link_hop = YANGDynClass(base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__unnumbered_link_hop = YANGDynClass(base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__as_number_hop = YANGDynClass(base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__label_hop = YANGDynClass(base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-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 ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'underlay', 'primary-path', 'path-element'] + + def _get_path_element_id(self): + """ + Getter method for path_element_id, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/primary_path/path_element/path_element_id (uint32) + + YANG Description: To identify the element in a path. + """ + return self.__path_element_id + + def _set_path_element_id(self, v, load=False): + """ + Setter method for path_element_id, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/primary_path/path_element/path_element_id (uint32) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_element_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_element_id() directly. + + YANG Description: To identify the element in a path. + """ + 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=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="path-element-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_element_id 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="path-element-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True)""", + }) + + self.__path_element_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_element_id(self): + self.__path_element_id = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="path-element-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + + + def _get_numbered_node_hop(self): + """ + Getter method for numbered_node_hop, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/primary_path/path_element/numbered_node_hop (container) + + YANG Description: Numbered node route hop. + """ + return self.__numbered_node_hop + + def _set_numbered_node_hop(self, v, load=False): + """ + Setter method for numbered_node_hop, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/primary_path/path_element/numbered_node_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_numbered_node_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_numbered_node_hop() directly. + + YANG Description: Numbered node route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """numbered_node_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__numbered_node_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_numbered_node_hop(self): + self.__numbered_node_hop = YANGDynClass(base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_numbered_link_hop(self): + """ + Getter method for numbered_link_hop, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/primary_path/path_element/numbered_link_hop (container) + + YANG Description: Numbered link explicit route hop. + """ + return self.__numbered_link_hop + + def _set_numbered_link_hop(self, v, load=False): + """ + Setter method for numbered_link_hop, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/primary_path/path_element/numbered_link_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_numbered_link_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_numbered_link_hop() directly. + + YANG Description: Numbered link explicit route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """numbered_link_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__numbered_link_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_numbered_link_hop(self): + self.__numbered_link_hop = YANGDynClass(base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_unnumbered_link_hop(self): + """ + Getter method for unnumbered_link_hop, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/primary_path/path_element/unnumbered_link_hop (container) + + YANG Description: Unnumbered link explicit route hop. + """ + return self.__unnumbered_link_hop + + def _set_unnumbered_link_hop(self, v, load=False): + """ + Setter method for unnumbered_link_hop, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/primary_path/path_element/unnumbered_link_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_unnumbered_link_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_unnumbered_link_hop() directly. + + YANG Description: Unnumbered link explicit route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """unnumbered_link_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__unnumbered_link_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_unnumbered_link_hop(self): + self.__unnumbered_link_hop = YANGDynClass(base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_as_number_hop(self): + """ + Getter method for as_number_hop, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/primary_path/path_element/as_number_hop (container) + + YANG Description: AS explicit route hop. + """ + return self.__as_number_hop + + def _set_as_number_hop(self, v, load=False): + """ + Setter method for as_number_hop, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/primary_path/path_element/as_number_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_as_number_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_as_number_hop() directly. + + YANG Description: AS explicit route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """as_number_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__as_number_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_as_number_hop(self): + self.__as_number_hop = YANGDynClass(base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_label_hop(self): + """ + Getter method for label_hop, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/primary_path/path_element/label_hop (container) + + YANG Description: Label hop type. + """ + return self.__label_hop + + def _set_label_hop(self, v, load=False): + """ + Setter method for label_hop, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/primary_path/path_element/label_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_label_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_label_hop() directly. + + YANG Description: Label hop type. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """label_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__label_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_label_hop(self): + self.__label_hop = YANGDynClass(base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + path_element_id = __builtin__.property(_get_path_element_id, _set_path_element_id) + numbered_node_hop = __builtin__.property(_get_numbered_node_hop, _set_numbered_node_hop) + numbered_link_hop = __builtin__.property(_get_numbered_link_hop, _set_numbered_link_hop) + unnumbered_link_hop = __builtin__.property(_get_unnumbered_link_hop, _set_unnumbered_link_hop) + as_number_hop = __builtin__.property(_get_as_number_hop, _set_as_number_hop) + label_hop = __builtin__.property(_get_label_hop, _set_label_hop) + + __choices__ = {'type': {'numbered-node-hop': ['numbered_node_hop'], 'numbered-link-hop': ['numbered_link_hop'], 'unnumbered-link-hop': ['unnumbered_link_hop'], 'as-number': ['as_number_hop'], 'label': ['label_hop']}} + _pyangbind_elements = OrderedDict([('path_element_id', path_element_id), ('numbered_node_hop', numbered_node_hop), ('numbered_link_hop', numbered_link_hop), ('unnumbered_link_hop', unnumbered_link_hop), ('as_number_hop', as_number_hop), ('label_hop', label_hop), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/primary_path/path_element/as_number_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/primary_path/path_element/as_number_hop/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..2c3bb0005ff1dc2926197c1af5e242f04e9aee10 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/primary_path/path_element/as_number_hop/__init__.py @@ -0,0 +1,154 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 as_number_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/underlay/primary-path/path-element/as-number-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: AS explicit route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__as_number','__hop_type',) + + _yang_name = 'as-number-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__as_number = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=True) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', 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 ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'underlay', 'primary-path', 'path-element', 'as-number-hop'] + + def _get_as_number(self): + """ + Getter method for as_number, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/primary_path/path_element/as_number_hop/as_number (inet:as-number) + + YANG Description: The Autonomous System (AS) number. + """ + return self.__as_number + + def _set_as_number(self, v, load=False): + """ + Setter method for as_number, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/primary_path/path_element/as_number_hop/as_number (inet:as-number) + If this variable is read-only (config: false) in the + source YANG file, then _set_as_number is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_as_number() directly. + + YANG Description: The Autonomous System (AS) number. + """ + 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="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """as_number must be of a type compatible with inet:as-number""", + 'defined-type': "inet:as-number", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=True)""", + }) + + self.__as_number = t + if hasattr(self, '_set'): + self._set() + + def _unset_as_number(self): + self.__as_number = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=True) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/primary_path/path_element/as_number_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/primary_path/path_element/as_number_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + 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={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + + as_number = __builtin__.property(_get_as_number, _set_as_number) + hop_type = __builtin__.property(_get_hop_type, _set_hop_type) + + __choices__ = {'type': {'as-number': ['as_number', 'hop_type']}} + _pyangbind_elements = OrderedDict([('as_number', as_number), ('hop_type', hop_type), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/primary_path/path_element/label_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/primary_path/path_element/label_hop/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..fc6a1621914ea32479aea31f5db5d3aebc0e8e98 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/primary_path/path_element/label_hop/__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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 te_label +class label_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/underlay/primary-path/path-element/label-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Label hop type. + """ + __slots__ = ('_path_helper', '_extmethods', '__te_label',) + + _yang_name = 'label-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__te_label = YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-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 ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'underlay', 'primary-path', 'path-element', 'label-hop'] + + def _get_te_label(self): + """ + Getter method for te_label, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/primary_path/path_element/label_hop/te_label (container) + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + return self.__te_label + + def _set_te_label(self, v, load=False): + """ + Setter method for te_label, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/primary_path/path_element/label_hop/te_label (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_te_label is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_te_label() directly. + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """te_label must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__te_label = t + if hasattr(self, '_set'): + self._set() + + def _unset_te_label(self): + self.__te_label = YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + te_label = __builtin__.property(_get_te_label, _set_te_label) + + __choices__ = {'type': {'label': ['te_label']}} + _pyangbind_elements = OrderedDict([('te_label', te_label), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/primary_path/path_element/label_hop/te_label/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/primary_path/path_element/label_hop/te_label/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..d1db2ca234326d8bd3577ea24c539864ec672152 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/primary_path/path_element/label_hop/te_label/__init__.py @@ -0,0 +1,234 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 otn +class te_label(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/underlay/primary-path/path-element/label-hop/te-label. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + __slots__ = ('_path_helper', '_extmethods', '__generic','__otn','__vlanid','__direction',) + + _yang_name = 'te-label' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__generic = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True) + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + self.__vlanid = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True) + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', 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 ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'underlay', 'primary-path', 'path-element', 'label-hop', 'te-label'] + + def _get_generic(self): + """ + Getter method for generic, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/primary_path/path_element/label_hop/te_label/generic (rt-types:generalized-label) + + YANG Description: TE label specified in a generic format. + """ + return self.__generic + + def _set_generic(self, v, load=False): + """ + Setter method for generic, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/primary_path/path_element/label_hop/te_label/generic (rt-types:generalized-label) + If this variable is read-only (config: false) in the + source YANG file, then _set_generic is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_generic() directly. + + YANG Description: TE label specified in a generic format. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """generic must be of a type compatible with rt-types:generalized-label""", + 'defined-type': "rt-types:generalized-label", + 'generated-type': """YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True)""", + }) + + self.__generic = t + if hasattr(self, '_set'): + self._set() + + def _unset_generic(self): + self.__generic = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True) + + + def _get_otn(self): + """ + Getter method for otn, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/primary_path/path_element/label_hop/te_label/otn (container) + + YANG Description: Label hop for OTN. + """ + return self.__otn + + def _set_otn(self, v, load=False): + """ + Setter method for otn, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/primary_path/path_element/label_hop/te_label/otn (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_otn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_otn() directly. + + YANG Description: Label hop for OTN. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """otn must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True)""", + }) + + self.__otn = t + if hasattr(self, '_set'): + self._set() + + def _unset_otn(self): + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + + + def _get_vlanid(self): + """ + Getter method for vlanid, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/primary_path/path_element/label_hop/te_label/vlanid (etht-types:vlanid) + + YANG Description: VLAN tag id. + """ + return self.__vlanid + + def _set_vlanid(self, v, load=False): + """ + Setter method for vlanid, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/primary_path/path_element/label_hop/te_label/vlanid (etht-types:vlanid) + If this variable is read-only (config: false) in the + source YANG file, then _set_vlanid is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_vlanid() directly. + + YANG Description: VLAN tag id. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """vlanid must be of a type compatible with etht-types:vlanid""", + 'defined-type': "etht-types:vlanid", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True)""", + }) + + self.__vlanid = t + if hasattr(self, '_set'): + self._set() + + def _unset_vlanid(self): + self.__vlanid = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True) + + + def _get_direction(self): + """ + Getter method for direction, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/primary_path/path_element/label_hop/te_label/direction (te-label-direction) + + YANG Description: Label direction. + """ + return self.__direction + + def _set_direction(self, v, load=False): + """ + Setter method for direction, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/primary_path/path_element/label_hop/te_label/direction (te-label-direction) + If this variable is read-only (config: false) in the + source YANG file, then _set_direction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_direction() directly. + + YANG Description: Label direction. + """ + 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={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """direction must be of a type compatible with te-label-direction""", + 'defined-type': "ietf-te-topology:te-label-direction", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=True)""", + }) + + self.__direction = t + if hasattr(self, '_set'): + self._set() + + def _unset_direction(self): + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=True) + + generic = __builtin__.property(_get_generic, _set_generic) + otn = __builtin__.property(_get_otn, _set_otn) + vlanid = __builtin__.property(_get_vlanid, _set_vlanid) + direction = __builtin__.property(_get_direction, _set_direction) + + __choices__ = {'technology': {'generic': ['generic'], 'otn': ['otn'], 'eth': ['vlanid']}, 'type': {'label': ['direction']}} + _pyangbind_elements = OrderedDict([('generic', generic), ('otn', otn), ('vlanid', vlanid), ('direction', direction), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/primary_path/path_element/label_hop/te_label/otn/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/primary_path/path_element/label_hop/te_label/otn/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..0b291e326c2abd344565772273324e7ffb082704 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/primary_path/path_element/label_hop/te_label/otn/__init__.py @@ -0,0 +1,209 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 otn(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/underlay/primary-path/path-element/label-hop/te-label/otn. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Label hop for OTN. + """ + __slots__ = ('_path_helper', '_extmethods', '__tpn','__tsg','__ts_list',) + + _yang_name = 'otn' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__tpn = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True) + self.__tsg = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + self.__ts_list = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-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 ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'underlay', 'primary-path', 'path-element', 'label-hop', 'te-label', 'otn'] + + def _get_tpn(self): + """ + Getter method for tpn, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/primary_path/path_element/label_hop/te_label/otn/tpn (otn-tpn) + + YANG Description: Tributary Port Number (TPN). + """ + return self.__tpn + + def _set_tpn(self, v, load=False): + """ + Setter method for tpn, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/primary_path/path_element/label_hop/te_label/otn/tpn (otn-tpn) + If this variable is read-only (config: false) in the + source YANG file, then _set_tpn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tpn() directly. + + YANG Description: Tributary Port Number (TPN). + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tpn must be of a type compatible with otn-tpn""", + 'defined-type': "ietf-otn-topology:otn-tpn", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True)""", + }) + + self.__tpn = t + if hasattr(self, '_set'): + self._set() + + def _unset_tpn(self): + self.__tpn = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True) + + + def _get_tsg(self): + """ + Getter method for tsg, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/primary_path/path_element/label_hop/te_label/otn/tsg (identityref) + + YANG Description: Tributary Slot Granularity (TSG). + """ + return self.__tsg + + def _set_tsg(self, v, load=False): + """ + Setter method for tsg, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/primary_path/path_element/label_hop/te_label/otn/tsg (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_tsg is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tsg() directly. + + YANG Description: Tributary Slot Granularity (TSG). + """ + 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={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tsg must be of a type compatible with identityref""", + 'defined-type': "ietf-otn-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True)""", + }) + + self.__tsg = t + if hasattr(self, '_set'): + self._set() + + def _unset_tsg(self): + self.__tsg = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + + + def _get_ts_list(self): + """ + Getter method for ts_list, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/primary_path/path_element/label_hop/te_label/otn/ts_list (string) + + YANG Description: A list of available Tributary Slots (TS) ranging + + + + +between 1 and 4095. If multiple values or +ranges are given, they all MUST be disjoint +and MUST be in ascending order. +For example 1-20,25,50-1000. + """ + return self.__ts_list + + def _set_ts_list(self, v, load=False): + """ + Setter method for ts_list, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/primary_path/path_element/label_hop/te_label/otn/ts_list (string) + If this variable is read-only (config: false) in the + source YANG file, then _set_ts_list is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_ts_list() directly. + + YANG Description: A list of available Tributary Slots (TS) ranging + + + + +between 1 and 4095. If multiple values or +ranges are given, they all MUST be disjoint +and MUST be in ascending order. +For example 1-20,25,50-1000. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='string', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """ts_list must be of a type compatible with string""", + 'defined-type': "string", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='string', is_config=True)""", + }) + + self.__ts_list = t + if hasattr(self, '_set'): + self._set() + + def _unset_ts_list(self): + self.__ts_list = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='string', is_config=True) + + tpn = __builtin__.property(_get_tpn, _set_tpn) + tsg = __builtin__.property(_get_tsg, _set_tsg) + ts_list = __builtin__.property(_get_ts_list, _set_ts_list) + + __choices__ = {'technology': {'otn': ['tpn', 'tsg', 'ts_list']}} + _pyangbind_elements = OrderedDict([('tpn', tpn), ('tsg', tsg), ('ts_list', ts_list), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/primary_path/path_element/numbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/primary_path/path_element/numbered_link_hop/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..ccb0ca471771b6c5cc6cb3e85796e099f0062e34 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/primary_path/path_element/numbered_link_hop/__init__.py @@ -0,0 +1,193 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 numbered_link_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/underlay/primary-path/path-element/numbered-link-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Numbered link explicit route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__link_tp_id','__hop_type','__direction',) + + _yang_name = 'numbered-link-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', 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 ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'underlay', 'primary-path', 'path-element', 'numbered-link-hop'] + + def _get_link_tp_id(self): + """ + Getter method for link_tp_id, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/primary_path/path_element/numbered_link_hop/link_tp_id (te-tp-id) + + YANG Description: TE Link Termination Point (LTP) identifier. + """ + return self.__link_tp_id + + def _set_link_tp_id(self, v, load=False): + """ + Setter method for link_tp_id, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/primary_path/path_element/numbered_link_hop/link_tp_id (te-tp-id) + If this variable is read-only (config: false) in the + source YANG file, then _set_link_tp_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_link_tp_id() directly. + + YANG Description: TE Link Termination Point (LTP) identifier. + """ + 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),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """link_tp_id must be of a type compatible with te-tp-id""", + 'defined-type': "ietf-te-topology:te-tp-id", + 'generated-type': """YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True)""", + }) + + self.__link_tp_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_link_tp_id(self): + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/primary_path/path_element/numbered_link_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/primary_path/path_element/numbered_link_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + 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={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + + + def _get_direction(self): + """ + Getter method for direction, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/primary_path/path_element/numbered_link_hop/direction (te-link-direction) + + YANG Description: Link route object direction. + """ + return self.__direction + + def _set_direction(self, v, load=False): + """ + Setter method for direction, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/primary_path/path_element/numbered_link_hop/direction (te-link-direction) + If this variable is read-only (config: false) in the + source YANG file, then _set_direction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_direction() directly. + + YANG Description: Link route object direction. + """ + 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={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """direction must be of a type compatible with te-link-direction""", + 'defined-type': "ietf-te-topology:te-link-direction", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True)""", + }) + + self.__direction = t + if hasattr(self, '_set'): + self._set() + + def _unset_direction(self): + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True) + + link_tp_id = __builtin__.property(_get_link_tp_id, _set_link_tp_id) + hop_type = __builtin__.property(_get_hop_type, _set_hop_type) + direction = __builtin__.property(_get_direction, _set_direction) + + __choices__ = {'type': {'numbered-link-hop': ['link_tp_id', 'hop_type', 'direction']}} + _pyangbind_elements = OrderedDict([('link_tp_id', link_tp_id), ('hop_type', hop_type), ('direction', direction), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/primary_path/path_element/numbered_node_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/primary_path/path_element/numbered_node_hop/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..5c0fdf8daf0e9db2468488e52b54a4a7d1871da7 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/primary_path/path_element/numbered_node_hop/__init__.py @@ -0,0 +1,154 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 numbered_node_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/underlay/primary-path/path-element/numbered-node-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Numbered node route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__node_id','__hop_type',) + + _yang_name = 'numbered-node-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', 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 ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'underlay', 'primary-path', 'path-element', 'numbered-node-hop'] + + def _get_node_id(self): + """ + Getter method for node_id, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/primary_path/path_element/numbered_node_hop/node_id (te-node-id) + + YANG Description: The identifier of a node in the TE topology. + """ + return self.__node_id + + def _set_node_id(self, v, load=False): + """ + Setter method for node_id, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/primary_path/path_element/numbered_node_hop/node_id (te-node-id) + 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. + + YANG Description: The identifier of a node in the TE topology. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """node_id must be of a type compatible with te-node-id""", + 'defined-type': "ietf-te-topology:te-node-id", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True)""", + }) + + self.__node_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_node_id(self): + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/primary_path/path_element/numbered_node_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/primary_path/path_element/numbered_node_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + 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={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + + node_id = __builtin__.property(_get_node_id, _set_node_id) + hop_type = __builtin__.property(_get_hop_type, _set_hop_type) + + __choices__ = {'type': {'numbered-node-hop': ['node_id', 'hop_type']}} + _pyangbind_elements = OrderedDict([('node_id', node_id), ('hop_type', hop_type), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/primary_path/path_element/unnumbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/primary_path/path_element/unnumbered_link_hop/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..c70dd4cc0245ca118568b9d3905fddf50f8ee453 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/primary_path/path_element/unnumbered_link_hop/__init__.py @@ -0,0 +1,236 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 unnumbered_link_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/underlay/primary-path/path-element/unnumbered-link-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Unnumbered link explicit route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__link_tp_id','__node_id','__hop_type','__direction',) + + _yang_name = 'unnumbered-link-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True) + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', 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 ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'underlay', 'primary-path', 'path-element', 'unnumbered-link-hop'] + + def _get_link_tp_id(self): + """ + Getter method for link_tp_id, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/primary_path/path_element/unnumbered_link_hop/link_tp_id (te-tp-id) + + YANG Description: TE LTP identifier. The combination of the TE link ID +and the TE node ID is used to identify an unnumbered +TE link. + """ + return self.__link_tp_id + + def _set_link_tp_id(self, v, load=False): + """ + Setter method for link_tp_id, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/primary_path/path_element/unnumbered_link_hop/link_tp_id (te-tp-id) + If this variable is read-only (config: false) in the + source YANG file, then _set_link_tp_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_link_tp_id() directly. + + YANG Description: TE LTP identifier. The combination of the TE link ID +and the TE node ID is used to identify an unnumbered +TE link. + """ + 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),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """link_tp_id must be of a type compatible with te-tp-id""", + 'defined-type': "ietf-te-topology:te-tp-id", + 'generated-type': """YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True)""", + }) + + self.__link_tp_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_link_tp_id(self): + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True) + + + def _get_node_id(self): + """ + Getter method for node_id, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/primary_path/path_element/unnumbered_link_hop/node_id (te-node-id) + + YANG Description: The identifier of a node in the TE topology. + """ + return self.__node_id + + def _set_node_id(self, v, load=False): + """ + Setter method for node_id, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/primary_path/path_element/unnumbered_link_hop/node_id (te-node-id) + 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. + + YANG Description: The identifier of a node in the TE topology. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """node_id must be of a type compatible with te-node-id""", + 'defined-type': "ietf-te-topology:te-node-id", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True)""", + }) + + self.__node_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_node_id(self): + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/primary_path/path_element/unnumbered_link_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/primary_path/path_element/unnumbered_link_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + 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={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + + + def _get_direction(self): + """ + Getter method for direction, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/primary_path/path_element/unnumbered_link_hop/direction (te-link-direction) + + YANG Description: Link route object direction. + """ + return self.__direction + + def _set_direction(self, v, load=False): + """ + Setter method for direction, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/primary_path/path_element/unnumbered_link_hop/direction (te-link-direction) + If this variable is read-only (config: false) in the + source YANG file, then _set_direction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_direction() directly. + + YANG Description: Link route object direction. + """ + 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={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """direction must be of a type compatible with te-link-direction""", + 'defined-type': "ietf-te-topology:te-link-direction", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True)""", + }) + + self.__direction = t + if hasattr(self, '_set'): + self._set() + + def _unset_direction(self): + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True) + + link_tp_id = __builtin__.property(_get_link_tp_id, _set_link_tp_id) + node_id = __builtin__.property(_get_node_id, _set_node_id) + hop_type = __builtin__.property(_get_hop_type, _set_hop_type) + direction = __builtin__.property(_get_direction, _set_direction) + + __choices__ = {'type': {'unnumbered-link-hop': ['link_tp_id', 'node_id', 'hop_type', 'direction']}} + _pyangbind_elements = OrderedDict([('link_tp_id', link_tp_id), ('node_id', node_id), ('hop_type', hop_type), ('direction', direction), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/tunnel_termination_points/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/tunnel_termination_points/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..01b0c397670aad0d2c9ac7a892ab83fa1a979da7 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/tunnel_termination_points/__init__.py @@ -0,0 +1,154 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 tunnel_termination_points(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/underlay/tunnel-termination-points. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Underlay TTPs desired for this link. + """ + __slots__ = ('_path_helper', '_extmethods', '__source','__destination',) + + _yang_name = 'tunnel-termination-points' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__source = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="source", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='binary', is_config=True) + self.__destination = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="destination", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='binary', 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 ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'underlay', 'tunnel-termination-points'] + + def _get_source(self): + """ + Getter method for source, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/tunnel_termination_points/source (binary) + + YANG Description: Source TTP identifier. + """ + return self.__source + + def _set_source(self, v, load=False): + """ + Setter method for source, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/tunnel_termination_points/source (binary) + If this variable is read-only (config: false) in the + source YANG file, then _set_source is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_source() directly. + + YANG Description: Source TTP identifier. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBinary, is_leaf=True, yang_name="source", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='binary', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """source must be of a type compatible with binary""", + 'defined-type': "binary", + 'generated-type': """YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="source", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='binary', is_config=True)""", + }) + + self.__source = t + if hasattr(self, '_set'): + self._set() + + def _unset_source(self): + self.__source = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="source", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='binary', is_config=True) + + + def _get_destination(self): + """ + Getter method for destination, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/tunnel_termination_points/destination (binary) + + YANG Description: Destination TTP identifier. + """ + return self.__destination + + def _set_destination(self, v, load=False): + """ + Setter method for destination, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/tunnel_termination_points/destination (binary) + If this variable is read-only (config: false) in the + source YANG file, then _set_destination is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_destination() directly. + + YANG Description: Destination TTP identifier. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBinary, is_leaf=True, yang_name="destination", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='binary', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """destination must be of a type compatible with binary""", + 'defined-type': "binary", + 'generated-type': """YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="destination", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='binary', is_config=True)""", + }) + + self.__destination = t + if hasattr(self, '_set'): + self._set() + + def _unset_destination(self): + self.__destination = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="destination", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='binary', is_config=True) + + source = __builtin__.property(_get_source, _set_source) + destination = __builtin__.property(_get_destination, _set_destination) + + + _pyangbind_elements = OrderedDict([('source', source), ('destination', destination), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/tunnels/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/tunnels/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..c8b792d49d202131fb439164a8c15614e350976d --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/tunnels/__init__.py @@ -0,0 +1,167 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 tunnel +class tunnels(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/underlay/tunnels. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Underlay TE tunnels supporting this TE link. + """ + __slots__ = ('_path_helper', '_extmethods', '__sharing','__tunnel',) + + _yang_name = 'tunnels' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__sharing = YANGDynClass(base=YANGBool, default=YANGBool("true"), is_leaf=True, yang_name="sharing", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='boolean', is_config=True) + self.__tunnel = YANGDynClass(base=YANGListType("tunnel_name",tunnel.tunnel, yang_name="tunnel", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='tunnel-name', extensions=None), is_container='list', yang_name="tunnel", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-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 ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'underlay', 'tunnels'] + + def _get_sharing(self): + """ + Getter method for sharing, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/tunnels/sharing (boolean) + + YANG Description: 'true' if the underlay tunnel can be shared with other +TE links; +'false' if the underlay tunnel is dedicated to this +TE link. +This leaf is the default option for all TE tunnels +and may be overridden by the per-TE-tunnel value. + """ + return self.__sharing + + def _set_sharing(self, v, load=False): + """ + Setter method for sharing, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/tunnels/sharing (boolean) + If this variable is read-only (config: false) in the + source YANG file, then _set_sharing is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_sharing() directly. + + YANG Description: 'true' if the underlay tunnel can be shared with other +TE links; +'false' if the underlay tunnel is dedicated to this +TE link. +This leaf is the default option for all TE tunnels +and may be overridden by the per-TE-tunnel value. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBool, default=YANGBool("true"), is_leaf=True, yang_name="sharing", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='boolean', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """sharing must be of a type compatible with boolean""", + 'defined-type': "boolean", + 'generated-type': """YANGDynClass(base=YANGBool, default=YANGBool("true"), is_leaf=True, yang_name="sharing", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='boolean', is_config=True)""", + }) + + self.__sharing = t + if hasattr(self, '_set'): + self._set() + + def _unset_sharing(self): + self.__sharing = YANGDynClass(base=YANGBool, default=YANGBool("true"), is_leaf=True, yang_name="sharing", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='boolean', is_config=True) + + + def _get_tunnel(self): + """ + Getter method for tunnel, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/tunnels/tunnel (list) + + YANG Description: Zero, one, or more underlay TE tunnels that support this +TE link. + """ + return self.__tunnel + + def _set_tunnel(self, v, load=False): + """ + Setter method for tunnel, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/tunnels/tunnel (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_tunnel is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tunnel() directly. + + YANG Description: Zero, one, or more underlay TE tunnels that support this +TE link. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("tunnel_name",tunnel.tunnel, yang_name="tunnel", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='tunnel-name', extensions=None), is_container='list', yang_name="tunnel", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tunnel must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("tunnel_name",tunnel.tunnel, yang_name="tunnel", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='tunnel-name', extensions=None), is_container='list', yang_name="tunnel", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True)""", + }) + + self.__tunnel = t + if hasattr(self, '_set'): + self._set() + + def _unset_tunnel(self): + self.__tunnel = YANGDynClass(base=YANGListType("tunnel_name",tunnel.tunnel, yang_name="tunnel", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='tunnel-name', extensions=None), is_container='list', yang_name="tunnel", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + + sharing = __builtin__.property(_get_sharing, _set_sharing) + tunnel = __builtin__.property(_get_tunnel, _set_tunnel) + + + _pyangbind_elements = OrderedDict([('sharing', sharing), ('tunnel', tunnel), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/tunnels/tunnel/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/tunnels/tunnel/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..03756dbc3bd57a08deb5cf7521dead63b6ca3296 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/tunnels/tunnel/__init__.py @@ -0,0 +1,170 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 tunnel(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/underlay/tunnels/tunnel. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Zero, one, or more underlay TE tunnels that support this +TE link. + """ + __slots__ = ('_path_helper', '_extmethods', '__tunnel_name','__sharing',) + + _yang_name = 'tunnel' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__tunnel_name = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="tunnel-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=True) + self.__sharing = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="sharing", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', 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 ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'underlay', 'tunnels', 'tunnel'] + + def _get_tunnel_name(self): + """ + Getter method for tunnel_name, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/tunnels/tunnel/tunnel_name (string) + + YANG Description: A tunnel name uniquely identifies an underlay TE tunnel, +used together with the 'source-node' value for this +link. + """ + return self.__tunnel_name + + def _set_tunnel_name(self, v, load=False): + """ + Setter method for tunnel_name, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/tunnels/tunnel/tunnel_name (string) + If this variable is read-only (config: false) in the + source YANG file, then _set_tunnel_name is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tunnel_name() directly. + + YANG Description: A tunnel name uniquely identifies an underlay TE tunnel, +used together with the 'source-node' value for this +link. + """ + 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="tunnel-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tunnel_name must be of a type compatible with string""", + 'defined-type': "string", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="tunnel-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=True)""", + }) + + self.__tunnel_name = t + if hasattr(self, '_set'): + self._set() + + def _unset_tunnel_name(self): + self.__tunnel_name = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="tunnel-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=True) + + + def _get_sharing(self): + """ + Getter method for sharing, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/tunnels/tunnel/sharing (boolean) + + YANG Description: 'true' if the underlay tunnel can be shared with other +TE links; +'false' if the underlay tunnel is dedicated to this +TE link. + """ + return self.__sharing + + def _set_sharing(self, v, load=False): + """ + Setter method for sharing, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/tunnels/tunnel/sharing (boolean) + If this variable is read-only (config: false) in the + source YANG file, then _set_sharing is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_sharing() directly. + + YANG Description: 'true' if the underlay tunnel can be shared with other +TE links; +'false' if the underlay tunnel is dedicated to this +TE link. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBool, is_leaf=True, yang_name="sharing", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='boolean', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """sharing must be of a type compatible with boolean""", + 'defined-type': "boolean", + 'generated-type': """YANGDynClass(base=YANGBool, is_leaf=True, yang_name="sharing", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='boolean', is_config=True)""", + }) + + self.__sharing = t + if hasattr(self, '_set'): + self._set() + + def _unset_sharing(self): + self.__sharing = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="sharing", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='boolean', is_config=True) + + tunnel_name = __builtin__.property(_get_tunnel_name, _set_tunnel_name) + sharing = __builtin__.property(_get_sharing, _set_sharing) + + + _pyangbind_elements = OrderedDict([('tunnel_name', tunnel_name), ('sharing', sharing), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/underlay_topology/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/underlay_topology/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..2e4a62679917d02b57e56d464b0f9c59fd8b1ea9 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/underlay_topology/__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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 underlay_topology(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/underlay-topology. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: When an abstract node encapsulates a topology, the +attributes in this container point to said topology. + """ + __slots__ = ('_path_helper', '_extmethods', '__network_ref',) + + _yang_name = 'underlay-topology' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__network_ref = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="network-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-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 ['networks', 'network', 'node', 'te', 'te-node-attributes', 'underlay-topology'] + + def _get_network_ref(self): + """ + Getter method for network_ref, mapped from YANG variable /networks/network/node/te/te_node_attributes/underlay_topology/network_ref (leafref) + + YANG Description: Used to reference a network -- for example, an underlay +network. + """ + return self.__network_ref + + def _set_network_ref(self, v, load=False): + """ + Setter method for network_ref, mapped from YANG variable /networks/network/node/te/te_node_attributes/underlay_topology/network_ref (leafref) + If this variable is read-only (config: false) in the + source YANG file, then _set_network_ref is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_network_ref() directly. + + YANG Description: Used to reference a network -- for example, an underlay +network. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="network-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """network_ref must be of a type compatible with leafref""", + 'defined-type': "leafref", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="network-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=True)""", + }) + + self.__network_ref = t + if hasattr(self, '_set'): + self._set() + + def _unset_network_ref(self): + self.__network_ref = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="network-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=True) + + network_ref = __builtin__.property(_get_network_ref, _set_network_ref) + + + _pyangbind_elements = OrderedDict([('network_ref', network_ref), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..92fbb57f7371ee17f476c0f2f5a3baa02a5ecab8 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/__init__.py @@ -0,0 +1,597 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 client_layer_adaptation +from . import local_link_connectivities +from . import geolocation +from . import statistics +from . import supporting_tunnel_termination_point +class tunnel_termination_point(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: A termination point can terminate a tunnel. + """ + __slots__ = ('_path_helper', '_extmethods', '__tunnel_tp_id','__admin_status','__name','__switching_capability','__encoding','__inter_layer_lock_id','__protection_type','__client_layer_adaptation','__local_link_connectivities','__oper_status','__geolocation','__statistics','__supporting_tunnel_termination_point',) + + _yang_name = 'tunnel-termination-point' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__tunnel_tp_id = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="tunnel-tp-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='binary', is_config=True) + self.__admin_status = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'up': {}, 'down': {}, 'testing': {}, 'preparing-maintenance': {}, 'maintenance': {}, 'unknown': {}},), is_leaf=True, yang_name="admin-status", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-types:te-admin-status', is_config=True) + 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='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=True) + self.__switching_capability = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'switching-psc1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-psc1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-psc1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-evpl': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-evpl': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-evpl': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-l2sc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-l2sc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-l2sc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-tdm': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-tdm': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-tdm': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-otn': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-otn': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-otn': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-dcsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-dcsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-dcsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-lsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-lsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-lsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-fsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-fsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-fsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="switching-capability", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + self.__encoding = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'lsp-encoding-packet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-packet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-packet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-ethernet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-ethernet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-ethernet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-pdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-pdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-pdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-sdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-sdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-sdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-digital-wrapper': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-digital-wrapper': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-digital-wrapper': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-lambda': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-lambda': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-lambda': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-fiber': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-fiber': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-fiber': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-fiber-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-fiber-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-fiber-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-oduk': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-oduk': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-oduk': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-optical-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-optical-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-optical-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-line': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-line': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-line': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="encoding", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + self.__inter_layer_lock_id = YANGDynClass(unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32)), is_leaf=False, yang_name="inter-layer-lock-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + self.__protection_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'lsp-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-reroute-extra': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-reroute-extra': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-reroute-extra': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-reroute': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-reroute': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-reroute': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-1-for-n': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-1-for-n': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-1-for-n': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-unidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-unidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-unidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-bidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-bidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-bidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="protection-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + self.__client_layer_adaptation = YANGDynClass(base=client_layer_adaptation.client_layer_adaptation, is_container='container', yang_name="client-layer-adaptation", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__local_link_connectivities = YANGDynClass(base=local_link_connectivities.local_link_connectivities, is_container='container', yang_name="local-link-connectivities", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__oper_status = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'up': {}, 'down': {}, 'testing': {}, 'preparing-maintenance': {}, 'maintenance': {}, 'unknown': {}},), is_leaf=True, yang_name="oper-status", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-types:te-oper-status', is_config=False) + self.__geolocation = YANGDynClass(base=geolocation.geolocation, is_container='container', yang_name="geolocation", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__statistics = YANGDynClass(base=statistics.statistics, is_container='container', yang_name="statistics", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__supporting_tunnel_termination_point = YANGDynClass(base=YANGListType("node_ref tunnel_tp_ref",supporting_tunnel_termination_point.supporting_tunnel_termination_point, yang_name="supporting-tunnel-termination-point", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='node-ref tunnel-tp-ref', extensions=None), is_container='list', yang_name="supporting-tunnel-termination-point", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-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 ['networks', 'network', 'node', 'te', 'tunnel-termination-point'] + + def _get_tunnel_tp_id(self): + """ + Getter method for tunnel_tp_id, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/tunnel_tp_id (binary) + + YANG Description: TTP identifier. + """ + return self.__tunnel_tp_id + + def _set_tunnel_tp_id(self, v, load=False): + """ + Setter method for tunnel_tp_id, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/tunnel_tp_id (binary) + If this variable is read-only (config: false) in the + source YANG file, then _set_tunnel_tp_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tunnel_tp_id() directly. + + YANG Description: TTP identifier. + """ + 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=YANGBinary, is_leaf=True, yang_name="tunnel-tp-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='binary', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tunnel_tp_id must be of a type compatible with binary""", + 'defined-type': "binary", + 'generated-type': """YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="tunnel-tp-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='binary', is_config=True)""", + }) + + self.__tunnel_tp_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_tunnel_tp_id(self): + self.__tunnel_tp_id = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="tunnel-tp-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='binary', is_config=True) + + + def _get_admin_status(self): + """ + Getter method for admin_status, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/admin_status (te-types:te-admin-status) + + YANG Description: The administrative state of the TTP. + """ + return self.__admin_status + + def _set_admin_status(self, v, load=False): + """ + Setter method for admin_status, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/admin_status (te-types:te-admin-status) + 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 administrative state of the TTP. + """ + 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': {}, 'preparing-maintenance': {}, 'maintenance': {}, 'unknown': {}},), is_leaf=True, yang_name="admin-status", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-types:te-admin-status', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """admin_status must be of a type compatible with te-types:te-admin-status""", + 'defined-type': "te-types:te-admin-status", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'up': {}, 'down': {}, 'testing': {}, 'preparing-maintenance': {}, 'maintenance': {}, 'unknown': {}},), is_leaf=True, yang_name="admin-status", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-types:te-admin-status', is_config=True)""", + }) + + 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': {}, 'preparing-maintenance': {}, 'maintenance': {}, 'unknown': {}},), is_leaf=True, yang_name="admin-status", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-types:te-admin-status', is_config=True) + + + def _get_name(self): + """ + Getter method for name, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/name (string) + + YANG Description: A descriptive name for the TTP. + """ + return self.__name + + def _set_name(self, v, load=False): + """ + Setter method for name, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/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: A descriptive name for the TTP. + """ + 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='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', 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='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', 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='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=True) + + + def _get_switching_capability(self): + """ + Getter method for switching_capability, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/switching_capability (identityref) + + YANG Description: Switching capability for this interface. + """ + return self.__switching_capability + + def _set_switching_capability(self, v, load=False): + """ + Setter method for switching_capability, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/switching_capability (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_switching_capability is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_switching_capability() directly. + + YANG Description: Switching capability for this 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={'switching-psc1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-psc1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-psc1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-evpl': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-evpl': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-evpl': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-l2sc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-l2sc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-l2sc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-tdm': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-tdm': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-tdm': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-otn': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-otn': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-otn': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-dcsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-dcsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-dcsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-lsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-lsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-lsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-fsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-fsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-fsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="switching-capability", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """switching_capability must be of a type compatible with identityref""", + 'defined-type': "ietf-te-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'switching-psc1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-psc1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-psc1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-evpl': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-evpl': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-evpl': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-l2sc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-l2sc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-l2sc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-tdm': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-tdm': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-tdm': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-otn': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-otn': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-otn': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-dcsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-dcsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-dcsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-lsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-lsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-lsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-fsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-fsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-fsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="switching-capability", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True)""", + }) + + self.__switching_capability = t + if hasattr(self, '_set'): + self._set() + + def _unset_switching_capability(self): + self.__switching_capability = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'switching-psc1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-psc1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-psc1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-evpl': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-evpl': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-evpl': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-l2sc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-l2sc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-l2sc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-tdm': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-tdm': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-tdm': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-otn': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-otn': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-otn': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-dcsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-dcsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-dcsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-lsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-lsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-lsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-fsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-fsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-fsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="switching-capability", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + + + def _get_encoding(self): + """ + Getter method for encoding, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/encoding (identityref) + + YANG Description: Encoding supported by this interface. + """ + return self.__encoding + + def _set_encoding(self, v, load=False): + """ + Setter method for encoding, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/encoding (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_encoding is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_encoding() directly. + + YANG Description: Encoding supported by this 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={'lsp-encoding-packet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-packet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-packet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-ethernet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-ethernet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-ethernet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-pdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-pdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-pdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-sdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-sdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-sdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-digital-wrapper': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-digital-wrapper': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-digital-wrapper': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-lambda': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-lambda': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-lambda': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-fiber': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-fiber': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-fiber': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-fiber-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-fiber-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-fiber-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-oduk': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-oduk': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-oduk': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-optical-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-optical-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-optical-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-line': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-line': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-line': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="encoding", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """encoding must be of a type compatible with identityref""", + 'defined-type': "ietf-te-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'lsp-encoding-packet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-packet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-packet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-ethernet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-ethernet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-ethernet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-pdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-pdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-pdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-sdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-sdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-sdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-digital-wrapper': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-digital-wrapper': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-digital-wrapper': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-lambda': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-lambda': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-lambda': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-fiber': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-fiber': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-fiber': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-fiber-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-fiber-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-fiber-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-oduk': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-oduk': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-oduk': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-optical-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-optical-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-optical-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-line': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-line': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-line': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="encoding", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True)""", + }) + + self.__encoding = t + if hasattr(self, '_set'): + self._set() + + def _unset_encoding(self): + self.__encoding = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'lsp-encoding-packet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-packet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-packet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-ethernet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-ethernet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-ethernet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-pdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-pdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-pdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-sdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-sdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-sdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-digital-wrapper': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-digital-wrapper': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-digital-wrapper': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-lambda': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-lambda': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-lambda': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-fiber': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-fiber': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-fiber': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-fiber-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-fiber-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-fiber-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-oduk': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-oduk': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-oduk': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-optical-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-optical-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-optical-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-line': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-line': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-line': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="encoding", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + + + def _get_inter_layer_lock_id(self): + """ + Getter method for inter_layer_lock_id, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/inter_layer_lock_id (uint32) + + YANG Description: Inter-layer lock ID, used for path computation in a TE +topology covering multiple layers or multiple regions. + """ + return self.__inter_layer_lock_id + + def _set_inter_layer_lock_id(self, v, load=False): + """ + Setter method for inter_layer_lock_id, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/inter_layer_lock_id (uint32) + If this variable is read-only (config: false) in the + source YANG file, then _set_inter_layer_lock_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_inter_layer_lock_id() directly. + + YANG Description: Inter-layer lock ID, used for path computation in a TE +topology covering multiple layers or multiple regions. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32)), is_leaf=False, yang_name="inter-layer-lock-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """inter_layer_lock_id must be of a type compatible with uint32""", + 'defined-type': "uint32", + 'generated-type': """YANGDynClass(unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32)), is_leaf=False, yang_name="inter-layer-lock-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True)""", + }) + + self.__inter_layer_lock_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_inter_layer_lock_id(self): + self.__inter_layer_lock_id = YANGDynClass(unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32)), is_leaf=False, yang_name="inter-layer-lock-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + + + def _get_protection_type(self): + """ + Getter method for protection_type, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/protection_type (identityref) + + YANG Description: The protection type that this TTP is capable of. + """ + return self.__protection_type + + def _set_protection_type(self, v, load=False): + """ + Setter method for protection_type, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/protection_type (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_protection_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_protection_type() directly. + + YANG Description: The protection type that this TTP is capable of. + """ + 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={'lsp-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-reroute-extra': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-reroute-extra': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-reroute-extra': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-reroute': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-reroute': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-reroute': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-1-for-n': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-1-for-n': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-1-for-n': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-unidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-unidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-unidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-bidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-bidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-bidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="protection-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """protection_type must be of a type compatible with identityref""", + 'defined-type': "ietf-te-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'lsp-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-reroute-extra': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-reroute-extra': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-reroute-extra': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-reroute': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-reroute': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-reroute': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-1-for-n': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-1-for-n': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-1-for-n': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-unidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-unidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-unidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-bidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-bidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-bidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="protection-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True)""", + }) + + self.__protection_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_protection_type(self): + self.__protection_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'lsp-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-reroute-extra': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-reroute-extra': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-reroute-extra': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-reroute': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-reroute': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-reroute': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-1-for-n': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-1-for-n': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-1-for-n': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-unidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-unidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-unidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-bidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-bidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-bidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="protection-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + + + def _get_client_layer_adaptation(self): + """ + Getter method for client_layer_adaptation, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/client_layer_adaptation (container) + + YANG Description: Contains capability information to support a client-layer +adaptation in a multi-layer topology. + """ + return self.__client_layer_adaptation + + def _set_client_layer_adaptation(self, v, load=False): + """ + Setter method for client_layer_adaptation, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/client_layer_adaptation (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_client_layer_adaptation is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_client_layer_adaptation() directly. + + YANG Description: Contains capability information to support a client-layer +adaptation in a multi-layer topology. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=client_layer_adaptation.client_layer_adaptation, is_container='container', yang_name="client-layer-adaptation", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """client_layer_adaptation must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=client_layer_adaptation.client_layer_adaptation, is_container='container', yang_name="client-layer-adaptation", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__client_layer_adaptation = t + if hasattr(self, '_set'): + self._set() + + def _unset_client_layer_adaptation(self): + self.__client_layer_adaptation = YANGDynClass(base=client_layer_adaptation.client_layer_adaptation, is_container='container', yang_name="client-layer-adaptation", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_local_link_connectivities(self): + """ + Getter method for local_link_connectivities, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities (container) + + YANG Description: Contains an LLCL for a TTP on a TE node. + """ + return self.__local_link_connectivities + + def _set_local_link_connectivities(self, v, load=False): + """ + Setter method for local_link_connectivities, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_local_link_connectivities is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_local_link_connectivities() directly. + + YANG Description: Contains an LLCL for a TTP on a TE node. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=local_link_connectivities.local_link_connectivities, is_container='container', yang_name="local-link-connectivities", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """local_link_connectivities must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=local_link_connectivities.local_link_connectivities, is_container='container', yang_name="local-link-connectivities", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__local_link_connectivities = t + if hasattr(self, '_set'): + self._set() + + def _unset_local_link_connectivities(self): + self.__local_link_connectivities = YANGDynClass(base=local_link_connectivities.local_link_connectivities, is_container='container', yang_name="local-link-connectivities", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_oper_status(self): + """ + Getter method for oper_status, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/oper_status (te-types:te-oper-status) + + YANG Description: The current operational state of the TTP. + """ + return self.__oper_status + + def _set_oper_status(self, v, load=False): + """ + Setter method for oper_status, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/oper_status (te-types:te-oper-status) + 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 TTP. + """ + 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': {}, 'preparing-maintenance': {}, 'maintenance': {}, 'unknown': {}},), is_leaf=True, yang_name="oper-status", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-types:te-oper-status', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """oper_status must be of a type compatible with te-types:te-oper-status""", + 'defined-type': "te-types:te-oper-status", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'up': {}, 'down': {}, 'testing': {}, 'preparing-maintenance': {}, 'maintenance': {}, 'unknown': {}},), is_leaf=True, yang_name="oper-status", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-types:te-oper-status', 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': {}, 'down': {}, 'testing': {}, 'preparing-maintenance': {}, 'maintenance': {}, 'unknown': {}},), is_leaf=True, yang_name="oper-status", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-types:te-oper-status', is_config=False) + + + def _get_geolocation(self): + """ + Getter method for geolocation, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/geolocation (container) + + YANG Description: Contains a GPS location. + """ + return self.__geolocation + + def _set_geolocation(self, v, load=False): + """ + Setter method for geolocation, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/geolocation (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_geolocation is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_geolocation() directly. + + YANG Description: Contains a GPS location. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=geolocation.geolocation, is_container='container', yang_name="geolocation", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """geolocation must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=geolocation.geolocation, is_container='container', yang_name="geolocation", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__geolocation = t + if hasattr(self, '_set'): + self._set() + + def _unset_geolocation(self): + self.__geolocation = YANGDynClass(base=geolocation.geolocation, is_container='container', yang_name="geolocation", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_statistics(self): + """ + Getter method for statistics, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/statistics (container) + + YANG Description: Statistics data. + """ + return self.__statistics + + def _set_statistics(self, v, load=False): + """ + Setter method for statistics, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/statistics (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_statistics is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_statistics() directly. + + YANG Description: Statistics data. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=statistics.statistics, is_container='container', yang_name="statistics", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """statistics must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=statistics.statistics, is_container='container', yang_name="statistics", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__statistics = t + if hasattr(self, '_set'): + self._set() + + def _unset_statistics(self): + self.__statistics = YANGDynClass(base=statistics.statistics, is_container='container', yang_name="statistics", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_supporting_tunnel_termination_point(self): + """ + Getter method for supporting_tunnel_termination_point, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/supporting_tunnel_termination_point (list) + + YANG Description: Identifies the TTPs on which this TTP depends. + """ + return self.__supporting_tunnel_termination_point + + def _set_supporting_tunnel_termination_point(self, v, load=False): + """ + Setter method for supporting_tunnel_termination_point, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/supporting_tunnel_termination_point (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_supporting_tunnel_termination_point is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_supporting_tunnel_termination_point() directly. + + YANG Description: Identifies the TTPs on which this TTP depends. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("node_ref tunnel_tp_ref",supporting_tunnel_termination_point.supporting_tunnel_termination_point, yang_name="supporting-tunnel-termination-point", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='node-ref tunnel-tp-ref', extensions=None), is_container='list', yang_name="supporting-tunnel-termination-point", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """supporting_tunnel_termination_point must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("node_ref tunnel_tp_ref",supporting_tunnel_termination_point.supporting_tunnel_termination_point, yang_name="supporting-tunnel-termination-point", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='node-ref tunnel-tp-ref', extensions=None), is_container='list', yang_name="supporting-tunnel-termination-point", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True)""", + }) + + self.__supporting_tunnel_termination_point = t + if hasattr(self, '_set'): + self._set() + + def _unset_supporting_tunnel_termination_point(self): + self.__supporting_tunnel_termination_point = YANGDynClass(base=YANGListType("node_ref tunnel_tp_ref",supporting_tunnel_termination_point.supporting_tunnel_termination_point, yang_name="supporting-tunnel-termination-point", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='node-ref tunnel-tp-ref', extensions=None), is_container='list', yang_name="supporting-tunnel-termination-point", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + + tunnel_tp_id = __builtin__.property(_get_tunnel_tp_id, _set_tunnel_tp_id) + admin_status = __builtin__.property(_get_admin_status, _set_admin_status) + name = __builtin__.property(_get_name, _set_name) + switching_capability = __builtin__.property(_get_switching_capability, _set_switching_capability) + encoding = __builtin__.property(_get_encoding, _set_encoding) + inter_layer_lock_id = __builtin__.property(_get_inter_layer_lock_id, _set_inter_layer_lock_id) + protection_type = __builtin__.property(_get_protection_type, _set_protection_type) + client_layer_adaptation = __builtin__.property(_get_client_layer_adaptation, _set_client_layer_adaptation) + local_link_connectivities = __builtin__.property(_get_local_link_connectivities, _set_local_link_connectivities) + oper_status = __builtin__.property(_get_oper_status) + geolocation = __builtin__.property(_get_geolocation) + statistics = __builtin__.property(_get_statistics) + supporting_tunnel_termination_point = __builtin__.property(_get_supporting_tunnel_termination_point, _set_supporting_tunnel_termination_point) + + + _pyangbind_elements = OrderedDict([('tunnel_tp_id', tunnel_tp_id), ('admin_status', admin_status), ('name', name), ('switching_capability', switching_capability), ('encoding', encoding), ('inter_layer_lock_id', inter_layer_lock_id), ('protection_type', protection_type), ('client_layer_adaptation', client_layer_adaptation), ('local_link_connectivities', local_link_connectivities), ('oper_status', oper_status), ('geolocation', geolocation), ('statistics', statistics), ('supporting_tunnel_termination_point', supporting_tunnel_termination_point), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/client_layer_adaptation/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/client_layer_adaptation/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..35927a2b6d4cfdb6772293b24523657e9bde3e3d --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/client_layer_adaptation/__init__.py @@ -0,0 +1,117 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 switching_capability +class client_layer_adaptation(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/client-layer-adaptation. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Contains capability information to support a client-layer +adaptation in a multi-layer topology. + """ + __slots__ = ('_path_helper', '_extmethods', '__switching_capability',) + + _yang_name = 'client-layer-adaptation' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__switching_capability = YANGDynClass(base=YANGListType("switching_capability encoding",switching_capability.switching_capability, yang_name="switching-capability", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='switching-capability encoding', extensions=None), is_container='list', yang_name="switching-capability", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-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 ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'client-layer-adaptation'] + + def _get_switching_capability(self): + """ + Getter method for switching_capability, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/client_layer_adaptation/switching_capability (list) + + YANG Description: List of supported switching capabilities. + """ + return self.__switching_capability + + def _set_switching_capability(self, v, load=False): + """ + Setter method for switching_capability, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/client_layer_adaptation/switching_capability (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_switching_capability is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_switching_capability() directly. + + YANG Description: List of supported switching capabilities. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("switching_capability encoding",switching_capability.switching_capability, yang_name="switching-capability", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='switching-capability encoding', extensions=None), is_container='list', yang_name="switching-capability", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """switching_capability must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("switching_capability encoding",switching_capability.switching_capability, yang_name="switching-capability", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='switching-capability encoding', extensions=None), is_container='list', yang_name="switching-capability", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True)""", + }) + + self.__switching_capability = t + if hasattr(self, '_set'): + self._set() + + def _unset_switching_capability(self): + self.__switching_capability = YANGDynClass(base=YANGListType("switching_capability encoding",switching_capability.switching_capability, yang_name="switching-capability", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='switching-capability encoding', extensions=None), is_container='list', yang_name="switching-capability", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + + switching_capability = __builtin__.property(_get_switching_capability, _set_switching_capability) + + + _pyangbind_elements = OrderedDict([('switching_capability', switching_capability), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/client_layer_adaptation/switching_capability/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/client_layer_adaptation/switching_capability/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..4f565ac105c144b0cede7abcf7171faea22f4fff --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/client_layer_adaptation/switching_capability/__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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 te_bandwidth +class switching_capability(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/client-layer-adaptation/switching-capability. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: List of supported switching capabilities. + """ + __slots__ = ('_path_helper', '_extmethods', '__switching_capability','__encoding','__te_bandwidth',) + + _yang_name = 'switching-capability' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__switching_capability = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'switching-psc1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-psc1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-psc1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-evpl': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-evpl': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-evpl': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-l2sc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-l2sc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-l2sc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-tdm': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-tdm': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-tdm': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-otn': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-otn': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-otn': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-dcsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-dcsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-dcsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-lsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-lsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-lsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-fsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-fsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-fsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="switching-capability", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + self.__encoding = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'lsp-encoding-packet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-packet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-packet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-ethernet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-ethernet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-ethernet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-pdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-pdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-pdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-sdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-sdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-sdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-digital-wrapper': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-digital-wrapper': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-digital-wrapper': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-lambda': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-lambda': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-lambda': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-fiber': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-fiber': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-fiber': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-fiber-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-fiber-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-fiber-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-oduk': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-oduk': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-oduk': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-optical-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-optical-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-optical-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-line': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-line': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-line': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="encoding", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + self.__te_bandwidth = YANGDynClass(base=te_bandwidth.te_bandwidth, is_container='container', yang_name="te-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-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 ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'client-layer-adaptation', 'switching-capability'] + + def _get_switching_capability(self): + """ + Getter method for switching_capability, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/client_layer_adaptation/switching_capability/switching_capability (identityref) + + YANG Description: Switching capability for the client-layer adaptation. + """ + return self.__switching_capability + + def _set_switching_capability(self, v, load=False): + """ + Setter method for switching_capability, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/client_layer_adaptation/switching_capability/switching_capability (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_switching_capability is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_switching_capability() directly. + + YANG Description: Switching capability for the client-layer adaptation. + """ + 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=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'switching-psc1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-psc1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-psc1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-evpl': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-evpl': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-evpl': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-l2sc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-l2sc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-l2sc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-tdm': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-tdm': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-tdm': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-otn': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-otn': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-otn': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-dcsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-dcsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-dcsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-lsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-lsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-lsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-fsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-fsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-fsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="switching-capability", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """switching_capability must be of a type compatible with identityref""", + 'defined-type': "ietf-te-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'switching-psc1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-psc1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-psc1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-evpl': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-evpl': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-evpl': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-l2sc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-l2sc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-l2sc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-tdm': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-tdm': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-tdm': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-otn': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-otn': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-otn': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-dcsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-dcsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-dcsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-lsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-lsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-lsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-fsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-fsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-fsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="switching-capability", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True)""", + }) + + self.__switching_capability = t + if hasattr(self, '_set'): + self._set() + + def _unset_switching_capability(self): + self.__switching_capability = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'switching-psc1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-psc1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-psc1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-evpl': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-evpl': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-evpl': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-l2sc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-l2sc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-l2sc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-tdm': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-tdm': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-tdm': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-otn': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-otn': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-otn': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-dcsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-dcsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-dcsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-lsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-lsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-lsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-fsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-fsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-fsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="switching-capability", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + + + def _get_encoding(self): + """ + Getter method for encoding, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/client_layer_adaptation/switching_capability/encoding (identityref) + + YANG Description: Encoding supported by the client-layer adaptation. + """ + return self.__encoding + + def _set_encoding(self, v, load=False): + """ + Setter method for encoding, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/client_layer_adaptation/switching_capability/encoding (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_encoding is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_encoding() directly. + + YANG Description: Encoding supported by the client-layer adaptation. + """ + 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=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'lsp-encoding-packet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-packet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-packet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-ethernet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-ethernet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-ethernet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-pdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-pdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-pdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-sdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-sdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-sdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-digital-wrapper': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-digital-wrapper': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-digital-wrapper': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-lambda': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-lambda': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-lambda': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-fiber': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-fiber': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-fiber': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-fiber-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-fiber-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-fiber-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-oduk': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-oduk': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-oduk': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-optical-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-optical-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-optical-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-line': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-line': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-line': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="encoding", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """encoding must be of a type compatible with identityref""", + 'defined-type': "ietf-te-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'lsp-encoding-packet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-packet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-packet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-ethernet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-ethernet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-ethernet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-pdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-pdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-pdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-sdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-sdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-sdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-digital-wrapper': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-digital-wrapper': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-digital-wrapper': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-lambda': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-lambda': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-lambda': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-fiber': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-fiber': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-fiber': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-fiber-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-fiber-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-fiber-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-oduk': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-oduk': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-oduk': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-optical-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-optical-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-optical-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-line': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-line': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-line': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="encoding", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True)""", + }) + + self.__encoding = t + if hasattr(self, '_set'): + self._set() + + def _unset_encoding(self): + self.__encoding = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'lsp-encoding-packet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-packet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-packet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-ethernet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-ethernet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-ethernet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-pdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-pdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-pdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-sdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-sdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-sdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-digital-wrapper': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-digital-wrapper': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-digital-wrapper': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-lambda': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-lambda': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-lambda': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-fiber': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-fiber': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-fiber': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-fiber-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-fiber-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-fiber-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-oduk': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-oduk': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-oduk': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-optical-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-optical-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-optical-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-line': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-line': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-line': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="encoding", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + + + def _get_te_bandwidth(self): + """ + Getter method for te_bandwidth, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/client_layer_adaptation/switching_capability/te_bandwidth (container) + + YANG Description: Container that specifies TE bandwidth. The choices +can be augmented for specific data-plane technologies. + """ + return self.__te_bandwidth + + def _set_te_bandwidth(self, v, load=False): + """ + Setter method for te_bandwidth, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/client_layer_adaptation/switching_capability/te_bandwidth (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_te_bandwidth is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_te_bandwidth() directly. + + YANG Description: Container that specifies TE bandwidth. The choices +can be augmented for specific data-plane technologies. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=te_bandwidth.te_bandwidth, is_container='container', yang_name="te-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """te_bandwidth must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=te_bandwidth.te_bandwidth, is_container='container', yang_name="te-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__te_bandwidth = t + if hasattr(self, '_set'): + self._set() + + def _unset_te_bandwidth(self): + self.__te_bandwidth = YANGDynClass(base=te_bandwidth.te_bandwidth, is_container='container', yang_name="te-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + switching_capability = __builtin__.property(_get_switching_capability, _set_switching_capability) + encoding = __builtin__.property(_get_encoding, _set_encoding) + te_bandwidth = __builtin__.property(_get_te_bandwidth, _set_te_bandwidth) + + + _pyangbind_elements = OrderedDict([('switching_capability', switching_capability), ('encoding', encoding), ('te_bandwidth', te_bandwidth), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/client_layer_adaptation/switching_capability/te_bandwidth/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/client_layer_adaptation/switching_capability/te_bandwidth/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..52516d7596ef2a4a35fe0c9f5613b7d11325dc8f --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/client_layer_adaptation/switching_capability/te_bandwidth/__init__.py @@ -0,0 +1,195 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 otn +class te_bandwidth(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/client-layer-adaptation/switching-capability/te-bandwidth. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Container that specifies TE bandwidth. The choices +can be augmented for specific data-plane technologies. + """ + __slots__ = ('_path_helper', '_extmethods', '__generic','__otn','__eth_bandwidth',) + + _yang_name = 'te-bandwidth' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__generic = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+(,(0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+))*'}), is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-bandwidth', is_config=True) + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + self.__eth_bandwidth = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), restriction_dict={'range': ['0..10000000000']}), is_leaf=True, yang_name="eth-bandwidth", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint64', 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 ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'client-layer-adaptation', 'switching-capability', 'te-bandwidth'] + + def _get_generic(self): + """ + Getter method for generic, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/client_layer_adaptation/switching_capability/te_bandwidth/generic (te-bandwidth) + + YANG Description: Bandwidth specified in a generic format. + """ + return self.__generic + + def _set_generic(self, v, load=False): + """ + Setter method for generic, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/client_layer_adaptation/switching_capability/te_bandwidth/generic (te-bandwidth) + If this variable is read-only (config: false) in the + source YANG file, then _set_generic is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_generic() directly. + + YANG Description: Bandwidth specified in a generic format. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+(,(0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+))*'}), is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-bandwidth', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """generic must be of a type compatible with te-bandwidth""", + 'defined-type': "ietf-te-topology:te-bandwidth", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+(,(0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+))*'}), is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-bandwidth', is_config=True)""", + }) + + self.__generic = t + if hasattr(self, '_set'): + self._set() + + def _unset_generic(self): + self.__generic = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+(,(0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+))*'}), is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-bandwidth', is_config=True) + + + def _get_otn(self): + """ + Getter method for otn, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/client_layer_adaptation/switching_capability/te_bandwidth/otn (container) + + YANG Description: Bandwidth attributes for OTN links + """ + return self.__otn + + def _set_otn(self, v, load=False): + """ + Setter method for otn, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/client_layer_adaptation/switching_capability/te_bandwidth/otn (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_otn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_otn() directly. + + YANG Description: Bandwidth attributes for OTN links + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """otn must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True)""", + }) + + self.__otn = t + if hasattr(self, '_set'): + self._set() + + def _unset_otn(self): + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + + + def _get_eth_bandwidth(self): + """ + Getter method for eth_bandwidth, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/client_layer_adaptation/switching_capability/te_bandwidth/eth_bandwidth (uint64) + + YANG Description: Available bandwith value expressed in kilobits per second + """ + return self.__eth_bandwidth + + def _set_eth_bandwidth(self, v, load=False): + """ + Setter method for eth_bandwidth, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/client_layer_adaptation/switching_capability/te_bandwidth/eth_bandwidth (uint64) + If this variable is read-only (config: false) in the + source YANG file, then _set_eth_bandwidth is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_eth_bandwidth() directly. + + YANG Description: Available bandwith value expressed in kilobits per second + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), restriction_dict={'range': ['0..10000000000']}), is_leaf=True, yang_name="eth-bandwidth", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint64', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """eth_bandwidth must be of a type compatible with uint64""", + 'defined-type': "uint64", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), restriction_dict={'range': ['0..10000000000']}), is_leaf=True, yang_name="eth-bandwidth", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint64', is_config=True)""", + }) + + self.__eth_bandwidth = t + if hasattr(self, '_set'): + self._set() + + def _unset_eth_bandwidth(self): + self.__eth_bandwidth = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), restriction_dict={'range': ['0..10000000000']}), is_leaf=True, yang_name="eth-bandwidth", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint64', is_config=True) + + generic = __builtin__.property(_get_generic, _set_generic) + otn = __builtin__.property(_get_otn, _set_otn) + eth_bandwidth = __builtin__.property(_get_eth_bandwidth, _set_eth_bandwidth) + + __choices__ = {'technology': {'generic': ['generic'], 'otn': ['otn'], 'eth': ['eth_bandwidth']}} + _pyangbind_elements = OrderedDict([('generic', generic), ('otn', otn), ('eth_bandwidth', eth_bandwidth), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/client_layer_adaptation/switching_capability/te_bandwidth/otn/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/client_layer_adaptation/switching_capability/te_bandwidth/otn/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..3f44ede78bd97cc08792454e82392145da7fff76 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/client_layer_adaptation/switching_capability/te_bandwidth/otn/__init__.py @@ -0,0 +1,163 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 odulist +class otn(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/client-layer-adaptation/switching-capability/te-bandwidth/otn. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Bandwidth attributes for OTN links + """ + __slots__ = ('_path_helper', '_extmethods', '__odulist','__odtu_flex_type',) + + _yang_name = 'otn' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__odulist = YANGDynClass(base=YANGListType("odu_type",odulist.odulist, yang_name="odulist", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='odu-type', extensions=None, choice=('technology', 'otn')), is_container='list', yang_name="odulist", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='list', is_config=True) + self.__odtu_flex_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'2': {}, '3': {}, '4': {}, 'Cn': {}},), is_leaf=True, yang_name="odtu-flex-type", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='l1-types:odtu-flex-type', 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 ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'client-layer-adaptation', 'switching-capability', 'te-bandwidth', 'otn'] + + def _get_odulist(self): + """ + Getter method for odulist, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/client_layer_adaptation/switching_capability/te_bandwidth/otn/odulist (list) + + YANG Description: OTN bandwidth definition + """ + return self.__odulist + + def _set_odulist(self, v, load=False): + """ + Setter method for odulist, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/client_layer_adaptation/switching_capability/te_bandwidth/otn/odulist (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_odulist is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_odulist() directly. + + YANG Description: OTN bandwidth definition + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("odu_type",odulist.odulist, yang_name="odulist", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='odu-type', extensions=None, choice=('technology', 'otn')), is_container='list', yang_name="odulist", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='list', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """odulist must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("odu_type",odulist.odulist, yang_name="odulist", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='odu-type', extensions=None, choice=('technology', 'otn')), is_container='list', yang_name="odulist", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='list', is_config=True)""", + }) + + self.__odulist = t + if hasattr(self, '_set'): + self._set() + + def _unset_odulist(self): + self.__odulist = YANGDynClass(base=YANGListType("odu_type",odulist.odulist, yang_name="odulist", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='odu-type', extensions=None, choice=('technology', 'otn')), is_container='list', yang_name="odulist", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='list', is_config=True) + + + def _get_odtu_flex_type(self): + """ + Getter method for odtu_flex_type, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/client_layer_adaptation/switching_capability/te_bandwidth/otn/odtu_flex_type (l1-types:odtu-flex-type) + + YANG Description: The type of Optical Data Tributary Unit (ODTU) +whose nominal bitrate is used to compute the number of +Tributary Slots (TS) required by the ODUflex LSPs +terminated on this OTN Tunnel Termination Point +(TTP). + """ + return self.__odtu_flex_type + + def _set_odtu_flex_type(self, v, load=False): + """ + Setter method for odtu_flex_type, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/client_layer_adaptation/switching_capability/te_bandwidth/otn/odtu_flex_type (l1-types:odtu-flex-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_odtu_flex_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_odtu_flex_type() directly. + + YANG Description: The type of Optical Data Tributary Unit (ODTU) +whose nominal bitrate is used to compute the number of +Tributary Slots (TS) required by the ODUflex LSPs +terminated on this OTN Tunnel Termination Point +(TTP). + """ + 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={'2': {}, '3': {}, '4': {}, 'Cn': {}},), is_leaf=True, yang_name="odtu-flex-type", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='l1-types:odtu-flex-type', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """odtu_flex_type must be of a type compatible with l1-types:odtu-flex-type""", + 'defined-type': "l1-types:odtu-flex-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'2': {}, '3': {}, '4': {}, 'Cn': {}},), is_leaf=True, yang_name="odtu-flex-type", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='l1-types:odtu-flex-type', is_config=True)""", + }) + + self.__odtu_flex_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_odtu_flex_type(self): + self.__odtu_flex_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'2': {}, '3': {}, '4': {}, 'Cn': {}},), is_leaf=True, yang_name="odtu-flex-type", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='l1-types:odtu-flex-type', is_config=True) + + odulist = __builtin__.property(_get_odulist, _set_odulist) + odtu_flex_type = __builtin__.property(_get_odtu_flex_type, _set_odtu_flex_type) + + __choices__ = {'technology': {'otn': ['odulist', 'odtu_flex_type']}} + _pyangbind_elements = OrderedDict([('odulist', odulist), ('odtu_flex_type', odtu_flex_type), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/client_layer_adaptation/switching_capability/te_bandwidth/otn/odulist/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/client_layer_adaptation/switching_capability/te_bandwidth/otn/odulist/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..d4cb37ddf48866ddc9846bde21cab02a01eb9255 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/client_layer_adaptation/switching_capability/te_bandwidth/otn/odulist/__init__.py @@ -0,0 +1,200 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 odulist(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/client-layer-adaptation/switching-capability/te-bandwidth/otn/odulist. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: OTN bandwidth definition + """ + __slots__ = ('_path_helper', '_extmethods', '__odu_type','__number','__ts_number',) + + _yang_name = 'odulist' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__odu_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="odu-type", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + self.__number = YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), is_leaf=True, yang_name="number", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', is_config=True) + self.__ts_number = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts-number", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', 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 ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'client-layer-adaptation', 'switching-capability', 'te-bandwidth', 'otn', 'odulist'] + + def _get_odu_type(self): + """ + Getter method for odu_type, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/client_layer_adaptation/switching_capability/te_bandwidth/otn/odulist/odu_type (identityref) + + YANG Description: ODU type + """ + return self.__odu_type + + def _set_odu_type(self, v, load=False): + """ + Setter method for odu_type, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/client_layer_adaptation/switching_capability/te_bandwidth/otn/odulist/odu_type (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_odu_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_odu_type() directly. + + YANG Description: ODU type + """ + 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=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="odu-type", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """odu_type must be of a type compatible with identityref""", + 'defined-type': "ietf-otn-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="odu-type", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True)""", + }) + + self.__odu_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_odu_type(self): + self.__odu_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="odu-type", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + + + def _get_number(self): + """ + Getter method for number, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/client_layer_adaptation/switching_capability/te_bandwidth/otn/odulist/number (uint16) + + YANG Description: Number of ODUs + """ + return self.__number + + def _set_number(self, v, load=False): + """ + Setter method for number, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/client_layer_adaptation/switching_capability/te_bandwidth/otn/odulist/number (uint16) + If this variable is read-only (config: false) in the + source YANG file, then _set_number is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_number() directly. + + YANG Description: Number of ODUs + """ + 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="number", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """number 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="number", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', is_config=True)""", + }) + + self.__number = t + if hasattr(self, '_set'): + self._set() + + def _unset_number(self): + self.__number = YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), is_leaf=True, yang_name="number", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', is_config=True) + + + def _get_ts_number(self): + """ + Getter method for ts_number, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/client_layer_adaptation/switching_capability/te_bandwidth/otn/odulist/ts_number (uint16) + + YANG Description: The number of Tributary Slots (TS) that +could be used by all the ODUflex LSPs. + """ + return self.__ts_number + + def _set_ts_number(self, v, load=False): + """ + Setter method for ts_number, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/client_layer_adaptation/switching_capability/te_bandwidth/otn/odulist/ts_number (uint16) + If this variable is read-only (config: false) in the + source YANG file, then _set_ts_number is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_ts_number() directly. + + YANG Description: The number of Tributary Slots (TS) that +could be used by all the ODUflex LSPs. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts-number", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """ts_number must be of a type compatible with uint16""", + 'defined-type': "uint16", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts-number", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', is_config=True)""", + }) + + self.__ts_number = t + if hasattr(self, '_set'): + self._set() + + def _unset_ts_number(self): + self.__ts_number = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts-number", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', is_config=True) + + odu_type = __builtin__.property(_get_odu_type, _set_odu_type) + number = __builtin__.property(_get_number, _set_number) + ts_number = __builtin__.property(_get_ts_number, _set_ts_number) + + __choices__ = {'technology': {'otn': ['odu_type', 'number', 'ts_number']}} + _pyangbind_elements = OrderedDict([('odu_type', odu_type), ('number', number), ('ts_number', ts_number), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/geolocation/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/geolocation/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..60eedb630beaabab4d10b6ad562533d0a3c450c4 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/geolocation/__init__.py @@ -0,0 +1,193 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 geolocation(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/geolocation. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Contains a GPS location. + """ + __slots__ = ('_path_helper', '_extmethods', '__altitude','__latitude','__longitude',) + + _yang_name = 'geolocation' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__altitude = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['-9223372036854775808..9223372036854775807']}, int_size=64), is_leaf=True, yang_name="altitude", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='int64', is_config=False) + self.__latitude = YANGDynClass(base=RestrictedClassType(base_type=RestrictedPrecisionDecimalType(precision=8), restriction_dict={'range': ['-90..90']}), is_leaf=True, yang_name="latitude", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='geographic-coordinate-degree', is_config=False) + self.__longitude = YANGDynClass(base=RestrictedClassType(base_type=RestrictedPrecisionDecimalType(precision=8), restriction_dict={'range': ['-180..180']}), is_leaf=True, yang_name="longitude", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='geographic-coordinate-degree', 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 ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'geolocation'] + + def _get_altitude(self): + """ + Getter method for altitude, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/geolocation/altitude (int64) + + YANG Description: Distance above sea level. + """ + return self.__altitude + + def _set_altitude(self, v, load=False): + """ + Setter method for altitude, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/geolocation/altitude (int64) + If this variable is read-only (config: false) in the + source YANG file, then _set_altitude is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_altitude() directly. + + YANG Description: Distance above sea level. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['-9223372036854775808..9223372036854775807']}, int_size=64), is_leaf=True, yang_name="altitude", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='int64', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """altitude must be of a type compatible with int64""", + 'defined-type': "int64", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['-9223372036854775808..9223372036854775807']}, int_size=64), is_leaf=True, yang_name="altitude", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='int64', is_config=False)""", + }) + + self.__altitude = t + if hasattr(self, '_set'): + self._set() + + def _unset_altitude(self): + self.__altitude = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['-9223372036854775808..9223372036854775807']}, int_size=64), is_leaf=True, yang_name="altitude", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='int64', is_config=False) + + + def _get_latitude(self): + """ + Getter method for latitude, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/geolocation/latitude (geographic-coordinate-degree) + + YANG Description: Relative position north or south on the Earth's surface. + """ + return self.__latitude + + def _set_latitude(self, v, load=False): + """ + Setter method for latitude, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/geolocation/latitude (geographic-coordinate-degree) + If this variable is read-only (config: false) in the + source YANG file, then _set_latitude is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_latitude() directly. + + YANG Description: Relative position north or south on the Earth's surface. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedPrecisionDecimalType(precision=8), restriction_dict={'range': ['-90..90']}), is_leaf=True, yang_name="latitude", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='geographic-coordinate-degree', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """latitude must be of a type compatible with geographic-coordinate-degree""", + 'defined-type': "ietf-te-topology:geographic-coordinate-degree", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedPrecisionDecimalType(precision=8), restriction_dict={'range': ['-90..90']}), is_leaf=True, yang_name="latitude", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='geographic-coordinate-degree', is_config=False)""", + }) + + self.__latitude = t + if hasattr(self, '_set'): + self._set() + + def _unset_latitude(self): + self.__latitude = YANGDynClass(base=RestrictedClassType(base_type=RestrictedPrecisionDecimalType(precision=8), restriction_dict={'range': ['-90..90']}), is_leaf=True, yang_name="latitude", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='geographic-coordinate-degree', is_config=False) + + + def _get_longitude(self): + """ + Getter method for longitude, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/geolocation/longitude (geographic-coordinate-degree) + + YANG Description: Angular distance east or west on the Earth's surface. + """ + return self.__longitude + + def _set_longitude(self, v, load=False): + """ + Setter method for longitude, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/geolocation/longitude (geographic-coordinate-degree) + If this variable is read-only (config: false) in the + source YANG file, then _set_longitude is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_longitude() directly. + + YANG Description: Angular distance east or west on the Earth's surface. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedPrecisionDecimalType(precision=8), restriction_dict={'range': ['-180..180']}), is_leaf=True, yang_name="longitude", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='geographic-coordinate-degree', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """longitude must be of a type compatible with geographic-coordinate-degree""", + 'defined-type': "ietf-te-topology:geographic-coordinate-degree", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedPrecisionDecimalType(precision=8), restriction_dict={'range': ['-180..180']}), is_leaf=True, yang_name="longitude", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='geographic-coordinate-degree', is_config=False)""", + }) + + self.__longitude = t + if hasattr(self, '_set'): + self._set() + + def _unset_longitude(self): + self.__longitude = YANGDynClass(base=RestrictedClassType(base_type=RestrictedPrecisionDecimalType(precision=8), restriction_dict={'range': ['-180..180']}), is_leaf=True, yang_name="longitude", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='geographic-coordinate-degree', is_config=False) + + altitude = __builtin__.property(_get_altitude) + latitude = __builtin__.property(_get_latitude) + longitude = __builtin__.property(_get_longitude) + + + _pyangbind_elements = OrderedDict([('altitude', altitude), ('latitude', latitude), ('longitude', longitude), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..309e87f52d489f0d2f62db7f7eee13eeadf527e1 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/__init__.py @@ -0,0 +1,418 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 label_restrictions +from . import underlay +from . import path_constraints +from . import optimizations +from . import path_properties +from . import local_link_connectivity +class local_link_connectivities(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Contains an LLCL for a TTP on a TE node. + """ + __slots__ = ('_path_helper', '_extmethods', '__number_of_entries','__label_restrictions','__is_allowed','__underlay','__path_constraints','__optimizations','__path_properties','__local_link_connectivity',) + + _yang_name = 'local-link-connectivities' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__number_of_entries = YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), is_leaf=True, yang_name="number-of-entries", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint16', is_config=True) + self.__label_restrictions = YANGDynClass(base=label_restrictions.label_restrictions, is_container='container', yang_name="label-restrictions", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__is_allowed = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="is-allowed", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='boolean', is_config=True) + self.__underlay = YANGDynClass(base=underlay.underlay, is_container='container', yang_name="underlay", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__path_constraints = YANGDynClass(base=path_constraints.path_constraints, is_container='container', yang_name="path-constraints", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__optimizations = YANGDynClass(base=optimizations.optimizations, is_container='container', yang_name="optimizations", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__path_properties = YANGDynClass(base=path_properties.path_properties, is_container='container', yang_name="path-properties", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__local_link_connectivity = YANGDynClass(base=YANGListType("link_tp_ref",local_link_connectivity.local_link_connectivity, yang_name="local-link-connectivity", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='link-tp-ref', extensions=None), is_container='list', yang_name="local-link-connectivity", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-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 ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities'] + + def _get_number_of_entries(self): + """ + Getter method for number_of_entries, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/number_of_entries (uint16) + + YANG Description: The number of LLCL entries. +If this number is specified in the configuration request, +the number is the requested number of entries, which may +not all be listed in the list; +if this number is reported in the state data, +the number is the current number of operational entries. + """ + return self.__number_of_entries + + def _set_number_of_entries(self, v, load=False): + """ + Setter method for number_of_entries, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/number_of_entries (uint16) + If this variable is read-only (config: false) in the + source YANG file, then _set_number_of_entries is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_number_of_entries() directly. + + YANG Description: The number of LLCL entries. +If this number is specified in the configuration request, +the number is the requested number of entries, which may +not all be listed in the list; +if this number is reported in the state data, +the number is the current number of operational entries. + """ + 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="number-of-entries", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint16', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """number_of_entries 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="number-of-entries", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint16', is_config=True)""", + }) + + self.__number_of_entries = t + if hasattr(self, '_set'): + self._set() + + def _unset_number_of_entries(self): + self.__number_of_entries = YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), is_leaf=True, yang_name="number-of-entries", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint16', is_config=True) + + + def _get_label_restrictions(self): + """ + Getter method for label_restrictions, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions (container) + + YANG Description: The label restrictions container. + """ + return self.__label_restrictions + + def _set_label_restrictions(self, v, load=False): + """ + Setter method for label_restrictions, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_label_restrictions is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_label_restrictions() directly. + + YANG Description: The label restrictions container. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=label_restrictions.label_restrictions, is_container='container', yang_name="label-restrictions", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """label_restrictions must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=label_restrictions.label_restrictions, is_container='container', yang_name="label-restrictions", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__label_restrictions = t + if hasattr(self, '_set'): + self._set() + + def _unset_label_restrictions(self): + self.__label_restrictions = YANGDynClass(base=label_restrictions.label_restrictions, is_container='container', yang_name="label-restrictions", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_is_allowed(self): + """ + Getter method for is_allowed, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/is_allowed (boolean) + + YANG Description: 'true' - switching is allowed; +'false' - switching is disallowed. + """ + return self.__is_allowed + + def _set_is_allowed(self, v, load=False): + """ + Setter method for is_allowed, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/is_allowed (boolean) + If this variable is read-only (config: false) in the + source YANG file, then _set_is_allowed is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_is_allowed() directly. + + YANG Description: 'true' - switching is allowed; +'false' - switching is disallowed. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBool, is_leaf=True, yang_name="is-allowed", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='boolean', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """is_allowed must be of a type compatible with boolean""", + 'defined-type': "boolean", + 'generated-type': """YANGDynClass(base=YANGBool, is_leaf=True, yang_name="is-allowed", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='boolean', is_config=True)""", + }) + + self.__is_allowed = t + if hasattr(self, '_set'): + self._set() + + def _unset_is_allowed(self): + self.__is_allowed = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="is-allowed", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='boolean', is_config=True) + + + def _get_underlay(self): + """ + Getter method for underlay, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay (container) + + YANG Description: Attributes of the TE link underlay. + """ + return self.__underlay + + def _set_underlay(self, v, load=False): + """ + Setter method for underlay, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_underlay is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_underlay() directly. + + YANG Description: Attributes of the TE link underlay. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=underlay.underlay, is_container='container', yang_name="underlay", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """underlay must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=underlay.underlay, is_container='container', yang_name="underlay", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__underlay = t + if hasattr(self, '_set'): + self._set() + + def _unset_underlay(self): + self.__underlay = YANGDynClass(base=underlay.underlay, is_container='container', yang_name="underlay", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_path_constraints(self): + """ + Getter method for path_constraints, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints (container) + + YANG Description: TE named path constraints container. + """ + return self.__path_constraints + + def _set_path_constraints(self, v, load=False): + """ + Setter method for path_constraints, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_constraints is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_constraints() directly. + + YANG Description: TE named path constraints container. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=path_constraints.path_constraints, is_container='container', yang_name="path-constraints", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_constraints must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=path_constraints.path_constraints, is_container='container', yang_name="path-constraints", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__path_constraints = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_constraints(self): + self.__path_constraints = YANGDynClass(base=path_constraints.path_constraints, is_container='container', yang_name="path-constraints", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_optimizations(self): + """ + Getter method for optimizations, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations (container) + + YANG Description: The objective function container that includes +attributes to impose when computing a TE path. + """ + return self.__optimizations + + def _set_optimizations(self, v, load=False): + """ + Setter method for optimizations, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_optimizations is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_optimizations() directly. + + YANG Description: The objective function container that includes +attributes to impose when computing a TE path. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=optimizations.optimizations, is_container='container', yang_name="optimizations", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """optimizations must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=optimizations.optimizations, is_container='container', yang_name="optimizations", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__optimizations = t + if hasattr(self, '_set'): + self._set() + + def _unset_optimizations(self): + self.__optimizations = YANGDynClass(base=optimizations.optimizations, is_container='container', yang_name="optimizations", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_path_properties(self): + """ + Getter method for path_properties, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties (container) + + YANG Description: The TE path properties. + """ + return self.__path_properties + + def _set_path_properties(self, v, load=False): + """ + Setter method for path_properties, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_properties is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_properties() directly. + + YANG Description: The TE path properties. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=path_properties.path_properties, is_container='container', yang_name="path-properties", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_properties must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=path_properties.path_properties, is_container='container', yang_name="path-properties", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__path_properties = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_properties(self): + self.__path_properties = YANGDynClass(base=path_properties.path_properties, is_container='container', yang_name="path-properties", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_local_link_connectivity(self): + """ + Getter method for local_link_connectivity, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity (list) + + YANG Description: The termination capabilities between the TTP and the LTP. +This capability information can be used to compute +the tunnel path. +The Interface Adjustment Capability Descriptors (IACDs) +(defined in RFC 6001) on each LTP can be derived from +this list. + """ + return self.__local_link_connectivity + + def _set_local_link_connectivity(self, v, load=False): + """ + Setter method for local_link_connectivity, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_local_link_connectivity is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_local_link_connectivity() directly. + + YANG Description: The termination capabilities between the TTP and the LTP. +This capability information can be used to compute +the tunnel path. +The Interface Adjustment Capability Descriptors (IACDs) +(defined in RFC 6001) on each LTP can be derived from +this list. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("link_tp_ref",local_link_connectivity.local_link_connectivity, yang_name="local-link-connectivity", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='link-tp-ref', extensions=None), is_container='list', yang_name="local-link-connectivity", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """local_link_connectivity must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("link_tp_ref",local_link_connectivity.local_link_connectivity, yang_name="local-link-connectivity", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='link-tp-ref', extensions=None), is_container='list', yang_name="local-link-connectivity", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True)""", + }) + + self.__local_link_connectivity = t + if hasattr(self, '_set'): + self._set() + + def _unset_local_link_connectivity(self): + self.__local_link_connectivity = YANGDynClass(base=YANGListType("link_tp_ref",local_link_connectivity.local_link_connectivity, yang_name="local-link-connectivity", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='link-tp-ref', extensions=None), is_container='list', yang_name="local-link-connectivity", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + + number_of_entries = __builtin__.property(_get_number_of_entries, _set_number_of_entries) + label_restrictions = __builtin__.property(_get_label_restrictions, _set_label_restrictions) + is_allowed = __builtin__.property(_get_is_allowed, _set_is_allowed) + underlay = __builtin__.property(_get_underlay, _set_underlay) + path_constraints = __builtin__.property(_get_path_constraints, _set_path_constraints) + optimizations = __builtin__.property(_get_optimizations, _set_optimizations) + path_properties = __builtin__.property(_get_path_properties) + local_link_connectivity = __builtin__.property(_get_local_link_connectivity, _set_local_link_connectivity) + + + _pyangbind_elements = OrderedDict([('number_of_entries', number_of_entries), ('label_restrictions', label_restrictions), ('is_allowed', is_allowed), ('underlay', underlay), ('path_constraints', path_constraints), ('optimizations', optimizations), ('path_properties', path_properties), ('local_link_connectivity', local_link_connectivity), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..7170e479811b3ec5d8576646bcf18677541eae62 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/__init__.py @@ -0,0 +1,120 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 label_restriction +class label_restrictions(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/label-restrictions. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: The label restrictions container. + """ + __slots__ = ('_path_helper', '_extmethods', '__label_restriction',) + + _yang_name = 'label-restrictions' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__label_restriction = YANGDynClass(base=YANGListType("index",label_restriction.label_restriction, yang_name="label-restriction", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='index', extensions=None), is_container='list', yang_name="label-restriction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-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 ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'label-restrictions'] + + def _get_label_restriction(self): + """ + Getter method for label_restriction, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/label_restriction (list) + + YANG Description: The absence of the label restrictions container implies +that all labels are acceptable; otherwise, only restricted +labels are available. + """ + return self.__label_restriction + + def _set_label_restriction(self, v, load=False): + """ + Setter method for label_restriction, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/label_restriction (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_label_restriction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_label_restriction() directly. + + YANG Description: The absence of the label restrictions container implies +that all labels are acceptable; otherwise, only restricted +labels are available. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("index",label_restriction.label_restriction, yang_name="label-restriction", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='index', extensions=None), is_container='list', yang_name="label-restriction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """label_restriction must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("index",label_restriction.label_restriction, yang_name="label-restriction", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='index', extensions=None), is_container='list', yang_name="label-restriction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True)""", + }) + + self.__label_restriction = t + if hasattr(self, '_set'): + self._set() + + def _unset_label_restriction(self): + self.__label_restriction = YANGDynClass(base=YANGListType("index",label_restriction.label_restriction, yang_name="label-restriction", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='index', extensions=None), is_container='list', yang_name="label-restriction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + + label_restriction = __builtin__.property(_get_label_restriction, _set_label_restriction) + + + _pyangbind_elements = OrderedDict([('label_restriction', label_restriction), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/label_restriction/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/label_restriction/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..6bb6db97a047b6d5c290b75b80088bfe46913b02 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/label_restriction/__init__.py @@ -0,0 +1,450 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 label_start +from . import label_end +from . import label_step +from . import otn_label_range +from . import ethernet_label_range +class label_restriction(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/label-restrictions/label-restriction. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: The absence of the label restrictions container implies +that all labels are acceptable; otherwise, only restricted +labels are available. + """ + __slots__ = ('_path_helper', '_extmethods', '__restriction','__index','__label_start','__label_end','__label_step','__range_bitmap','__otn_label_range','__ethernet_label_range',) + + _yang_name = 'label-restriction' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__restriction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'inclusive': {}, 'exclusive': {}},), default=six.text_type("inclusive"), is_leaf=True, yang_name="restriction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='enumeration', is_config=True) + self.__index = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + self.__label_start = YANGDynClass(base=label_start.label_start, is_container='container', yang_name="label-start", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__label_end = YANGDynClass(base=label_end.label_end, is_container='container', yang_name="label-end", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__label_step = YANGDynClass(base=label_step.label_step, is_container='container', yang_name="label-step", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__range_bitmap = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}), is_leaf=True, yang_name="range-bitmap", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:hex-string', is_config=True) + self.__otn_label_range = YANGDynClass(base=otn_label_range.otn_label_range, is_container='container', yang_name="otn-label-range", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + self.__ethernet_label_range = YANGDynClass(base=ethernet_label_range.ethernet_label_range, is_container='container', yang_name="ethernet-label-range", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-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 ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'label-restrictions', 'label-restriction'] + + def _get_restriction(self): + """ + Getter method for restriction, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/label_restriction/restriction (enumeration) + + YANG Description: Indicates whether the list item is inclusive or exclusive. + """ + return self.__restriction + + def _set_restriction(self, v, load=False): + """ + Setter method for restriction, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/label_restriction/restriction (enumeration) + If this variable is read-only (config: false) in the + source YANG file, then _set_restriction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_restriction() directly. + + YANG Description: Indicates whether the list item is inclusive or exclusive. + """ + 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={'inclusive': {}, 'exclusive': {}},), default=six.text_type("inclusive"), is_leaf=True, yang_name="restriction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='enumeration', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """restriction must be of a type compatible with enumeration""", + 'defined-type': "ietf-te-topology:enumeration", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'inclusive': {}, 'exclusive': {}},), default=six.text_type("inclusive"), is_leaf=True, yang_name="restriction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='enumeration', is_config=True)""", + }) + + self.__restriction = t + if hasattr(self, '_set'): + self._set() + + def _unset_restriction(self): + self.__restriction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'inclusive': {}, 'exclusive': {}},), default=six.text_type("inclusive"), is_leaf=True, yang_name="restriction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='enumeration', is_config=True) + + + def _get_index(self): + """ + Getter method for index, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/label_restriction/index (uint32) + + YANG Description: The index of the label restriction list entry. + """ + return self.__index + + def _set_index(self, v, load=False): + """ + Setter method for index, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/label_restriction/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 label restriction list entry. + """ + 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=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', 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), is_leaf=True, yang_name="index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', 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), is_leaf=True, yang_name="index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + + + def _get_label_start(self): + """ + Getter method for label_start, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/label_restriction/label_start (container) + + YANG Description: This is the starting label if a label range is specified. +This is the label value if a single label is specified, +in which case the 'label-end' attribute is not set. + """ + return self.__label_start + + def _set_label_start(self, v, load=False): + """ + Setter method for label_start, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/label_restriction/label_start (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_label_start is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_label_start() directly. + + YANG Description: This is the starting label if a label range is specified. +This is the label value if a single label is specified, +in which case the 'label-end' attribute is not set. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=label_start.label_start, is_container='container', yang_name="label-start", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """label_start must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=label_start.label_start, is_container='container', yang_name="label-start", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__label_start = t + if hasattr(self, '_set'): + self._set() + + def _unset_label_start(self): + self.__label_start = YANGDynClass(base=label_start.label_start, is_container='container', yang_name="label-start", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_label_end(self): + """ + Getter method for label_end, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/label_restriction/label_end (container) + + YANG Description: This is the ending label if a label range is specified. +This attribute is not set if a single label is specified. + """ + return self.__label_end + + def _set_label_end(self, v, load=False): + """ + Setter method for label_end, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/label_restriction/label_end (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_label_end is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_label_end() directly. + + YANG Description: This is the ending label if a label range is specified. +This attribute is not set if a single label is specified. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=label_end.label_end, is_container='container', yang_name="label-end", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """label_end must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=label_end.label_end, is_container='container', yang_name="label-end", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__label_end = t + if hasattr(self, '_set'): + self._set() + + def _unset_label_end(self): + self.__label_end = YANGDynClass(base=label_end.label_end, is_container='container', yang_name="label-end", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_label_step(self): + """ + Getter method for label_step, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/label_restriction/label_step (container) + + YANG Description: The step increment between labels in the label range. +The label start/end values will have to be consistent +with the sign of label step. For example, +'label-start' < 'label-end' enforces 'label-step' > 0 +'label-start' > 'label-end' enforces 'label-step' < 0. + """ + return self.__label_step + + def _set_label_step(self, v, load=False): + """ + Setter method for label_step, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/label_restriction/label_step (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_label_step is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_label_step() directly. + + YANG Description: The step increment between labels in the label range. +The label start/end values will have to be consistent +with the sign of label step. For example, +'label-start' < 'label-end' enforces 'label-step' > 0 +'label-start' > 'label-end' enforces 'label-step' < 0. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=label_step.label_step, is_container='container', yang_name="label-step", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """label_step must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=label_step.label_step, is_container='container', yang_name="label-step", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__label_step = t + if hasattr(self, '_set'): + self._set() + + def _unset_label_step(self): + self.__label_step = YANGDynClass(base=label_step.label_step, is_container='container', yang_name="label-step", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_range_bitmap(self): + """ + Getter method for range_bitmap, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/label_restriction/range_bitmap (yang:hex-string) + + YANG Description: When there are gaps between 'label-start' and 'label-end', +this attribute is used to specify the positions +of the used labels. This is represented in big endian as +'hex-string'. +The most significant byte in the hex-string is the farthest +to the left in the byte sequence. Leading zero bytes in the +configured value may be omitted for brevity. +Each bit position in the 'range-bitmap' 'hex-string' maps +to a label in the range derived from 'label-start'. + +For example, assuming that 'label-start' = 16000 and +'range-bitmap' = 0x01000001, then: + +- bit position (0) is set, and the corresponding mapped + label from the range is 16000 + (0 * 'label-step') or + 16000 for default 'label-step' = 1. +- bit position (24) is set, and the corresponding mapped + label from the range is 16000 + (24 * 'label-step') or + 16024 for default 'label-step' = 1. + """ + return self.__range_bitmap + + def _set_range_bitmap(self, v, load=False): + """ + Setter method for range_bitmap, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/label_restriction/range_bitmap (yang:hex-string) + If this variable is read-only (config: false) in the + source YANG file, then _set_range_bitmap is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_range_bitmap() directly. + + YANG Description: When there are gaps between 'label-start' and 'label-end', +this attribute is used to specify the positions +of the used labels. This is represented in big endian as +'hex-string'. +The most significant byte in the hex-string is the farthest +to the left in the byte sequence. Leading zero bytes in the +configured value may be omitted for brevity. +Each bit position in the 'range-bitmap' 'hex-string' maps +to a label in the range derived from 'label-start'. + +For example, assuming that 'label-start' = 16000 and +'range-bitmap' = 0x01000001, then: + +- bit position (0) is set, and the corresponding mapped + label from the range is 16000 + (0 * 'label-step') or + 16000 for default 'label-step' = 1. +- bit position (24) is set, and the corresponding mapped + label from the range is 16000 + (24 * 'label-step') or + 16024 for default 'label-step' = 1. + """ + 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})*)?'}), is_leaf=True, yang_name="range-bitmap", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:hex-string', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """range_bitmap must be of a type compatible with yang:hex-string""", + 'defined-type': "yang:hex-string", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}), is_leaf=True, yang_name="range-bitmap", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:hex-string', is_config=True)""", + }) + + self.__range_bitmap = t + if hasattr(self, '_set'): + self._set() + + def _unset_range_bitmap(self): + self.__range_bitmap = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}), is_leaf=True, yang_name="range-bitmap", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:hex-string', is_config=True) + + + def _get_otn_label_range(self): + """ + Getter method for otn_label_range, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/label_restriction/otn_label_range (container) + + YANG Description: Label range information for OTN. + """ + return self.__otn_label_range + + def _set_otn_label_range(self, v, load=False): + """ + Setter method for otn_label_range, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/label_restriction/otn_label_range (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_otn_label_range is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_otn_label_range() directly. + + YANG Description: Label range information for OTN. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=otn_label_range.otn_label_range, is_container='container', yang_name="otn-label-range", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """otn_label_range must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=otn_label_range.otn_label_range, is_container='container', yang_name="otn-label-range", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True)""", + }) + + self.__otn_label_range = t + if hasattr(self, '_set'): + self._set() + + def _unset_otn_label_range(self): + self.__otn_label_range = YANGDynClass(base=otn_label_range.otn_label_range, is_container='container', yang_name="otn-label-range", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + + + def _get_ethernet_label_range(self): + """ + Getter method for ethernet_label_range, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/label_restriction/ethernet_label_range (container) + + YANG Description: Ethernet-specific label range related information. + """ + return self.__ethernet_label_range + + def _set_ethernet_label_range(self, v, load=False): + """ + Setter method for ethernet_label_range, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/label_restriction/ethernet_label_range (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_ethernet_label_range is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_ethernet_label_range() directly. + + YANG Description: Ethernet-specific label range related information. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=ethernet_label_range.ethernet_label_range, is_container='container', yang_name="ethernet-label-range", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """ethernet_label_range must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=ethernet_label_range.ethernet_label_range, is_container='container', yang_name="ethernet-label-range", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='container', is_config=True)""", + }) + + self.__ethernet_label_range = t + if hasattr(self, '_set'): + self._set() + + def _unset_ethernet_label_range(self): + self.__ethernet_label_range = YANGDynClass(base=ethernet_label_range.ethernet_label_range, is_container='container', yang_name="ethernet-label-range", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='container', is_config=True) + + restriction = __builtin__.property(_get_restriction, _set_restriction) + index = __builtin__.property(_get_index, _set_index) + label_start = __builtin__.property(_get_label_start, _set_label_start) + label_end = __builtin__.property(_get_label_end, _set_label_end) + label_step = __builtin__.property(_get_label_step, _set_label_step) + range_bitmap = __builtin__.property(_get_range_bitmap, _set_range_bitmap) + otn_label_range = __builtin__.property(_get_otn_label_range, _set_otn_label_range) + ethernet_label_range = __builtin__.property(_get_ethernet_label_range, _set_ethernet_label_range) + + + _pyangbind_elements = OrderedDict([('restriction', restriction), ('index', index), ('label_start', label_start), ('label_end', label_end), ('label_step', label_step), ('range_bitmap', range_bitmap), ('otn_label_range', otn_label_range), ('ethernet_label_range', ethernet_label_range), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/label_restriction/ethernet_label_range/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/label_restriction/ethernet_label_range/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..3ee376c6a7df9fdbee967d382797a74126c05f56 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/label_restriction/ethernet_label_range/__init__.py @@ -0,0 +1,154 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 ethernet_label_range(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/label-restrictions/label-restriction/ethernet-label-range. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Ethernet-specific label range related information. + """ + __slots__ = ('_path_helper', '_extmethods', '__tag_type','__priority',) + + _yang_name = 'ethernet-label-range' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__tag_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 's-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:s-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:s-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}},), is_leaf=True, yang_name="tag-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:eth-tag-type', is_config=True) + self.__priority = YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), is_leaf=True, yang_name="priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', 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 ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'label-restrictions', 'label-restriction', 'ethernet-label-range'] + + def _get_tag_type(self): + """ + Getter method for tag_type, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/label_restriction/ethernet_label_range/tag_type (etht-types:eth-tag-type) + + YANG Description: VLAN tag type. + """ + return self.__tag_type + + def _set_tag_type(self, v, load=False): + """ + Setter method for tag_type, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/label_restriction/ethernet_label_range/tag_type (etht-types:eth-tag-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_tag_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tag_type() directly. + + YANG Description: VLAN tag type. + """ + 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={'c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 's-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:s-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:s-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}},), is_leaf=True, yang_name="tag-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:eth-tag-type', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tag_type must be of a type compatible with etht-types:eth-tag-type""", + 'defined-type': "etht-types:eth-tag-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 's-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:s-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:s-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}},), is_leaf=True, yang_name="tag-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:eth-tag-type', is_config=True)""", + }) + + self.__tag_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_tag_type(self): + self.__tag_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 's-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:s-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:s-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}},), is_leaf=True, yang_name="tag-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:eth-tag-type', is_config=True) + + + def _get_priority(self): + """ + Getter method for priority, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/label_restriction/ethernet_label_range/priority (uint8) + + YANG Description: priority. + """ + return self.__priority + + def _set_priority(self, v, load=False): + """ + Setter method for priority, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/label_restriction/ethernet_label_range/priority (uint8) + If this variable is read-only (config: false) in the + source YANG file, then _set_priority is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_priority() directly. + + YANG Description: priority. + """ + 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="priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint8', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """priority 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="priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint8', is_config=True)""", + }) + + self.__priority = t + if hasattr(self, '_set'): + self._set() + + def _unset_priority(self): + self.__priority = YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), is_leaf=True, yang_name="priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint8', is_config=True) + + tag_type = __builtin__.property(_get_tag_type, _set_tag_type) + priority = __builtin__.property(_get_priority, _set_priority) + + + _pyangbind_elements = OrderedDict([('tag_type', tag_type), ('priority', priority), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/label_restriction/label_end/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/label_restriction/label_end/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e6bcde2cf63e6308e080f14000153b02c2c907fe --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/label_restriction/label_end/__init__.py @@ -0,0 +1,119 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 te_label +class label_end(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/label-restrictions/label-restriction/label-end. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: This is the ending label if a label range is specified. +This attribute is not set if a single label is specified. + """ + __slots__ = ('_path_helper', '_extmethods', '__te_label',) + + _yang_name = 'label-end' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__te_label = YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-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 ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'label-restrictions', 'label-restriction', 'label-end'] + + def _get_te_label(self): + """ + Getter method for te_label, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/label_restriction/label_end/te_label (container) + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + return self.__te_label + + def _set_te_label(self, v, load=False): + """ + Setter method for te_label, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/label_restriction/label_end/te_label (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_te_label is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_te_label() directly. + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """te_label must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__te_label = t + if hasattr(self, '_set'): + self._set() + + def _unset_te_label(self): + self.__te_label = YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + te_label = __builtin__.property(_get_te_label, _set_te_label) + + + _pyangbind_elements = OrderedDict([('te_label', te_label), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/label_restriction/label_end/te_label/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/label_restriction/label_end/te_label/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..d964dca5c1af89e12a0f8f24f4fc1633e1054e5a --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/label_restriction/label_end/te_label/__init__.py @@ -0,0 +1,234 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 otn +class te_label(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/label-restrictions/label-restriction/label-end/te-label. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + __slots__ = ('_path_helper', '_extmethods', '__generic','__otn','__vlanid','__direction',) + + _yang_name = 'te-label' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__generic = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True) + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + self.__vlanid = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True) + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', 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 ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'label-restrictions', 'label-restriction', 'label-end', 'te-label'] + + def _get_generic(self): + """ + Getter method for generic, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/label_restriction/label_end/te_label/generic (rt-types:generalized-label) + + YANG Description: TE label specified in a generic format. + """ + return self.__generic + + def _set_generic(self, v, load=False): + """ + Setter method for generic, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/label_restriction/label_end/te_label/generic (rt-types:generalized-label) + If this variable is read-only (config: false) in the + source YANG file, then _set_generic is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_generic() directly. + + YANG Description: TE label specified in a generic format. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """generic must be of a type compatible with rt-types:generalized-label""", + 'defined-type': "rt-types:generalized-label", + 'generated-type': """YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True)""", + }) + + self.__generic = t + if hasattr(self, '_set'): + self._set() + + def _unset_generic(self): + self.__generic = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True) + + + def _get_otn(self): + """ + Getter method for otn, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/label_restriction/label_end/te_label/otn (container) + + YANG Description: Label start or label end for OTN. + """ + return self.__otn + + def _set_otn(self, v, load=False): + """ + Setter method for otn, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/label_restriction/label_end/te_label/otn (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_otn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_otn() directly. + + YANG Description: Label start or label end for OTN. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """otn must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True)""", + }) + + self.__otn = t + if hasattr(self, '_set'): + self._set() + + def _unset_otn(self): + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + + + def _get_vlanid(self): + """ + Getter method for vlanid, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/label_restriction/label_end/te_label/vlanid (etht-types:vlanid) + + YANG Description: VLAN tag id. + """ + return self.__vlanid + + def _set_vlanid(self, v, load=False): + """ + Setter method for vlanid, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/label_restriction/label_end/te_label/vlanid (etht-types:vlanid) + If this variable is read-only (config: false) in the + source YANG file, then _set_vlanid is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_vlanid() directly. + + YANG Description: VLAN tag id. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """vlanid must be of a type compatible with etht-types:vlanid""", + 'defined-type': "etht-types:vlanid", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True)""", + }) + + self.__vlanid = t + if hasattr(self, '_set'): + self._set() + + def _unset_vlanid(self): + self.__vlanid = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True) + + + def _get_direction(self): + """ + Getter method for direction, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/label_restriction/label_end/te_label/direction (te-label-direction) + + YANG Description: Label direction. + """ + return self.__direction + + def _set_direction(self, v, load=False): + """ + Setter method for direction, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/label_restriction/label_end/te_label/direction (te-label-direction) + If this variable is read-only (config: false) in the + source YANG file, then _set_direction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_direction() directly. + + YANG Description: Label direction. + """ + 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={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """direction must be of a type compatible with te-label-direction""", + 'defined-type': "ietf-te-topology:te-label-direction", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=True)""", + }) + + self.__direction = t + if hasattr(self, '_set'): + self._set() + + def _unset_direction(self): + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=True) + + generic = __builtin__.property(_get_generic, _set_generic) + otn = __builtin__.property(_get_otn, _set_otn) + vlanid = __builtin__.property(_get_vlanid, _set_vlanid) + direction = __builtin__.property(_get_direction, _set_direction) + + __choices__ = {'technology': {'generic': ['generic'], 'otn': ['otn'], 'eth': ['vlanid']}} + _pyangbind_elements = OrderedDict([('generic', generic), ('otn', otn), ('vlanid', vlanid), ('direction', direction), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/label_restriction/label_end/te_label/otn/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/label_restriction/label_end/te_label/otn/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..360a1223487e55f8e2ba8a86690025ee7973a9a0 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/label_restriction/label_end/te_label/otn/__init__.py @@ -0,0 +1,154 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 otn(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/label-restrictions/label-restriction/label-end/te-label/otn. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Label start or label end for OTN. + """ + __slots__ = ('_path_helper', '_extmethods', '__tpn','__ts',) + + _yang_name = 'otn' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__tpn = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('range-type', 'trib-port'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True) + self.__ts = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts", parent=self, choice=('range-type', 'trib-slot'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-ts', 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 ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'label-restrictions', 'label-restriction', 'label-end', 'te-label', 'otn'] + + def _get_tpn(self): + """ + Getter method for tpn, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/label_restriction/label_end/te_label/otn/tpn (otn-tpn) + + YANG Description: Tributary Port Number (TPN). + """ + return self.__tpn + + def _set_tpn(self, v, load=False): + """ + Setter method for tpn, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/label_restriction/label_end/te_label/otn/tpn (otn-tpn) + If this variable is read-only (config: false) in the + source YANG file, then _set_tpn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tpn() directly. + + YANG Description: Tributary Port Number (TPN). + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('range-type', 'trib-port'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tpn must be of a type compatible with otn-tpn""", + 'defined-type': "ietf-otn-topology:otn-tpn", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('range-type', 'trib-port'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True)""", + }) + + self.__tpn = t + if hasattr(self, '_set'): + self._set() + + def _unset_tpn(self): + self.__tpn = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('range-type', 'trib-port'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True) + + + def _get_ts(self): + """ + Getter method for ts, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/label_restriction/label_end/te_label/otn/ts (otn-ts) + + YANG Description: Tributary Slot (TS) number. + """ + return self.__ts + + def _set_ts(self, v, load=False): + """ + Setter method for ts, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/label_restriction/label_end/te_label/otn/ts (otn-ts) + If this variable is read-only (config: false) in the + source YANG file, then _set_ts is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_ts() directly. + + YANG Description: Tributary Slot (TS) number. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts", parent=self, choice=('range-type', 'trib-slot'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-ts', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """ts must be of a type compatible with otn-ts""", + 'defined-type': "ietf-otn-topology:otn-ts", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts", parent=self, choice=('range-type', 'trib-slot'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-ts', is_config=True)""", + }) + + self.__ts = t + if hasattr(self, '_set'): + self._set() + + def _unset_ts(self): + self.__ts = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts", parent=self, choice=('range-type', 'trib-slot'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-ts', is_config=True) + + tpn = __builtin__.property(_get_tpn, _set_tpn) + ts = __builtin__.property(_get_ts, _set_ts) + + __choices__ = {'range-type': {'trib-port': ['tpn'], 'trib-slot': ['ts']}} + _pyangbind_elements = OrderedDict([('tpn', tpn), ('ts', ts), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/label_restriction/label_start/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/label_restriction/label_start/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..438d60e5b369b0b6ef5d3d7e90ce1d73b8373a05 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/label_restriction/label_start/__init__.py @@ -0,0 +1,120 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 te_label +class label_start(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/label-restrictions/label-restriction/label-start. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: This is the starting label if a label range is specified. +This is the label value if a single label is specified, +in which case the 'label-end' attribute is not set. + """ + __slots__ = ('_path_helper', '_extmethods', '__te_label',) + + _yang_name = 'label-start' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__te_label = YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-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 ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'label-restrictions', 'label-restriction', 'label-start'] + + def _get_te_label(self): + """ + Getter method for te_label, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/label_restriction/label_start/te_label (container) + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + return self.__te_label + + def _set_te_label(self, v, load=False): + """ + Setter method for te_label, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/label_restriction/label_start/te_label (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_te_label is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_te_label() directly. + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """te_label must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__te_label = t + if hasattr(self, '_set'): + self._set() + + def _unset_te_label(self): + self.__te_label = YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + te_label = __builtin__.property(_get_te_label, _set_te_label) + + + _pyangbind_elements = OrderedDict([('te_label', te_label), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/label_restriction/label_start/te_label/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/label_restriction/label_start/te_label/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..8e14efa20446bf26b79d2976780eab84d73465d2 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/label_restriction/label_start/te_label/__init__.py @@ -0,0 +1,234 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 otn +class te_label(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/label-restrictions/label-restriction/label-start/te-label. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + __slots__ = ('_path_helper', '_extmethods', '__generic','__otn','__vlanid','__direction',) + + _yang_name = 'te-label' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__generic = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True) + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + self.__vlanid = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True) + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', 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 ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'label-restrictions', 'label-restriction', 'label-start', 'te-label'] + + def _get_generic(self): + """ + Getter method for generic, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/label_restriction/label_start/te_label/generic (rt-types:generalized-label) + + YANG Description: TE label specified in a generic format. + """ + return self.__generic + + def _set_generic(self, v, load=False): + """ + Setter method for generic, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/label_restriction/label_start/te_label/generic (rt-types:generalized-label) + If this variable is read-only (config: false) in the + source YANG file, then _set_generic is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_generic() directly. + + YANG Description: TE label specified in a generic format. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """generic must be of a type compatible with rt-types:generalized-label""", + 'defined-type': "rt-types:generalized-label", + 'generated-type': """YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True)""", + }) + + self.__generic = t + if hasattr(self, '_set'): + self._set() + + def _unset_generic(self): + self.__generic = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True) + + + def _get_otn(self): + """ + Getter method for otn, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/label_restriction/label_start/te_label/otn (container) + + YANG Description: Label start or label end for OTN. + """ + return self.__otn + + def _set_otn(self, v, load=False): + """ + Setter method for otn, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/label_restriction/label_start/te_label/otn (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_otn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_otn() directly. + + YANG Description: Label start or label end for OTN. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """otn must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True)""", + }) + + self.__otn = t + if hasattr(self, '_set'): + self._set() + + def _unset_otn(self): + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + + + def _get_vlanid(self): + """ + Getter method for vlanid, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/label_restriction/label_start/te_label/vlanid (etht-types:vlanid) + + YANG Description: VLAN tag id. + """ + return self.__vlanid + + def _set_vlanid(self, v, load=False): + """ + Setter method for vlanid, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/label_restriction/label_start/te_label/vlanid (etht-types:vlanid) + If this variable is read-only (config: false) in the + source YANG file, then _set_vlanid is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_vlanid() directly. + + YANG Description: VLAN tag id. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """vlanid must be of a type compatible with etht-types:vlanid""", + 'defined-type': "etht-types:vlanid", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True)""", + }) + + self.__vlanid = t + if hasattr(self, '_set'): + self._set() + + def _unset_vlanid(self): + self.__vlanid = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True) + + + def _get_direction(self): + """ + Getter method for direction, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/label_restriction/label_start/te_label/direction (te-label-direction) + + YANG Description: Label direction. + """ + return self.__direction + + def _set_direction(self, v, load=False): + """ + Setter method for direction, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/label_restriction/label_start/te_label/direction (te-label-direction) + If this variable is read-only (config: false) in the + source YANG file, then _set_direction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_direction() directly. + + YANG Description: Label direction. + """ + 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={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """direction must be of a type compatible with te-label-direction""", + 'defined-type': "ietf-te-topology:te-label-direction", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=True)""", + }) + + self.__direction = t + if hasattr(self, '_set'): + self._set() + + def _unset_direction(self): + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=True) + + generic = __builtin__.property(_get_generic, _set_generic) + otn = __builtin__.property(_get_otn, _set_otn) + vlanid = __builtin__.property(_get_vlanid, _set_vlanid) + direction = __builtin__.property(_get_direction, _set_direction) + + __choices__ = {'technology': {'generic': ['generic'], 'otn': ['otn'], 'eth': ['vlanid']}} + _pyangbind_elements = OrderedDict([('generic', generic), ('otn', otn), ('vlanid', vlanid), ('direction', direction), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/label_restriction/label_start/te_label/otn/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/label_restriction/label_start/te_label/otn/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..56b84bbbdd84e3d8688b21d2ac1aeaa683471a86 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/label_restriction/label_start/te_label/otn/__init__.py @@ -0,0 +1,154 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 otn(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/label-restrictions/label-restriction/label-start/te-label/otn. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Label start or label end for OTN. + """ + __slots__ = ('_path_helper', '_extmethods', '__tpn','__ts',) + + _yang_name = 'otn' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__tpn = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('range-type', 'trib-port'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True) + self.__ts = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts", parent=self, choice=('range-type', 'trib-slot'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-ts', 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 ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'label-restrictions', 'label-restriction', 'label-start', 'te-label', 'otn'] + + def _get_tpn(self): + """ + Getter method for tpn, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/label_restriction/label_start/te_label/otn/tpn (otn-tpn) + + YANG Description: Tributary Port Number (TPN). + """ + return self.__tpn + + def _set_tpn(self, v, load=False): + """ + Setter method for tpn, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/label_restriction/label_start/te_label/otn/tpn (otn-tpn) + If this variable is read-only (config: false) in the + source YANG file, then _set_tpn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tpn() directly. + + YANG Description: Tributary Port Number (TPN). + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('range-type', 'trib-port'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tpn must be of a type compatible with otn-tpn""", + 'defined-type': "ietf-otn-topology:otn-tpn", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('range-type', 'trib-port'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True)""", + }) + + self.__tpn = t + if hasattr(self, '_set'): + self._set() + + def _unset_tpn(self): + self.__tpn = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('range-type', 'trib-port'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True) + + + def _get_ts(self): + """ + Getter method for ts, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/label_restriction/label_start/te_label/otn/ts (otn-ts) + + YANG Description: Tributary Slot (TS) number. + """ + return self.__ts + + def _set_ts(self, v, load=False): + """ + Setter method for ts, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/label_restriction/label_start/te_label/otn/ts (otn-ts) + If this variable is read-only (config: false) in the + source YANG file, then _set_ts is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_ts() directly. + + YANG Description: Tributary Slot (TS) number. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts", parent=self, choice=('range-type', 'trib-slot'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-ts', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """ts must be of a type compatible with otn-ts""", + 'defined-type': "ietf-otn-topology:otn-ts", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts", parent=self, choice=('range-type', 'trib-slot'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-ts', is_config=True)""", + }) + + self.__ts = t + if hasattr(self, '_set'): + self._set() + + def _unset_ts(self): + self.__ts = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts", parent=self, choice=('range-type', 'trib-slot'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-ts', is_config=True) + + tpn = __builtin__.property(_get_tpn, _set_tpn) + ts = __builtin__.property(_get_ts, _set_ts) + + __choices__ = {'range-type': {'trib-port': ['tpn'], 'trib-slot': ['ts']}} + _pyangbind_elements = OrderedDict([('tpn', tpn), ('ts', ts), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/label_restriction/label_step/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/label_restriction/label_step/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..c349c4d913142f494bea3dd6af4b17c1fe153d49 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/label_restriction/label_step/__init__.py @@ -0,0 +1,200 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 otn +class label_step(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/label-restrictions/label-restriction/label-step. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: The step increment between labels in the label range. +The label start/end values will have to be consistent +with the sign of label step. For example, +'label-start' < 'label-end' enforces 'label-step' > 0 +'label-start' > 'label-end' enforces 'label-step' < 0. + """ + __slots__ = ('_path_helper', '_extmethods', '__generic','__otn','__eth_step',) + + _yang_name = 'label-step' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__generic = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['-2147483648..2147483647']}, int_size=32), default=RestrictedClassType(base_type=long, restriction_dict={'range': ['-2147483648..2147483647']}, int_size=32)(1), is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='int32', is_config=True) + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + self.__eth_step = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), default=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16)(1), is_leaf=True, yang_name="eth-step", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint16', 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 ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'label-restrictions', 'label-restriction', 'label-step'] + + def _get_generic(self): + """ + Getter method for generic, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/label_restriction/label_step/generic (int32) + + YANG Description: Label range step. + """ + return self.__generic + + def _set_generic(self, v, load=False): + """ + Setter method for generic, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/label_restriction/label_step/generic (int32) + If this variable is read-only (config: false) in the + source YANG file, then _set_generic is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_generic() directly. + + YANG Description: Label range step. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['-2147483648..2147483647']}, int_size=32), default=RestrictedClassType(base_type=long, restriction_dict={'range': ['-2147483648..2147483647']}, int_size=32)(1), is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='int32', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """generic must be of a type compatible with int32""", + 'defined-type': "int32", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['-2147483648..2147483647']}, int_size=32), default=RestrictedClassType(base_type=long, restriction_dict={'range': ['-2147483648..2147483647']}, int_size=32)(1), is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='int32', is_config=True)""", + }) + + self.__generic = t + if hasattr(self, '_set'): + self._set() + + def _unset_generic(self): + self.__generic = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['-2147483648..2147483647']}, int_size=32), default=RestrictedClassType(base_type=long, restriction_dict={'range': ['-2147483648..2147483647']}, int_size=32)(1), is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='int32', is_config=True) + + + def _get_otn(self): + """ + Getter method for otn, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/label_restriction/label_step/otn (container) + + YANG Description: Label step for OTN + """ + return self.__otn + + def _set_otn(self, v, load=False): + """ + Setter method for otn, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/label_restriction/label_step/otn (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_otn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_otn() directly. + + YANG Description: Label step for OTN + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """otn must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True)""", + }) + + self.__otn = t + if hasattr(self, '_set'): + self._set() + + def _unset_otn(self): + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + + + def _get_eth_step(self): + """ + Getter method for eth_step, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/label_restriction/label_step/eth_step (uint16) + + YANG Description: Label step which represent possible increments for +an Ethernet VLAN tag. + """ + return self.__eth_step + + def _set_eth_step(self, v, load=False): + """ + Setter method for eth_step, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/label_restriction/label_step/eth_step (uint16) + If this variable is read-only (config: false) in the + source YANG file, then _set_eth_step is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_eth_step() directly. + + YANG Description: Label step which represent possible increments for +an Ethernet VLAN tag. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), default=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16)(1), is_leaf=True, yang_name="eth-step", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint16', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """eth_step must be of a type compatible with uint16""", + 'defined-type': "uint16", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), default=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16)(1), is_leaf=True, yang_name="eth-step", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint16', is_config=True)""", + }) + + self.__eth_step = t + if hasattr(self, '_set'): + self._set() + + def _unset_eth_step(self): + self.__eth_step = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), default=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16)(1), is_leaf=True, yang_name="eth-step", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint16', is_config=True) + + generic = __builtin__.property(_get_generic, _set_generic) + otn = __builtin__.property(_get_otn, _set_otn) + eth_step = __builtin__.property(_get_eth_step, _set_eth_step) + + __choices__ = {'technology': {'generic': ['generic'], 'otn': ['otn'], 'eth': ['eth_step']}} + _pyangbind_elements = OrderedDict([('generic', generic), ('otn', otn), ('eth_step', eth_step), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/label_restriction/label_step/otn/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/label_restriction/label_step/otn/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..0a0f6d7aebfdc5b3facdf88d2daae95138107502 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/label_restriction/label_step/otn/__init__.py @@ -0,0 +1,158 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 otn(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/label-restrictions/label-restriction/label-step/otn. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Label step for OTN + """ + __slots__ = ('_path_helper', '_extmethods', '__tpn','__ts',) + + _yang_name = 'otn' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__tpn = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('range-type', 'trib-port'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True) + self.__ts = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts", parent=self, choice=('range-type', 'trib-slot'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-ts', 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 ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'label-restrictions', 'label-restriction', 'label-step', 'otn'] + + def _get_tpn(self): + """ + Getter method for tpn, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/label_restriction/label_step/otn/tpn (otn-tpn) + + YANG Description: Label step which represents possible increments for +Tributary Port Number (TPN). + """ + return self.__tpn + + def _set_tpn(self, v, load=False): + """ + Setter method for tpn, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/label_restriction/label_step/otn/tpn (otn-tpn) + If this variable is read-only (config: false) in the + source YANG file, then _set_tpn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tpn() directly. + + YANG Description: Label step which represents possible increments for +Tributary Port Number (TPN). + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('range-type', 'trib-port'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tpn must be of a type compatible with otn-tpn""", + 'defined-type': "ietf-otn-topology:otn-tpn", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('range-type', 'trib-port'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True)""", + }) + + self.__tpn = t + if hasattr(self, '_set'): + self._set() + + def _unset_tpn(self): + self.__tpn = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('range-type', 'trib-port'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True) + + + def _get_ts(self): + """ + Getter method for ts, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/label_restriction/label_step/otn/ts (otn-ts) + + YANG Description: Label step which represents possible increments for +Tributary Slot (TS) number. + """ + return self.__ts + + def _set_ts(self, v, load=False): + """ + Setter method for ts, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/label_restriction/label_step/otn/ts (otn-ts) + If this variable is read-only (config: false) in the + source YANG file, then _set_ts is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_ts() directly. + + YANG Description: Label step which represents possible increments for +Tributary Slot (TS) number. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts", parent=self, choice=('range-type', 'trib-slot'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-ts', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """ts must be of a type compatible with otn-ts""", + 'defined-type': "ietf-otn-topology:otn-ts", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts", parent=self, choice=('range-type', 'trib-slot'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-ts', is_config=True)""", + }) + + self.__ts = t + if hasattr(self, '_set'): + self._set() + + def _unset_ts(self): + self.__ts = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts", parent=self, choice=('range-type', 'trib-slot'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-ts', is_config=True) + + tpn = __builtin__.property(_get_tpn, _set_tpn) + ts = __builtin__.property(_get_ts, _set_ts) + + __choices__ = {'range-type': {'trib-port': ['tpn'], 'trib-slot': ['ts']}} + _pyangbind_elements = OrderedDict([('tpn', tpn), ('ts', ts), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/label_restriction/otn_label_range/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/label_restriction/otn_label_range/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..bfc2cd1e0e44c93eedd87a9fd2d41467feaef47d --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/label_restriction/otn_label_range/__init__.py @@ -0,0 +1,256 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 otn_label_range(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/label-restrictions/label-restriction/otn-label-range. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Label range information for OTN. + """ + __slots__ = ('_path_helper', '_extmethods', '__range_type','__tsg','__odu_type_list','__priority',) + + _yang_name = 'otn-label-range' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__range_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'trib-slot': {}, 'trib-port': {}},), is_leaf=True, yang_name="range-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-label-range-type', is_config=True) + self.__tsg = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + self.__odu_type_list = YANGDynClass(unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},)), is_leaf=False, yang_name="odu-type-list", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + self.__priority = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..7']}), is_leaf=True, yang_name="priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', 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 ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'label-restrictions', 'label-restriction', 'otn-label-range'] + + def _get_range_type(self): + """ + Getter method for range_type, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/label_restriction/otn_label_range/range_type (otn-label-range-type) + + YANG Description: The type of range (e.g., TPN or TS) +to which the label range applies + """ + return self.__range_type + + def _set_range_type(self, v, load=False): + """ + Setter method for range_type, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/label_restriction/otn_label_range/range_type (otn-label-range-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_range_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_range_type() directly. + + YANG Description: The type of range (e.g., TPN or TS) +to which the label range applies + """ + 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={'trib-slot': {}, 'trib-port': {}},), is_leaf=True, yang_name="range-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-label-range-type', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """range_type must be of a type compatible with otn-label-range-type""", + 'defined-type': "ietf-otn-topology:otn-label-range-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'trib-slot': {}, 'trib-port': {}},), is_leaf=True, yang_name="range-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-label-range-type', is_config=True)""", + }) + + self.__range_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_range_type(self): + self.__range_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'trib-slot': {}, 'trib-port': {}},), is_leaf=True, yang_name="range-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-label-range-type', is_config=True) + + + def _get_tsg(self): + """ + Getter method for tsg, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/label_restriction/otn_label_range/tsg (identityref) + + YANG Description: Tributary slot granularity (TSG) to which the label range +applies. + +This leaf MUST be present when the range-type is TS. + +This leaf MAY be omitted when mapping an ODUk over an OTUk +Link. In this case the range-type is tpn, with only one +entry (ODUk), and the tpn range has only one value (1). + """ + return self.__tsg + + def _set_tsg(self, v, load=False): + """ + Setter method for tsg, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/label_restriction/otn_label_range/tsg (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_tsg is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tsg() directly. + + YANG Description: Tributary slot granularity (TSG) to which the label range +applies. + +This leaf MUST be present when the range-type is TS. + +This leaf MAY be omitted when mapping an ODUk over an OTUk +Link. In this case the range-type is tpn, with only one +entry (ODUk), and the tpn range has only one value (1). + """ + 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={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tsg must be of a type compatible with identityref""", + 'defined-type': "ietf-otn-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True)""", + }) + + self.__tsg = t + if hasattr(self, '_set'): + self._set() + + def _unset_tsg(self): + self.__tsg = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + + + def _get_odu_type_list(self): + """ + Getter method for odu_type_list, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/label_restriction/otn_label_range/odu_type_list (identityref) + + YANG Description: List of ODU types to which the label range applies. + +An Empty odu-type-list means that the label range +applies to all the supported ODU types. + """ + return self.__odu_type_list + + def _set_odu_type_list(self, v, load=False): + """ + Setter method for odu_type_list, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/label_restriction/otn_label_range/odu_type_list (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_odu_type_list is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_odu_type_list() directly. + + YANG Description: List of ODU types to which the label range applies. + +An Empty odu-type-list means that the label range +applies to all the supported ODU types. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},)), is_leaf=False, yang_name="odu-type-list", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """odu_type_list must be of a type compatible with identityref""", + 'defined-type': "ietf-otn-topology:identityref", + 'generated-type': """YANGDynClass(unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},)), is_leaf=False, yang_name="odu-type-list", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True)""", + }) + + self.__odu_type_list = t + if hasattr(self, '_set'): + self._set() + + def _unset_odu_type_list(self): + self.__odu_type_list = YANGDynClass(unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},)), is_leaf=False, yang_name="odu-type-list", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + + + def _get_priority(self): + """ + Getter method for priority, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/label_restriction/otn_label_range/priority (uint8) + + YANG Description: Priority in Interface Switching Capability +Descriptor (ISCD). + """ + return self.__priority + + def _set_priority(self, v, load=False): + """ + Setter method for priority, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/label_restriction/otn_label_range/priority (uint8) + If this variable is read-only (config: false) in the + source YANG file, then _set_priority is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_priority() directly. + + YANG Description: Priority in Interface Switching Capability +Descriptor (ISCD). + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..7']}), is_leaf=True, yang_name="priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint8', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """priority must be of a type compatible with uint8""", + 'defined-type': "uint8", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..7']}), is_leaf=True, yang_name="priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint8', is_config=True)""", + }) + + self.__priority = t + if hasattr(self, '_set'): + self._set() + + def _unset_priority(self): + self.__priority = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..7']}), is_leaf=True, yang_name="priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint8', is_config=True) + + range_type = __builtin__.property(_get_range_type, _set_range_type) + tsg = __builtin__.property(_get_tsg, _set_tsg) + odu_type_list = __builtin__.property(_get_odu_type_list, _set_odu_type_list) + priority = __builtin__.property(_get_priority, _set_priority) + + + _pyangbind_elements = OrderedDict([('range_type', range_type), ('tsg', tsg), ('odu_type_list', odu_type_list), ('priority', priority), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..b7a646ea671ab3fe76eb70143aea289f4c130628 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/__init__.py @@ -0,0 +1,368 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 label_restrictions +from . import underlay +from . import path_constraints +from . import optimizations +from . import path_properties +class local_link_connectivity(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/local-link-connectivity. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: The termination capabilities between the TTP and the LTP. +This capability information can be used to compute +the tunnel path. +The Interface Adjustment Capability Descriptors (IACDs) +(defined in RFC 6001) on each LTP can be derived from +this list. + """ + __slots__ = ('_path_helper', '_extmethods', '__link_tp_ref','__label_restrictions','__is_allowed','__underlay','__path_constraints','__optimizations','__path_properties',) + + _yang_name = 'local-link-connectivity' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__link_tp_ref = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="link-tp-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=True) + self.__label_restrictions = YANGDynClass(base=label_restrictions.label_restrictions, is_container='container', yang_name="label-restrictions", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__is_allowed = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="is-allowed", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='boolean', is_config=True) + self.__underlay = YANGDynClass(base=underlay.underlay, is_container='container', yang_name="underlay", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__path_constraints = YANGDynClass(base=path_constraints.path_constraints, is_container='container', yang_name="path-constraints", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__optimizations = YANGDynClass(base=optimizations.optimizations, is_container='container', yang_name="optimizations", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__path_properties = YANGDynClass(base=path_properties.path_properties, is_container='container', yang_name="path-properties", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', 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 ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'local-link-connectivity'] + + def _get_link_tp_ref(self): + """ + Getter method for link_tp_ref, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/link_tp_ref (leafref) + + YANG Description: LTP. + """ + return self.__link_tp_ref + + def _set_link_tp_ref(self, v, load=False): + """ + Setter method for link_tp_ref, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/link_tp_ref (leafref) + If this variable is read-only (config: false) in the + source YANG file, then _set_link_tp_ref is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_link_tp_ref() directly. + + YANG Description: LTP. + """ + 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-tp-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """link_tp_ref must be of a type compatible with leafref""", + 'defined-type': "leafref", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="link-tp-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=True)""", + }) + + self.__link_tp_ref = t + if hasattr(self, '_set'): + self._set() + + def _unset_link_tp_ref(self): + self.__link_tp_ref = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="link-tp-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=True) + + + def _get_label_restrictions(self): + """ + Getter method for label_restrictions, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions (container) + + YANG Description: The label restrictions container. + """ + return self.__label_restrictions + + def _set_label_restrictions(self, v, load=False): + """ + Setter method for label_restrictions, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_label_restrictions is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_label_restrictions() directly. + + YANG Description: The label restrictions container. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=label_restrictions.label_restrictions, is_container='container', yang_name="label-restrictions", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """label_restrictions must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=label_restrictions.label_restrictions, is_container='container', yang_name="label-restrictions", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__label_restrictions = t + if hasattr(self, '_set'): + self._set() + + def _unset_label_restrictions(self): + self.__label_restrictions = YANGDynClass(base=label_restrictions.label_restrictions, is_container='container', yang_name="label-restrictions", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_is_allowed(self): + """ + Getter method for is_allowed, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/is_allowed (boolean) + + YANG Description: 'true' - switching is allowed; +'false' - switching is disallowed. + """ + return self.__is_allowed + + def _set_is_allowed(self, v, load=False): + """ + Setter method for is_allowed, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/is_allowed (boolean) + If this variable is read-only (config: false) in the + source YANG file, then _set_is_allowed is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_is_allowed() directly. + + YANG Description: 'true' - switching is allowed; +'false' - switching is disallowed. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBool, is_leaf=True, yang_name="is-allowed", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='boolean', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """is_allowed must be of a type compatible with boolean""", + 'defined-type': "boolean", + 'generated-type': """YANGDynClass(base=YANGBool, is_leaf=True, yang_name="is-allowed", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='boolean', is_config=True)""", + }) + + self.__is_allowed = t + if hasattr(self, '_set'): + self._set() + + def _unset_is_allowed(self): + self.__is_allowed = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="is-allowed", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='boolean', is_config=True) + + + def _get_underlay(self): + """ + Getter method for underlay, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay (container) + + YANG Description: Attributes of the TE link underlay. + """ + return self.__underlay + + def _set_underlay(self, v, load=False): + """ + Setter method for underlay, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_underlay is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_underlay() directly. + + YANG Description: Attributes of the TE link underlay. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=underlay.underlay, is_container='container', yang_name="underlay", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """underlay must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=underlay.underlay, is_container='container', yang_name="underlay", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__underlay = t + if hasattr(self, '_set'): + self._set() + + def _unset_underlay(self): + self.__underlay = YANGDynClass(base=underlay.underlay, is_container='container', yang_name="underlay", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_path_constraints(self): + """ + Getter method for path_constraints, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints (container) + + YANG Description: TE named path constraints container. + """ + return self.__path_constraints + + def _set_path_constraints(self, v, load=False): + """ + Setter method for path_constraints, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_constraints is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_constraints() directly. + + YANG Description: TE named path constraints container. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=path_constraints.path_constraints, is_container='container', yang_name="path-constraints", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_constraints must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=path_constraints.path_constraints, is_container='container', yang_name="path-constraints", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__path_constraints = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_constraints(self): + self.__path_constraints = YANGDynClass(base=path_constraints.path_constraints, is_container='container', yang_name="path-constraints", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_optimizations(self): + """ + Getter method for optimizations, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations (container) + + YANG Description: The objective function container that includes +attributes to impose when computing a TE path. + """ + return self.__optimizations + + def _set_optimizations(self, v, load=False): + """ + Setter method for optimizations, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_optimizations is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_optimizations() directly. + + YANG Description: The objective function container that includes +attributes to impose when computing a TE path. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=optimizations.optimizations, is_container='container', yang_name="optimizations", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """optimizations must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=optimizations.optimizations, is_container='container', yang_name="optimizations", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__optimizations = t + if hasattr(self, '_set'): + self._set() + + def _unset_optimizations(self): + self.__optimizations = YANGDynClass(base=optimizations.optimizations, is_container='container', yang_name="optimizations", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_path_properties(self): + """ + Getter method for path_properties, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties (container) + + YANG Description: The TE path properties. + """ + return self.__path_properties + + def _set_path_properties(self, v, load=False): + """ + Setter method for path_properties, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_properties is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_properties() directly. + + YANG Description: The TE path properties. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=path_properties.path_properties, is_container='container', yang_name="path-properties", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_properties must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=path_properties.path_properties, is_container='container', yang_name="path-properties", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__path_properties = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_properties(self): + self.__path_properties = YANGDynClass(base=path_properties.path_properties, is_container='container', yang_name="path-properties", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + link_tp_ref = __builtin__.property(_get_link_tp_ref, _set_link_tp_ref) + label_restrictions = __builtin__.property(_get_label_restrictions, _set_label_restrictions) + is_allowed = __builtin__.property(_get_is_allowed, _set_is_allowed) + underlay = __builtin__.property(_get_underlay, _set_underlay) + path_constraints = __builtin__.property(_get_path_constraints, _set_path_constraints) + optimizations = __builtin__.property(_get_optimizations, _set_optimizations) + path_properties = __builtin__.property(_get_path_properties) + + + _pyangbind_elements = OrderedDict([('link_tp_ref', link_tp_ref), ('label_restrictions', label_restrictions), ('is_allowed', is_allowed), ('underlay', underlay), ('path_constraints', path_constraints), ('optimizations', optimizations), ('path_properties', path_properties), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..37d7f23f2187c3896264636b88d1dbe26eaafe2d --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/__init__.py @@ -0,0 +1,120 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 label_restriction +class label_restrictions(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/local-link-connectivity/label-restrictions. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: The label restrictions container. + """ + __slots__ = ('_path_helper', '_extmethods', '__label_restriction',) + + _yang_name = 'label-restrictions' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__label_restriction = YANGDynClass(base=YANGListType("index",label_restriction.label_restriction, yang_name="label-restriction", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='index', extensions=None), is_container='list', yang_name="label-restriction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-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 ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'local-link-connectivity', 'label-restrictions'] + + def _get_label_restriction(self): + """ + Getter method for label_restriction, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/label_restriction (list) + + YANG Description: The absence of the label restrictions container implies +that all labels are acceptable; otherwise, only restricted +labels are available. + """ + return self.__label_restriction + + def _set_label_restriction(self, v, load=False): + """ + Setter method for label_restriction, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/label_restriction (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_label_restriction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_label_restriction() directly. + + YANG Description: The absence of the label restrictions container implies +that all labels are acceptable; otherwise, only restricted +labels are available. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("index",label_restriction.label_restriction, yang_name="label-restriction", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='index', extensions=None), is_container='list', yang_name="label-restriction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """label_restriction must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("index",label_restriction.label_restriction, yang_name="label-restriction", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='index', extensions=None), is_container='list', yang_name="label-restriction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True)""", + }) + + self.__label_restriction = t + if hasattr(self, '_set'): + self._set() + + def _unset_label_restriction(self): + self.__label_restriction = YANGDynClass(base=YANGListType("index",label_restriction.label_restriction, yang_name="label-restriction", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='index', extensions=None), is_container='list', yang_name="label-restriction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + + label_restriction = __builtin__.property(_get_label_restriction, _set_label_restriction) + + + _pyangbind_elements = OrderedDict([('label_restriction', label_restriction), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/label_restriction/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/label_restriction/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..5d5f6509bd6063c7a3dce0d27b36f2db0aded0f1 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/label_restriction/__init__.py @@ -0,0 +1,450 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 label_start +from . import label_end +from . import label_step +from . import otn_label_range +from . import ethernet_label_range +class label_restriction(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/local-link-connectivity/label-restrictions/label-restriction. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: The absence of the label restrictions container implies +that all labels are acceptable; otherwise, only restricted +labels are available. + """ + __slots__ = ('_path_helper', '_extmethods', '__restriction','__index','__label_start','__label_end','__label_step','__range_bitmap','__otn_label_range','__ethernet_label_range',) + + _yang_name = 'label-restriction' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__restriction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'inclusive': {}, 'exclusive': {}},), default=six.text_type("inclusive"), is_leaf=True, yang_name="restriction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='enumeration', is_config=True) + self.__index = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + self.__label_start = YANGDynClass(base=label_start.label_start, is_container='container', yang_name="label-start", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__label_end = YANGDynClass(base=label_end.label_end, is_container='container', yang_name="label-end", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__label_step = YANGDynClass(base=label_step.label_step, is_container='container', yang_name="label-step", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__range_bitmap = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}), is_leaf=True, yang_name="range-bitmap", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:hex-string', is_config=True) + self.__otn_label_range = YANGDynClass(base=otn_label_range.otn_label_range, is_container='container', yang_name="otn-label-range", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + self.__ethernet_label_range = YANGDynClass(base=ethernet_label_range.ethernet_label_range, is_container='container', yang_name="ethernet-label-range", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-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 ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'local-link-connectivity', 'label-restrictions', 'label-restriction'] + + def _get_restriction(self): + """ + Getter method for restriction, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/label_restriction/restriction (enumeration) + + YANG Description: Indicates whether the list item is inclusive or exclusive. + """ + return self.__restriction + + def _set_restriction(self, v, load=False): + """ + Setter method for restriction, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/label_restriction/restriction (enumeration) + If this variable is read-only (config: false) in the + source YANG file, then _set_restriction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_restriction() directly. + + YANG Description: Indicates whether the list item is inclusive or exclusive. + """ + 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={'inclusive': {}, 'exclusive': {}},), default=six.text_type("inclusive"), is_leaf=True, yang_name="restriction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='enumeration', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """restriction must be of a type compatible with enumeration""", + 'defined-type': "ietf-te-topology:enumeration", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'inclusive': {}, 'exclusive': {}},), default=six.text_type("inclusive"), is_leaf=True, yang_name="restriction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='enumeration', is_config=True)""", + }) + + self.__restriction = t + if hasattr(self, '_set'): + self._set() + + def _unset_restriction(self): + self.__restriction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'inclusive': {}, 'exclusive': {}},), default=six.text_type("inclusive"), is_leaf=True, yang_name="restriction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='enumeration', is_config=True) + + + def _get_index(self): + """ + Getter method for index, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/label_restriction/index (uint32) + + YANG Description: The index of the label restriction list entry. + """ + return self.__index + + def _set_index(self, v, load=False): + """ + Setter method for index, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/label_restriction/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 label restriction list entry. + """ + 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=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', 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), is_leaf=True, yang_name="index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', 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), is_leaf=True, yang_name="index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + + + def _get_label_start(self): + """ + Getter method for label_start, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/label_restriction/label_start (container) + + YANG Description: This is the starting label if a label range is specified. +This is the label value if a single label is specified, +in which case the 'label-end' attribute is not set. + """ + return self.__label_start + + def _set_label_start(self, v, load=False): + """ + Setter method for label_start, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/label_restriction/label_start (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_label_start is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_label_start() directly. + + YANG Description: This is the starting label if a label range is specified. +This is the label value if a single label is specified, +in which case the 'label-end' attribute is not set. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=label_start.label_start, is_container='container', yang_name="label-start", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """label_start must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=label_start.label_start, is_container='container', yang_name="label-start", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__label_start = t + if hasattr(self, '_set'): + self._set() + + def _unset_label_start(self): + self.__label_start = YANGDynClass(base=label_start.label_start, is_container='container', yang_name="label-start", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_label_end(self): + """ + Getter method for label_end, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/label_restriction/label_end (container) + + YANG Description: This is the ending label if a label range is specified. +This attribute is not set if a single label is specified. + """ + return self.__label_end + + def _set_label_end(self, v, load=False): + """ + Setter method for label_end, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/label_restriction/label_end (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_label_end is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_label_end() directly. + + YANG Description: This is the ending label if a label range is specified. +This attribute is not set if a single label is specified. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=label_end.label_end, is_container='container', yang_name="label-end", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """label_end must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=label_end.label_end, is_container='container', yang_name="label-end", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__label_end = t + if hasattr(self, '_set'): + self._set() + + def _unset_label_end(self): + self.__label_end = YANGDynClass(base=label_end.label_end, is_container='container', yang_name="label-end", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_label_step(self): + """ + Getter method for label_step, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/label_restriction/label_step (container) + + YANG Description: The step increment between labels in the label range. +The label start/end values will have to be consistent +with the sign of label step. For example, +'label-start' < 'label-end' enforces 'label-step' > 0 +'label-start' > 'label-end' enforces 'label-step' < 0. + """ + return self.__label_step + + def _set_label_step(self, v, load=False): + """ + Setter method for label_step, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/label_restriction/label_step (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_label_step is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_label_step() directly. + + YANG Description: The step increment between labels in the label range. +The label start/end values will have to be consistent +with the sign of label step. For example, +'label-start' < 'label-end' enforces 'label-step' > 0 +'label-start' > 'label-end' enforces 'label-step' < 0. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=label_step.label_step, is_container='container', yang_name="label-step", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """label_step must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=label_step.label_step, is_container='container', yang_name="label-step", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__label_step = t + if hasattr(self, '_set'): + self._set() + + def _unset_label_step(self): + self.__label_step = YANGDynClass(base=label_step.label_step, is_container='container', yang_name="label-step", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_range_bitmap(self): + """ + Getter method for range_bitmap, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/label_restriction/range_bitmap (yang:hex-string) + + YANG Description: When there are gaps between 'label-start' and 'label-end', +this attribute is used to specify the positions +of the used labels. This is represented in big endian as +'hex-string'. +The most significant byte in the hex-string is the farthest +to the left in the byte sequence. Leading zero bytes in the +configured value may be omitted for brevity. +Each bit position in the 'range-bitmap' 'hex-string' maps +to a label in the range derived from 'label-start'. + +For example, assuming that 'label-start' = 16000 and +'range-bitmap' = 0x01000001, then: + +- bit position (0) is set, and the corresponding mapped + label from the range is 16000 + (0 * 'label-step') or + 16000 for default 'label-step' = 1. +- bit position (24) is set, and the corresponding mapped + label from the range is 16000 + (24 * 'label-step') or + 16024 for default 'label-step' = 1. + """ + return self.__range_bitmap + + def _set_range_bitmap(self, v, load=False): + """ + Setter method for range_bitmap, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/label_restriction/range_bitmap (yang:hex-string) + If this variable is read-only (config: false) in the + source YANG file, then _set_range_bitmap is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_range_bitmap() directly. + + YANG Description: When there are gaps between 'label-start' and 'label-end', +this attribute is used to specify the positions +of the used labels. This is represented in big endian as +'hex-string'. +The most significant byte in the hex-string is the farthest +to the left in the byte sequence. Leading zero bytes in the +configured value may be omitted for brevity. +Each bit position in the 'range-bitmap' 'hex-string' maps +to a label in the range derived from 'label-start'. + +For example, assuming that 'label-start' = 16000 and +'range-bitmap' = 0x01000001, then: + +- bit position (0) is set, and the corresponding mapped + label from the range is 16000 + (0 * 'label-step') or + 16000 for default 'label-step' = 1. +- bit position (24) is set, and the corresponding mapped + label from the range is 16000 + (24 * 'label-step') or + 16024 for default 'label-step' = 1. + """ + 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})*)?'}), is_leaf=True, yang_name="range-bitmap", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:hex-string', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """range_bitmap must be of a type compatible with yang:hex-string""", + 'defined-type': "yang:hex-string", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}), is_leaf=True, yang_name="range-bitmap", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:hex-string', is_config=True)""", + }) + + self.__range_bitmap = t + if hasattr(self, '_set'): + self._set() + + def _unset_range_bitmap(self): + self.__range_bitmap = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}), is_leaf=True, yang_name="range-bitmap", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:hex-string', is_config=True) + + + def _get_otn_label_range(self): + """ + Getter method for otn_label_range, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/label_restriction/otn_label_range (container) + + YANG Description: Label range information for OTN. + """ + return self.__otn_label_range + + def _set_otn_label_range(self, v, load=False): + """ + Setter method for otn_label_range, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/label_restriction/otn_label_range (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_otn_label_range is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_otn_label_range() directly. + + YANG Description: Label range information for OTN. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=otn_label_range.otn_label_range, is_container='container', yang_name="otn-label-range", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """otn_label_range must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=otn_label_range.otn_label_range, is_container='container', yang_name="otn-label-range", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True)""", + }) + + self.__otn_label_range = t + if hasattr(self, '_set'): + self._set() + + def _unset_otn_label_range(self): + self.__otn_label_range = YANGDynClass(base=otn_label_range.otn_label_range, is_container='container', yang_name="otn-label-range", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + + + def _get_ethernet_label_range(self): + """ + Getter method for ethernet_label_range, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/label_restriction/ethernet_label_range (container) + + YANG Description: Ethernet-specific label range related information. + """ + return self.__ethernet_label_range + + def _set_ethernet_label_range(self, v, load=False): + """ + Setter method for ethernet_label_range, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/label_restriction/ethernet_label_range (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_ethernet_label_range is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_ethernet_label_range() directly. + + YANG Description: Ethernet-specific label range related information. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=ethernet_label_range.ethernet_label_range, is_container='container', yang_name="ethernet-label-range", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """ethernet_label_range must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=ethernet_label_range.ethernet_label_range, is_container='container', yang_name="ethernet-label-range", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='container', is_config=True)""", + }) + + self.__ethernet_label_range = t + if hasattr(self, '_set'): + self._set() + + def _unset_ethernet_label_range(self): + self.__ethernet_label_range = YANGDynClass(base=ethernet_label_range.ethernet_label_range, is_container='container', yang_name="ethernet-label-range", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='container', is_config=True) + + restriction = __builtin__.property(_get_restriction, _set_restriction) + index = __builtin__.property(_get_index, _set_index) + label_start = __builtin__.property(_get_label_start, _set_label_start) + label_end = __builtin__.property(_get_label_end, _set_label_end) + label_step = __builtin__.property(_get_label_step, _set_label_step) + range_bitmap = __builtin__.property(_get_range_bitmap, _set_range_bitmap) + otn_label_range = __builtin__.property(_get_otn_label_range, _set_otn_label_range) + ethernet_label_range = __builtin__.property(_get_ethernet_label_range, _set_ethernet_label_range) + + + _pyangbind_elements = OrderedDict([('restriction', restriction), ('index', index), ('label_start', label_start), ('label_end', label_end), ('label_step', label_step), ('range_bitmap', range_bitmap), ('otn_label_range', otn_label_range), ('ethernet_label_range', ethernet_label_range), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/label_restriction/ethernet_label_range/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/label_restriction/ethernet_label_range/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..17b2f661d64f6db169a22b1cd10bc49f538893b2 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/label_restriction/ethernet_label_range/__init__.py @@ -0,0 +1,154 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 ethernet_label_range(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/local-link-connectivity/label-restrictions/label-restriction/ethernet-label-range. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Ethernet-specific label range related information. + """ + __slots__ = ('_path_helper', '_extmethods', '__tag_type','__priority',) + + _yang_name = 'ethernet-label-range' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__tag_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 's-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:s-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:s-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}},), is_leaf=True, yang_name="tag-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:eth-tag-type', is_config=True) + self.__priority = YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), is_leaf=True, yang_name="priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', 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 ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'local-link-connectivity', 'label-restrictions', 'label-restriction', 'ethernet-label-range'] + + def _get_tag_type(self): + """ + Getter method for tag_type, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/label_restriction/ethernet_label_range/tag_type (etht-types:eth-tag-type) + + YANG Description: VLAN tag type. + """ + return self.__tag_type + + def _set_tag_type(self, v, load=False): + """ + Setter method for tag_type, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/label_restriction/ethernet_label_range/tag_type (etht-types:eth-tag-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_tag_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tag_type() directly. + + YANG Description: VLAN tag type. + """ + 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={'c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 's-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:s-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:s-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}},), is_leaf=True, yang_name="tag-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:eth-tag-type', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tag_type must be of a type compatible with etht-types:eth-tag-type""", + 'defined-type': "etht-types:eth-tag-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 's-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:s-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:s-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}},), is_leaf=True, yang_name="tag-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:eth-tag-type', is_config=True)""", + }) + + self.__tag_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_tag_type(self): + self.__tag_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 's-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:s-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:s-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}},), is_leaf=True, yang_name="tag-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:eth-tag-type', is_config=True) + + + def _get_priority(self): + """ + Getter method for priority, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/label_restriction/ethernet_label_range/priority (uint8) + + YANG Description: priority. + """ + return self.__priority + + def _set_priority(self, v, load=False): + """ + Setter method for priority, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/label_restriction/ethernet_label_range/priority (uint8) + If this variable is read-only (config: false) in the + source YANG file, then _set_priority is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_priority() directly. + + YANG Description: priority. + """ + 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="priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint8', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """priority 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="priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint8', is_config=True)""", + }) + + self.__priority = t + if hasattr(self, '_set'): + self._set() + + def _unset_priority(self): + self.__priority = YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), is_leaf=True, yang_name="priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint8', is_config=True) + + tag_type = __builtin__.property(_get_tag_type, _set_tag_type) + priority = __builtin__.property(_get_priority, _set_priority) + + + _pyangbind_elements = OrderedDict([('tag_type', tag_type), ('priority', priority), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/label_restriction/label_end/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/label_restriction/label_end/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..c31cb61453887c3cea67f9e70935fa34140e469e --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/label_restriction/label_end/__init__.py @@ -0,0 +1,119 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 te_label +class label_end(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/local-link-connectivity/label-restrictions/label-restriction/label-end. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: This is the ending label if a label range is specified. +This attribute is not set if a single label is specified. + """ + __slots__ = ('_path_helper', '_extmethods', '__te_label',) + + _yang_name = 'label-end' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__te_label = YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-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 ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'local-link-connectivity', 'label-restrictions', 'label-restriction', 'label-end'] + + def _get_te_label(self): + """ + Getter method for te_label, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/label_restriction/label_end/te_label (container) + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + return self.__te_label + + def _set_te_label(self, v, load=False): + """ + Setter method for te_label, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/label_restriction/label_end/te_label (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_te_label is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_te_label() directly. + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """te_label must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__te_label = t + if hasattr(self, '_set'): + self._set() + + def _unset_te_label(self): + self.__te_label = YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + te_label = __builtin__.property(_get_te_label, _set_te_label) + + + _pyangbind_elements = OrderedDict([('te_label', te_label), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/label_restriction/label_end/te_label/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/label_restriction/label_end/te_label/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..deb12db62a93bb2fed55d87fd9864e12bee11dde --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/label_restriction/label_end/te_label/__init__.py @@ -0,0 +1,234 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 otn +class te_label(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/local-link-connectivity/label-restrictions/label-restriction/label-end/te-label. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + __slots__ = ('_path_helper', '_extmethods', '__generic','__otn','__vlanid','__direction',) + + _yang_name = 'te-label' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__generic = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True) + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + self.__vlanid = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True) + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', 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 ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'local-link-connectivity', 'label-restrictions', 'label-restriction', 'label-end', 'te-label'] + + def _get_generic(self): + """ + Getter method for generic, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/label_restriction/label_end/te_label/generic (rt-types:generalized-label) + + YANG Description: TE label specified in a generic format. + """ + return self.__generic + + def _set_generic(self, v, load=False): + """ + Setter method for generic, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/label_restriction/label_end/te_label/generic (rt-types:generalized-label) + If this variable is read-only (config: false) in the + source YANG file, then _set_generic is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_generic() directly. + + YANG Description: TE label specified in a generic format. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """generic must be of a type compatible with rt-types:generalized-label""", + 'defined-type': "rt-types:generalized-label", + 'generated-type': """YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True)""", + }) + + self.__generic = t + if hasattr(self, '_set'): + self._set() + + def _unset_generic(self): + self.__generic = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True) + + + def _get_otn(self): + """ + Getter method for otn, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/label_restriction/label_end/te_label/otn (container) + + YANG Description: Label start or label end for OTN. + """ + return self.__otn + + def _set_otn(self, v, load=False): + """ + Setter method for otn, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/label_restriction/label_end/te_label/otn (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_otn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_otn() directly. + + YANG Description: Label start or label end for OTN. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """otn must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True)""", + }) + + self.__otn = t + if hasattr(self, '_set'): + self._set() + + def _unset_otn(self): + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + + + def _get_vlanid(self): + """ + Getter method for vlanid, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/label_restriction/label_end/te_label/vlanid (etht-types:vlanid) + + YANG Description: VLAN tag id. + """ + return self.__vlanid + + def _set_vlanid(self, v, load=False): + """ + Setter method for vlanid, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/label_restriction/label_end/te_label/vlanid (etht-types:vlanid) + If this variable is read-only (config: false) in the + source YANG file, then _set_vlanid is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_vlanid() directly. + + YANG Description: VLAN tag id. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """vlanid must be of a type compatible with etht-types:vlanid""", + 'defined-type': "etht-types:vlanid", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True)""", + }) + + self.__vlanid = t + if hasattr(self, '_set'): + self._set() + + def _unset_vlanid(self): + self.__vlanid = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True) + + + def _get_direction(self): + """ + Getter method for direction, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/label_restriction/label_end/te_label/direction (te-label-direction) + + YANG Description: Label direction. + """ + return self.__direction + + def _set_direction(self, v, load=False): + """ + Setter method for direction, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/label_restriction/label_end/te_label/direction (te-label-direction) + If this variable is read-only (config: false) in the + source YANG file, then _set_direction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_direction() directly. + + YANG Description: Label direction. + """ + 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={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """direction must be of a type compatible with te-label-direction""", + 'defined-type': "ietf-te-topology:te-label-direction", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=True)""", + }) + + self.__direction = t + if hasattr(self, '_set'): + self._set() + + def _unset_direction(self): + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=True) + + generic = __builtin__.property(_get_generic, _set_generic) + otn = __builtin__.property(_get_otn, _set_otn) + vlanid = __builtin__.property(_get_vlanid, _set_vlanid) + direction = __builtin__.property(_get_direction, _set_direction) + + __choices__ = {'technology': {'generic': ['generic'], 'otn': ['otn'], 'eth': ['vlanid']}} + _pyangbind_elements = OrderedDict([('generic', generic), ('otn', otn), ('vlanid', vlanid), ('direction', direction), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/label_restriction/label_end/te_label/otn/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/label_restriction/label_end/te_label/otn/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..efd7f3ed2d56606b1afb9693993a0842e57f3cb3 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/label_restriction/label_end/te_label/otn/__init__.py @@ -0,0 +1,154 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 otn(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/local-link-connectivity/label-restrictions/label-restriction/label-end/te-label/otn. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Label start or label end for OTN. + """ + __slots__ = ('_path_helper', '_extmethods', '__tpn','__ts',) + + _yang_name = 'otn' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__tpn = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('range-type', 'trib-port'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True) + self.__ts = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts", parent=self, choice=('range-type', 'trib-slot'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-ts', 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 ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'local-link-connectivity', 'label-restrictions', 'label-restriction', 'label-end', 'te-label', 'otn'] + + def _get_tpn(self): + """ + Getter method for tpn, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/label_restriction/label_end/te_label/otn/tpn (otn-tpn) + + YANG Description: Tributary Port Number (TPN). + """ + return self.__tpn + + def _set_tpn(self, v, load=False): + """ + Setter method for tpn, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/label_restriction/label_end/te_label/otn/tpn (otn-tpn) + If this variable is read-only (config: false) in the + source YANG file, then _set_tpn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tpn() directly. + + YANG Description: Tributary Port Number (TPN). + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('range-type', 'trib-port'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tpn must be of a type compatible with otn-tpn""", + 'defined-type': "ietf-otn-topology:otn-tpn", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('range-type', 'trib-port'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True)""", + }) + + self.__tpn = t + if hasattr(self, '_set'): + self._set() + + def _unset_tpn(self): + self.__tpn = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('range-type', 'trib-port'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True) + + + def _get_ts(self): + """ + Getter method for ts, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/label_restriction/label_end/te_label/otn/ts (otn-ts) + + YANG Description: Tributary Slot (TS) number. + """ + return self.__ts + + def _set_ts(self, v, load=False): + """ + Setter method for ts, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/label_restriction/label_end/te_label/otn/ts (otn-ts) + If this variable is read-only (config: false) in the + source YANG file, then _set_ts is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_ts() directly. + + YANG Description: Tributary Slot (TS) number. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts", parent=self, choice=('range-type', 'trib-slot'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-ts', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """ts must be of a type compatible with otn-ts""", + 'defined-type': "ietf-otn-topology:otn-ts", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts", parent=self, choice=('range-type', 'trib-slot'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-ts', is_config=True)""", + }) + + self.__ts = t + if hasattr(self, '_set'): + self._set() + + def _unset_ts(self): + self.__ts = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts", parent=self, choice=('range-type', 'trib-slot'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-ts', is_config=True) + + tpn = __builtin__.property(_get_tpn, _set_tpn) + ts = __builtin__.property(_get_ts, _set_ts) + + __choices__ = {'range-type': {'trib-port': ['tpn'], 'trib-slot': ['ts']}} + _pyangbind_elements = OrderedDict([('tpn', tpn), ('ts', ts), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/label_restriction/label_start/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/label_restriction/label_start/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..824467f81b28cb978a87996d0631864753ed91e6 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/label_restriction/label_start/__init__.py @@ -0,0 +1,120 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 te_label +class label_start(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/local-link-connectivity/label-restrictions/label-restriction/label-start. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: This is the starting label if a label range is specified. +This is the label value if a single label is specified, +in which case the 'label-end' attribute is not set. + """ + __slots__ = ('_path_helper', '_extmethods', '__te_label',) + + _yang_name = 'label-start' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__te_label = YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-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 ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'local-link-connectivity', 'label-restrictions', 'label-restriction', 'label-start'] + + def _get_te_label(self): + """ + Getter method for te_label, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/label_restriction/label_start/te_label (container) + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + return self.__te_label + + def _set_te_label(self, v, load=False): + """ + Setter method for te_label, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/label_restriction/label_start/te_label (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_te_label is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_te_label() directly. + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """te_label must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__te_label = t + if hasattr(self, '_set'): + self._set() + + def _unset_te_label(self): + self.__te_label = YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + te_label = __builtin__.property(_get_te_label, _set_te_label) + + + _pyangbind_elements = OrderedDict([('te_label', te_label), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/label_restriction/label_start/te_label/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/label_restriction/label_start/te_label/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..7fddd85cf7bc6dabc2fb9973b516f959b1796665 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/label_restriction/label_start/te_label/__init__.py @@ -0,0 +1,234 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 otn +class te_label(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/local-link-connectivity/label-restrictions/label-restriction/label-start/te-label. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + __slots__ = ('_path_helper', '_extmethods', '__generic','__otn','__vlanid','__direction',) + + _yang_name = 'te-label' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__generic = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True) + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + self.__vlanid = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True) + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', 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 ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'local-link-connectivity', 'label-restrictions', 'label-restriction', 'label-start', 'te-label'] + + def _get_generic(self): + """ + Getter method for generic, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/label_restriction/label_start/te_label/generic (rt-types:generalized-label) + + YANG Description: TE label specified in a generic format. + """ + return self.__generic + + def _set_generic(self, v, load=False): + """ + Setter method for generic, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/label_restriction/label_start/te_label/generic (rt-types:generalized-label) + If this variable is read-only (config: false) in the + source YANG file, then _set_generic is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_generic() directly. + + YANG Description: TE label specified in a generic format. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """generic must be of a type compatible with rt-types:generalized-label""", + 'defined-type': "rt-types:generalized-label", + 'generated-type': """YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True)""", + }) + + self.__generic = t + if hasattr(self, '_set'): + self._set() + + def _unset_generic(self): + self.__generic = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True) + + + def _get_otn(self): + """ + Getter method for otn, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/label_restriction/label_start/te_label/otn (container) + + YANG Description: Label start or label end for OTN. + """ + return self.__otn + + def _set_otn(self, v, load=False): + """ + Setter method for otn, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/label_restriction/label_start/te_label/otn (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_otn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_otn() directly. + + YANG Description: Label start or label end for OTN. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """otn must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True)""", + }) + + self.__otn = t + if hasattr(self, '_set'): + self._set() + + def _unset_otn(self): + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + + + def _get_vlanid(self): + """ + Getter method for vlanid, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/label_restriction/label_start/te_label/vlanid (etht-types:vlanid) + + YANG Description: VLAN tag id. + """ + return self.__vlanid + + def _set_vlanid(self, v, load=False): + """ + Setter method for vlanid, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/label_restriction/label_start/te_label/vlanid (etht-types:vlanid) + If this variable is read-only (config: false) in the + source YANG file, then _set_vlanid is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_vlanid() directly. + + YANG Description: VLAN tag id. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """vlanid must be of a type compatible with etht-types:vlanid""", + 'defined-type': "etht-types:vlanid", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True)""", + }) + + self.__vlanid = t + if hasattr(self, '_set'): + self._set() + + def _unset_vlanid(self): + self.__vlanid = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True) + + + def _get_direction(self): + """ + Getter method for direction, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/label_restriction/label_start/te_label/direction (te-label-direction) + + YANG Description: Label direction. + """ + return self.__direction + + def _set_direction(self, v, load=False): + """ + Setter method for direction, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/label_restriction/label_start/te_label/direction (te-label-direction) + If this variable is read-only (config: false) in the + source YANG file, then _set_direction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_direction() directly. + + YANG Description: Label direction. + """ + 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={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """direction must be of a type compatible with te-label-direction""", + 'defined-type': "ietf-te-topology:te-label-direction", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=True)""", + }) + + self.__direction = t + if hasattr(self, '_set'): + self._set() + + def _unset_direction(self): + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=True) + + generic = __builtin__.property(_get_generic, _set_generic) + otn = __builtin__.property(_get_otn, _set_otn) + vlanid = __builtin__.property(_get_vlanid, _set_vlanid) + direction = __builtin__.property(_get_direction, _set_direction) + + __choices__ = {'technology': {'generic': ['generic'], 'otn': ['otn'], 'eth': ['vlanid']}} + _pyangbind_elements = OrderedDict([('generic', generic), ('otn', otn), ('vlanid', vlanid), ('direction', direction), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/label_restriction/label_start/te_label/otn/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/label_restriction/label_start/te_label/otn/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..44028d6f94f01dc8d99fa990bb36c9cbd85d3dda --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/label_restriction/label_start/te_label/otn/__init__.py @@ -0,0 +1,154 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 otn(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/local-link-connectivity/label-restrictions/label-restriction/label-start/te-label/otn. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Label start or label end for OTN. + """ + __slots__ = ('_path_helper', '_extmethods', '__tpn','__ts',) + + _yang_name = 'otn' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__tpn = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('range-type', 'trib-port'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True) + self.__ts = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts", parent=self, choice=('range-type', 'trib-slot'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-ts', 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 ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'local-link-connectivity', 'label-restrictions', 'label-restriction', 'label-start', 'te-label', 'otn'] + + def _get_tpn(self): + """ + Getter method for tpn, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/label_restriction/label_start/te_label/otn/tpn (otn-tpn) + + YANG Description: Tributary Port Number (TPN). + """ + return self.__tpn + + def _set_tpn(self, v, load=False): + """ + Setter method for tpn, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/label_restriction/label_start/te_label/otn/tpn (otn-tpn) + If this variable is read-only (config: false) in the + source YANG file, then _set_tpn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tpn() directly. + + YANG Description: Tributary Port Number (TPN). + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('range-type', 'trib-port'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tpn must be of a type compatible with otn-tpn""", + 'defined-type': "ietf-otn-topology:otn-tpn", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('range-type', 'trib-port'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True)""", + }) + + self.__tpn = t + if hasattr(self, '_set'): + self._set() + + def _unset_tpn(self): + self.__tpn = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('range-type', 'trib-port'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True) + + + def _get_ts(self): + """ + Getter method for ts, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/label_restriction/label_start/te_label/otn/ts (otn-ts) + + YANG Description: Tributary Slot (TS) number. + """ + return self.__ts + + def _set_ts(self, v, load=False): + """ + Setter method for ts, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/label_restriction/label_start/te_label/otn/ts (otn-ts) + If this variable is read-only (config: false) in the + source YANG file, then _set_ts is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_ts() directly. + + YANG Description: Tributary Slot (TS) number. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts", parent=self, choice=('range-type', 'trib-slot'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-ts', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """ts must be of a type compatible with otn-ts""", + 'defined-type': "ietf-otn-topology:otn-ts", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts", parent=self, choice=('range-type', 'trib-slot'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-ts', is_config=True)""", + }) + + self.__ts = t + if hasattr(self, '_set'): + self._set() + + def _unset_ts(self): + self.__ts = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts", parent=self, choice=('range-type', 'trib-slot'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-ts', is_config=True) + + tpn = __builtin__.property(_get_tpn, _set_tpn) + ts = __builtin__.property(_get_ts, _set_ts) + + __choices__ = {'range-type': {'trib-port': ['tpn'], 'trib-slot': ['ts']}} + _pyangbind_elements = OrderedDict([('tpn', tpn), ('ts', ts), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/label_restriction/label_step/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/label_restriction/label_step/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..58c0b9c3e467c8592bb12617d41499c0d03529df --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/label_restriction/label_step/__init__.py @@ -0,0 +1,200 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 otn +class label_step(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/local-link-connectivity/label-restrictions/label-restriction/label-step. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: The step increment between labels in the label range. +The label start/end values will have to be consistent +with the sign of label step. For example, +'label-start' < 'label-end' enforces 'label-step' > 0 +'label-start' > 'label-end' enforces 'label-step' < 0. + """ + __slots__ = ('_path_helper', '_extmethods', '__generic','__otn','__eth_step',) + + _yang_name = 'label-step' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__generic = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['-2147483648..2147483647']}, int_size=32), default=RestrictedClassType(base_type=long, restriction_dict={'range': ['-2147483648..2147483647']}, int_size=32)(1), is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='int32', is_config=True) + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + self.__eth_step = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), default=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16)(1), is_leaf=True, yang_name="eth-step", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint16', 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 ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'local-link-connectivity', 'label-restrictions', 'label-restriction', 'label-step'] + + def _get_generic(self): + """ + Getter method for generic, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/label_restriction/label_step/generic (int32) + + YANG Description: Label range step. + """ + return self.__generic + + def _set_generic(self, v, load=False): + """ + Setter method for generic, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/label_restriction/label_step/generic (int32) + If this variable is read-only (config: false) in the + source YANG file, then _set_generic is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_generic() directly. + + YANG Description: Label range step. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['-2147483648..2147483647']}, int_size=32), default=RestrictedClassType(base_type=long, restriction_dict={'range': ['-2147483648..2147483647']}, int_size=32)(1), is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='int32', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """generic must be of a type compatible with int32""", + 'defined-type': "int32", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['-2147483648..2147483647']}, int_size=32), default=RestrictedClassType(base_type=long, restriction_dict={'range': ['-2147483648..2147483647']}, int_size=32)(1), is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='int32', is_config=True)""", + }) + + self.__generic = t + if hasattr(self, '_set'): + self._set() + + def _unset_generic(self): + self.__generic = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['-2147483648..2147483647']}, int_size=32), default=RestrictedClassType(base_type=long, restriction_dict={'range': ['-2147483648..2147483647']}, int_size=32)(1), is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='int32', is_config=True) + + + def _get_otn(self): + """ + Getter method for otn, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/label_restriction/label_step/otn (container) + + YANG Description: Label step for OTN + """ + return self.__otn + + def _set_otn(self, v, load=False): + """ + Setter method for otn, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/label_restriction/label_step/otn (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_otn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_otn() directly. + + YANG Description: Label step for OTN + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """otn must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True)""", + }) + + self.__otn = t + if hasattr(self, '_set'): + self._set() + + def _unset_otn(self): + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + + + def _get_eth_step(self): + """ + Getter method for eth_step, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/label_restriction/label_step/eth_step (uint16) + + YANG Description: Label step which represent possible increments for +an Ethernet VLAN tag. + """ + return self.__eth_step + + def _set_eth_step(self, v, load=False): + """ + Setter method for eth_step, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/label_restriction/label_step/eth_step (uint16) + If this variable is read-only (config: false) in the + source YANG file, then _set_eth_step is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_eth_step() directly. + + YANG Description: Label step which represent possible increments for +an Ethernet VLAN tag. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), default=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16)(1), is_leaf=True, yang_name="eth-step", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint16', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """eth_step must be of a type compatible with uint16""", + 'defined-type': "uint16", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), default=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16)(1), is_leaf=True, yang_name="eth-step", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint16', is_config=True)""", + }) + + self.__eth_step = t + if hasattr(self, '_set'): + self._set() + + def _unset_eth_step(self): + self.__eth_step = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), default=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16)(1), is_leaf=True, yang_name="eth-step", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint16', is_config=True) + + generic = __builtin__.property(_get_generic, _set_generic) + otn = __builtin__.property(_get_otn, _set_otn) + eth_step = __builtin__.property(_get_eth_step, _set_eth_step) + + __choices__ = {'technology': {'generic': ['generic'], 'otn': ['otn'], 'eth': ['eth_step']}} + _pyangbind_elements = OrderedDict([('generic', generic), ('otn', otn), ('eth_step', eth_step), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/label_restriction/label_step/otn/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/label_restriction/label_step/otn/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..7125ae3a2c00b9dcd82c30958ca9c0911dec1b9d --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/label_restriction/label_step/otn/__init__.py @@ -0,0 +1,158 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 otn(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/local-link-connectivity/label-restrictions/label-restriction/label-step/otn. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Label step for OTN + """ + __slots__ = ('_path_helper', '_extmethods', '__tpn','__ts',) + + _yang_name = 'otn' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__tpn = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('range-type', 'trib-port'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True) + self.__ts = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts", parent=self, choice=('range-type', 'trib-slot'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-ts', 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 ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'local-link-connectivity', 'label-restrictions', 'label-restriction', 'label-step', 'otn'] + + def _get_tpn(self): + """ + Getter method for tpn, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/label_restriction/label_step/otn/tpn (otn-tpn) + + YANG Description: Label step which represents possible increments for +Tributary Port Number (TPN). + """ + return self.__tpn + + def _set_tpn(self, v, load=False): + """ + Setter method for tpn, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/label_restriction/label_step/otn/tpn (otn-tpn) + If this variable is read-only (config: false) in the + source YANG file, then _set_tpn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tpn() directly. + + YANG Description: Label step which represents possible increments for +Tributary Port Number (TPN). + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('range-type', 'trib-port'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tpn must be of a type compatible with otn-tpn""", + 'defined-type': "ietf-otn-topology:otn-tpn", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('range-type', 'trib-port'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True)""", + }) + + self.__tpn = t + if hasattr(self, '_set'): + self._set() + + def _unset_tpn(self): + self.__tpn = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('range-type', 'trib-port'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True) + + + def _get_ts(self): + """ + Getter method for ts, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/label_restriction/label_step/otn/ts (otn-ts) + + YANG Description: Label step which represents possible increments for +Tributary Slot (TS) number. + """ + return self.__ts + + def _set_ts(self, v, load=False): + """ + Setter method for ts, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/label_restriction/label_step/otn/ts (otn-ts) + If this variable is read-only (config: false) in the + source YANG file, then _set_ts is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_ts() directly. + + YANG Description: Label step which represents possible increments for +Tributary Slot (TS) number. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts", parent=self, choice=('range-type', 'trib-slot'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-ts', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """ts must be of a type compatible with otn-ts""", + 'defined-type': "ietf-otn-topology:otn-ts", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts", parent=self, choice=('range-type', 'trib-slot'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-ts', is_config=True)""", + }) + + self.__ts = t + if hasattr(self, '_set'): + self._set() + + def _unset_ts(self): + self.__ts = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts", parent=self, choice=('range-type', 'trib-slot'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-ts', is_config=True) + + tpn = __builtin__.property(_get_tpn, _set_tpn) + ts = __builtin__.property(_get_ts, _set_ts) + + __choices__ = {'range-type': {'trib-port': ['tpn'], 'trib-slot': ['ts']}} + _pyangbind_elements = OrderedDict([('tpn', tpn), ('ts', ts), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/label_restriction/otn_label_range/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/label_restriction/otn_label_range/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..54adb557bb093d883e1eb78881222f1d6c9ee898 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/label_restriction/otn_label_range/__init__.py @@ -0,0 +1,256 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 otn_label_range(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/local-link-connectivity/label-restrictions/label-restriction/otn-label-range. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Label range information for OTN. + """ + __slots__ = ('_path_helper', '_extmethods', '__range_type','__tsg','__odu_type_list','__priority',) + + _yang_name = 'otn-label-range' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__range_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'trib-slot': {}, 'trib-port': {}},), is_leaf=True, yang_name="range-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-label-range-type', is_config=True) + self.__tsg = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + self.__odu_type_list = YANGDynClass(unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},)), is_leaf=False, yang_name="odu-type-list", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + self.__priority = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..7']}), is_leaf=True, yang_name="priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', 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 ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'local-link-connectivity', 'label-restrictions', 'label-restriction', 'otn-label-range'] + + def _get_range_type(self): + """ + Getter method for range_type, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/label_restriction/otn_label_range/range_type (otn-label-range-type) + + YANG Description: The type of range (e.g., TPN or TS) +to which the label range applies + """ + return self.__range_type + + def _set_range_type(self, v, load=False): + """ + Setter method for range_type, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/label_restriction/otn_label_range/range_type (otn-label-range-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_range_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_range_type() directly. + + YANG Description: The type of range (e.g., TPN or TS) +to which the label range applies + """ + 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={'trib-slot': {}, 'trib-port': {}},), is_leaf=True, yang_name="range-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-label-range-type', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """range_type must be of a type compatible with otn-label-range-type""", + 'defined-type': "ietf-otn-topology:otn-label-range-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'trib-slot': {}, 'trib-port': {}},), is_leaf=True, yang_name="range-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-label-range-type', is_config=True)""", + }) + + self.__range_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_range_type(self): + self.__range_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'trib-slot': {}, 'trib-port': {}},), is_leaf=True, yang_name="range-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-label-range-type', is_config=True) + + + def _get_tsg(self): + """ + Getter method for tsg, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/label_restriction/otn_label_range/tsg (identityref) + + YANG Description: Tributary slot granularity (TSG) to which the label range +applies. + +This leaf MUST be present when the range-type is TS. + +This leaf MAY be omitted when mapping an ODUk over an OTUk +Link. In this case the range-type is tpn, with only one +entry (ODUk), and the tpn range has only one value (1). + """ + return self.__tsg + + def _set_tsg(self, v, load=False): + """ + Setter method for tsg, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/label_restriction/otn_label_range/tsg (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_tsg is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tsg() directly. + + YANG Description: Tributary slot granularity (TSG) to which the label range +applies. + +This leaf MUST be present when the range-type is TS. + +This leaf MAY be omitted when mapping an ODUk over an OTUk +Link. In this case the range-type is tpn, with only one +entry (ODUk), and the tpn range has only one value (1). + """ + 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={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tsg must be of a type compatible with identityref""", + 'defined-type': "ietf-otn-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True)""", + }) + + self.__tsg = t + if hasattr(self, '_set'): + self._set() + + def _unset_tsg(self): + self.__tsg = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + + + def _get_odu_type_list(self): + """ + Getter method for odu_type_list, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/label_restriction/otn_label_range/odu_type_list (identityref) + + YANG Description: List of ODU types to which the label range applies. + +An Empty odu-type-list means that the label range +applies to all the supported ODU types. + """ + return self.__odu_type_list + + def _set_odu_type_list(self, v, load=False): + """ + Setter method for odu_type_list, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/label_restriction/otn_label_range/odu_type_list (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_odu_type_list is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_odu_type_list() directly. + + YANG Description: List of ODU types to which the label range applies. + +An Empty odu-type-list means that the label range +applies to all the supported ODU types. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},)), is_leaf=False, yang_name="odu-type-list", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """odu_type_list must be of a type compatible with identityref""", + 'defined-type': "ietf-otn-topology:identityref", + 'generated-type': """YANGDynClass(unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},)), is_leaf=False, yang_name="odu-type-list", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True)""", + }) + + self.__odu_type_list = t + if hasattr(self, '_set'): + self._set() + + def _unset_odu_type_list(self): + self.__odu_type_list = YANGDynClass(unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},)), is_leaf=False, yang_name="odu-type-list", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + + + def _get_priority(self): + """ + Getter method for priority, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/label_restriction/otn_label_range/priority (uint8) + + YANG Description: Priority in Interface Switching Capability +Descriptor (ISCD). + """ + return self.__priority + + def _set_priority(self, v, load=False): + """ + Setter method for priority, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/label_restriction/otn_label_range/priority (uint8) + If this variable is read-only (config: false) in the + source YANG file, then _set_priority is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_priority() directly. + + YANG Description: Priority in Interface Switching Capability +Descriptor (ISCD). + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..7']}), is_leaf=True, yang_name="priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint8', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """priority must be of a type compatible with uint8""", + 'defined-type': "uint8", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..7']}), is_leaf=True, yang_name="priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint8', is_config=True)""", + }) + + self.__priority = t + if hasattr(self, '_set'): + self._set() + + def _unset_priority(self): + self.__priority = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..7']}), is_leaf=True, yang_name="priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint8', is_config=True) + + range_type = __builtin__.property(_get_range_type, _set_range_type) + tsg = __builtin__.property(_get_tsg, _set_tsg) + odu_type_list = __builtin__.property(_get_odu_type_list, _set_odu_type_list) + priority = __builtin__.property(_get_priority, _set_priority) + + + _pyangbind_elements = OrderedDict([('range_type', range_type), ('tsg', tsg), ('odu_type_list', odu_type_list), ('priority', priority), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..3bc26167a6e71530ea7d92582812e55483c86fd3 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/__init__.py @@ -0,0 +1,199 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 optimization_metric +from . import tiebreakers +from . import objective_function +class optimizations(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/local-link-connectivity/optimizations. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: The objective function container that includes +attributes to impose when computing a TE path. + """ + __slots__ = ('_path_helper', '_extmethods', '__optimization_metric','__tiebreakers','__objective_function',) + + _yang_name = 'optimizations' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__optimization_metric = YANGDynClass(base=YANGListType("metric_type",optimization_metric.optimization_metric, yang_name="optimization-metric", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='metric-type', extensions=None, choice=False), is_container='list', yang_name="optimization-metric", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + self.__tiebreakers = YANGDynClass(base=tiebreakers.tiebreakers, is_container='container', yang_name="tiebreakers", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__objective_function = YANGDynClass(base=objective_function.objective_function, is_container='container', yang_name="objective-function", parent=self, choice=('algorithm', 'objective-function'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-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 ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'local-link-connectivity', 'optimizations'] + + def _get_optimization_metric(self): + """ + Getter method for optimization_metric, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric (list) + + YANG Description: TE path metric type. + """ + return self.__optimization_metric + + def _set_optimization_metric(self, v, load=False): + """ + Setter method for optimization_metric, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_optimization_metric is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_optimization_metric() directly. + + YANG Description: TE path metric type. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("metric_type",optimization_metric.optimization_metric, yang_name="optimization-metric", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='metric-type', extensions=None, choice=False), is_container='list', yang_name="optimization-metric", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """optimization_metric must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("metric_type",optimization_metric.optimization_metric, yang_name="optimization-metric", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='metric-type', extensions=None, choice=False), is_container='list', yang_name="optimization-metric", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True)""", + }) + + self.__optimization_metric = t + if hasattr(self, '_set'): + self._set() + + def _unset_optimization_metric(self): + self.__optimization_metric = YANGDynClass(base=YANGListType("metric_type",optimization_metric.optimization_metric, yang_name="optimization-metric", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='metric-type', extensions=None, choice=False), is_container='list', yang_name="optimization-metric", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + + + def _get_tiebreakers(self): + """ + Getter method for tiebreakers, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/tiebreakers (container) + + YANG Description: Container for the list of tiebreakers. + """ + return self.__tiebreakers + + def _set_tiebreakers(self, v, load=False): + """ + Setter method for tiebreakers, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/tiebreakers (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_tiebreakers is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tiebreakers() directly. + + YANG Description: Container for the list of tiebreakers. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=tiebreakers.tiebreakers, is_container='container', yang_name="tiebreakers", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tiebreakers must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=tiebreakers.tiebreakers, is_container='container', yang_name="tiebreakers", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__tiebreakers = t + if hasattr(self, '_set'): + self._set() + + def _unset_tiebreakers(self): + self.__tiebreakers = YANGDynClass(base=tiebreakers.tiebreakers, is_container='container', yang_name="tiebreakers", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_objective_function(self): + """ + Getter method for objective_function, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/objective_function (container) + + YANG Description: The objective function container that includes +attributes to impose when computing a TE path. + """ + return self.__objective_function + + def _set_objective_function(self, v, load=False): + """ + Setter method for objective_function, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/objective_function (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_objective_function is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_objective_function() directly. + + YANG Description: The objective function container that includes +attributes to impose when computing a TE path. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=objective_function.objective_function, is_container='container', yang_name="objective-function", parent=self, choice=('algorithm', 'objective-function'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """objective_function must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=objective_function.objective_function, is_container='container', yang_name="objective-function", parent=self, choice=('algorithm', 'objective-function'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__objective_function = t + if hasattr(self, '_set'): + self._set() + + def _unset_objective_function(self): + self.__objective_function = YANGDynClass(base=objective_function.objective_function, is_container='container', yang_name="objective-function", parent=self, choice=('algorithm', 'objective-function'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + optimization_metric = __builtin__.property(_get_optimization_metric, _set_optimization_metric) + tiebreakers = __builtin__.property(_get_tiebreakers, _set_tiebreakers) + objective_function = __builtin__.property(_get_objective_function, _set_objective_function) + + __choices__ = {'algorithm': {'metric': ['optimization_metric', 'tiebreakers'], 'objective-function': ['objective_function']}} + _pyangbind_elements = OrderedDict([('optimization_metric', optimization_metric), ('tiebreakers', tiebreakers), ('objective_function', objective_function), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/objective_function/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/objective_function/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..302ed483026db4ae6afa8e38646ca609132c8eda --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/objective_function/__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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 objective_function(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/local-link-connectivity/optimizations/objective-function. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: The objective function container that includes +attributes to impose when computing a TE path. + """ + __slots__ = ('_path_helper', '_extmethods', '__objective_function_type',) + + _yang_name = 'objective-function' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__objective_function_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'of-minimize-cost-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-cost-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-cost-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-minimize-load-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-load-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-load-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-maximize-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-maximize-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-maximize-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-minimize-agg-bandwidth-consumption': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-agg-bandwidth-consumption': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-agg-bandwidth-consumption': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-minimize-load-most-loaded-link': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-load-most-loaded-link': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-load-most-loaded-link': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-minimize-cost-path-set': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-cost-path-set': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-cost-path-set': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), default=six.text_type("te-types:of-minimize-cost-path"), is_leaf=True, yang_name="objective-function-type", parent=self, choice=('algorithm', 'objective-function'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', 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 ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'local-link-connectivity', 'optimizations', 'objective-function'] + + def _get_objective_function_type(self): + """ + Getter method for objective_function_type, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/objective_function/objective_function_type (identityref) + + YANG Description: Objective function entry. + """ + return self.__objective_function_type + + def _set_objective_function_type(self, v, load=False): + """ + Setter method for objective_function_type, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/objective_function/objective_function_type (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_objective_function_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_objective_function_type() directly. + + YANG Description: Objective function entry. + """ + 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={'of-minimize-cost-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-cost-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-cost-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-minimize-load-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-load-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-load-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-maximize-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-maximize-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-maximize-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-minimize-agg-bandwidth-consumption': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-agg-bandwidth-consumption': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-agg-bandwidth-consumption': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-minimize-load-most-loaded-link': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-load-most-loaded-link': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-load-most-loaded-link': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-minimize-cost-path-set': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-cost-path-set': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-cost-path-set': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), default=six.text_type("te-types:of-minimize-cost-path"), is_leaf=True, yang_name="objective-function-type", parent=self, choice=('algorithm', 'objective-function'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """objective_function_type must be of a type compatible with identityref""", + 'defined-type': "ietf-te-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'of-minimize-cost-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-cost-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-cost-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-minimize-load-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-load-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-load-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-maximize-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-maximize-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-maximize-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-minimize-agg-bandwidth-consumption': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-agg-bandwidth-consumption': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-agg-bandwidth-consumption': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-minimize-load-most-loaded-link': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-load-most-loaded-link': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-load-most-loaded-link': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-minimize-cost-path-set': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-cost-path-set': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-cost-path-set': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), default=six.text_type("te-types:of-minimize-cost-path"), is_leaf=True, yang_name="objective-function-type", parent=self, choice=('algorithm', 'objective-function'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True)""", + }) + + self.__objective_function_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_objective_function_type(self): + self.__objective_function_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'of-minimize-cost-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-cost-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-cost-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-minimize-load-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-load-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-load-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-maximize-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-maximize-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-maximize-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-minimize-agg-bandwidth-consumption': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-agg-bandwidth-consumption': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-agg-bandwidth-consumption': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-minimize-load-most-loaded-link': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-load-most-loaded-link': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-load-most-loaded-link': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-minimize-cost-path-set': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-cost-path-set': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-cost-path-set': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), default=six.text_type("te-types:of-minimize-cost-path"), is_leaf=True, yang_name="objective-function-type", parent=self, choice=('algorithm', 'objective-function'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + + objective_function_type = __builtin__.property(_get_objective_function_type, _set_objective_function_type) + + __choices__ = {'algorithm': {'objective-function': ['objective_function_type']}} + _pyangbind_elements = OrderedDict([('objective_function_type', objective_function_type), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..ef6ac03d431417d485a346e8192e3b37629e4937 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/__init__.py @@ -0,0 +1,241 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 explicit_route_exclude_objects +from . import explicit_route_include_objects +class optimization_metric(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/local-link-connectivity/optimizations/optimization-metric. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: TE path metric type. + """ + __slots__ = ('_path_helper', '_extmethods', '__metric_type','__weight','__explicit_route_exclude_objects','__explicit_route_include_objects',) + + _yang_name = 'optimization-metric' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__metric_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="metric-type", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + self.__weight = YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), default=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8)(1), is_leaf=True, yang_name="weight", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint8', is_config=True) + self.__explicit_route_exclude_objects = YANGDynClass(base=explicit_route_exclude_objects.explicit_route_exclude_objects, is_container='container', yang_name="explicit-route-exclude-objects", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__explicit_route_include_objects = YANGDynClass(base=explicit_route_include_objects.explicit_route_include_objects, is_container='container', yang_name="explicit-route-include-objects", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-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 ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'local-link-connectivity', 'optimizations', 'optimization-metric'] + + def _get_metric_type(self): + """ + Getter method for metric_type, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/metric_type (identityref) + + YANG Description: Identifies the 'metric-type' that the path computation +process uses for optimization. + """ + return self.__metric_type + + def _set_metric_type(self, v, load=False): + """ + Setter method for metric_type, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/metric_type (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_metric_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_metric_type() directly. + + YANG Description: Identifies the 'metric-type' that the path computation +process uses for optimization. + """ + 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=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="metric-type", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """metric_type must be of a type compatible with identityref""", + 'defined-type': "ietf-te-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="metric-type", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True)""", + }) + + self.__metric_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_metric_type(self): + self.__metric_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="metric-type", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + + + def _get_weight(self): + """ + Getter method for weight, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/weight (uint8) + + YANG Description: TE path metric normalization weight. + """ + return self.__weight + + def _set_weight(self, v, load=False): + """ + Setter method for weight, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/weight (uint8) + If this variable is read-only (config: false) in the + source YANG file, then _set_weight is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_weight() directly. + + YANG Description: TE path metric normalization weight. + """ + 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), default=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8)(1), is_leaf=True, yang_name="weight", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint8', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """weight 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), default=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8)(1), is_leaf=True, yang_name="weight", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint8', is_config=True)""", + }) + + self.__weight = t + if hasattr(self, '_set'): + self._set() + + def _unset_weight(self): + self.__weight = YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), default=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8)(1), is_leaf=True, yang_name="weight", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint8', is_config=True) + + + def _get_explicit_route_exclude_objects(self): + """ + Getter method for explicit_route_exclude_objects, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_exclude_objects (container) + + YANG Description: Container for the 'exclude route' object list. + """ + return self.__explicit_route_exclude_objects + + def _set_explicit_route_exclude_objects(self, v, load=False): + """ + Setter method for explicit_route_exclude_objects, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_exclude_objects (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_explicit_route_exclude_objects is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_explicit_route_exclude_objects() directly. + + YANG Description: Container for the 'exclude route' object list. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=explicit_route_exclude_objects.explicit_route_exclude_objects, is_container='container', yang_name="explicit-route-exclude-objects", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """explicit_route_exclude_objects must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=explicit_route_exclude_objects.explicit_route_exclude_objects, is_container='container', yang_name="explicit-route-exclude-objects", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__explicit_route_exclude_objects = t + if hasattr(self, '_set'): + self._set() + + def _unset_explicit_route_exclude_objects(self): + self.__explicit_route_exclude_objects = YANGDynClass(base=explicit_route_exclude_objects.explicit_route_exclude_objects, is_container='container', yang_name="explicit-route-exclude-objects", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_explicit_route_include_objects(self): + """ + Getter method for explicit_route_include_objects, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_include_objects (container) + + YANG Description: Container for the 'include route' object list. + """ + return self.__explicit_route_include_objects + + def _set_explicit_route_include_objects(self, v, load=False): + """ + Setter method for explicit_route_include_objects, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_include_objects (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_explicit_route_include_objects is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_explicit_route_include_objects() directly. + + YANG Description: Container for the 'include route' object list. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=explicit_route_include_objects.explicit_route_include_objects, is_container='container', yang_name="explicit-route-include-objects", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """explicit_route_include_objects must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=explicit_route_include_objects.explicit_route_include_objects, is_container='container', yang_name="explicit-route-include-objects", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__explicit_route_include_objects = t + if hasattr(self, '_set'): + self._set() + + def _unset_explicit_route_include_objects(self): + self.__explicit_route_include_objects = YANGDynClass(base=explicit_route_include_objects.explicit_route_include_objects, is_container='container', yang_name="explicit-route-include-objects", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + metric_type = __builtin__.property(_get_metric_type, _set_metric_type) + weight = __builtin__.property(_get_weight, _set_weight) + explicit_route_exclude_objects = __builtin__.property(_get_explicit_route_exclude_objects, _set_explicit_route_exclude_objects) + explicit_route_include_objects = __builtin__.property(_get_explicit_route_include_objects, _set_explicit_route_include_objects) + + __choices__ = {'algorithm': {'metric': ['metric_type', 'weight', 'explicit_route_exclude_objects', 'explicit_route_include_objects']}} + _pyangbind_elements = OrderedDict([('metric_type', metric_type), ('weight', weight), ('explicit_route_exclude_objects', explicit_route_exclude_objects), ('explicit_route_include_objects', explicit_route_include_objects), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_exclude_objects/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_exclude_objects/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..f81d927f3a7fc066f47ad055904cf65e0bb729a3 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_exclude_objects/__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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 route_object_exclude_object +class explicit_route_exclude_objects(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/local-link-connectivity/optimizations/optimization-metric/explicit-route-exclude-objects. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Container for the 'exclude route' object list. + """ + __slots__ = ('_path_helper', '_extmethods', '__route_object_exclude_object',) + + _yang_name = 'explicit-route-exclude-objects' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__route_object_exclude_object = YANGDynClass(base=YANGListType("index",route_object_exclude_object.route_object_exclude_object, yang_name="route-object-exclude-object", parent=self, is_container='list', user_ordered=True, path_helper=self._path_helper, yang_keys='index', extensions=None, choice=('algorithm', 'metric')), is_container='list', yang_name="route-object-exclude-object", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-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 ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'local-link-connectivity', 'optimizations', 'optimization-metric', 'explicit-route-exclude-objects'] + + def _get_route_object_exclude_object(self): + """ + Getter method for route_object_exclude_object, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object (list) + + YANG Description: List of Explicit Route Objects to be excluded in the +path computation. + """ + return self.__route_object_exclude_object + + def _set_route_object_exclude_object(self, v, load=False): + """ + Setter method for route_object_exclude_object, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_route_object_exclude_object is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_route_object_exclude_object() directly. + + YANG Description: List of Explicit Route Objects to be excluded in the +path computation. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("index",route_object_exclude_object.route_object_exclude_object, yang_name="route-object-exclude-object", parent=self, is_container='list', user_ordered=True, path_helper=self._path_helper, yang_keys='index', extensions=None, choice=('algorithm', 'metric')), is_container='list', yang_name="route-object-exclude-object", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """route_object_exclude_object must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("index",route_object_exclude_object.route_object_exclude_object, yang_name="route-object-exclude-object", parent=self, is_container='list', user_ordered=True, path_helper=self._path_helper, yang_keys='index', extensions=None, choice=('algorithm', 'metric')), is_container='list', yang_name="route-object-exclude-object", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True)""", + }) + + self.__route_object_exclude_object = t + if hasattr(self, '_set'): + self._set() + + def _unset_route_object_exclude_object(self): + self.__route_object_exclude_object = YANGDynClass(base=YANGListType("index",route_object_exclude_object.route_object_exclude_object, yang_name="route-object-exclude-object", parent=self, is_container='list', user_ordered=True, path_helper=self._path_helper, yang_keys='index', extensions=None, choice=('algorithm', 'metric')), is_container='list', yang_name="route-object-exclude-object", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + + route_object_exclude_object = __builtin__.property(_get_route_object_exclude_object, _set_route_object_exclude_object) + + __choices__ = {'algorithm': {'metric': ['route_object_exclude_object']}} + _pyangbind_elements = OrderedDict([('route_object_exclude_object', route_object_exclude_object), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..0ce09fde14ab1f2f1e56ed189aa62110a1ba07a2 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/__init__.py @@ -0,0 +1,365 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 numbered_node_hop +from . import numbered_link_hop +from . import unnumbered_link_hop +from . import as_number_hop +from . import label_hop +from . import srlg +class route_object_exclude_object(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/local-link-connectivity/optimizations/optimization-metric/explicit-route-exclude-objects/route-object-exclude-object. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: List of Explicit Route Objects to be excluded in the +path computation. + """ + __slots__ = ('_path_helper', '_extmethods', '__index','__numbered_node_hop','__numbered_link_hop','__unnumbered_link_hop','__as_number_hop','__label_hop','__srlg',) + + _yang_name = 'route-object-exclude-object' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _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), is_leaf=True, yang_name="index", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + self.__numbered_node_hop = YANGDynClass(base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__numbered_link_hop = YANGDynClass(base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__unnumbered_link_hop = YANGDynClass(base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__as_number_hop = YANGDynClass(base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__label_hop = YANGDynClass(base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__srlg = YANGDynClass(base=srlg.srlg, is_container='container', yang_name="srlg", parent=self, choice=('type', 'srlg'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-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 ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'local-link-connectivity', 'optimizations', 'optimization-metric', 'explicit-route-exclude-objects', 'route-object-exclude-object'] + + def _get_index(self): + """ + Getter method for index, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/index (uint32) + + YANG Description: Route object entry index. The index is used to +identify an entry in the list. The order of entries +is defined by the user without relying on key values. + """ + return self.__index + + def _set_index(self, v, load=False): + """ + Setter method for index, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/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: Route object entry index. The index is used to +identify an entry in the list. The order of entries +is defined by the user without relying on key values. + """ + 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=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="index", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', 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), is_leaf=True, yang_name="index", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', 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), is_leaf=True, yang_name="index", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + + + def _get_numbered_node_hop(self): + """ + Getter method for numbered_node_hop, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/numbered_node_hop (container) + + YANG Description: Numbered node route hop. + """ + return self.__numbered_node_hop + + def _set_numbered_node_hop(self, v, load=False): + """ + Setter method for numbered_node_hop, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/numbered_node_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_numbered_node_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_numbered_node_hop() directly. + + YANG Description: Numbered node route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """numbered_node_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__numbered_node_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_numbered_node_hop(self): + self.__numbered_node_hop = YANGDynClass(base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_numbered_link_hop(self): + """ + Getter method for numbered_link_hop, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/numbered_link_hop (container) + + YANG Description: Numbered link explicit route hop. + """ + return self.__numbered_link_hop + + def _set_numbered_link_hop(self, v, load=False): + """ + Setter method for numbered_link_hop, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/numbered_link_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_numbered_link_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_numbered_link_hop() directly. + + YANG Description: Numbered link explicit route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """numbered_link_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__numbered_link_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_numbered_link_hop(self): + self.__numbered_link_hop = YANGDynClass(base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_unnumbered_link_hop(self): + """ + Getter method for unnumbered_link_hop, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/unnumbered_link_hop (container) + + YANG Description: Unnumbered link explicit route hop. + """ + return self.__unnumbered_link_hop + + def _set_unnumbered_link_hop(self, v, load=False): + """ + Setter method for unnumbered_link_hop, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/unnumbered_link_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_unnumbered_link_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_unnumbered_link_hop() directly. + + YANG Description: Unnumbered link explicit route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """unnumbered_link_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__unnumbered_link_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_unnumbered_link_hop(self): + self.__unnumbered_link_hop = YANGDynClass(base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_as_number_hop(self): + """ + Getter method for as_number_hop, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/as_number_hop (container) + + YANG Description: AS explicit route hop. + """ + return self.__as_number_hop + + def _set_as_number_hop(self, v, load=False): + """ + Setter method for as_number_hop, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/as_number_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_as_number_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_as_number_hop() directly. + + YANG Description: AS explicit route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """as_number_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__as_number_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_as_number_hop(self): + self.__as_number_hop = YANGDynClass(base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_label_hop(self): + """ + Getter method for label_hop, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop (container) + + YANG Description: Label hop type. + """ + return self.__label_hop + + def _set_label_hop(self, v, load=False): + """ + Setter method for label_hop, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_label_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_label_hop() directly. + + YANG Description: Label hop type. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """label_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__label_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_label_hop(self): + self.__label_hop = YANGDynClass(base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_srlg(self): + """ + Getter method for srlg, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/srlg (container) + + YANG Description: SRLG container. + """ + return self.__srlg + + def _set_srlg(self, v, load=False): + """ + Setter method for srlg, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/srlg (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_srlg is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_srlg() directly. + + YANG Description: SRLG container. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=srlg.srlg, is_container='container', yang_name="srlg", parent=self, choice=('type', 'srlg'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """srlg must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=srlg.srlg, is_container='container', yang_name="srlg", parent=self, choice=('type', 'srlg'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__srlg = t + if hasattr(self, '_set'): + self._set() + + def _unset_srlg(self): + self.__srlg = YANGDynClass(base=srlg.srlg, is_container='container', yang_name="srlg", parent=self, choice=('type', 'srlg'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + index = __builtin__.property(_get_index, _set_index) + numbered_node_hop = __builtin__.property(_get_numbered_node_hop, _set_numbered_node_hop) + numbered_link_hop = __builtin__.property(_get_numbered_link_hop, _set_numbered_link_hop) + unnumbered_link_hop = __builtin__.property(_get_unnumbered_link_hop, _set_unnumbered_link_hop) + as_number_hop = __builtin__.property(_get_as_number_hop, _set_as_number_hop) + label_hop = __builtin__.property(_get_label_hop, _set_label_hop) + srlg = __builtin__.property(_get_srlg, _set_srlg) + + __choices__ = {'algorithm': {'metric': ['index']}, 'type': {'numbered-node-hop': ['numbered_node_hop'], 'numbered-link-hop': ['numbered_link_hop'], 'unnumbered-link-hop': ['unnumbered_link_hop'], 'as-number': ['as_number_hop'], 'label': ['label_hop'], 'srlg': ['srlg']}} + _pyangbind_elements = OrderedDict([('index', index), ('numbered_node_hop', numbered_node_hop), ('numbered_link_hop', numbered_link_hop), ('unnumbered_link_hop', unnumbered_link_hop), ('as_number_hop', as_number_hop), ('label_hop', label_hop), ('srlg', srlg), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/as_number_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/as_number_hop/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..0cbff483c1e7a2c9999c02c3155508169a8071ce --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/as_number_hop/__init__.py @@ -0,0 +1,154 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 as_number_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/local-link-connectivity/optimizations/optimization-metric/explicit-route-exclude-objects/route-object-exclude-object/as-number-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: AS explicit route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__as_number','__hop_type',) + + _yang_name = 'as-number-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__as_number = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=True) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', 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 ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'local-link-connectivity', 'optimizations', 'optimization-metric', 'explicit-route-exclude-objects', 'route-object-exclude-object', 'as-number-hop'] + + def _get_as_number(self): + """ + Getter method for as_number, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/as_number_hop/as_number (inet:as-number) + + YANG Description: The Autonomous System (AS) number. + """ + return self.__as_number + + def _set_as_number(self, v, load=False): + """ + Setter method for as_number, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/as_number_hop/as_number (inet:as-number) + If this variable is read-only (config: false) in the + source YANG file, then _set_as_number is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_as_number() directly. + + YANG Description: The Autonomous System (AS) number. + """ + 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="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """as_number must be of a type compatible with inet:as-number""", + 'defined-type': "inet:as-number", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=True)""", + }) + + self.__as_number = t + if hasattr(self, '_set'): + self._set() + + def _unset_as_number(self): + self.__as_number = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=True) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/as_number_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/as_number_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + 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={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + + as_number = __builtin__.property(_get_as_number, _set_as_number) + hop_type = __builtin__.property(_get_hop_type, _set_hop_type) + + __choices__ = {'type': {'as-number': ['as_number', 'hop_type']}} + _pyangbind_elements = OrderedDict([('as_number', as_number), ('hop_type', hop_type), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..5acd3647742511b6b1deca0051576521cdd967aa --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/__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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 te_label +class label_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/local-link-connectivity/optimizations/optimization-metric/explicit-route-exclude-objects/route-object-exclude-object/label-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Label hop type. + """ + __slots__ = ('_path_helper', '_extmethods', '__te_label',) + + _yang_name = 'label-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__te_label = YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-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 ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'local-link-connectivity', 'optimizations', 'optimization-metric', 'explicit-route-exclude-objects', 'route-object-exclude-object', 'label-hop'] + + def _get_te_label(self): + """ + Getter method for te_label, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label (container) + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + return self.__te_label + + def _set_te_label(self, v, load=False): + """ + Setter method for te_label, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_te_label is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_te_label() directly. + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """te_label must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__te_label = t + if hasattr(self, '_set'): + self._set() + + def _unset_te_label(self): + self.__te_label = YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + te_label = __builtin__.property(_get_te_label, _set_te_label) + + __choices__ = {'type': {'label': ['te_label']}} + _pyangbind_elements = OrderedDict([('te_label', te_label), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..aadad5c2c2c8d745e7f41c6d7d6ba38fe2537810 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label/__init__.py @@ -0,0 +1,234 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 otn +class te_label(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/local-link-connectivity/optimizations/optimization-metric/explicit-route-exclude-objects/route-object-exclude-object/label-hop/te-label. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + __slots__ = ('_path_helper', '_extmethods', '__generic','__otn','__vlanid','__direction',) + + _yang_name = 'te-label' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__generic = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True) + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + self.__vlanid = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True) + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', 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 ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'local-link-connectivity', 'optimizations', 'optimization-metric', 'explicit-route-exclude-objects', 'route-object-exclude-object', 'label-hop', 'te-label'] + + def _get_generic(self): + """ + Getter method for generic, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label/generic (rt-types:generalized-label) + + YANG Description: TE label specified in a generic format. + """ + return self.__generic + + def _set_generic(self, v, load=False): + """ + Setter method for generic, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label/generic (rt-types:generalized-label) + If this variable is read-only (config: false) in the + source YANG file, then _set_generic is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_generic() directly. + + YANG Description: TE label specified in a generic format. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """generic must be of a type compatible with rt-types:generalized-label""", + 'defined-type': "rt-types:generalized-label", + 'generated-type': """YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True)""", + }) + + self.__generic = t + if hasattr(self, '_set'): + self._set() + + def _unset_generic(self): + self.__generic = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True) + + + def _get_otn(self): + """ + Getter method for otn, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label/otn (container) + + YANG Description: Label hop for OTN. + """ + return self.__otn + + def _set_otn(self, v, load=False): + """ + Setter method for otn, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label/otn (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_otn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_otn() directly. + + YANG Description: Label hop for OTN. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """otn must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True)""", + }) + + self.__otn = t + if hasattr(self, '_set'): + self._set() + + def _unset_otn(self): + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + + + def _get_vlanid(self): + """ + Getter method for vlanid, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label/vlanid (etht-types:vlanid) + + YANG Description: VLAN tag id. + """ + return self.__vlanid + + def _set_vlanid(self, v, load=False): + """ + Setter method for vlanid, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label/vlanid (etht-types:vlanid) + If this variable is read-only (config: false) in the + source YANG file, then _set_vlanid is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_vlanid() directly. + + YANG Description: VLAN tag id. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """vlanid must be of a type compatible with etht-types:vlanid""", + 'defined-type': "etht-types:vlanid", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True)""", + }) + + self.__vlanid = t + if hasattr(self, '_set'): + self._set() + + def _unset_vlanid(self): + self.__vlanid = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True) + + + def _get_direction(self): + """ + Getter method for direction, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label/direction (te-label-direction) + + YANG Description: Label direction. + """ + return self.__direction + + def _set_direction(self, v, load=False): + """ + Setter method for direction, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label/direction (te-label-direction) + If this variable is read-only (config: false) in the + source YANG file, then _set_direction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_direction() directly. + + YANG Description: Label direction. + """ + 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={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """direction must be of a type compatible with te-label-direction""", + 'defined-type': "ietf-te-topology:te-label-direction", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=True)""", + }) + + self.__direction = t + if hasattr(self, '_set'): + self._set() + + def _unset_direction(self): + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=True) + + generic = __builtin__.property(_get_generic, _set_generic) + otn = __builtin__.property(_get_otn, _set_otn) + vlanid = __builtin__.property(_get_vlanid, _set_vlanid) + direction = __builtin__.property(_get_direction, _set_direction) + + __choices__ = {'technology': {'generic': ['generic'], 'otn': ['otn'], 'eth': ['vlanid']}, 'type': {'label': ['direction']}} + _pyangbind_elements = OrderedDict([('generic', generic), ('otn', otn), ('vlanid', vlanid), ('direction', direction), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label/otn/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label/otn/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..6c0b396ee7d0ae6a237131987bf3e8514244893f --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label/otn/__init__.py @@ -0,0 +1,209 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 otn(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/local-link-connectivity/optimizations/optimization-metric/explicit-route-exclude-objects/route-object-exclude-object/label-hop/te-label/otn. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Label hop for OTN. + """ + __slots__ = ('_path_helper', '_extmethods', '__tpn','__tsg','__ts_list',) + + _yang_name = 'otn' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__tpn = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True) + self.__tsg = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + self.__ts_list = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-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 ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'local-link-connectivity', 'optimizations', 'optimization-metric', 'explicit-route-exclude-objects', 'route-object-exclude-object', 'label-hop', 'te-label', 'otn'] + + def _get_tpn(self): + """ + Getter method for tpn, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label/otn/tpn (otn-tpn) + + YANG Description: Tributary Port Number (TPN). + """ + return self.__tpn + + def _set_tpn(self, v, load=False): + """ + Setter method for tpn, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label/otn/tpn (otn-tpn) + If this variable is read-only (config: false) in the + source YANG file, then _set_tpn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tpn() directly. + + YANG Description: Tributary Port Number (TPN). + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tpn must be of a type compatible with otn-tpn""", + 'defined-type': "ietf-otn-topology:otn-tpn", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True)""", + }) + + self.__tpn = t + if hasattr(self, '_set'): + self._set() + + def _unset_tpn(self): + self.__tpn = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True) + + + def _get_tsg(self): + """ + Getter method for tsg, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label/otn/tsg (identityref) + + YANG Description: Tributary Slot Granularity (TSG). + """ + return self.__tsg + + def _set_tsg(self, v, load=False): + """ + Setter method for tsg, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label/otn/tsg (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_tsg is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tsg() directly. + + YANG Description: Tributary Slot Granularity (TSG). + """ + 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={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tsg must be of a type compatible with identityref""", + 'defined-type': "ietf-otn-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True)""", + }) + + self.__tsg = t + if hasattr(self, '_set'): + self._set() + + def _unset_tsg(self): + self.__tsg = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + + + def _get_ts_list(self): + """ + Getter method for ts_list, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label/otn/ts_list (string) + + YANG Description: A list of available Tributary Slots (TS) ranging + + + + +between 1 and 4095. If multiple values or +ranges are given, they all MUST be disjoint +and MUST be in ascending order. +For example 1-20,25,50-1000. + """ + return self.__ts_list + + def _set_ts_list(self, v, load=False): + """ + Setter method for ts_list, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label/otn/ts_list (string) + If this variable is read-only (config: false) in the + source YANG file, then _set_ts_list is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_ts_list() directly. + + YANG Description: A list of available Tributary Slots (TS) ranging + + + + +between 1 and 4095. If multiple values or +ranges are given, they all MUST be disjoint +and MUST be in ascending order. +For example 1-20,25,50-1000. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='string', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """ts_list must be of a type compatible with string""", + 'defined-type': "string", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='string', is_config=True)""", + }) + + self.__ts_list = t + if hasattr(self, '_set'): + self._set() + + def _unset_ts_list(self): + self.__ts_list = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='string', is_config=True) + + tpn = __builtin__.property(_get_tpn, _set_tpn) + tsg = __builtin__.property(_get_tsg, _set_tsg) + ts_list = __builtin__.property(_get_ts_list, _set_ts_list) + + __choices__ = {'technology': {'otn': ['tpn', 'tsg', 'ts_list']}} + _pyangbind_elements = OrderedDict([('tpn', tpn), ('tsg', tsg), ('ts_list', ts_list), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/numbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/numbered_link_hop/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..bda9afb8438c86eca19dde2b7f4a8c90b8b67064 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/numbered_link_hop/__init__.py @@ -0,0 +1,193 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 numbered_link_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/local-link-connectivity/optimizations/optimization-metric/explicit-route-exclude-objects/route-object-exclude-object/numbered-link-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Numbered link explicit route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__link_tp_id','__hop_type','__direction',) + + _yang_name = 'numbered-link-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', 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 ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'local-link-connectivity', 'optimizations', 'optimization-metric', 'explicit-route-exclude-objects', 'route-object-exclude-object', 'numbered-link-hop'] + + def _get_link_tp_id(self): + """ + Getter method for link_tp_id, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/numbered_link_hop/link_tp_id (te-tp-id) + + YANG Description: TE Link Termination Point (LTP) identifier. + """ + return self.__link_tp_id + + def _set_link_tp_id(self, v, load=False): + """ + Setter method for link_tp_id, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/numbered_link_hop/link_tp_id (te-tp-id) + If this variable is read-only (config: false) in the + source YANG file, then _set_link_tp_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_link_tp_id() directly. + + YANG Description: TE Link Termination Point (LTP) identifier. + """ + 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),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """link_tp_id must be of a type compatible with te-tp-id""", + 'defined-type': "ietf-te-topology:te-tp-id", + 'generated-type': """YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True)""", + }) + + self.__link_tp_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_link_tp_id(self): + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/numbered_link_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/numbered_link_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + 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={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + + + def _get_direction(self): + """ + Getter method for direction, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/numbered_link_hop/direction (te-link-direction) + + YANG Description: Link route object direction. + """ + return self.__direction + + def _set_direction(self, v, load=False): + """ + Setter method for direction, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/numbered_link_hop/direction (te-link-direction) + If this variable is read-only (config: false) in the + source YANG file, then _set_direction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_direction() directly. + + YANG Description: Link route object direction. + """ + 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={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """direction must be of a type compatible with te-link-direction""", + 'defined-type': "ietf-te-topology:te-link-direction", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True)""", + }) + + self.__direction = t + if hasattr(self, '_set'): + self._set() + + def _unset_direction(self): + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True) + + link_tp_id = __builtin__.property(_get_link_tp_id, _set_link_tp_id) + hop_type = __builtin__.property(_get_hop_type, _set_hop_type) + direction = __builtin__.property(_get_direction, _set_direction) + + __choices__ = {'type': {'numbered-link-hop': ['link_tp_id', 'hop_type', 'direction']}} + _pyangbind_elements = OrderedDict([('link_tp_id', link_tp_id), ('hop_type', hop_type), ('direction', direction), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/numbered_node_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/numbered_node_hop/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..5c7cd97f18083e5cb1bee25bbefcf3d465f68e7a --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/numbered_node_hop/__init__.py @@ -0,0 +1,154 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 numbered_node_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/local-link-connectivity/optimizations/optimization-metric/explicit-route-exclude-objects/route-object-exclude-object/numbered-node-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Numbered node route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__node_id','__hop_type',) + + _yang_name = 'numbered-node-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', 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 ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'local-link-connectivity', 'optimizations', 'optimization-metric', 'explicit-route-exclude-objects', 'route-object-exclude-object', 'numbered-node-hop'] + + def _get_node_id(self): + """ + Getter method for node_id, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/numbered_node_hop/node_id (te-node-id) + + YANG Description: The identifier of a node in the TE topology. + """ + return self.__node_id + + def _set_node_id(self, v, load=False): + """ + Setter method for node_id, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/numbered_node_hop/node_id (te-node-id) + 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. + + YANG Description: The identifier of a node in the TE topology. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """node_id must be of a type compatible with te-node-id""", + 'defined-type': "ietf-te-topology:te-node-id", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True)""", + }) + + self.__node_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_node_id(self): + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/numbered_node_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/numbered_node_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + 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={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + + node_id = __builtin__.property(_get_node_id, _set_node_id) + hop_type = __builtin__.property(_get_hop_type, _set_hop_type) + + __choices__ = {'type': {'numbered-node-hop': ['node_id', 'hop_type']}} + _pyangbind_elements = OrderedDict([('node_id', node_id), ('hop_type', hop_type), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/srlg/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/srlg/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..9fdf3924968411d9f77d42b907982b67ceda3a26 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/srlg/__init__.py @@ -0,0 +1,115 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 srlg(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/local-link-connectivity/optimizations/optimization-metric/explicit-route-exclude-objects/route-object-exclude-object/srlg. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: SRLG container. + """ + __slots__ = ('_path_helper', '_extmethods', '__srlg',) + + _yang_name = 'srlg' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__srlg = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="srlg", parent=self, choice=('type', 'srlg'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', 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 ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'local-link-connectivity', 'optimizations', 'optimization-metric', 'explicit-route-exclude-objects', 'route-object-exclude-object', 'srlg'] + + def _get_srlg(self): + """ + Getter method for srlg, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/srlg/srlg (uint32) + + YANG Description: SRLG value. + """ + return self.__srlg + + def _set_srlg(self, v, load=False): + """ + Setter method for srlg, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/srlg/srlg (uint32) + If this variable is read-only (config: false) in the + source YANG file, then _set_srlg is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_srlg() directly. + + YANG Description: SRLG value. + """ + 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="srlg", parent=self, choice=('type', 'srlg'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """srlg 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="srlg", parent=self, choice=('type', 'srlg'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True)""", + }) + + self.__srlg = t + if hasattr(self, '_set'): + self._set() + + def _unset_srlg(self): + self.__srlg = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="srlg", parent=self, choice=('type', 'srlg'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + + srlg = __builtin__.property(_get_srlg, _set_srlg) + + __choices__ = {'type': {'srlg': ['srlg']}} + _pyangbind_elements = OrderedDict([('srlg', srlg), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/unnumbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/unnumbered_link_hop/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..b5794e333a5155532f3a0af6b0647939d5d4f964 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/unnumbered_link_hop/__init__.py @@ -0,0 +1,236 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 unnumbered_link_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/local-link-connectivity/optimizations/optimization-metric/explicit-route-exclude-objects/route-object-exclude-object/unnumbered-link-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Unnumbered link explicit route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__link_tp_id','__node_id','__hop_type','__direction',) + + _yang_name = 'unnumbered-link-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True) + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', 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 ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'local-link-connectivity', 'optimizations', 'optimization-metric', 'explicit-route-exclude-objects', 'route-object-exclude-object', 'unnumbered-link-hop'] + + def _get_link_tp_id(self): + """ + Getter method for link_tp_id, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/unnumbered_link_hop/link_tp_id (te-tp-id) + + YANG Description: TE LTP identifier. The combination of the TE link ID +and the TE node ID is used to identify an unnumbered +TE link. + """ + return self.__link_tp_id + + def _set_link_tp_id(self, v, load=False): + """ + Setter method for link_tp_id, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/unnumbered_link_hop/link_tp_id (te-tp-id) + If this variable is read-only (config: false) in the + source YANG file, then _set_link_tp_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_link_tp_id() directly. + + YANG Description: TE LTP identifier. The combination of the TE link ID +and the TE node ID is used to identify an unnumbered +TE link. + """ + 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),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """link_tp_id must be of a type compatible with te-tp-id""", + 'defined-type': "ietf-te-topology:te-tp-id", + 'generated-type': """YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True)""", + }) + + self.__link_tp_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_link_tp_id(self): + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True) + + + def _get_node_id(self): + """ + Getter method for node_id, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/unnumbered_link_hop/node_id (te-node-id) + + YANG Description: The identifier of a node in the TE topology. + """ + return self.__node_id + + def _set_node_id(self, v, load=False): + """ + Setter method for node_id, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/unnumbered_link_hop/node_id (te-node-id) + 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. + + YANG Description: The identifier of a node in the TE topology. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """node_id must be of a type compatible with te-node-id""", + 'defined-type': "ietf-te-topology:te-node-id", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True)""", + }) + + self.__node_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_node_id(self): + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/unnumbered_link_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/unnumbered_link_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + 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={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + + + def _get_direction(self): + """ + Getter method for direction, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/unnumbered_link_hop/direction (te-link-direction) + + YANG Description: Link route object direction. + """ + return self.__direction + + def _set_direction(self, v, load=False): + """ + Setter method for direction, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/unnumbered_link_hop/direction (te-link-direction) + If this variable is read-only (config: false) in the + source YANG file, then _set_direction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_direction() directly. + + YANG Description: Link route object direction. + """ + 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={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """direction must be of a type compatible with te-link-direction""", + 'defined-type': "ietf-te-topology:te-link-direction", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True)""", + }) + + self.__direction = t + if hasattr(self, '_set'): + self._set() + + def _unset_direction(self): + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True) + + link_tp_id = __builtin__.property(_get_link_tp_id, _set_link_tp_id) + node_id = __builtin__.property(_get_node_id, _set_node_id) + hop_type = __builtin__.property(_get_hop_type, _set_hop_type) + direction = __builtin__.property(_get_direction, _set_direction) + + __choices__ = {'type': {'unnumbered-link-hop': ['link_tp_id', 'node_id', 'hop_type', 'direction']}} + _pyangbind_elements = OrderedDict([('link_tp_id', link_tp_id), ('node_id', node_id), ('hop_type', hop_type), ('direction', direction), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_include_objects/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_include_objects/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..f5e9a3732126f9480005cfee1746e3ce154243af --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_include_objects/__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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 route_object_include_object +class explicit_route_include_objects(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/local-link-connectivity/optimizations/optimization-metric/explicit-route-include-objects. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Container for the 'include route' object list. + """ + __slots__ = ('_path_helper', '_extmethods', '__route_object_include_object',) + + _yang_name = 'explicit-route-include-objects' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__route_object_include_object = YANGDynClass(base=YANGListType("index",route_object_include_object.route_object_include_object, yang_name="route-object-include-object", parent=self, is_container='list', user_ordered=True, path_helper=self._path_helper, yang_keys='index', extensions=None, choice=('algorithm', 'metric')), is_container='list', yang_name="route-object-include-object", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-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 ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'local-link-connectivity', 'optimizations', 'optimization-metric', 'explicit-route-include-objects'] + + def _get_route_object_include_object(self): + """ + Getter method for route_object_include_object, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object (list) + + YANG Description: List of Explicit Route Objects to be included in the +path computation. + """ + return self.__route_object_include_object + + def _set_route_object_include_object(self, v, load=False): + """ + Setter method for route_object_include_object, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_route_object_include_object is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_route_object_include_object() directly. + + YANG Description: List of Explicit Route Objects to be included in the +path computation. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("index",route_object_include_object.route_object_include_object, yang_name="route-object-include-object", parent=self, is_container='list', user_ordered=True, path_helper=self._path_helper, yang_keys='index', extensions=None, choice=('algorithm', 'metric')), is_container='list', yang_name="route-object-include-object", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """route_object_include_object must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("index",route_object_include_object.route_object_include_object, yang_name="route-object-include-object", parent=self, is_container='list', user_ordered=True, path_helper=self._path_helper, yang_keys='index', extensions=None, choice=('algorithm', 'metric')), is_container='list', yang_name="route-object-include-object", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True)""", + }) + + self.__route_object_include_object = t + if hasattr(self, '_set'): + self._set() + + def _unset_route_object_include_object(self): + self.__route_object_include_object = YANGDynClass(base=YANGListType("index",route_object_include_object.route_object_include_object, yang_name="route-object-include-object", parent=self, is_container='list', user_ordered=True, path_helper=self._path_helper, yang_keys='index', extensions=None, choice=('algorithm', 'metric')), is_container='list', yang_name="route-object-include-object", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + + route_object_include_object = __builtin__.property(_get_route_object_include_object, _set_route_object_include_object) + + __choices__ = {'algorithm': {'metric': ['route_object_include_object']}} + _pyangbind_elements = OrderedDict([('route_object_include_object', route_object_include_object), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..374536eb4a03613662b8edb0cb12bc447d9e0340 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/__init__.py @@ -0,0 +1,325 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 numbered_node_hop +from . import numbered_link_hop +from . import unnumbered_link_hop +from . import as_number_hop +from . import label_hop +class route_object_include_object(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/local-link-connectivity/optimizations/optimization-metric/explicit-route-include-objects/route-object-include-object. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: List of Explicit Route Objects to be included in the +path computation. + """ + __slots__ = ('_path_helper', '_extmethods', '__index','__numbered_node_hop','__numbered_link_hop','__unnumbered_link_hop','__as_number_hop','__label_hop',) + + _yang_name = 'route-object-include-object' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _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), is_leaf=True, yang_name="index", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + self.__numbered_node_hop = YANGDynClass(base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__numbered_link_hop = YANGDynClass(base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__unnumbered_link_hop = YANGDynClass(base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__as_number_hop = YANGDynClass(base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__label_hop = YANGDynClass(base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-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 ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'local-link-connectivity', 'optimizations', 'optimization-metric', 'explicit-route-include-objects', 'route-object-include-object'] + + def _get_index(self): + """ + Getter method for index, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/index (uint32) + + YANG Description: Route object entry index. The index is used to +identify an entry in the list. The order of entries +is defined by the user without relying on key values. + """ + return self.__index + + def _set_index(self, v, load=False): + """ + Setter method for index, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/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: Route object entry index. The index is used to +identify an entry in the list. The order of entries +is defined by the user without relying on key values. + """ + 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=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="index", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', 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), is_leaf=True, yang_name="index", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', 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), is_leaf=True, yang_name="index", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + + + def _get_numbered_node_hop(self): + """ + Getter method for numbered_node_hop, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/numbered_node_hop (container) + + YANG Description: Numbered node route hop. + """ + return self.__numbered_node_hop + + def _set_numbered_node_hop(self, v, load=False): + """ + Setter method for numbered_node_hop, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/numbered_node_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_numbered_node_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_numbered_node_hop() directly. + + YANG Description: Numbered node route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """numbered_node_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__numbered_node_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_numbered_node_hop(self): + self.__numbered_node_hop = YANGDynClass(base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_numbered_link_hop(self): + """ + Getter method for numbered_link_hop, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/numbered_link_hop (container) + + YANG Description: Numbered link explicit route hop. + """ + return self.__numbered_link_hop + + def _set_numbered_link_hop(self, v, load=False): + """ + Setter method for numbered_link_hop, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/numbered_link_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_numbered_link_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_numbered_link_hop() directly. + + YANG Description: Numbered link explicit route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """numbered_link_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__numbered_link_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_numbered_link_hop(self): + self.__numbered_link_hop = YANGDynClass(base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_unnumbered_link_hop(self): + """ + Getter method for unnumbered_link_hop, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/unnumbered_link_hop (container) + + YANG Description: Unnumbered link explicit route hop. + """ + return self.__unnumbered_link_hop + + def _set_unnumbered_link_hop(self, v, load=False): + """ + Setter method for unnumbered_link_hop, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/unnumbered_link_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_unnumbered_link_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_unnumbered_link_hop() directly. + + YANG Description: Unnumbered link explicit route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """unnumbered_link_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__unnumbered_link_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_unnumbered_link_hop(self): + self.__unnumbered_link_hop = YANGDynClass(base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_as_number_hop(self): + """ + Getter method for as_number_hop, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/as_number_hop (container) + + YANG Description: AS explicit route hop. + """ + return self.__as_number_hop + + def _set_as_number_hop(self, v, load=False): + """ + Setter method for as_number_hop, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/as_number_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_as_number_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_as_number_hop() directly. + + YANG Description: AS explicit route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """as_number_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__as_number_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_as_number_hop(self): + self.__as_number_hop = YANGDynClass(base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_label_hop(self): + """ + Getter method for label_hop, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop (container) + + YANG Description: Label hop type. + """ + return self.__label_hop + + def _set_label_hop(self, v, load=False): + """ + Setter method for label_hop, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_label_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_label_hop() directly. + + YANG Description: Label hop type. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """label_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__label_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_label_hop(self): + self.__label_hop = YANGDynClass(base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + index = __builtin__.property(_get_index, _set_index) + numbered_node_hop = __builtin__.property(_get_numbered_node_hop, _set_numbered_node_hop) + numbered_link_hop = __builtin__.property(_get_numbered_link_hop, _set_numbered_link_hop) + unnumbered_link_hop = __builtin__.property(_get_unnumbered_link_hop, _set_unnumbered_link_hop) + as_number_hop = __builtin__.property(_get_as_number_hop, _set_as_number_hop) + label_hop = __builtin__.property(_get_label_hop, _set_label_hop) + + __choices__ = {'algorithm': {'metric': ['index']}, 'type': {'numbered-node-hop': ['numbered_node_hop'], 'numbered-link-hop': ['numbered_link_hop'], 'unnumbered-link-hop': ['unnumbered_link_hop'], 'as-number': ['as_number_hop'], 'label': ['label_hop']}} + _pyangbind_elements = OrderedDict([('index', index), ('numbered_node_hop', numbered_node_hop), ('numbered_link_hop', numbered_link_hop), ('unnumbered_link_hop', unnumbered_link_hop), ('as_number_hop', as_number_hop), ('label_hop', label_hop), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/as_number_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/as_number_hop/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..0b9ce19d6fb5071f1285e74ed70a8cf256980397 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/as_number_hop/__init__.py @@ -0,0 +1,154 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 as_number_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/local-link-connectivity/optimizations/optimization-metric/explicit-route-include-objects/route-object-include-object/as-number-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: AS explicit route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__as_number','__hop_type',) + + _yang_name = 'as-number-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__as_number = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=True) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', 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 ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'local-link-connectivity', 'optimizations', 'optimization-metric', 'explicit-route-include-objects', 'route-object-include-object', 'as-number-hop'] + + def _get_as_number(self): + """ + Getter method for as_number, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/as_number_hop/as_number (inet:as-number) + + YANG Description: The Autonomous System (AS) number. + """ + return self.__as_number + + def _set_as_number(self, v, load=False): + """ + Setter method for as_number, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/as_number_hop/as_number (inet:as-number) + If this variable is read-only (config: false) in the + source YANG file, then _set_as_number is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_as_number() directly. + + YANG Description: The Autonomous System (AS) number. + """ + 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="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """as_number must be of a type compatible with inet:as-number""", + 'defined-type': "inet:as-number", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=True)""", + }) + + self.__as_number = t + if hasattr(self, '_set'): + self._set() + + def _unset_as_number(self): + self.__as_number = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=True) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/as_number_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/as_number_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + 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={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + + as_number = __builtin__.property(_get_as_number, _set_as_number) + hop_type = __builtin__.property(_get_hop_type, _set_hop_type) + + __choices__ = {'type': {'as-number': ['as_number', 'hop_type']}} + _pyangbind_elements = OrderedDict([('as_number', as_number), ('hop_type', hop_type), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..b21890c48b0310bf39896972ca3f76bf2f0d91c1 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/__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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 te_label +class label_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/local-link-connectivity/optimizations/optimization-metric/explicit-route-include-objects/route-object-include-object/label-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Label hop type. + """ + __slots__ = ('_path_helper', '_extmethods', '__te_label',) + + _yang_name = 'label-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__te_label = YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-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 ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'local-link-connectivity', 'optimizations', 'optimization-metric', 'explicit-route-include-objects', 'route-object-include-object', 'label-hop'] + + def _get_te_label(self): + """ + Getter method for te_label, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label (container) + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + return self.__te_label + + def _set_te_label(self, v, load=False): + """ + Setter method for te_label, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_te_label is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_te_label() directly. + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """te_label must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__te_label = t + if hasattr(self, '_set'): + self._set() + + def _unset_te_label(self): + self.__te_label = YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + te_label = __builtin__.property(_get_te_label, _set_te_label) + + __choices__ = {'type': {'label': ['te_label']}} + _pyangbind_elements = OrderedDict([('te_label', te_label), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..df8c1361951da40f39c4baef79c1402c08cf7882 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label/__init__.py @@ -0,0 +1,234 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 otn +class te_label(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/local-link-connectivity/optimizations/optimization-metric/explicit-route-include-objects/route-object-include-object/label-hop/te-label. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + __slots__ = ('_path_helper', '_extmethods', '__generic','__otn','__vlanid','__direction',) + + _yang_name = 'te-label' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__generic = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True) + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + self.__vlanid = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True) + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', 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 ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'local-link-connectivity', 'optimizations', 'optimization-metric', 'explicit-route-include-objects', 'route-object-include-object', 'label-hop', 'te-label'] + + def _get_generic(self): + """ + Getter method for generic, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label/generic (rt-types:generalized-label) + + YANG Description: TE label specified in a generic format. + """ + return self.__generic + + def _set_generic(self, v, load=False): + """ + Setter method for generic, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label/generic (rt-types:generalized-label) + If this variable is read-only (config: false) in the + source YANG file, then _set_generic is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_generic() directly. + + YANG Description: TE label specified in a generic format. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """generic must be of a type compatible with rt-types:generalized-label""", + 'defined-type': "rt-types:generalized-label", + 'generated-type': """YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True)""", + }) + + self.__generic = t + if hasattr(self, '_set'): + self._set() + + def _unset_generic(self): + self.__generic = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True) + + + def _get_otn(self): + """ + Getter method for otn, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label/otn (container) + + YANG Description: Label hop for OTN. + """ + return self.__otn + + def _set_otn(self, v, load=False): + """ + Setter method for otn, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label/otn (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_otn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_otn() directly. + + YANG Description: Label hop for OTN. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """otn must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True)""", + }) + + self.__otn = t + if hasattr(self, '_set'): + self._set() + + def _unset_otn(self): + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + + + def _get_vlanid(self): + """ + Getter method for vlanid, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label/vlanid (etht-types:vlanid) + + YANG Description: VLAN tag id. + """ + return self.__vlanid + + def _set_vlanid(self, v, load=False): + """ + Setter method for vlanid, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label/vlanid (etht-types:vlanid) + If this variable is read-only (config: false) in the + source YANG file, then _set_vlanid is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_vlanid() directly. + + YANG Description: VLAN tag id. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """vlanid must be of a type compatible with etht-types:vlanid""", + 'defined-type': "etht-types:vlanid", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True)""", + }) + + self.__vlanid = t + if hasattr(self, '_set'): + self._set() + + def _unset_vlanid(self): + self.__vlanid = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True) + + + def _get_direction(self): + """ + Getter method for direction, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label/direction (te-label-direction) + + YANG Description: Label direction. + """ + return self.__direction + + def _set_direction(self, v, load=False): + """ + Setter method for direction, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label/direction (te-label-direction) + If this variable is read-only (config: false) in the + source YANG file, then _set_direction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_direction() directly. + + YANG Description: Label direction. + """ + 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={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """direction must be of a type compatible with te-label-direction""", + 'defined-type': "ietf-te-topology:te-label-direction", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=True)""", + }) + + self.__direction = t + if hasattr(self, '_set'): + self._set() + + def _unset_direction(self): + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=True) + + generic = __builtin__.property(_get_generic, _set_generic) + otn = __builtin__.property(_get_otn, _set_otn) + vlanid = __builtin__.property(_get_vlanid, _set_vlanid) + direction = __builtin__.property(_get_direction, _set_direction) + + __choices__ = {'technology': {'generic': ['generic'], 'otn': ['otn'], 'eth': ['vlanid']}, 'type': {'label': ['direction']}} + _pyangbind_elements = OrderedDict([('generic', generic), ('otn', otn), ('vlanid', vlanid), ('direction', direction), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label/otn/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label/otn/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..7fef4856ef2c1720a443a226ac6bdbd347097b72 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label/otn/__init__.py @@ -0,0 +1,209 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 otn(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/local-link-connectivity/optimizations/optimization-metric/explicit-route-include-objects/route-object-include-object/label-hop/te-label/otn. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Label hop for OTN. + """ + __slots__ = ('_path_helper', '_extmethods', '__tpn','__tsg','__ts_list',) + + _yang_name = 'otn' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__tpn = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True) + self.__tsg = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + self.__ts_list = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-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 ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'local-link-connectivity', 'optimizations', 'optimization-metric', 'explicit-route-include-objects', 'route-object-include-object', 'label-hop', 'te-label', 'otn'] + + def _get_tpn(self): + """ + Getter method for tpn, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label/otn/tpn (otn-tpn) + + YANG Description: Tributary Port Number (TPN). + """ + return self.__tpn + + def _set_tpn(self, v, load=False): + """ + Setter method for tpn, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label/otn/tpn (otn-tpn) + If this variable is read-only (config: false) in the + source YANG file, then _set_tpn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tpn() directly. + + YANG Description: Tributary Port Number (TPN). + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tpn must be of a type compatible with otn-tpn""", + 'defined-type': "ietf-otn-topology:otn-tpn", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True)""", + }) + + self.__tpn = t + if hasattr(self, '_set'): + self._set() + + def _unset_tpn(self): + self.__tpn = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True) + + + def _get_tsg(self): + """ + Getter method for tsg, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label/otn/tsg (identityref) + + YANG Description: Tributary Slot Granularity (TSG). + """ + return self.__tsg + + def _set_tsg(self, v, load=False): + """ + Setter method for tsg, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label/otn/tsg (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_tsg is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tsg() directly. + + YANG Description: Tributary Slot Granularity (TSG). + """ + 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={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tsg must be of a type compatible with identityref""", + 'defined-type': "ietf-otn-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True)""", + }) + + self.__tsg = t + if hasattr(self, '_set'): + self._set() + + def _unset_tsg(self): + self.__tsg = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + + + def _get_ts_list(self): + """ + Getter method for ts_list, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label/otn/ts_list (string) + + YANG Description: A list of available Tributary Slots (TS) ranging + + + + +between 1 and 4095. If multiple values or +ranges are given, they all MUST be disjoint +and MUST be in ascending order. +For example 1-20,25,50-1000. + """ + return self.__ts_list + + def _set_ts_list(self, v, load=False): + """ + Setter method for ts_list, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label/otn/ts_list (string) + If this variable is read-only (config: false) in the + source YANG file, then _set_ts_list is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_ts_list() directly. + + YANG Description: A list of available Tributary Slots (TS) ranging + + + + +between 1 and 4095. If multiple values or +ranges are given, they all MUST be disjoint +and MUST be in ascending order. +For example 1-20,25,50-1000. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='string', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """ts_list must be of a type compatible with string""", + 'defined-type': "string", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='string', is_config=True)""", + }) + + self.__ts_list = t + if hasattr(self, '_set'): + self._set() + + def _unset_ts_list(self): + self.__ts_list = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='string', is_config=True) + + tpn = __builtin__.property(_get_tpn, _set_tpn) + tsg = __builtin__.property(_get_tsg, _set_tsg) + ts_list = __builtin__.property(_get_ts_list, _set_ts_list) + + __choices__ = {'technology': {'otn': ['tpn', 'tsg', 'ts_list']}} + _pyangbind_elements = OrderedDict([('tpn', tpn), ('tsg', tsg), ('ts_list', ts_list), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/numbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/numbered_link_hop/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..97b264f0df4730b294424e89f9d7b7aec427c1e5 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/numbered_link_hop/__init__.py @@ -0,0 +1,193 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 numbered_link_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/local-link-connectivity/optimizations/optimization-metric/explicit-route-include-objects/route-object-include-object/numbered-link-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Numbered link explicit route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__link_tp_id','__hop_type','__direction',) + + _yang_name = 'numbered-link-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', 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 ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'local-link-connectivity', 'optimizations', 'optimization-metric', 'explicit-route-include-objects', 'route-object-include-object', 'numbered-link-hop'] + + def _get_link_tp_id(self): + """ + Getter method for link_tp_id, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/numbered_link_hop/link_tp_id (te-tp-id) + + YANG Description: TE Link Termination Point (LTP) identifier. + """ + return self.__link_tp_id + + def _set_link_tp_id(self, v, load=False): + """ + Setter method for link_tp_id, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/numbered_link_hop/link_tp_id (te-tp-id) + If this variable is read-only (config: false) in the + source YANG file, then _set_link_tp_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_link_tp_id() directly. + + YANG Description: TE Link Termination Point (LTP) identifier. + """ + 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),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """link_tp_id must be of a type compatible with te-tp-id""", + 'defined-type': "ietf-te-topology:te-tp-id", + 'generated-type': """YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True)""", + }) + + self.__link_tp_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_link_tp_id(self): + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/numbered_link_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/numbered_link_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + 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={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + + + def _get_direction(self): + """ + Getter method for direction, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/numbered_link_hop/direction (te-link-direction) + + YANG Description: Link route object direction. + """ + return self.__direction + + def _set_direction(self, v, load=False): + """ + Setter method for direction, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/numbered_link_hop/direction (te-link-direction) + If this variable is read-only (config: false) in the + source YANG file, then _set_direction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_direction() directly. + + YANG Description: Link route object direction. + """ + 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={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """direction must be of a type compatible with te-link-direction""", + 'defined-type': "ietf-te-topology:te-link-direction", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True)""", + }) + + self.__direction = t + if hasattr(self, '_set'): + self._set() + + def _unset_direction(self): + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True) + + link_tp_id = __builtin__.property(_get_link_tp_id, _set_link_tp_id) + hop_type = __builtin__.property(_get_hop_type, _set_hop_type) + direction = __builtin__.property(_get_direction, _set_direction) + + __choices__ = {'type': {'numbered-link-hop': ['link_tp_id', 'hop_type', 'direction']}} + _pyangbind_elements = OrderedDict([('link_tp_id', link_tp_id), ('hop_type', hop_type), ('direction', direction), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/numbered_node_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/numbered_node_hop/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..218283dca241717d1ea5bbd904562ee30751dc59 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/numbered_node_hop/__init__.py @@ -0,0 +1,154 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 numbered_node_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/local-link-connectivity/optimizations/optimization-metric/explicit-route-include-objects/route-object-include-object/numbered-node-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Numbered node route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__node_id','__hop_type',) + + _yang_name = 'numbered-node-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', 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 ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'local-link-connectivity', 'optimizations', 'optimization-metric', 'explicit-route-include-objects', 'route-object-include-object', 'numbered-node-hop'] + + def _get_node_id(self): + """ + Getter method for node_id, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/numbered_node_hop/node_id (te-node-id) + + YANG Description: The identifier of a node in the TE topology. + """ + return self.__node_id + + def _set_node_id(self, v, load=False): + """ + Setter method for node_id, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/numbered_node_hop/node_id (te-node-id) + 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. + + YANG Description: The identifier of a node in the TE topology. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """node_id must be of a type compatible with te-node-id""", + 'defined-type': "ietf-te-topology:te-node-id", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True)""", + }) + + self.__node_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_node_id(self): + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/numbered_node_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/numbered_node_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + 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={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + + node_id = __builtin__.property(_get_node_id, _set_node_id) + hop_type = __builtin__.property(_get_hop_type, _set_hop_type) + + __choices__ = {'type': {'numbered-node-hop': ['node_id', 'hop_type']}} + _pyangbind_elements = OrderedDict([('node_id', node_id), ('hop_type', hop_type), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/unnumbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/unnumbered_link_hop/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..ce387660e79d92b814eb12f9cabf9777d6cc8bc7 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/unnumbered_link_hop/__init__.py @@ -0,0 +1,236 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 unnumbered_link_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/local-link-connectivity/optimizations/optimization-metric/explicit-route-include-objects/route-object-include-object/unnumbered-link-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Unnumbered link explicit route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__link_tp_id','__node_id','__hop_type','__direction',) + + _yang_name = 'unnumbered-link-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True) + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', 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 ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'local-link-connectivity', 'optimizations', 'optimization-metric', 'explicit-route-include-objects', 'route-object-include-object', 'unnumbered-link-hop'] + + def _get_link_tp_id(self): + """ + Getter method for link_tp_id, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/unnumbered_link_hop/link_tp_id (te-tp-id) + + YANG Description: TE LTP identifier. The combination of the TE link ID +and the TE node ID is used to identify an unnumbered +TE link. + """ + return self.__link_tp_id + + def _set_link_tp_id(self, v, load=False): + """ + Setter method for link_tp_id, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/unnumbered_link_hop/link_tp_id (te-tp-id) + If this variable is read-only (config: false) in the + source YANG file, then _set_link_tp_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_link_tp_id() directly. + + YANG Description: TE LTP identifier. The combination of the TE link ID +and the TE node ID is used to identify an unnumbered +TE link. + """ + 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),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """link_tp_id must be of a type compatible with te-tp-id""", + 'defined-type': "ietf-te-topology:te-tp-id", + 'generated-type': """YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True)""", + }) + + self.__link_tp_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_link_tp_id(self): + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True) + + + def _get_node_id(self): + """ + Getter method for node_id, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/unnumbered_link_hop/node_id (te-node-id) + + YANG Description: The identifier of a node in the TE topology. + """ + return self.__node_id + + def _set_node_id(self, v, load=False): + """ + Setter method for node_id, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/unnumbered_link_hop/node_id (te-node-id) + 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. + + YANG Description: The identifier of a node in the TE topology. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """node_id must be of a type compatible with te-node-id""", + 'defined-type': "ietf-te-topology:te-node-id", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True)""", + }) + + self.__node_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_node_id(self): + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/unnumbered_link_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/unnumbered_link_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + 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={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + + + def _get_direction(self): + """ + Getter method for direction, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/unnumbered_link_hop/direction (te-link-direction) + + YANG Description: Link route object direction. + """ + return self.__direction + + def _set_direction(self, v, load=False): + """ + Setter method for direction, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/unnumbered_link_hop/direction (te-link-direction) + If this variable is read-only (config: false) in the + source YANG file, then _set_direction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_direction() directly. + + YANG Description: Link route object direction. + """ + 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={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """direction must be of a type compatible with te-link-direction""", + 'defined-type': "ietf-te-topology:te-link-direction", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True)""", + }) + + self.__direction = t + if hasattr(self, '_set'): + self._set() + + def _unset_direction(self): + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True) + + link_tp_id = __builtin__.property(_get_link_tp_id, _set_link_tp_id) + node_id = __builtin__.property(_get_node_id, _set_node_id) + hop_type = __builtin__.property(_get_hop_type, _set_hop_type) + direction = __builtin__.property(_get_direction, _set_direction) + + __choices__ = {'type': {'unnumbered-link-hop': ['link_tp_id', 'node_id', 'hop_type', 'direction']}} + _pyangbind_elements = OrderedDict([('link_tp_id', link_tp_id), ('node_id', node_id), ('hop_type', hop_type), ('direction', direction), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/tiebreakers/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/tiebreakers/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..5dbea3946289108d2b2c3ddebe78bbfaa158aa05 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/tiebreakers/__init__.py @@ -0,0 +1,120 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 tiebreaker +class tiebreakers(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/local-link-connectivity/optimizations/tiebreakers. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Container for the list of tiebreakers. + """ + __slots__ = ('_path_helper', '_extmethods', '__tiebreaker',) + + _yang_name = 'tiebreakers' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__tiebreaker = YANGDynClass(base=YANGListType("tiebreaker_type",tiebreaker.tiebreaker, yang_name="tiebreaker", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='tiebreaker-type', extensions=None, choice=('algorithm', 'metric')), is_container='list', yang_name="tiebreaker", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-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 ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'local-link-connectivity', 'optimizations', 'tiebreakers'] + + def _get_tiebreaker(self): + """ + Getter method for tiebreaker, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/tiebreakers/tiebreaker (list) + + YANG Description: The list of tiebreaker criteria to apply on an +equally favored set of paths, in order to pick +the best. + """ + return self.__tiebreaker + + def _set_tiebreaker(self, v, load=False): + """ + Setter method for tiebreaker, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/tiebreakers/tiebreaker (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_tiebreaker is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tiebreaker() directly. + + YANG Description: The list of tiebreaker criteria to apply on an +equally favored set of paths, in order to pick +the best. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("tiebreaker_type",tiebreaker.tiebreaker, yang_name="tiebreaker", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='tiebreaker-type', extensions=None, choice=('algorithm', 'metric')), is_container='list', yang_name="tiebreaker", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tiebreaker must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("tiebreaker_type",tiebreaker.tiebreaker, yang_name="tiebreaker", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='tiebreaker-type', extensions=None, choice=('algorithm', 'metric')), is_container='list', yang_name="tiebreaker", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True)""", + }) + + self.__tiebreaker = t + if hasattr(self, '_set'): + self._set() + + def _unset_tiebreaker(self): + self.__tiebreaker = YANGDynClass(base=YANGListType("tiebreaker_type",tiebreaker.tiebreaker, yang_name="tiebreaker", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='tiebreaker-type', extensions=None, choice=('algorithm', 'metric')), is_container='list', yang_name="tiebreaker", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + + tiebreaker = __builtin__.property(_get_tiebreaker, _set_tiebreaker) + + __choices__ = {'algorithm': {'metric': ['tiebreaker']}} + _pyangbind_elements = OrderedDict([('tiebreaker', tiebreaker), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/tiebreakers/tiebreaker/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/tiebreakers/tiebreaker/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..6c879cb008a89e64a10388b6d404580a09162a6b --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/tiebreakers/tiebreaker/__init__.py @@ -0,0 +1,122 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 tiebreaker(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/local-link-connectivity/optimizations/tiebreakers/tiebreaker. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: The list of tiebreaker criteria to apply on an +equally favored set of paths, in order to pick +the best. + """ + __slots__ = ('_path_helper', '_extmethods', '__tiebreaker_type',) + + _yang_name = 'tiebreaker' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__tiebreaker_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="tiebreaker-type", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', 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 ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'local-link-connectivity', 'optimizations', 'tiebreakers', 'tiebreaker'] + + def _get_tiebreaker_type(self): + """ + Getter method for tiebreaker_type, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/tiebreakers/tiebreaker/tiebreaker_type (identityref) + + YANG Description: Identifies an entry in the list of tiebreakers. + """ + return self.__tiebreaker_type + + def _set_tiebreaker_type(self, v, load=False): + """ + Setter method for tiebreaker_type, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/tiebreakers/tiebreaker/tiebreaker_type (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_tiebreaker_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tiebreaker_type() directly. + + YANG Description: Identifies an entry in the list of tiebreakers. + """ + 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=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="tiebreaker-type", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tiebreaker_type must be of a type compatible with identityref""", + 'defined-type': "ietf-te-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="tiebreaker-type", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True)""", + }) + + self.__tiebreaker_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_tiebreaker_type(self): + self.__tiebreaker_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="tiebreaker-type", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + + tiebreaker_type = __builtin__.property(_get_tiebreaker_type, _set_tiebreaker_type) + + __choices__ = {'algorithm': {'metric': ['tiebreaker_type']}} + _pyangbind_elements = OrderedDict([('tiebreaker_type', tiebreaker_type), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..f737852bfcfe03d7e1b344472f9e92029947eccb --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/__init__.py @@ -0,0 +1,523 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 te_bandwidth +from . import path_metric_bounds +from . import path_affinities_values +from . import path_affinity_names +from . import path_srlgs_lists +from . import path_srlgs_names +class path_constraints(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/local-link-connectivity/path-constraints. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: TE named path constraints container. + """ + __slots__ = ('_path_helper', '_extmethods', '__te_bandwidth','__link_protection','__setup_priority','__hold_priority','__signaling_type','__path_metric_bounds','__path_affinities_values','__path_affinity_names','__path_srlgs_lists','__path_srlgs_names','__disjointness',) + + _yang_name = 'path-constraints' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__te_bandwidth = YANGDynClass(base=te_bandwidth.te_bandwidth, is_container='container', yang_name="te-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__link_protection = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'link-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-shared': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-shared': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-shared': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-enhanced': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-enhanced': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-enhanced': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), default=six.text_type("te-types:link-protection-unprotected"), is_leaf=True, yang_name="link-protection", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + self.__setup_priority = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..7']}), default=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8)(7), is_leaf=True, yang_name="setup-priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint8', is_config=True) + self.__hold_priority = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..7']}), default=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8)(7), is_leaf=True, yang_name="hold-priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint8', is_config=True) + self.__signaling_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'path-setup-static': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-setup-static': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-setup-static': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-setup-rsvp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-setup-rsvp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-setup-rsvp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-setup-sr': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-setup-sr': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-setup-sr': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), default=six.text_type("te-types:path-setup-rsvp"), is_leaf=True, yang_name="signaling-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + self.__path_metric_bounds = YANGDynClass(base=path_metric_bounds.path_metric_bounds, is_container='container', yang_name="path-metric-bounds", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__path_affinities_values = YANGDynClass(base=path_affinities_values.path_affinities_values, is_container='container', yang_name="path-affinities-values", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__path_affinity_names = YANGDynClass(base=path_affinity_names.path_affinity_names, is_container='container', yang_name="path-affinity-names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__path_srlgs_lists = YANGDynClass(base=path_srlgs_lists.path_srlgs_lists, is_container='container', yang_name="path-srlgs-lists", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__path_srlgs_names = YANGDynClass(base=path_srlgs_names.path_srlgs_names, is_container='container', yang_name="path-srlgs-names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__disjointness = YANGDynClass(base=YANGBitsType(allowed_bits={'node': '0', 'link': '1', 'srlg': '2'}), is_leaf=True, yang_name="disjointness", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-path-disjointness', 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 ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'local-link-connectivity', 'path-constraints'] + + def _get_te_bandwidth(self): + """ + Getter method for te_bandwidth, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/te_bandwidth (container) + + YANG Description: Container that specifies TE bandwidth. The choices +can be augmented for specific data-plane technologies. + """ + return self.__te_bandwidth + + def _set_te_bandwidth(self, v, load=False): + """ + Setter method for te_bandwidth, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/te_bandwidth (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_te_bandwidth is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_te_bandwidth() directly. + + YANG Description: Container that specifies TE bandwidth. The choices +can be augmented for specific data-plane technologies. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=te_bandwidth.te_bandwidth, is_container='container', yang_name="te-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """te_bandwidth must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=te_bandwidth.te_bandwidth, is_container='container', yang_name="te-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__te_bandwidth = t + if hasattr(self, '_set'): + self._set() + + def _unset_te_bandwidth(self): + self.__te_bandwidth = YANGDynClass(base=te_bandwidth.te_bandwidth, is_container='container', yang_name="te-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_link_protection(self): + """ + Getter method for link_protection, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/link_protection (identityref) + + YANG Description: Link protection type required for the links included +in the computed path. + """ + return self.__link_protection + + def _set_link_protection(self, v, load=False): + """ + Setter method for link_protection, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/link_protection (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_link_protection is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_link_protection() directly. + + YANG Description: Link protection type required for the links included +in the computed path. + """ + 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={'link-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-shared': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-shared': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-shared': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-enhanced': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-enhanced': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-enhanced': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), default=six.text_type("te-types:link-protection-unprotected"), is_leaf=True, yang_name="link-protection", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """link_protection must be of a type compatible with identityref""", + 'defined-type': "ietf-te-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'link-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-shared': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-shared': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-shared': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-enhanced': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-enhanced': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-enhanced': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), default=six.text_type("te-types:link-protection-unprotected"), is_leaf=True, yang_name="link-protection", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True)""", + }) + + self.__link_protection = t + if hasattr(self, '_set'): + self._set() + + def _unset_link_protection(self): + self.__link_protection = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'link-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-shared': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-shared': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-shared': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-enhanced': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-enhanced': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-enhanced': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), default=six.text_type("te-types:link-protection-unprotected"), is_leaf=True, yang_name="link-protection", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + + + def _get_setup_priority(self): + """ + Getter method for setup_priority, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/setup_priority (uint8) + + YANG Description: TE LSP requested setup priority. + """ + return self.__setup_priority + + def _set_setup_priority(self, v, load=False): + """ + Setter method for setup_priority, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/setup_priority (uint8) + If this variable is read-only (config: false) in the + source YANG file, then _set_setup_priority is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_setup_priority() directly. + + YANG Description: TE LSP requested setup priority. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..7']}), default=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8)(7), is_leaf=True, yang_name="setup-priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint8', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """setup_priority must be of a type compatible with uint8""", + 'defined-type': "uint8", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..7']}), default=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8)(7), is_leaf=True, yang_name="setup-priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint8', is_config=True)""", + }) + + self.__setup_priority = t + if hasattr(self, '_set'): + self._set() + + def _unset_setup_priority(self): + self.__setup_priority = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..7']}), default=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8)(7), is_leaf=True, yang_name="setup-priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint8', is_config=True) + + + def _get_hold_priority(self): + """ + Getter method for hold_priority, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/hold_priority (uint8) + + YANG Description: TE LSP requested hold priority. + """ + return self.__hold_priority + + def _set_hold_priority(self, v, load=False): + """ + Setter method for hold_priority, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/hold_priority (uint8) + If this variable is read-only (config: false) in the + source YANG file, then _set_hold_priority is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hold_priority() directly. + + YANG Description: TE LSP requested hold priority. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..7']}), default=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8)(7), is_leaf=True, yang_name="hold-priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint8', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hold_priority must be of a type compatible with uint8""", + 'defined-type': "uint8", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..7']}), default=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8)(7), is_leaf=True, yang_name="hold-priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint8', is_config=True)""", + }) + + self.__hold_priority = t + if hasattr(self, '_set'): + self._set() + + def _unset_hold_priority(self): + self.__hold_priority = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..7']}), default=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8)(7), is_leaf=True, yang_name="hold-priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint8', is_config=True) + + + def _get_signaling_type(self): + """ + Getter method for signaling_type, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/signaling_type (identityref) + + YANG Description: TE tunnel path signaling type. + """ + return self.__signaling_type + + def _set_signaling_type(self, v, load=False): + """ + Setter method for signaling_type, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/signaling_type (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_signaling_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_signaling_type() directly. + + YANG Description: TE tunnel path signaling type. + """ + 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={'path-setup-static': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-setup-static': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-setup-static': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-setup-rsvp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-setup-rsvp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-setup-rsvp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-setup-sr': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-setup-sr': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-setup-sr': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), default=six.text_type("te-types:path-setup-rsvp"), is_leaf=True, yang_name="signaling-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """signaling_type must be of a type compatible with identityref""", + 'defined-type': "ietf-te-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'path-setup-static': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-setup-static': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-setup-static': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-setup-rsvp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-setup-rsvp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-setup-rsvp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-setup-sr': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-setup-sr': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-setup-sr': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), default=six.text_type("te-types:path-setup-rsvp"), is_leaf=True, yang_name="signaling-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True)""", + }) + + self.__signaling_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_signaling_type(self): + self.__signaling_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'path-setup-static': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-setup-static': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-setup-static': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-setup-rsvp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-setup-rsvp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-setup-rsvp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-setup-sr': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-setup-sr': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-setup-sr': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), default=six.text_type("te-types:path-setup-rsvp"), is_leaf=True, yang_name="signaling-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + + + def _get_path_metric_bounds(self): + """ + Getter method for path_metric_bounds, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/path_metric_bounds (container) + + YANG Description: TE path metric bounds container. + """ + return self.__path_metric_bounds + + def _set_path_metric_bounds(self, v, load=False): + """ + Setter method for path_metric_bounds, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/path_metric_bounds (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_metric_bounds is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_metric_bounds() directly. + + YANG Description: TE path metric bounds container. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=path_metric_bounds.path_metric_bounds, is_container='container', yang_name="path-metric-bounds", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_metric_bounds must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=path_metric_bounds.path_metric_bounds, is_container='container', yang_name="path-metric-bounds", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__path_metric_bounds = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_metric_bounds(self): + self.__path_metric_bounds = YANGDynClass(base=path_metric_bounds.path_metric_bounds, is_container='container', yang_name="path-metric-bounds", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_path_affinities_values(self): + """ + Getter method for path_affinities_values, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/path_affinities_values (container) + + YANG Description: Path affinities represented as values. + """ + return self.__path_affinities_values + + def _set_path_affinities_values(self, v, load=False): + """ + Setter method for path_affinities_values, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/path_affinities_values (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_affinities_values is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_affinities_values() directly. + + YANG Description: Path affinities represented as values. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=path_affinities_values.path_affinities_values, is_container='container', yang_name="path-affinities-values", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_affinities_values must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=path_affinities_values.path_affinities_values, is_container='container', yang_name="path-affinities-values", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__path_affinities_values = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_affinities_values(self): + self.__path_affinities_values = YANGDynClass(base=path_affinities_values.path_affinities_values, is_container='container', yang_name="path-affinities-values", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_path_affinity_names(self): + """ + Getter method for path_affinity_names, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/path_affinity_names (container) + + YANG Description: Path affinities represented as names. + """ + return self.__path_affinity_names + + def _set_path_affinity_names(self, v, load=False): + """ + Setter method for path_affinity_names, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/path_affinity_names (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_affinity_names is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_affinity_names() directly. + + YANG Description: Path affinities represented as names. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=path_affinity_names.path_affinity_names, is_container='container', yang_name="path-affinity-names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_affinity_names must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=path_affinity_names.path_affinity_names, is_container='container', yang_name="path-affinity-names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__path_affinity_names = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_affinity_names(self): + self.__path_affinity_names = YANGDynClass(base=path_affinity_names.path_affinity_names, is_container='container', yang_name="path-affinity-names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_path_srlgs_lists(self): + """ + Getter method for path_srlgs_lists, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/path_srlgs_lists (container) + + YANG Description: Path SRLG properties container. + """ + return self.__path_srlgs_lists + + def _set_path_srlgs_lists(self, v, load=False): + """ + Setter method for path_srlgs_lists, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/path_srlgs_lists (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_srlgs_lists is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_srlgs_lists() directly. + + YANG Description: Path SRLG properties container. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=path_srlgs_lists.path_srlgs_lists, is_container='container', yang_name="path-srlgs-lists", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_srlgs_lists must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=path_srlgs_lists.path_srlgs_lists, is_container='container', yang_name="path-srlgs-lists", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__path_srlgs_lists = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_srlgs_lists(self): + self.__path_srlgs_lists = YANGDynClass(base=path_srlgs_lists.path_srlgs_lists, is_container='container', yang_name="path-srlgs-lists", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_path_srlgs_names(self): + """ + Getter method for path_srlgs_names, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/path_srlgs_names (container) + + YANG Description: Container for the list of named SRLGs. + """ + return self.__path_srlgs_names + + def _set_path_srlgs_names(self, v, load=False): + """ + Setter method for path_srlgs_names, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/path_srlgs_names (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_srlgs_names is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_srlgs_names() directly. + + YANG Description: Container for the list of named SRLGs. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=path_srlgs_names.path_srlgs_names, is_container='container', yang_name="path-srlgs-names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_srlgs_names must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=path_srlgs_names.path_srlgs_names, is_container='container', yang_name="path-srlgs-names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__path_srlgs_names = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_srlgs_names(self): + self.__path_srlgs_names = YANGDynClass(base=path_srlgs_names.path_srlgs_names, is_container='container', yang_name="path-srlgs-names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_disjointness(self): + """ + Getter method for disjointness, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/disjointness (te-path-disjointness) + + YANG Description: The type of resource disjointness. +When configured for a primary path, the disjointness level +applies to all secondary LSPs. When configured for a +secondary path, the disjointness level overrides the level +configured for the primary path. + """ + return self.__disjointness + + def _set_disjointness(self, v, load=False): + """ + Setter method for disjointness, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/disjointness (te-path-disjointness) + If this variable is read-only (config: false) in the + source YANG file, then _set_disjointness is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_disjointness() directly. + + YANG Description: The type of resource disjointness. +When configured for a primary path, the disjointness level +applies to all secondary LSPs. When configured for a +secondary path, the disjointness level overrides the level +configured for the primary path. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBitsType(allowed_bits={'node': '0', 'link': '1', 'srlg': '2'}), is_leaf=True, yang_name="disjointness", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-path-disjointness', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """disjointness must be of a type compatible with te-path-disjointness""", + 'defined-type': "ietf-te-topology:te-path-disjointness", + 'generated-type': """YANGDynClass(base=YANGBitsType(allowed_bits={'node': '0', 'link': '1', 'srlg': '2'}), is_leaf=True, yang_name="disjointness", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-path-disjointness', is_config=True)""", + }) + + self.__disjointness = t + if hasattr(self, '_set'): + self._set() + + def _unset_disjointness(self): + self.__disjointness = YANGDynClass(base=YANGBitsType(allowed_bits={'node': '0', 'link': '1', 'srlg': '2'}), is_leaf=True, yang_name="disjointness", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-path-disjointness', is_config=True) + + te_bandwidth = __builtin__.property(_get_te_bandwidth, _set_te_bandwidth) + link_protection = __builtin__.property(_get_link_protection, _set_link_protection) + setup_priority = __builtin__.property(_get_setup_priority, _set_setup_priority) + hold_priority = __builtin__.property(_get_hold_priority, _set_hold_priority) + signaling_type = __builtin__.property(_get_signaling_type, _set_signaling_type) + path_metric_bounds = __builtin__.property(_get_path_metric_bounds, _set_path_metric_bounds) + path_affinities_values = __builtin__.property(_get_path_affinities_values, _set_path_affinities_values) + path_affinity_names = __builtin__.property(_get_path_affinity_names, _set_path_affinity_names) + path_srlgs_lists = __builtin__.property(_get_path_srlgs_lists, _set_path_srlgs_lists) + path_srlgs_names = __builtin__.property(_get_path_srlgs_names, _set_path_srlgs_names) + disjointness = __builtin__.property(_get_disjointness, _set_disjointness) + + + _pyangbind_elements = OrderedDict([('te_bandwidth', te_bandwidth), ('link_protection', link_protection), ('setup_priority', setup_priority), ('hold_priority', hold_priority), ('signaling_type', signaling_type), ('path_metric_bounds', path_metric_bounds), ('path_affinities_values', path_affinities_values), ('path_affinity_names', path_affinity_names), ('path_srlgs_lists', path_srlgs_lists), ('path_srlgs_names', path_srlgs_names), ('disjointness', disjointness), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/path_affinities_values/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/path_affinities_values/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..9e3265c0729d76820783333b4db0fa0b49c60f46 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/path_affinities_values/__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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 path_affinities_value +class path_affinities_values(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/local-link-connectivity/path-constraints/path-affinities-values. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Path affinities represented as values. + """ + __slots__ = ('_path_helper', '_extmethods', '__path_affinities_value',) + + _yang_name = 'path-affinities-values' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__path_affinities_value = YANGDynClass(base=YANGListType("usage",path_affinities_value.path_affinities_value, yang_name="path-affinities-value", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-affinities-value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-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 ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'local-link-connectivity', 'path-constraints', 'path-affinities-values'] + + def _get_path_affinities_value(self): + """ + Getter method for path_affinities_value, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/path_affinities_values/path_affinities_value (list) + + YANG Description: List of named affinity constraints. + """ + return self.__path_affinities_value + + def _set_path_affinities_value(self, v, load=False): + """ + Setter method for path_affinities_value, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/path_affinities_values/path_affinities_value (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_affinities_value is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_affinities_value() directly. + + YANG Description: List of named affinity constraints. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("usage",path_affinities_value.path_affinities_value, yang_name="path-affinities-value", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-affinities-value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_affinities_value must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("usage",path_affinities_value.path_affinities_value, yang_name="path-affinities-value", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-affinities-value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True)""", + }) + + self.__path_affinities_value = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_affinities_value(self): + self.__path_affinities_value = YANGDynClass(base=YANGListType("usage",path_affinities_value.path_affinities_value, yang_name="path-affinities-value", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-affinities-value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + + path_affinities_value = __builtin__.property(_get_path_affinities_value, _set_path_affinities_value) + + + _pyangbind_elements = OrderedDict([('path_affinities_value', path_affinities_value), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/path_affinities_values/path_affinities_value/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/path_affinities_values/path_affinities_value/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..8d6c0465d7071071b70e7292196d934bea81fe4f --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/path_affinities_values/path_affinities_value/__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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 path_affinities_value(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/local-link-connectivity/path-constraints/path-affinities-values/path-affinities-value. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: List of named affinity constraints. + """ + __slots__ = ('_path_helper', '_extmethods', '__usage','__value',) + + _yang_name = 'path-affinities-value' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__usage = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + self.__value = YANGDynClass(base=[RestrictedClassType(base_type=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}), restriction_dict={'length': ['1..11']}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}),], default=six.text_type(""), is_leaf=True, yang_name="value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='admin-groups', 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 ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'local-link-connectivity', 'path-constraints', 'path-affinities-values', 'path-affinities-value'] + + def _get_usage(self): + """ + Getter method for usage, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/path_affinities_values/path_affinities_value/usage (identityref) + + YANG Description: Identifies an entry in the list of value affinity +constraints. + """ + return self.__usage + + def _set_usage(self, v, load=False): + """ + Setter method for usage, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/path_affinities_values/path_affinities_value/usage (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_usage is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_usage() directly. + + YANG Description: Identifies an entry in the list of value affinity +constraints. + """ + 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=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """usage must be of a type compatible with identityref""", + 'defined-type': "ietf-te-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True)""", + }) + + self.__usage = t + if hasattr(self, '_set'): + self._set() + + def _unset_usage(self): + self.__usage = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + + + def _get_value(self): + """ + Getter method for value, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/path_affinities_values/path_affinities_value/value (admin-groups) + + YANG Description: The affinity value. The default is empty. + """ + return self.__value + + def _set_value(self, v, load=False): + """ + Setter method for value, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/path_affinities_values/path_affinities_value/value (admin-groups) + 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: The affinity value. The default is empty. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=[RestrictedClassType(base_type=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}), restriction_dict={'length': ['1..11']}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}),], default=six.text_type(""), is_leaf=True, yang_name="value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='admin-groups', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """value must be of a type compatible with admin-groups""", + 'defined-type': "ietf-te-topology:admin-groups", + 'generated-type': """YANGDynClass(base=[RestrictedClassType(base_type=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}), restriction_dict={'length': ['1..11']}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}),], default=six.text_type(""), is_leaf=True, yang_name="value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='admin-groups', is_config=True)""", + }) + + self.__value = t + if hasattr(self, '_set'): + self._set() + + def _unset_value(self): + self.__value = YANGDynClass(base=[RestrictedClassType(base_type=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}), restriction_dict={'length': ['1..11']}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}),], default=six.text_type(""), is_leaf=True, yang_name="value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='admin-groups', is_config=True) + + usage = __builtin__.property(_get_usage, _set_usage) + value = __builtin__.property(_get_value, _set_value) + + + _pyangbind_elements = OrderedDict([('usage', usage), ('value', value), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/path_affinity_names/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/path_affinity_names/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..93c042152835d0343828db33f1ccbdcc9fd0e712 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/path_affinity_names/__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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 path_affinity_name +class path_affinity_names(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/local-link-connectivity/path-constraints/path-affinity-names. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Path affinities represented as names. + """ + __slots__ = ('_path_helper', '_extmethods', '__path_affinity_name',) + + _yang_name = 'path-affinity-names' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__path_affinity_name = YANGDynClass(base=YANGListType("usage",path_affinity_name.path_affinity_name, yang_name="path-affinity-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-affinity-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-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 ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'local-link-connectivity', 'path-constraints', 'path-affinity-names'] + + def _get_path_affinity_name(self): + """ + Getter method for path_affinity_name, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/path_affinity_names/path_affinity_name (list) + + YANG Description: List of named affinity constraints. + """ + return self.__path_affinity_name + + def _set_path_affinity_name(self, v, load=False): + """ + Setter method for path_affinity_name, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/path_affinity_names/path_affinity_name (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_affinity_name is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_affinity_name() directly. + + YANG Description: List of named affinity constraints. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("usage",path_affinity_name.path_affinity_name, yang_name="path-affinity-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-affinity-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_affinity_name must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("usage",path_affinity_name.path_affinity_name, yang_name="path-affinity-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-affinity-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True)""", + }) + + self.__path_affinity_name = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_affinity_name(self): + self.__path_affinity_name = YANGDynClass(base=YANGListType("usage",path_affinity_name.path_affinity_name, yang_name="path-affinity-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-affinity-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + + path_affinity_name = __builtin__.property(_get_path_affinity_name, _set_path_affinity_name) + + + _pyangbind_elements = OrderedDict([('path_affinity_name', path_affinity_name), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/path_affinity_names/path_affinity_name/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/path_affinity_names/path_affinity_name/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..8f1e020959c1d9b22eeeaa6ca728765d5e967e0d --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/path_affinity_names/path_affinity_name/__init__.py @@ -0,0 +1,162 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 affinity_name +class path_affinity_name(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/local-link-connectivity/path-constraints/path-affinity-names/path-affinity-name. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: List of named affinity constraints. + """ + __slots__ = ('_path_helper', '_extmethods', '__usage','__affinity_name',) + + _yang_name = 'path-affinity-name' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__usage = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + self.__affinity_name = YANGDynClass(base=YANGListType("name",affinity_name.affinity_name, yang_name="affinity-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='name', extensions=None), is_container='list', yang_name="affinity-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-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 ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'local-link-connectivity', 'path-constraints', 'path-affinity-names', 'path-affinity-name'] + + def _get_usage(self): + """ + Getter method for usage, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/path_affinity_names/path_affinity_name/usage (identityref) + + YANG Description: Identifies an entry in the list of named affinity +constraints. + """ + return self.__usage + + def _set_usage(self, v, load=False): + """ + Setter method for usage, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/path_affinity_names/path_affinity_name/usage (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_usage is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_usage() directly. + + YANG Description: Identifies an entry in the list of named affinity +constraints. + """ + 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=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """usage must be of a type compatible with identityref""", + 'defined-type': "ietf-te-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True)""", + }) + + self.__usage = t + if hasattr(self, '_set'): + self._set() + + def _unset_usage(self): + self.__usage = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + + + def _get_affinity_name(self): + """ + Getter method for affinity_name, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/path_affinity_names/path_affinity_name/affinity_name (list) + + YANG Description: List of named affinities. + """ + return self.__affinity_name + + def _set_affinity_name(self, v, load=False): + """ + Setter method for affinity_name, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/path_affinity_names/path_affinity_name/affinity_name (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_affinity_name is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_affinity_name() directly. + + YANG Description: List of named affinities. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("name",affinity_name.affinity_name, yang_name="affinity-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='name', extensions=None), is_container='list', yang_name="affinity-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """affinity_name must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("name",affinity_name.affinity_name, yang_name="affinity-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='name', extensions=None), is_container='list', yang_name="affinity-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True)""", + }) + + self.__affinity_name = t + if hasattr(self, '_set'): + self._set() + + def _unset_affinity_name(self): + self.__affinity_name = YANGDynClass(base=YANGListType("name",affinity_name.affinity_name, yang_name="affinity-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='name', extensions=None), is_container='list', yang_name="affinity-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + + usage = __builtin__.property(_get_usage, _set_usage) + affinity_name = __builtin__.property(_get_affinity_name, _set_affinity_name) + + + _pyangbind_elements = OrderedDict([('usage', usage), ('affinity_name', affinity_name), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/path_affinity_names/path_affinity_name/affinity_name/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/path_affinity_names/path_affinity_name/affinity_name/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..84a532259c1bf948a93bf5e76256cc75a7159567 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/path_affinity_names/path_affinity_name/affinity_name/__init__.py @@ -0,0 +1,120 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 affinity_name(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/local-link-connectivity/path-constraints/path-affinity-names/path-affinity-name/affinity-name. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: List of named affinities. + """ + __slots__ = ('_path_helper', '_extmethods', '__name',) + + _yang_name = 'affinity-name' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _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='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-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 ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'local-link-connectivity', 'path-constraints', 'path-affinity-names', 'path-affinity-name', 'affinity-name'] + + def _get_name(self): + """ + Getter method for name, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/path_affinity_names/path_affinity_name/affinity_name/name (string) + + YANG Description: Identifies a named affinity entry. + """ + return self.__name + + def _set_name(self, v, load=False): + """ + Setter method for name, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/path_affinity_names/path_affinity_name/affinity_name/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: Identifies a named affinity entry. + """ + 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='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', 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, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', 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, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=True) + + name = __builtin__.property(_get_name, _set_name) + + + _pyangbind_elements = OrderedDict([('name', name), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/path_metric_bounds/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/path_metric_bounds/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..62154c4c0deac0a7b49e13cae45e760e872d0716 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/path_metric_bounds/__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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 path_metric_bound +class path_metric_bounds(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/local-link-connectivity/path-constraints/path-metric-bounds. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: TE path metric bounds container. + """ + __slots__ = ('_path_helper', '_extmethods', '__path_metric_bound',) + + _yang_name = 'path-metric-bounds' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__path_metric_bound = YANGDynClass(base=YANGListType("metric_type",path_metric_bound.path_metric_bound, yang_name="path-metric-bound", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='metric-type', extensions=None), is_container='list', yang_name="path-metric-bound", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-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 ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'local-link-connectivity', 'path-constraints', 'path-metric-bounds'] + + def _get_path_metric_bound(self): + """ + Getter method for path_metric_bound, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/path_metric_bounds/path_metric_bound (list) + + YANG Description: List of TE path metric bounds. + """ + return self.__path_metric_bound + + def _set_path_metric_bound(self, v, load=False): + """ + Setter method for path_metric_bound, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/path_metric_bounds/path_metric_bound (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_metric_bound is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_metric_bound() directly. + + YANG Description: List of TE path metric bounds. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("metric_type",path_metric_bound.path_metric_bound, yang_name="path-metric-bound", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='metric-type', extensions=None), is_container='list', yang_name="path-metric-bound", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_metric_bound must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("metric_type",path_metric_bound.path_metric_bound, yang_name="path-metric-bound", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='metric-type', extensions=None), is_container='list', yang_name="path-metric-bound", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True)""", + }) + + self.__path_metric_bound = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_metric_bound(self): + self.__path_metric_bound = YANGDynClass(base=YANGListType("metric_type",path_metric_bound.path_metric_bound, yang_name="path-metric-bound", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='metric-type', extensions=None), is_container='list', yang_name="path-metric-bound", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + + path_metric_bound = __builtin__.property(_get_path_metric_bound, _set_path_metric_bound) + + + _pyangbind_elements = OrderedDict([('path_metric_bound', path_metric_bound), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/path_metric_bounds/path_metric_bound/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/path_metric_bounds/path_metric_bound/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..61dd53dffe3102ad34f4a1a9db4ef7df9b306171 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/path_metric_bounds/path_metric_bound/__init__.py @@ -0,0 +1,165 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 path_metric_bound(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/local-link-connectivity/path-constraints/path-metric-bounds/path-metric-bound. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: List of TE path metric bounds. + """ + __slots__ = ('_path_helper', '_extmethods', '__metric_type','__upper_bound',) + + _yang_name = 'path-metric-bound' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__metric_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="metric-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + self.__upper_bound = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), default=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64)(0), is_leaf=True, yang_name="upper-bound", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint64', 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 ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'local-link-connectivity', 'path-constraints', 'path-metric-bounds', 'path-metric-bound'] + + def _get_metric_type(self): + """ + Getter method for metric_type, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/path_metric_bounds/path_metric_bound/metric_type (identityref) + + YANG Description: Identifies an entry in the list of 'metric-type' items +bound for the TE path. + """ + return self.__metric_type + + def _set_metric_type(self, v, load=False): + """ + Setter method for metric_type, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/path_metric_bounds/path_metric_bound/metric_type (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_metric_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_metric_type() directly. + + YANG Description: Identifies an entry in the list of 'metric-type' items +bound for the TE path. + """ + 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=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="metric-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """metric_type must be of a type compatible with identityref""", + 'defined-type': "ietf-te-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="metric-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True)""", + }) + + self.__metric_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_metric_type(self): + self.__metric_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="metric-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + + + def _get_upper_bound(self): + """ + Getter method for upper_bound, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/path_metric_bounds/path_metric_bound/upper_bound (uint64) + + YANG Description: Upper bound on the end-to-end TE path metric. A zero +indicates an unbounded upper limit for the specific +'metric-type'. + """ + return self.__upper_bound + + def _set_upper_bound(self, v, load=False): + """ + Setter method for upper_bound, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/path_metric_bounds/path_metric_bound/upper_bound (uint64) + If this variable is read-only (config: false) in the + source YANG file, then _set_upper_bound is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_upper_bound() directly. + + YANG Description: Upper bound on the end-to-end TE path metric. A zero +indicates an unbounded upper limit for the specific +'metric-type'. + """ + 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), default=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64)(0), is_leaf=True, yang_name="upper-bound", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint64', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """upper_bound 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), default=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64)(0), is_leaf=True, yang_name="upper-bound", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint64', is_config=True)""", + }) + + self.__upper_bound = t + if hasattr(self, '_set'): + self._set() + + def _unset_upper_bound(self): + self.__upper_bound = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), default=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64)(0), is_leaf=True, yang_name="upper-bound", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint64', is_config=True) + + metric_type = __builtin__.property(_get_metric_type, _set_metric_type) + upper_bound = __builtin__.property(_get_upper_bound, _set_upper_bound) + + + _pyangbind_elements = OrderedDict([('metric_type', metric_type), ('upper_bound', upper_bound), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/path_srlgs_lists/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/path_srlgs_lists/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..28e1d8c74eba76ce3fbe5f1e38cffd564a78282d --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/path_srlgs_lists/__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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 path_srlgs_list +class path_srlgs_lists(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/local-link-connectivity/path-constraints/path-srlgs-lists. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Path SRLG properties container. + """ + __slots__ = ('_path_helper', '_extmethods', '__path_srlgs_list',) + + _yang_name = 'path-srlgs-lists' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__path_srlgs_list = YANGDynClass(base=YANGListType("usage",path_srlgs_list.path_srlgs_list, yang_name="path-srlgs-list", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-srlgs-list", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-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 ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'local-link-connectivity', 'path-constraints', 'path-srlgs-lists'] + + def _get_path_srlgs_list(self): + """ + Getter method for path_srlgs_list, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/path_srlgs_lists/path_srlgs_list (list) + + YANG Description: List of SRLG values to be included or excluded. + """ + return self.__path_srlgs_list + + def _set_path_srlgs_list(self, v, load=False): + """ + Setter method for path_srlgs_list, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/path_srlgs_lists/path_srlgs_list (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_srlgs_list is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_srlgs_list() directly. + + YANG Description: List of SRLG values to be included or excluded. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("usage",path_srlgs_list.path_srlgs_list, yang_name="path-srlgs-list", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-srlgs-list", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_srlgs_list must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("usage",path_srlgs_list.path_srlgs_list, yang_name="path-srlgs-list", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-srlgs-list", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True)""", + }) + + self.__path_srlgs_list = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_srlgs_list(self): + self.__path_srlgs_list = YANGDynClass(base=YANGListType("usage",path_srlgs_list.path_srlgs_list, yang_name="path-srlgs-list", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-srlgs-list", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + + path_srlgs_list = __builtin__.property(_get_path_srlgs_list, _set_path_srlgs_list) + + + _pyangbind_elements = OrderedDict([('path_srlgs_list', path_srlgs_list), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/path_srlgs_lists/path_srlgs_list/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/path_srlgs_lists/path_srlgs_list/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..a41c502dbcedab66dbdb30dcb749e9895d3f88b1 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/path_srlgs_lists/path_srlgs_list/__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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 path_srlgs_list(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/local-link-connectivity/path-constraints/path-srlgs-lists/path-srlgs-list. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: List of SRLG values to be included or excluded. + """ + __slots__ = ('_path_helper', '_extmethods', '__usage','__values',) + + _yang_name = 'path-srlgs-list' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__usage = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + self.__values = YANGDynClass(unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32)), is_leaf=False, yang_name="values", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='srlg', 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 ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'local-link-connectivity', 'path-constraints', 'path-srlgs-lists', 'path-srlgs-list'] + + def _get_usage(self): + """ + Getter method for usage, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/path_srlgs_lists/path_srlgs_list/usage (identityref) + + YANG Description: Identifies an entry in a list of SRLGs to either +include or exclude. + """ + return self.__usage + + def _set_usage(self, v, load=False): + """ + Setter method for usage, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/path_srlgs_lists/path_srlgs_list/usage (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_usage is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_usage() directly. + + YANG Description: Identifies an entry in a list of SRLGs to either +include or exclude. + """ + 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=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """usage must be of a type compatible with identityref""", + 'defined-type': "ietf-te-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True)""", + }) + + self.__usage = t + if hasattr(self, '_set'): + self._set() + + def _unset_usage(self): + self.__usage = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + + + def _get_values(self): + """ + Getter method for values, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/path_srlgs_lists/path_srlgs_list/values (srlg) + + YANG Description: List of SRLG values. + """ + return self.__values + + def _set_values(self, v, load=False): + """ + Setter method for values, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/path_srlgs_lists/path_srlgs_list/values (srlg) + If this variable is read-only (config: false) in the + source YANG file, then _set_values is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_values() directly. + + YANG Description: List of SRLG values. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32)), is_leaf=False, yang_name="values", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='srlg', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """values must be of a type compatible with srlg""", + 'defined-type': "ietf-te-topology:srlg", + 'generated-type': """YANGDynClass(unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32)), is_leaf=False, yang_name="values", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='srlg', is_config=True)""", + }) + + self.__values = t + if hasattr(self, '_set'): + self._set() + + def _unset_values(self): + self.__values = YANGDynClass(unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32)), is_leaf=False, yang_name="values", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='srlg', is_config=True) + + usage = __builtin__.property(_get_usage, _set_usage) + values = __builtin__.property(_get_values, _set_values) + + + _pyangbind_elements = OrderedDict([('usage', usage), ('values', values), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/path_srlgs_names/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/path_srlgs_names/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..964651c73accfe8a8e3076374aae9fe673844c9f --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/path_srlgs_names/__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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 path_srlgs_name +class path_srlgs_names(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/local-link-connectivity/path-constraints/path-srlgs-names. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Container for the list of named SRLGs. + """ + __slots__ = ('_path_helper', '_extmethods', '__path_srlgs_name',) + + _yang_name = 'path-srlgs-names' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__path_srlgs_name = YANGDynClass(base=YANGListType("usage",path_srlgs_name.path_srlgs_name, yang_name="path-srlgs-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-srlgs-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-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 ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'local-link-connectivity', 'path-constraints', 'path-srlgs-names'] + + def _get_path_srlgs_name(self): + """ + Getter method for path_srlgs_name, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/path_srlgs_names/path_srlgs_name (list) + + YANG Description: List of named SRLGs to be included or excluded. + """ + return self.__path_srlgs_name + + def _set_path_srlgs_name(self, v, load=False): + """ + Setter method for path_srlgs_name, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/path_srlgs_names/path_srlgs_name (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_srlgs_name is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_srlgs_name() directly. + + YANG Description: List of named SRLGs to be included or excluded. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("usage",path_srlgs_name.path_srlgs_name, yang_name="path-srlgs-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-srlgs-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_srlgs_name must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("usage",path_srlgs_name.path_srlgs_name, yang_name="path-srlgs-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-srlgs-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True)""", + }) + + self.__path_srlgs_name = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_srlgs_name(self): + self.__path_srlgs_name = YANGDynClass(base=YANGListType("usage",path_srlgs_name.path_srlgs_name, yang_name="path-srlgs-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-srlgs-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + + path_srlgs_name = __builtin__.property(_get_path_srlgs_name, _set_path_srlgs_name) + + + _pyangbind_elements = OrderedDict([('path_srlgs_name', path_srlgs_name), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/path_srlgs_names/path_srlgs_name/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/path_srlgs_names/path_srlgs_name/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..2ae4647f9aecd4be075fa67d98d42765922081f9 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/path_srlgs_names/path_srlgs_name/__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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 path_srlgs_name(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/local-link-connectivity/path-constraints/path-srlgs-names/path-srlgs-name. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: List of named SRLGs to be included or excluded. + """ + __slots__ = ('_path_helper', '_extmethods', '__usage','__names',) + + _yang_name = 'path-srlgs-name' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__usage = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + self.__names = YANGDynClass(unique=True, base=TypedListType(allowed_type=six.text_type), is_leaf=False, yang_name="names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-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 ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'local-link-connectivity', 'path-constraints', 'path-srlgs-names', 'path-srlgs-name'] + + def _get_usage(self): + """ + Getter method for usage, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/path_srlgs_names/path_srlgs_name/usage (identityref) + + YANG Description: Identifies an entry in a list of named SRLGs to either +include or exclude. + """ + return self.__usage + + def _set_usage(self, v, load=False): + """ + Setter method for usage, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/path_srlgs_names/path_srlgs_name/usage (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_usage is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_usage() directly. + + YANG Description: Identifies an entry in a list of named SRLGs to either +include or exclude. + """ + 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=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """usage must be of a type compatible with identityref""", + 'defined-type': "ietf-te-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True)""", + }) + + self.__usage = t + if hasattr(self, '_set'): + self._set() + + def _unset_usage(self): + self.__usage = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + + + def _get_names(self): + """ + Getter method for names, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/path_srlgs_names/path_srlgs_name/names (string) + + YANG Description: List of named SRLGs. + """ + return self.__names + + def _set_names(self, v, load=False): + """ + Setter method for names, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/path_srlgs_names/path_srlgs_name/names (string) + If this variable is read-only (config: false) in the + source YANG file, then _set_names is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_names() directly. + + YANG Description: List of named SRLGs. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,unique=True, base=TypedListType(allowed_type=six.text_type), is_leaf=False, yang_name="names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """names must be of a type compatible with string""", + 'defined-type': "string", + 'generated-type': """YANGDynClass(unique=True, base=TypedListType(allowed_type=six.text_type), is_leaf=False, yang_name="names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=True)""", + }) + + self.__names = t + if hasattr(self, '_set'): + self._set() + + def _unset_names(self): + self.__names = YANGDynClass(unique=True, base=TypedListType(allowed_type=six.text_type), is_leaf=False, yang_name="names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=True) + + usage = __builtin__.property(_get_usage, _set_usage) + names = __builtin__.property(_get_names, _set_names) + + + _pyangbind_elements = OrderedDict([('usage', usage), ('names', names), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/te_bandwidth/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/te_bandwidth/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..9d086807ab378b0c94eabdecbca9da35137aa8f6 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/te_bandwidth/__init__.py @@ -0,0 +1,195 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 otn +class te_bandwidth(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/local-link-connectivity/path-constraints/te-bandwidth. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Container that specifies TE bandwidth. The choices +can be augmented for specific data-plane technologies. + """ + __slots__ = ('_path_helper', '_extmethods', '__generic','__otn','__eth_bandwidth',) + + _yang_name = 'te-bandwidth' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__generic = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+(,(0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+))*'}), is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-bandwidth', is_config=True) + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + self.__eth_bandwidth = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), restriction_dict={'range': ['0..10000000000']}), is_leaf=True, yang_name="eth-bandwidth", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint64', 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 ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'local-link-connectivity', 'path-constraints', 'te-bandwidth'] + + def _get_generic(self): + """ + Getter method for generic, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/te_bandwidth/generic (te-bandwidth) + + YANG Description: Bandwidth specified in a generic format. + """ + return self.__generic + + def _set_generic(self, v, load=False): + """ + Setter method for generic, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/te_bandwidth/generic (te-bandwidth) + If this variable is read-only (config: false) in the + source YANG file, then _set_generic is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_generic() directly. + + YANG Description: Bandwidth specified in a generic format. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+(,(0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+))*'}), is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-bandwidth', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """generic must be of a type compatible with te-bandwidth""", + 'defined-type': "ietf-te-topology:te-bandwidth", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+(,(0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+))*'}), is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-bandwidth', is_config=True)""", + }) + + self.__generic = t + if hasattr(self, '_set'): + self._set() + + def _unset_generic(self): + self.__generic = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+(,(0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+))*'}), is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-bandwidth', is_config=True) + + + def _get_otn(self): + """ + Getter method for otn, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/te_bandwidth/otn (container) + + YANG Description: Bandwidth attributes for OTN links + """ + return self.__otn + + def _set_otn(self, v, load=False): + """ + Setter method for otn, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/te_bandwidth/otn (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_otn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_otn() directly. + + YANG Description: Bandwidth attributes for OTN links + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """otn must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True)""", + }) + + self.__otn = t + if hasattr(self, '_set'): + self._set() + + def _unset_otn(self): + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + + + def _get_eth_bandwidth(self): + """ + Getter method for eth_bandwidth, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/te_bandwidth/eth_bandwidth (uint64) + + YANG Description: Available bandwith value expressed in kilobits per second + """ + return self.__eth_bandwidth + + def _set_eth_bandwidth(self, v, load=False): + """ + Setter method for eth_bandwidth, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/te_bandwidth/eth_bandwidth (uint64) + If this variable is read-only (config: false) in the + source YANG file, then _set_eth_bandwidth is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_eth_bandwidth() directly. + + YANG Description: Available bandwith value expressed in kilobits per second + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), restriction_dict={'range': ['0..10000000000']}), is_leaf=True, yang_name="eth-bandwidth", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint64', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """eth_bandwidth must be of a type compatible with uint64""", + 'defined-type': "uint64", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), restriction_dict={'range': ['0..10000000000']}), is_leaf=True, yang_name="eth-bandwidth", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint64', is_config=True)""", + }) + + self.__eth_bandwidth = t + if hasattr(self, '_set'): + self._set() + + def _unset_eth_bandwidth(self): + self.__eth_bandwidth = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), restriction_dict={'range': ['0..10000000000']}), is_leaf=True, yang_name="eth-bandwidth", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint64', is_config=True) + + generic = __builtin__.property(_get_generic, _set_generic) + otn = __builtin__.property(_get_otn, _set_otn) + eth_bandwidth = __builtin__.property(_get_eth_bandwidth, _set_eth_bandwidth) + + __choices__ = {'technology': {'generic': ['generic'], 'otn': ['otn'], 'eth': ['eth_bandwidth']}} + _pyangbind_elements = OrderedDict([('generic', generic), ('otn', otn), ('eth_bandwidth', eth_bandwidth), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/te_bandwidth/otn/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/te_bandwidth/otn/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..8edd4ebde41cc7fdd55ac3ea16fc07871fd719dd --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/te_bandwidth/otn/__init__.py @@ -0,0 +1,163 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 odulist +class otn(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/local-link-connectivity/path-constraints/te-bandwidth/otn. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Bandwidth attributes for OTN links + """ + __slots__ = ('_path_helper', '_extmethods', '__odulist','__odtu_flex_type',) + + _yang_name = 'otn' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__odulist = YANGDynClass(base=YANGListType("odu_type",odulist.odulist, yang_name="odulist", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='odu-type', extensions=None, choice=('technology', 'otn')), is_container='list', yang_name="odulist", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='list', is_config=True) + self.__odtu_flex_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'2': {}, '3': {}, '4': {}, 'Cn': {}},), is_leaf=True, yang_name="odtu-flex-type", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='l1-types:odtu-flex-type', 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 ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'local-link-connectivity', 'path-constraints', 'te-bandwidth', 'otn'] + + def _get_odulist(self): + """ + Getter method for odulist, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/te_bandwidth/otn/odulist (list) + + YANG Description: OTN bandwidth definition + """ + return self.__odulist + + def _set_odulist(self, v, load=False): + """ + Setter method for odulist, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/te_bandwidth/otn/odulist (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_odulist is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_odulist() directly. + + YANG Description: OTN bandwidth definition + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("odu_type",odulist.odulist, yang_name="odulist", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='odu-type', extensions=None, choice=('technology', 'otn')), is_container='list', yang_name="odulist", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='list', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """odulist must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("odu_type",odulist.odulist, yang_name="odulist", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='odu-type', extensions=None, choice=('technology', 'otn')), is_container='list', yang_name="odulist", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='list', is_config=True)""", + }) + + self.__odulist = t + if hasattr(self, '_set'): + self._set() + + def _unset_odulist(self): + self.__odulist = YANGDynClass(base=YANGListType("odu_type",odulist.odulist, yang_name="odulist", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='odu-type', extensions=None, choice=('technology', 'otn')), is_container='list', yang_name="odulist", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='list', is_config=True) + + + def _get_odtu_flex_type(self): + """ + Getter method for odtu_flex_type, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/te_bandwidth/otn/odtu_flex_type (l1-types:odtu-flex-type) + + YANG Description: The type of Optical Data Tributary Unit (ODTU) +whose nominal bitrate is used to compute the number of +Tributary Slots (TS) required by the ODUflex LSPs +set up along the underlay path of this OTN Local +Link Connectivyt entry. + """ + return self.__odtu_flex_type + + def _set_odtu_flex_type(self, v, load=False): + """ + Setter method for odtu_flex_type, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/te_bandwidth/otn/odtu_flex_type (l1-types:odtu-flex-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_odtu_flex_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_odtu_flex_type() directly. + + YANG Description: The type of Optical Data Tributary Unit (ODTU) +whose nominal bitrate is used to compute the number of +Tributary Slots (TS) required by the ODUflex LSPs +set up along the underlay path of this OTN Local +Link Connectivyt entry. + """ + 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={'2': {}, '3': {}, '4': {}, 'Cn': {}},), is_leaf=True, yang_name="odtu-flex-type", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='l1-types:odtu-flex-type', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """odtu_flex_type must be of a type compatible with l1-types:odtu-flex-type""", + 'defined-type': "l1-types:odtu-flex-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'2': {}, '3': {}, '4': {}, 'Cn': {}},), is_leaf=True, yang_name="odtu-flex-type", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='l1-types:odtu-flex-type', is_config=True)""", + }) + + self.__odtu_flex_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_odtu_flex_type(self): + self.__odtu_flex_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'2': {}, '3': {}, '4': {}, 'Cn': {}},), is_leaf=True, yang_name="odtu-flex-type", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='l1-types:odtu-flex-type', is_config=True) + + odulist = __builtin__.property(_get_odulist, _set_odulist) + odtu_flex_type = __builtin__.property(_get_odtu_flex_type, _set_odtu_flex_type) + + __choices__ = {'technology': {'otn': ['odulist', 'odtu_flex_type']}} + _pyangbind_elements = OrderedDict([('odulist', odulist), ('odtu_flex_type', odtu_flex_type), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/te_bandwidth/otn/odulist/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/te_bandwidth/otn/odulist/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..22a8a8f859f7c787bcf6899bdb2887fbadce9d62 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/te_bandwidth/otn/odulist/__init__.py @@ -0,0 +1,200 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 odulist(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/local-link-connectivity/path-constraints/te-bandwidth/otn/odulist. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: OTN bandwidth definition + """ + __slots__ = ('_path_helper', '_extmethods', '__odu_type','__number','__ts_number',) + + _yang_name = 'odulist' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__odu_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="odu-type", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + self.__number = YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), is_leaf=True, yang_name="number", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', is_config=True) + self.__ts_number = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts-number", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', 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 ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'local-link-connectivity', 'path-constraints', 'te-bandwidth', 'otn', 'odulist'] + + def _get_odu_type(self): + """ + Getter method for odu_type, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/te_bandwidth/otn/odulist/odu_type (identityref) + + YANG Description: ODU type + """ + return self.__odu_type + + def _set_odu_type(self, v, load=False): + """ + Setter method for odu_type, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/te_bandwidth/otn/odulist/odu_type (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_odu_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_odu_type() directly. + + YANG Description: ODU type + """ + 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=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="odu-type", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """odu_type must be of a type compatible with identityref""", + 'defined-type': "ietf-otn-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="odu-type", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True)""", + }) + + self.__odu_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_odu_type(self): + self.__odu_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="odu-type", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + + + def _get_number(self): + """ + Getter method for number, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/te_bandwidth/otn/odulist/number (uint16) + + YANG Description: Number of ODUs + """ + return self.__number + + def _set_number(self, v, load=False): + """ + Setter method for number, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/te_bandwidth/otn/odulist/number (uint16) + If this variable is read-only (config: false) in the + source YANG file, then _set_number is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_number() directly. + + YANG Description: Number of ODUs + """ + 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="number", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """number 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="number", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', is_config=True)""", + }) + + self.__number = t + if hasattr(self, '_set'): + self._set() + + def _unset_number(self): + self.__number = YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), is_leaf=True, yang_name="number", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', is_config=True) + + + def _get_ts_number(self): + """ + Getter method for ts_number, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/te_bandwidth/otn/odulist/ts_number (uint16) + + YANG Description: The number of Tributary Slots (TS) that +could be used by all the ODUflex LSPs. + """ + return self.__ts_number + + def _set_ts_number(self, v, load=False): + """ + Setter method for ts_number, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/te_bandwidth/otn/odulist/ts_number (uint16) + If this variable is read-only (config: false) in the + source YANG file, then _set_ts_number is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_ts_number() directly. + + YANG Description: The number of Tributary Slots (TS) that +could be used by all the ODUflex LSPs. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts-number", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """ts_number must be of a type compatible with uint16""", + 'defined-type': "uint16", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts-number", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', is_config=True)""", + }) + + self.__ts_number = t + if hasattr(self, '_set'): + self._set() + + def _unset_ts_number(self): + self.__ts_number = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts-number", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', is_config=True) + + odu_type = __builtin__.property(_get_odu_type, _set_odu_type) + number = __builtin__.property(_get_number, _set_number) + ts_number = __builtin__.property(_get_ts_number, _set_ts_number) + + __choices__ = {'technology': {'otn': ['odu_type', 'number', 'ts_number']}} + _pyangbind_elements = OrderedDict([('odu_type', odu_type), ('number', number), ('ts_number', ts_number), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..8d881474f2984fc4af3230caa846eb05d5a6342a --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/__init__.py @@ -0,0 +1,318 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 path_metric +from . import path_affinities_values +from . import path_affinity_names +from . import path_srlgs_lists +from . import path_srlgs_names +from . import path_route_objects +class path_properties(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/local-link-connectivity/path-properties. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: The TE path properties. + """ + __slots__ = ('_path_helper', '_extmethods', '__path_metric','__path_affinities_values','__path_affinity_names','__path_srlgs_lists','__path_srlgs_names','__path_route_objects',) + + _yang_name = 'path-properties' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__path_metric = YANGDynClass(base=YANGListType("metric_type",path_metric.path_metric, yang_name="path-metric", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='metric-type', extensions=None), is_container='list', yang_name="path-metric", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + self.__path_affinities_values = YANGDynClass(base=path_affinities_values.path_affinities_values, is_container='container', yang_name="path-affinities-values", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__path_affinity_names = YANGDynClass(base=path_affinity_names.path_affinity_names, is_container='container', yang_name="path-affinity-names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__path_srlgs_lists = YANGDynClass(base=path_srlgs_lists.path_srlgs_lists, is_container='container', yang_name="path-srlgs-lists", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__path_srlgs_names = YANGDynClass(base=path_srlgs_names.path_srlgs_names, is_container='container', yang_name="path-srlgs-names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__path_route_objects = YANGDynClass(base=path_route_objects.path_route_objects, is_container='container', yang_name="path-route-objects", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', 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 ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'local-link-connectivity', 'path-properties'] + + def _get_path_metric(self): + """ + Getter method for path_metric, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_metric (list) + + YANG Description: TE path metric type. + """ + return self.__path_metric + + def _set_path_metric(self, v, load=False): + """ + Setter method for path_metric, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_metric (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_metric is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_metric() directly. + + YANG Description: TE path metric type. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("metric_type",path_metric.path_metric, yang_name="path-metric", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='metric-type', extensions=None), is_container='list', yang_name="path-metric", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_metric must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("metric_type",path_metric.path_metric, yang_name="path-metric", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='metric-type', extensions=None), is_container='list', yang_name="path-metric", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False)""", + }) + + self.__path_metric = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_metric(self): + self.__path_metric = YANGDynClass(base=YANGListType("metric_type",path_metric.path_metric, yang_name="path-metric", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='metric-type', extensions=None), is_container='list', yang_name="path-metric", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + + + def _get_path_affinities_values(self): + """ + Getter method for path_affinities_values, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_affinities_values (container) + + YANG Description: Path affinities represented as values. + """ + return self.__path_affinities_values + + def _set_path_affinities_values(self, v, load=False): + """ + Setter method for path_affinities_values, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_affinities_values (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_affinities_values is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_affinities_values() directly. + + YANG Description: Path affinities represented as values. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=path_affinities_values.path_affinities_values, is_container='container', yang_name="path-affinities-values", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_affinities_values must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=path_affinities_values.path_affinities_values, is_container='container', yang_name="path-affinities-values", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__path_affinities_values = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_affinities_values(self): + self.__path_affinities_values = YANGDynClass(base=path_affinities_values.path_affinities_values, is_container='container', yang_name="path-affinities-values", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_path_affinity_names(self): + """ + Getter method for path_affinity_names, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_affinity_names (container) + + YANG Description: Path affinities represented as names. + """ + return self.__path_affinity_names + + def _set_path_affinity_names(self, v, load=False): + """ + Setter method for path_affinity_names, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_affinity_names (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_affinity_names is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_affinity_names() directly. + + YANG Description: Path affinities represented as names. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=path_affinity_names.path_affinity_names, is_container='container', yang_name="path-affinity-names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_affinity_names must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=path_affinity_names.path_affinity_names, is_container='container', yang_name="path-affinity-names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__path_affinity_names = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_affinity_names(self): + self.__path_affinity_names = YANGDynClass(base=path_affinity_names.path_affinity_names, is_container='container', yang_name="path-affinity-names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_path_srlgs_lists(self): + """ + Getter method for path_srlgs_lists, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_srlgs_lists (container) + + YANG Description: Path SRLG properties container. + """ + return self.__path_srlgs_lists + + def _set_path_srlgs_lists(self, v, load=False): + """ + Setter method for path_srlgs_lists, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_srlgs_lists (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_srlgs_lists is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_srlgs_lists() directly. + + YANG Description: Path SRLG properties container. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=path_srlgs_lists.path_srlgs_lists, is_container='container', yang_name="path-srlgs-lists", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_srlgs_lists must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=path_srlgs_lists.path_srlgs_lists, is_container='container', yang_name="path-srlgs-lists", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__path_srlgs_lists = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_srlgs_lists(self): + self.__path_srlgs_lists = YANGDynClass(base=path_srlgs_lists.path_srlgs_lists, is_container='container', yang_name="path-srlgs-lists", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_path_srlgs_names(self): + """ + Getter method for path_srlgs_names, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_srlgs_names (container) + + YANG Description: Container for the list of named SRLGs. + """ + return self.__path_srlgs_names + + def _set_path_srlgs_names(self, v, load=False): + """ + Setter method for path_srlgs_names, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_srlgs_names (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_srlgs_names is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_srlgs_names() directly. + + YANG Description: Container for the list of named SRLGs. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=path_srlgs_names.path_srlgs_names, is_container='container', yang_name="path-srlgs-names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_srlgs_names must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=path_srlgs_names.path_srlgs_names, is_container='container', yang_name="path-srlgs-names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__path_srlgs_names = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_srlgs_names(self): + self.__path_srlgs_names = YANGDynClass(base=path_srlgs_names.path_srlgs_names, is_container='container', yang_name="path-srlgs-names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_path_route_objects(self): + """ + Getter method for path_route_objects, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_route_objects (container) + + YANG Description: Container for the list of route objects either returned by +the computation engine or actually used by an LSP. + """ + return self.__path_route_objects + + def _set_path_route_objects(self, v, load=False): + """ + Setter method for path_route_objects, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_route_objects (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_route_objects is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_route_objects() directly. + + YANG Description: Container for the list of route objects either returned by +the computation engine or actually used by an LSP. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=path_route_objects.path_route_objects, is_container='container', yang_name="path-route-objects", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_route_objects must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=path_route_objects.path_route_objects, is_container='container', yang_name="path-route-objects", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__path_route_objects = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_route_objects(self): + self.__path_route_objects = YANGDynClass(base=path_route_objects.path_route_objects, is_container='container', yang_name="path-route-objects", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + path_metric = __builtin__.property(_get_path_metric) + path_affinities_values = __builtin__.property(_get_path_affinities_values) + path_affinity_names = __builtin__.property(_get_path_affinity_names) + path_srlgs_lists = __builtin__.property(_get_path_srlgs_lists) + path_srlgs_names = __builtin__.property(_get_path_srlgs_names) + path_route_objects = __builtin__.property(_get_path_route_objects) + + + _pyangbind_elements = OrderedDict([('path_metric', path_metric), ('path_affinities_values', path_affinities_values), ('path_affinity_names', path_affinity_names), ('path_srlgs_lists', path_srlgs_lists), ('path_srlgs_names', path_srlgs_names), ('path_route_objects', path_route_objects), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_affinities_values/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_affinities_values/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..3384b6a42e7ed530221f3ea1505e999fdefb73db --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_affinities_values/__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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 path_affinities_value +class path_affinities_values(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/local-link-connectivity/path-properties/path-affinities-values. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Path affinities represented as values. + """ + __slots__ = ('_path_helper', '_extmethods', '__path_affinities_value',) + + _yang_name = 'path-affinities-values' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__path_affinities_value = YANGDynClass(base=YANGListType("usage",path_affinities_value.path_affinities_value, yang_name="path-affinities-value", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-affinities-value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', 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 ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'local-link-connectivity', 'path-properties', 'path-affinities-values'] + + def _get_path_affinities_value(self): + """ + Getter method for path_affinities_value, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_affinities_values/path_affinities_value (list) + + YANG Description: List of named affinity constraints. + """ + return self.__path_affinities_value + + def _set_path_affinities_value(self, v, load=False): + """ + Setter method for path_affinities_value, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_affinities_values/path_affinities_value (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_affinities_value is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_affinities_value() directly. + + YANG Description: List of named affinity constraints. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("usage",path_affinities_value.path_affinities_value, yang_name="path-affinities-value", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-affinities-value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_affinities_value must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("usage",path_affinities_value.path_affinities_value, yang_name="path-affinities-value", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-affinities-value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False)""", + }) + + self.__path_affinities_value = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_affinities_value(self): + self.__path_affinities_value = YANGDynClass(base=YANGListType("usage",path_affinities_value.path_affinities_value, yang_name="path-affinities-value", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-affinities-value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + + path_affinities_value = __builtin__.property(_get_path_affinities_value) + + + _pyangbind_elements = OrderedDict([('path_affinities_value', path_affinities_value), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_affinities_values/path_affinities_value/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_affinities_values/path_affinities_value/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..626f7d24037391d083bb55c1b9135783954c867d --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_affinities_values/path_affinities_value/__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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 path_affinities_value(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/local-link-connectivity/path-properties/path-affinities-values/path-affinities-value. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: List of named affinity constraints. + """ + __slots__ = ('_path_helper', '_extmethods', '__usage','__value',) + + _yang_name = 'path-affinities-value' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__usage = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + self.__value = YANGDynClass(base=[RestrictedClassType(base_type=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}), restriction_dict={'length': ['1..11']}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}),], default=six.text_type(""), is_leaf=True, yang_name="value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='admin-groups', 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 ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'local-link-connectivity', 'path-properties', 'path-affinities-values', 'path-affinities-value'] + + def _get_usage(self): + """ + Getter method for usage, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_affinities_values/path_affinities_value/usage (identityref) + + YANG Description: Identifies an entry in the list of value affinity +constraints. + """ + return self.__usage + + def _set_usage(self, v, load=False): + """ + Setter method for usage, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_affinities_values/path_affinities_value/usage (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_usage is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_usage() directly. + + YANG Description: Identifies an entry in the list of value affinity +constraints. + """ + 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=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """usage must be of a type compatible with identityref""", + 'defined-type': "ietf-te-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False)""", + }) + + self.__usage = t + if hasattr(self, '_set'): + self._set() + + def _unset_usage(self): + self.__usage = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + + + def _get_value(self): + """ + Getter method for value, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_affinities_values/path_affinities_value/value (admin-groups) + + YANG Description: The affinity value. The default is empty. + """ + return self.__value + + def _set_value(self, v, load=False): + """ + Setter method for value, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_affinities_values/path_affinities_value/value (admin-groups) + 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: The affinity value. The default is empty. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=[RestrictedClassType(base_type=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}), restriction_dict={'length': ['1..11']}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}),], default=six.text_type(""), is_leaf=True, yang_name="value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='admin-groups', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """value must be of a type compatible with admin-groups""", + 'defined-type': "ietf-te-topology:admin-groups", + 'generated-type': """YANGDynClass(base=[RestrictedClassType(base_type=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}), restriction_dict={'length': ['1..11']}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}),], default=six.text_type(""), is_leaf=True, yang_name="value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='admin-groups', is_config=False)""", + }) + + self.__value = t + if hasattr(self, '_set'): + self._set() + + def _unset_value(self): + self.__value = YANGDynClass(base=[RestrictedClassType(base_type=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}), restriction_dict={'length': ['1..11']}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}),], default=six.text_type(""), is_leaf=True, yang_name="value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='admin-groups', is_config=False) + + usage = __builtin__.property(_get_usage) + value = __builtin__.property(_get_value) + + + _pyangbind_elements = OrderedDict([('usage', usage), ('value', value), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_affinity_names/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_affinity_names/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..3fc26577e1b13b6bee6537f99d5be9369fd3f3c6 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_affinity_names/__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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 path_affinity_name +class path_affinity_names(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/local-link-connectivity/path-properties/path-affinity-names. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Path affinities represented as names. + """ + __slots__ = ('_path_helper', '_extmethods', '__path_affinity_name',) + + _yang_name = 'path-affinity-names' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__path_affinity_name = YANGDynClass(base=YANGListType("usage",path_affinity_name.path_affinity_name, yang_name="path-affinity-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-affinity-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', 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 ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'local-link-connectivity', 'path-properties', 'path-affinity-names'] + + def _get_path_affinity_name(self): + """ + Getter method for path_affinity_name, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_affinity_names/path_affinity_name (list) + + YANG Description: List of named affinity constraints. + """ + return self.__path_affinity_name + + def _set_path_affinity_name(self, v, load=False): + """ + Setter method for path_affinity_name, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_affinity_names/path_affinity_name (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_affinity_name is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_affinity_name() directly. + + YANG Description: List of named affinity constraints. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("usage",path_affinity_name.path_affinity_name, yang_name="path-affinity-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-affinity-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_affinity_name must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("usage",path_affinity_name.path_affinity_name, yang_name="path-affinity-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-affinity-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False)""", + }) + + self.__path_affinity_name = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_affinity_name(self): + self.__path_affinity_name = YANGDynClass(base=YANGListType("usage",path_affinity_name.path_affinity_name, yang_name="path-affinity-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-affinity-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + + path_affinity_name = __builtin__.property(_get_path_affinity_name) + + + _pyangbind_elements = OrderedDict([('path_affinity_name', path_affinity_name), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_affinity_names/path_affinity_name/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_affinity_names/path_affinity_name/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..63035d44dd3fdd4b30b37bd16b316b8f90e31b0b --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_affinity_names/path_affinity_name/__init__.py @@ -0,0 +1,162 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 affinity_name +class path_affinity_name(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/local-link-connectivity/path-properties/path-affinity-names/path-affinity-name. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: List of named affinity constraints. + """ + __slots__ = ('_path_helper', '_extmethods', '__usage','__affinity_name',) + + _yang_name = 'path-affinity-name' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__usage = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + self.__affinity_name = YANGDynClass(base=YANGListType("name",affinity_name.affinity_name, yang_name="affinity-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='name', extensions=None), is_container='list', yang_name="affinity-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', 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 ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'local-link-connectivity', 'path-properties', 'path-affinity-names', 'path-affinity-name'] + + def _get_usage(self): + """ + Getter method for usage, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_affinity_names/path_affinity_name/usage (identityref) + + YANG Description: Identifies an entry in the list of named affinity +constraints. + """ + return self.__usage + + def _set_usage(self, v, load=False): + """ + Setter method for usage, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_affinity_names/path_affinity_name/usage (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_usage is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_usage() directly. + + YANG Description: Identifies an entry in the list of named affinity +constraints. + """ + 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=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """usage must be of a type compatible with identityref""", + 'defined-type': "ietf-te-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False)""", + }) + + self.__usage = t + if hasattr(self, '_set'): + self._set() + + def _unset_usage(self): + self.__usage = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + + + def _get_affinity_name(self): + """ + Getter method for affinity_name, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_affinity_names/path_affinity_name/affinity_name (list) + + YANG Description: List of named affinities. + """ + return self.__affinity_name + + def _set_affinity_name(self, v, load=False): + """ + Setter method for affinity_name, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_affinity_names/path_affinity_name/affinity_name (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_affinity_name is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_affinity_name() directly. + + YANG Description: List of named affinities. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("name",affinity_name.affinity_name, yang_name="affinity-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='name', extensions=None), is_container='list', yang_name="affinity-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """affinity_name must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("name",affinity_name.affinity_name, yang_name="affinity-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='name', extensions=None), is_container='list', yang_name="affinity-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False)""", + }) + + self.__affinity_name = t + if hasattr(self, '_set'): + self._set() + + def _unset_affinity_name(self): + self.__affinity_name = YANGDynClass(base=YANGListType("name",affinity_name.affinity_name, yang_name="affinity-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='name', extensions=None), is_container='list', yang_name="affinity-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + + usage = __builtin__.property(_get_usage) + affinity_name = __builtin__.property(_get_affinity_name) + + + _pyangbind_elements = OrderedDict([('usage', usage), ('affinity_name', affinity_name), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_affinity_names/path_affinity_name/affinity_name/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_affinity_names/path_affinity_name/affinity_name/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..42383ee4d247fdfb6b351fad04628e72db2022e3 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_affinity_names/path_affinity_name/affinity_name/__init__.py @@ -0,0 +1,120 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 affinity_name(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/local-link-connectivity/path-properties/path-affinity-names/path-affinity-name/affinity-name. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: List of named affinities. + """ + __slots__ = ('_path_helper', '_extmethods', '__name',) + + _yang_name = 'affinity-name' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _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='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', 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 ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'local-link-connectivity', 'path-properties', 'path-affinity-names', 'path-affinity-name', 'affinity-name'] + + def _get_name(self): + """ + Getter method for name, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_affinity_names/path_affinity_name/affinity_name/name (string) + + YANG Description: Identifies a named affinity entry. + """ + return self.__name + + def _set_name(self, v, load=False): + """ + Setter method for name, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_affinity_names/path_affinity_name/affinity_name/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: Identifies a named affinity entry. + """ + 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='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', 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, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', 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, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=False) + + name = __builtin__.property(_get_name) + + + _pyangbind_elements = OrderedDict([('name', name), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_metric/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_metric/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..5a283282dbd0921574717dd049ba6ec7cdc435f2 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_metric/__init__.py @@ -0,0 +1,159 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 path_metric(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/local-link-connectivity/path-properties/path-metric. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: TE path metric type. + """ + __slots__ = ('_path_helper', '_extmethods', '__metric_type','__accumulative_value',) + + _yang_name = 'path-metric' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__metric_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="metric-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + self.__accumulative_value = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="accumulative-value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', 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 ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'local-link-connectivity', 'path-properties', 'path-metric'] + + def _get_metric_type(self): + """ + Getter method for metric_type, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_metric/metric_type (identityref) + + YANG Description: TE path metric type. + """ + return self.__metric_type + + def _set_metric_type(self, v, load=False): + """ + Setter method for metric_type, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_metric/metric_type (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_metric_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_metric_type() directly. + + YANG Description: TE path metric type. + """ + 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=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="metric-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """metric_type must be of a type compatible with identityref""", + 'defined-type': "ietf-te-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="metric-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False)""", + }) + + self.__metric_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_metric_type(self): + self.__metric_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="metric-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + + + def _get_accumulative_value(self): + """ + Getter method for accumulative_value, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_metric/accumulative_value (uint64) + + YANG Description: TE path metric accumulative value. + """ + return self.__accumulative_value + + def _set_accumulative_value(self, v, load=False): + """ + Setter method for accumulative_value, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_metric/accumulative_value (uint64) + If this variable is read-only (config: false) in the + source YANG file, then _set_accumulative_value is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_accumulative_value() directly. + + YANG Description: TE path metric accumulative value. + """ + 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="accumulative-value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint64', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """accumulative_value 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="accumulative-value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint64', is_config=False)""", + }) + + self.__accumulative_value = t + if hasattr(self, '_set'): + self._set() + + def _unset_accumulative_value(self): + self.__accumulative_value = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="accumulative-value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint64', is_config=False) + + metric_type = __builtin__.property(_get_metric_type) + accumulative_value = __builtin__.property(_get_accumulative_value) + + + _pyangbind_elements = OrderedDict([('metric_type', metric_type), ('accumulative_value', accumulative_value), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_route_objects/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_route_objects/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..425ac19d0ba2ad2089694efa68733b4a4df87be9 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_route_objects/__init__.py @@ -0,0 +1,119 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 path_route_object +class path_route_objects(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/local-link-connectivity/path-properties/path-route-objects. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Container for the list of route objects either returned by +the computation engine or actually used by an LSP. + """ + __slots__ = ('_path_helper', '_extmethods', '__path_route_object',) + + _yang_name = 'path-route-objects' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__path_route_object = YANGDynClass(base=YANGListType("index",path_route_object.path_route_object, yang_name="path-route-object", parent=self, is_container='list', user_ordered=True, path_helper=self._path_helper, yang_keys='index', extensions=None), is_container='list', yang_name="path-route-object", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', 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 ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'local-link-connectivity', 'path-properties', 'path-route-objects'] + + def _get_path_route_object(self): + """ + Getter method for path_route_object, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_route_objects/path_route_object (list) + + YANG Description: List of route objects either returned by the computation +engine or actually used by an LSP. + """ + return self.__path_route_object + + def _set_path_route_object(self, v, load=False): + """ + Setter method for path_route_object, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_route_objects/path_route_object (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_route_object is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_route_object() directly. + + YANG Description: List of route objects either returned by the computation +engine or actually used by an LSP. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("index",path_route_object.path_route_object, yang_name="path-route-object", parent=self, is_container='list', user_ordered=True, path_helper=self._path_helper, yang_keys='index', extensions=None), is_container='list', yang_name="path-route-object", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_route_object must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("index",path_route_object.path_route_object, yang_name="path-route-object", parent=self, is_container='list', user_ordered=True, path_helper=self._path_helper, yang_keys='index', extensions=None), is_container='list', yang_name="path-route-object", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False)""", + }) + + self.__path_route_object = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_route_object(self): + self.__path_route_object = YANGDynClass(base=YANGListType("index",path_route_object.path_route_object, yang_name="path-route-object", parent=self, is_container='list', user_ordered=True, path_helper=self._path_helper, yang_keys='index', extensions=None), is_container='list', yang_name="path-route-object", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + + path_route_object = __builtin__.property(_get_path_route_object) + + + _pyangbind_elements = OrderedDict([('path_route_object', path_route_object), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_route_objects/path_route_object/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_route_objects/path_route_object/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..abb7aee29bfcff96c141252b8b576eee2bc77580 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_route_objects/path_route_object/__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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 numbered_node_hop +from . import numbered_link_hop +from . import unnumbered_link_hop +from . import as_number_hop +from . import label_hop +class path_route_object(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/local-link-connectivity/path-properties/path-route-objects/path-route-object. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: List of route objects either returned by the computation +engine or actually used by an LSP. + """ + __slots__ = ('_path_helper', '_extmethods', '__index','__numbered_node_hop','__numbered_link_hop','__unnumbered_link_hop','__as_number_hop','__label_hop',) + + _yang_name = 'path-route-object' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _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), is_leaf=True, yang_name="index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=False) + self.__numbered_node_hop = YANGDynClass(base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__numbered_link_hop = YANGDynClass(base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__unnumbered_link_hop = YANGDynClass(base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__as_number_hop = YANGDynClass(base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__label_hop = YANGDynClass(base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', 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 ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'local-link-connectivity', 'path-properties', 'path-route-objects', 'path-route-object'] + + def _get_index(self): + """ + Getter method for index, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_route_objects/path_route_object/index (uint32) + + YANG Description: Route object entry index. The index is used to +identify an entry in the list. The order of entries +is defined by the user without relying on key +values. + """ + return self.__index + + def _set_index(self, v, load=False): + """ + Setter method for index, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_route_objects/path_route_object/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: Route object entry index. The index is used to +identify an entry in the list. The order of entries +is defined by the user without relying on key +values. + """ + 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=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', 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), is_leaf=True, yang_name="index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', 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), is_leaf=True, yang_name="index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=False) + + + def _get_numbered_node_hop(self): + """ + Getter method for numbered_node_hop, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_route_objects/path_route_object/numbered_node_hop (container) + + YANG Description: Numbered node route hop. + """ + return self.__numbered_node_hop + + def _set_numbered_node_hop(self, v, load=False): + """ + Setter method for numbered_node_hop, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_route_objects/path_route_object/numbered_node_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_numbered_node_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_numbered_node_hop() directly. + + YANG Description: Numbered node route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """numbered_node_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__numbered_node_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_numbered_node_hop(self): + self.__numbered_node_hop = YANGDynClass(base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_numbered_link_hop(self): + """ + Getter method for numbered_link_hop, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_route_objects/path_route_object/numbered_link_hop (container) + + YANG Description: Numbered link explicit route hop. + """ + return self.__numbered_link_hop + + def _set_numbered_link_hop(self, v, load=False): + """ + Setter method for numbered_link_hop, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_route_objects/path_route_object/numbered_link_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_numbered_link_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_numbered_link_hop() directly. + + YANG Description: Numbered link explicit route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """numbered_link_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__numbered_link_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_numbered_link_hop(self): + self.__numbered_link_hop = YANGDynClass(base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_unnumbered_link_hop(self): + """ + Getter method for unnumbered_link_hop, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_route_objects/path_route_object/unnumbered_link_hop (container) + + YANG Description: Unnumbered link explicit route hop. + """ + return self.__unnumbered_link_hop + + def _set_unnumbered_link_hop(self, v, load=False): + """ + Setter method for unnumbered_link_hop, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_route_objects/path_route_object/unnumbered_link_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_unnumbered_link_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_unnumbered_link_hop() directly. + + YANG Description: Unnumbered link explicit route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """unnumbered_link_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__unnumbered_link_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_unnumbered_link_hop(self): + self.__unnumbered_link_hop = YANGDynClass(base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_as_number_hop(self): + """ + Getter method for as_number_hop, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_route_objects/path_route_object/as_number_hop (container) + + YANG Description: AS explicit route hop. + """ + return self.__as_number_hop + + def _set_as_number_hop(self, v, load=False): + """ + Setter method for as_number_hop, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_route_objects/path_route_object/as_number_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_as_number_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_as_number_hop() directly. + + YANG Description: AS explicit route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """as_number_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__as_number_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_as_number_hop(self): + self.__as_number_hop = YANGDynClass(base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_label_hop(self): + """ + Getter method for label_hop, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_route_objects/path_route_object/label_hop (container) + + YANG Description: Label hop type. + """ + return self.__label_hop + + def _set_label_hop(self, v, load=False): + """ + Setter method for label_hop, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_route_objects/path_route_object/label_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_label_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_label_hop() directly. + + YANG Description: Label hop type. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """label_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__label_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_label_hop(self): + self.__label_hop = YANGDynClass(base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + index = __builtin__.property(_get_index) + numbered_node_hop = __builtin__.property(_get_numbered_node_hop) + numbered_link_hop = __builtin__.property(_get_numbered_link_hop) + unnumbered_link_hop = __builtin__.property(_get_unnumbered_link_hop) + as_number_hop = __builtin__.property(_get_as_number_hop) + label_hop = __builtin__.property(_get_label_hop) + + __choices__ = {'type': {'numbered-node-hop': ['numbered_node_hop'], 'numbered-link-hop': ['numbered_link_hop'], 'unnumbered-link-hop': ['unnumbered_link_hop'], 'as-number': ['as_number_hop'], 'label': ['label_hop']}} + _pyangbind_elements = OrderedDict([('index', index), ('numbered_node_hop', numbered_node_hop), ('numbered_link_hop', numbered_link_hop), ('unnumbered_link_hop', unnumbered_link_hop), ('as_number_hop', as_number_hop), ('label_hop', label_hop), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_route_objects/path_route_object/as_number_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_route_objects/path_route_object/as_number_hop/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..b3d293b8351e545985c03b1d6932795428635e61 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_route_objects/path_route_object/as_number_hop/__init__.py @@ -0,0 +1,154 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 as_number_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/local-link-connectivity/path-properties/path-route-objects/path-route-object/as-number-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: AS explicit route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__as_number','__hop_type',) + + _yang_name = 'as-number-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__as_number = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=False) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', 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 ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'local-link-connectivity', 'path-properties', 'path-route-objects', 'path-route-object', 'as-number-hop'] + + def _get_as_number(self): + """ + Getter method for as_number, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_route_objects/path_route_object/as_number_hop/as_number (inet:as-number) + + YANG Description: The Autonomous System (AS) number. + """ + return self.__as_number + + def _set_as_number(self, v, load=False): + """ + Setter method for as_number, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_route_objects/path_route_object/as_number_hop/as_number (inet:as-number) + If this variable is read-only (config: false) in the + source YANG file, then _set_as_number is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_as_number() directly. + + YANG Description: The Autonomous System (AS) number. + """ + 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="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """as_number must be of a type compatible with inet:as-number""", + 'defined-type': "inet:as-number", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=False)""", + }) + + self.__as_number = t + if hasattr(self, '_set'): + self._set() + + def _unset_as_number(self): + self.__as_number = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=False) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_route_objects/path_route_object/as_number_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_route_objects/path_route_object/as_number_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + 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={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + + as_number = __builtin__.property(_get_as_number) + hop_type = __builtin__.property(_get_hop_type) + + __choices__ = {'type': {'as-number': ['as_number', 'hop_type']}} + _pyangbind_elements = OrderedDict([('as_number', as_number), ('hop_type', hop_type), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_route_objects/path_route_object/label_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_route_objects/path_route_object/label_hop/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..10f4a55b7ebcaf51bc5be227c28139119e9638e6 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_route_objects/path_route_object/label_hop/__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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 te_label +class label_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/local-link-connectivity/path-properties/path-route-objects/path-route-object/label-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Label hop type. + """ + __slots__ = ('_path_helper', '_extmethods', '__te_label',) + + _yang_name = 'label-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__te_label = YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', 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 ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'local-link-connectivity', 'path-properties', 'path-route-objects', 'path-route-object', 'label-hop'] + + def _get_te_label(self): + """ + Getter method for te_label, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_route_objects/path_route_object/label_hop/te_label (container) + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + return self.__te_label + + def _set_te_label(self, v, load=False): + """ + Setter method for te_label, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_route_objects/path_route_object/label_hop/te_label (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_te_label is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_te_label() directly. + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """te_label must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__te_label = t + if hasattr(self, '_set'): + self._set() + + def _unset_te_label(self): + self.__te_label = YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + te_label = __builtin__.property(_get_te_label) + + __choices__ = {'type': {'label': ['te_label']}} + _pyangbind_elements = OrderedDict([('te_label', te_label), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_route_objects/path_route_object/label_hop/te_label/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_route_objects/path_route_object/label_hop/te_label/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..8764e4794ccf6b384a53d66c77dc2fd17bd202ea --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_route_objects/path_route_object/label_hop/te_label/__init__.py @@ -0,0 +1,234 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 otn +class te_label(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/local-link-connectivity/path-properties/path-route-objects/path-route-object/label-hop/te-label. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + __slots__ = ('_path_helper', '_extmethods', '__generic','__otn','__vlanid','__direction',) + + _yang_name = 'te-label' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__generic = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=False) + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False) + self.__vlanid = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=False) + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', 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 ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'local-link-connectivity', 'path-properties', 'path-route-objects', 'path-route-object', 'label-hop', 'te-label'] + + def _get_generic(self): + """ + Getter method for generic, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_route_objects/path_route_object/label_hop/te_label/generic (rt-types:generalized-label) + + YANG Description: TE label specified in a generic format. + """ + return self.__generic + + def _set_generic(self, v, load=False): + """ + Setter method for generic, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_route_objects/path_route_object/label_hop/te_label/generic (rt-types:generalized-label) + If this variable is read-only (config: false) in the + source YANG file, then _set_generic is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_generic() directly. + + YANG Description: TE label specified in a generic format. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """generic must be of a type compatible with rt-types:generalized-label""", + 'defined-type': "rt-types:generalized-label", + 'generated-type': """YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=False)""", + }) + + self.__generic = t + if hasattr(self, '_set'): + self._set() + + def _unset_generic(self): + self.__generic = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=False) + + + def _get_otn(self): + """ + Getter method for otn, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_route_objects/path_route_object/label_hop/te_label/otn (container) + + YANG Description: Label hop for OTN. + """ + return self.__otn + + def _set_otn(self, v, load=False): + """ + Setter method for otn, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_route_objects/path_route_object/label_hop/te_label/otn (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_otn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_otn() directly. + + YANG Description: Label hop for OTN. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """otn must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False)""", + }) + + self.__otn = t + if hasattr(self, '_set'): + self._set() + + def _unset_otn(self): + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False) + + + def _get_vlanid(self): + """ + Getter method for vlanid, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_route_objects/path_route_object/label_hop/te_label/vlanid (etht-types:vlanid) + + YANG Description: VLAN tag id. + """ + return self.__vlanid + + def _set_vlanid(self, v, load=False): + """ + Setter method for vlanid, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_route_objects/path_route_object/label_hop/te_label/vlanid (etht-types:vlanid) + If this variable is read-only (config: false) in the + source YANG file, then _set_vlanid is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_vlanid() directly. + + YANG Description: VLAN tag id. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """vlanid must be of a type compatible with etht-types:vlanid""", + 'defined-type': "etht-types:vlanid", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=False)""", + }) + + self.__vlanid = t + if hasattr(self, '_set'): + self._set() + + def _unset_vlanid(self): + self.__vlanid = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=False) + + + def _get_direction(self): + """ + Getter method for direction, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_route_objects/path_route_object/label_hop/te_label/direction (te-label-direction) + + YANG Description: Label direction. + """ + return self.__direction + + def _set_direction(self, v, load=False): + """ + Setter method for direction, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_route_objects/path_route_object/label_hop/te_label/direction (te-label-direction) + If this variable is read-only (config: false) in the + source YANG file, then _set_direction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_direction() directly. + + YANG Description: Label direction. + """ + 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={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """direction must be of a type compatible with te-label-direction""", + 'defined-type': "ietf-te-topology:te-label-direction", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=False)""", + }) + + self.__direction = t + if hasattr(self, '_set'): + self._set() + + def _unset_direction(self): + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=False) + + generic = __builtin__.property(_get_generic) + otn = __builtin__.property(_get_otn) + vlanid = __builtin__.property(_get_vlanid) + direction = __builtin__.property(_get_direction) + + __choices__ = {'technology': {'generic': ['generic'], 'otn': ['otn'], 'eth': ['vlanid']}, 'type': {'label': ['direction']}} + _pyangbind_elements = OrderedDict([('generic', generic), ('otn', otn), ('vlanid', vlanid), ('direction', direction), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_route_objects/path_route_object/label_hop/te_label/otn/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_route_objects/path_route_object/label_hop/te_label/otn/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..25a5ec822fcb142ca575a1d09946fd504aac40aa --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_route_objects/path_route_object/label_hop/te_label/otn/__init__.py @@ -0,0 +1,209 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 otn(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/local-link-connectivity/path-properties/path-route-objects/path-route-object/label-hop/te-label/otn. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Label hop for OTN. + """ + __slots__ = ('_path_helper', '_extmethods', '__tpn','__tsg','__ts_list',) + + _yang_name = 'otn' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__tpn = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=False) + self.__tsg = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=False) + self.__ts_list = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', 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 ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'local-link-connectivity', 'path-properties', 'path-route-objects', 'path-route-object', 'label-hop', 'te-label', 'otn'] + + def _get_tpn(self): + """ + Getter method for tpn, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_route_objects/path_route_object/label_hop/te_label/otn/tpn (otn-tpn) + + YANG Description: Tributary Port Number (TPN). + """ + return self.__tpn + + def _set_tpn(self, v, load=False): + """ + Setter method for tpn, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_route_objects/path_route_object/label_hop/te_label/otn/tpn (otn-tpn) + If this variable is read-only (config: false) in the + source YANG file, then _set_tpn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tpn() directly. + + YANG Description: Tributary Port Number (TPN). + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tpn must be of a type compatible with otn-tpn""", + 'defined-type': "ietf-otn-topology:otn-tpn", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=False)""", + }) + + self.__tpn = t + if hasattr(self, '_set'): + self._set() + + def _unset_tpn(self): + self.__tpn = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=False) + + + def _get_tsg(self): + """ + Getter method for tsg, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_route_objects/path_route_object/label_hop/te_label/otn/tsg (identityref) + + YANG Description: Tributary Slot Granularity (TSG). + """ + return self.__tsg + + def _set_tsg(self, v, load=False): + """ + Setter method for tsg, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_route_objects/path_route_object/label_hop/te_label/otn/tsg (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_tsg is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tsg() directly. + + YANG Description: Tributary Slot Granularity (TSG). + """ + 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={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tsg must be of a type compatible with identityref""", + 'defined-type': "ietf-otn-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=False)""", + }) + + self.__tsg = t + if hasattr(self, '_set'): + self._set() + + def _unset_tsg(self): + self.__tsg = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=False) + + + def _get_ts_list(self): + """ + Getter method for ts_list, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_route_objects/path_route_object/label_hop/te_label/otn/ts_list (string) + + YANG Description: A list of available Tributary Slots (TS) ranging + + + + +between 1 and 4095. If multiple values or +ranges are given, they all MUST be disjoint +and MUST be in ascending order. +For example 1-20,25,50-1000. + """ + return self.__ts_list + + def _set_ts_list(self, v, load=False): + """ + Setter method for ts_list, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_route_objects/path_route_object/label_hop/te_label/otn/ts_list (string) + If this variable is read-only (config: false) in the + source YANG file, then _set_ts_list is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_ts_list() directly. + + YANG Description: A list of available Tributary Slots (TS) ranging + + + + +between 1 and 4095. If multiple values or +ranges are given, they all MUST be disjoint +and MUST be in ascending order. +For example 1-20,25,50-1000. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='string', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """ts_list must be of a type compatible with string""", + 'defined-type': "string", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='string', is_config=False)""", + }) + + self.__ts_list = t + if hasattr(self, '_set'): + self._set() + + def _unset_ts_list(self): + self.__ts_list = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='string', is_config=False) + + tpn = __builtin__.property(_get_tpn) + tsg = __builtin__.property(_get_tsg) + ts_list = __builtin__.property(_get_ts_list) + + __choices__ = {'technology': {'otn': ['tpn', 'tsg', 'ts_list']}} + _pyangbind_elements = OrderedDict([('tpn', tpn), ('tsg', tsg), ('ts_list', ts_list), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_route_objects/path_route_object/numbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_route_objects/path_route_object/numbered_link_hop/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..7f9882c112f2d67c83372e89ba435e131f90edaa --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_route_objects/path_route_object/numbered_link_hop/__init__.py @@ -0,0 +1,193 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 numbered_link_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/local-link-connectivity/path-properties/path-route-objects/path-route-object/numbered-link-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Numbered link explicit route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__link_tp_id','__hop_type','__direction',) + + _yang_name = 'numbered-link-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=False) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', 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 ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'local-link-connectivity', 'path-properties', 'path-route-objects', 'path-route-object', 'numbered-link-hop'] + + def _get_link_tp_id(self): + """ + Getter method for link_tp_id, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_route_objects/path_route_object/numbered_link_hop/link_tp_id (te-tp-id) + + YANG Description: TE Link Termination Point (LTP) identifier. + """ + return self.__link_tp_id + + def _set_link_tp_id(self, v, load=False): + """ + Setter method for link_tp_id, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_route_objects/path_route_object/numbered_link_hop/link_tp_id (te-tp-id) + If this variable is read-only (config: false) in the + source YANG file, then _set_link_tp_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_link_tp_id() directly. + + YANG Description: TE Link Termination Point (LTP) identifier. + """ + 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),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """link_tp_id must be of a type compatible with te-tp-id""", + 'defined-type': "ietf-te-topology:te-tp-id", + 'generated-type': """YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=False)""", + }) + + self.__link_tp_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_link_tp_id(self): + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=False) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_route_objects/path_route_object/numbered_link_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_route_objects/path_route_object/numbered_link_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + 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={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + + + def _get_direction(self): + """ + Getter method for direction, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_route_objects/path_route_object/numbered_link_hop/direction (te-link-direction) + + YANG Description: Link route object direction. + """ + return self.__direction + + def _set_direction(self, v, load=False): + """ + Setter method for direction, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_route_objects/path_route_object/numbered_link_hop/direction (te-link-direction) + If this variable is read-only (config: false) in the + source YANG file, then _set_direction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_direction() directly. + + YANG Description: Link route object direction. + """ + 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={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """direction must be of a type compatible with te-link-direction""", + 'defined-type': "ietf-te-topology:te-link-direction", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=False)""", + }) + + self.__direction = t + if hasattr(self, '_set'): + self._set() + + def _unset_direction(self): + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=False) + + link_tp_id = __builtin__.property(_get_link_tp_id) + hop_type = __builtin__.property(_get_hop_type) + direction = __builtin__.property(_get_direction) + + __choices__ = {'type': {'numbered-link-hop': ['link_tp_id', 'hop_type', 'direction']}} + _pyangbind_elements = OrderedDict([('link_tp_id', link_tp_id), ('hop_type', hop_type), ('direction', direction), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_route_objects/path_route_object/numbered_node_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_route_objects/path_route_object/numbered_node_hop/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..c406a2f54e28223ea024680f6781b5cf5bd44eb1 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_route_objects/path_route_object/numbered_node_hop/__init__.py @@ -0,0 +1,154 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 numbered_node_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/local-link-connectivity/path-properties/path-route-objects/path-route-object/numbered-node-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Numbered node route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__node_id','__hop_type',) + + _yang_name = 'numbered-node-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=False) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', 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 ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'local-link-connectivity', 'path-properties', 'path-route-objects', 'path-route-object', 'numbered-node-hop'] + + def _get_node_id(self): + """ + Getter method for node_id, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_route_objects/path_route_object/numbered_node_hop/node_id (te-node-id) + + YANG Description: The identifier of a node in the TE topology. + """ + return self.__node_id + + def _set_node_id(self, v, load=False): + """ + Setter method for node_id, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_route_objects/path_route_object/numbered_node_hop/node_id (te-node-id) + 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. + + YANG Description: The identifier of a node in the TE topology. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """node_id must be of a type compatible with te-node-id""", + 'defined-type': "ietf-te-topology:te-node-id", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=False)""", + }) + + self.__node_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_node_id(self): + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=False) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_route_objects/path_route_object/numbered_node_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_route_objects/path_route_object/numbered_node_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + 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={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + + node_id = __builtin__.property(_get_node_id) + hop_type = __builtin__.property(_get_hop_type) + + __choices__ = {'type': {'numbered-node-hop': ['node_id', 'hop_type']}} + _pyangbind_elements = OrderedDict([('node_id', node_id), ('hop_type', hop_type), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_route_objects/path_route_object/unnumbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_route_objects/path_route_object/unnumbered_link_hop/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..c965f3ce1f85c93f8af1465d77cd6ae33b014c1b --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_route_objects/path_route_object/unnumbered_link_hop/__init__.py @@ -0,0 +1,236 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 unnumbered_link_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/local-link-connectivity/path-properties/path-route-objects/path-route-object/unnumbered-link-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Unnumbered link explicit route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__link_tp_id','__node_id','__hop_type','__direction',) + + _yang_name = 'unnumbered-link-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=False) + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=False) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', 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 ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'local-link-connectivity', 'path-properties', 'path-route-objects', 'path-route-object', 'unnumbered-link-hop'] + + def _get_link_tp_id(self): + """ + Getter method for link_tp_id, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_route_objects/path_route_object/unnumbered_link_hop/link_tp_id (te-tp-id) + + YANG Description: TE LTP identifier. The combination of the TE link ID +and the TE node ID is used to identify an unnumbered +TE link. + """ + return self.__link_tp_id + + def _set_link_tp_id(self, v, load=False): + """ + Setter method for link_tp_id, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_route_objects/path_route_object/unnumbered_link_hop/link_tp_id (te-tp-id) + If this variable is read-only (config: false) in the + source YANG file, then _set_link_tp_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_link_tp_id() directly. + + YANG Description: TE LTP identifier. The combination of the TE link ID +and the TE node ID is used to identify an unnumbered +TE link. + """ + 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),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """link_tp_id must be of a type compatible with te-tp-id""", + 'defined-type': "ietf-te-topology:te-tp-id", + 'generated-type': """YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=False)""", + }) + + self.__link_tp_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_link_tp_id(self): + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=False) + + + def _get_node_id(self): + """ + Getter method for node_id, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_route_objects/path_route_object/unnumbered_link_hop/node_id (te-node-id) + + YANG Description: The identifier of a node in the TE topology. + """ + return self.__node_id + + def _set_node_id(self, v, load=False): + """ + Setter method for node_id, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_route_objects/path_route_object/unnumbered_link_hop/node_id (te-node-id) + 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. + + YANG Description: The identifier of a node in the TE topology. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """node_id must be of a type compatible with te-node-id""", + 'defined-type': "ietf-te-topology:te-node-id", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=False)""", + }) + + self.__node_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_node_id(self): + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=False) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_route_objects/path_route_object/unnumbered_link_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_route_objects/path_route_object/unnumbered_link_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + 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={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + + + def _get_direction(self): + """ + Getter method for direction, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_route_objects/path_route_object/unnumbered_link_hop/direction (te-link-direction) + + YANG Description: Link route object direction. + """ + return self.__direction + + def _set_direction(self, v, load=False): + """ + Setter method for direction, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_route_objects/path_route_object/unnumbered_link_hop/direction (te-link-direction) + If this variable is read-only (config: false) in the + source YANG file, then _set_direction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_direction() directly. + + YANG Description: Link route object direction. + """ + 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={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """direction must be of a type compatible with te-link-direction""", + 'defined-type': "ietf-te-topology:te-link-direction", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=False)""", + }) + + self.__direction = t + if hasattr(self, '_set'): + self._set() + + def _unset_direction(self): + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=False) + + link_tp_id = __builtin__.property(_get_link_tp_id) + node_id = __builtin__.property(_get_node_id) + hop_type = __builtin__.property(_get_hop_type) + direction = __builtin__.property(_get_direction) + + __choices__ = {'type': {'unnumbered-link-hop': ['link_tp_id', 'node_id', 'hop_type', 'direction']}} + _pyangbind_elements = OrderedDict([('link_tp_id', link_tp_id), ('node_id', node_id), ('hop_type', hop_type), ('direction', direction), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_srlgs_lists/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_srlgs_lists/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..db6b557eb1491d21d65f67be69d642a0fb956024 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_srlgs_lists/__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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 path_srlgs_list +class path_srlgs_lists(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/local-link-connectivity/path-properties/path-srlgs-lists. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Path SRLG properties container. + """ + __slots__ = ('_path_helper', '_extmethods', '__path_srlgs_list',) + + _yang_name = 'path-srlgs-lists' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__path_srlgs_list = YANGDynClass(base=YANGListType("usage",path_srlgs_list.path_srlgs_list, yang_name="path-srlgs-list", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-srlgs-list", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', 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 ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'local-link-connectivity', 'path-properties', 'path-srlgs-lists'] + + def _get_path_srlgs_list(self): + """ + Getter method for path_srlgs_list, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_srlgs_lists/path_srlgs_list (list) + + YANG Description: List of SRLG values to be included or excluded. + """ + return self.__path_srlgs_list + + def _set_path_srlgs_list(self, v, load=False): + """ + Setter method for path_srlgs_list, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_srlgs_lists/path_srlgs_list (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_srlgs_list is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_srlgs_list() directly. + + YANG Description: List of SRLG values to be included or excluded. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("usage",path_srlgs_list.path_srlgs_list, yang_name="path-srlgs-list", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-srlgs-list", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_srlgs_list must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("usage",path_srlgs_list.path_srlgs_list, yang_name="path-srlgs-list", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-srlgs-list", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False)""", + }) + + self.__path_srlgs_list = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_srlgs_list(self): + self.__path_srlgs_list = YANGDynClass(base=YANGListType("usage",path_srlgs_list.path_srlgs_list, yang_name="path-srlgs-list", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-srlgs-list", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + + path_srlgs_list = __builtin__.property(_get_path_srlgs_list) + + + _pyangbind_elements = OrderedDict([('path_srlgs_list', path_srlgs_list), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_srlgs_lists/path_srlgs_list/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_srlgs_lists/path_srlgs_list/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..909764a6d1e8e0bfe61d9044d8e85d8cc4cb9c8c --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_srlgs_lists/path_srlgs_list/__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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 path_srlgs_list(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/local-link-connectivity/path-properties/path-srlgs-lists/path-srlgs-list. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: List of SRLG values to be included or excluded. + """ + __slots__ = ('_path_helper', '_extmethods', '__usage','__values',) + + _yang_name = 'path-srlgs-list' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__usage = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + self.__values = YANGDynClass(unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32)), is_leaf=False, yang_name="values", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='srlg', 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 ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'local-link-connectivity', 'path-properties', 'path-srlgs-lists', 'path-srlgs-list'] + + def _get_usage(self): + """ + Getter method for usage, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_srlgs_lists/path_srlgs_list/usage (identityref) + + YANG Description: Identifies an entry in a list of SRLGs to either +include or exclude. + """ + return self.__usage + + def _set_usage(self, v, load=False): + """ + Setter method for usage, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_srlgs_lists/path_srlgs_list/usage (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_usage is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_usage() directly. + + YANG Description: Identifies an entry in a list of SRLGs to either +include or exclude. + """ + 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=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """usage must be of a type compatible with identityref""", + 'defined-type': "ietf-te-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False)""", + }) + + self.__usage = t + if hasattr(self, '_set'): + self._set() + + def _unset_usage(self): + self.__usage = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + + + def _get_values(self): + """ + Getter method for values, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_srlgs_lists/path_srlgs_list/values (srlg) + + YANG Description: List of SRLG values. + """ + return self.__values + + def _set_values(self, v, load=False): + """ + Setter method for values, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_srlgs_lists/path_srlgs_list/values (srlg) + If this variable is read-only (config: false) in the + source YANG file, then _set_values is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_values() directly. + + YANG Description: List of SRLG values. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32)), is_leaf=False, yang_name="values", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='srlg', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """values must be of a type compatible with srlg""", + 'defined-type': "ietf-te-topology:srlg", + 'generated-type': """YANGDynClass(unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32)), is_leaf=False, yang_name="values", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='srlg', is_config=False)""", + }) + + self.__values = t + if hasattr(self, '_set'): + self._set() + + def _unset_values(self): + self.__values = YANGDynClass(unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32)), is_leaf=False, yang_name="values", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='srlg', is_config=False) + + usage = __builtin__.property(_get_usage) + values = __builtin__.property(_get_values) + + + _pyangbind_elements = OrderedDict([('usage', usage), ('values', values), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_srlgs_names/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_srlgs_names/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..7466c4918dd186ed92cf52f6c3d00637e7136d51 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_srlgs_names/__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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 path_srlgs_name +class path_srlgs_names(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/local-link-connectivity/path-properties/path-srlgs-names. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Container for the list of named SRLGs. + """ + __slots__ = ('_path_helper', '_extmethods', '__path_srlgs_name',) + + _yang_name = 'path-srlgs-names' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__path_srlgs_name = YANGDynClass(base=YANGListType("usage",path_srlgs_name.path_srlgs_name, yang_name="path-srlgs-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-srlgs-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', 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 ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'local-link-connectivity', 'path-properties', 'path-srlgs-names'] + + def _get_path_srlgs_name(self): + """ + Getter method for path_srlgs_name, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_srlgs_names/path_srlgs_name (list) + + YANG Description: List of named SRLGs to be included or excluded. + """ + return self.__path_srlgs_name + + def _set_path_srlgs_name(self, v, load=False): + """ + Setter method for path_srlgs_name, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_srlgs_names/path_srlgs_name (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_srlgs_name is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_srlgs_name() directly. + + YANG Description: List of named SRLGs to be included or excluded. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("usage",path_srlgs_name.path_srlgs_name, yang_name="path-srlgs-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-srlgs-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_srlgs_name must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("usage",path_srlgs_name.path_srlgs_name, yang_name="path-srlgs-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-srlgs-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False)""", + }) + + self.__path_srlgs_name = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_srlgs_name(self): + self.__path_srlgs_name = YANGDynClass(base=YANGListType("usage",path_srlgs_name.path_srlgs_name, yang_name="path-srlgs-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-srlgs-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + + path_srlgs_name = __builtin__.property(_get_path_srlgs_name) + + + _pyangbind_elements = OrderedDict([('path_srlgs_name', path_srlgs_name), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_srlgs_names/path_srlgs_name/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_srlgs_names/path_srlgs_name/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..75f5ea586d436c798808c15cdc57103ac2b73953 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_srlgs_names/path_srlgs_name/__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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 path_srlgs_name(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/local-link-connectivity/path-properties/path-srlgs-names/path-srlgs-name. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: List of named SRLGs to be included or excluded. + """ + __slots__ = ('_path_helper', '_extmethods', '__usage','__names',) + + _yang_name = 'path-srlgs-name' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__usage = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + self.__names = YANGDynClass(unique=True, base=TypedListType(allowed_type=six.text_type), is_leaf=False, yang_name="names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', 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 ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'local-link-connectivity', 'path-properties', 'path-srlgs-names', 'path-srlgs-name'] + + def _get_usage(self): + """ + Getter method for usage, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_srlgs_names/path_srlgs_name/usage (identityref) + + YANG Description: Identifies an entry in a list of named SRLGs to either +include or exclude. + """ + return self.__usage + + def _set_usage(self, v, load=False): + """ + Setter method for usage, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_srlgs_names/path_srlgs_name/usage (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_usage is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_usage() directly. + + YANG Description: Identifies an entry in a list of named SRLGs to either +include or exclude. + """ + 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=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """usage must be of a type compatible with identityref""", + 'defined-type': "ietf-te-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False)""", + }) + + self.__usage = t + if hasattr(self, '_set'): + self._set() + + def _unset_usage(self): + self.__usage = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + + + def _get_names(self): + """ + Getter method for names, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_srlgs_names/path_srlgs_name/names (string) + + YANG Description: List of named SRLGs. + """ + return self.__names + + def _set_names(self, v, load=False): + """ + Setter method for names, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_srlgs_names/path_srlgs_name/names (string) + If this variable is read-only (config: false) in the + source YANG file, then _set_names is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_names() directly. + + YANG Description: List of named SRLGs. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,unique=True, base=TypedListType(allowed_type=six.text_type), is_leaf=False, yang_name="names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """names must be of a type compatible with string""", + 'defined-type': "string", + 'generated-type': """YANGDynClass(unique=True, base=TypedListType(allowed_type=six.text_type), is_leaf=False, yang_name="names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=False)""", + }) + + self.__names = t + if hasattr(self, '_set'): + self._set() + + def _unset_names(self): + self.__names = YANGDynClass(unique=True, base=TypedListType(allowed_type=six.text_type), is_leaf=False, yang_name="names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=False) + + usage = __builtin__.property(_get_usage) + names = __builtin__.property(_get_names) + + + _pyangbind_elements = OrderedDict([('usage', usage), ('names', names), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e4c8bb6d3b582017cb7ac23a67e8b788a412e646 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/__init__.py @@ -0,0 +1,326 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 primary_path +from . import backup_path +from . import tunnel_termination_points +from . import tunnels +class underlay(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/local-link-connectivity/underlay. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Attributes of the TE link underlay. + """ + __slots__ = ('_path_helper', '_extmethods', '__enabled','__primary_path','__backup_path','__protection_type','__tunnel_termination_points','__tunnels',) + + _yang_name = 'underlay' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__enabled = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="enabled", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='boolean', is_config=True) + self.__primary_path = YANGDynClass(base=primary_path.primary_path, is_container='container', yang_name="primary-path", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__backup_path = YANGDynClass(base=YANGListType("index",backup_path.backup_path, yang_name="backup-path", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='index', extensions=None), is_container='list', yang_name="backup-path", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + self.__protection_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'lsp-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-reroute-extra': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-reroute-extra': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-reroute-extra': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-reroute': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-reroute': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-reroute': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-1-for-n': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-1-for-n': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-1-for-n': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-unidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-unidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-unidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-bidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-bidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-bidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="protection-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + self.__tunnel_termination_points = YANGDynClass(base=tunnel_termination_points.tunnel_termination_points, is_container='container', yang_name="tunnel-termination-points", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__tunnels = YANGDynClass(base=tunnels.tunnels, is_container='container', yang_name="tunnels", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-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 ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'local-link-connectivity', 'underlay'] + + def _get_enabled(self): + """ + Getter method for enabled, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/enabled (boolean) + + YANG Description: 'true' if the underlay is enabled. +'false' if the underlay is disabled. + """ + return self.__enabled + + def _set_enabled(self, v, load=False): + """ + Setter method for enabled, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/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: 'true' if the underlay is enabled. +'false' if the underlay is disabled. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBool, is_leaf=True, yang_name="enabled", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', 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, is_leaf=True, yang_name="enabled", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='boolean', is_config=True)""", + }) + + self.__enabled = t + if hasattr(self, '_set'): + self._set() + + def _unset_enabled(self): + self.__enabled = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="enabled", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='boolean', is_config=True) + + + def _get_primary_path(self): + """ + Getter method for primary_path, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/primary_path (container) + + YANG Description: The service path on the underlay topology that +supports this link. + """ + return self.__primary_path + + def _set_primary_path(self, v, load=False): + """ + Setter method for primary_path, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/primary_path (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_primary_path is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_primary_path() directly. + + YANG Description: The service path on the underlay topology that +supports this link. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=primary_path.primary_path, is_container='container', yang_name="primary-path", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """primary_path must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=primary_path.primary_path, is_container='container', yang_name="primary-path", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__primary_path = t + if hasattr(self, '_set'): + self._set() + + def _unset_primary_path(self): + self.__primary_path = YANGDynClass(base=primary_path.primary_path, is_container='container', yang_name="primary-path", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_backup_path(self): + """ + Getter method for backup_path, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/backup_path (list) + + YANG Description: A list of backup service paths on the underlay topology that +protect the underlay primary path. If the primary path is +not protected, the list contains zero elements. If the +primary path is protected, the list contains one or more +elements. + """ + return self.__backup_path + + def _set_backup_path(self, v, load=False): + """ + Setter method for backup_path, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/backup_path (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_backup_path is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_backup_path() directly. + + YANG Description: A list of backup service paths on the underlay topology that +protect the underlay primary path. If the primary path is +not protected, the list contains zero elements. If the +primary path is protected, the list contains one or more +elements. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("index",backup_path.backup_path, yang_name="backup-path", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='index', extensions=None), is_container='list', yang_name="backup-path", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """backup_path must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("index",backup_path.backup_path, yang_name="backup-path", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='index', extensions=None), is_container='list', yang_name="backup-path", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True)""", + }) + + self.__backup_path = t + if hasattr(self, '_set'): + self._set() + + def _unset_backup_path(self): + self.__backup_path = YANGDynClass(base=YANGListType("index",backup_path.backup_path, yang_name="backup-path", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='index', extensions=None), is_container='list', yang_name="backup-path", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + + + def _get_protection_type(self): + """ + Getter method for protection_type, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/protection_type (identityref) + + YANG Description: Underlay protection type desired for this link. + """ + return self.__protection_type + + def _set_protection_type(self, v, load=False): + """ + Setter method for protection_type, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/protection_type (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_protection_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_protection_type() directly. + + YANG Description: Underlay protection type desired for this link. + """ + 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={'lsp-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-reroute-extra': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-reroute-extra': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-reroute-extra': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-reroute': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-reroute': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-reroute': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-1-for-n': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-1-for-n': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-1-for-n': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-unidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-unidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-unidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-bidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-bidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-bidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="protection-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """protection_type must be of a type compatible with identityref""", + 'defined-type': "ietf-te-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'lsp-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-reroute-extra': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-reroute-extra': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-reroute-extra': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-reroute': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-reroute': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-reroute': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-1-for-n': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-1-for-n': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-1-for-n': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-unidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-unidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-unidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-bidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-bidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-bidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="protection-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True)""", + }) + + self.__protection_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_protection_type(self): + self.__protection_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'lsp-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-reroute-extra': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-reroute-extra': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-reroute-extra': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-reroute': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-reroute': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-reroute': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-1-for-n': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-1-for-n': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-1-for-n': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-unidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-unidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-unidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-bidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-bidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-bidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="protection-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + + + def _get_tunnel_termination_points(self): + """ + Getter method for tunnel_termination_points, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/tunnel_termination_points (container) + + YANG Description: Underlay TTPs desired for this link. + """ + return self.__tunnel_termination_points + + def _set_tunnel_termination_points(self, v, load=False): + """ + Setter method for tunnel_termination_points, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/tunnel_termination_points (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_tunnel_termination_points is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tunnel_termination_points() directly. + + YANG Description: Underlay TTPs desired for this link. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=tunnel_termination_points.tunnel_termination_points, is_container='container', yang_name="tunnel-termination-points", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tunnel_termination_points must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=tunnel_termination_points.tunnel_termination_points, is_container='container', yang_name="tunnel-termination-points", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__tunnel_termination_points = t + if hasattr(self, '_set'): + self._set() + + def _unset_tunnel_termination_points(self): + self.__tunnel_termination_points = YANGDynClass(base=tunnel_termination_points.tunnel_termination_points, is_container='container', yang_name="tunnel-termination-points", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_tunnels(self): + """ + Getter method for tunnels, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/tunnels (container) + + YANG Description: Underlay TE tunnels supporting this TE link. + """ + return self.__tunnels + + def _set_tunnels(self, v, load=False): + """ + Setter method for tunnels, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/tunnels (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_tunnels is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tunnels() directly. + + YANG Description: Underlay TE tunnels supporting this TE link. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=tunnels.tunnels, is_container='container', yang_name="tunnels", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tunnels must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=tunnels.tunnels, is_container='container', yang_name="tunnels", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__tunnels = t + if hasattr(self, '_set'): + self._set() + + def _unset_tunnels(self): + self.__tunnels = YANGDynClass(base=tunnels.tunnels, is_container='container', yang_name="tunnels", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + enabled = __builtin__.property(_get_enabled, _set_enabled) + primary_path = __builtin__.property(_get_primary_path, _set_primary_path) + backup_path = __builtin__.property(_get_backup_path, _set_backup_path) + protection_type = __builtin__.property(_get_protection_type, _set_protection_type) + tunnel_termination_points = __builtin__.property(_get_tunnel_termination_points, _set_tunnel_termination_points) + tunnels = __builtin__.property(_get_tunnels, _set_tunnels) + + + _pyangbind_elements = OrderedDict([('enabled', enabled), ('primary_path', primary_path), ('backup_path', backup_path), ('protection_type', protection_type), ('tunnel_termination_points', tunnel_termination_points), ('tunnels', tunnels), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/backup_path/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/backup_path/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..f9690f9383c3ec5d4f013e28890f2ad02df14d7c --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/backup_path/__init__.py @@ -0,0 +1,207 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 path_element +class backup_path(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/local-link-connectivity/underlay/backup-path. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: A list of backup service paths on the underlay topology that +protect the underlay primary path. If the primary path is +not protected, the list contains zero elements. If the +primary path is protected, the list contains one or more +elements. + """ + __slots__ = ('_path_helper', '_extmethods', '__index','__network_ref','__path_element',) + + _yang_name = 'backup-path' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _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), is_leaf=True, yang_name="index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + self.__network_ref = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="network-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=True) + self.__path_element = YANGDynClass(base=YANGListType("path_element_id",path_element.path_element, yang_name="path-element", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='path-element-id', extensions=None), is_container='list', yang_name="path-element", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-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 ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'local-link-connectivity', 'underlay', 'backup-path'] + + def _get_index(self): + """ + Getter method for index, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/backup_path/index (uint32) + + YANG Description: A sequence number to identify a backup path. + """ + return self.__index + + def _set_index(self, v, load=False): + """ + Setter method for index, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/backup_path/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: A sequence number to identify a backup path. + """ + 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=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', 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), is_leaf=True, yang_name="index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', 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), is_leaf=True, yang_name="index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + + + def _get_network_ref(self): + """ + Getter method for network_ref, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/backup_path/network_ref (leafref) + + YANG Description: Used to reference a network -- for example, an underlay +network. + """ + return self.__network_ref + + def _set_network_ref(self, v, load=False): + """ + Setter method for network_ref, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/backup_path/network_ref (leafref) + If this variable is read-only (config: false) in the + source YANG file, then _set_network_ref is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_network_ref() directly. + + YANG Description: Used to reference a network -- for example, an underlay +network. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="network-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """network_ref must be of a type compatible with leafref""", + 'defined-type': "leafref", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="network-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=True)""", + }) + + self.__network_ref = t + if hasattr(self, '_set'): + self._set() + + def _unset_network_ref(self): + self.__network_ref = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="network-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=True) + + + def _get_path_element(self): + """ + Getter method for path_element, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/backup_path/path_element (list) + + YANG Description: A list of path elements describing the backup service +path. + """ + return self.__path_element + + def _set_path_element(self, v, load=False): + """ + Setter method for path_element, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/backup_path/path_element (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_element is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_element() directly. + + YANG Description: A list of path elements describing the backup service +path. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("path_element_id",path_element.path_element, yang_name="path-element", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='path-element-id', extensions=None), is_container='list', yang_name="path-element", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_element must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("path_element_id",path_element.path_element, yang_name="path-element", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='path-element-id', extensions=None), is_container='list', yang_name="path-element", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True)""", + }) + + self.__path_element = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_element(self): + self.__path_element = YANGDynClass(base=YANGListType("path_element_id",path_element.path_element, yang_name="path-element", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='path-element-id', extensions=None), is_container='list', yang_name="path-element", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + + index = __builtin__.property(_get_index, _set_index) + network_ref = __builtin__.property(_get_network_ref, _set_network_ref) + path_element = __builtin__.property(_get_path_element, _set_path_element) + + + _pyangbind_elements = OrderedDict([('index', index), ('network_ref', network_ref), ('path_element', path_element), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/backup_path/path_element/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/backup_path/path_element/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..beb298aa14f672bc2a0bf46ff0ebcb7b47005f77 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/backup_path/path_element/__init__.py @@ -0,0 +1,321 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 numbered_node_hop +from . import numbered_link_hop +from . import unnumbered_link_hop +from . import as_number_hop +from . import label_hop +class path_element(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/local-link-connectivity/underlay/backup-path/path-element. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: A list of path elements describing the backup service +path. + """ + __slots__ = ('_path_helper', '_extmethods', '__path_element_id','__numbered_node_hop','__numbered_link_hop','__unnumbered_link_hop','__as_number_hop','__label_hop',) + + _yang_name = 'path-element' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__path_element_id = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="path-element-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + self.__numbered_node_hop = YANGDynClass(base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__numbered_link_hop = YANGDynClass(base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__unnumbered_link_hop = YANGDynClass(base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__as_number_hop = YANGDynClass(base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__label_hop = YANGDynClass(base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-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 ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'local-link-connectivity', 'underlay', 'backup-path', 'path-element'] + + def _get_path_element_id(self): + """ + Getter method for path_element_id, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/backup_path/path_element/path_element_id (uint32) + + YANG Description: To identify the element in a path. + """ + return self.__path_element_id + + def _set_path_element_id(self, v, load=False): + """ + Setter method for path_element_id, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/backup_path/path_element/path_element_id (uint32) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_element_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_element_id() directly. + + YANG Description: To identify the element in a path. + """ + 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=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="path-element-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_element_id 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="path-element-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True)""", + }) + + self.__path_element_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_element_id(self): + self.__path_element_id = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="path-element-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + + + def _get_numbered_node_hop(self): + """ + Getter method for numbered_node_hop, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/backup_path/path_element/numbered_node_hop (container) + + YANG Description: Numbered node route hop. + """ + return self.__numbered_node_hop + + def _set_numbered_node_hop(self, v, load=False): + """ + Setter method for numbered_node_hop, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/backup_path/path_element/numbered_node_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_numbered_node_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_numbered_node_hop() directly. + + YANG Description: Numbered node route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """numbered_node_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__numbered_node_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_numbered_node_hop(self): + self.__numbered_node_hop = YANGDynClass(base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_numbered_link_hop(self): + """ + Getter method for numbered_link_hop, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/backup_path/path_element/numbered_link_hop (container) + + YANG Description: Numbered link explicit route hop. + """ + return self.__numbered_link_hop + + def _set_numbered_link_hop(self, v, load=False): + """ + Setter method for numbered_link_hop, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/backup_path/path_element/numbered_link_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_numbered_link_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_numbered_link_hop() directly. + + YANG Description: Numbered link explicit route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """numbered_link_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__numbered_link_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_numbered_link_hop(self): + self.__numbered_link_hop = YANGDynClass(base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_unnumbered_link_hop(self): + """ + Getter method for unnumbered_link_hop, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/backup_path/path_element/unnumbered_link_hop (container) + + YANG Description: Unnumbered link explicit route hop. + """ + return self.__unnumbered_link_hop + + def _set_unnumbered_link_hop(self, v, load=False): + """ + Setter method for unnumbered_link_hop, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/backup_path/path_element/unnumbered_link_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_unnumbered_link_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_unnumbered_link_hop() directly. + + YANG Description: Unnumbered link explicit route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """unnumbered_link_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__unnumbered_link_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_unnumbered_link_hop(self): + self.__unnumbered_link_hop = YANGDynClass(base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_as_number_hop(self): + """ + Getter method for as_number_hop, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/backup_path/path_element/as_number_hop (container) + + YANG Description: AS explicit route hop. + """ + return self.__as_number_hop + + def _set_as_number_hop(self, v, load=False): + """ + Setter method for as_number_hop, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/backup_path/path_element/as_number_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_as_number_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_as_number_hop() directly. + + YANG Description: AS explicit route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """as_number_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__as_number_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_as_number_hop(self): + self.__as_number_hop = YANGDynClass(base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_label_hop(self): + """ + Getter method for label_hop, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/backup_path/path_element/label_hop (container) + + YANG Description: Label hop type. + """ + return self.__label_hop + + def _set_label_hop(self, v, load=False): + """ + Setter method for label_hop, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/backup_path/path_element/label_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_label_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_label_hop() directly. + + YANG Description: Label hop type. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """label_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__label_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_label_hop(self): + self.__label_hop = YANGDynClass(base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + path_element_id = __builtin__.property(_get_path_element_id, _set_path_element_id) + numbered_node_hop = __builtin__.property(_get_numbered_node_hop, _set_numbered_node_hop) + numbered_link_hop = __builtin__.property(_get_numbered_link_hop, _set_numbered_link_hop) + unnumbered_link_hop = __builtin__.property(_get_unnumbered_link_hop, _set_unnumbered_link_hop) + as_number_hop = __builtin__.property(_get_as_number_hop, _set_as_number_hop) + label_hop = __builtin__.property(_get_label_hop, _set_label_hop) + + __choices__ = {'type': {'numbered-node-hop': ['numbered_node_hop'], 'numbered-link-hop': ['numbered_link_hop'], 'unnumbered-link-hop': ['unnumbered_link_hop'], 'as-number': ['as_number_hop'], 'label': ['label_hop']}} + _pyangbind_elements = OrderedDict([('path_element_id', path_element_id), ('numbered_node_hop', numbered_node_hop), ('numbered_link_hop', numbered_link_hop), ('unnumbered_link_hop', unnumbered_link_hop), ('as_number_hop', as_number_hop), ('label_hop', label_hop), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/backup_path/path_element/as_number_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/backup_path/path_element/as_number_hop/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..60abe510bdcf78892f0a9a2f9f0e2a682f790fbb --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/backup_path/path_element/as_number_hop/__init__.py @@ -0,0 +1,154 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 as_number_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/local-link-connectivity/underlay/backup-path/path-element/as-number-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: AS explicit route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__as_number','__hop_type',) + + _yang_name = 'as-number-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__as_number = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=True) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', 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 ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'local-link-connectivity', 'underlay', 'backup-path', 'path-element', 'as-number-hop'] + + def _get_as_number(self): + """ + Getter method for as_number, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/backup_path/path_element/as_number_hop/as_number (inet:as-number) + + YANG Description: The Autonomous System (AS) number. + """ + return self.__as_number + + def _set_as_number(self, v, load=False): + """ + Setter method for as_number, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/backup_path/path_element/as_number_hop/as_number (inet:as-number) + If this variable is read-only (config: false) in the + source YANG file, then _set_as_number is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_as_number() directly. + + YANG Description: The Autonomous System (AS) number. + """ + 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="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """as_number must be of a type compatible with inet:as-number""", + 'defined-type': "inet:as-number", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=True)""", + }) + + self.__as_number = t + if hasattr(self, '_set'): + self._set() + + def _unset_as_number(self): + self.__as_number = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=True) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/backup_path/path_element/as_number_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/backup_path/path_element/as_number_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + 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={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + + as_number = __builtin__.property(_get_as_number, _set_as_number) + hop_type = __builtin__.property(_get_hop_type, _set_hop_type) + + __choices__ = {'type': {'as-number': ['as_number', 'hop_type']}} + _pyangbind_elements = OrderedDict([('as_number', as_number), ('hop_type', hop_type), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/backup_path/path_element/label_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/backup_path/path_element/label_hop/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..5ee2330a9e0c326a26439c365c98bbf212319529 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/backup_path/path_element/label_hop/__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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 te_label +class label_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/local-link-connectivity/underlay/backup-path/path-element/label-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Label hop type. + """ + __slots__ = ('_path_helper', '_extmethods', '__te_label',) + + _yang_name = 'label-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__te_label = YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-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 ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'local-link-connectivity', 'underlay', 'backup-path', 'path-element', 'label-hop'] + + def _get_te_label(self): + """ + Getter method for te_label, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/backup_path/path_element/label_hop/te_label (container) + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + return self.__te_label + + def _set_te_label(self, v, load=False): + """ + Setter method for te_label, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/backup_path/path_element/label_hop/te_label (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_te_label is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_te_label() directly. + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """te_label must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__te_label = t + if hasattr(self, '_set'): + self._set() + + def _unset_te_label(self): + self.__te_label = YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + te_label = __builtin__.property(_get_te_label, _set_te_label) + + __choices__ = {'type': {'label': ['te_label']}} + _pyangbind_elements = OrderedDict([('te_label', te_label), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/backup_path/path_element/label_hop/te_label/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/backup_path/path_element/label_hop/te_label/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..94d9603a099b262137aa19b7b22e885364b94a38 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/backup_path/path_element/label_hop/te_label/__init__.py @@ -0,0 +1,234 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 otn +class te_label(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/local-link-connectivity/underlay/backup-path/path-element/label-hop/te-label. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + __slots__ = ('_path_helper', '_extmethods', '__generic','__otn','__vlanid','__direction',) + + _yang_name = 'te-label' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__generic = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True) + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + self.__vlanid = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True) + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', 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 ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'local-link-connectivity', 'underlay', 'backup-path', 'path-element', 'label-hop', 'te-label'] + + def _get_generic(self): + """ + Getter method for generic, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/backup_path/path_element/label_hop/te_label/generic (rt-types:generalized-label) + + YANG Description: TE label specified in a generic format. + """ + return self.__generic + + def _set_generic(self, v, load=False): + """ + Setter method for generic, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/backup_path/path_element/label_hop/te_label/generic (rt-types:generalized-label) + If this variable is read-only (config: false) in the + source YANG file, then _set_generic is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_generic() directly. + + YANG Description: TE label specified in a generic format. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """generic must be of a type compatible with rt-types:generalized-label""", + 'defined-type': "rt-types:generalized-label", + 'generated-type': """YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True)""", + }) + + self.__generic = t + if hasattr(self, '_set'): + self._set() + + def _unset_generic(self): + self.__generic = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True) + + + def _get_otn(self): + """ + Getter method for otn, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/backup_path/path_element/label_hop/te_label/otn (container) + + YANG Description: Label hop for OTN. + """ + return self.__otn + + def _set_otn(self, v, load=False): + """ + Setter method for otn, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/backup_path/path_element/label_hop/te_label/otn (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_otn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_otn() directly. + + YANG Description: Label hop for OTN. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """otn must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True)""", + }) + + self.__otn = t + if hasattr(self, '_set'): + self._set() + + def _unset_otn(self): + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + + + def _get_vlanid(self): + """ + Getter method for vlanid, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/backup_path/path_element/label_hop/te_label/vlanid (etht-types:vlanid) + + YANG Description: VLAN tag id. + """ + return self.__vlanid + + def _set_vlanid(self, v, load=False): + """ + Setter method for vlanid, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/backup_path/path_element/label_hop/te_label/vlanid (etht-types:vlanid) + If this variable is read-only (config: false) in the + source YANG file, then _set_vlanid is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_vlanid() directly. + + YANG Description: VLAN tag id. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """vlanid must be of a type compatible with etht-types:vlanid""", + 'defined-type': "etht-types:vlanid", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True)""", + }) + + self.__vlanid = t + if hasattr(self, '_set'): + self._set() + + def _unset_vlanid(self): + self.__vlanid = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True) + + + def _get_direction(self): + """ + Getter method for direction, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/backup_path/path_element/label_hop/te_label/direction (te-label-direction) + + YANG Description: Label direction. + """ + return self.__direction + + def _set_direction(self, v, load=False): + """ + Setter method for direction, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/backup_path/path_element/label_hop/te_label/direction (te-label-direction) + If this variable is read-only (config: false) in the + source YANG file, then _set_direction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_direction() directly. + + YANG Description: Label direction. + """ + 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={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """direction must be of a type compatible with te-label-direction""", + 'defined-type': "ietf-te-topology:te-label-direction", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=True)""", + }) + + self.__direction = t + if hasattr(self, '_set'): + self._set() + + def _unset_direction(self): + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=True) + + generic = __builtin__.property(_get_generic, _set_generic) + otn = __builtin__.property(_get_otn, _set_otn) + vlanid = __builtin__.property(_get_vlanid, _set_vlanid) + direction = __builtin__.property(_get_direction, _set_direction) + + __choices__ = {'technology': {'generic': ['generic'], 'otn': ['otn'], 'eth': ['vlanid']}, 'type': {'label': ['direction']}} + _pyangbind_elements = OrderedDict([('generic', generic), ('otn', otn), ('vlanid', vlanid), ('direction', direction), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/backup_path/path_element/label_hop/te_label/otn/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/backup_path/path_element/label_hop/te_label/otn/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..3dfbe742aaf061e6d11ab2e8959e42f0275caadf --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/backup_path/path_element/label_hop/te_label/otn/__init__.py @@ -0,0 +1,209 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 otn(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/local-link-connectivity/underlay/backup-path/path-element/label-hop/te-label/otn. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Label hop for OTN. + """ + __slots__ = ('_path_helper', '_extmethods', '__tpn','__tsg','__ts_list',) + + _yang_name = 'otn' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__tpn = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True) + self.__tsg = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + self.__ts_list = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-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 ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'local-link-connectivity', 'underlay', 'backup-path', 'path-element', 'label-hop', 'te-label', 'otn'] + + def _get_tpn(self): + """ + Getter method for tpn, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/backup_path/path_element/label_hop/te_label/otn/tpn (otn-tpn) + + YANG Description: Tributary Port Number (TPN). + """ + return self.__tpn + + def _set_tpn(self, v, load=False): + """ + Setter method for tpn, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/backup_path/path_element/label_hop/te_label/otn/tpn (otn-tpn) + If this variable is read-only (config: false) in the + source YANG file, then _set_tpn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tpn() directly. + + YANG Description: Tributary Port Number (TPN). + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tpn must be of a type compatible with otn-tpn""", + 'defined-type': "ietf-otn-topology:otn-tpn", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True)""", + }) + + self.__tpn = t + if hasattr(self, '_set'): + self._set() + + def _unset_tpn(self): + self.__tpn = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True) + + + def _get_tsg(self): + """ + Getter method for tsg, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/backup_path/path_element/label_hop/te_label/otn/tsg (identityref) + + YANG Description: Tributary Slot Granularity (TSG). + """ + return self.__tsg + + def _set_tsg(self, v, load=False): + """ + Setter method for tsg, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/backup_path/path_element/label_hop/te_label/otn/tsg (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_tsg is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tsg() directly. + + YANG Description: Tributary Slot Granularity (TSG). + """ + 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={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tsg must be of a type compatible with identityref""", + 'defined-type': "ietf-otn-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True)""", + }) + + self.__tsg = t + if hasattr(self, '_set'): + self._set() + + def _unset_tsg(self): + self.__tsg = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + + + def _get_ts_list(self): + """ + Getter method for ts_list, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/backup_path/path_element/label_hop/te_label/otn/ts_list (string) + + YANG Description: A list of available Tributary Slots (TS) ranging + + + + +between 1 and 4095. If multiple values or +ranges are given, they all MUST be disjoint +and MUST be in ascending order. +For example 1-20,25,50-1000. + """ + return self.__ts_list + + def _set_ts_list(self, v, load=False): + """ + Setter method for ts_list, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/backup_path/path_element/label_hop/te_label/otn/ts_list (string) + If this variable is read-only (config: false) in the + source YANG file, then _set_ts_list is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_ts_list() directly. + + YANG Description: A list of available Tributary Slots (TS) ranging + + + + +between 1 and 4095. If multiple values or +ranges are given, they all MUST be disjoint +and MUST be in ascending order. +For example 1-20,25,50-1000. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='string', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """ts_list must be of a type compatible with string""", + 'defined-type': "string", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='string', is_config=True)""", + }) + + self.__ts_list = t + if hasattr(self, '_set'): + self._set() + + def _unset_ts_list(self): + self.__ts_list = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='string', is_config=True) + + tpn = __builtin__.property(_get_tpn, _set_tpn) + tsg = __builtin__.property(_get_tsg, _set_tsg) + ts_list = __builtin__.property(_get_ts_list, _set_ts_list) + + __choices__ = {'technology': {'otn': ['tpn', 'tsg', 'ts_list']}} + _pyangbind_elements = OrderedDict([('tpn', tpn), ('tsg', tsg), ('ts_list', ts_list), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/backup_path/path_element/numbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/backup_path/path_element/numbered_link_hop/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..d9b3a906d14e0b0fec0cec35d7266587e142330a --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/backup_path/path_element/numbered_link_hop/__init__.py @@ -0,0 +1,193 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 numbered_link_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/local-link-connectivity/underlay/backup-path/path-element/numbered-link-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Numbered link explicit route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__link_tp_id','__hop_type','__direction',) + + _yang_name = 'numbered-link-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', 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 ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'local-link-connectivity', 'underlay', 'backup-path', 'path-element', 'numbered-link-hop'] + + def _get_link_tp_id(self): + """ + Getter method for link_tp_id, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/backup_path/path_element/numbered_link_hop/link_tp_id (te-tp-id) + + YANG Description: TE Link Termination Point (LTP) identifier. + """ + return self.__link_tp_id + + def _set_link_tp_id(self, v, load=False): + """ + Setter method for link_tp_id, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/backup_path/path_element/numbered_link_hop/link_tp_id (te-tp-id) + If this variable is read-only (config: false) in the + source YANG file, then _set_link_tp_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_link_tp_id() directly. + + YANG Description: TE Link Termination Point (LTP) identifier. + """ + 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),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """link_tp_id must be of a type compatible with te-tp-id""", + 'defined-type': "ietf-te-topology:te-tp-id", + 'generated-type': """YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True)""", + }) + + self.__link_tp_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_link_tp_id(self): + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/backup_path/path_element/numbered_link_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/backup_path/path_element/numbered_link_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + 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={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + + + def _get_direction(self): + """ + Getter method for direction, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/backup_path/path_element/numbered_link_hop/direction (te-link-direction) + + YANG Description: Link route object direction. + """ + return self.__direction + + def _set_direction(self, v, load=False): + """ + Setter method for direction, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/backup_path/path_element/numbered_link_hop/direction (te-link-direction) + If this variable is read-only (config: false) in the + source YANG file, then _set_direction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_direction() directly. + + YANG Description: Link route object direction. + """ + 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={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """direction must be of a type compatible with te-link-direction""", + 'defined-type': "ietf-te-topology:te-link-direction", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True)""", + }) + + self.__direction = t + if hasattr(self, '_set'): + self._set() + + def _unset_direction(self): + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True) + + link_tp_id = __builtin__.property(_get_link_tp_id, _set_link_tp_id) + hop_type = __builtin__.property(_get_hop_type, _set_hop_type) + direction = __builtin__.property(_get_direction, _set_direction) + + __choices__ = {'type': {'numbered-link-hop': ['link_tp_id', 'hop_type', 'direction']}} + _pyangbind_elements = OrderedDict([('link_tp_id', link_tp_id), ('hop_type', hop_type), ('direction', direction), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/backup_path/path_element/numbered_node_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/backup_path/path_element/numbered_node_hop/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e4e4080396d83fca58c1a2f30fc6d33a9e3c27ed --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/backup_path/path_element/numbered_node_hop/__init__.py @@ -0,0 +1,154 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 numbered_node_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/local-link-connectivity/underlay/backup-path/path-element/numbered-node-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Numbered node route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__node_id','__hop_type',) + + _yang_name = 'numbered-node-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', 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 ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'local-link-connectivity', 'underlay', 'backup-path', 'path-element', 'numbered-node-hop'] + + def _get_node_id(self): + """ + Getter method for node_id, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/backup_path/path_element/numbered_node_hop/node_id (te-node-id) + + YANG Description: The identifier of a node in the TE topology. + """ + return self.__node_id + + def _set_node_id(self, v, load=False): + """ + Setter method for node_id, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/backup_path/path_element/numbered_node_hop/node_id (te-node-id) + 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. + + YANG Description: The identifier of a node in the TE topology. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """node_id must be of a type compatible with te-node-id""", + 'defined-type': "ietf-te-topology:te-node-id", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True)""", + }) + + self.__node_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_node_id(self): + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/backup_path/path_element/numbered_node_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/backup_path/path_element/numbered_node_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + 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={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + + node_id = __builtin__.property(_get_node_id, _set_node_id) + hop_type = __builtin__.property(_get_hop_type, _set_hop_type) + + __choices__ = {'type': {'numbered-node-hop': ['node_id', 'hop_type']}} + _pyangbind_elements = OrderedDict([('node_id', node_id), ('hop_type', hop_type), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/backup_path/path_element/unnumbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/backup_path/path_element/unnumbered_link_hop/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..274e9473a569e845f1e2cabb879a4b9ad169e065 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/backup_path/path_element/unnumbered_link_hop/__init__.py @@ -0,0 +1,236 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 unnumbered_link_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/local-link-connectivity/underlay/backup-path/path-element/unnumbered-link-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Unnumbered link explicit route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__link_tp_id','__node_id','__hop_type','__direction',) + + _yang_name = 'unnumbered-link-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True) + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', 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 ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'local-link-connectivity', 'underlay', 'backup-path', 'path-element', 'unnumbered-link-hop'] + + def _get_link_tp_id(self): + """ + Getter method for link_tp_id, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/backup_path/path_element/unnumbered_link_hop/link_tp_id (te-tp-id) + + YANG Description: TE LTP identifier. The combination of the TE link ID +and the TE node ID is used to identify an unnumbered +TE link. + """ + return self.__link_tp_id + + def _set_link_tp_id(self, v, load=False): + """ + Setter method for link_tp_id, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/backup_path/path_element/unnumbered_link_hop/link_tp_id (te-tp-id) + If this variable is read-only (config: false) in the + source YANG file, then _set_link_tp_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_link_tp_id() directly. + + YANG Description: TE LTP identifier. The combination of the TE link ID +and the TE node ID is used to identify an unnumbered +TE link. + """ + 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),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """link_tp_id must be of a type compatible with te-tp-id""", + 'defined-type': "ietf-te-topology:te-tp-id", + 'generated-type': """YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True)""", + }) + + self.__link_tp_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_link_tp_id(self): + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True) + + + def _get_node_id(self): + """ + Getter method for node_id, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/backup_path/path_element/unnumbered_link_hop/node_id (te-node-id) + + YANG Description: The identifier of a node in the TE topology. + """ + return self.__node_id + + def _set_node_id(self, v, load=False): + """ + Setter method for node_id, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/backup_path/path_element/unnumbered_link_hop/node_id (te-node-id) + 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. + + YANG Description: The identifier of a node in the TE topology. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """node_id must be of a type compatible with te-node-id""", + 'defined-type': "ietf-te-topology:te-node-id", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True)""", + }) + + self.__node_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_node_id(self): + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/backup_path/path_element/unnumbered_link_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/backup_path/path_element/unnumbered_link_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + 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={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + + + def _get_direction(self): + """ + Getter method for direction, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/backup_path/path_element/unnumbered_link_hop/direction (te-link-direction) + + YANG Description: Link route object direction. + """ + return self.__direction + + def _set_direction(self, v, load=False): + """ + Setter method for direction, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/backup_path/path_element/unnumbered_link_hop/direction (te-link-direction) + If this variable is read-only (config: false) in the + source YANG file, then _set_direction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_direction() directly. + + YANG Description: Link route object direction. + """ + 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={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """direction must be of a type compatible with te-link-direction""", + 'defined-type': "ietf-te-topology:te-link-direction", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True)""", + }) + + self.__direction = t + if hasattr(self, '_set'): + self._set() + + def _unset_direction(self): + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True) + + link_tp_id = __builtin__.property(_get_link_tp_id, _set_link_tp_id) + node_id = __builtin__.property(_get_node_id, _set_node_id) + hop_type = __builtin__.property(_get_hop_type, _set_hop_type) + direction = __builtin__.property(_get_direction, _set_direction) + + __choices__ = {'type': {'unnumbered-link-hop': ['link_tp_id', 'node_id', 'hop_type', 'direction']}} + _pyangbind_elements = OrderedDict([('link_tp_id', link_tp_id), ('node_id', node_id), ('hop_type', hop_type), ('direction', direction), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/primary_path/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/primary_path/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..56854b5857837e5cab85b13189ed10916c1438e6 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/primary_path/__init__.py @@ -0,0 +1,158 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 path_element +class primary_path(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/local-link-connectivity/underlay/primary-path. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: The service path on the underlay topology that +supports this link. + """ + __slots__ = ('_path_helper', '_extmethods', '__network_ref','__path_element',) + + _yang_name = 'primary-path' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__network_ref = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="network-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=True) + self.__path_element = YANGDynClass(base=YANGListType("path_element_id",path_element.path_element, yang_name="path-element", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='path-element-id', extensions=None), is_container='list', yang_name="path-element", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-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 ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'local-link-connectivity', 'underlay', 'primary-path'] + + def _get_network_ref(self): + """ + Getter method for network_ref, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/primary_path/network_ref (leafref) + + YANG Description: Used to reference a network -- for example, an underlay +network. + """ + return self.__network_ref + + def _set_network_ref(self, v, load=False): + """ + Setter method for network_ref, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/primary_path/network_ref (leafref) + If this variable is read-only (config: false) in the + source YANG file, then _set_network_ref is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_network_ref() directly. + + YANG Description: Used to reference a network -- for example, an underlay +network. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="network-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """network_ref must be of a type compatible with leafref""", + 'defined-type': "leafref", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="network-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=True)""", + }) + + self.__network_ref = t + if hasattr(self, '_set'): + self._set() + + def _unset_network_ref(self): + self.__network_ref = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="network-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=True) + + + def _get_path_element(self): + """ + Getter method for path_element, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/primary_path/path_element (list) + + YANG Description: A list of path elements describing the service path. + """ + return self.__path_element + + def _set_path_element(self, v, load=False): + """ + Setter method for path_element, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/primary_path/path_element (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_element is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_element() directly. + + YANG Description: A list of path elements describing the service path. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("path_element_id",path_element.path_element, yang_name="path-element", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='path-element-id', extensions=None), is_container='list', yang_name="path-element", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_element must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("path_element_id",path_element.path_element, yang_name="path-element", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='path-element-id', extensions=None), is_container='list', yang_name="path-element", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True)""", + }) + + self.__path_element = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_element(self): + self.__path_element = YANGDynClass(base=YANGListType("path_element_id",path_element.path_element, yang_name="path-element", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='path-element-id', extensions=None), is_container='list', yang_name="path-element", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + + network_ref = __builtin__.property(_get_network_ref, _set_network_ref) + path_element = __builtin__.property(_get_path_element, _set_path_element) + + + _pyangbind_elements = OrderedDict([('network_ref', network_ref), ('path_element', path_element), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/primary_path/path_element/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/primary_path/path_element/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..f54312b46f7a07411770ee27ee1f360b82c2b9d9 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/primary_path/path_element/__init__.py @@ -0,0 +1,320 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 numbered_node_hop +from . import numbered_link_hop +from . import unnumbered_link_hop +from . import as_number_hop +from . import label_hop +class path_element(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/local-link-connectivity/underlay/primary-path/path-element. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: A list of path elements describing the service path. + """ + __slots__ = ('_path_helper', '_extmethods', '__path_element_id','__numbered_node_hop','__numbered_link_hop','__unnumbered_link_hop','__as_number_hop','__label_hop',) + + _yang_name = 'path-element' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__path_element_id = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="path-element-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + self.__numbered_node_hop = YANGDynClass(base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__numbered_link_hop = YANGDynClass(base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__unnumbered_link_hop = YANGDynClass(base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__as_number_hop = YANGDynClass(base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__label_hop = YANGDynClass(base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-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 ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'local-link-connectivity', 'underlay', 'primary-path', 'path-element'] + + def _get_path_element_id(self): + """ + Getter method for path_element_id, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/primary_path/path_element/path_element_id (uint32) + + YANG Description: To identify the element in a path. + """ + return self.__path_element_id + + def _set_path_element_id(self, v, load=False): + """ + Setter method for path_element_id, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/primary_path/path_element/path_element_id (uint32) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_element_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_element_id() directly. + + YANG Description: To identify the element in a path. + """ + 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=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="path-element-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_element_id 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="path-element-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True)""", + }) + + self.__path_element_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_element_id(self): + self.__path_element_id = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="path-element-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + + + def _get_numbered_node_hop(self): + """ + Getter method for numbered_node_hop, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/primary_path/path_element/numbered_node_hop (container) + + YANG Description: Numbered node route hop. + """ + return self.__numbered_node_hop + + def _set_numbered_node_hop(self, v, load=False): + """ + Setter method for numbered_node_hop, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/primary_path/path_element/numbered_node_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_numbered_node_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_numbered_node_hop() directly. + + YANG Description: Numbered node route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """numbered_node_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__numbered_node_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_numbered_node_hop(self): + self.__numbered_node_hop = YANGDynClass(base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_numbered_link_hop(self): + """ + Getter method for numbered_link_hop, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/primary_path/path_element/numbered_link_hop (container) + + YANG Description: Numbered link explicit route hop. + """ + return self.__numbered_link_hop + + def _set_numbered_link_hop(self, v, load=False): + """ + Setter method for numbered_link_hop, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/primary_path/path_element/numbered_link_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_numbered_link_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_numbered_link_hop() directly. + + YANG Description: Numbered link explicit route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """numbered_link_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__numbered_link_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_numbered_link_hop(self): + self.__numbered_link_hop = YANGDynClass(base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_unnumbered_link_hop(self): + """ + Getter method for unnumbered_link_hop, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/primary_path/path_element/unnumbered_link_hop (container) + + YANG Description: Unnumbered link explicit route hop. + """ + return self.__unnumbered_link_hop + + def _set_unnumbered_link_hop(self, v, load=False): + """ + Setter method for unnumbered_link_hop, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/primary_path/path_element/unnumbered_link_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_unnumbered_link_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_unnumbered_link_hop() directly. + + YANG Description: Unnumbered link explicit route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """unnumbered_link_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__unnumbered_link_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_unnumbered_link_hop(self): + self.__unnumbered_link_hop = YANGDynClass(base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_as_number_hop(self): + """ + Getter method for as_number_hop, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/primary_path/path_element/as_number_hop (container) + + YANG Description: AS explicit route hop. + """ + return self.__as_number_hop + + def _set_as_number_hop(self, v, load=False): + """ + Setter method for as_number_hop, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/primary_path/path_element/as_number_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_as_number_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_as_number_hop() directly. + + YANG Description: AS explicit route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """as_number_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__as_number_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_as_number_hop(self): + self.__as_number_hop = YANGDynClass(base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_label_hop(self): + """ + Getter method for label_hop, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/primary_path/path_element/label_hop (container) + + YANG Description: Label hop type. + """ + return self.__label_hop + + def _set_label_hop(self, v, load=False): + """ + Setter method for label_hop, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/primary_path/path_element/label_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_label_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_label_hop() directly. + + YANG Description: Label hop type. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """label_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__label_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_label_hop(self): + self.__label_hop = YANGDynClass(base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + path_element_id = __builtin__.property(_get_path_element_id, _set_path_element_id) + numbered_node_hop = __builtin__.property(_get_numbered_node_hop, _set_numbered_node_hop) + numbered_link_hop = __builtin__.property(_get_numbered_link_hop, _set_numbered_link_hop) + unnumbered_link_hop = __builtin__.property(_get_unnumbered_link_hop, _set_unnumbered_link_hop) + as_number_hop = __builtin__.property(_get_as_number_hop, _set_as_number_hop) + label_hop = __builtin__.property(_get_label_hop, _set_label_hop) + + __choices__ = {'type': {'numbered-node-hop': ['numbered_node_hop'], 'numbered-link-hop': ['numbered_link_hop'], 'unnumbered-link-hop': ['unnumbered_link_hop'], 'as-number': ['as_number_hop'], 'label': ['label_hop']}} + _pyangbind_elements = OrderedDict([('path_element_id', path_element_id), ('numbered_node_hop', numbered_node_hop), ('numbered_link_hop', numbered_link_hop), ('unnumbered_link_hop', unnumbered_link_hop), ('as_number_hop', as_number_hop), ('label_hop', label_hop), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/primary_path/path_element/as_number_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/primary_path/path_element/as_number_hop/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..013370a26795f61d508e086d2eb10ec61207d3ae --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/primary_path/path_element/as_number_hop/__init__.py @@ -0,0 +1,154 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 as_number_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/local-link-connectivity/underlay/primary-path/path-element/as-number-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: AS explicit route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__as_number','__hop_type',) + + _yang_name = 'as-number-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__as_number = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=True) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', 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 ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'local-link-connectivity', 'underlay', 'primary-path', 'path-element', 'as-number-hop'] + + def _get_as_number(self): + """ + Getter method for as_number, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/primary_path/path_element/as_number_hop/as_number (inet:as-number) + + YANG Description: The Autonomous System (AS) number. + """ + return self.__as_number + + def _set_as_number(self, v, load=False): + """ + Setter method for as_number, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/primary_path/path_element/as_number_hop/as_number (inet:as-number) + If this variable is read-only (config: false) in the + source YANG file, then _set_as_number is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_as_number() directly. + + YANG Description: The Autonomous System (AS) number. + """ + 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="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """as_number must be of a type compatible with inet:as-number""", + 'defined-type': "inet:as-number", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=True)""", + }) + + self.__as_number = t + if hasattr(self, '_set'): + self._set() + + def _unset_as_number(self): + self.__as_number = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=True) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/primary_path/path_element/as_number_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/primary_path/path_element/as_number_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + 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={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + + as_number = __builtin__.property(_get_as_number, _set_as_number) + hop_type = __builtin__.property(_get_hop_type, _set_hop_type) + + __choices__ = {'type': {'as-number': ['as_number', 'hop_type']}} + _pyangbind_elements = OrderedDict([('as_number', as_number), ('hop_type', hop_type), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/primary_path/path_element/label_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/primary_path/path_element/label_hop/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..1f048ca63252d00b5550a102c254ac3970806d7a --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/primary_path/path_element/label_hop/__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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 te_label +class label_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/local-link-connectivity/underlay/primary-path/path-element/label-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Label hop type. + """ + __slots__ = ('_path_helper', '_extmethods', '__te_label',) + + _yang_name = 'label-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__te_label = YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-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 ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'local-link-connectivity', 'underlay', 'primary-path', 'path-element', 'label-hop'] + + def _get_te_label(self): + """ + Getter method for te_label, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/primary_path/path_element/label_hop/te_label (container) + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + return self.__te_label + + def _set_te_label(self, v, load=False): + """ + Setter method for te_label, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/primary_path/path_element/label_hop/te_label (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_te_label is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_te_label() directly. + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """te_label must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__te_label = t + if hasattr(self, '_set'): + self._set() + + def _unset_te_label(self): + self.__te_label = YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + te_label = __builtin__.property(_get_te_label, _set_te_label) + + __choices__ = {'type': {'label': ['te_label']}} + _pyangbind_elements = OrderedDict([('te_label', te_label), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/primary_path/path_element/label_hop/te_label/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/primary_path/path_element/label_hop/te_label/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..345fd6279609dfb0ceb951b29996de73856cc0cb --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/primary_path/path_element/label_hop/te_label/__init__.py @@ -0,0 +1,234 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 otn +class te_label(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/local-link-connectivity/underlay/primary-path/path-element/label-hop/te-label. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + __slots__ = ('_path_helper', '_extmethods', '__generic','__otn','__vlanid','__direction',) + + _yang_name = 'te-label' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__generic = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True) + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + self.__vlanid = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True) + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', 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 ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'local-link-connectivity', 'underlay', 'primary-path', 'path-element', 'label-hop', 'te-label'] + + def _get_generic(self): + """ + Getter method for generic, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/primary_path/path_element/label_hop/te_label/generic (rt-types:generalized-label) + + YANG Description: TE label specified in a generic format. + """ + return self.__generic + + def _set_generic(self, v, load=False): + """ + Setter method for generic, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/primary_path/path_element/label_hop/te_label/generic (rt-types:generalized-label) + If this variable is read-only (config: false) in the + source YANG file, then _set_generic is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_generic() directly. + + YANG Description: TE label specified in a generic format. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """generic must be of a type compatible with rt-types:generalized-label""", + 'defined-type': "rt-types:generalized-label", + 'generated-type': """YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True)""", + }) + + self.__generic = t + if hasattr(self, '_set'): + self._set() + + def _unset_generic(self): + self.__generic = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True) + + + def _get_otn(self): + """ + Getter method for otn, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/primary_path/path_element/label_hop/te_label/otn (container) + + YANG Description: Label hop for OTN. + """ + return self.__otn + + def _set_otn(self, v, load=False): + """ + Setter method for otn, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/primary_path/path_element/label_hop/te_label/otn (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_otn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_otn() directly. + + YANG Description: Label hop for OTN. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """otn must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True)""", + }) + + self.__otn = t + if hasattr(self, '_set'): + self._set() + + def _unset_otn(self): + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + + + def _get_vlanid(self): + """ + Getter method for vlanid, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/primary_path/path_element/label_hop/te_label/vlanid (etht-types:vlanid) + + YANG Description: VLAN tag id. + """ + return self.__vlanid + + def _set_vlanid(self, v, load=False): + """ + Setter method for vlanid, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/primary_path/path_element/label_hop/te_label/vlanid (etht-types:vlanid) + If this variable is read-only (config: false) in the + source YANG file, then _set_vlanid is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_vlanid() directly. + + YANG Description: VLAN tag id. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """vlanid must be of a type compatible with etht-types:vlanid""", + 'defined-type': "etht-types:vlanid", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True)""", + }) + + self.__vlanid = t + if hasattr(self, '_set'): + self._set() + + def _unset_vlanid(self): + self.__vlanid = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True) + + + def _get_direction(self): + """ + Getter method for direction, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/primary_path/path_element/label_hop/te_label/direction (te-label-direction) + + YANG Description: Label direction. + """ + return self.__direction + + def _set_direction(self, v, load=False): + """ + Setter method for direction, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/primary_path/path_element/label_hop/te_label/direction (te-label-direction) + If this variable is read-only (config: false) in the + source YANG file, then _set_direction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_direction() directly. + + YANG Description: Label direction. + """ + 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={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """direction must be of a type compatible with te-label-direction""", + 'defined-type': "ietf-te-topology:te-label-direction", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=True)""", + }) + + self.__direction = t + if hasattr(self, '_set'): + self._set() + + def _unset_direction(self): + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=True) + + generic = __builtin__.property(_get_generic, _set_generic) + otn = __builtin__.property(_get_otn, _set_otn) + vlanid = __builtin__.property(_get_vlanid, _set_vlanid) + direction = __builtin__.property(_get_direction, _set_direction) + + __choices__ = {'technology': {'generic': ['generic'], 'otn': ['otn'], 'eth': ['vlanid']}, 'type': {'label': ['direction']}} + _pyangbind_elements = OrderedDict([('generic', generic), ('otn', otn), ('vlanid', vlanid), ('direction', direction), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/primary_path/path_element/label_hop/te_label/otn/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/primary_path/path_element/label_hop/te_label/otn/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..453fa07179533dcb2a64017fd255b526f929442f --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/primary_path/path_element/label_hop/te_label/otn/__init__.py @@ -0,0 +1,209 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 otn(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/local-link-connectivity/underlay/primary-path/path-element/label-hop/te-label/otn. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Label hop for OTN. + """ + __slots__ = ('_path_helper', '_extmethods', '__tpn','__tsg','__ts_list',) + + _yang_name = 'otn' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__tpn = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True) + self.__tsg = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + self.__ts_list = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-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 ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'local-link-connectivity', 'underlay', 'primary-path', 'path-element', 'label-hop', 'te-label', 'otn'] + + def _get_tpn(self): + """ + Getter method for tpn, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/primary_path/path_element/label_hop/te_label/otn/tpn (otn-tpn) + + YANG Description: Tributary Port Number (TPN). + """ + return self.__tpn + + def _set_tpn(self, v, load=False): + """ + Setter method for tpn, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/primary_path/path_element/label_hop/te_label/otn/tpn (otn-tpn) + If this variable is read-only (config: false) in the + source YANG file, then _set_tpn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tpn() directly. + + YANG Description: Tributary Port Number (TPN). + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tpn must be of a type compatible with otn-tpn""", + 'defined-type': "ietf-otn-topology:otn-tpn", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True)""", + }) + + self.__tpn = t + if hasattr(self, '_set'): + self._set() + + def _unset_tpn(self): + self.__tpn = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True) + + + def _get_tsg(self): + """ + Getter method for tsg, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/primary_path/path_element/label_hop/te_label/otn/tsg (identityref) + + YANG Description: Tributary Slot Granularity (TSG). + """ + return self.__tsg + + def _set_tsg(self, v, load=False): + """ + Setter method for tsg, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/primary_path/path_element/label_hop/te_label/otn/tsg (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_tsg is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tsg() directly. + + YANG Description: Tributary Slot Granularity (TSG). + """ + 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={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tsg must be of a type compatible with identityref""", + 'defined-type': "ietf-otn-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True)""", + }) + + self.__tsg = t + if hasattr(self, '_set'): + self._set() + + def _unset_tsg(self): + self.__tsg = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + + + def _get_ts_list(self): + """ + Getter method for ts_list, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/primary_path/path_element/label_hop/te_label/otn/ts_list (string) + + YANG Description: A list of available Tributary Slots (TS) ranging + + + + +between 1 and 4095. If multiple values or +ranges are given, they all MUST be disjoint +and MUST be in ascending order. +For example 1-20,25,50-1000. + """ + return self.__ts_list + + def _set_ts_list(self, v, load=False): + """ + Setter method for ts_list, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/primary_path/path_element/label_hop/te_label/otn/ts_list (string) + If this variable is read-only (config: false) in the + source YANG file, then _set_ts_list is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_ts_list() directly. + + YANG Description: A list of available Tributary Slots (TS) ranging + + + + +between 1 and 4095. If multiple values or +ranges are given, they all MUST be disjoint +and MUST be in ascending order. +For example 1-20,25,50-1000. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='string', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """ts_list must be of a type compatible with string""", + 'defined-type': "string", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='string', is_config=True)""", + }) + + self.__ts_list = t + if hasattr(self, '_set'): + self._set() + + def _unset_ts_list(self): + self.__ts_list = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='string', is_config=True) + + tpn = __builtin__.property(_get_tpn, _set_tpn) + tsg = __builtin__.property(_get_tsg, _set_tsg) + ts_list = __builtin__.property(_get_ts_list, _set_ts_list) + + __choices__ = {'technology': {'otn': ['tpn', 'tsg', 'ts_list']}} + _pyangbind_elements = OrderedDict([('tpn', tpn), ('tsg', tsg), ('ts_list', ts_list), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/primary_path/path_element/numbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/primary_path/path_element/numbered_link_hop/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..1e222d4341ea9807e87a41d694ce1fddf93874ee --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/primary_path/path_element/numbered_link_hop/__init__.py @@ -0,0 +1,193 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 numbered_link_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/local-link-connectivity/underlay/primary-path/path-element/numbered-link-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Numbered link explicit route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__link_tp_id','__hop_type','__direction',) + + _yang_name = 'numbered-link-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', 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 ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'local-link-connectivity', 'underlay', 'primary-path', 'path-element', 'numbered-link-hop'] + + def _get_link_tp_id(self): + """ + Getter method for link_tp_id, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/primary_path/path_element/numbered_link_hop/link_tp_id (te-tp-id) + + YANG Description: TE Link Termination Point (LTP) identifier. + """ + return self.__link_tp_id + + def _set_link_tp_id(self, v, load=False): + """ + Setter method for link_tp_id, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/primary_path/path_element/numbered_link_hop/link_tp_id (te-tp-id) + If this variable is read-only (config: false) in the + source YANG file, then _set_link_tp_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_link_tp_id() directly. + + YANG Description: TE Link Termination Point (LTP) identifier. + """ + 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),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """link_tp_id must be of a type compatible with te-tp-id""", + 'defined-type': "ietf-te-topology:te-tp-id", + 'generated-type': """YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True)""", + }) + + self.__link_tp_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_link_tp_id(self): + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/primary_path/path_element/numbered_link_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/primary_path/path_element/numbered_link_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + 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={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + + + def _get_direction(self): + """ + Getter method for direction, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/primary_path/path_element/numbered_link_hop/direction (te-link-direction) + + YANG Description: Link route object direction. + """ + return self.__direction + + def _set_direction(self, v, load=False): + """ + Setter method for direction, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/primary_path/path_element/numbered_link_hop/direction (te-link-direction) + If this variable is read-only (config: false) in the + source YANG file, then _set_direction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_direction() directly. + + YANG Description: Link route object direction. + """ + 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={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """direction must be of a type compatible with te-link-direction""", + 'defined-type': "ietf-te-topology:te-link-direction", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True)""", + }) + + self.__direction = t + if hasattr(self, '_set'): + self._set() + + def _unset_direction(self): + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True) + + link_tp_id = __builtin__.property(_get_link_tp_id, _set_link_tp_id) + hop_type = __builtin__.property(_get_hop_type, _set_hop_type) + direction = __builtin__.property(_get_direction, _set_direction) + + __choices__ = {'type': {'numbered-link-hop': ['link_tp_id', 'hop_type', 'direction']}} + _pyangbind_elements = OrderedDict([('link_tp_id', link_tp_id), ('hop_type', hop_type), ('direction', direction), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/primary_path/path_element/numbered_node_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/primary_path/path_element/numbered_node_hop/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..fdc5c17286825e797e93cb16dabec136e84ba130 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/primary_path/path_element/numbered_node_hop/__init__.py @@ -0,0 +1,154 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 numbered_node_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/local-link-connectivity/underlay/primary-path/path-element/numbered-node-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Numbered node route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__node_id','__hop_type',) + + _yang_name = 'numbered-node-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', 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 ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'local-link-connectivity', 'underlay', 'primary-path', 'path-element', 'numbered-node-hop'] + + def _get_node_id(self): + """ + Getter method for node_id, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/primary_path/path_element/numbered_node_hop/node_id (te-node-id) + + YANG Description: The identifier of a node in the TE topology. + """ + return self.__node_id + + def _set_node_id(self, v, load=False): + """ + Setter method for node_id, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/primary_path/path_element/numbered_node_hop/node_id (te-node-id) + 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. + + YANG Description: The identifier of a node in the TE topology. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """node_id must be of a type compatible with te-node-id""", + 'defined-type': "ietf-te-topology:te-node-id", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True)""", + }) + + self.__node_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_node_id(self): + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/primary_path/path_element/numbered_node_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/primary_path/path_element/numbered_node_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + 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={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + + node_id = __builtin__.property(_get_node_id, _set_node_id) + hop_type = __builtin__.property(_get_hop_type, _set_hop_type) + + __choices__ = {'type': {'numbered-node-hop': ['node_id', 'hop_type']}} + _pyangbind_elements = OrderedDict([('node_id', node_id), ('hop_type', hop_type), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/primary_path/path_element/unnumbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/primary_path/path_element/unnumbered_link_hop/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..1f41ade4f487d23a00cee5856b9509b64fc00fe5 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/primary_path/path_element/unnumbered_link_hop/__init__.py @@ -0,0 +1,236 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 unnumbered_link_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/local-link-connectivity/underlay/primary-path/path-element/unnumbered-link-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Unnumbered link explicit route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__link_tp_id','__node_id','__hop_type','__direction',) + + _yang_name = 'unnumbered-link-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True) + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', 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 ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'local-link-connectivity', 'underlay', 'primary-path', 'path-element', 'unnumbered-link-hop'] + + def _get_link_tp_id(self): + """ + Getter method for link_tp_id, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/primary_path/path_element/unnumbered_link_hop/link_tp_id (te-tp-id) + + YANG Description: TE LTP identifier. The combination of the TE link ID +and the TE node ID is used to identify an unnumbered +TE link. + """ + return self.__link_tp_id + + def _set_link_tp_id(self, v, load=False): + """ + Setter method for link_tp_id, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/primary_path/path_element/unnumbered_link_hop/link_tp_id (te-tp-id) + If this variable is read-only (config: false) in the + source YANG file, then _set_link_tp_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_link_tp_id() directly. + + YANG Description: TE LTP identifier. The combination of the TE link ID +and the TE node ID is used to identify an unnumbered +TE link. + """ + 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),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """link_tp_id must be of a type compatible with te-tp-id""", + 'defined-type': "ietf-te-topology:te-tp-id", + 'generated-type': """YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True)""", + }) + + self.__link_tp_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_link_tp_id(self): + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True) + + + def _get_node_id(self): + """ + Getter method for node_id, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/primary_path/path_element/unnumbered_link_hop/node_id (te-node-id) + + YANG Description: The identifier of a node in the TE topology. + """ + return self.__node_id + + def _set_node_id(self, v, load=False): + """ + Setter method for node_id, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/primary_path/path_element/unnumbered_link_hop/node_id (te-node-id) + 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. + + YANG Description: The identifier of a node in the TE topology. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """node_id must be of a type compatible with te-node-id""", + 'defined-type': "ietf-te-topology:te-node-id", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True)""", + }) + + self.__node_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_node_id(self): + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/primary_path/path_element/unnumbered_link_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/primary_path/path_element/unnumbered_link_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + 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={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + + + def _get_direction(self): + """ + Getter method for direction, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/primary_path/path_element/unnumbered_link_hop/direction (te-link-direction) + + YANG Description: Link route object direction. + """ + return self.__direction + + def _set_direction(self, v, load=False): + """ + Setter method for direction, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/primary_path/path_element/unnumbered_link_hop/direction (te-link-direction) + If this variable is read-only (config: false) in the + source YANG file, then _set_direction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_direction() directly. + + YANG Description: Link route object direction. + """ + 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={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """direction must be of a type compatible with te-link-direction""", + 'defined-type': "ietf-te-topology:te-link-direction", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True)""", + }) + + self.__direction = t + if hasattr(self, '_set'): + self._set() + + def _unset_direction(self): + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True) + + link_tp_id = __builtin__.property(_get_link_tp_id, _set_link_tp_id) + node_id = __builtin__.property(_get_node_id, _set_node_id) + hop_type = __builtin__.property(_get_hop_type, _set_hop_type) + direction = __builtin__.property(_get_direction, _set_direction) + + __choices__ = {'type': {'unnumbered-link-hop': ['link_tp_id', 'node_id', 'hop_type', 'direction']}} + _pyangbind_elements = OrderedDict([('link_tp_id', link_tp_id), ('node_id', node_id), ('hop_type', hop_type), ('direction', direction), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/tunnel_termination_points/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/tunnel_termination_points/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..f0ae851c18fa662017979f10868a8a46fb0f2432 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/tunnel_termination_points/__init__.py @@ -0,0 +1,154 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 tunnel_termination_points(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/local-link-connectivity/underlay/tunnel-termination-points. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Underlay TTPs desired for this link. + """ + __slots__ = ('_path_helper', '_extmethods', '__source','__destination',) + + _yang_name = 'tunnel-termination-points' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__source = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="source", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='binary', is_config=True) + self.__destination = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="destination", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='binary', 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 ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'local-link-connectivity', 'underlay', 'tunnel-termination-points'] + + def _get_source(self): + """ + Getter method for source, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/tunnel_termination_points/source (binary) + + YANG Description: Source TTP identifier. + """ + return self.__source + + def _set_source(self, v, load=False): + """ + Setter method for source, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/tunnel_termination_points/source (binary) + If this variable is read-only (config: false) in the + source YANG file, then _set_source is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_source() directly. + + YANG Description: Source TTP identifier. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBinary, is_leaf=True, yang_name="source", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='binary', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """source must be of a type compatible with binary""", + 'defined-type': "binary", + 'generated-type': """YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="source", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='binary', is_config=True)""", + }) + + self.__source = t + if hasattr(self, '_set'): + self._set() + + def _unset_source(self): + self.__source = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="source", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='binary', is_config=True) + + + def _get_destination(self): + """ + Getter method for destination, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/tunnel_termination_points/destination (binary) + + YANG Description: Destination TTP identifier. + """ + return self.__destination + + def _set_destination(self, v, load=False): + """ + Setter method for destination, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/tunnel_termination_points/destination (binary) + If this variable is read-only (config: false) in the + source YANG file, then _set_destination is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_destination() directly. + + YANG Description: Destination TTP identifier. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBinary, is_leaf=True, yang_name="destination", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='binary', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """destination must be of a type compatible with binary""", + 'defined-type': "binary", + 'generated-type': """YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="destination", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='binary', is_config=True)""", + }) + + self.__destination = t + if hasattr(self, '_set'): + self._set() + + def _unset_destination(self): + self.__destination = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="destination", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='binary', is_config=True) + + source = __builtin__.property(_get_source, _set_source) + destination = __builtin__.property(_get_destination, _set_destination) + + + _pyangbind_elements = OrderedDict([('source', source), ('destination', destination), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/tunnels/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/tunnels/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..b49e97083a810c0ea140cb33745f326de12b0151 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/tunnels/__init__.py @@ -0,0 +1,167 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 tunnel +class tunnels(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/local-link-connectivity/underlay/tunnels. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Underlay TE tunnels supporting this TE link. + """ + __slots__ = ('_path_helper', '_extmethods', '__sharing','__tunnel',) + + _yang_name = 'tunnels' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__sharing = YANGDynClass(base=YANGBool, default=YANGBool("true"), is_leaf=True, yang_name="sharing", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='boolean', is_config=True) + self.__tunnel = YANGDynClass(base=YANGListType("tunnel_name",tunnel.tunnel, yang_name="tunnel", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='tunnel-name', extensions=None), is_container='list', yang_name="tunnel", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-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 ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'local-link-connectivity', 'underlay', 'tunnels'] + + def _get_sharing(self): + """ + Getter method for sharing, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/tunnels/sharing (boolean) + + YANG Description: 'true' if the underlay tunnel can be shared with other +TE links; +'false' if the underlay tunnel is dedicated to this +TE link. +This leaf is the default option for all TE tunnels +and may be overridden by the per-TE-tunnel value. + """ + return self.__sharing + + def _set_sharing(self, v, load=False): + """ + Setter method for sharing, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/tunnels/sharing (boolean) + If this variable is read-only (config: false) in the + source YANG file, then _set_sharing is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_sharing() directly. + + YANG Description: 'true' if the underlay tunnel can be shared with other +TE links; +'false' if the underlay tunnel is dedicated to this +TE link. +This leaf is the default option for all TE tunnels +and may be overridden by the per-TE-tunnel value. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBool, default=YANGBool("true"), is_leaf=True, yang_name="sharing", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='boolean', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """sharing must be of a type compatible with boolean""", + 'defined-type': "boolean", + 'generated-type': """YANGDynClass(base=YANGBool, default=YANGBool("true"), is_leaf=True, yang_name="sharing", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='boolean', is_config=True)""", + }) + + self.__sharing = t + if hasattr(self, '_set'): + self._set() + + def _unset_sharing(self): + self.__sharing = YANGDynClass(base=YANGBool, default=YANGBool("true"), is_leaf=True, yang_name="sharing", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='boolean', is_config=True) + + + def _get_tunnel(self): + """ + Getter method for tunnel, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/tunnels/tunnel (list) + + YANG Description: Zero, one, or more underlay TE tunnels that support this +TE link. + """ + return self.__tunnel + + def _set_tunnel(self, v, load=False): + """ + Setter method for tunnel, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/tunnels/tunnel (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_tunnel is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tunnel() directly. + + YANG Description: Zero, one, or more underlay TE tunnels that support this +TE link. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("tunnel_name",tunnel.tunnel, yang_name="tunnel", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='tunnel-name', extensions=None), is_container='list', yang_name="tunnel", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tunnel must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("tunnel_name",tunnel.tunnel, yang_name="tunnel", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='tunnel-name', extensions=None), is_container='list', yang_name="tunnel", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True)""", + }) + + self.__tunnel = t + if hasattr(self, '_set'): + self._set() + + def _unset_tunnel(self): + self.__tunnel = YANGDynClass(base=YANGListType("tunnel_name",tunnel.tunnel, yang_name="tunnel", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='tunnel-name', extensions=None), is_container='list', yang_name="tunnel", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + + sharing = __builtin__.property(_get_sharing, _set_sharing) + tunnel = __builtin__.property(_get_tunnel, _set_tunnel) + + + _pyangbind_elements = OrderedDict([('sharing', sharing), ('tunnel', tunnel), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/tunnels/tunnel/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/tunnels/tunnel/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..bc8bc8ecbd670ac03bab9bba8daf41436e1924ab --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/tunnels/tunnel/__init__.py @@ -0,0 +1,170 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 tunnel(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/local-link-connectivity/underlay/tunnels/tunnel. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Zero, one, or more underlay TE tunnels that support this +TE link. + """ + __slots__ = ('_path_helper', '_extmethods', '__tunnel_name','__sharing',) + + _yang_name = 'tunnel' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__tunnel_name = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="tunnel-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=True) + self.__sharing = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="sharing", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', 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 ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'local-link-connectivity', 'underlay', 'tunnels', 'tunnel'] + + def _get_tunnel_name(self): + """ + Getter method for tunnel_name, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/tunnels/tunnel/tunnel_name (string) + + YANG Description: A tunnel name uniquely identifies an underlay TE tunnel, +used together with the 'source-node' value for this +link. + """ + return self.__tunnel_name + + def _set_tunnel_name(self, v, load=False): + """ + Setter method for tunnel_name, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/tunnels/tunnel/tunnel_name (string) + If this variable is read-only (config: false) in the + source YANG file, then _set_tunnel_name is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tunnel_name() directly. + + YANG Description: A tunnel name uniquely identifies an underlay TE tunnel, +used together with the 'source-node' value for this +link. + """ + 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="tunnel-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tunnel_name must be of a type compatible with string""", + 'defined-type': "string", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="tunnel-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=True)""", + }) + + self.__tunnel_name = t + if hasattr(self, '_set'): + self._set() + + def _unset_tunnel_name(self): + self.__tunnel_name = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="tunnel-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=True) + + + def _get_sharing(self): + """ + Getter method for sharing, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/tunnels/tunnel/sharing (boolean) + + YANG Description: 'true' if the underlay tunnel can be shared with other +TE links; +'false' if the underlay tunnel is dedicated to this +TE link. + """ + return self.__sharing + + def _set_sharing(self, v, load=False): + """ + Setter method for sharing, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/tunnels/tunnel/sharing (boolean) + If this variable is read-only (config: false) in the + source YANG file, then _set_sharing is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_sharing() directly. + + YANG Description: 'true' if the underlay tunnel can be shared with other +TE links; +'false' if the underlay tunnel is dedicated to this +TE link. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBool, is_leaf=True, yang_name="sharing", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='boolean', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """sharing must be of a type compatible with boolean""", + 'defined-type': "boolean", + 'generated-type': """YANGDynClass(base=YANGBool, is_leaf=True, yang_name="sharing", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='boolean', is_config=True)""", + }) + + self.__sharing = t + if hasattr(self, '_set'): + self._set() + + def _unset_sharing(self): + self.__sharing = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="sharing", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='boolean', is_config=True) + + tunnel_name = __builtin__.property(_get_tunnel_name, _set_tunnel_name) + sharing = __builtin__.property(_get_sharing, _set_sharing) + + + _pyangbind_elements = OrderedDict([('tunnel_name', tunnel_name), ('sharing', sharing), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..5ed824918759d90f3e7cfbaa93f66622c3698763 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/__init__.py @@ -0,0 +1,199 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 optimization_metric +from . import tiebreakers +from . import objective_function +class optimizations(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/optimizations. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: The objective function container that includes +attributes to impose when computing a TE path. + """ + __slots__ = ('_path_helper', '_extmethods', '__optimization_metric','__tiebreakers','__objective_function',) + + _yang_name = 'optimizations' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__optimization_metric = YANGDynClass(base=YANGListType("metric_type",optimization_metric.optimization_metric, yang_name="optimization-metric", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='metric-type', extensions=None, choice=False), is_container='list', yang_name="optimization-metric", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + self.__tiebreakers = YANGDynClass(base=tiebreakers.tiebreakers, is_container='container', yang_name="tiebreakers", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__objective_function = YANGDynClass(base=objective_function.objective_function, is_container='container', yang_name="objective-function", parent=self, choice=('algorithm', 'objective-function'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-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 ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'optimizations'] + + def _get_optimization_metric(self): + """ + Getter method for optimization_metric, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric (list) + + YANG Description: TE path metric type. + """ + return self.__optimization_metric + + def _set_optimization_metric(self, v, load=False): + """ + Setter method for optimization_metric, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_optimization_metric is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_optimization_metric() directly. + + YANG Description: TE path metric type. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("metric_type",optimization_metric.optimization_metric, yang_name="optimization-metric", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='metric-type', extensions=None, choice=False), is_container='list', yang_name="optimization-metric", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """optimization_metric must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("metric_type",optimization_metric.optimization_metric, yang_name="optimization-metric", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='metric-type', extensions=None, choice=False), is_container='list', yang_name="optimization-metric", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True)""", + }) + + self.__optimization_metric = t + if hasattr(self, '_set'): + self._set() + + def _unset_optimization_metric(self): + self.__optimization_metric = YANGDynClass(base=YANGListType("metric_type",optimization_metric.optimization_metric, yang_name="optimization-metric", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='metric-type', extensions=None, choice=False), is_container='list', yang_name="optimization-metric", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + + + def _get_tiebreakers(self): + """ + Getter method for tiebreakers, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/tiebreakers (container) + + YANG Description: Container for the list of tiebreakers. + """ + return self.__tiebreakers + + def _set_tiebreakers(self, v, load=False): + """ + Setter method for tiebreakers, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/tiebreakers (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_tiebreakers is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tiebreakers() directly. + + YANG Description: Container for the list of tiebreakers. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=tiebreakers.tiebreakers, is_container='container', yang_name="tiebreakers", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tiebreakers must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=tiebreakers.tiebreakers, is_container='container', yang_name="tiebreakers", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__tiebreakers = t + if hasattr(self, '_set'): + self._set() + + def _unset_tiebreakers(self): + self.__tiebreakers = YANGDynClass(base=tiebreakers.tiebreakers, is_container='container', yang_name="tiebreakers", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_objective_function(self): + """ + Getter method for objective_function, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/objective_function (container) + + YANG Description: The objective function container that includes +attributes to impose when computing a TE path. + """ + return self.__objective_function + + def _set_objective_function(self, v, load=False): + """ + Setter method for objective_function, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/objective_function (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_objective_function is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_objective_function() directly. + + YANG Description: The objective function container that includes +attributes to impose when computing a TE path. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=objective_function.objective_function, is_container='container', yang_name="objective-function", parent=self, choice=('algorithm', 'objective-function'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """objective_function must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=objective_function.objective_function, is_container='container', yang_name="objective-function", parent=self, choice=('algorithm', 'objective-function'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__objective_function = t + if hasattr(self, '_set'): + self._set() + + def _unset_objective_function(self): + self.__objective_function = YANGDynClass(base=objective_function.objective_function, is_container='container', yang_name="objective-function", parent=self, choice=('algorithm', 'objective-function'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + optimization_metric = __builtin__.property(_get_optimization_metric, _set_optimization_metric) + tiebreakers = __builtin__.property(_get_tiebreakers, _set_tiebreakers) + objective_function = __builtin__.property(_get_objective_function, _set_objective_function) + + __choices__ = {'algorithm': {'metric': ['optimization_metric', 'tiebreakers'], 'objective-function': ['objective_function']}} + _pyangbind_elements = OrderedDict([('optimization_metric', optimization_metric), ('tiebreakers', tiebreakers), ('objective_function', objective_function), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/objective_function/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/objective_function/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..3c10569db3b8424d75a3241100ff3348ed909997 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/objective_function/__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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 objective_function(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/optimizations/objective-function. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: The objective function container that includes +attributes to impose when computing a TE path. + """ + __slots__ = ('_path_helper', '_extmethods', '__objective_function_type',) + + _yang_name = 'objective-function' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__objective_function_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'of-minimize-cost-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-cost-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-cost-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-minimize-load-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-load-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-load-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-maximize-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-maximize-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-maximize-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-minimize-agg-bandwidth-consumption': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-agg-bandwidth-consumption': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-agg-bandwidth-consumption': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-minimize-load-most-loaded-link': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-load-most-loaded-link': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-load-most-loaded-link': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-minimize-cost-path-set': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-cost-path-set': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-cost-path-set': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), default=six.text_type("te-types:of-minimize-cost-path"), is_leaf=True, yang_name="objective-function-type", parent=self, choice=('algorithm', 'objective-function'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', 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 ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'optimizations', 'objective-function'] + + def _get_objective_function_type(self): + """ + Getter method for objective_function_type, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/objective_function/objective_function_type (identityref) + + YANG Description: Objective function entry. + """ + return self.__objective_function_type + + def _set_objective_function_type(self, v, load=False): + """ + Setter method for objective_function_type, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/objective_function/objective_function_type (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_objective_function_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_objective_function_type() directly. + + YANG Description: Objective function entry. + """ + 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={'of-minimize-cost-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-cost-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-cost-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-minimize-load-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-load-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-load-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-maximize-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-maximize-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-maximize-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-minimize-agg-bandwidth-consumption': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-agg-bandwidth-consumption': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-agg-bandwidth-consumption': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-minimize-load-most-loaded-link': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-load-most-loaded-link': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-load-most-loaded-link': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-minimize-cost-path-set': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-cost-path-set': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-cost-path-set': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), default=six.text_type("te-types:of-minimize-cost-path"), is_leaf=True, yang_name="objective-function-type", parent=self, choice=('algorithm', 'objective-function'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """objective_function_type must be of a type compatible with identityref""", + 'defined-type': "ietf-te-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'of-minimize-cost-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-cost-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-cost-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-minimize-load-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-load-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-load-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-maximize-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-maximize-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-maximize-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-minimize-agg-bandwidth-consumption': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-agg-bandwidth-consumption': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-agg-bandwidth-consumption': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-minimize-load-most-loaded-link': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-load-most-loaded-link': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-load-most-loaded-link': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-minimize-cost-path-set': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-cost-path-set': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-cost-path-set': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), default=six.text_type("te-types:of-minimize-cost-path"), is_leaf=True, yang_name="objective-function-type", parent=self, choice=('algorithm', 'objective-function'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True)""", + }) + + self.__objective_function_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_objective_function_type(self): + self.__objective_function_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'of-minimize-cost-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-cost-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-cost-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-minimize-load-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-load-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-load-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-maximize-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-maximize-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-maximize-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-minimize-agg-bandwidth-consumption': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-agg-bandwidth-consumption': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-agg-bandwidth-consumption': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-minimize-load-most-loaded-link': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-load-most-loaded-link': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-load-most-loaded-link': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-minimize-cost-path-set': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-cost-path-set': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-cost-path-set': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), default=six.text_type("te-types:of-minimize-cost-path"), is_leaf=True, yang_name="objective-function-type", parent=self, choice=('algorithm', 'objective-function'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + + objective_function_type = __builtin__.property(_get_objective_function_type, _set_objective_function_type) + + __choices__ = {'algorithm': {'objective-function': ['objective_function_type']}} + _pyangbind_elements = OrderedDict([('objective_function_type', objective_function_type), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..abb419890db7c10441efe74dc76a073b4087d58c --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/__init__.py @@ -0,0 +1,241 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 explicit_route_exclude_objects +from . import explicit_route_include_objects +class optimization_metric(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/optimizations/optimization-metric. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: TE path metric type. + """ + __slots__ = ('_path_helper', '_extmethods', '__metric_type','__weight','__explicit_route_exclude_objects','__explicit_route_include_objects',) + + _yang_name = 'optimization-metric' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__metric_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="metric-type", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + self.__weight = YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), default=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8)(1), is_leaf=True, yang_name="weight", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint8', is_config=True) + self.__explicit_route_exclude_objects = YANGDynClass(base=explicit_route_exclude_objects.explicit_route_exclude_objects, is_container='container', yang_name="explicit-route-exclude-objects", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__explicit_route_include_objects = YANGDynClass(base=explicit_route_include_objects.explicit_route_include_objects, is_container='container', yang_name="explicit-route-include-objects", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-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 ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'optimizations', 'optimization-metric'] + + def _get_metric_type(self): + """ + Getter method for metric_type, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/metric_type (identityref) + + YANG Description: Identifies the 'metric-type' that the path computation +process uses for optimization. + """ + return self.__metric_type + + def _set_metric_type(self, v, load=False): + """ + Setter method for metric_type, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/metric_type (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_metric_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_metric_type() directly. + + YANG Description: Identifies the 'metric-type' that the path computation +process uses for optimization. + """ + 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=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="metric-type", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """metric_type must be of a type compatible with identityref""", + 'defined-type': "ietf-te-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="metric-type", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True)""", + }) + + self.__metric_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_metric_type(self): + self.__metric_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="metric-type", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + + + def _get_weight(self): + """ + Getter method for weight, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/weight (uint8) + + YANG Description: TE path metric normalization weight. + """ + return self.__weight + + def _set_weight(self, v, load=False): + """ + Setter method for weight, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/weight (uint8) + If this variable is read-only (config: false) in the + source YANG file, then _set_weight is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_weight() directly. + + YANG Description: TE path metric normalization weight. + """ + 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), default=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8)(1), is_leaf=True, yang_name="weight", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint8', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """weight 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), default=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8)(1), is_leaf=True, yang_name="weight", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint8', is_config=True)""", + }) + + self.__weight = t + if hasattr(self, '_set'): + self._set() + + def _unset_weight(self): + self.__weight = YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), default=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8)(1), is_leaf=True, yang_name="weight", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint8', is_config=True) + + + def _get_explicit_route_exclude_objects(self): + """ + Getter method for explicit_route_exclude_objects, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_exclude_objects (container) + + YANG Description: Container for the 'exclude route' object list. + """ + return self.__explicit_route_exclude_objects + + def _set_explicit_route_exclude_objects(self, v, load=False): + """ + Setter method for explicit_route_exclude_objects, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_exclude_objects (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_explicit_route_exclude_objects is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_explicit_route_exclude_objects() directly. + + YANG Description: Container for the 'exclude route' object list. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=explicit_route_exclude_objects.explicit_route_exclude_objects, is_container='container', yang_name="explicit-route-exclude-objects", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """explicit_route_exclude_objects must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=explicit_route_exclude_objects.explicit_route_exclude_objects, is_container='container', yang_name="explicit-route-exclude-objects", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__explicit_route_exclude_objects = t + if hasattr(self, '_set'): + self._set() + + def _unset_explicit_route_exclude_objects(self): + self.__explicit_route_exclude_objects = YANGDynClass(base=explicit_route_exclude_objects.explicit_route_exclude_objects, is_container='container', yang_name="explicit-route-exclude-objects", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_explicit_route_include_objects(self): + """ + Getter method for explicit_route_include_objects, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_include_objects (container) + + YANG Description: Container for the 'include route' object list. + """ + return self.__explicit_route_include_objects + + def _set_explicit_route_include_objects(self, v, load=False): + """ + Setter method for explicit_route_include_objects, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_include_objects (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_explicit_route_include_objects is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_explicit_route_include_objects() directly. + + YANG Description: Container for the 'include route' object list. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=explicit_route_include_objects.explicit_route_include_objects, is_container='container', yang_name="explicit-route-include-objects", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """explicit_route_include_objects must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=explicit_route_include_objects.explicit_route_include_objects, is_container='container', yang_name="explicit-route-include-objects", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__explicit_route_include_objects = t + if hasattr(self, '_set'): + self._set() + + def _unset_explicit_route_include_objects(self): + self.__explicit_route_include_objects = YANGDynClass(base=explicit_route_include_objects.explicit_route_include_objects, is_container='container', yang_name="explicit-route-include-objects", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + metric_type = __builtin__.property(_get_metric_type, _set_metric_type) + weight = __builtin__.property(_get_weight, _set_weight) + explicit_route_exclude_objects = __builtin__.property(_get_explicit_route_exclude_objects, _set_explicit_route_exclude_objects) + explicit_route_include_objects = __builtin__.property(_get_explicit_route_include_objects, _set_explicit_route_include_objects) + + __choices__ = {'algorithm': {'metric': ['metric_type', 'weight', 'explicit_route_exclude_objects', 'explicit_route_include_objects']}} + _pyangbind_elements = OrderedDict([('metric_type', metric_type), ('weight', weight), ('explicit_route_exclude_objects', explicit_route_exclude_objects), ('explicit_route_include_objects', explicit_route_include_objects), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_exclude_objects/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_exclude_objects/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..3831dbff9b1144fa1415a445b89031271bd42649 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_exclude_objects/__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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 route_object_exclude_object +class explicit_route_exclude_objects(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/optimizations/optimization-metric/explicit-route-exclude-objects. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Container for the 'exclude route' object list. + """ + __slots__ = ('_path_helper', '_extmethods', '__route_object_exclude_object',) + + _yang_name = 'explicit-route-exclude-objects' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__route_object_exclude_object = YANGDynClass(base=YANGListType("index",route_object_exclude_object.route_object_exclude_object, yang_name="route-object-exclude-object", parent=self, is_container='list', user_ordered=True, path_helper=self._path_helper, yang_keys='index', extensions=None, choice=('algorithm', 'metric')), is_container='list', yang_name="route-object-exclude-object", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-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 ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'optimizations', 'optimization-metric', 'explicit-route-exclude-objects'] + + def _get_route_object_exclude_object(self): + """ + Getter method for route_object_exclude_object, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object (list) + + YANG Description: List of Explicit Route Objects to be excluded in the +path computation. + """ + return self.__route_object_exclude_object + + def _set_route_object_exclude_object(self, v, load=False): + """ + Setter method for route_object_exclude_object, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_route_object_exclude_object is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_route_object_exclude_object() directly. + + YANG Description: List of Explicit Route Objects to be excluded in the +path computation. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("index",route_object_exclude_object.route_object_exclude_object, yang_name="route-object-exclude-object", parent=self, is_container='list', user_ordered=True, path_helper=self._path_helper, yang_keys='index', extensions=None, choice=('algorithm', 'metric')), is_container='list', yang_name="route-object-exclude-object", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """route_object_exclude_object must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("index",route_object_exclude_object.route_object_exclude_object, yang_name="route-object-exclude-object", parent=self, is_container='list', user_ordered=True, path_helper=self._path_helper, yang_keys='index', extensions=None, choice=('algorithm', 'metric')), is_container='list', yang_name="route-object-exclude-object", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True)""", + }) + + self.__route_object_exclude_object = t + if hasattr(self, '_set'): + self._set() + + def _unset_route_object_exclude_object(self): + self.__route_object_exclude_object = YANGDynClass(base=YANGListType("index",route_object_exclude_object.route_object_exclude_object, yang_name="route-object-exclude-object", parent=self, is_container='list', user_ordered=True, path_helper=self._path_helper, yang_keys='index', extensions=None, choice=('algorithm', 'metric')), is_container='list', yang_name="route-object-exclude-object", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + + route_object_exclude_object = __builtin__.property(_get_route_object_exclude_object, _set_route_object_exclude_object) + + __choices__ = {'algorithm': {'metric': ['route_object_exclude_object']}} + _pyangbind_elements = OrderedDict([('route_object_exclude_object', route_object_exclude_object), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..dea360b243ea8087c4f2a0945c9a230d073d9ecd --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/__init__.py @@ -0,0 +1,365 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 numbered_node_hop +from . import numbered_link_hop +from . import unnumbered_link_hop +from . import as_number_hop +from . import label_hop +from . import srlg +class route_object_exclude_object(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/optimizations/optimization-metric/explicit-route-exclude-objects/route-object-exclude-object. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: List of Explicit Route Objects to be excluded in the +path computation. + """ + __slots__ = ('_path_helper', '_extmethods', '__index','__numbered_node_hop','__numbered_link_hop','__unnumbered_link_hop','__as_number_hop','__label_hop','__srlg',) + + _yang_name = 'route-object-exclude-object' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _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), is_leaf=True, yang_name="index", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + self.__numbered_node_hop = YANGDynClass(base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__numbered_link_hop = YANGDynClass(base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__unnumbered_link_hop = YANGDynClass(base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__as_number_hop = YANGDynClass(base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__label_hop = YANGDynClass(base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__srlg = YANGDynClass(base=srlg.srlg, is_container='container', yang_name="srlg", parent=self, choice=('type', 'srlg'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-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 ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'optimizations', 'optimization-metric', 'explicit-route-exclude-objects', 'route-object-exclude-object'] + + def _get_index(self): + """ + Getter method for index, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/index (uint32) + + YANG Description: Route object entry index. The index is used to +identify an entry in the list. The order of entries +is defined by the user without relying on key values. + """ + return self.__index + + def _set_index(self, v, load=False): + """ + Setter method for index, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/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: Route object entry index. The index is used to +identify an entry in the list. The order of entries +is defined by the user without relying on key values. + """ + 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=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="index", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', 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), is_leaf=True, yang_name="index", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', 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), is_leaf=True, yang_name="index", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + + + def _get_numbered_node_hop(self): + """ + Getter method for numbered_node_hop, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/numbered_node_hop (container) + + YANG Description: Numbered node route hop. + """ + return self.__numbered_node_hop + + def _set_numbered_node_hop(self, v, load=False): + """ + Setter method for numbered_node_hop, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/numbered_node_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_numbered_node_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_numbered_node_hop() directly. + + YANG Description: Numbered node route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """numbered_node_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__numbered_node_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_numbered_node_hop(self): + self.__numbered_node_hop = YANGDynClass(base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_numbered_link_hop(self): + """ + Getter method for numbered_link_hop, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/numbered_link_hop (container) + + YANG Description: Numbered link explicit route hop. + """ + return self.__numbered_link_hop + + def _set_numbered_link_hop(self, v, load=False): + """ + Setter method for numbered_link_hop, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/numbered_link_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_numbered_link_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_numbered_link_hop() directly. + + YANG Description: Numbered link explicit route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """numbered_link_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__numbered_link_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_numbered_link_hop(self): + self.__numbered_link_hop = YANGDynClass(base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_unnumbered_link_hop(self): + """ + Getter method for unnumbered_link_hop, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/unnumbered_link_hop (container) + + YANG Description: Unnumbered link explicit route hop. + """ + return self.__unnumbered_link_hop + + def _set_unnumbered_link_hop(self, v, load=False): + """ + Setter method for unnumbered_link_hop, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/unnumbered_link_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_unnumbered_link_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_unnumbered_link_hop() directly. + + YANG Description: Unnumbered link explicit route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """unnumbered_link_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__unnumbered_link_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_unnumbered_link_hop(self): + self.__unnumbered_link_hop = YANGDynClass(base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_as_number_hop(self): + """ + Getter method for as_number_hop, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/as_number_hop (container) + + YANG Description: AS explicit route hop. + """ + return self.__as_number_hop + + def _set_as_number_hop(self, v, load=False): + """ + Setter method for as_number_hop, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/as_number_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_as_number_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_as_number_hop() directly. + + YANG Description: AS explicit route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """as_number_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__as_number_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_as_number_hop(self): + self.__as_number_hop = YANGDynClass(base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_label_hop(self): + """ + Getter method for label_hop, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop (container) + + YANG Description: Label hop type. + """ + return self.__label_hop + + def _set_label_hop(self, v, load=False): + """ + Setter method for label_hop, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_label_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_label_hop() directly. + + YANG Description: Label hop type. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """label_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__label_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_label_hop(self): + self.__label_hop = YANGDynClass(base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_srlg(self): + """ + Getter method for srlg, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/srlg (container) + + YANG Description: SRLG container. + """ + return self.__srlg + + def _set_srlg(self, v, load=False): + """ + Setter method for srlg, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/srlg (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_srlg is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_srlg() directly. + + YANG Description: SRLG container. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=srlg.srlg, is_container='container', yang_name="srlg", parent=self, choice=('type', 'srlg'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """srlg must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=srlg.srlg, is_container='container', yang_name="srlg", parent=self, choice=('type', 'srlg'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__srlg = t + if hasattr(self, '_set'): + self._set() + + def _unset_srlg(self): + self.__srlg = YANGDynClass(base=srlg.srlg, is_container='container', yang_name="srlg", parent=self, choice=('type', 'srlg'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + index = __builtin__.property(_get_index, _set_index) + numbered_node_hop = __builtin__.property(_get_numbered_node_hop, _set_numbered_node_hop) + numbered_link_hop = __builtin__.property(_get_numbered_link_hop, _set_numbered_link_hop) + unnumbered_link_hop = __builtin__.property(_get_unnumbered_link_hop, _set_unnumbered_link_hop) + as_number_hop = __builtin__.property(_get_as_number_hop, _set_as_number_hop) + label_hop = __builtin__.property(_get_label_hop, _set_label_hop) + srlg = __builtin__.property(_get_srlg, _set_srlg) + + __choices__ = {'algorithm': {'metric': ['index']}, 'type': {'numbered-node-hop': ['numbered_node_hop'], 'numbered-link-hop': ['numbered_link_hop'], 'unnumbered-link-hop': ['unnumbered_link_hop'], 'as-number': ['as_number_hop'], 'label': ['label_hop'], 'srlg': ['srlg']}} + _pyangbind_elements = OrderedDict([('index', index), ('numbered_node_hop', numbered_node_hop), ('numbered_link_hop', numbered_link_hop), ('unnumbered_link_hop', unnumbered_link_hop), ('as_number_hop', as_number_hop), ('label_hop', label_hop), ('srlg', srlg), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/as_number_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/as_number_hop/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..c2450591ff591b28c8a20d81e919adb39fff1e79 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/as_number_hop/__init__.py @@ -0,0 +1,154 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 as_number_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/optimizations/optimization-metric/explicit-route-exclude-objects/route-object-exclude-object/as-number-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: AS explicit route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__as_number','__hop_type',) + + _yang_name = 'as-number-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__as_number = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=True) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', 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 ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'optimizations', 'optimization-metric', 'explicit-route-exclude-objects', 'route-object-exclude-object', 'as-number-hop'] + + def _get_as_number(self): + """ + Getter method for as_number, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/as_number_hop/as_number (inet:as-number) + + YANG Description: The Autonomous System (AS) number. + """ + return self.__as_number + + def _set_as_number(self, v, load=False): + """ + Setter method for as_number, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/as_number_hop/as_number (inet:as-number) + If this variable is read-only (config: false) in the + source YANG file, then _set_as_number is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_as_number() directly. + + YANG Description: The Autonomous System (AS) number. + """ + 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="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """as_number must be of a type compatible with inet:as-number""", + 'defined-type': "inet:as-number", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=True)""", + }) + + self.__as_number = t + if hasattr(self, '_set'): + self._set() + + def _unset_as_number(self): + self.__as_number = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=True) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/as_number_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/as_number_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + 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={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + + as_number = __builtin__.property(_get_as_number, _set_as_number) + hop_type = __builtin__.property(_get_hop_type, _set_hop_type) + + __choices__ = {'type': {'as-number': ['as_number', 'hop_type']}} + _pyangbind_elements = OrderedDict([('as_number', as_number), ('hop_type', hop_type), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..05755c89d8c3b35e5d79a27360663653f365d31d --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/__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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 te_label +class label_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/optimizations/optimization-metric/explicit-route-exclude-objects/route-object-exclude-object/label-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Label hop type. + """ + __slots__ = ('_path_helper', '_extmethods', '__te_label',) + + _yang_name = 'label-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__te_label = YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-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 ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'optimizations', 'optimization-metric', 'explicit-route-exclude-objects', 'route-object-exclude-object', 'label-hop'] + + def _get_te_label(self): + """ + Getter method for te_label, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label (container) + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + return self.__te_label + + def _set_te_label(self, v, load=False): + """ + Setter method for te_label, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_te_label is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_te_label() directly. + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """te_label must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__te_label = t + if hasattr(self, '_set'): + self._set() + + def _unset_te_label(self): + self.__te_label = YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + te_label = __builtin__.property(_get_te_label, _set_te_label) + + __choices__ = {'type': {'label': ['te_label']}} + _pyangbind_elements = OrderedDict([('te_label', te_label), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..aaf8055717a002732b93666eb0ca309f3aba8f35 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label/__init__.py @@ -0,0 +1,234 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 otn +class te_label(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/optimizations/optimization-metric/explicit-route-exclude-objects/route-object-exclude-object/label-hop/te-label. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + __slots__ = ('_path_helper', '_extmethods', '__generic','__otn','__vlanid','__direction',) + + _yang_name = 'te-label' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__generic = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True) + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + self.__vlanid = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True) + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', 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 ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'optimizations', 'optimization-metric', 'explicit-route-exclude-objects', 'route-object-exclude-object', 'label-hop', 'te-label'] + + def _get_generic(self): + """ + Getter method for generic, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label/generic (rt-types:generalized-label) + + YANG Description: TE label specified in a generic format. + """ + return self.__generic + + def _set_generic(self, v, load=False): + """ + Setter method for generic, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label/generic (rt-types:generalized-label) + If this variable is read-only (config: false) in the + source YANG file, then _set_generic is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_generic() directly. + + YANG Description: TE label specified in a generic format. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """generic must be of a type compatible with rt-types:generalized-label""", + 'defined-type': "rt-types:generalized-label", + 'generated-type': """YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True)""", + }) + + self.__generic = t + if hasattr(self, '_set'): + self._set() + + def _unset_generic(self): + self.__generic = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True) + + + def _get_otn(self): + """ + Getter method for otn, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label/otn (container) + + YANG Description: Label hop for OTN. + """ + return self.__otn + + def _set_otn(self, v, load=False): + """ + Setter method for otn, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label/otn (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_otn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_otn() directly. + + YANG Description: Label hop for OTN. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """otn must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True)""", + }) + + self.__otn = t + if hasattr(self, '_set'): + self._set() + + def _unset_otn(self): + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + + + def _get_vlanid(self): + """ + Getter method for vlanid, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label/vlanid (etht-types:vlanid) + + YANG Description: VLAN tag id. + """ + return self.__vlanid + + def _set_vlanid(self, v, load=False): + """ + Setter method for vlanid, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label/vlanid (etht-types:vlanid) + If this variable is read-only (config: false) in the + source YANG file, then _set_vlanid is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_vlanid() directly. + + YANG Description: VLAN tag id. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """vlanid must be of a type compatible with etht-types:vlanid""", + 'defined-type': "etht-types:vlanid", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True)""", + }) + + self.__vlanid = t + if hasattr(self, '_set'): + self._set() + + def _unset_vlanid(self): + self.__vlanid = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True) + + + def _get_direction(self): + """ + Getter method for direction, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label/direction (te-label-direction) + + YANG Description: Label direction. + """ + return self.__direction + + def _set_direction(self, v, load=False): + """ + Setter method for direction, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label/direction (te-label-direction) + If this variable is read-only (config: false) in the + source YANG file, then _set_direction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_direction() directly. + + YANG Description: Label direction. + """ + 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={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """direction must be of a type compatible with te-label-direction""", + 'defined-type': "ietf-te-topology:te-label-direction", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=True)""", + }) + + self.__direction = t + if hasattr(self, '_set'): + self._set() + + def _unset_direction(self): + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=True) + + generic = __builtin__.property(_get_generic, _set_generic) + otn = __builtin__.property(_get_otn, _set_otn) + vlanid = __builtin__.property(_get_vlanid, _set_vlanid) + direction = __builtin__.property(_get_direction, _set_direction) + + __choices__ = {'technology': {'generic': ['generic'], 'otn': ['otn'], 'eth': ['vlanid']}, 'type': {'label': ['direction']}} + _pyangbind_elements = OrderedDict([('generic', generic), ('otn', otn), ('vlanid', vlanid), ('direction', direction), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label/otn/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label/otn/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..f8e446cfb477bdb47f7bcc9668ae1fd9282ce086 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label/otn/__init__.py @@ -0,0 +1,209 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 otn(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/optimizations/optimization-metric/explicit-route-exclude-objects/route-object-exclude-object/label-hop/te-label/otn. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Label hop for OTN. + """ + __slots__ = ('_path_helper', '_extmethods', '__tpn','__tsg','__ts_list',) + + _yang_name = 'otn' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__tpn = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True) + self.__tsg = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + self.__ts_list = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-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 ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'optimizations', 'optimization-metric', 'explicit-route-exclude-objects', 'route-object-exclude-object', 'label-hop', 'te-label', 'otn'] + + def _get_tpn(self): + """ + Getter method for tpn, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label/otn/tpn (otn-tpn) + + YANG Description: Tributary Port Number (TPN). + """ + return self.__tpn + + def _set_tpn(self, v, load=False): + """ + Setter method for tpn, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label/otn/tpn (otn-tpn) + If this variable is read-only (config: false) in the + source YANG file, then _set_tpn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tpn() directly. + + YANG Description: Tributary Port Number (TPN). + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tpn must be of a type compatible with otn-tpn""", + 'defined-type': "ietf-otn-topology:otn-tpn", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True)""", + }) + + self.__tpn = t + if hasattr(self, '_set'): + self._set() + + def _unset_tpn(self): + self.__tpn = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True) + + + def _get_tsg(self): + """ + Getter method for tsg, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label/otn/tsg (identityref) + + YANG Description: Tributary Slot Granularity (TSG). + """ + return self.__tsg + + def _set_tsg(self, v, load=False): + """ + Setter method for tsg, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label/otn/tsg (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_tsg is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tsg() directly. + + YANG Description: Tributary Slot Granularity (TSG). + """ + 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={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tsg must be of a type compatible with identityref""", + 'defined-type': "ietf-otn-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True)""", + }) + + self.__tsg = t + if hasattr(self, '_set'): + self._set() + + def _unset_tsg(self): + self.__tsg = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + + + def _get_ts_list(self): + """ + Getter method for ts_list, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label/otn/ts_list (string) + + YANG Description: A list of available Tributary Slots (TS) ranging + + + + +between 1 and 4095. If multiple values or +ranges are given, they all MUST be disjoint +and MUST be in ascending order. +For example 1-20,25,50-1000. + """ + return self.__ts_list + + def _set_ts_list(self, v, load=False): + """ + Setter method for ts_list, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label/otn/ts_list (string) + If this variable is read-only (config: false) in the + source YANG file, then _set_ts_list is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_ts_list() directly. + + YANG Description: A list of available Tributary Slots (TS) ranging + + + + +between 1 and 4095. If multiple values or +ranges are given, they all MUST be disjoint +and MUST be in ascending order. +For example 1-20,25,50-1000. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='string', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """ts_list must be of a type compatible with string""", + 'defined-type': "string", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='string', is_config=True)""", + }) + + self.__ts_list = t + if hasattr(self, '_set'): + self._set() + + def _unset_ts_list(self): + self.__ts_list = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='string', is_config=True) + + tpn = __builtin__.property(_get_tpn, _set_tpn) + tsg = __builtin__.property(_get_tsg, _set_tsg) + ts_list = __builtin__.property(_get_ts_list, _set_ts_list) + + __choices__ = {'technology': {'otn': ['tpn', 'tsg', 'ts_list']}} + _pyangbind_elements = OrderedDict([('tpn', tpn), ('tsg', tsg), ('ts_list', ts_list), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/numbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/numbered_link_hop/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..fe5117d928b39ec1fe5ea702638d9af153099e3b --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/numbered_link_hop/__init__.py @@ -0,0 +1,193 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 numbered_link_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/optimizations/optimization-metric/explicit-route-exclude-objects/route-object-exclude-object/numbered-link-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Numbered link explicit route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__link_tp_id','__hop_type','__direction',) + + _yang_name = 'numbered-link-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', 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 ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'optimizations', 'optimization-metric', 'explicit-route-exclude-objects', 'route-object-exclude-object', 'numbered-link-hop'] + + def _get_link_tp_id(self): + """ + Getter method for link_tp_id, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/numbered_link_hop/link_tp_id (te-tp-id) + + YANG Description: TE Link Termination Point (LTP) identifier. + """ + return self.__link_tp_id + + def _set_link_tp_id(self, v, load=False): + """ + Setter method for link_tp_id, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/numbered_link_hop/link_tp_id (te-tp-id) + If this variable is read-only (config: false) in the + source YANG file, then _set_link_tp_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_link_tp_id() directly. + + YANG Description: TE Link Termination Point (LTP) identifier. + """ + 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),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """link_tp_id must be of a type compatible with te-tp-id""", + 'defined-type': "ietf-te-topology:te-tp-id", + 'generated-type': """YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True)""", + }) + + self.__link_tp_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_link_tp_id(self): + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/numbered_link_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/numbered_link_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + 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={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + + + def _get_direction(self): + """ + Getter method for direction, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/numbered_link_hop/direction (te-link-direction) + + YANG Description: Link route object direction. + """ + return self.__direction + + def _set_direction(self, v, load=False): + """ + Setter method for direction, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/numbered_link_hop/direction (te-link-direction) + If this variable is read-only (config: false) in the + source YANG file, then _set_direction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_direction() directly. + + YANG Description: Link route object direction. + """ + 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={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """direction must be of a type compatible with te-link-direction""", + 'defined-type': "ietf-te-topology:te-link-direction", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True)""", + }) + + self.__direction = t + if hasattr(self, '_set'): + self._set() + + def _unset_direction(self): + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True) + + link_tp_id = __builtin__.property(_get_link_tp_id, _set_link_tp_id) + hop_type = __builtin__.property(_get_hop_type, _set_hop_type) + direction = __builtin__.property(_get_direction, _set_direction) + + __choices__ = {'type': {'numbered-link-hop': ['link_tp_id', 'hop_type', 'direction']}} + _pyangbind_elements = OrderedDict([('link_tp_id', link_tp_id), ('hop_type', hop_type), ('direction', direction), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/numbered_node_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/numbered_node_hop/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..421eefdb3c6873a6876d81c59c9d9b774edfaf54 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/numbered_node_hop/__init__.py @@ -0,0 +1,154 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 numbered_node_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/optimizations/optimization-metric/explicit-route-exclude-objects/route-object-exclude-object/numbered-node-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Numbered node route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__node_id','__hop_type',) + + _yang_name = 'numbered-node-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', 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 ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'optimizations', 'optimization-metric', 'explicit-route-exclude-objects', 'route-object-exclude-object', 'numbered-node-hop'] + + def _get_node_id(self): + """ + Getter method for node_id, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/numbered_node_hop/node_id (te-node-id) + + YANG Description: The identifier of a node in the TE topology. + """ + return self.__node_id + + def _set_node_id(self, v, load=False): + """ + Setter method for node_id, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/numbered_node_hop/node_id (te-node-id) + 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. + + YANG Description: The identifier of a node in the TE topology. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """node_id must be of a type compatible with te-node-id""", + 'defined-type': "ietf-te-topology:te-node-id", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True)""", + }) + + self.__node_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_node_id(self): + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/numbered_node_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/numbered_node_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + 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={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + + node_id = __builtin__.property(_get_node_id, _set_node_id) + hop_type = __builtin__.property(_get_hop_type, _set_hop_type) + + __choices__ = {'type': {'numbered-node-hop': ['node_id', 'hop_type']}} + _pyangbind_elements = OrderedDict([('node_id', node_id), ('hop_type', hop_type), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/srlg/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/srlg/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e2dd6a91a18271038d0f0438e88f620b138dec0d --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/srlg/__init__.py @@ -0,0 +1,115 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 srlg(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/optimizations/optimization-metric/explicit-route-exclude-objects/route-object-exclude-object/srlg. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: SRLG container. + """ + __slots__ = ('_path_helper', '_extmethods', '__srlg',) + + _yang_name = 'srlg' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__srlg = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="srlg", parent=self, choice=('type', 'srlg'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', 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 ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'optimizations', 'optimization-metric', 'explicit-route-exclude-objects', 'route-object-exclude-object', 'srlg'] + + def _get_srlg(self): + """ + Getter method for srlg, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/srlg/srlg (uint32) + + YANG Description: SRLG value. + """ + return self.__srlg + + def _set_srlg(self, v, load=False): + """ + Setter method for srlg, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/srlg/srlg (uint32) + If this variable is read-only (config: false) in the + source YANG file, then _set_srlg is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_srlg() directly. + + YANG Description: SRLG value. + """ + 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="srlg", parent=self, choice=('type', 'srlg'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """srlg 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="srlg", parent=self, choice=('type', 'srlg'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True)""", + }) + + self.__srlg = t + if hasattr(self, '_set'): + self._set() + + def _unset_srlg(self): + self.__srlg = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="srlg", parent=self, choice=('type', 'srlg'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + + srlg = __builtin__.property(_get_srlg, _set_srlg) + + __choices__ = {'type': {'srlg': ['srlg']}} + _pyangbind_elements = OrderedDict([('srlg', srlg), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/unnumbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/unnumbered_link_hop/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..cd0b15cae91a4541ffd79125eaac5b2f55b517d3 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/unnumbered_link_hop/__init__.py @@ -0,0 +1,236 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 unnumbered_link_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/optimizations/optimization-metric/explicit-route-exclude-objects/route-object-exclude-object/unnumbered-link-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Unnumbered link explicit route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__link_tp_id','__node_id','__hop_type','__direction',) + + _yang_name = 'unnumbered-link-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True) + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', 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 ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'optimizations', 'optimization-metric', 'explicit-route-exclude-objects', 'route-object-exclude-object', 'unnumbered-link-hop'] + + def _get_link_tp_id(self): + """ + Getter method for link_tp_id, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/unnumbered_link_hop/link_tp_id (te-tp-id) + + YANG Description: TE LTP identifier. The combination of the TE link ID +and the TE node ID is used to identify an unnumbered +TE link. + """ + return self.__link_tp_id + + def _set_link_tp_id(self, v, load=False): + """ + Setter method for link_tp_id, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/unnumbered_link_hop/link_tp_id (te-tp-id) + If this variable is read-only (config: false) in the + source YANG file, then _set_link_tp_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_link_tp_id() directly. + + YANG Description: TE LTP identifier. The combination of the TE link ID +and the TE node ID is used to identify an unnumbered +TE link. + """ + 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),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """link_tp_id must be of a type compatible with te-tp-id""", + 'defined-type': "ietf-te-topology:te-tp-id", + 'generated-type': """YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True)""", + }) + + self.__link_tp_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_link_tp_id(self): + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True) + + + def _get_node_id(self): + """ + Getter method for node_id, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/unnumbered_link_hop/node_id (te-node-id) + + YANG Description: The identifier of a node in the TE topology. + """ + return self.__node_id + + def _set_node_id(self, v, load=False): + """ + Setter method for node_id, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/unnumbered_link_hop/node_id (te-node-id) + 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. + + YANG Description: The identifier of a node in the TE topology. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """node_id must be of a type compatible with te-node-id""", + 'defined-type': "ietf-te-topology:te-node-id", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True)""", + }) + + self.__node_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_node_id(self): + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/unnumbered_link_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/unnumbered_link_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + 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={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + + + def _get_direction(self): + """ + Getter method for direction, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/unnumbered_link_hop/direction (te-link-direction) + + YANG Description: Link route object direction. + """ + return self.__direction + + def _set_direction(self, v, load=False): + """ + Setter method for direction, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/unnumbered_link_hop/direction (te-link-direction) + If this variable is read-only (config: false) in the + source YANG file, then _set_direction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_direction() directly. + + YANG Description: Link route object direction. + """ + 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={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """direction must be of a type compatible with te-link-direction""", + 'defined-type': "ietf-te-topology:te-link-direction", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True)""", + }) + + self.__direction = t + if hasattr(self, '_set'): + self._set() + + def _unset_direction(self): + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True) + + link_tp_id = __builtin__.property(_get_link_tp_id, _set_link_tp_id) + node_id = __builtin__.property(_get_node_id, _set_node_id) + hop_type = __builtin__.property(_get_hop_type, _set_hop_type) + direction = __builtin__.property(_get_direction, _set_direction) + + __choices__ = {'type': {'unnumbered-link-hop': ['link_tp_id', 'node_id', 'hop_type', 'direction']}} + _pyangbind_elements = OrderedDict([('link_tp_id', link_tp_id), ('node_id', node_id), ('hop_type', hop_type), ('direction', direction), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_include_objects/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_include_objects/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..2af5c34bd287e8e7c748f300ab2feaf8349a2472 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_include_objects/__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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 route_object_include_object +class explicit_route_include_objects(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/optimizations/optimization-metric/explicit-route-include-objects. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Container for the 'include route' object list. + """ + __slots__ = ('_path_helper', '_extmethods', '__route_object_include_object',) + + _yang_name = 'explicit-route-include-objects' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__route_object_include_object = YANGDynClass(base=YANGListType("index",route_object_include_object.route_object_include_object, yang_name="route-object-include-object", parent=self, is_container='list', user_ordered=True, path_helper=self._path_helper, yang_keys='index', extensions=None, choice=('algorithm', 'metric')), is_container='list', yang_name="route-object-include-object", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-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 ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'optimizations', 'optimization-metric', 'explicit-route-include-objects'] + + def _get_route_object_include_object(self): + """ + Getter method for route_object_include_object, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object (list) + + YANG Description: List of Explicit Route Objects to be included in the +path computation. + """ + return self.__route_object_include_object + + def _set_route_object_include_object(self, v, load=False): + """ + Setter method for route_object_include_object, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_route_object_include_object is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_route_object_include_object() directly. + + YANG Description: List of Explicit Route Objects to be included in the +path computation. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("index",route_object_include_object.route_object_include_object, yang_name="route-object-include-object", parent=self, is_container='list', user_ordered=True, path_helper=self._path_helper, yang_keys='index', extensions=None, choice=('algorithm', 'metric')), is_container='list', yang_name="route-object-include-object", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """route_object_include_object must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("index",route_object_include_object.route_object_include_object, yang_name="route-object-include-object", parent=self, is_container='list', user_ordered=True, path_helper=self._path_helper, yang_keys='index', extensions=None, choice=('algorithm', 'metric')), is_container='list', yang_name="route-object-include-object", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True)""", + }) + + self.__route_object_include_object = t + if hasattr(self, '_set'): + self._set() + + def _unset_route_object_include_object(self): + self.__route_object_include_object = YANGDynClass(base=YANGListType("index",route_object_include_object.route_object_include_object, yang_name="route-object-include-object", parent=self, is_container='list', user_ordered=True, path_helper=self._path_helper, yang_keys='index', extensions=None, choice=('algorithm', 'metric')), is_container='list', yang_name="route-object-include-object", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + + route_object_include_object = __builtin__.property(_get_route_object_include_object, _set_route_object_include_object) + + __choices__ = {'algorithm': {'metric': ['route_object_include_object']}} + _pyangbind_elements = OrderedDict([('route_object_include_object', route_object_include_object), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..43968474bf22d558ba037ace70ad27b486fd8faa --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/__init__.py @@ -0,0 +1,325 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 numbered_node_hop +from . import numbered_link_hop +from . import unnumbered_link_hop +from . import as_number_hop +from . import label_hop +class route_object_include_object(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/optimizations/optimization-metric/explicit-route-include-objects/route-object-include-object. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: List of Explicit Route Objects to be included in the +path computation. + """ + __slots__ = ('_path_helper', '_extmethods', '__index','__numbered_node_hop','__numbered_link_hop','__unnumbered_link_hop','__as_number_hop','__label_hop',) + + _yang_name = 'route-object-include-object' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _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), is_leaf=True, yang_name="index", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + self.__numbered_node_hop = YANGDynClass(base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__numbered_link_hop = YANGDynClass(base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__unnumbered_link_hop = YANGDynClass(base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__as_number_hop = YANGDynClass(base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__label_hop = YANGDynClass(base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-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 ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'optimizations', 'optimization-metric', 'explicit-route-include-objects', 'route-object-include-object'] + + def _get_index(self): + """ + Getter method for index, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/index (uint32) + + YANG Description: Route object entry index. The index is used to +identify an entry in the list. The order of entries +is defined by the user without relying on key values. + """ + return self.__index + + def _set_index(self, v, load=False): + """ + Setter method for index, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/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: Route object entry index. The index is used to +identify an entry in the list. The order of entries +is defined by the user without relying on key values. + """ + 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=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="index", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', 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), is_leaf=True, yang_name="index", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', 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), is_leaf=True, yang_name="index", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + + + def _get_numbered_node_hop(self): + """ + Getter method for numbered_node_hop, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/numbered_node_hop (container) + + YANG Description: Numbered node route hop. + """ + return self.__numbered_node_hop + + def _set_numbered_node_hop(self, v, load=False): + """ + Setter method for numbered_node_hop, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/numbered_node_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_numbered_node_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_numbered_node_hop() directly. + + YANG Description: Numbered node route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """numbered_node_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__numbered_node_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_numbered_node_hop(self): + self.__numbered_node_hop = YANGDynClass(base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_numbered_link_hop(self): + """ + Getter method for numbered_link_hop, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/numbered_link_hop (container) + + YANG Description: Numbered link explicit route hop. + """ + return self.__numbered_link_hop + + def _set_numbered_link_hop(self, v, load=False): + """ + Setter method for numbered_link_hop, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/numbered_link_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_numbered_link_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_numbered_link_hop() directly. + + YANG Description: Numbered link explicit route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """numbered_link_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__numbered_link_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_numbered_link_hop(self): + self.__numbered_link_hop = YANGDynClass(base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_unnumbered_link_hop(self): + """ + Getter method for unnumbered_link_hop, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/unnumbered_link_hop (container) + + YANG Description: Unnumbered link explicit route hop. + """ + return self.__unnumbered_link_hop + + def _set_unnumbered_link_hop(self, v, load=False): + """ + Setter method for unnumbered_link_hop, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/unnumbered_link_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_unnumbered_link_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_unnumbered_link_hop() directly. + + YANG Description: Unnumbered link explicit route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """unnumbered_link_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__unnumbered_link_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_unnumbered_link_hop(self): + self.__unnumbered_link_hop = YANGDynClass(base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_as_number_hop(self): + """ + Getter method for as_number_hop, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/as_number_hop (container) + + YANG Description: AS explicit route hop. + """ + return self.__as_number_hop + + def _set_as_number_hop(self, v, load=False): + """ + Setter method for as_number_hop, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/as_number_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_as_number_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_as_number_hop() directly. + + YANG Description: AS explicit route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """as_number_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__as_number_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_as_number_hop(self): + self.__as_number_hop = YANGDynClass(base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_label_hop(self): + """ + Getter method for label_hop, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop (container) + + YANG Description: Label hop type. + """ + return self.__label_hop + + def _set_label_hop(self, v, load=False): + """ + Setter method for label_hop, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_label_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_label_hop() directly. + + YANG Description: Label hop type. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """label_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__label_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_label_hop(self): + self.__label_hop = YANGDynClass(base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + index = __builtin__.property(_get_index, _set_index) + numbered_node_hop = __builtin__.property(_get_numbered_node_hop, _set_numbered_node_hop) + numbered_link_hop = __builtin__.property(_get_numbered_link_hop, _set_numbered_link_hop) + unnumbered_link_hop = __builtin__.property(_get_unnumbered_link_hop, _set_unnumbered_link_hop) + as_number_hop = __builtin__.property(_get_as_number_hop, _set_as_number_hop) + label_hop = __builtin__.property(_get_label_hop, _set_label_hop) + + __choices__ = {'algorithm': {'metric': ['index']}, 'type': {'numbered-node-hop': ['numbered_node_hop'], 'numbered-link-hop': ['numbered_link_hop'], 'unnumbered-link-hop': ['unnumbered_link_hop'], 'as-number': ['as_number_hop'], 'label': ['label_hop']}} + _pyangbind_elements = OrderedDict([('index', index), ('numbered_node_hop', numbered_node_hop), ('numbered_link_hop', numbered_link_hop), ('unnumbered_link_hop', unnumbered_link_hop), ('as_number_hop', as_number_hop), ('label_hop', label_hop), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/as_number_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/as_number_hop/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..ad6d9db46c085a14427a5e94c9a54f4abb133cf2 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/as_number_hop/__init__.py @@ -0,0 +1,154 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 as_number_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/optimizations/optimization-metric/explicit-route-include-objects/route-object-include-object/as-number-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: AS explicit route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__as_number','__hop_type',) + + _yang_name = 'as-number-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__as_number = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=True) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', 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 ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'optimizations', 'optimization-metric', 'explicit-route-include-objects', 'route-object-include-object', 'as-number-hop'] + + def _get_as_number(self): + """ + Getter method for as_number, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/as_number_hop/as_number (inet:as-number) + + YANG Description: The Autonomous System (AS) number. + """ + return self.__as_number + + def _set_as_number(self, v, load=False): + """ + Setter method for as_number, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/as_number_hop/as_number (inet:as-number) + If this variable is read-only (config: false) in the + source YANG file, then _set_as_number is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_as_number() directly. + + YANG Description: The Autonomous System (AS) number. + """ + 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="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """as_number must be of a type compatible with inet:as-number""", + 'defined-type': "inet:as-number", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=True)""", + }) + + self.__as_number = t + if hasattr(self, '_set'): + self._set() + + def _unset_as_number(self): + self.__as_number = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=True) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/as_number_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/as_number_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + 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={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + + as_number = __builtin__.property(_get_as_number, _set_as_number) + hop_type = __builtin__.property(_get_hop_type, _set_hop_type) + + __choices__ = {'type': {'as-number': ['as_number', 'hop_type']}} + _pyangbind_elements = OrderedDict([('as_number', as_number), ('hop_type', hop_type), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..d1ce0f206df0bf10b7b8f78ae15f6fbfd315b03c --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/__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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 te_label +class label_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/optimizations/optimization-metric/explicit-route-include-objects/route-object-include-object/label-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Label hop type. + """ + __slots__ = ('_path_helper', '_extmethods', '__te_label',) + + _yang_name = 'label-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__te_label = YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-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 ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'optimizations', 'optimization-metric', 'explicit-route-include-objects', 'route-object-include-object', 'label-hop'] + + def _get_te_label(self): + """ + Getter method for te_label, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label (container) + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + return self.__te_label + + def _set_te_label(self, v, load=False): + """ + Setter method for te_label, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_te_label is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_te_label() directly. + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """te_label must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__te_label = t + if hasattr(self, '_set'): + self._set() + + def _unset_te_label(self): + self.__te_label = YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + te_label = __builtin__.property(_get_te_label, _set_te_label) + + __choices__ = {'type': {'label': ['te_label']}} + _pyangbind_elements = OrderedDict([('te_label', te_label), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..66d61a6af0012e236d4097d062c9217698f6db20 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label/__init__.py @@ -0,0 +1,234 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 otn +class te_label(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/optimizations/optimization-metric/explicit-route-include-objects/route-object-include-object/label-hop/te-label. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + __slots__ = ('_path_helper', '_extmethods', '__generic','__otn','__vlanid','__direction',) + + _yang_name = 'te-label' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__generic = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True) + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + self.__vlanid = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True) + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', 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 ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'optimizations', 'optimization-metric', 'explicit-route-include-objects', 'route-object-include-object', 'label-hop', 'te-label'] + + def _get_generic(self): + """ + Getter method for generic, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label/generic (rt-types:generalized-label) + + YANG Description: TE label specified in a generic format. + """ + return self.__generic + + def _set_generic(self, v, load=False): + """ + Setter method for generic, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label/generic (rt-types:generalized-label) + If this variable is read-only (config: false) in the + source YANG file, then _set_generic is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_generic() directly. + + YANG Description: TE label specified in a generic format. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """generic must be of a type compatible with rt-types:generalized-label""", + 'defined-type': "rt-types:generalized-label", + 'generated-type': """YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True)""", + }) + + self.__generic = t + if hasattr(self, '_set'): + self._set() + + def _unset_generic(self): + self.__generic = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True) + + + def _get_otn(self): + """ + Getter method for otn, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label/otn (container) + + YANG Description: Label hop for OTN. + """ + return self.__otn + + def _set_otn(self, v, load=False): + """ + Setter method for otn, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label/otn (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_otn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_otn() directly. + + YANG Description: Label hop for OTN. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """otn must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True)""", + }) + + self.__otn = t + if hasattr(self, '_set'): + self._set() + + def _unset_otn(self): + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + + + def _get_vlanid(self): + """ + Getter method for vlanid, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label/vlanid (etht-types:vlanid) + + YANG Description: VLAN tag id. + """ + return self.__vlanid + + def _set_vlanid(self, v, load=False): + """ + Setter method for vlanid, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label/vlanid (etht-types:vlanid) + If this variable is read-only (config: false) in the + source YANG file, then _set_vlanid is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_vlanid() directly. + + YANG Description: VLAN tag id. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """vlanid must be of a type compatible with etht-types:vlanid""", + 'defined-type': "etht-types:vlanid", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True)""", + }) + + self.__vlanid = t + if hasattr(self, '_set'): + self._set() + + def _unset_vlanid(self): + self.__vlanid = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True) + + + def _get_direction(self): + """ + Getter method for direction, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label/direction (te-label-direction) + + YANG Description: Label direction. + """ + return self.__direction + + def _set_direction(self, v, load=False): + """ + Setter method for direction, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label/direction (te-label-direction) + If this variable is read-only (config: false) in the + source YANG file, then _set_direction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_direction() directly. + + YANG Description: Label direction. + """ + 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={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """direction must be of a type compatible with te-label-direction""", + 'defined-type': "ietf-te-topology:te-label-direction", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=True)""", + }) + + self.__direction = t + if hasattr(self, '_set'): + self._set() + + def _unset_direction(self): + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=True) + + generic = __builtin__.property(_get_generic, _set_generic) + otn = __builtin__.property(_get_otn, _set_otn) + vlanid = __builtin__.property(_get_vlanid, _set_vlanid) + direction = __builtin__.property(_get_direction, _set_direction) + + __choices__ = {'technology': {'generic': ['generic'], 'otn': ['otn'], 'eth': ['vlanid']}, 'type': {'label': ['direction']}} + _pyangbind_elements = OrderedDict([('generic', generic), ('otn', otn), ('vlanid', vlanid), ('direction', direction), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label/otn/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label/otn/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..24d91aba654ef76431291309a56dd2779acf25a6 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label/otn/__init__.py @@ -0,0 +1,209 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 otn(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/optimizations/optimization-metric/explicit-route-include-objects/route-object-include-object/label-hop/te-label/otn. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Label hop for OTN. + """ + __slots__ = ('_path_helper', '_extmethods', '__tpn','__tsg','__ts_list',) + + _yang_name = 'otn' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__tpn = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True) + self.__tsg = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + self.__ts_list = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-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 ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'optimizations', 'optimization-metric', 'explicit-route-include-objects', 'route-object-include-object', 'label-hop', 'te-label', 'otn'] + + def _get_tpn(self): + """ + Getter method for tpn, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label/otn/tpn (otn-tpn) + + YANG Description: Tributary Port Number (TPN). + """ + return self.__tpn + + def _set_tpn(self, v, load=False): + """ + Setter method for tpn, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label/otn/tpn (otn-tpn) + If this variable is read-only (config: false) in the + source YANG file, then _set_tpn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tpn() directly. + + YANG Description: Tributary Port Number (TPN). + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tpn must be of a type compatible with otn-tpn""", + 'defined-type': "ietf-otn-topology:otn-tpn", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True)""", + }) + + self.__tpn = t + if hasattr(self, '_set'): + self._set() + + def _unset_tpn(self): + self.__tpn = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True) + + + def _get_tsg(self): + """ + Getter method for tsg, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label/otn/tsg (identityref) + + YANG Description: Tributary Slot Granularity (TSG). + """ + return self.__tsg + + def _set_tsg(self, v, load=False): + """ + Setter method for tsg, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label/otn/tsg (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_tsg is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tsg() directly. + + YANG Description: Tributary Slot Granularity (TSG). + """ + 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={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tsg must be of a type compatible with identityref""", + 'defined-type': "ietf-otn-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True)""", + }) + + self.__tsg = t + if hasattr(self, '_set'): + self._set() + + def _unset_tsg(self): + self.__tsg = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + + + def _get_ts_list(self): + """ + Getter method for ts_list, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label/otn/ts_list (string) + + YANG Description: A list of available Tributary Slots (TS) ranging + + + + +between 1 and 4095. If multiple values or +ranges are given, they all MUST be disjoint +and MUST be in ascending order. +For example 1-20,25,50-1000. + """ + return self.__ts_list + + def _set_ts_list(self, v, load=False): + """ + Setter method for ts_list, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label/otn/ts_list (string) + If this variable is read-only (config: false) in the + source YANG file, then _set_ts_list is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_ts_list() directly. + + YANG Description: A list of available Tributary Slots (TS) ranging + + + + +between 1 and 4095. If multiple values or +ranges are given, they all MUST be disjoint +and MUST be in ascending order. +For example 1-20,25,50-1000. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='string', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """ts_list must be of a type compatible with string""", + 'defined-type': "string", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='string', is_config=True)""", + }) + + self.__ts_list = t + if hasattr(self, '_set'): + self._set() + + def _unset_ts_list(self): + self.__ts_list = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='string', is_config=True) + + tpn = __builtin__.property(_get_tpn, _set_tpn) + tsg = __builtin__.property(_get_tsg, _set_tsg) + ts_list = __builtin__.property(_get_ts_list, _set_ts_list) + + __choices__ = {'technology': {'otn': ['tpn', 'tsg', 'ts_list']}} + _pyangbind_elements = OrderedDict([('tpn', tpn), ('tsg', tsg), ('ts_list', ts_list), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/numbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/numbered_link_hop/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..bec617c3fa4e11573d500def11067009e0b95c83 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/numbered_link_hop/__init__.py @@ -0,0 +1,193 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 numbered_link_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/optimizations/optimization-metric/explicit-route-include-objects/route-object-include-object/numbered-link-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Numbered link explicit route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__link_tp_id','__hop_type','__direction',) + + _yang_name = 'numbered-link-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', 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 ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'optimizations', 'optimization-metric', 'explicit-route-include-objects', 'route-object-include-object', 'numbered-link-hop'] + + def _get_link_tp_id(self): + """ + Getter method for link_tp_id, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/numbered_link_hop/link_tp_id (te-tp-id) + + YANG Description: TE Link Termination Point (LTP) identifier. + """ + return self.__link_tp_id + + def _set_link_tp_id(self, v, load=False): + """ + Setter method for link_tp_id, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/numbered_link_hop/link_tp_id (te-tp-id) + If this variable is read-only (config: false) in the + source YANG file, then _set_link_tp_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_link_tp_id() directly. + + YANG Description: TE Link Termination Point (LTP) identifier. + """ + 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),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """link_tp_id must be of a type compatible with te-tp-id""", + 'defined-type': "ietf-te-topology:te-tp-id", + 'generated-type': """YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True)""", + }) + + self.__link_tp_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_link_tp_id(self): + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/numbered_link_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/numbered_link_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + 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={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + + + def _get_direction(self): + """ + Getter method for direction, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/numbered_link_hop/direction (te-link-direction) + + YANG Description: Link route object direction. + """ + return self.__direction + + def _set_direction(self, v, load=False): + """ + Setter method for direction, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/numbered_link_hop/direction (te-link-direction) + If this variable is read-only (config: false) in the + source YANG file, then _set_direction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_direction() directly. + + YANG Description: Link route object direction. + """ + 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={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """direction must be of a type compatible with te-link-direction""", + 'defined-type': "ietf-te-topology:te-link-direction", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True)""", + }) + + self.__direction = t + if hasattr(self, '_set'): + self._set() + + def _unset_direction(self): + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True) + + link_tp_id = __builtin__.property(_get_link_tp_id, _set_link_tp_id) + hop_type = __builtin__.property(_get_hop_type, _set_hop_type) + direction = __builtin__.property(_get_direction, _set_direction) + + __choices__ = {'type': {'numbered-link-hop': ['link_tp_id', 'hop_type', 'direction']}} + _pyangbind_elements = OrderedDict([('link_tp_id', link_tp_id), ('hop_type', hop_type), ('direction', direction), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/numbered_node_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/numbered_node_hop/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..6281dee5fde2d3645a433846903a110ab8d9813e --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/numbered_node_hop/__init__.py @@ -0,0 +1,154 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 numbered_node_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/optimizations/optimization-metric/explicit-route-include-objects/route-object-include-object/numbered-node-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Numbered node route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__node_id','__hop_type',) + + _yang_name = 'numbered-node-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', 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 ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'optimizations', 'optimization-metric', 'explicit-route-include-objects', 'route-object-include-object', 'numbered-node-hop'] + + def _get_node_id(self): + """ + Getter method for node_id, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/numbered_node_hop/node_id (te-node-id) + + YANG Description: The identifier of a node in the TE topology. + """ + return self.__node_id + + def _set_node_id(self, v, load=False): + """ + Setter method for node_id, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/numbered_node_hop/node_id (te-node-id) + 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. + + YANG Description: The identifier of a node in the TE topology. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """node_id must be of a type compatible with te-node-id""", + 'defined-type': "ietf-te-topology:te-node-id", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True)""", + }) + + self.__node_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_node_id(self): + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/numbered_node_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/numbered_node_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + 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={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + + node_id = __builtin__.property(_get_node_id, _set_node_id) + hop_type = __builtin__.property(_get_hop_type, _set_hop_type) + + __choices__ = {'type': {'numbered-node-hop': ['node_id', 'hop_type']}} + _pyangbind_elements = OrderedDict([('node_id', node_id), ('hop_type', hop_type), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/unnumbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/unnumbered_link_hop/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..9150e2a6ed50b034d1669d1e49f080aa3bd40fc3 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/unnumbered_link_hop/__init__.py @@ -0,0 +1,236 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 unnumbered_link_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/optimizations/optimization-metric/explicit-route-include-objects/route-object-include-object/unnumbered-link-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Unnumbered link explicit route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__link_tp_id','__node_id','__hop_type','__direction',) + + _yang_name = 'unnumbered-link-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True) + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', 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 ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'optimizations', 'optimization-metric', 'explicit-route-include-objects', 'route-object-include-object', 'unnumbered-link-hop'] + + def _get_link_tp_id(self): + """ + Getter method for link_tp_id, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/unnumbered_link_hop/link_tp_id (te-tp-id) + + YANG Description: TE LTP identifier. The combination of the TE link ID +and the TE node ID is used to identify an unnumbered +TE link. + """ + return self.__link_tp_id + + def _set_link_tp_id(self, v, load=False): + """ + Setter method for link_tp_id, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/unnumbered_link_hop/link_tp_id (te-tp-id) + If this variable is read-only (config: false) in the + source YANG file, then _set_link_tp_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_link_tp_id() directly. + + YANG Description: TE LTP identifier. The combination of the TE link ID +and the TE node ID is used to identify an unnumbered +TE link. + """ + 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),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """link_tp_id must be of a type compatible with te-tp-id""", + 'defined-type': "ietf-te-topology:te-tp-id", + 'generated-type': """YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True)""", + }) + + self.__link_tp_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_link_tp_id(self): + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True) + + + def _get_node_id(self): + """ + Getter method for node_id, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/unnumbered_link_hop/node_id (te-node-id) + + YANG Description: The identifier of a node in the TE topology. + """ + return self.__node_id + + def _set_node_id(self, v, load=False): + """ + Setter method for node_id, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/unnumbered_link_hop/node_id (te-node-id) + 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. + + YANG Description: The identifier of a node in the TE topology. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """node_id must be of a type compatible with te-node-id""", + 'defined-type': "ietf-te-topology:te-node-id", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True)""", + }) + + self.__node_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_node_id(self): + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/unnumbered_link_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/unnumbered_link_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + 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={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + + + def _get_direction(self): + """ + Getter method for direction, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/unnumbered_link_hop/direction (te-link-direction) + + YANG Description: Link route object direction. + """ + return self.__direction + + def _set_direction(self, v, load=False): + """ + Setter method for direction, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/unnumbered_link_hop/direction (te-link-direction) + If this variable is read-only (config: false) in the + source YANG file, then _set_direction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_direction() directly. + + YANG Description: Link route object direction. + """ + 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={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """direction must be of a type compatible with te-link-direction""", + 'defined-type': "ietf-te-topology:te-link-direction", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True)""", + }) + + self.__direction = t + if hasattr(self, '_set'): + self._set() + + def _unset_direction(self): + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True) + + link_tp_id = __builtin__.property(_get_link_tp_id, _set_link_tp_id) + node_id = __builtin__.property(_get_node_id, _set_node_id) + hop_type = __builtin__.property(_get_hop_type, _set_hop_type) + direction = __builtin__.property(_get_direction, _set_direction) + + __choices__ = {'type': {'unnumbered-link-hop': ['link_tp_id', 'node_id', 'hop_type', 'direction']}} + _pyangbind_elements = OrderedDict([('link_tp_id', link_tp_id), ('node_id', node_id), ('hop_type', hop_type), ('direction', direction), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/tiebreakers/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/tiebreakers/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..f5a272d7ff3a71cf63d6e16d7825b9b3298df004 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/tiebreakers/__init__.py @@ -0,0 +1,120 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 tiebreaker +class tiebreakers(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/optimizations/tiebreakers. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Container for the list of tiebreakers. + """ + __slots__ = ('_path_helper', '_extmethods', '__tiebreaker',) + + _yang_name = 'tiebreakers' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__tiebreaker = YANGDynClass(base=YANGListType("tiebreaker_type",tiebreaker.tiebreaker, yang_name="tiebreaker", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='tiebreaker-type', extensions=None, choice=('algorithm', 'metric')), is_container='list', yang_name="tiebreaker", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-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 ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'optimizations', 'tiebreakers'] + + def _get_tiebreaker(self): + """ + Getter method for tiebreaker, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/tiebreakers/tiebreaker (list) + + YANG Description: The list of tiebreaker criteria to apply on an +equally favored set of paths, in order to pick +the best. + """ + return self.__tiebreaker + + def _set_tiebreaker(self, v, load=False): + """ + Setter method for tiebreaker, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/tiebreakers/tiebreaker (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_tiebreaker is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tiebreaker() directly. + + YANG Description: The list of tiebreaker criteria to apply on an +equally favored set of paths, in order to pick +the best. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("tiebreaker_type",tiebreaker.tiebreaker, yang_name="tiebreaker", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='tiebreaker-type', extensions=None, choice=('algorithm', 'metric')), is_container='list', yang_name="tiebreaker", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tiebreaker must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("tiebreaker_type",tiebreaker.tiebreaker, yang_name="tiebreaker", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='tiebreaker-type', extensions=None, choice=('algorithm', 'metric')), is_container='list', yang_name="tiebreaker", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True)""", + }) + + self.__tiebreaker = t + if hasattr(self, '_set'): + self._set() + + def _unset_tiebreaker(self): + self.__tiebreaker = YANGDynClass(base=YANGListType("tiebreaker_type",tiebreaker.tiebreaker, yang_name="tiebreaker", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='tiebreaker-type', extensions=None, choice=('algorithm', 'metric')), is_container='list', yang_name="tiebreaker", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + + tiebreaker = __builtin__.property(_get_tiebreaker, _set_tiebreaker) + + __choices__ = {'algorithm': {'metric': ['tiebreaker']}} + _pyangbind_elements = OrderedDict([('tiebreaker', tiebreaker), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/tiebreakers/tiebreaker/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/tiebreakers/tiebreaker/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..2a5ad102ada2c667c7e9fd37d6419baff6b3ad36 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/tiebreakers/tiebreaker/__init__.py @@ -0,0 +1,122 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 tiebreaker(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/optimizations/tiebreakers/tiebreaker. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: The list of tiebreaker criteria to apply on an +equally favored set of paths, in order to pick +the best. + """ + __slots__ = ('_path_helper', '_extmethods', '__tiebreaker_type',) + + _yang_name = 'tiebreaker' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__tiebreaker_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="tiebreaker-type", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', 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 ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'optimizations', 'tiebreakers', 'tiebreaker'] + + def _get_tiebreaker_type(self): + """ + Getter method for tiebreaker_type, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/tiebreakers/tiebreaker/tiebreaker_type (identityref) + + YANG Description: Identifies an entry in the list of tiebreakers. + """ + return self.__tiebreaker_type + + def _set_tiebreaker_type(self, v, load=False): + """ + Setter method for tiebreaker_type, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/tiebreakers/tiebreaker/tiebreaker_type (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_tiebreaker_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tiebreaker_type() directly. + + YANG Description: Identifies an entry in the list of tiebreakers. + """ + 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=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="tiebreaker-type", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tiebreaker_type must be of a type compatible with identityref""", + 'defined-type': "ietf-te-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="tiebreaker-type", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True)""", + }) + + self.__tiebreaker_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_tiebreaker_type(self): + self.__tiebreaker_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="tiebreaker-type", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + + tiebreaker_type = __builtin__.property(_get_tiebreaker_type, _set_tiebreaker_type) + + __choices__ = {'algorithm': {'metric': ['tiebreaker_type']}} + _pyangbind_elements = OrderedDict([('tiebreaker_type', tiebreaker_type), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..995e60b8b8d8c0afe207ea8c44a73c34ae1af587 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/__init__.py @@ -0,0 +1,523 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 te_bandwidth +from . import path_metric_bounds +from . import path_affinities_values +from . import path_affinity_names +from . import path_srlgs_lists +from . import path_srlgs_names +class path_constraints(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/path-constraints. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: TE named path constraints container. + """ + __slots__ = ('_path_helper', '_extmethods', '__te_bandwidth','__link_protection','__setup_priority','__hold_priority','__signaling_type','__path_metric_bounds','__path_affinities_values','__path_affinity_names','__path_srlgs_lists','__path_srlgs_names','__disjointness',) + + _yang_name = 'path-constraints' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__te_bandwidth = YANGDynClass(base=te_bandwidth.te_bandwidth, is_container='container', yang_name="te-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__link_protection = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'link-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-shared': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-shared': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-shared': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-enhanced': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-enhanced': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-enhanced': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), default=six.text_type("te-types:link-protection-unprotected"), is_leaf=True, yang_name="link-protection", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + self.__setup_priority = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..7']}), default=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8)(7), is_leaf=True, yang_name="setup-priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint8', is_config=True) + self.__hold_priority = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..7']}), default=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8)(7), is_leaf=True, yang_name="hold-priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint8', is_config=True) + self.__signaling_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'path-setup-static': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-setup-static': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-setup-static': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-setup-rsvp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-setup-rsvp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-setup-rsvp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-setup-sr': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-setup-sr': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-setup-sr': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), default=six.text_type("te-types:path-setup-rsvp"), is_leaf=True, yang_name="signaling-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + self.__path_metric_bounds = YANGDynClass(base=path_metric_bounds.path_metric_bounds, is_container='container', yang_name="path-metric-bounds", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__path_affinities_values = YANGDynClass(base=path_affinities_values.path_affinities_values, is_container='container', yang_name="path-affinities-values", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__path_affinity_names = YANGDynClass(base=path_affinity_names.path_affinity_names, is_container='container', yang_name="path-affinity-names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__path_srlgs_lists = YANGDynClass(base=path_srlgs_lists.path_srlgs_lists, is_container='container', yang_name="path-srlgs-lists", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__path_srlgs_names = YANGDynClass(base=path_srlgs_names.path_srlgs_names, is_container='container', yang_name="path-srlgs-names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__disjointness = YANGDynClass(base=YANGBitsType(allowed_bits={'node': '0', 'link': '1', 'srlg': '2'}), is_leaf=True, yang_name="disjointness", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-path-disjointness', 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 ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'path-constraints'] + + def _get_te_bandwidth(self): + """ + Getter method for te_bandwidth, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/te_bandwidth (container) + + YANG Description: Container that specifies TE bandwidth. The choices +can be augmented for specific data-plane technologies. + """ + return self.__te_bandwidth + + def _set_te_bandwidth(self, v, load=False): + """ + Setter method for te_bandwidth, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/te_bandwidth (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_te_bandwidth is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_te_bandwidth() directly. + + YANG Description: Container that specifies TE bandwidth. The choices +can be augmented for specific data-plane technologies. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=te_bandwidth.te_bandwidth, is_container='container', yang_name="te-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """te_bandwidth must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=te_bandwidth.te_bandwidth, is_container='container', yang_name="te-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__te_bandwidth = t + if hasattr(self, '_set'): + self._set() + + def _unset_te_bandwidth(self): + self.__te_bandwidth = YANGDynClass(base=te_bandwidth.te_bandwidth, is_container='container', yang_name="te-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_link_protection(self): + """ + Getter method for link_protection, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/link_protection (identityref) + + YANG Description: Link protection type required for the links included +in the computed path. + """ + return self.__link_protection + + def _set_link_protection(self, v, load=False): + """ + Setter method for link_protection, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/link_protection (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_link_protection is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_link_protection() directly. + + YANG Description: Link protection type required for the links included +in the computed path. + """ + 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={'link-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-shared': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-shared': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-shared': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-enhanced': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-enhanced': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-enhanced': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), default=six.text_type("te-types:link-protection-unprotected"), is_leaf=True, yang_name="link-protection", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """link_protection must be of a type compatible with identityref""", + 'defined-type': "ietf-te-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'link-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-shared': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-shared': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-shared': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-enhanced': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-enhanced': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-enhanced': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), default=six.text_type("te-types:link-protection-unprotected"), is_leaf=True, yang_name="link-protection", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True)""", + }) + + self.__link_protection = t + if hasattr(self, '_set'): + self._set() + + def _unset_link_protection(self): + self.__link_protection = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'link-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-shared': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-shared': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-shared': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-enhanced': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-enhanced': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-enhanced': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), default=six.text_type("te-types:link-protection-unprotected"), is_leaf=True, yang_name="link-protection", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + + + def _get_setup_priority(self): + """ + Getter method for setup_priority, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/setup_priority (uint8) + + YANG Description: TE LSP requested setup priority. + """ + return self.__setup_priority + + def _set_setup_priority(self, v, load=False): + """ + Setter method for setup_priority, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/setup_priority (uint8) + If this variable is read-only (config: false) in the + source YANG file, then _set_setup_priority is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_setup_priority() directly. + + YANG Description: TE LSP requested setup priority. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..7']}), default=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8)(7), is_leaf=True, yang_name="setup-priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint8', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """setup_priority must be of a type compatible with uint8""", + 'defined-type': "uint8", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..7']}), default=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8)(7), is_leaf=True, yang_name="setup-priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint8', is_config=True)""", + }) + + self.__setup_priority = t + if hasattr(self, '_set'): + self._set() + + def _unset_setup_priority(self): + self.__setup_priority = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..7']}), default=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8)(7), is_leaf=True, yang_name="setup-priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint8', is_config=True) + + + def _get_hold_priority(self): + """ + Getter method for hold_priority, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/hold_priority (uint8) + + YANG Description: TE LSP requested hold priority. + """ + return self.__hold_priority + + def _set_hold_priority(self, v, load=False): + """ + Setter method for hold_priority, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/hold_priority (uint8) + If this variable is read-only (config: false) in the + source YANG file, then _set_hold_priority is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hold_priority() directly. + + YANG Description: TE LSP requested hold priority. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..7']}), default=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8)(7), is_leaf=True, yang_name="hold-priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint8', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hold_priority must be of a type compatible with uint8""", + 'defined-type': "uint8", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..7']}), default=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8)(7), is_leaf=True, yang_name="hold-priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint8', is_config=True)""", + }) + + self.__hold_priority = t + if hasattr(self, '_set'): + self._set() + + def _unset_hold_priority(self): + self.__hold_priority = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..7']}), default=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8)(7), is_leaf=True, yang_name="hold-priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint8', is_config=True) + + + def _get_signaling_type(self): + """ + Getter method for signaling_type, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/signaling_type (identityref) + + YANG Description: TE tunnel path signaling type. + """ + return self.__signaling_type + + def _set_signaling_type(self, v, load=False): + """ + Setter method for signaling_type, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/signaling_type (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_signaling_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_signaling_type() directly. + + YANG Description: TE tunnel path signaling type. + """ + 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={'path-setup-static': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-setup-static': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-setup-static': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-setup-rsvp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-setup-rsvp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-setup-rsvp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-setup-sr': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-setup-sr': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-setup-sr': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), default=six.text_type("te-types:path-setup-rsvp"), is_leaf=True, yang_name="signaling-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """signaling_type must be of a type compatible with identityref""", + 'defined-type': "ietf-te-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'path-setup-static': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-setup-static': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-setup-static': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-setup-rsvp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-setup-rsvp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-setup-rsvp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-setup-sr': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-setup-sr': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-setup-sr': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), default=six.text_type("te-types:path-setup-rsvp"), is_leaf=True, yang_name="signaling-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True)""", + }) + + self.__signaling_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_signaling_type(self): + self.__signaling_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'path-setup-static': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-setup-static': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-setup-static': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-setup-rsvp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-setup-rsvp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-setup-rsvp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-setup-sr': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-setup-sr': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-setup-sr': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), default=six.text_type("te-types:path-setup-rsvp"), is_leaf=True, yang_name="signaling-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + + + def _get_path_metric_bounds(self): + """ + Getter method for path_metric_bounds, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/path_metric_bounds (container) + + YANG Description: TE path metric bounds container. + """ + return self.__path_metric_bounds + + def _set_path_metric_bounds(self, v, load=False): + """ + Setter method for path_metric_bounds, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/path_metric_bounds (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_metric_bounds is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_metric_bounds() directly. + + YANG Description: TE path metric bounds container. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=path_metric_bounds.path_metric_bounds, is_container='container', yang_name="path-metric-bounds", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_metric_bounds must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=path_metric_bounds.path_metric_bounds, is_container='container', yang_name="path-metric-bounds", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__path_metric_bounds = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_metric_bounds(self): + self.__path_metric_bounds = YANGDynClass(base=path_metric_bounds.path_metric_bounds, is_container='container', yang_name="path-metric-bounds", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_path_affinities_values(self): + """ + Getter method for path_affinities_values, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/path_affinities_values (container) + + YANG Description: Path affinities represented as values. + """ + return self.__path_affinities_values + + def _set_path_affinities_values(self, v, load=False): + """ + Setter method for path_affinities_values, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/path_affinities_values (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_affinities_values is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_affinities_values() directly. + + YANG Description: Path affinities represented as values. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=path_affinities_values.path_affinities_values, is_container='container', yang_name="path-affinities-values", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_affinities_values must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=path_affinities_values.path_affinities_values, is_container='container', yang_name="path-affinities-values", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__path_affinities_values = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_affinities_values(self): + self.__path_affinities_values = YANGDynClass(base=path_affinities_values.path_affinities_values, is_container='container', yang_name="path-affinities-values", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_path_affinity_names(self): + """ + Getter method for path_affinity_names, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/path_affinity_names (container) + + YANG Description: Path affinities represented as names. + """ + return self.__path_affinity_names + + def _set_path_affinity_names(self, v, load=False): + """ + Setter method for path_affinity_names, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/path_affinity_names (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_affinity_names is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_affinity_names() directly. + + YANG Description: Path affinities represented as names. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=path_affinity_names.path_affinity_names, is_container='container', yang_name="path-affinity-names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_affinity_names must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=path_affinity_names.path_affinity_names, is_container='container', yang_name="path-affinity-names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__path_affinity_names = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_affinity_names(self): + self.__path_affinity_names = YANGDynClass(base=path_affinity_names.path_affinity_names, is_container='container', yang_name="path-affinity-names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_path_srlgs_lists(self): + """ + Getter method for path_srlgs_lists, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/path_srlgs_lists (container) + + YANG Description: Path SRLG properties container. + """ + return self.__path_srlgs_lists + + def _set_path_srlgs_lists(self, v, load=False): + """ + Setter method for path_srlgs_lists, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/path_srlgs_lists (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_srlgs_lists is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_srlgs_lists() directly. + + YANG Description: Path SRLG properties container. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=path_srlgs_lists.path_srlgs_lists, is_container='container', yang_name="path-srlgs-lists", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_srlgs_lists must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=path_srlgs_lists.path_srlgs_lists, is_container='container', yang_name="path-srlgs-lists", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__path_srlgs_lists = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_srlgs_lists(self): + self.__path_srlgs_lists = YANGDynClass(base=path_srlgs_lists.path_srlgs_lists, is_container='container', yang_name="path-srlgs-lists", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_path_srlgs_names(self): + """ + Getter method for path_srlgs_names, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/path_srlgs_names (container) + + YANG Description: Container for the list of named SRLGs. + """ + return self.__path_srlgs_names + + def _set_path_srlgs_names(self, v, load=False): + """ + Setter method for path_srlgs_names, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/path_srlgs_names (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_srlgs_names is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_srlgs_names() directly. + + YANG Description: Container for the list of named SRLGs. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=path_srlgs_names.path_srlgs_names, is_container='container', yang_name="path-srlgs-names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_srlgs_names must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=path_srlgs_names.path_srlgs_names, is_container='container', yang_name="path-srlgs-names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__path_srlgs_names = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_srlgs_names(self): + self.__path_srlgs_names = YANGDynClass(base=path_srlgs_names.path_srlgs_names, is_container='container', yang_name="path-srlgs-names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_disjointness(self): + """ + Getter method for disjointness, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/disjointness (te-path-disjointness) + + YANG Description: The type of resource disjointness. +When configured for a primary path, the disjointness level +applies to all secondary LSPs. When configured for a +secondary path, the disjointness level overrides the level +configured for the primary path. + """ + return self.__disjointness + + def _set_disjointness(self, v, load=False): + """ + Setter method for disjointness, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/disjointness (te-path-disjointness) + If this variable is read-only (config: false) in the + source YANG file, then _set_disjointness is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_disjointness() directly. + + YANG Description: The type of resource disjointness. +When configured for a primary path, the disjointness level +applies to all secondary LSPs. When configured for a +secondary path, the disjointness level overrides the level +configured for the primary path. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBitsType(allowed_bits={'node': '0', 'link': '1', 'srlg': '2'}), is_leaf=True, yang_name="disjointness", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-path-disjointness', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """disjointness must be of a type compatible with te-path-disjointness""", + 'defined-type': "ietf-te-topology:te-path-disjointness", + 'generated-type': """YANGDynClass(base=YANGBitsType(allowed_bits={'node': '0', 'link': '1', 'srlg': '2'}), is_leaf=True, yang_name="disjointness", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-path-disjointness', is_config=True)""", + }) + + self.__disjointness = t + if hasattr(self, '_set'): + self._set() + + def _unset_disjointness(self): + self.__disjointness = YANGDynClass(base=YANGBitsType(allowed_bits={'node': '0', 'link': '1', 'srlg': '2'}), is_leaf=True, yang_name="disjointness", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-path-disjointness', is_config=True) + + te_bandwidth = __builtin__.property(_get_te_bandwidth, _set_te_bandwidth) + link_protection = __builtin__.property(_get_link_protection, _set_link_protection) + setup_priority = __builtin__.property(_get_setup_priority, _set_setup_priority) + hold_priority = __builtin__.property(_get_hold_priority, _set_hold_priority) + signaling_type = __builtin__.property(_get_signaling_type, _set_signaling_type) + path_metric_bounds = __builtin__.property(_get_path_metric_bounds, _set_path_metric_bounds) + path_affinities_values = __builtin__.property(_get_path_affinities_values, _set_path_affinities_values) + path_affinity_names = __builtin__.property(_get_path_affinity_names, _set_path_affinity_names) + path_srlgs_lists = __builtin__.property(_get_path_srlgs_lists, _set_path_srlgs_lists) + path_srlgs_names = __builtin__.property(_get_path_srlgs_names, _set_path_srlgs_names) + disjointness = __builtin__.property(_get_disjointness, _set_disjointness) + + + _pyangbind_elements = OrderedDict([('te_bandwidth', te_bandwidth), ('link_protection', link_protection), ('setup_priority', setup_priority), ('hold_priority', hold_priority), ('signaling_type', signaling_type), ('path_metric_bounds', path_metric_bounds), ('path_affinities_values', path_affinities_values), ('path_affinity_names', path_affinity_names), ('path_srlgs_lists', path_srlgs_lists), ('path_srlgs_names', path_srlgs_names), ('disjointness', disjointness), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/path_affinities_values/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/path_affinities_values/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..d3b86bd00f9cdd444c47d0b4c6d9872f7443bc52 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/path_affinities_values/__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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 path_affinities_value +class path_affinities_values(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/path-constraints/path-affinities-values. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Path affinities represented as values. + """ + __slots__ = ('_path_helper', '_extmethods', '__path_affinities_value',) + + _yang_name = 'path-affinities-values' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__path_affinities_value = YANGDynClass(base=YANGListType("usage",path_affinities_value.path_affinities_value, yang_name="path-affinities-value", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-affinities-value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-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 ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'path-constraints', 'path-affinities-values'] + + def _get_path_affinities_value(self): + """ + Getter method for path_affinities_value, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/path_affinities_values/path_affinities_value (list) + + YANG Description: List of named affinity constraints. + """ + return self.__path_affinities_value + + def _set_path_affinities_value(self, v, load=False): + """ + Setter method for path_affinities_value, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/path_affinities_values/path_affinities_value (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_affinities_value is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_affinities_value() directly. + + YANG Description: List of named affinity constraints. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("usage",path_affinities_value.path_affinities_value, yang_name="path-affinities-value", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-affinities-value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_affinities_value must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("usage",path_affinities_value.path_affinities_value, yang_name="path-affinities-value", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-affinities-value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True)""", + }) + + self.__path_affinities_value = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_affinities_value(self): + self.__path_affinities_value = YANGDynClass(base=YANGListType("usage",path_affinities_value.path_affinities_value, yang_name="path-affinities-value", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-affinities-value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + + path_affinities_value = __builtin__.property(_get_path_affinities_value, _set_path_affinities_value) + + + _pyangbind_elements = OrderedDict([('path_affinities_value', path_affinities_value), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/path_affinities_values/path_affinities_value/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/path_affinities_values/path_affinities_value/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..0d53fa7eb6527d38c2ec20b59918ce25923b3563 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/path_affinities_values/path_affinities_value/__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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 path_affinities_value(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/path-constraints/path-affinities-values/path-affinities-value. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: List of named affinity constraints. + """ + __slots__ = ('_path_helper', '_extmethods', '__usage','__value',) + + _yang_name = 'path-affinities-value' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__usage = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + self.__value = YANGDynClass(base=[RestrictedClassType(base_type=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}), restriction_dict={'length': ['1..11']}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}),], default=six.text_type(""), is_leaf=True, yang_name="value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='admin-groups', 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 ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'path-constraints', 'path-affinities-values', 'path-affinities-value'] + + def _get_usage(self): + """ + Getter method for usage, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/path_affinities_values/path_affinities_value/usage (identityref) + + YANG Description: Identifies an entry in the list of value affinity +constraints. + """ + return self.__usage + + def _set_usage(self, v, load=False): + """ + Setter method for usage, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/path_affinities_values/path_affinities_value/usage (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_usage is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_usage() directly. + + YANG Description: Identifies an entry in the list of value affinity +constraints. + """ + 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=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """usage must be of a type compatible with identityref""", + 'defined-type': "ietf-te-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True)""", + }) + + self.__usage = t + if hasattr(self, '_set'): + self._set() + + def _unset_usage(self): + self.__usage = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + + + def _get_value(self): + """ + Getter method for value, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/path_affinities_values/path_affinities_value/value (admin-groups) + + YANG Description: The affinity value. The default is empty. + """ + return self.__value + + def _set_value(self, v, load=False): + """ + Setter method for value, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/path_affinities_values/path_affinities_value/value (admin-groups) + 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: The affinity value. The default is empty. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=[RestrictedClassType(base_type=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}), restriction_dict={'length': ['1..11']}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}),], default=six.text_type(""), is_leaf=True, yang_name="value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='admin-groups', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """value must be of a type compatible with admin-groups""", + 'defined-type': "ietf-te-topology:admin-groups", + 'generated-type': """YANGDynClass(base=[RestrictedClassType(base_type=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}), restriction_dict={'length': ['1..11']}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}),], default=six.text_type(""), is_leaf=True, yang_name="value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='admin-groups', is_config=True)""", + }) + + self.__value = t + if hasattr(self, '_set'): + self._set() + + def _unset_value(self): + self.__value = YANGDynClass(base=[RestrictedClassType(base_type=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}), restriction_dict={'length': ['1..11']}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}),], default=six.text_type(""), is_leaf=True, yang_name="value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='admin-groups', is_config=True) + + usage = __builtin__.property(_get_usage, _set_usage) + value = __builtin__.property(_get_value, _set_value) + + + _pyangbind_elements = OrderedDict([('usage', usage), ('value', value), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/path_affinity_names/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/path_affinity_names/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..915eb1efba9948d537f6ef35b2666651ba8398bd --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/path_affinity_names/__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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 path_affinity_name +class path_affinity_names(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/path-constraints/path-affinity-names. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Path affinities represented as names. + """ + __slots__ = ('_path_helper', '_extmethods', '__path_affinity_name',) + + _yang_name = 'path-affinity-names' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__path_affinity_name = YANGDynClass(base=YANGListType("usage",path_affinity_name.path_affinity_name, yang_name="path-affinity-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-affinity-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-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 ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'path-constraints', 'path-affinity-names'] + + def _get_path_affinity_name(self): + """ + Getter method for path_affinity_name, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/path_affinity_names/path_affinity_name (list) + + YANG Description: List of named affinity constraints. + """ + return self.__path_affinity_name + + def _set_path_affinity_name(self, v, load=False): + """ + Setter method for path_affinity_name, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/path_affinity_names/path_affinity_name (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_affinity_name is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_affinity_name() directly. + + YANG Description: List of named affinity constraints. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("usage",path_affinity_name.path_affinity_name, yang_name="path-affinity-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-affinity-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_affinity_name must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("usage",path_affinity_name.path_affinity_name, yang_name="path-affinity-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-affinity-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True)""", + }) + + self.__path_affinity_name = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_affinity_name(self): + self.__path_affinity_name = YANGDynClass(base=YANGListType("usage",path_affinity_name.path_affinity_name, yang_name="path-affinity-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-affinity-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + + path_affinity_name = __builtin__.property(_get_path_affinity_name, _set_path_affinity_name) + + + _pyangbind_elements = OrderedDict([('path_affinity_name', path_affinity_name), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/path_affinity_names/path_affinity_name/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/path_affinity_names/path_affinity_name/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..f4886c5ce32b94fd9c091c9f1e34e74a28db92bb --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/path_affinity_names/path_affinity_name/__init__.py @@ -0,0 +1,162 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 affinity_name +class path_affinity_name(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/path-constraints/path-affinity-names/path-affinity-name. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: List of named affinity constraints. + """ + __slots__ = ('_path_helper', '_extmethods', '__usage','__affinity_name',) + + _yang_name = 'path-affinity-name' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__usage = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + self.__affinity_name = YANGDynClass(base=YANGListType("name",affinity_name.affinity_name, yang_name="affinity-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='name', extensions=None), is_container='list', yang_name="affinity-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-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 ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'path-constraints', 'path-affinity-names', 'path-affinity-name'] + + def _get_usage(self): + """ + Getter method for usage, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/path_affinity_names/path_affinity_name/usage (identityref) + + YANG Description: Identifies an entry in the list of named affinity +constraints. + """ + return self.__usage + + def _set_usage(self, v, load=False): + """ + Setter method for usage, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/path_affinity_names/path_affinity_name/usage (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_usage is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_usage() directly. + + YANG Description: Identifies an entry in the list of named affinity +constraints. + """ + 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=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """usage must be of a type compatible with identityref""", + 'defined-type': "ietf-te-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True)""", + }) + + self.__usage = t + if hasattr(self, '_set'): + self._set() + + def _unset_usage(self): + self.__usage = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + + + def _get_affinity_name(self): + """ + Getter method for affinity_name, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/path_affinity_names/path_affinity_name/affinity_name (list) + + YANG Description: List of named affinities. + """ + return self.__affinity_name + + def _set_affinity_name(self, v, load=False): + """ + Setter method for affinity_name, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/path_affinity_names/path_affinity_name/affinity_name (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_affinity_name is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_affinity_name() directly. + + YANG Description: List of named affinities. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("name",affinity_name.affinity_name, yang_name="affinity-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='name', extensions=None), is_container='list', yang_name="affinity-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """affinity_name must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("name",affinity_name.affinity_name, yang_name="affinity-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='name', extensions=None), is_container='list', yang_name="affinity-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True)""", + }) + + self.__affinity_name = t + if hasattr(self, '_set'): + self._set() + + def _unset_affinity_name(self): + self.__affinity_name = YANGDynClass(base=YANGListType("name",affinity_name.affinity_name, yang_name="affinity-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='name', extensions=None), is_container='list', yang_name="affinity-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + + usage = __builtin__.property(_get_usage, _set_usage) + affinity_name = __builtin__.property(_get_affinity_name, _set_affinity_name) + + + _pyangbind_elements = OrderedDict([('usage', usage), ('affinity_name', affinity_name), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/path_affinity_names/path_affinity_name/affinity_name/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/path_affinity_names/path_affinity_name/affinity_name/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..2a14ea23b6bac527f70952d99f9bfc44907e81b3 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/path_affinity_names/path_affinity_name/affinity_name/__init__.py @@ -0,0 +1,120 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 affinity_name(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/path-constraints/path-affinity-names/path-affinity-name/affinity-name. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: List of named affinities. + """ + __slots__ = ('_path_helper', '_extmethods', '__name',) + + _yang_name = 'affinity-name' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _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='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-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 ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'path-constraints', 'path-affinity-names', 'path-affinity-name', 'affinity-name'] + + def _get_name(self): + """ + Getter method for name, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/path_affinity_names/path_affinity_name/affinity_name/name (string) + + YANG Description: Identifies a named affinity entry. + """ + return self.__name + + def _set_name(self, v, load=False): + """ + Setter method for name, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/path_affinity_names/path_affinity_name/affinity_name/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: Identifies a named affinity entry. + """ + 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='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', 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, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', 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, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=True) + + name = __builtin__.property(_get_name, _set_name) + + + _pyangbind_elements = OrderedDict([('name', name), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/path_metric_bounds/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/path_metric_bounds/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..9a35d6f919f7bfef3d8d83d10175fa4b04a17cb8 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/path_metric_bounds/__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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 path_metric_bound +class path_metric_bounds(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/path-constraints/path-metric-bounds. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: TE path metric bounds container. + """ + __slots__ = ('_path_helper', '_extmethods', '__path_metric_bound',) + + _yang_name = 'path-metric-bounds' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__path_metric_bound = YANGDynClass(base=YANGListType("metric_type",path_metric_bound.path_metric_bound, yang_name="path-metric-bound", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='metric-type', extensions=None), is_container='list', yang_name="path-metric-bound", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-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 ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'path-constraints', 'path-metric-bounds'] + + def _get_path_metric_bound(self): + """ + Getter method for path_metric_bound, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/path_metric_bounds/path_metric_bound (list) + + YANG Description: List of TE path metric bounds. + """ + return self.__path_metric_bound + + def _set_path_metric_bound(self, v, load=False): + """ + Setter method for path_metric_bound, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/path_metric_bounds/path_metric_bound (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_metric_bound is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_metric_bound() directly. + + YANG Description: List of TE path metric bounds. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("metric_type",path_metric_bound.path_metric_bound, yang_name="path-metric-bound", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='metric-type', extensions=None), is_container='list', yang_name="path-metric-bound", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_metric_bound must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("metric_type",path_metric_bound.path_metric_bound, yang_name="path-metric-bound", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='metric-type', extensions=None), is_container='list', yang_name="path-metric-bound", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True)""", + }) + + self.__path_metric_bound = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_metric_bound(self): + self.__path_metric_bound = YANGDynClass(base=YANGListType("metric_type",path_metric_bound.path_metric_bound, yang_name="path-metric-bound", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='metric-type', extensions=None), is_container='list', yang_name="path-metric-bound", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + + path_metric_bound = __builtin__.property(_get_path_metric_bound, _set_path_metric_bound) + + + _pyangbind_elements = OrderedDict([('path_metric_bound', path_metric_bound), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/path_metric_bounds/path_metric_bound/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/path_metric_bounds/path_metric_bound/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..c015281ab564d3baceb353d35a63a80496e2b538 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/path_metric_bounds/path_metric_bound/__init__.py @@ -0,0 +1,165 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 path_metric_bound(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/path-constraints/path-metric-bounds/path-metric-bound. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: List of TE path metric bounds. + """ + __slots__ = ('_path_helper', '_extmethods', '__metric_type','__upper_bound',) + + _yang_name = 'path-metric-bound' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__metric_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="metric-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + self.__upper_bound = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), default=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64)(0), is_leaf=True, yang_name="upper-bound", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint64', 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 ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'path-constraints', 'path-metric-bounds', 'path-metric-bound'] + + def _get_metric_type(self): + """ + Getter method for metric_type, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/path_metric_bounds/path_metric_bound/metric_type (identityref) + + YANG Description: Identifies an entry in the list of 'metric-type' items +bound for the TE path. + """ + return self.__metric_type + + def _set_metric_type(self, v, load=False): + """ + Setter method for metric_type, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/path_metric_bounds/path_metric_bound/metric_type (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_metric_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_metric_type() directly. + + YANG Description: Identifies an entry in the list of 'metric-type' items +bound for the TE path. + """ + 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=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="metric-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """metric_type must be of a type compatible with identityref""", + 'defined-type': "ietf-te-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="metric-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True)""", + }) + + self.__metric_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_metric_type(self): + self.__metric_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="metric-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + + + def _get_upper_bound(self): + """ + Getter method for upper_bound, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/path_metric_bounds/path_metric_bound/upper_bound (uint64) + + YANG Description: Upper bound on the end-to-end TE path metric. A zero +indicates an unbounded upper limit for the specific +'metric-type'. + """ + return self.__upper_bound + + def _set_upper_bound(self, v, load=False): + """ + Setter method for upper_bound, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/path_metric_bounds/path_metric_bound/upper_bound (uint64) + If this variable is read-only (config: false) in the + source YANG file, then _set_upper_bound is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_upper_bound() directly. + + YANG Description: Upper bound on the end-to-end TE path metric. A zero +indicates an unbounded upper limit for the specific +'metric-type'. + """ + 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), default=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64)(0), is_leaf=True, yang_name="upper-bound", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint64', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """upper_bound 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), default=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64)(0), is_leaf=True, yang_name="upper-bound", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint64', is_config=True)""", + }) + + self.__upper_bound = t + if hasattr(self, '_set'): + self._set() + + def _unset_upper_bound(self): + self.__upper_bound = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), default=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64)(0), is_leaf=True, yang_name="upper-bound", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint64', is_config=True) + + metric_type = __builtin__.property(_get_metric_type, _set_metric_type) + upper_bound = __builtin__.property(_get_upper_bound, _set_upper_bound) + + + _pyangbind_elements = OrderedDict([('metric_type', metric_type), ('upper_bound', upper_bound), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/path_srlgs_lists/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/path_srlgs_lists/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..1be416c5fede3814b541f7582f1c7dc74c4c9bf6 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/path_srlgs_lists/__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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 path_srlgs_list +class path_srlgs_lists(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/path-constraints/path-srlgs-lists. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Path SRLG properties container. + """ + __slots__ = ('_path_helper', '_extmethods', '__path_srlgs_list',) + + _yang_name = 'path-srlgs-lists' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__path_srlgs_list = YANGDynClass(base=YANGListType("usage",path_srlgs_list.path_srlgs_list, yang_name="path-srlgs-list", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-srlgs-list", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-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 ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'path-constraints', 'path-srlgs-lists'] + + def _get_path_srlgs_list(self): + """ + Getter method for path_srlgs_list, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/path_srlgs_lists/path_srlgs_list (list) + + YANG Description: List of SRLG values to be included or excluded. + """ + return self.__path_srlgs_list + + def _set_path_srlgs_list(self, v, load=False): + """ + Setter method for path_srlgs_list, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/path_srlgs_lists/path_srlgs_list (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_srlgs_list is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_srlgs_list() directly. + + YANG Description: List of SRLG values to be included or excluded. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("usage",path_srlgs_list.path_srlgs_list, yang_name="path-srlgs-list", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-srlgs-list", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_srlgs_list must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("usage",path_srlgs_list.path_srlgs_list, yang_name="path-srlgs-list", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-srlgs-list", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True)""", + }) + + self.__path_srlgs_list = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_srlgs_list(self): + self.__path_srlgs_list = YANGDynClass(base=YANGListType("usage",path_srlgs_list.path_srlgs_list, yang_name="path-srlgs-list", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-srlgs-list", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + + path_srlgs_list = __builtin__.property(_get_path_srlgs_list, _set_path_srlgs_list) + + + _pyangbind_elements = OrderedDict([('path_srlgs_list', path_srlgs_list), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/path_srlgs_lists/path_srlgs_list/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/path_srlgs_lists/path_srlgs_list/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..656884a887a37097554e5c0d65351daa1c4a1d99 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/path_srlgs_lists/path_srlgs_list/__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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 path_srlgs_list(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/path-constraints/path-srlgs-lists/path-srlgs-list. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: List of SRLG values to be included or excluded. + """ + __slots__ = ('_path_helper', '_extmethods', '__usage','__values',) + + _yang_name = 'path-srlgs-list' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__usage = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + self.__values = YANGDynClass(unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32)), is_leaf=False, yang_name="values", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='srlg', 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 ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'path-constraints', 'path-srlgs-lists', 'path-srlgs-list'] + + def _get_usage(self): + """ + Getter method for usage, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/path_srlgs_lists/path_srlgs_list/usage (identityref) + + YANG Description: Identifies an entry in a list of SRLGs to either +include or exclude. + """ + return self.__usage + + def _set_usage(self, v, load=False): + """ + Setter method for usage, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/path_srlgs_lists/path_srlgs_list/usage (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_usage is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_usage() directly. + + YANG Description: Identifies an entry in a list of SRLGs to either +include or exclude. + """ + 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=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """usage must be of a type compatible with identityref""", + 'defined-type': "ietf-te-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True)""", + }) + + self.__usage = t + if hasattr(self, '_set'): + self._set() + + def _unset_usage(self): + self.__usage = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + + + def _get_values(self): + """ + Getter method for values, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/path_srlgs_lists/path_srlgs_list/values (srlg) + + YANG Description: List of SRLG values. + """ + return self.__values + + def _set_values(self, v, load=False): + """ + Setter method for values, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/path_srlgs_lists/path_srlgs_list/values (srlg) + If this variable is read-only (config: false) in the + source YANG file, then _set_values is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_values() directly. + + YANG Description: List of SRLG values. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32)), is_leaf=False, yang_name="values", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='srlg', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """values must be of a type compatible with srlg""", + 'defined-type': "ietf-te-topology:srlg", + 'generated-type': """YANGDynClass(unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32)), is_leaf=False, yang_name="values", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='srlg', is_config=True)""", + }) + + self.__values = t + if hasattr(self, '_set'): + self._set() + + def _unset_values(self): + self.__values = YANGDynClass(unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32)), is_leaf=False, yang_name="values", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='srlg', is_config=True) + + usage = __builtin__.property(_get_usage, _set_usage) + values = __builtin__.property(_get_values, _set_values) + + + _pyangbind_elements = OrderedDict([('usage', usage), ('values', values), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/path_srlgs_names/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/path_srlgs_names/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..0e50a196f1902610a99d0a2b957695bc47c02184 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/path_srlgs_names/__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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 path_srlgs_name +class path_srlgs_names(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/path-constraints/path-srlgs-names. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Container for the list of named SRLGs. + """ + __slots__ = ('_path_helper', '_extmethods', '__path_srlgs_name',) + + _yang_name = 'path-srlgs-names' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__path_srlgs_name = YANGDynClass(base=YANGListType("usage",path_srlgs_name.path_srlgs_name, yang_name="path-srlgs-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-srlgs-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-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 ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'path-constraints', 'path-srlgs-names'] + + def _get_path_srlgs_name(self): + """ + Getter method for path_srlgs_name, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/path_srlgs_names/path_srlgs_name (list) + + YANG Description: List of named SRLGs to be included or excluded. + """ + return self.__path_srlgs_name + + def _set_path_srlgs_name(self, v, load=False): + """ + Setter method for path_srlgs_name, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/path_srlgs_names/path_srlgs_name (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_srlgs_name is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_srlgs_name() directly. + + YANG Description: List of named SRLGs to be included or excluded. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("usage",path_srlgs_name.path_srlgs_name, yang_name="path-srlgs-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-srlgs-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_srlgs_name must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("usage",path_srlgs_name.path_srlgs_name, yang_name="path-srlgs-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-srlgs-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True)""", + }) + + self.__path_srlgs_name = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_srlgs_name(self): + self.__path_srlgs_name = YANGDynClass(base=YANGListType("usage",path_srlgs_name.path_srlgs_name, yang_name="path-srlgs-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-srlgs-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + + path_srlgs_name = __builtin__.property(_get_path_srlgs_name, _set_path_srlgs_name) + + + _pyangbind_elements = OrderedDict([('path_srlgs_name', path_srlgs_name), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/path_srlgs_names/path_srlgs_name/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/path_srlgs_names/path_srlgs_name/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..4010d6485d50ed9228f88eda54e0cee8d7212dd7 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/path_srlgs_names/path_srlgs_name/__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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 path_srlgs_name(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/path-constraints/path-srlgs-names/path-srlgs-name. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: List of named SRLGs to be included or excluded. + """ + __slots__ = ('_path_helper', '_extmethods', '__usage','__names',) + + _yang_name = 'path-srlgs-name' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__usage = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + self.__names = YANGDynClass(unique=True, base=TypedListType(allowed_type=six.text_type), is_leaf=False, yang_name="names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-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 ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'path-constraints', 'path-srlgs-names', 'path-srlgs-name'] + + def _get_usage(self): + """ + Getter method for usage, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/path_srlgs_names/path_srlgs_name/usage (identityref) + + YANG Description: Identifies an entry in a list of named SRLGs to either +include or exclude. + """ + return self.__usage + + def _set_usage(self, v, load=False): + """ + Setter method for usage, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/path_srlgs_names/path_srlgs_name/usage (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_usage is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_usage() directly. + + YANG Description: Identifies an entry in a list of named SRLGs to either +include or exclude. + """ + 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=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """usage must be of a type compatible with identityref""", + 'defined-type': "ietf-te-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True)""", + }) + + self.__usage = t + if hasattr(self, '_set'): + self._set() + + def _unset_usage(self): + self.__usage = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + + + def _get_names(self): + """ + Getter method for names, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/path_srlgs_names/path_srlgs_name/names (string) + + YANG Description: List of named SRLGs. + """ + return self.__names + + def _set_names(self, v, load=False): + """ + Setter method for names, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/path_srlgs_names/path_srlgs_name/names (string) + If this variable is read-only (config: false) in the + source YANG file, then _set_names is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_names() directly. + + YANG Description: List of named SRLGs. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,unique=True, base=TypedListType(allowed_type=six.text_type), is_leaf=False, yang_name="names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """names must be of a type compatible with string""", + 'defined-type': "string", + 'generated-type': """YANGDynClass(unique=True, base=TypedListType(allowed_type=six.text_type), is_leaf=False, yang_name="names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=True)""", + }) + + self.__names = t + if hasattr(self, '_set'): + self._set() + + def _unset_names(self): + self.__names = YANGDynClass(unique=True, base=TypedListType(allowed_type=six.text_type), is_leaf=False, yang_name="names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=True) + + usage = __builtin__.property(_get_usage, _set_usage) + names = __builtin__.property(_get_names, _set_names) + + + _pyangbind_elements = OrderedDict([('usage', usage), ('names', names), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/te_bandwidth/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/te_bandwidth/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..82e5ccc6549f03c2834c6706a3b48a9e6e3749ab --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/te_bandwidth/__init__.py @@ -0,0 +1,195 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 otn +class te_bandwidth(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/path-constraints/te-bandwidth. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Container that specifies TE bandwidth. The choices +can be augmented for specific data-plane technologies. + """ + __slots__ = ('_path_helper', '_extmethods', '__generic','__otn','__eth_bandwidth',) + + _yang_name = 'te-bandwidth' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__generic = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+(,(0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+))*'}), is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-bandwidth', is_config=True) + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + self.__eth_bandwidth = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), restriction_dict={'range': ['0..10000000000']}), is_leaf=True, yang_name="eth-bandwidth", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint64', 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 ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'path-constraints', 'te-bandwidth'] + + def _get_generic(self): + """ + Getter method for generic, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/te_bandwidth/generic (te-bandwidth) + + YANG Description: Bandwidth specified in a generic format. + """ + return self.__generic + + def _set_generic(self, v, load=False): + """ + Setter method for generic, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/te_bandwidth/generic (te-bandwidth) + If this variable is read-only (config: false) in the + source YANG file, then _set_generic is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_generic() directly. + + YANG Description: Bandwidth specified in a generic format. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+(,(0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+))*'}), is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-bandwidth', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """generic must be of a type compatible with te-bandwidth""", + 'defined-type': "ietf-te-topology:te-bandwidth", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+(,(0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+))*'}), is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-bandwidth', is_config=True)""", + }) + + self.__generic = t + if hasattr(self, '_set'): + self._set() + + def _unset_generic(self): + self.__generic = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+(,(0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+))*'}), is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-bandwidth', is_config=True) + + + def _get_otn(self): + """ + Getter method for otn, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/te_bandwidth/otn (container) + + YANG Description: Bandwidth attributes for OTN links + """ + return self.__otn + + def _set_otn(self, v, load=False): + """ + Setter method for otn, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/te_bandwidth/otn (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_otn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_otn() directly. + + YANG Description: Bandwidth attributes for OTN links + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """otn must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True)""", + }) + + self.__otn = t + if hasattr(self, '_set'): + self._set() + + def _unset_otn(self): + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + + + def _get_eth_bandwidth(self): + """ + Getter method for eth_bandwidth, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/te_bandwidth/eth_bandwidth (uint64) + + YANG Description: Available bandwith value expressed in kilobits per second + """ + return self.__eth_bandwidth + + def _set_eth_bandwidth(self, v, load=False): + """ + Setter method for eth_bandwidth, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/te_bandwidth/eth_bandwidth (uint64) + If this variable is read-only (config: false) in the + source YANG file, then _set_eth_bandwidth is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_eth_bandwidth() directly. + + YANG Description: Available bandwith value expressed in kilobits per second + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), restriction_dict={'range': ['0..10000000000']}), is_leaf=True, yang_name="eth-bandwidth", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint64', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """eth_bandwidth must be of a type compatible with uint64""", + 'defined-type': "uint64", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), restriction_dict={'range': ['0..10000000000']}), is_leaf=True, yang_name="eth-bandwidth", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint64', is_config=True)""", + }) + + self.__eth_bandwidth = t + if hasattr(self, '_set'): + self._set() + + def _unset_eth_bandwidth(self): + self.__eth_bandwidth = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), restriction_dict={'range': ['0..10000000000']}), is_leaf=True, yang_name="eth-bandwidth", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint64', is_config=True) + + generic = __builtin__.property(_get_generic, _set_generic) + otn = __builtin__.property(_get_otn, _set_otn) + eth_bandwidth = __builtin__.property(_get_eth_bandwidth, _set_eth_bandwidth) + + __choices__ = {'technology': {'generic': ['generic'], 'otn': ['otn'], 'eth': ['eth_bandwidth']}} + _pyangbind_elements = OrderedDict([('generic', generic), ('otn', otn), ('eth_bandwidth', eth_bandwidth), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/te_bandwidth/otn/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/te_bandwidth/otn/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..43c1a9a43a3295e83e04dc80bb7757d4dfb2926c --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/te_bandwidth/otn/__init__.py @@ -0,0 +1,163 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 odulist +class otn(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/path-constraints/te-bandwidth/otn. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Bandwidth attributes for OTN links + """ + __slots__ = ('_path_helper', '_extmethods', '__odulist','__odtu_flex_type',) + + _yang_name = 'otn' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__odulist = YANGDynClass(base=YANGListType("odu_type",odulist.odulist, yang_name="odulist", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='odu-type', extensions=None, choice=('technology', 'otn')), is_container='list', yang_name="odulist", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='list', is_config=True) + self.__odtu_flex_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'2': {}, '3': {}, '4': {}, 'Cn': {}},), is_leaf=True, yang_name="odtu-flex-type", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='l1-types:odtu-flex-type', 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 ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'path-constraints', 'te-bandwidth', 'otn'] + + def _get_odulist(self): + """ + Getter method for odulist, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/te_bandwidth/otn/odulist (list) + + YANG Description: OTN bandwidth definition + """ + return self.__odulist + + def _set_odulist(self, v, load=False): + """ + Setter method for odulist, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/te_bandwidth/otn/odulist (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_odulist is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_odulist() directly. + + YANG Description: OTN bandwidth definition + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("odu_type",odulist.odulist, yang_name="odulist", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='odu-type', extensions=None, choice=('technology', 'otn')), is_container='list', yang_name="odulist", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='list', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """odulist must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("odu_type",odulist.odulist, yang_name="odulist", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='odu-type', extensions=None, choice=('technology', 'otn')), is_container='list', yang_name="odulist", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='list', is_config=True)""", + }) + + self.__odulist = t + if hasattr(self, '_set'): + self._set() + + def _unset_odulist(self): + self.__odulist = YANGDynClass(base=YANGListType("odu_type",odulist.odulist, yang_name="odulist", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='odu-type', extensions=None, choice=('technology', 'otn')), is_container='list', yang_name="odulist", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='list', is_config=True) + + + def _get_odtu_flex_type(self): + """ + Getter method for odtu_flex_type, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/te_bandwidth/otn/odtu_flex_type (l1-types:odtu-flex-type) + + YANG Description: The type of Optical Data Tributary Unit (ODTU) +whose nominal bitrate is used to compute the number of +Tributary Slots (TS) required by the ODUflex LSPs +set up along the underlay paths of these OTN Local +Link Connectivities. + """ + return self.__odtu_flex_type + + def _set_odtu_flex_type(self, v, load=False): + """ + Setter method for odtu_flex_type, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/te_bandwidth/otn/odtu_flex_type (l1-types:odtu-flex-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_odtu_flex_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_odtu_flex_type() directly. + + YANG Description: The type of Optical Data Tributary Unit (ODTU) +whose nominal bitrate is used to compute the number of +Tributary Slots (TS) required by the ODUflex LSPs +set up along the underlay paths of these OTN Local +Link Connectivities. + """ + 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={'2': {}, '3': {}, '4': {}, 'Cn': {}},), is_leaf=True, yang_name="odtu-flex-type", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='l1-types:odtu-flex-type', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """odtu_flex_type must be of a type compatible with l1-types:odtu-flex-type""", + 'defined-type': "l1-types:odtu-flex-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'2': {}, '3': {}, '4': {}, 'Cn': {}},), is_leaf=True, yang_name="odtu-flex-type", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='l1-types:odtu-flex-type', is_config=True)""", + }) + + self.__odtu_flex_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_odtu_flex_type(self): + self.__odtu_flex_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'2': {}, '3': {}, '4': {}, 'Cn': {}},), is_leaf=True, yang_name="odtu-flex-type", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='l1-types:odtu-flex-type', is_config=True) + + odulist = __builtin__.property(_get_odulist, _set_odulist) + odtu_flex_type = __builtin__.property(_get_odtu_flex_type, _set_odtu_flex_type) + + __choices__ = {'technology': {'otn': ['odulist', 'odtu_flex_type']}} + _pyangbind_elements = OrderedDict([('odulist', odulist), ('odtu_flex_type', odtu_flex_type), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/te_bandwidth/otn/odulist/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/te_bandwidth/otn/odulist/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..637f3a83b79cadd411537fc51e1ab6fd56a3762b --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/te_bandwidth/otn/odulist/__init__.py @@ -0,0 +1,200 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 odulist(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/path-constraints/te-bandwidth/otn/odulist. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: OTN bandwidth definition + """ + __slots__ = ('_path_helper', '_extmethods', '__odu_type','__number','__ts_number',) + + _yang_name = 'odulist' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__odu_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="odu-type", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + self.__number = YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), is_leaf=True, yang_name="number", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', is_config=True) + self.__ts_number = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts-number", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', 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 ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'path-constraints', 'te-bandwidth', 'otn', 'odulist'] + + def _get_odu_type(self): + """ + Getter method for odu_type, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/te_bandwidth/otn/odulist/odu_type (identityref) + + YANG Description: ODU type + """ + return self.__odu_type + + def _set_odu_type(self, v, load=False): + """ + Setter method for odu_type, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/te_bandwidth/otn/odulist/odu_type (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_odu_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_odu_type() directly. + + YANG Description: ODU type + """ + 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=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="odu-type", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """odu_type must be of a type compatible with identityref""", + 'defined-type': "ietf-otn-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="odu-type", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True)""", + }) + + self.__odu_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_odu_type(self): + self.__odu_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="odu-type", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + + + def _get_number(self): + """ + Getter method for number, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/te_bandwidth/otn/odulist/number (uint16) + + YANG Description: Number of ODUs + """ + return self.__number + + def _set_number(self, v, load=False): + """ + Setter method for number, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/te_bandwidth/otn/odulist/number (uint16) + If this variable is read-only (config: false) in the + source YANG file, then _set_number is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_number() directly. + + YANG Description: Number of ODUs + """ + 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="number", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """number 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="number", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', is_config=True)""", + }) + + self.__number = t + if hasattr(self, '_set'): + self._set() + + def _unset_number(self): + self.__number = YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), is_leaf=True, yang_name="number", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', is_config=True) + + + def _get_ts_number(self): + """ + Getter method for ts_number, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/te_bandwidth/otn/odulist/ts_number (uint16) + + YANG Description: The number of Tributary Slots (TS) that +could be used by all the ODUflex LSPs. + """ + return self.__ts_number + + def _set_ts_number(self, v, load=False): + """ + Setter method for ts_number, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/te_bandwidth/otn/odulist/ts_number (uint16) + If this variable is read-only (config: false) in the + source YANG file, then _set_ts_number is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_ts_number() directly. + + YANG Description: The number of Tributary Slots (TS) that +could be used by all the ODUflex LSPs. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts-number", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """ts_number must be of a type compatible with uint16""", + 'defined-type': "uint16", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts-number", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', is_config=True)""", + }) + + self.__ts_number = t + if hasattr(self, '_set'): + self._set() + + def _unset_ts_number(self): + self.__ts_number = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts-number", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', is_config=True) + + odu_type = __builtin__.property(_get_odu_type, _set_odu_type) + number = __builtin__.property(_get_number, _set_number) + ts_number = __builtin__.property(_get_ts_number, _set_ts_number) + + __choices__ = {'technology': {'otn': ['odu_type', 'number', 'ts_number']}} + _pyangbind_elements = OrderedDict([('odu_type', odu_type), ('number', number), ('ts_number', ts_number), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..121cb20268cd50916e97d72932b9e21796022462 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/__init__.py @@ -0,0 +1,318 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 path_metric +from . import path_affinities_values +from . import path_affinity_names +from . import path_srlgs_lists +from . import path_srlgs_names +from . import path_route_objects +class path_properties(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/path-properties. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: The TE path properties. + """ + __slots__ = ('_path_helper', '_extmethods', '__path_metric','__path_affinities_values','__path_affinity_names','__path_srlgs_lists','__path_srlgs_names','__path_route_objects',) + + _yang_name = 'path-properties' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__path_metric = YANGDynClass(base=YANGListType("metric_type",path_metric.path_metric, yang_name="path-metric", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='metric-type', extensions=None), is_container='list', yang_name="path-metric", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + self.__path_affinities_values = YANGDynClass(base=path_affinities_values.path_affinities_values, is_container='container', yang_name="path-affinities-values", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__path_affinity_names = YANGDynClass(base=path_affinity_names.path_affinity_names, is_container='container', yang_name="path-affinity-names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__path_srlgs_lists = YANGDynClass(base=path_srlgs_lists.path_srlgs_lists, is_container='container', yang_name="path-srlgs-lists", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__path_srlgs_names = YANGDynClass(base=path_srlgs_names.path_srlgs_names, is_container='container', yang_name="path-srlgs-names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__path_route_objects = YANGDynClass(base=path_route_objects.path_route_objects, is_container='container', yang_name="path-route-objects", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', 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 ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'path-properties'] + + def _get_path_metric(self): + """ + Getter method for path_metric, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_metric (list) + + YANG Description: TE path metric type. + """ + return self.__path_metric + + def _set_path_metric(self, v, load=False): + """ + Setter method for path_metric, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_metric (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_metric is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_metric() directly. + + YANG Description: TE path metric type. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("metric_type",path_metric.path_metric, yang_name="path-metric", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='metric-type', extensions=None), is_container='list', yang_name="path-metric", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_metric must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("metric_type",path_metric.path_metric, yang_name="path-metric", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='metric-type', extensions=None), is_container='list', yang_name="path-metric", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False)""", + }) + + self.__path_metric = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_metric(self): + self.__path_metric = YANGDynClass(base=YANGListType("metric_type",path_metric.path_metric, yang_name="path-metric", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='metric-type', extensions=None), is_container='list', yang_name="path-metric", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + + + def _get_path_affinities_values(self): + """ + Getter method for path_affinities_values, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_affinities_values (container) + + YANG Description: Path affinities represented as values. + """ + return self.__path_affinities_values + + def _set_path_affinities_values(self, v, load=False): + """ + Setter method for path_affinities_values, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_affinities_values (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_affinities_values is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_affinities_values() directly. + + YANG Description: Path affinities represented as values. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=path_affinities_values.path_affinities_values, is_container='container', yang_name="path-affinities-values", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_affinities_values must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=path_affinities_values.path_affinities_values, is_container='container', yang_name="path-affinities-values", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__path_affinities_values = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_affinities_values(self): + self.__path_affinities_values = YANGDynClass(base=path_affinities_values.path_affinities_values, is_container='container', yang_name="path-affinities-values", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_path_affinity_names(self): + """ + Getter method for path_affinity_names, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_affinity_names (container) + + YANG Description: Path affinities represented as names. + """ + return self.__path_affinity_names + + def _set_path_affinity_names(self, v, load=False): + """ + Setter method for path_affinity_names, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_affinity_names (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_affinity_names is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_affinity_names() directly. + + YANG Description: Path affinities represented as names. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=path_affinity_names.path_affinity_names, is_container='container', yang_name="path-affinity-names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_affinity_names must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=path_affinity_names.path_affinity_names, is_container='container', yang_name="path-affinity-names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__path_affinity_names = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_affinity_names(self): + self.__path_affinity_names = YANGDynClass(base=path_affinity_names.path_affinity_names, is_container='container', yang_name="path-affinity-names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_path_srlgs_lists(self): + """ + Getter method for path_srlgs_lists, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_srlgs_lists (container) + + YANG Description: Path SRLG properties container. + """ + return self.__path_srlgs_lists + + def _set_path_srlgs_lists(self, v, load=False): + """ + Setter method for path_srlgs_lists, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_srlgs_lists (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_srlgs_lists is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_srlgs_lists() directly. + + YANG Description: Path SRLG properties container. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=path_srlgs_lists.path_srlgs_lists, is_container='container', yang_name="path-srlgs-lists", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_srlgs_lists must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=path_srlgs_lists.path_srlgs_lists, is_container='container', yang_name="path-srlgs-lists", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__path_srlgs_lists = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_srlgs_lists(self): + self.__path_srlgs_lists = YANGDynClass(base=path_srlgs_lists.path_srlgs_lists, is_container='container', yang_name="path-srlgs-lists", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_path_srlgs_names(self): + """ + Getter method for path_srlgs_names, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_srlgs_names (container) + + YANG Description: Container for the list of named SRLGs. + """ + return self.__path_srlgs_names + + def _set_path_srlgs_names(self, v, load=False): + """ + Setter method for path_srlgs_names, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_srlgs_names (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_srlgs_names is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_srlgs_names() directly. + + YANG Description: Container for the list of named SRLGs. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=path_srlgs_names.path_srlgs_names, is_container='container', yang_name="path-srlgs-names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_srlgs_names must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=path_srlgs_names.path_srlgs_names, is_container='container', yang_name="path-srlgs-names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__path_srlgs_names = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_srlgs_names(self): + self.__path_srlgs_names = YANGDynClass(base=path_srlgs_names.path_srlgs_names, is_container='container', yang_name="path-srlgs-names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_path_route_objects(self): + """ + Getter method for path_route_objects, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_route_objects (container) + + YANG Description: Container for the list of route objects either returned by +the computation engine or actually used by an LSP. + """ + return self.__path_route_objects + + def _set_path_route_objects(self, v, load=False): + """ + Setter method for path_route_objects, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_route_objects (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_route_objects is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_route_objects() directly. + + YANG Description: Container for the list of route objects either returned by +the computation engine or actually used by an LSP. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=path_route_objects.path_route_objects, is_container='container', yang_name="path-route-objects", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_route_objects must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=path_route_objects.path_route_objects, is_container='container', yang_name="path-route-objects", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__path_route_objects = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_route_objects(self): + self.__path_route_objects = YANGDynClass(base=path_route_objects.path_route_objects, is_container='container', yang_name="path-route-objects", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + path_metric = __builtin__.property(_get_path_metric) + path_affinities_values = __builtin__.property(_get_path_affinities_values) + path_affinity_names = __builtin__.property(_get_path_affinity_names) + path_srlgs_lists = __builtin__.property(_get_path_srlgs_lists) + path_srlgs_names = __builtin__.property(_get_path_srlgs_names) + path_route_objects = __builtin__.property(_get_path_route_objects) + + + _pyangbind_elements = OrderedDict([('path_metric', path_metric), ('path_affinities_values', path_affinities_values), ('path_affinity_names', path_affinity_names), ('path_srlgs_lists', path_srlgs_lists), ('path_srlgs_names', path_srlgs_names), ('path_route_objects', path_route_objects), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_affinities_values/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_affinities_values/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..5f23f944f0d276d34cf8582a39d1dbd440a56369 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_affinities_values/__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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 path_affinities_value +class path_affinities_values(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/path-properties/path-affinities-values. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Path affinities represented as values. + """ + __slots__ = ('_path_helper', '_extmethods', '__path_affinities_value',) + + _yang_name = 'path-affinities-values' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__path_affinities_value = YANGDynClass(base=YANGListType("usage",path_affinities_value.path_affinities_value, yang_name="path-affinities-value", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-affinities-value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', 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 ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'path-properties', 'path-affinities-values'] + + def _get_path_affinities_value(self): + """ + Getter method for path_affinities_value, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_affinities_values/path_affinities_value (list) + + YANG Description: List of named affinity constraints. + """ + return self.__path_affinities_value + + def _set_path_affinities_value(self, v, load=False): + """ + Setter method for path_affinities_value, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_affinities_values/path_affinities_value (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_affinities_value is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_affinities_value() directly. + + YANG Description: List of named affinity constraints. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("usage",path_affinities_value.path_affinities_value, yang_name="path-affinities-value", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-affinities-value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_affinities_value must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("usage",path_affinities_value.path_affinities_value, yang_name="path-affinities-value", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-affinities-value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False)""", + }) + + self.__path_affinities_value = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_affinities_value(self): + self.__path_affinities_value = YANGDynClass(base=YANGListType("usage",path_affinities_value.path_affinities_value, yang_name="path-affinities-value", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-affinities-value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + + path_affinities_value = __builtin__.property(_get_path_affinities_value) + + + _pyangbind_elements = OrderedDict([('path_affinities_value', path_affinities_value), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_affinities_values/path_affinities_value/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_affinities_values/path_affinities_value/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..6e7ba3ec4ade2664fd5d5fcc6d23d7ebc7e92536 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_affinities_values/path_affinities_value/__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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 path_affinities_value(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/path-properties/path-affinities-values/path-affinities-value. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: List of named affinity constraints. + """ + __slots__ = ('_path_helper', '_extmethods', '__usage','__value',) + + _yang_name = 'path-affinities-value' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__usage = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + self.__value = YANGDynClass(base=[RestrictedClassType(base_type=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}), restriction_dict={'length': ['1..11']}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}),], default=six.text_type(""), is_leaf=True, yang_name="value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='admin-groups', 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 ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'path-properties', 'path-affinities-values', 'path-affinities-value'] + + def _get_usage(self): + """ + Getter method for usage, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_affinities_values/path_affinities_value/usage (identityref) + + YANG Description: Identifies an entry in the list of value affinity +constraints. + """ + return self.__usage + + def _set_usage(self, v, load=False): + """ + Setter method for usage, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_affinities_values/path_affinities_value/usage (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_usage is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_usage() directly. + + YANG Description: Identifies an entry in the list of value affinity +constraints. + """ + 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=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """usage must be of a type compatible with identityref""", + 'defined-type': "ietf-te-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False)""", + }) + + self.__usage = t + if hasattr(self, '_set'): + self._set() + + def _unset_usage(self): + self.__usage = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + + + def _get_value(self): + """ + Getter method for value, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_affinities_values/path_affinities_value/value (admin-groups) + + YANG Description: The affinity value. The default is empty. + """ + return self.__value + + def _set_value(self, v, load=False): + """ + Setter method for value, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_affinities_values/path_affinities_value/value (admin-groups) + 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: The affinity value. The default is empty. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=[RestrictedClassType(base_type=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}), restriction_dict={'length': ['1..11']}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}),], default=six.text_type(""), is_leaf=True, yang_name="value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='admin-groups', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """value must be of a type compatible with admin-groups""", + 'defined-type': "ietf-te-topology:admin-groups", + 'generated-type': """YANGDynClass(base=[RestrictedClassType(base_type=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}), restriction_dict={'length': ['1..11']}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}),], default=six.text_type(""), is_leaf=True, yang_name="value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='admin-groups', is_config=False)""", + }) + + self.__value = t + if hasattr(self, '_set'): + self._set() + + def _unset_value(self): + self.__value = YANGDynClass(base=[RestrictedClassType(base_type=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}), restriction_dict={'length': ['1..11']}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}),], default=six.text_type(""), is_leaf=True, yang_name="value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='admin-groups', is_config=False) + + usage = __builtin__.property(_get_usage) + value = __builtin__.property(_get_value) + + + _pyangbind_elements = OrderedDict([('usage', usage), ('value', value), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_affinity_names/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_affinity_names/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..75ec7e310803d6f2a3da41b9bdae5df569404985 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_affinity_names/__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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 path_affinity_name +class path_affinity_names(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/path-properties/path-affinity-names. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Path affinities represented as names. + """ + __slots__ = ('_path_helper', '_extmethods', '__path_affinity_name',) + + _yang_name = 'path-affinity-names' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__path_affinity_name = YANGDynClass(base=YANGListType("usage",path_affinity_name.path_affinity_name, yang_name="path-affinity-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-affinity-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', 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 ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'path-properties', 'path-affinity-names'] + + def _get_path_affinity_name(self): + """ + Getter method for path_affinity_name, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_affinity_names/path_affinity_name (list) + + YANG Description: List of named affinity constraints. + """ + return self.__path_affinity_name + + def _set_path_affinity_name(self, v, load=False): + """ + Setter method for path_affinity_name, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_affinity_names/path_affinity_name (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_affinity_name is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_affinity_name() directly. + + YANG Description: List of named affinity constraints. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("usage",path_affinity_name.path_affinity_name, yang_name="path-affinity-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-affinity-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_affinity_name must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("usage",path_affinity_name.path_affinity_name, yang_name="path-affinity-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-affinity-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False)""", + }) + + self.__path_affinity_name = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_affinity_name(self): + self.__path_affinity_name = YANGDynClass(base=YANGListType("usage",path_affinity_name.path_affinity_name, yang_name="path-affinity-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-affinity-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + + path_affinity_name = __builtin__.property(_get_path_affinity_name) + + + _pyangbind_elements = OrderedDict([('path_affinity_name', path_affinity_name), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_affinity_names/path_affinity_name/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_affinity_names/path_affinity_name/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..6d2740363b6e25d8f84ff3c0cce856f06bb7d74a --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_affinity_names/path_affinity_name/__init__.py @@ -0,0 +1,162 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 affinity_name +class path_affinity_name(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/path-properties/path-affinity-names/path-affinity-name. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: List of named affinity constraints. + """ + __slots__ = ('_path_helper', '_extmethods', '__usage','__affinity_name',) + + _yang_name = 'path-affinity-name' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__usage = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + self.__affinity_name = YANGDynClass(base=YANGListType("name",affinity_name.affinity_name, yang_name="affinity-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='name', extensions=None), is_container='list', yang_name="affinity-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', 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 ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'path-properties', 'path-affinity-names', 'path-affinity-name'] + + def _get_usage(self): + """ + Getter method for usage, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_affinity_names/path_affinity_name/usage (identityref) + + YANG Description: Identifies an entry in the list of named affinity +constraints. + """ + return self.__usage + + def _set_usage(self, v, load=False): + """ + Setter method for usage, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_affinity_names/path_affinity_name/usage (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_usage is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_usage() directly. + + YANG Description: Identifies an entry in the list of named affinity +constraints. + """ + 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=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """usage must be of a type compatible with identityref""", + 'defined-type': "ietf-te-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False)""", + }) + + self.__usage = t + if hasattr(self, '_set'): + self._set() + + def _unset_usage(self): + self.__usage = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + + + def _get_affinity_name(self): + """ + Getter method for affinity_name, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_affinity_names/path_affinity_name/affinity_name (list) + + YANG Description: List of named affinities. + """ + return self.__affinity_name + + def _set_affinity_name(self, v, load=False): + """ + Setter method for affinity_name, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_affinity_names/path_affinity_name/affinity_name (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_affinity_name is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_affinity_name() directly. + + YANG Description: List of named affinities. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("name",affinity_name.affinity_name, yang_name="affinity-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='name', extensions=None), is_container='list', yang_name="affinity-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """affinity_name must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("name",affinity_name.affinity_name, yang_name="affinity-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='name', extensions=None), is_container='list', yang_name="affinity-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False)""", + }) + + self.__affinity_name = t + if hasattr(self, '_set'): + self._set() + + def _unset_affinity_name(self): + self.__affinity_name = YANGDynClass(base=YANGListType("name",affinity_name.affinity_name, yang_name="affinity-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='name', extensions=None), is_container='list', yang_name="affinity-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + + usage = __builtin__.property(_get_usage) + affinity_name = __builtin__.property(_get_affinity_name) + + + _pyangbind_elements = OrderedDict([('usage', usage), ('affinity_name', affinity_name), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_affinity_names/path_affinity_name/affinity_name/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_affinity_names/path_affinity_name/affinity_name/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..d00d8136a5d1ca3bbac8062f58938771b9ace146 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_affinity_names/path_affinity_name/affinity_name/__init__.py @@ -0,0 +1,120 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 affinity_name(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/path-properties/path-affinity-names/path-affinity-name/affinity-name. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: List of named affinities. + """ + __slots__ = ('_path_helper', '_extmethods', '__name',) + + _yang_name = 'affinity-name' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _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='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', 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 ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'path-properties', 'path-affinity-names', 'path-affinity-name', 'affinity-name'] + + def _get_name(self): + """ + Getter method for name, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_affinity_names/path_affinity_name/affinity_name/name (string) + + YANG Description: Identifies a named affinity entry. + """ + return self.__name + + def _set_name(self, v, load=False): + """ + Setter method for name, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_affinity_names/path_affinity_name/affinity_name/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: Identifies a named affinity entry. + """ + 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='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', 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, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', 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, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=False) + + name = __builtin__.property(_get_name) + + + _pyangbind_elements = OrderedDict([('name', name), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_metric/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_metric/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..34ad252cf05256f871e52b7f4bcf419b3311f4e5 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_metric/__init__.py @@ -0,0 +1,159 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 path_metric(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/path-properties/path-metric. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: TE path metric type. + """ + __slots__ = ('_path_helper', '_extmethods', '__metric_type','__accumulative_value',) + + _yang_name = 'path-metric' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__metric_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="metric-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + self.__accumulative_value = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="accumulative-value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', 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 ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'path-properties', 'path-metric'] + + def _get_metric_type(self): + """ + Getter method for metric_type, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_metric/metric_type (identityref) + + YANG Description: TE path metric type. + """ + return self.__metric_type + + def _set_metric_type(self, v, load=False): + """ + Setter method for metric_type, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_metric/metric_type (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_metric_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_metric_type() directly. + + YANG Description: TE path metric type. + """ + 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=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="metric-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """metric_type must be of a type compatible with identityref""", + 'defined-type': "ietf-te-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="metric-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False)""", + }) + + self.__metric_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_metric_type(self): + self.__metric_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="metric-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + + + def _get_accumulative_value(self): + """ + Getter method for accumulative_value, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_metric/accumulative_value (uint64) + + YANG Description: TE path metric accumulative value. + """ + return self.__accumulative_value + + def _set_accumulative_value(self, v, load=False): + """ + Setter method for accumulative_value, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_metric/accumulative_value (uint64) + If this variable is read-only (config: false) in the + source YANG file, then _set_accumulative_value is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_accumulative_value() directly. + + YANG Description: TE path metric accumulative value. + """ + 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="accumulative-value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint64', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """accumulative_value 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="accumulative-value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint64', is_config=False)""", + }) + + self.__accumulative_value = t + if hasattr(self, '_set'): + self._set() + + def _unset_accumulative_value(self): + self.__accumulative_value = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="accumulative-value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint64', is_config=False) + + metric_type = __builtin__.property(_get_metric_type) + accumulative_value = __builtin__.property(_get_accumulative_value) + + + _pyangbind_elements = OrderedDict([('metric_type', metric_type), ('accumulative_value', accumulative_value), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_route_objects/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_route_objects/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..826eb49d2814dbfb5b886de185937b1e94b3208b --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_route_objects/__init__.py @@ -0,0 +1,119 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 path_route_object +class path_route_objects(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/path-properties/path-route-objects. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Container for the list of route objects either returned by +the computation engine or actually used by an LSP. + """ + __slots__ = ('_path_helper', '_extmethods', '__path_route_object',) + + _yang_name = 'path-route-objects' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__path_route_object = YANGDynClass(base=YANGListType("index",path_route_object.path_route_object, yang_name="path-route-object", parent=self, is_container='list', user_ordered=True, path_helper=self._path_helper, yang_keys='index', extensions=None), is_container='list', yang_name="path-route-object", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', 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 ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'path-properties', 'path-route-objects'] + + def _get_path_route_object(self): + """ + Getter method for path_route_object, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_route_objects/path_route_object (list) + + YANG Description: List of route objects either returned by the computation +engine or actually used by an LSP. + """ + return self.__path_route_object + + def _set_path_route_object(self, v, load=False): + """ + Setter method for path_route_object, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_route_objects/path_route_object (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_route_object is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_route_object() directly. + + YANG Description: List of route objects either returned by the computation +engine or actually used by an LSP. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("index",path_route_object.path_route_object, yang_name="path-route-object", parent=self, is_container='list', user_ordered=True, path_helper=self._path_helper, yang_keys='index', extensions=None), is_container='list', yang_name="path-route-object", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_route_object must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("index",path_route_object.path_route_object, yang_name="path-route-object", parent=self, is_container='list', user_ordered=True, path_helper=self._path_helper, yang_keys='index', extensions=None), is_container='list', yang_name="path-route-object", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False)""", + }) + + self.__path_route_object = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_route_object(self): + self.__path_route_object = YANGDynClass(base=YANGListType("index",path_route_object.path_route_object, yang_name="path-route-object", parent=self, is_container='list', user_ordered=True, path_helper=self._path_helper, yang_keys='index', extensions=None), is_container='list', yang_name="path-route-object", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + + path_route_object = __builtin__.property(_get_path_route_object) + + + _pyangbind_elements = OrderedDict([('path_route_object', path_route_object), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_route_objects/path_route_object/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_route_objects/path_route_object/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..3f433dc1f276583e0c66dc28cded4a78296701b0 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_route_objects/path_route_object/__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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 numbered_node_hop +from . import numbered_link_hop +from . import unnumbered_link_hop +from . import as_number_hop +from . import label_hop +class path_route_object(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/path-properties/path-route-objects/path-route-object. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: List of route objects either returned by the computation +engine or actually used by an LSP. + """ + __slots__ = ('_path_helper', '_extmethods', '__index','__numbered_node_hop','__numbered_link_hop','__unnumbered_link_hop','__as_number_hop','__label_hop',) + + _yang_name = 'path-route-object' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _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), is_leaf=True, yang_name="index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=False) + self.__numbered_node_hop = YANGDynClass(base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__numbered_link_hop = YANGDynClass(base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__unnumbered_link_hop = YANGDynClass(base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__as_number_hop = YANGDynClass(base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__label_hop = YANGDynClass(base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', 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 ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'path-properties', 'path-route-objects', 'path-route-object'] + + def _get_index(self): + """ + Getter method for index, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_route_objects/path_route_object/index (uint32) + + YANG Description: Route object entry index. The index is used to +identify an entry in the list. The order of entries +is defined by the user without relying on key +values. + """ + return self.__index + + def _set_index(self, v, load=False): + """ + Setter method for index, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_route_objects/path_route_object/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: Route object entry index. The index is used to +identify an entry in the list. The order of entries +is defined by the user without relying on key +values. + """ + 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=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', 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), is_leaf=True, yang_name="index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', 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), is_leaf=True, yang_name="index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=False) + + + def _get_numbered_node_hop(self): + """ + Getter method for numbered_node_hop, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_route_objects/path_route_object/numbered_node_hop (container) + + YANG Description: Numbered node route hop. + """ + return self.__numbered_node_hop + + def _set_numbered_node_hop(self, v, load=False): + """ + Setter method for numbered_node_hop, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_route_objects/path_route_object/numbered_node_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_numbered_node_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_numbered_node_hop() directly. + + YANG Description: Numbered node route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """numbered_node_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__numbered_node_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_numbered_node_hop(self): + self.__numbered_node_hop = YANGDynClass(base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_numbered_link_hop(self): + """ + Getter method for numbered_link_hop, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_route_objects/path_route_object/numbered_link_hop (container) + + YANG Description: Numbered link explicit route hop. + """ + return self.__numbered_link_hop + + def _set_numbered_link_hop(self, v, load=False): + """ + Setter method for numbered_link_hop, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_route_objects/path_route_object/numbered_link_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_numbered_link_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_numbered_link_hop() directly. + + YANG Description: Numbered link explicit route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """numbered_link_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__numbered_link_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_numbered_link_hop(self): + self.__numbered_link_hop = YANGDynClass(base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_unnumbered_link_hop(self): + """ + Getter method for unnumbered_link_hop, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_route_objects/path_route_object/unnumbered_link_hop (container) + + YANG Description: Unnumbered link explicit route hop. + """ + return self.__unnumbered_link_hop + + def _set_unnumbered_link_hop(self, v, load=False): + """ + Setter method for unnumbered_link_hop, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_route_objects/path_route_object/unnumbered_link_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_unnumbered_link_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_unnumbered_link_hop() directly. + + YANG Description: Unnumbered link explicit route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """unnumbered_link_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__unnumbered_link_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_unnumbered_link_hop(self): + self.__unnumbered_link_hop = YANGDynClass(base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_as_number_hop(self): + """ + Getter method for as_number_hop, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_route_objects/path_route_object/as_number_hop (container) + + YANG Description: AS explicit route hop. + """ + return self.__as_number_hop + + def _set_as_number_hop(self, v, load=False): + """ + Setter method for as_number_hop, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_route_objects/path_route_object/as_number_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_as_number_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_as_number_hop() directly. + + YANG Description: AS explicit route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """as_number_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__as_number_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_as_number_hop(self): + self.__as_number_hop = YANGDynClass(base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_label_hop(self): + """ + Getter method for label_hop, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_route_objects/path_route_object/label_hop (container) + + YANG Description: Label hop type. + """ + return self.__label_hop + + def _set_label_hop(self, v, load=False): + """ + Setter method for label_hop, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_route_objects/path_route_object/label_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_label_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_label_hop() directly. + + YANG Description: Label hop type. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """label_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__label_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_label_hop(self): + self.__label_hop = YANGDynClass(base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + index = __builtin__.property(_get_index) + numbered_node_hop = __builtin__.property(_get_numbered_node_hop) + numbered_link_hop = __builtin__.property(_get_numbered_link_hop) + unnumbered_link_hop = __builtin__.property(_get_unnumbered_link_hop) + as_number_hop = __builtin__.property(_get_as_number_hop) + label_hop = __builtin__.property(_get_label_hop) + + __choices__ = {'type': {'numbered-node-hop': ['numbered_node_hop'], 'numbered-link-hop': ['numbered_link_hop'], 'unnumbered-link-hop': ['unnumbered_link_hop'], 'as-number': ['as_number_hop'], 'label': ['label_hop']}} + _pyangbind_elements = OrderedDict([('index', index), ('numbered_node_hop', numbered_node_hop), ('numbered_link_hop', numbered_link_hop), ('unnumbered_link_hop', unnumbered_link_hop), ('as_number_hop', as_number_hop), ('label_hop', label_hop), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_route_objects/path_route_object/as_number_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_route_objects/path_route_object/as_number_hop/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..f8ad1dc661d24f2f70b40425f7c5c46d32046207 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_route_objects/path_route_object/as_number_hop/__init__.py @@ -0,0 +1,154 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 as_number_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/path-properties/path-route-objects/path-route-object/as-number-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: AS explicit route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__as_number','__hop_type',) + + _yang_name = 'as-number-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__as_number = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=False) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', 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 ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'path-properties', 'path-route-objects', 'path-route-object', 'as-number-hop'] + + def _get_as_number(self): + """ + Getter method for as_number, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_route_objects/path_route_object/as_number_hop/as_number (inet:as-number) + + YANG Description: The Autonomous System (AS) number. + """ + return self.__as_number + + def _set_as_number(self, v, load=False): + """ + Setter method for as_number, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_route_objects/path_route_object/as_number_hop/as_number (inet:as-number) + If this variable is read-only (config: false) in the + source YANG file, then _set_as_number is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_as_number() directly. + + YANG Description: The Autonomous System (AS) number. + """ + 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="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """as_number must be of a type compatible with inet:as-number""", + 'defined-type': "inet:as-number", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=False)""", + }) + + self.__as_number = t + if hasattr(self, '_set'): + self._set() + + def _unset_as_number(self): + self.__as_number = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=False) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_route_objects/path_route_object/as_number_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_route_objects/path_route_object/as_number_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + 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={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + + as_number = __builtin__.property(_get_as_number) + hop_type = __builtin__.property(_get_hop_type) + + __choices__ = {'type': {'as-number': ['as_number', 'hop_type']}} + _pyangbind_elements = OrderedDict([('as_number', as_number), ('hop_type', hop_type), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_route_objects/path_route_object/label_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_route_objects/path_route_object/label_hop/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..c577696eaf347a7202b981648897bac553b9d1ed --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_route_objects/path_route_object/label_hop/__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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 te_label +class label_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/path-properties/path-route-objects/path-route-object/label-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Label hop type. + """ + __slots__ = ('_path_helper', '_extmethods', '__te_label',) + + _yang_name = 'label-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__te_label = YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', 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 ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'path-properties', 'path-route-objects', 'path-route-object', 'label-hop'] + + def _get_te_label(self): + """ + Getter method for te_label, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_route_objects/path_route_object/label_hop/te_label (container) + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + return self.__te_label + + def _set_te_label(self, v, load=False): + """ + Setter method for te_label, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_route_objects/path_route_object/label_hop/te_label (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_te_label is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_te_label() directly. + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """te_label must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__te_label = t + if hasattr(self, '_set'): + self._set() + + def _unset_te_label(self): + self.__te_label = YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + te_label = __builtin__.property(_get_te_label) + + __choices__ = {'type': {'label': ['te_label']}} + _pyangbind_elements = OrderedDict([('te_label', te_label), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_route_objects/path_route_object/label_hop/te_label/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_route_objects/path_route_object/label_hop/te_label/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e8bc5dd22eed737dc1b818e8c4c5e64f71f3c17e --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_route_objects/path_route_object/label_hop/te_label/__init__.py @@ -0,0 +1,234 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 otn +class te_label(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/path-properties/path-route-objects/path-route-object/label-hop/te-label. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + __slots__ = ('_path_helper', '_extmethods', '__generic','__otn','__vlanid','__direction',) + + _yang_name = 'te-label' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__generic = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=False) + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False) + self.__vlanid = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=False) + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', 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 ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'path-properties', 'path-route-objects', 'path-route-object', 'label-hop', 'te-label'] + + def _get_generic(self): + """ + Getter method for generic, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_route_objects/path_route_object/label_hop/te_label/generic (rt-types:generalized-label) + + YANG Description: TE label specified in a generic format. + """ + return self.__generic + + def _set_generic(self, v, load=False): + """ + Setter method for generic, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_route_objects/path_route_object/label_hop/te_label/generic (rt-types:generalized-label) + If this variable is read-only (config: false) in the + source YANG file, then _set_generic is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_generic() directly. + + YANG Description: TE label specified in a generic format. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """generic must be of a type compatible with rt-types:generalized-label""", + 'defined-type': "rt-types:generalized-label", + 'generated-type': """YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=False)""", + }) + + self.__generic = t + if hasattr(self, '_set'): + self._set() + + def _unset_generic(self): + self.__generic = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=False) + + + def _get_otn(self): + """ + Getter method for otn, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_route_objects/path_route_object/label_hop/te_label/otn (container) + + YANG Description: Label hop for OTN. + """ + return self.__otn + + def _set_otn(self, v, load=False): + """ + Setter method for otn, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_route_objects/path_route_object/label_hop/te_label/otn (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_otn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_otn() directly. + + YANG Description: Label hop for OTN. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """otn must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False)""", + }) + + self.__otn = t + if hasattr(self, '_set'): + self._set() + + def _unset_otn(self): + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False) + + + def _get_vlanid(self): + """ + Getter method for vlanid, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_route_objects/path_route_object/label_hop/te_label/vlanid (etht-types:vlanid) + + YANG Description: VLAN tag id. + """ + return self.__vlanid + + def _set_vlanid(self, v, load=False): + """ + Setter method for vlanid, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_route_objects/path_route_object/label_hop/te_label/vlanid (etht-types:vlanid) + If this variable is read-only (config: false) in the + source YANG file, then _set_vlanid is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_vlanid() directly. + + YANG Description: VLAN tag id. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """vlanid must be of a type compatible with etht-types:vlanid""", + 'defined-type': "etht-types:vlanid", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=False)""", + }) + + self.__vlanid = t + if hasattr(self, '_set'): + self._set() + + def _unset_vlanid(self): + self.__vlanid = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=False) + + + def _get_direction(self): + """ + Getter method for direction, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_route_objects/path_route_object/label_hop/te_label/direction (te-label-direction) + + YANG Description: Label direction. + """ + return self.__direction + + def _set_direction(self, v, load=False): + """ + Setter method for direction, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_route_objects/path_route_object/label_hop/te_label/direction (te-label-direction) + If this variable is read-only (config: false) in the + source YANG file, then _set_direction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_direction() directly. + + YANG Description: Label direction. + """ + 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={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """direction must be of a type compatible with te-label-direction""", + 'defined-type': "ietf-te-topology:te-label-direction", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=False)""", + }) + + self.__direction = t + if hasattr(self, '_set'): + self._set() + + def _unset_direction(self): + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=False) + + generic = __builtin__.property(_get_generic) + otn = __builtin__.property(_get_otn) + vlanid = __builtin__.property(_get_vlanid) + direction = __builtin__.property(_get_direction) + + __choices__ = {'technology': {'generic': ['generic'], 'otn': ['otn'], 'eth': ['vlanid']}, 'type': {'label': ['direction']}} + _pyangbind_elements = OrderedDict([('generic', generic), ('otn', otn), ('vlanid', vlanid), ('direction', direction), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_route_objects/path_route_object/label_hop/te_label/otn/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_route_objects/path_route_object/label_hop/te_label/otn/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..15655b7d140771626a170095088be326dbf3df3e --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_route_objects/path_route_object/label_hop/te_label/otn/__init__.py @@ -0,0 +1,209 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 otn(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/path-properties/path-route-objects/path-route-object/label-hop/te-label/otn. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Label hop for OTN. + """ + __slots__ = ('_path_helper', '_extmethods', '__tpn','__tsg','__ts_list',) + + _yang_name = 'otn' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__tpn = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=False) + self.__tsg = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=False) + self.__ts_list = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', 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 ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'path-properties', 'path-route-objects', 'path-route-object', 'label-hop', 'te-label', 'otn'] + + def _get_tpn(self): + """ + Getter method for tpn, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_route_objects/path_route_object/label_hop/te_label/otn/tpn (otn-tpn) + + YANG Description: Tributary Port Number (TPN). + """ + return self.__tpn + + def _set_tpn(self, v, load=False): + """ + Setter method for tpn, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_route_objects/path_route_object/label_hop/te_label/otn/tpn (otn-tpn) + If this variable is read-only (config: false) in the + source YANG file, then _set_tpn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tpn() directly. + + YANG Description: Tributary Port Number (TPN). + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tpn must be of a type compatible with otn-tpn""", + 'defined-type': "ietf-otn-topology:otn-tpn", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=False)""", + }) + + self.__tpn = t + if hasattr(self, '_set'): + self._set() + + def _unset_tpn(self): + self.__tpn = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=False) + + + def _get_tsg(self): + """ + Getter method for tsg, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_route_objects/path_route_object/label_hop/te_label/otn/tsg (identityref) + + YANG Description: Tributary Slot Granularity (TSG). + """ + return self.__tsg + + def _set_tsg(self, v, load=False): + """ + Setter method for tsg, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_route_objects/path_route_object/label_hop/te_label/otn/tsg (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_tsg is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tsg() directly. + + YANG Description: Tributary Slot Granularity (TSG). + """ + 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={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tsg must be of a type compatible with identityref""", + 'defined-type': "ietf-otn-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=False)""", + }) + + self.__tsg = t + if hasattr(self, '_set'): + self._set() + + def _unset_tsg(self): + self.__tsg = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=False) + + + def _get_ts_list(self): + """ + Getter method for ts_list, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_route_objects/path_route_object/label_hop/te_label/otn/ts_list (string) + + YANG Description: A list of available Tributary Slots (TS) ranging + + + + +between 1 and 4095. If multiple values or +ranges are given, they all MUST be disjoint +and MUST be in ascending order. +For example 1-20,25,50-1000. + """ + return self.__ts_list + + def _set_ts_list(self, v, load=False): + """ + Setter method for ts_list, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_route_objects/path_route_object/label_hop/te_label/otn/ts_list (string) + If this variable is read-only (config: false) in the + source YANG file, then _set_ts_list is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_ts_list() directly. + + YANG Description: A list of available Tributary Slots (TS) ranging + + + + +between 1 and 4095. If multiple values or +ranges are given, they all MUST be disjoint +and MUST be in ascending order. +For example 1-20,25,50-1000. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='string', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """ts_list must be of a type compatible with string""", + 'defined-type': "string", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='string', is_config=False)""", + }) + + self.__ts_list = t + if hasattr(self, '_set'): + self._set() + + def _unset_ts_list(self): + self.__ts_list = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='string', is_config=False) + + tpn = __builtin__.property(_get_tpn) + tsg = __builtin__.property(_get_tsg) + ts_list = __builtin__.property(_get_ts_list) + + __choices__ = {'technology': {'otn': ['tpn', 'tsg', 'ts_list']}} + _pyangbind_elements = OrderedDict([('tpn', tpn), ('tsg', tsg), ('ts_list', ts_list), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_route_objects/path_route_object/numbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_route_objects/path_route_object/numbered_link_hop/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..417bcf3cf2edba4eec7d40840829581e81125903 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_route_objects/path_route_object/numbered_link_hop/__init__.py @@ -0,0 +1,193 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 numbered_link_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/path-properties/path-route-objects/path-route-object/numbered-link-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Numbered link explicit route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__link_tp_id','__hop_type','__direction',) + + _yang_name = 'numbered-link-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=False) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', 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 ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'path-properties', 'path-route-objects', 'path-route-object', 'numbered-link-hop'] + + def _get_link_tp_id(self): + """ + Getter method for link_tp_id, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_route_objects/path_route_object/numbered_link_hop/link_tp_id (te-tp-id) + + YANG Description: TE Link Termination Point (LTP) identifier. + """ + return self.__link_tp_id + + def _set_link_tp_id(self, v, load=False): + """ + Setter method for link_tp_id, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_route_objects/path_route_object/numbered_link_hop/link_tp_id (te-tp-id) + If this variable is read-only (config: false) in the + source YANG file, then _set_link_tp_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_link_tp_id() directly. + + YANG Description: TE Link Termination Point (LTP) identifier. + """ + 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),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """link_tp_id must be of a type compatible with te-tp-id""", + 'defined-type': "ietf-te-topology:te-tp-id", + 'generated-type': """YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=False)""", + }) + + self.__link_tp_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_link_tp_id(self): + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=False) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_route_objects/path_route_object/numbered_link_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_route_objects/path_route_object/numbered_link_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + 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={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + + + def _get_direction(self): + """ + Getter method for direction, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_route_objects/path_route_object/numbered_link_hop/direction (te-link-direction) + + YANG Description: Link route object direction. + """ + return self.__direction + + def _set_direction(self, v, load=False): + """ + Setter method for direction, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_route_objects/path_route_object/numbered_link_hop/direction (te-link-direction) + If this variable is read-only (config: false) in the + source YANG file, then _set_direction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_direction() directly. + + YANG Description: Link route object direction. + """ + 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={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """direction must be of a type compatible with te-link-direction""", + 'defined-type': "ietf-te-topology:te-link-direction", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=False)""", + }) + + self.__direction = t + if hasattr(self, '_set'): + self._set() + + def _unset_direction(self): + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=False) + + link_tp_id = __builtin__.property(_get_link_tp_id) + hop_type = __builtin__.property(_get_hop_type) + direction = __builtin__.property(_get_direction) + + __choices__ = {'type': {'numbered-link-hop': ['link_tp_id', 'hop_type', 'direction']}} + _pyangbind_elements = OrderedDict([('link_tp_id', link_tp_id), ('hop_type', hop_type), ('direction', direction), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_route_objects/path_route_object/numbered_node_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_route_objects/path_route_object/numbered_node_hop/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..bef8709eb663207146dacf4e13648829484c5c5d --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_route_objects/path_route_object/numbered_node_hop/__init__.py @@ -0,0 +1,154 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 numbered_node_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/path-properties/path-route-objects/path-route-object/numbered-node-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Numbered node route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__node_id','__hop_type',) + + _yang_name = 'numbered-node-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=False) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', 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 ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'path-properties', 'path-route-objects', 'path-route-object', 'numbered-node-hop'] + + def _get_node_id(self): + """ + Getter method for node_id, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_route_objects/path_route_object/numbered_node_hop/node_id (te-node-id) + + YANG Description: The identifier of a node in the TE topology. + """ + return self.__node_id + + def _set_node_id(self, v, load=False): + """ + Setter method for node_id, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_route_objects/path_route_object/numbered_node_hop/node_id (te-node-id) + 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. + + YANG Description: The identifier of a node in the TE topology. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """node_id must be of a type compatible with te-node-id""", + 'defined-type': "ietf-te-topology:te-node-id", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=False)""", + }) + + self.__node_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_node_id(self): + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=False) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_route_objects/path_route_object/numbered_node_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_route_objects/path_route_object/numbered_node_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + 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={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + + node_id = __builtin__.property(_get_node_id) + hop_type = __builtin__.property(_get_hop_type) + + __choices__ = {'type': {'numbered-node-hop': ['node_id', 'hop_type']}} + _pyangbind_elements = OrderedDict([('node_id', node_id), ('hop_type', hop_type), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_route_objects/path_route_object/unnumbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_route_objects/path_route_object/unnumbered_link_hop/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..255ef933696bc9a136660d07cb8e00a9a8e8e8f0 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_route_objects/path_route_object/unnumbered_link_hop/__init__.py @@ -0,0 +1,236 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 unnumbered_link_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/path-properties/path-route-objects/path-route-object/unnumbered-link-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Unnumbered link explicit route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__link_tp_id','__node_id','__hop_type','__direction',) + + _yang_name = 'unnumbered-link-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=False) + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=False) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', 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 ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'path-properties', 'path-route-objects', 'path-route-object', 'unnumbered-link-hop'] + + def _get_link_tp_id(self): + """ + Getter method for link_tp_id, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_route_objects/path_route_object/unnumbered_link_hop/link_tp_id (te-tp-id) + + YANG Description: TE LTP identifier. The combination of the TE link ID +and the TE node ID is used to identify an unnumbered +TE link. + """ + return self.__link_tp_id + + def _set_link_tp_id(self, v, load=False): + """ + Setter method for link_tp_id, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_route_objects/path_route_object/unnumbered_link_hop/link_tp_id (te-tp-id) + If this variable is read-only (config: false) in the + source YANG file, then _set_link_tp_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_link_tp_id() directly. + + YANG Description: TE LTP identifier. The combination of the TE link ID +and the TE node ID is used to identify an unnumbered +TE link. + """ + 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),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """link_tp_id must be of a type compatible with te-tp-id""", + 'defined-type': "ietf-te-topology:te-tp-id", + 'generated-type': """YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=False)""", + }) + + self.__link_tp_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_link_tp_id(self): + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=False) + + + def _get_node_id(self): + """ + Getter method for node_id, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_route_objects/path_route_object/unnumbered_link_hop/node_id (te-node-id) + + YANG Description: The identifier of a node in the TE topology. + """ + return self.__node_id + + def _set_node_id(self, v, load=False): + """ + Setter method for node_id, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_route_objects/path_route_object/unnumbered_link_hop/node_id (te-node-id) + 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. + + YANG Description: The identifier of a node in the TE topology. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """node_id must be of a type compatible with te-node-id""", + 'defined-type': "ietf-te-topology:te-node-id", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=False)""", + }) + + self.__node_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_node_id(self): + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=False) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_route_objects/path_route_object/unnumbered_link_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_route_objects/path_route_object/unnumbered_link_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + 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={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + + + def _get_direction(self): + """ + Getter method for direction, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_route_objects/path_route_object/unnumbered_link_hop/direction (te-link-direction) + + YANG Description: Link route object direction. + """ + return self.__direction + + def _set_direction(self, v, load=False): + """ + Setter method for direction, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_route_objects/path_route_object/unnumbered_link_hop/direction (te-link-direction) + If this variable is read-only (config: false) in the + source YANG file, then _set_direction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_direction() directly. + + YANG Description: Link route object direction. + """ + 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={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """direction must be of a type compatible with te-link-direction""", + 'defined-type': "ietf-te-topology:te-link-direction", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=False)""", + }) + + self.__direction = t + if hasattr(self, '_set'): + self._set() + + def _unset_direction(self): + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=False) + + link_tp_id = __builtin__.property(_get_link_tp_id) + node_id = __builtin__.property(_get_node_id) + hop_type = __builtin__.property(_get_hop_type) + direction = __builtin__.property(_get_direction) + + __choices__ = {'type': {'unnumbered-link-hop': ['link_tp_id', 'node_id', 'hop_type', 'direction']}} + _pyangbind_elements = OrderedDict([('link_tp_id', link_tp_id), ('node_id', node_id), ('hop_type', hop_type), ('direction', direction), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_srlgs_lists/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_srlgs_lists/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..ecfdfafc0419c3b6da7d37e634b4443d50f0dae3 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_srlgs_lists/__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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 path_srlgs_list +class path_srlgs_lists(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/path-properties/path-srlgs-lists. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Path SRLG properties container. + """ + __slots__ = ('_path_helper', '_extmethods', '__path_srlgs_list',) + + _yang_name = 'path-srlgs-lists' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__path_srlgs_list = YANGDynClass(base=YANGListType("usage",path_srlgs_list.path_srlgs_list, yang_name="path-srlgs-list", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-srlgs-list", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', 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 ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'path-properties', 'path-srlgs-lists'] + + def _get_path_srlgs_list(self): + """ + Getter method for path_srlgs_list, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_srlgs_lists/path_srlgs_list (list) + + YANG Description: List of SRLG values to be included or excluded. + """ + return self.__path_srlgs_list + + def _set_path_srlgs_list(self, v, load=False): + """ + Setter method for path_srlgs_list, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_srlgs_lists/path_srlgs_list (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_srlgs_list is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_srlgs_list() directly. + + YANG Description: List of SRLG values to be included or excluded. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("usage",path_srlgs_list.path_srlgs_list, yang_name="path-srlgs-list", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-srlgs-list", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_srlgs_list must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("usage",path_srlgs_list.path_srlgs_list, yang_name="path-srlgs-list", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-srlgs-list", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False)""", + }) + + self.__path_srlgs_list = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_srlgs_list(self): + self.__path_srlgs_list = YANGDynClass(base=YANGListType("usage",path_srlgs_list.path_srlgs_list, yang_name="path-srlgs-list", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-srlgs-list", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + + path_srlgs_list = __builtin__.property(_get_path_srlgs_list) + + + _pyangbind_elements = OrderedDict([('path_srlgs_list', path_srlgs_list), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_srlgs_lists/path_srlgs_list/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_srlgs_lists/path_srlgs_list/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..14fb3f2b020f894aa91bd213a469dae8b2548933 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_srlgs_lists/path_srlgs_list/__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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 path_srlgs_list(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/path-properties/path-srlgs-lists/path-srlgs-list. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: List of SRLG values to be included or excluded. + """ + __slots__ = ('_path_helper', '_extmethods', '__usage','__values',) + + _yang_name = 'path-srlgs-list' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__usage = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + self.__values = YANGDynClass(unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32)), is_leaf=False, yang_name="values", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='srlg', 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 ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'path-properties', 'path-srlgs-lists', 'path-srlgs-list'] + + def _get_usage(self): + """ + Getter method for usage, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_srlgs_lists/path_srlgs_list/usage (identityref) + + YANG Description: Identifies an entry in a list of SRLGs to either +include or exclude. + """ + return self.__usage + + def _set_usage(self, v, load=False): + """ + Setter method for usage, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_srlgs_lists/path_srlgs_list/usage (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_usage is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_usage() directly. + + YANG Description: Identifies an entry in a list of SRLGs to either +include or exclude. + """ + 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=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """usage must be of a type compatible with identityref""", + 'defined-type': "ietf-te-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False)""", + }) + + self.__usage = t + if hasattr(self, '_set'): + self._set() + + def _unset_usage(self): + self.__usage = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + + + def _get_values(self): + """ + Getter method for values, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_srlgs_lists/path_srlgs_list/values (srlg) + + YANG Description: List of SRLG values. + """ + return self.__values + + def _set_values(self, v, load=False): + """ + Setter method for values, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_srlgs_lists/path_srlgs_list/values (srlg) + If this variable is read-only (config: false) in the + source YANG file, then _set_values is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_values() directly. + + YANG Description: List of SRLG values. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32)), is_leaf=False, yang_name="values", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='srlg', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """values must be of a type compatible with srlg""", + 'defined-type': "ietf-te-topology:srlg", + 'generated-type': """YANGDynClass(unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32)), is_leaf=False, yang_name="values", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='srlg', is_config=False)""", + }) + + self.__values = t + if hasattr(self, '_set'): + self._set() + + def _unset_values(self): + self.__values = YANGDynClass(unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32)), is_leaf=False, yang_name="values", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='srlg', is_config=False) + + usage = __builtin__.property(_get_usage) + values = __builtin__.property(_get_values) + + + _pyangbind_elements = OrderedDict([('usage', usage), ('values', values), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_srlgs_names/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_srlgs_names/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..48d9f8f048cae1220e75c4b9e5cbf138c608734c --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_srlgs_names/__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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 path_srlgs_name +class path_srlgs_names(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/path-properties/path-srlgs-names. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Container for the list of named SRLGs. + """ + __slots__ = ('_path_helper', '_extmethods', '__path_srlgs_name',) + + _yang_name = 'path-srlgs-names' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__path_srlgs_name = YANGDynClass(base=YANGListType("usage",path_srlgs_name.path_srlgs_name, yang_name="path-srlgs-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-srlgs-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', 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 ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'path-properties', 'path-srlgs-names'] + + def _get_path_srlgs_name(self): + """ + Getter method for path_srlgs_name, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_srlgs_names/path_srlgs_name (list) + + YANG Description: List of named SRLGs to be included or excluded. + """ + return self.__path_srlgs_name + + def _set_path_srlgs_name(self, v, load=False): + """ + Setter method for path_srlgs_name, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_srlgs_names/path_srlgs_name (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_srlgs_name is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_srlgs_name() directly. + + YANG Description: List of named SRLGs to be included or excluded. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("usage",path_srlgs_name.path_srlgs_name, yang_name="path-srlgs-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-srlgs-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_srlgs_name must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("usage",path_srlgs_name.path_srlgs_name, yang_name="path-srlgs-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-srlgs-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False)""", + }) + + self.__path_srlgs_name = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_srlgs_name(self): + self.__path_srlgs_name = YANGDynClass(base=YANGListType("usage",path_srlgs_name.path_srlgs_name, yang_name="path-srlgs-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-srlgs-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + + path_srlgs_name = __builtin__.property(_get_path_srlgs_name) + + + _pyangbind_elements = OrderedDict([('path_srlgs_name', path_srlgs_name), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_srlgs_names/path_srlgs_name/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_srlgs_names/path_srlgs_name/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..874fef3496aabc1c1f220b4662531abe4ca7d362 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_srlgs_names/path_srlgs_name/__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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 path_srlgs_name(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/path-properties/path-srlgs-names/path-srlgs-name. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: List of named SRLGs to be included or excluded. + """ + __slots__ = ('_path_helper', '_extmethods', '__usage','__names',) + + _yang_name = 'path-srlgs-name' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__usage = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + self.__names = YANGDynClass(unique=True, base=TypedListType(allowed_type=six.text_type), is_leaf=False, yang_name="names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', 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 ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'path-properties', 'path-srlgs-names', 'path-srlgs-name'] + + def _get_usage(self): + """ + Getter method for usage, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_srlgs_names/path_srlgs_name/usage (identityref) + + YANG Description: Identifies an entry in a list of named SRLGs to either +include or exclude. + """ + return self.__usage + + def _set_usage(self, v, load=False): + """ + Setter method for usage, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_srlgs_names/path_srlgs_name/usage (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_usage is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_usage() directly. + + YANG Description: Identifies an entry in a list of named SRLGs to either +include or exclude. + """ + 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=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """usage must be of a type compatible with identityref""", + 'defined-type': "ietf-te-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False)""", + }) + + self.__usage = t + if hasattr(self, '_set'): + self._set() + + def _unset_usage(self): + self.__usage = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + + + def _get_names(self): + """ + Getter method for names, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_srlgs_names/path_srlgs_name/names (string) + + YANG Description: List of named SRLGs. + """ + return self.__names + + def _set_names(self, v, load=False): + """ + Setter method for names, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_srlgs_names/path_srlgs_name/names (string) + If this variable is read-only (config: false) in the + source YANG file, then _set_names is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_names() directly. + + YANG Description: List of named SRLGs. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,unique=True, base=TypedListType(allowed_type=six.text_type), is_leaf=False, yang_name="names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """names must be of a type compatible with string""", + 'defined-type': "string", + 'generated-type': """YANGDynClass(unique=True, base=TypedListType(allowed_type=six.text_type), is_leaf=False, yang_name="names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=False)""", + }) + + self.__names = t + if hasattr(self, '_set'): + self._set() + + def _unset_names(self): + self.__names = YANGDynClass(unique=True, base=TypedListType(allowed_type=six.text_type), is_leaf=False, yang_name="names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=False) + + usage = __builtin__.property(_get_usage) + names = __builtin__.property(_get_names) + + + _pyangbind_elements = OrderedDict([('usage', usage), ('names', names), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e1d683aebf4103bd2e3acb9007c9eaa8b2fdff5d --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/__init__.py @@ -0,0 +1,326 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 primary_path +from . import backup_path +from . import tunnel_termination_points +from . import tunnels +class underlay(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/underlay. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Attributes of the TE link underlay. + """ + __slots__ = ('_path_helper', '_extmethods', '__enabled','__primary_path','__backup_path','__protection_type','__tunnel_termination_points','__tunnels',) + + _yang_name = 'underlay' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__enabled = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="enabled", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='boolean', is_config=True) + self.__primary_path = YANGDynClass(base=primary_path.primary_path, is_container='container', yang_name="primary-path", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__backup_path = YANGDynClass(base=YANGListType("index",backup_path.backup_path, yang_name="backup-path", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='index', extensions=None), is_container='list', yang_name="backup-path", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + self.__protection_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'lsp-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-reroute-extra': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-reroute-extra': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-reroute-extra': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-reroute': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-reroute': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-reroute': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-1-for-n': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-1-for-n': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-1-for-n': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-unidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-unidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-unidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-bidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-bidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-bidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="protection-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + self.__tunnel_termination_points = YANGDynClass(base=tunnel_termination_points.tunnel_termination_points, is_container='container', yang_name="tunnel-termination-points", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__tunnels = YANGDynClass(base=tunnels.tunnels, is_container='container', yang_name="tunnels", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-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 ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'underlay'] + + def _get_enabled(self): + """ + Getter method for enabled, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/enabled (boolean) + + YANG Description: 'true' if the underlay is enabled. +'false' if the underlay is disabled. + """ + return self.__enabled + + def _set_enabled(self, v, load=False): + """ + Setter method for enabled, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/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: 'true' if the underlay is enabled. +'false' if the underlay is disabled. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBool, is_leaf=True, yang_name="enabled", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', 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, is_leaf=True, yang_name="enabled", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='boolean', is_config=True)""", + }) + + self.__enabled = t + if hasattr(self, '_set'): + self._set() + + def _unset_enabled(self): + self.__enabled = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="enabled", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='boolean', is_config=True) + + + def _get_primary_path(self): + """ + Getter method for primary_path, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/primary_path (container) + + YANG Description: The service path on the underlay topology that +supports this link. + """ + return self.__primary_path + + def _set_primary_path(self, v, load=False): + """ + Setter method for primary_path, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/primary_path (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_primary_path is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_primary_path() directly. + + YANG Description: The service path on the underlay topology that +supports this link. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=primary_path.primary_path, is_container='container', yang_name="primary-path", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """primary_path must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=primary_path.primary_path, is_container='container', yang_name="primary-path", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__primary_path = t + if hasattr(self, '_set'): + self._set() + + def _unset_primary_path(self): + self.__primary_path = YANGDynClass(base=primary_path.primary_path, is_container='container', yang_name="primary-path", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_backup_path(self): + """ + Getter method for backup_path, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/backup_path (list) + + YANG Description: A list of backup service paths on the underlay topology that +protect the underlay primary path. If the primary path is +not protected, the list contains zero elements. If the +primary path is protected, the list contains one or more +elements. + """ + return self.__backup_path + + def _set_backup_path(self, v, load=False): + """ + Setter method for backup_path, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/backup_path (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_backup_path is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_backup_path() directly. + + YANG Description: A list of backup service paths on the underlay topology that +protect the underlay primary path. If the primary path is +not protected, the list contains zero elements. If the +primary path is protected, the list contains one or more +elements. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("index",backup_path.backup_path, yang_name="backup-path", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='index', extensions=None), is_container='list', yang_name="backup-path", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """backup_path must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("index",backup_path.backup_path, yang_name="backup-path", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='index', extensions=None), is_container='list', yang_name="backup-path", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True)""", + }) + + self.__backup_path = t + if hasattr(self, '_set'): + self._set() + + def _unset_backup_path(self): + self.__backup_path = YANGDynClass(base=YANGListType("index",backup_path.backup_path, yang_name="backup-path", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='index', extensions=None), is_container='list', yang_name="backup-path", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + + + def _get_protection_type(self): + """ + Getter method for protection_type, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/protection_type (identityref) + + YANG Description: Underlay protection type desired for this link. + """ + return self.__protection_type + + def _set_protection_type(self, v, load=False): + """ + Setter method for protection_type, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/protection_type (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_protection_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_protection_type() directly. + + YANG Description: Underlay protection type desired for this link. + """ + 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={'lsp-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-reroute-extra': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-reroute-extra': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-reroute-extra': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-reroute': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-reroute': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-reroute': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-1-for-n': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-1-for-n': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-1-for-n': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-unidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-unidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-unidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-bidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-bidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-bidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="protection-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """protection_type must be of a type compatible with identityref""", + 'defined-type': "ietf-te-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'lsp-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-reroute-extra': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-reroute-extra': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-reroute-extra': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-reroute': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-reroute': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-reroute': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-1-for-n': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-1-for-n': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-1-for-n': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-unidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-unidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-unidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-bidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-bidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-bidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="protection-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True)""", + }) + + self.__protection_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_protection_type(self): + self.__protection_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'lsp-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-reroute-extra': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-reroute-extra': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-reroute-extra': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-reroute': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-reroute': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-reroute': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-1-for-n': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-1-for-n': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-1-for-n': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-unidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-unidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-unidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-bidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-bidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-bidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="protection-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + + + def _get_tunnel_termination_points(self): + """ + Getter method for tunnel_termination_points, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/tunnel_termination_points (container) + + YANG Description: Underlay TTPs desired for this link. + """ + return self.__tunnel_termination_points + + def _set_tunnel_termination_points(self, v, load=False): + """ + Setter method for tunnel_termination_points, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/tunnel_termination_points (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_tunnel_termination_points is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tunnel_termination_points() directly. + + YANG Description: Underlay TTPs desired for this link. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=tunnel_termination_points.tunnel_termination_points, is_container='container', yang_name="tunnel-termination-points", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tunnel_termination_points must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=tunnel_termination_points.tunnel_termination_points, is_container='container', yang_name="tunnel-termination-points", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__tunnel_termination_points = t + if hasattr(self, '_set'): + self._set() + + def _unset_tunnel_termination_points(self): + self.__tunnel_termination_points = YANGDynClass(base=tunnel_termination_points.tunnel_termination_points, is_container='container', yang_name="tunnel-termination-points", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_tunnels(self): + """ + Getter method for tunnels, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/tunnels (container) + + YANG Description: Underlay TE tunnels supporting this TE link. + """ + return self.__tunnels + + def _set_tunnels(self, v, load=False): + """ + Setter method for tunnels, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/tunnels (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_tunnels is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tunnels() directly. + + YANG Description: Underlay TE tunnels supporting this TE link. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=tunnels.tunnels, is_container='container', yang_name="tunnels", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tunnels must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=tunnels.tunnels, is_container='container', yang_name="tunnels", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__tunnels = t + if hasattr(self, '_set'): + self._set() + + def _unset_tunnels(self): + self.__tunnels = YANGDynClass(base=tunnels.tunnels, is_container='container', yang_name="tunnels", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + enabled = __builtin__.property(_get_enabled, _set_enabled) + primary_path = __builtin__.property(_get_primary_path, _set_primary_path) + backup_path = __builtin__.property(_get_backup_path, _set_backup_path) + protection_type = __builtin__.property(_get_protection_type, _set_protection_type) + tunnel_termination_points = __builtin__.property(_get_tunnel_termination_points, _set_tunnel_termination_points) + tunnels = __builtin__.property(_get_tunnels, _set_tunnels) + + + _pyangbind_elements = OrderedDict([('enabled', enabled), ('primary_path', primary_path), ('backup_path', backup_path), ('protection_type', protection_type), ('tunnel_termination_points', tunnel_termination_points), ('tunnels', tunnels), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/backup_path/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/backup_path/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..4347a263e217bbde4621b876d25f60f188c30add --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/backup_path/__init__.py @@ -0,0 +1,207 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 path_element +class backup_path(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/underlay/backup-path. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: A list of backup service paths on the underlay topology that +protect the underlay primary path. If the primary path is +not protected, the list contains zero elements. If the +primary path is protected, the list contains one or more +elements. + """ + __slots__ = ('_path_helper', '_extmethods', '__index','__network_ref','__path_element',) + + _yang_name = 'backup-path' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _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), is_leaf=True, yang_name="index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + self.__network_ref = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="network-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=True) + self.__path_element = YANGDynClass(base=YANGListType("path_element_id",path_element.path_element, yang_name="path-element", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='path-element-id', extensions=None), is_container='list', yang_name="path-element", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-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 ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'underlay', 'backup-path'] + + def _get_index(self): + """ + Getter method for index, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/backup_path/index (uint32) + + YANG Description: A sequence number to identify a backup path. + """ + return self.__index + + def _set_index(self, v, load=False): + """ + Setter method for index, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/backup_path/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: A sequence number to identify a backup path. + """ + 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=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', 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), is_leaf=True, yang_name="index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', 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), is_leaf=True, yang_name="index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + + + def _get_network_ref(self): + """ + Getter method for network_ref, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/backup_path/network_ref (leafref) + + YANG Description: Used to reference a network -- for example, an underlay +network. + """ + return self.__network_ref + + def _set_network_ref(self, v, load=False): + """ + Setter method for network_ref, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/backup_path/network_ref (leafref) + If this variable is read-only (config: false) in the + source YANG file, then _set_network_ref is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_network_ref() directly. + + YANG Description: Used to reference a network -- for example, an underlay +network. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="network-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """network_ref must be of a type compatible with leafref""", + 'defined-type': "leafref", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="network-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=True)""", + }) + + self.__network_ref = t + if hasattr(self, '_set'): + self._set() + + def _unset_network_ref(self): + self.__network_ref = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="network-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=True) + + + def _get_path_element(self): + """ + Getter method for path_element, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/backup_path/path_element (list) + + YANG Description: A list of path elements describing the backup service +path. + """ + return self.__path_element + + def _set_path_element(self, v, load=False): + """ + Setter method for path_element, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/backup_path/path_element (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_element is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_element() directly. + + YANG Description: A list of path elements describing the backup service +path. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("path_element_id",path_element.path_element, yang_name="path-element", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='path-element-id', extensions=None), is_container='list', yang_name="path-element", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_element must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("path_element_id",path_element.path_element, yang_name="path-element", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='path-element-id', extensions=None), is_container='list', yang_name="path-element", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True)""", + }) + + self.__path_element = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_element(self): + self.__path_element = YANGDynClass(base=YANGListType("path_element_id",path_element.path_element, yang_name="path-element", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='path-element-id', extensions=None), is_container='list', yang_name="path-element", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + + index = __builtin__.property(_get_index, _set_index) + network_ref = __builtin__.property(_get_network_ref, _set_network_ref) + path_element = __builtin__.property(_get_path_element, _set_path_element) + + + _pyangbind_elements = OrderedDict([('index', index), ('network_ref', network_ref), ('path_element', path_element), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/backup_path/path_element/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/backup_path/path_element/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..2742320363aaedefb624b8ae99b1998d56df03d3 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/backup_path/path_element/__init__.py @@ -0,0 +1,321 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 numbered_node_hop +from . import numbered_link_hop +from . import unnumbered_link_hop +from . import as_number_hop +from . import label_hop +class path_element(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/underlay/backup-path/path-element. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: A list of path elements describing the backup service +path. + """ + __slots__ = ('_path_helper', '_extmethods', '__path_element_id','__numbered_node_hop','__numbered_link_hop','__unnumbered_link_hop','__as_number_hop','__label_hop',) + + _yang_name = 'path-element' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__path_element_id = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="path-element-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + self.__numbered_node_hop = YANGDynClass(base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__numbered_link_hop = YANGDynClass(base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__unnumbered_link_hop = YANGDynClass(base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__as_number_hop = YANGDynClass(base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__label_hop = YANGDynClass(base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-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 ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'underlay', 'backup-path', 'path-element'] + + def _get_path_element_id(self): + """ + Getter method for path_element_id, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/backup_path/path_element/path_element_id (uint32) + + YANG Description: To identify the element in a path. + """ + return self.__path_element_id + + def _set_path_element_id(self, v, load=False): + """ + Setter method for path_element_id, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/backup_path/path_element/path_element_id (uint32) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_element_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_element_id() directly. + + YANG Description: To identify the element in a path. + """ + 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=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="path-element-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_element_id 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="path-element-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True)""", + }) + + self.__path_element_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_element_id(self): + self.__path_element_id = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="path-element-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + + + def _get_numbered_node_hop(self): + """ + Getter method for numbered_node_hop, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/backup_path/path_element/numbered_node_hop (container) + + YANG Description: Numbered node route hop. + """ + return self.__numbered_node_hop + + def _set_numbered_node_hop(self, v, load=False): + """ + Setter method for numbered_node_hop, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/backup_path/path_element/numbered_node_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_numbered_node_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_numbered_node_hop() directly. + + YANG Description: Numbered node route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """numbered_node_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__numbered_node_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_numbered_node_hop(self): + self.__numbered_node_hop = YANGDynClass(base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_numbered_link_hop(self): + """ + Getter method for numbered_link_hop, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/backup_path/path_element/numbered_link_hop (container) + + YANG Description: Numbered link explicit route hop. + """ + return self.__numbered_link_hop + + def _set_numbered_link_hop(self, v, load=False): + """ + Setter method for numbered_link_hop, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/backup_path/path_element/numbered_link_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_numbered_link_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_numbered_link_hop() directly. + + YANG Description: Numbered link explicit route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """numbered_link_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__numbered_link_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_numbered_link_hop(self): + self.__numbered_link_hop = YANGDynClass(base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_unnumbered_link_hop(self): + """ + Getter method for unnumbered_link_hop, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/backup_path/path_element/unnumbered_link_hop (container) + + YANG Description: Unnumbered link explicit route hop. + """ + return self.__unnumbered_link_hop + + def _set_unnumbered_link_hop(self, v, load=False): + """ + Setter method for unnumbered_link_hop, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/backup_path/path_element/unnumbered_link_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_unnumbered_link_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_unnumbered_link_hop() directly. + + YANG Description: Unnumbered link explicit route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """unnumbered_link_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__unnumbered_link_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_unnumbered_link_hop(self): + self.__unnumbered_link_hop = YANGDynClass(base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_as_number_hop(self): + """ + Getter method for as_number_hop, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/backup_path/path_element/as_number_hop (container) + + YANG Description: AS explicit route hop. + """ + return self.__as_number_hop + + def _set_as_number_hop(self, v, load=False): + """ + Setter method for as_number_hop, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/backup_path/path_element/as_number_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_as_number_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_as_number_hop() directly. + + YANG Description: AS explicit route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """as_number_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__as_number_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_as_number_hop(self): + self.__as_number_hop = YANGDynClass(base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_label_hop(self): + """ + Getter method for label_hop, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/backup_path/path_element/label_hop (container) + + YANG Description: Label hop type. + """ + return self.__label_hop + + def _set_label_hop(self, v, load=False): + """ + Setter method for label_hop, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/backup_path/path_element/label_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_label_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_label_hop() directly. + + YANG Description: Label hop type. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """label_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__label_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_label_hop(self): + self.__label_hop = YANGDynClass(base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + path_element_id = __builtin__.property(_get_path_element_id, _set_path_element_id) + numbered_node_hop = __builtin__.property(_get_numbered_node_hop, _set_numbered_node_hop) + numbered_link_hop = __builtin__.property(_get_numbered_link_hop, _set_numbered_link_hop) + unnumbered_link_hop = __builtin__.property(_get_unnumbered_link_hop, _set_unnumbered_link_hop) + as_number_hop = __builtin__.property(_get_as_number_hop, _set_as_number_hop) + label_hop = __builtin__.property(_get_label_hop, _set_label_hop) + + __choices__ = {'type': {'numbered-node-hop': ['numbered_node_hop'], 'numbered-link-hop': ['numbered_link_hop'], 'unnumbered-link-hop': ['unnumbered_link_hop'], 'as-number': ['as_number_hop'], 'label': ['label_hop']}} + _pyangbind_elements = OrderedDict([('path_element_id', path_element_id), ('numbered_node_hop', numbered_node_hop), ('numbered_link_hop', numbered_link_hop), ('unnumbered_link_hop', unnumbered_link_hop), ('as_number_hop', as_number_hop), ('label_hop', label_hop), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/backup_path/path_element/as_number_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/backup_path/path_element/as_number_hop/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..d2bba5863bde5c1b810032c6a8a31f325086c5be --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/backup_path/path_element/as_number_hop/__init__.py @@ -0,0 +1,154 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 as_number_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/underlay/backup-path/path-element/as-number-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: AS explicit route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__as_number','__hop_type',) + + _yang_name = 'as-number-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__as_number = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=True) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', 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 ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'underlay', 'backup-path', 'path-element', 'as-number-hop'] + + def _get_as_number(self): + """ + Getter method for as_number, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/backup_path/path_element/as_number_hop/as_number (inet:as-number) + + YANG Description: The Autonomous System (AS) number. + """ + return self.__as_number + + def _set_as_number(self, v, load=False): + """ + Setter method for as_number, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/backup_path/path_element/as_number_hop/as_number (inet:as-number) + If this variable is read-only (config: false) in the + source YANG file, then _set_as_number is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_as_number() directly. + + YANG Description: The Autonomous System (AS) number. + """ + 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="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """as_number must be of a type compatible with inet:as-number""", + 'defined-type': "inet:as-number", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=True)""", + }) + + self.__as_number = t + if hasattr(self, '_set'): + self._set() + + def _unset_as_number(self): + self.__as_number = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=True) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/backup_path/path_element/as_number_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/backup_path/path_element/as_number_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + 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={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + + as_number = __builtin__.property(_get_as_number, _set_as_number) + hop_type = __builtin__.property(_get_hop_type, _set_hop_type) + + __choices__ = {'type': {'as-number': ['as_number', 'hop_type']}} + _pyangbind_elements = OrderedDict([('as_number', as_number), ('hop_type', hop_type), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/backup_path/path_element/label_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/backup_path/path_element/label_hop/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..c46d30191327a3683fd95aab0eba1ea852e45552 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/backup_path/path_element/label_hop/__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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 te_label +class label_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/underlay/backup-path/path-element/label-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Label hop type. + """ + __slots__ = ('_path_helper', '_extmethods', '__te_label',) + + _yang_name = 'label-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__te_label = YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-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 ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'underlay', 'backup-path', 'path-element', 'label-hop'] + + def _get_te_label(self): + """ + Getter method for te_label, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/backup_path/path_element/label_hop/te_label (container) + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + return self.__te_label + + def _set_te_label(self, v, load=False): + """ + Setter method for te_label, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/backup_path/path_element/label_hop/te_label (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_te_label is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_te_label() directly. + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """te_label must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__te_label = t + if hasattr(self, '_set'): + self._set() + + def _unset_te_label(self): + self.__te_label = YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + te_label = __builtin__.property(_get_te_label, _set_te_label) + + __choices__ = {'type': {'label': ['te_label']}} + _pyangbind_elements = OrderedDict([('te_label', te_label), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/backup_path/path_element/label_hop/te_label/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/backup_path/path_element/label_hop/te_label/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..7a629f62c65cc6625cb147bfef16754ec8db88c9 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/backup_path/path_element/label_hop/te_label/__init__.py @@ -0,0 +1,234 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 otn +class te_label(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/underlay/backup-path/path-element/label-hop/te-label. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + __slots__ = ('_path_helper', '_extmethods', '__generic','__otn','__vlanid','__direction',) + + _yang_name = 'te-label' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__generic = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True) + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + self.__vlanid = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True) + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', 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 ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'underlay', 'backup-path', 'path-element', 'label-hop', 'te-label'] + + def _get_generic(self): + """ + Getter method for generic, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/backup_path/path_element/label_hop/te_label/generic (rt-types:generalized-label) + + YANG Description: TE label specified in a generic format. + """ + return self.__generic + + def _set_generic(self, v, load=False): + """ + Setter method for generic, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/backup_path/path_element/label_hop/te_label/generic (rt-types:generalized-label) + If this variable is read-only (config: false) in the + source YANG file, then _set_generic is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_generic() directly. + + YANG Description: TE label specified in a generic format. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """generic must be of a type compatible with rt-types:generalized-label""", + 'defined-type': "rt-types:generalized-label", + 'generated-type': """YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True)""", + }) + + self.__generic = t + if hasattr(self, '_set'): + self._set() + + def _unset_generic(self): + self.__generic = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True) + + + def _get_otn(self): + """ + Getter method for otn, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/backup_path/path_element/label_hop/te_label/otn (container) + + YANG Description: Label hop for OTN. + """ + return self.__otn + + def _set_otn(self, v, load=False): + """ + Setter method for otn, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/backup_path/path_element/label_hop/te_label/otn (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_otn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_otn() directly. + + YANG Description: Label hop for OTN. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """otn must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True)""", + }) + + self.__otn = t + if hasattr(self, '_set'): + self._set() + + def _unset_otn(self): + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + + + def _get_vlanid(self): + """ + Getter method for vlanid, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/backup_path/path_element/label_hop/te_label/vlanid (etht-types:vlanid) + + YANG Description: VLAN tag id. + """ + return self.__vlanid + + def _set_vlanid(self, v, load=False): + """ + Setter method for vlanid, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/backup_path/path_element/label_hop/te_label/vlanid (etht-types:vlanid) + If this variable is read-only (config: false) in the + source YANG file, then _set_vlanid is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_vlanid() directly. + + YANG Description: VLAN tag id. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """vlanid must be of a type compatible with etht-types:vlanid""", + 'defined-type': "etht-types:vlanid", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True)""", + }) + + self.__vlanid = t + if hasattr(self, '_set'): + self._set() + + def _unset_vlanid(self): + self.__vlanid = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True) + + + def _get_direction(self): + """ + Getter method for direction, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/backup_path/path_element/label_hop/te_label/direction (te-label-direction) + + YANG Description: Label direction. + """ + return self.__direction + + def _set_direction(self, v, load=False): + """ + Setter method for direction, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/backup_path/path_element/label_hop/te_label/direction (te-label-direction) + If this variable is read-only (config: false) in the + source YANG file, then _set_direction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_direction() directly. + + YANG Description: Label direction. + """ + 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={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """direction must be of a type compatible with te-label-direction""", + 'defined-type': "ietf-te-topology:te-label-direction", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=True)""", + }) + + self.__direction = t + if hasattr(self, '_set'): + self._set() + + def _unset_direction(self): + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=True) + + generic = __builtin__.property(_get_generic, _set_generic) + otn = __builtin__.property(_get_otn, _set_otn) + vlanid = __builtin__.property(_get_vlanid, _set_vlanid) + direction = __builtin__.property(_get_direction, _set_direction) + + __choices__ = {'technology': {'generic': ['generic'], 'otn': ['otn'], 'eth': ['vlanid']}, 'type': {'label': ['direction']}} + _pyangbind_elements = OrderedDict([('generic', generic), ('otn', otn), ('vlanid', vlanid), ('direction', direction), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/backup_path/path_element/label_hop/te_label/otn/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/backup_path/path_element/label_hop/te_label/otn/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..f372a5fb39962575ceac829b6e76d5218d1eb489 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/backup_path/path_element/label_hop/te_label/otn/__init__.py @@ -0,0 +1,209 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 otn(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/underlay/backup-path/path-element/label-hop/te-label/otn. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Label hop for OTN. + """ + __slots__ = ('_path_helper', '_extmethods', '__tpn','__tsg','__ts_list',) + + _yang_name = 'otn' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__tpn = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True) + self.__tsg = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + self.__ts_list = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-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 ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'underlay', 'backup-path', 'path-element', 'label-hop', 'te-label', 'otn'] + + def _get_tpn(self): + """ + Getter method for tpn, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/backup_path/path_element/label_hop/te_label/otn/tpn (otn-tpn) + + YANG Description: Tributary Port Number (TPN). + """ + return self.__tpn + + def _set_tpn(self, v, load=False): + """ + Setter method for tpn, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/backup_path/path_element/label_hop/te_label/otn/tpn (otn-tpn) + If this variable is read-only (config: false) in the + source YANG file, then _set_tpn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tpn() directly. + + YANG Description: Tributary Port Number (TPN). + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tpn must be of a type compatible with otn-tpn""", + 'defined-type': "ietf-otn-topology:otn-tpn", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True)""", + }) + + self.__tpn = t + if hasattr(self, '_set'): + self._set() + + def _unset_tpn(self): + self.__tpn = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True) + + + def _get_tsg(self): + """ + Getter method for tsg, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/backup_path/path_element/label_hop/te_label/otn/tsg (identityref) + + YANG Description: Tributary Slot Granularity (TSG). + """ + return self.__tsg + + def _set_tsg(self, v, load=False): + """ + Setter method for tsg, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/backup_path/path_element/label_hop/te_label/otn/tsg (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_tsg is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tsg() directly. + + YANG Description: Tributary Slot Granularity (TSG). + """ + 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={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tsg must be of a type compatible with identityref""", + 'defined-type': "ietf-otn-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True)""", + }) + + self.__tsg = t + if hasattr(self, '_set'): + self._set() + + def _unset_tsg(self): + self.__tsg = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + + + def _get_ts_list(self): + """ + Getter method for ts_list, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/backup_path/path_element/label_hop/te_label/otn/ts_list (string) + + YANG Description: A list of available Tributary Slots (TS) ranging + + + + +between 1 and 4095. If multiple values or +ranges are given, they all MUST be disjoint +and MUST be in ascending order. +For example 1-20,25,50-1000. + """ + return self.__ts_list + + def _set_ts_list(self, v, load=False): + """ + Setter method for ts_list, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/backup_path/path_element/label_hop/te_label/otn/ts_list (string) + If this variable is read-only (config: false) in the + source YANG file, then _set_ts_list is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_ts_list() directly. + + YANG Description: A list of available Tributary Slots (TS) ranging + + + + +between 1 and 4095. If multiple values or +ranges are given, they all MUST be disjoint +and MUST be in ascending order. +For example 1-20,25,50-1000. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='string', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """ts_list must be of a type compatible with string""", + 'defined-type': "string", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='string', is_config=True)""", + }) + + self.__ts_list = t + if hasattr(self, '_set'): + self._set() + + def _unset_ts_list(self): + self.__ts_list = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='string', is_config=True) + + tpn = __builtin__.property(_get_tpn, _set_tpn) + tsg = __builtin__.property(_get_tsg, _set_tsg) + ts_list = __builtin__.property(_get_ts_list, _set_ts_list) + + __choices__ = {'technology': {'otn': ['tpn', 'tsg', 'ts_list']}} + _pyangbind_elements = OrderedDict([('tpn', tpn), ('tsg', tsg), ('ts_list', ts_list), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/backup_path/path_element/numbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/backup_path/path_element/numbered_link_hop/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..4f7ede0ea83a89f13e1e7db70b5d986bec9cd2a9 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/backup_path/path_element/numbered_link_hop/__init__.py @@ -0,0 +1,193 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 numbered_link_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/underlay/backup-path/path-element/numbered-link-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Numbered link explicit route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__link_tp_id','__hop_type','__direction',) + + _yang_name = 'numbered-link-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', 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 ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'underlay', 'backup-path', 'path-element', 'numbered-link-hop'] + + def _get_link_tp_id(self): + """ + Getter method for link_tp_id, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/backup_path/path_element/numbered_link_hop/link_tp_id (te-tp-id) + + YANG Description: TE Link Termination Point (LTP) identifier. + """ + return self.__link_tp_id + + def _set_link_tp_id(self, v, load=False): + """ + Setter method for link_tp_id, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/backup_path/path_element/numbered_link_hop/link_tp_id (te-tp-id) + If this variable is read-only (config: false) in the + source YANG file, then _set_link_tp_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_link_tp_id() directly. + + YANG Description: TE Link Termination Point (LTP) identifier. + """ + 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),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """link_tp_id must be of a type compatible with te-tp-id""", + 'defined-type': "ietf-te-topology:te-tp-id", + 'generated-type': """YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True)""", + }) + + self.__link_tp_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_link_tp_id(self): + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/backup_path/path_element/numbered_link_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/backup_path/path_element/numbered_link_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + 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={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + + + def _get_direction(self): + """ + Getter method for direction, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/backup_path/path_element/numbered_link_hop/direction (te-link-direction) + + YANG Description: Link route object direction. + """ + return self.__direction + + def _set_direction(self, v, load=False): + """ + Setter method for direction, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/backup_path/path_element/numbered_link_hop/direction (te-link-direction) + If this variable is read-only (config: false) in the + source YANG file, then _set_direction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_direction() directly. + + YANG Description: Link route object direction. + """ + 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={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """direction must be of a type compatible with te-link-direction""", + 'defined-type': "ietf-te-topology:te-link-direction", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True)""", + }) + + self.__direction = t + if hasattr(self, '_set'): + self._set() + + def _unset_direction(self): + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True) + + link_tp_id = __builtin__.property(_get_link_tp_id, _set_link_tp_id) + hop_type = __builtin__.property(_get_hop_type, _set_hop_type) + direction = __builtin__.property(_get_direction, _set_direction) + + __choices__ = {'type': {'numbered-link-hop': ['link_tp_id', 'hop_type', 'direction']}} + _pyangbind_elements = OrderedDict([('link_tp_id', link_tp_id), ('hop_type', hop_type), ('direction', direction), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/backup_path/path_element/numbered_node_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/backup_path/path_element/numbered_node_hop/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..88dac655372e17dc2a27bc122a5bbe48edde4433 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/backup_path/path_element/numbered_node_hop/__init__.py @@ -0,0 +1,154 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 numbered_node_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/underlay/backup-path/path-element/numbered-node-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Numbered node route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__node_id','__hop_type',) + + _yang_name = 'numbered-node-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', 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 ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'underlay', 'backup-path', 'path-element', 'numbered-node-hop'] + + def _get_node_id(self): + """ + Getter method for node_id, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/backup_path/path_element/numbered_node_hop/node_id (te-node-id) + + YANG Description: The identifier of a node in the TE topology. + """ + return self.__node_id + + def _set_node_id(self, v, load=False): + """ + Setter method for node_id, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/backup_path/path_element/numbered_node_hop/node_id (te-node-id) + 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. + + YANG Description: The identifier of a node in the TE topology. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """node_id must be of a type compatible with te-node-id""", + 'defined-type': "ietf-te-topology:te-node-id", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True)""", + }) + + self.__node_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_node_id(self): + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/backup_path/path_element/numbered_node_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/backup_path/path_element/numbered_node_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + 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={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + + node_id = __builtin__.property(_get_node_id, _set_node_id) + hop_type = __builtin__.property(_get_hop_type, _set_hop_type) + + __choices__ = {'type': {'numbered-node-hop': ['node_id', 'hop_type']}} + _pyangbind_elements = OrderedDict([('node_id', node_id), ('hop_type', hop_type), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/backup_path/path_element/unnumbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/backup_path/path_element/unnumbered_link_hop/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..b5a3dfc51955821b9661f6ea5eeaeb61c5dfc74a --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/backup_path/path_element/unnumbered_link_hop/__init__.py @@ -0,0 +1,236 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 unnumbered_link_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/underlay/backup-path/path-element/unnumbered-link-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Unnumbered link explicit route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__link_tp_id','__node_id','__hop_type','__direction',) + + _yang_name = 'unnumbered-link-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True) + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', 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 ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'underlay', 'backup-path', 'path-element', 'unnumbered-link-hop'] + + def _get_link_tp_id(self): + """ + Getter method for link_tp_id, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/backup_path/path_element/unnumbered_link_hop/link_tp_id (te-tp-id) + + YANG Description: TE LTP identifier. The combination of the TE link ID +and the TE node ID is used to identify an unnumbered +TE link. + """ + return self.__link_tp_id + + def _set_link_tp_id(self, v, load=False): + """ + Setter method for link_tp_id, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/backup_path/path_element/unnumbered_link_hop/link_tp_id (te-tp-id) + If this variable is read-only (config: false) in the + source YANG file, then _set_link_tp_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_link_tp_id() directly. + + YANG Description: TE LTP identifier. The combination of the TE link ID +and the TE node ID is used to identify an unnumbered +TE link. + """ + 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),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """link_tp_id must be of a type compatible with te-tp-id""", + 'defined-type': "ietf-te-topology:te-tp-id", + 'generated-type': """YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True)""", + }) + + self.__link_tp_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_link_tp_id(self): + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True) + + + def _get_node_id(self): + """ + Getter method for node_id, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/backup_path/path_element/unnumbered_link_hop/node_id (te-node-id) + + YANG Description: The identifier of a node in the TE topology. + """ + return self.__node_id + + def _set_node_id(self, v, load=False): + """ + Setter method for node_id, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/backup_path/path_element/unnumbered_link_hop/node_id (te-node-id) + 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. + + YANG Description: The identifier of a node in the TE topology. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """node_id must be of a type compatible with te-node-id""", + 'defined-type': "ietf-te-topology:te-node-id", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True)""", + }) + + self.__node_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_node_id(self): + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/backup_path/path_element/unnumbered_link_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/backup_path/path_element/unnumbered_link_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + 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={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + + + def _get_direction(self): + """ + Getter method for direction, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/backup_path/path_element/unnumbered_link_hop/direction (te-link-direction) + + YANG Description: Link route object direction. + """ + return self.__direction + + def _set_direction(self, v, load=False): + """ + Setter method for direction, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/backup_path/path_element/unnumbered_link_hop/direction (te-link-direction) + If this variable is read-only (config: false) in the + source YANG file, then _set_direction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_direction() directly. + + YANG Description: Link route object direction. + """ + 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={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """direction must be of a type compatible with te-link-direction""", + 'defined-type': "ietf-te-topology:te-link-direction", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True)""", + }) + + self.__direction = t + if hasattr(self, '_set'): + self._set() + + def _unset_direction(self): + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True) + + link_tp_id = __builtin__.property(_get_link_tp_id, _set_link_tp_id) + node_id = __builtin__.property(_get_node_id, _set_node_id) + hop_type = __builtin__.property(_get_hop_type, _set_hop_type) + direction = __builtin__.property(_get_direction, _set_direction) + + __choices__ = {'type': {'unnumbered-link-hop': ['link_tp_id', 'node_id', 'hop_type', 'direction']}} + _pyangbind_elements = OrderedDict([('link_tp_id', link_tp_id), ('node_id', node_id), ('hop_type', hop_type), ('direction', direction), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/primary_path/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/primary_path/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..bca7e6259f173043e5b27e88f8d5353d33bf7348 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/primary_path/__init__.py @@ -0,0 +1,158 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 path_element +class primary_path(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/underlay/primary-path. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: The service path on the underlay topology that +supports this link. + """ + __slots__ = ('_path_helper', '_extmethods', '__network_ref','__path_element',) + + _yang_name = 'primary-path' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__network_ref = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="network-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=True) + self.__path_element = YANGDynClass(base=YANGListType("path_element_id",path_element.path_element, yang_name="path-element", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='path-element-id', extensions=None), is_container='list', yang_name="path-element", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-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 ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'underlay', 'primary-path'] + + def _get_network_ref(self): + """ + Getter method for network_ref, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/primary_path/network_ref (leafref) + + YANG Description: Used to reference a network -- for example, an underlay +network. + """ + return self.__network_ref + + def _set_network_ref(self, v, load=False): + """ + Setter method for network_ref, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/primary_path/network_ref (leafref) + If this variable is read-only (config: false) in the + source YANG file, then _set_network_ref is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_network_ref() directly. + + YANG Description: Used to reference a network -- for example, an underlay +network. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="network-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """network_ref must be of a type compatible with leafref""", + 'defined-type': "leafref", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="network-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=True)""", + }) + + self.__network_ref = t + if hasattr(self, '_set'): + self._set() + + def _unset_network_ref(self): + self.__network_ref = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="network-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=True) + + + def _get_path_element(self): + """ + Getter method for path_element, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/primary_path/path_element (list) + + YANG Description: A list of path elements describing the service path. + """ + return self.__path_element + + def _set_path_element(self, v, load=False): + """ + Setter method for path_element, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/primary_path/path_element (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_element is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_element() directly. + + YANG Description: A list of path elements describing the service path. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("path_element_id",path_element.path_element, yang_name="path-element", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='path-element-id', extensions=None), is_container='list', yang_name="path-element", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_element must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("path_element_id",path_element.path_element, yang_name="path-element", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='path-element-id', extensions=None), is_container='list', yang_name="path-element", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True)""", + }) + + self.__path_element = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_element(self): + self.__path_element = YANGDynClass(base=YANGListType("path_element_id",path_element.path_element, yang_name="path-element", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='path-element-id', extensions=None), is_container='list', yang_name="path-element", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + + network_ref = __builtin__.property(_get_network_ref, _set_network_ref) + path_element = __builtin__.property(_get_path_element, _set_path_element) + + + _pyangbind_elements = OrderedDict([('network_ref', network_ref), ('path_element', path_element), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/primary_path/path_element/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/primary_path/path_element/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..2ae1b7cb82f08a9a4d6e145f900ac953612d7e5f --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/primary_path/path_element/__init__.py @@ -0,0 +1,320 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 numbered_node_hop +from . import numbered_link_hop +from . import unnumbered_link_hop +from . import as_number_hop +from . import label_hop +class path_element(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/underlay/primary-path/path-element. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: A list of path elements describing the service path. + """ + __slots__ = ('_path_helper', '_extmethods', '__path_element_id','__numbered_node_hop','__numbered_link_hop','__unnumbered_link_hop','__as_number_hop','__label_hop',) + + _yang_name = 'path-element' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__path_element_id = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="path-element-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + self.__numbered_node_hop = YANGDynClass(base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__numbered_link_hop = YANGDynClass(base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__unnumbered_link_hop = YANGDynClass(base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__as_number_hop = YANGDynClass(base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__label_hop = YANGDynClass(base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-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 ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'underlay', 'primary-path', 'path-element'] + + def _get_path_element_id(self): + """ + Getter method for path_element_id, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/primary_path/path_element/path_element_id (uint32) + + YANG Description: To identify the element in a path. + """ + return self.__path_element_id + + def _set_path_element_id(self, v, load=False): + """ + Setter method for path_element_id, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/primary_path/path_element/path_element_id (uint32) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_element_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_element_id() directly. + + YANG Description: To identify the element in a path. + """ + 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=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="path-element-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_element_id 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="path-element-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True)""", + }) + + self.__path_element_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_element_id(self): + self.__path_element_id = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="path-element-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + + + def _get_numbered_node_hop(self): + """ + Getter method for numbered_node_hop, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/primary_path/path_element/numbered_node_hop (container) + + YANG Description: Numbered node route hop. + """ + return self.__numbered_node_hop + + def _set_numbered_node_hop(self, v, load=False): + """ + Setter method for numbered_node_hop, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/primary_path/path_element/numbered_node_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_numbered_node_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_numbered_node_hop() directly. + + YANG Description: Numbered node route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """numbered_node_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__numbered_node_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_numbered_node_hop(self): + self.__numbered_node_hop = YANGDynClass(base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_numbered_link_hop(self): + """ + Getter method for numbered_link_hop, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/primary_path/path_element/numbered_link_hop (container) + + YANG Description: Numbered link explicit route hop. + """ + return self.__numbered_link_hop + + def _set_numbered_link_hop(self, v, load=False): + """ + Setter method for numbered_link_hop, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/primary_path/path_element/numbered_link_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_numbered_link_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_numbered_link_hop() directly. + + YANG Description: Numbered link explicit route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """numbered_link_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__numbered_link_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_numbered_link_hop(self): + self.__numbered_link_hop = YANGDynClass(base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_unnumbered_link_hop(self): + """ + Getter method for unnumbered_link_hop, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/primary_path/path_element/unnumbered_link_hop (container) + + YANG Description: Unnumbered link explicit route hop. + """ + return self.__unnumbered_link_hop + + def _set_unnumbered_link_hop(self, v, load=False): + """ + Setter method for unnumbered_link_hop, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/primary_path/path_element/unnumbered_link_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_unnumbered_link_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_unnumbered_link_hop() directly. + + YANG Description: Unnumbered link explicit route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """unnumbered_link_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__unnumbered_link_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_unnumbered_link_hop(self): + self.__unnumbered_link_hop = YANGDynClass(base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_as_number_hop(self): + """ + Getter method for as_number_hop, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/primary_path/path_element/as_number_hop (container) + + YANG Description: AS explicit route hop. + """ + return self.__as_number_hop + + def _set_as_number_hop(self, v, load=False): + """ + Setter method for as_number_hop, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/primary_path/path_element/as_number_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_as_number_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_as_number_hop() directly. + + YANG Description: AS explicit route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """as_number_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__as_number_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_as_number_hop(self): + self.__as_number_hop = YANGDynClass(base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_label_hop(self): + """ + Getter method for label_hop, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/primary_path/path_element/label_hop (container) + + YANG Description: Label hop type. + """ + return self.__label_hop + + def _set_label_hop(self, v, load=False): + """ + Setter method for label_hop, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/primary_path/path_element/label_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_label_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_label_hop() directly. + + YANG Description: Label hop type. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """label_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__label_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_label_hop(self): + self.__label_hop = YANGDynClass(base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + path_element_id = __builtin__.property(_get_path_element_id, _set_path_element_id) + numbered_node_hop = __builtin__.property(_get_numbered_node_hop, _set_numbered_node_hop) + numbered_link_hop = __builtin__.property(_get_numbered_link_hop, _set_numbered_link_hop) + unnumbered_link_hop = __builtin__.property(_get_unnumbered_link_hop, _set_unnumbered_link_hop) + as_number_hop = __builtin__.property(_get_as_number_hop, _set_as_number_hop) + label_hop = __builtin__.property(_get_label_hop, _set_label_hop) + + __choices__ = {'type': {'numbered-node-hop': ['numbered_node_hop'], 'numbered-link-hop': ['numbered_link_hop'], 'unnumbered-link-hop': ['unnumbered_link_hop'], 'as-number': ['as_number_hop'], 'label': ['label_hop']}} + _pyangbind_elements = OrderedDict([('path_element_id', path_element_id), ('numbered_node_hop', numbered_node_hop), ('numbered_link_hop', numbered_link_hop), ('unnumbered_link_hop', unnumbered_link_hop), ('as_number_hop', as_number_hop), ('label_hop', label_hop), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/primary_path/path_element/as_number_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/primary_path/path_element/as_number_hop/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..68297031d392727cbaf66a8814206a5b5e85544a --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/primary_path/path_element/as_number_hop/__init__.py @@ -0,0 +1,154 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 as_number_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/underlay/primary-path/path-element/as-number-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: AS explicit route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__as_number','__hop_type',) + + _yang_name = 'as-number-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__as_number = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=True) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', 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 ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'underlay', 'primary-path', 'path-element', 'as-number-hop'] + + def _get_as_number(self): + """ + Getter method for as_number, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/primary_path/path_element/as_number_hop/as_number (inet:as-number) + + YANG Description: The Autonomous System (AS) number. + """ + return self.__as_number + + def _set_as_number(self, v, load=False): + """ + Setter method for as_number, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/primary_path/path_element/as_number_hop/as_number (inet:as-number) + If this variable is read-only (config: false) in the + source YANG file, then _set_as_number is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_as_number() directly. + + YANG Description: The Autonomous System (AS) number. + """ + 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="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """as_number must be of a type compatible with inet:as-number""", + 'defined-type': "inet:as-number", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=True)""", + }) + + self.__as_number = t + if hasattr(self, '_set'): + self._set() + + def _unset_as_number(self): + self.__as_number = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=True) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/primary_path/path_element/as_number_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/primary_path/path_element/as_number_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + 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={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + + as_number = __builtin__.property(_get_as_number, _set_as_number) + hop_type = __builtin__.property(_get_hop_type, _set_hop_type) + + __choices__ = {'type': {'as-number': ['as_number', 'hop_type']}} + _pyangbind_elements = OrderedDict([('as_number', as_number), ('hop_type', hop_type), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/primary_path/path_element/label_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/primary_path/path_element/label_hop/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..80afc929d8ea67af26cbf442755b5e25dcee7dc4 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/primary_path/path_element/label_hop/__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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 te_label +class label_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/underlay/primary-path/path-element/label-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Label hop type. + """ + __slots__ = ('_path_helper', '_extmethods', '__te_label',) + + _yang_name = 'label-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__te_label = YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-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 ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'underlay', 'primary-path', 'path-element', 'label-hop'] + + def _get_te_label(self): + """ + Getter method for te_label, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/primary_path/path_element/label_hop/te_label (container) + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + return self.__te_label + + def _set_te_label(self, v, load=False): + """ + Setter method for te_label, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/primary_path/path_element/label_hop/te_label (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_te_label is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_te_label() directly. + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """te_label must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__te_label = t + if hasattr(self, '_set'): + self._set() + + def _unset_te_label(self): + self.__te_label = YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + te_label = __builtin__.property(_get_te_label, _set_te_label) + + __choices__ = {'type': {'label': ['te_label']}} + _pyangbind_elements = OrderedDict([('te_label', te_label), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/primary_path/path_element/label_hop/te_label/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/primary_path/path_element/label_hop/te_label/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..51e80cb347cb6ac9c199b61cf5e8a4461873fb56 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/primary_path/path_element/label_hop/te_label/__init__.py @@ -0,0 +1,234 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 otn +class te_label(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/underlay/primary-path/path-element/label-hop/te-label. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + __slots__ = ('_path_helper', '_extmethods', '__generic','__otn','__vlanid','__direction',) + + _yang_name = 'te-label' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__generic = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True) + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + self.__vlanid = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True) + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', 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 ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'underlay', 'primary-path', 'path-element', 'label-hop', 'te-label'] + + def _get_generic(self): + """ + Getter method for generic, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/primary_path/path_element/label_hop/te_label/generic (rt-types:generalized-label) + + YANG Description: TE label specified in a generic format. + """ + return self.__generic + + def _set_generic(self, v, load=False): + """ + Setter method for generic, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/primary_path/path_element/label_hop/te_label/generic (rt-types:generalized-label) + If this variable is read-only (config: false) in the + source YANG file, then _set_generic is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_generic() directly. + + YANG Description: TE label specified in a generic format. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """generic must be of a type compatible with rt-types:generalized-label""", + 'defined-type': "rt-types:generalized-label", + 'generated-type': """YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True)""", + }) + + self.__generic = t + if hasattr(self, '_set'): + self._set() + + def _unset_generic(self): + self.__generic = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True) + + + def _get_otn(self): + """ + Getter method for otn, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/primary_path/path_element/label_hop/te_label/otn (container) + + YANG Description: Label hop for OTN. + """ + return self.__otn + + def _set_otn(self, v, load=False): + """ + Setter method for otn, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/primary_path/path_element/label_hop/te_label/otn (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_otn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_otn() directly. + + YANG Description: Label hop for OTN. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """otn must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True)""", + }) + + self.__otn = t + if hasattr(self, '_set'): + self._set() + + def _unset_otn(self): + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + + + def _get_vlanid(self): + """ + Getter method for vlanid, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/primary_path/path_element/label_hop/te_label/vlanid (etht-types:vlanid) + + YANG Description: VLAN tag id. + """ + return self.__vlanid + + def _set_vlanid(self, v, load=False): + """ + Setter method for vlanid, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/primary_path/path_element/label_hop/te_label/vlanid (etht-types:vlanid) + If this variable is read-only (config: false) in the + source YANG file, then _set_vlanid is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_vlanid() directly. + + YANG Description: VLAN tag id. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """vlanid must be of a type compatible with etht-types:vlanid""", + 'defined-type': "etht-types:vlanid", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True)""", + }) + + self.__vlanid = t + if hasattr(self, '_set'): + self._set() + + def _unset_vlanid(self): + self.__vlanid = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True) + + + def _get_direction(self): + """ + Getter method for direction, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/primary_path/path_element/label_hop/te_label/direction (te-label-direction) + + YANG Description: Label direction. + """ + return self.__direction + + def _set_direction(self, v, load=False): + """ + Setter method for direction, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/primary_path/path_element/label_hop/te_label/direction (te-label-direction) + If this variable is read-only (config: false) in the + source YANG file, then _set_direction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_direction() directly. + + YANG Description: Label direction. + """ + 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={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """direction must be of a type compatible with te-label-direction""", + 'defined-type': "ietf-te-topology:te-label-direction", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=True)""", + }) + + self.__direction = t + if hasattr(self, '_set'): + self._set() + + def _unset_direction(self): + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=True) + + generic = __builtin__.property(_get_generic, _set_generic) + otn = __builtin__.property(_get_otn, _set_otn) + vlanid = __builtin__.property(_get_vlanid, _set_vlanid) + direction = __builtin__.property(_get_direction, _set_direction) + + __choices__ = {'technology': {'generic': ['generic'], 'otn': ['otn'], 'eth': ['vlanid']}, 'type': {'label': ['direction']}} + _pyangbind_elements = OrderedDict([('generic', generic), ('otn', otn), ('vlanid', vlanid), ('direction', direction), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/primary_path/path_element/label_hop/te_label/otn/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/primary_path/path_element/label_hop/te_label/otn/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..bc1e9a494adca79867ee909bdf874c91853240d8 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/primary_path/path_element/label_hop/te_label/otn/__init__.py @@ -0,0 +1,209 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 otn(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/underlay/primary-path/path-element/label-hop/te-label/otn. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Label hop for OTN. + """ + __slots__ = ('_path_helper', '_extmethods', '__tpn','__tsg','__ts_list',) + + _yang_name = 'otn' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__tpn = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True) + self.__tsg = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + self.__ts_list = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-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 ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'underlay', 'primary-path', 'path-element', 'label-hop', 'te-label', 'otn'] + + def _get_tpn(self): + """ + Getter method for tpn, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/primary_path/path_element/label_hop/te_label/otn/tpn (otn-tpn) + + YANG Description: Tributary Port Number (TPN). + """ + return self.__tpn + + def _set_tpn(self, v, load=False): + """ + Setter method for tpn, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/primary_path/path_element/label_hop/te_label/otn/tpn (otn-tpn) + If this variable is read-only (config: false) in the + source YANG file, then _set_tpn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tpn() directly. + + YANG Description: Tributary Port Number (TPN). + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tpn must be of a type compatible with otn-tpn""", + 'defined-type': "ietf-otn-topology:otn-tpn", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True)""", + }) + + self.__tpn = t + if hasattr(self, '_set'): + self._set() + + def _unset_tpn(self): + self.__tpn = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True) + + + def _get_tsg(self): + """ + Getter method for tsg, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/primary_path/path_element/label_hop/te_label/otn/tsg (identityref) + + YANG Description: Tributary Slot Granularity (TSG). + """ + return self.__tsg + + def _set_tsg(self, v, load=False): + """ + Setter method for tsg, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/primary_path/path_element/label_hop/te_label/otn/tsg (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_tsg is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tsg() directly. + + YANG Description: Tributary Slot Granularity (TSG). + """ + 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={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tsg must be of a type compatible with identityref""", + 'defined-type': "ietf-otn-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True)""", + }) + + self.__tsg = t + if hasattr(self, '_set'): + self._set() + + def _unset_tsg(self): + self.__tsg = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + + + def _get_ts_list(self): + """ + Getter method for ts_list, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/primary_path/path_element/label_hop/te_label/otn/ts_list (string) + + YANG Description: A list of available Tributary Slots (TS) ranging + + + + +between 1 and 4095. If multiple values or +ranges are given, they all MUST be disjoint +and MUST be in ascending order. +For example 1-20,25,50-1000. + """ + return self.__ts_list + + def _set_ts_list(self, v, load=False): + """ + Setter method for ts_list, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/primary_path/path_element/label_hop/te_label/otn/ts_list (string) + If this variable is read-only (config: false) in the + source YANG file, then _set_ts_list is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_ts_list() directly. + + YANG Description: A list of available Tributary Slots (TS) ranging + + + + +between 1 and 4095. If multiple values or +ranges are given, they all MUST be disjoint +and MUST be in ascending order. +For example 1-20,25,50-1000. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='string', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """ts_list must be of a type compatible with string""", + 'defined-type': "string", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='string', is_config=True)""", + }) + + self.__ts_list = t + if hasattr(self, '_set'): + self._set() + + def _unset_ts_list(self): + self.__ts_list = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='string', is_config=True) + + tpn = __builtin__.property(_get_tpn, _set_tpn) + tsg = __builtin__.property(_get_tsg, _set_tsg) + ts_list = __builtin__.property(_get_ts_list, _set_ts_list) + + __choices__ = {'technology': {'otn': ['tpn', 'tsg', 'ts_list']}} + _pyangbind_elements = OrderedDict([('tpn', tpn), ('tsg', tsg), ('ts_list', ts_list), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/primary_path/path_element/numbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/primary_path/path_element/numbered_link_hop/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..94bf3ca84ea9053b367ebe78a7ecb327ff44bf8f --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/primary_path/path_element/numbered_link_hop/__init__.py @@ -0,0 +1,193 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 numbered_link_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/underlay/primary-path/path-element/numbered-link-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Numbered link explicit route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__link_tp_id','__hop_type','__direction',) + + _yang_name = 'numbered-link-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', 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 ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'underlay', 'primary-path', 'path-element', 'numbered-link-hop'] + + def _get_link_tp_id(self): + """ + Getter method for link_tp_id, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/primary_path/path_element/numbered_link_hop/link_tp_id (te-tp-id) + + YANG Description: TE Link Termination Point (LTP) identifier. + """ + return self.__link_tp_id + + def _set_link_tp_id(self, v, load=False): + """ + Setter method for link_tp_id, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/primary_path/path_element/numbered_link_hop/link_tp_id (te-tp-id) + If this variable is read-only (config: false) in the + source YANG file, then _set_link_tp_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_link_tp_id() directly. + + YANG Description: TE Link Termination Point (LTP) identifier. + """ + 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),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """link_tp_id must be of a type compatible with te-tp-id""", + 'defined-type': "ietf-te-topology:te-tp-id", + 'generated-type': """YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True)""", + }) + + self.__link_tp_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_link_tp_id(self): + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/primary_path/path_element/numbered_link_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/primary_path/path_element/numbered_link_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + 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={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + + + def _get_direction(self): + """ + Getter method for direction, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/primary_path/path_element/numbered_link_hop/direction (te-link-direction) + + YANG Description: Link route object direction. + """ + return self.__direction + + def _set_direction(self, v, load=False): + """ + Setter method for direction, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/primary_path/path_element/numbered_link_hop/direction (te-link-direction) + If this variable is read-only (config: false) in the + source YANG file, then _set_direction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_direction() directly. + + YANG Description: Link route object direction. + """ + 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={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """direction must be of a type compatible with te-link-direction""", + 'defined-type': "ietf-te-topology:te-link-direction", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True)""", + }) + + self.__direction = t + if hasattr(self, '_set'): + self._set() + + def _unset_direction(self): + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True) + + link_tp_id = __builtin__.property(_get_link_tp_id, _set_link_tp_id) + hop_type = __builtin__.property(_get_hop_type, _set_hop_type) + direction = __builtin__.property(_get_direction, _set_direction) + + __choices__ = {'type': {'numbered-link-hop': ['link_tp_id', 'hop_type', 'direction']}} + _pyangbind_elements = OrderedDict([('link_tp_id', link_tp_id), ('hop_type', hop_type), ('direction', direction), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/primary_path/path_element/numbered_node_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/primary_path/path_element/numbered_node_hop/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..3e3ac258c8cb85d97b00edf41e2d11e870bec8a6 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/primary_path/path_element/numbered_node_hop/__init__.py @@ -0,0 +1,154 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 numbered_node_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/underlay/primary-path/path-element/numbered-node-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Numbered node route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__node_id','__hop_type',) + + _yang_name = 'numbered-node-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', 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 ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'underlay', 'primary-path', 'path-element', 'numbered-node-hop'] + + def _get_node_id(self): + """ + Getter method for node_id, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/primary_path/path_element/numbered_node_hop/node_id (te-node-id) + + YANG Description: The identifier of a node in the TE topology. + """ + return self.__node_id + + def _set_node_id(self, v, load=False): + """ + Setter method for node_id, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/primary_path/path_element/numbered_node_hop/node_id (te-node-id) + 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. + + YANG Description: The identifier of a node in the TE topology. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """node_id must be of a type compatible with te-node-id""", + 'defined-type': "ietf-te-topology:te-node-id", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True)""", + }) + + self.__node_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_node_id(self): + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/primary_path/path_element/numbered_node_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/primary_path/path_element/numbered_node_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + 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={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + + node_id = __builtin__.property(_get_node_id, _set_node_id) + hop_type = __builtin__.property(_get_hop_type, _set_hop_type) + + __choices__ = {'type': {'numbered-node-hop': ['node_id', 'hop_type']}} + _pyangbind_elements = OrderedDict([('node_id', node_id), ('hop_type', hop_type), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/primary_path/path_element/unnumbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/primary_path/path_element/unnumbered_link_hop/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..0a2138b5fcdb45fccf594bbc776f16ae469ce1c2 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/primary_path/path_element/unnumbered_link_hop/__init__.py @@ -0,0 +1,236 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 unnumbered_link_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/underlay/primary-path/path-element/unnumbered-link-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Unnumbered link explicit route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__link_tp_id','__node_id','__hop_type','__direction',) + + _yang_name = 'unnumbered-link-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True) + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', 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 ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'underlay', 'primary-path', 'path-element', 'unnumbered-link-hop'] + + def _get_link_tp_id(self): + """ + Getter method for link_tp_id, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/primary_path/path_element/unnumbered_link_hop/link_tp_id (te-tp-id) + + YANG Description: TE LTP identifier. The combination of the TE link ID +and the TE node ID is used to identify an unnumbered +TE link. + """ + return self.__link_tp_id + + def _set_link_tp_id(self, v, load=False): + """ + Setter method for link_tp_id, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/primary_path/path_element/unnumbered_link_hop/link_tp_id (te-tp-id) + If this variable is read-only (config: false) in the + source YANG file, then _set_link_tp_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_link_tp_id() directly. + + YANG Description: TE LTP identifier. The combination of the TE link ID +and the TE node ID is used to identify an unnumbered +TE link. + """ + 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),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """link_tp_id must be of a type compatible with te-tp-id""", + 'defined-type': "ietf-te-topology:te-tp-id", + 'generated-type': """YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True)""", + }) + + self.__link_tp_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_link_tp_id(self): + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True) + + + def _get_node_id(self): + """ + Getter method for node_id, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/primary_path/path_element/unnumbered_link_hop/node_id (te-node-id) + + YANG Description: The identifier of a node in the TE topology. + """ + return self.__node_id + + def _set_node_id(self, v, load=False): + """ + Setter method for node_id, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/primary_path/path_element/unnumbered_link_hop/node_id (te-node-id) + 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. + + YANG Description: The identifier of a node in the TE topology. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """node_id must be of a type compatible with te-node-id""", + 'defined-type': "ietf-te-topology:te-node-id", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True)""", + }) + + self.__node_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_node_id(self): + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/primary_path/path_element/unnumbered_link_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/primary_path/path_element/unnumbered_link_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + 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={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + + + def _get_direction(self): + """ + Getter method for direction, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/primary_path/path_element/unnumbered_link_hop/direction (te-link-direction) + + YANG Description: Link route object direction. + """ + return self.__direction + + def _set_direction(self, v, load=False): + """ + Setter method for direction, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/primary_path/path_element/unnumbered_link_hop/direction (te-link-direction) + If this variable is read-only (config: false) in the + source YANG file, then _set_direction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_direction() directly. + + YANG Description: Link route object direction. + """ + 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={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """direction must be of a type compatible with te-link-direction""", + 'defined-type': "ietf-te-topology:te-link-direction", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True)""", + }) + + self.__direction = t + if hasattr(self, '_set'): + self._set() + + def _unset_direction(self): + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True) + + link_tp_id = __builtin__.property(_get_link_tp_id, _set_link_tp_id) + node_id = __builtin__.property(_get_node_id, _set_node_id) + hop_type = __builtin__.property(_get_hop_type, _set_hop_type) + direction = __builtin__.property(_get_direction, _set_direction) + + __choices__ = {'type': {'unnumbered-link-hop': ['link_tp_id', 'node_id', 'hop_type', 'direction']}} + _pyangbind_elements = OrderedDict([('link_tp_id', link_tp_id), ('node_id', node_id), ('hop_type', hop_type), ('direction', direction), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/tunnel_termination_points/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/tunnel_termination_points/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..018032a5fc256dd0e005bf6193d6074c85f3d9ca --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/tunnel_termination_points/__init__.py @@ -0,0 +1,154 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 tunnel_termination_points(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/underlay/tunnel-termination-points. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Underlay TTPs desired for this link. + """ + __slots__ = ('_path_helper', '_extmethods', '__source','__destination',) + + _yang_name = 'tunnel-termination-points' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__source = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="source", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='binary', is_config=True) + self.__destination = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="destination", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='binary', 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 ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'underlay', 'tunnel-termination-points'] + + def _get_source(self): + """ + Getter method for source, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/tunnel_termination_points/source (binary) + + YANG Description: Source TTP identifier. + """ + return self.__source + + def _set_source(self, v, load=False): + """ + Setter method for source, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/tunnel_termination_points/source (binary) + If this variable is read-only (config: false) in the + source YANG file, then _set_source is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_source() directly. + + YANG Description: Source TTP identifier. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBinary, is_leaf=True, yang_name="source", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='binary', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """source must be of a type compatible with binary""", + 'defined-type': "binary", + 'generated-type': """YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="source", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='binary', is_config=True)""", + }) + + self.__source = t + if hasattr(self, '_set'): + self._set() + + def _unset_source(self): + self.__source = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="source", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='binary', is_config=True) + + + def _get_destination(self): + """ + Getter method for destination, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/tunnel_termination_points/destination (binary) + + YANG Description: Destination TTP identifier. + """ + return self.__destination + + def _set_destination(self, v, load=False): + """ + Setter method for destination, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/tunnel_termination_points/destination (binary) + If this variable is read-only (config: false) in the + source YANG file, then _set_destination is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_destination() directly. + + YANG Description: Destination TTP identifier. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBinary, is_leaf=True, yang_name="destination", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='binary', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """destination must be of a type compatible with binary""", + 'defined-type': "binary", + 'generated-type': """YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="destination", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='binary', is_config=True)""", + }) + + self.__destination = t + if hasattr(self, '_set'): + self._set() + + def _unset_destination(self): + self.__destination = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="destination", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='binary', is_config=True) + + source = __builtin__.property(_get_source, _set_source) + destination = __builtin__.property(_get_destination, _set_destination) + + + _pyangbind_elements = OrderedDict([('source', source), ('destination', destination), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/tunnels/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/tunnels/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..2ba01ce03d54896d69499b9cf8debd9256134af5 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/tunnels/__init__.py @@ -0,0 +1,167 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 tunnel +class tunnels(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/underlay/tunnels. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Underlay TE tunnels supporting this TE link. + """ + __slots__ = ('_path_helper', '_extmethods', '__sharing','__tunnel',) + + _yang_name = 'tunnels' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__sharing = YANGDynClass(base=YANGBool, default=YANGBool("true"), is_leaf=True, yang_name="sharing", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='boolean', is_config=True) + self.__tunnel = YANGDynClass(base=YANGListType("tunnel_name",tunnel.tunnel, yang_name="tunnel", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='tunnel-name', extensions=None), is_container='list', yang_name="tunnel", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-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 ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'underlay', 'tunnels'] + + def _get_sharing(self): + """ + Getter method for sharing, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/tunnels/sharing (boolean) + + YANG Description: 'true' if the underlay tunnel can be shared with other +TE links; +'false' if the underlay tunnel is dedicated to this +TE link. +This leaf is the default option for all TE tunnels +and may be overridden by the per-TE-tunnel value. + """ + return self.__sharing + + def _set_sharing(self, v, load=False): + """ + Setter method for sharing, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/tunnels/sharing (boolean) + If this variable is read-only (config: false) in the + source YANG file, then _set_sharing is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_sharing() directly. + + YANG Description: 'true' if the underlay tunnel can be shared with other +TE links; +'false' if the underlay tunnel is dedicated to this +TE link. +This leaf is the default option for all TE tunnels +and may be overridden by the per-TE-tunnel value. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBool, default=YANGBool("true"), is_leaf=True, yang_name="sharing", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='boolean', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """sharing must be of a type compatible with boolean""", + 'defined-type': "boolean", + 'generated-type': """YANGDynClass(base=YANGBool, default=YANGBool("true"), is_leaf=True, yang_name="sharing", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='boolean', is_config=True)""", + }) + + self.__sharing = t + if hasattr(self, '_set'): + self._set() + + def _unset_sharing(self): + self.__sharing = YANGDynClass(base=YANGBool, default=YANGBool("true"), is_leaf=True, yang_name="sharing", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='boolean', is_config=True) + + + def _get_tunnel(self): + """ + Getter method for tunnel, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/tunnels/tunnel (list) + + YANG Description: Zero, one, or more underlay TE tunnels that support this +TE link. + """ + return self.__tunnel + + def _set_tunnel(self, v, load=False): + """ + Setter method for tunnel, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/tunnels/tunnel (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_tunnel is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tunnel() directly. + + YANG Description: Zero, one, or more underlay TE tunnels that support this +TE link. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("tunnel_name",tunnel.tunnel, yang_name="tunnel", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='tunnel-name', extensions=None), is_container='list', yang_name="tunnel", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tunnel must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("tunnel_name",tunnel.tunnel, yang_name="tunnel", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='tunnel-name', extensions=None), is_container='list', yang_name="tunnel", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True)""", + }) + + self.__tunnel = t + if hasattr(self, '_set'): + self._set() + + def _unset_tunnel(self): + self.__tunnel = YANGDynClass(base=YANGListType("tunnel_name",tunnel.tunnel, yang_name="tunnel", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='tunnel-name', extensions=None), is_container='list', yang_name="tunnel", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + + sharing = __builtin__.property(_get_sharing, _set_sharing) + tunnel = __builtin__.property(_get_tunnel, _set_tunnel) + + + _pyangbind_elements = OrderedDict([('sharing', sharing), ('tunnel', tunnel), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/tunnels/tunnel/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/tunnels/tunnel/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..ee3791127157d2ae6885deda709193aa5612eafc --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/tunnels/tunnel/__init__.py @@ -0,0 +1,170 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 tunnel(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/underlay/tunnels/tunnel. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Zero, one, or more underlay TE tunnels that support this +TE link. + """ + __slots__ = ('_path_helper', '_extmethods', '__tunnel_name','__sharing',) + + _yang_name = 'tunnel' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__tunnel_name = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="tunnel-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=True) + self.__sharing = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="sharing", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', 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 ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'underlay', 'tunnels', 'tunnel'] + + def _get_tunnel_name(self): + """ + Getter method for tunnel_name, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/tunnels/tunnel/tunnel_name (string) + + YANG Description: A tunnel name uniquely identifies an underlay TE tunnel, +used together with the 'source-node' value for this +link. + """ + return self.__tunnel_name + + def _set_tunnel_name(self, v, load=False): + """ + Setter method for tunnel_name, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/tunnels/tunnel/tunnel_name (string) + If this variable is read-only (config: false) in the + source YANG file, then _set_tunnel_name is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tunnel_name() directly. + + YANG Description: A tunnel name uniquely identifies an underlay TE tunnel, +used together with the 'source-node' value for this +link. + """ + 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="tunnel-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tunnel_name must be of a type compatible with string""", + 'defined-type': "string", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="tunnel-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=True)""", + }) + + self.__tunnel_name = t + if hasattr(self, '_set'): + self._set() + + def _unset_tunnel_name(self): + self.__tunnel_name = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="tunnel-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=True) + + + def _get_sharing(self): + """ + Getter method for sharing, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/tunnels/tunnel/sharing (boolean) + + YANG Description: 'true' if the underlay tunnel can be shared with other +TE links; +'false' if the underlay tunnel is dedicated to this +TE link. + """ + return self.__sharing + + def _set_sharing(self, v, load=False): + """ + Setter method for sharing, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/tunnels/tunnel/sharing (boolean) + If this variable is read-only (config: false) in the + source YANG file, then _set_sharing is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_sharing() directly. + + YANG Description: 'true' if the underlay tunnel can be shared with other +TE links; +'false' if the underlay tunnel is dedicated to this +TE link. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBool, is_leaf=True, yang_name="sharing", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='boolean', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """sharing must be of a type compatible with boolean""", + 'defined-type': "boolean", + 'generated-type': """YANGDynClass(base=YANGBool, is_leaf=True, yang_name="sharing", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='boolean', is_config=True)""", + }) + + self.__sharing = t + if hasattr(self, '_set'): + self._set() + + def _unset_sharing(self): + self.__sharing = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="sharing", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='boolean', is_config=True) + + tunnel_name = __builtin__.property(_get_tunnel_name, _set_tunnel_name) + sharing = __builtin__.property(_get_sharing, _set_sharing) + + + _pyangbind_elements = OrderedDict([('tunnel_name', tunnel_name), ('sharing', sharing), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/statistics/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/statistics/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..f8037917441e8994d0eda617a6b5b961d6af2837 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/statistics/__init__.py @@ -0,0 +1,207 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 tunnel_termination_point +from . import local_link_connectivity +class statistics(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/statistics. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Statistics data. + """ + __slots__ = ('_path_helper', '_extmethods', '__discontinuity_time','__tunnel_termination_point','__local_link_connectivity',) + + _yang_name = 'statistics' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__discontinuity_time = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(Z|[\\+\\-]\\d{2}:\\d{2})'}), is_leaf=True, yang_name="discontinuity-time", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:date-and-time', is_config=False) + self.__tunnel_termination_point = YANGDynClass(base=tunnel_termination_point.tunnel_termination_point, is_container='container', yang_name="tunnel-termination-point", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__local_link_connectivity = YANGDynClass(base=local_link_connectivity.local_link_connectivity, is_container='container', yang_name="local-link-connectivity", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', 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 ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'statistics'] + + def _get_discontinuity_time(self): + """ + Getter method for discontinuity_time, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/statistics/discontinuity_time (yang:date-and-time) + + YANG Description: The time of the most recent occasion at which any one or +more of this interface's counters suffered a +discontinuity. If no such discontinuities have occurred +since the last re-initialization of the local management +subsystem, then this node contains the time the local +management subsystem re-initialized itself. + """ + return self.__discontinuity_time + + def _set_discontinuity_time(self, v, load=False): + """ + Setter method for discontinuity_time, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/statistics/discontinuity_time (yang:date-and-time) + If this variable is read-only (config: false) in the + source YANG file, then _set_discontinuity_time is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_discontinuity_time() directly. + + YANG Description: The time of the most recent occasion at which any one or +more of this interface's counters suffered a +discontinuity. If no such discontinuities have occurred +since the last re-initialization of the local management +subsystem, then this node contains the time the local +management subsystem re-initialized itself. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(Z|[\\+\\-]\\d{2}:\\d{2})'}), is_leaf=True, yang_name="discontinuity-time", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:date-and-time', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """discontinuity_time must be of a type compatible with yang:date-and-time""", + 'defined-type': "yang:date-and-time", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(Z|[\\+\\-]\\d{2}:\\d{2})'}), is_leaf=True, yang_name="discontinuity-time", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:date-and-time', is_config=False)""", + }) + + self.__discontinuity_time = t + if hasattr(self, '_set'): + self._set() + + def _unset_discontinuity_time(self): + self.__discontinuity_time = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(Z|[\\+\\-]\\d{2}:\\d{2})'}), is_leaf=True, yang_name="discontinuity-time", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:date-and-time', is_config=False) + + + def _get_tunnel_termination_point(self): + """ + Getter method for tunnel_termination_point, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/statistics/tunnel_termination_point (container) + + YANG Description: Contains statistics attributes at the TE TTP level. + """ + return self.__tunnel_termination_point + + def _set_tunnel_termination_point(self, v, load=False): + """ + Setter method for tunnel_termination_point, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/statistics/tunnel_termination_point (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_tunnel_termination_point is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tunnel_termination_point() directly. + + YANG Description: Contains statistics attributes at the TE TTP level. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=tunnel_termination_point.tunnel_termination_point, is_container='container', yang_name="tunnel-termination-point", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tunnel_termination_point must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=tunnel_termination_point.tunnel_termination_point, is_container='container', yang_name="tunnel-termination-point", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__tunnel_termination_point = t + if hasattr(self, '_set'): + self._set() + + def _unset_tunnel_termination_point(self): + self.__tunnel_termination_point = YANGDynClass(base=tunnel_termination_point.tunnel_termination_point, is_container='container', yang_name="tunnel-termination-point", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_local_link_connectivity(self): + """ + Getter method for local_link_connectivity, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/statistics/local_link_connectivity (container) + + YANG Description: Contains statistics attributes at the TE LLCL (Local Link +Connectivity List) level. + """ + return self.__local_link_connectivity + + def _set_local_link_connectivity(self, v, load=False): + """ + Setter method for local_link_connectivity, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/statistics/local_link_connectivity (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_local_link_connectivity is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_local_link_connectivity() directly. + + YANG Description: Contains statistics attributes at the TE LLCL (Local Link +Connectivity List) level. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=local_link_connectivity.local_link_connectivity, is_container='container', yang_name="local-link-connectivity", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """local_link_connectivity must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=local_link_connectivity.local_link_connectivity, is_container='container', yang_name="local-link-connectivity", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__local_link_connectivity = t + if hasattr(self, '_set'): + self._set() + + def _unset_local_link_connectivity(self): + self.__local_link_connectivity = YANGDynClass(base=local_link_connectivity.local_link_connectivity, is_container='container', yang_name="local-link-connectivity", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + discontinuity_time = __builtin__.property(_get_discontinuity_time) + tunnel_termination_point = __builtin__.property(_get_tunnel_termination_point) + local_link_connectivity = __builtin__.property(_get_local_link_connectivity) + + + _pyangbind_elements = OrderedDict([('discontinuity_time', discontinuity_time), ('tunnel_termination_point', tunnel_termination_point), ('local_link_connectivity', local_link_connectivity), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/statistics/local_link_connectivity/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/statistics/local_link_connectivity/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e533bc72da87f17335dee6fb8a680fd5994fbe4b --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/statistics/local_link_connectivity/__init__.py @@ -0,0 +1,272 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 local_link_connectivity(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/statistics/local-link-connectivity. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Contains statistics attributes at the TE LLCL (Local Link +Connectivity List) level. + """ + __slots__ = ('_path_helper', '_extmethods', '__creates','__deletes','__disables','__enables','__modifies',) + + _yang_name = 'local-link-connectivity' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__creates = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="creates", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False) + self.__deletes = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="deletes", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False) + self.__disables = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="disables", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False) + self.__enables = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="enables", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False) + self.__modifies = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="modifies", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', 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 ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'statistics', 'local-link-connectivity'] + + def _get_creates(self): + """ + Getter method for creates, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/statistics/local_link_connectivity/creates (yang:counter32) + + YANG Description: Number of times that an LLCL entry was created. + """ + return self.__creates + + def _set_creates(self, v, load=False): + """ + Setter method for creates, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/statistics/local_link_connectivity/creates (yang:counter32) + If this variable is read-only (config: false) in the + source YANG file, then _set_creates is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_creates() directly. + + YANG Description: Number of times that an LLCL entry was created. + """ + 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="creates", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """creates must be of a type compatible with yang:counter32""", + 'defined-type': "yang:counter32", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="creates", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False)""", + }) + + self.__creates = t + if hasattr(self, '_set'): + self._set() + + def _unset_creates(self): + self.__creates = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="creates", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False) + + + def _get_deletes(self): + """ + Getter method for deletes, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/statistics/local_link_connectivity/deletes (yang:counter32) + + YANG Description: Number of times that an LLCL entry was deleted. + """ + return self.__deletes + + def _set_deletes(self, v, load=False): + """ + Setter method for deletes, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/statistics/local_link_connectivity/deletes (yang:counter32) + If this variable is read-only (config: false) in the + source YANG file, then _set_deletes is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_deletes() directly. + + YANG Description: Number of times that an LLCL entry was deleted. + """ + 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="deletes", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """deletes must be of a type compatible with yang:counter32""", + 'defined-type': "yang:counter32", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="deletes", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False)""", + }) + + self.__deletes = t + if hasattr(self, '_set'): + self._set() + + def _unset_deletes(self): + self.__deletes = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="deletes", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False) + + + def _get_disables(self): + """ + Getter method for disables, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/statistics/local_link_connectivity/disables (yang:counter32) + + YANG Description: Number of times that an LLCL entry was disabled. + """ + return self.__disables + + def _set_disables(self, v, load=False): + """ + Setter method for disables, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/statistics/local_link_connectivity/disables (yang:counter32) + If this variable is read-only (config: false) in the + source YANG file, then _set_disables is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_disables() directly. + + YANG Description: Number of times that an LLCL entry was disabled. + """ + 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="disables", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """disables must be of a type compatible with yang:counter32""", + 'defined-type': "yang:counter32", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="disables", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False)""", + }) + + self.__disables = t + if hasattr(self, '_set'): + self._set() + + def _unset_disables(self): + self.__disables = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="disables", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False) + + + def _get_enables(self): + """ + Getter method for enables, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/statistics/local_link_connectivity/enables (yang:counter32) + + YANG Description: Number of times that an LLCL entry was enabled. + """ + return self.__enables + + def _set_enables(self, v, load=False): + """ + Setter method for enables, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/statistics/local_link_connectivity/enables (yang:counter32) + If this variable is read-only (config: false) in the + source YANG file, then _set_enables is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_enables() directly. + + YANG Description: Number of times that an LLCL entry was enabled. + """ + 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="enables", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """enables must be of a type compatible with yang:counter32""", + 'defined-type': "yang:counter32", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="enables", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False)""", + }) + + self.__enables = t + if hasattr(self, '_set'): + self._set() + + def _unset_enables(self): + self.__enables = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="enables", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False) + + + def _get_modifies(self): + """ + Getter method for modifies, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/statistics/local_link_connectivity/modifies (yang:counter32) + + YANG Description: Number of times that an LLCL entry was modified. + """ + return self.__modifies + + def _set_modifies(self, v, load=False): + """ + Setter method for modifies, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/statistics/local_link_connectivity/modifies (yang:counter32) + If this variable is read-only (config: false) in the + source YANG file, then _set_modifies is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_modifies() directly. + + YANG Description: Number of times that an LLCL entry was modified. + """ + 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="modifies", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """modifies must be of a type compatible with yang:counter32""", + 'defined-type': "yang:counter32", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="modifies", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False)""", + }) + + self.__modifies = t + if hasattr(self, '_set'): + self._set() + + def _unset_modifies(self): + self.__modifies = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="modifies", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False) + + creates = __builtin__.property(_get_creates) + deletes = __builtin__.property(_get_deletes) + disables = __builtin__.property(_get_disables) + enables = __builtin__.property(_get_enables) + modifies = __builtin__.property(_get_modifies) + + + _pyangbind_elements = OrderedDict([('creates', creates), ('deletes', deletes), ('disables', disables), ('enables', enables), ('modifies', modifies), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/statistics/tunnel_termination_point/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/statistics/tunnel_termination_point/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..7759e40ddb4422ba2bbbd58a2c0fd9b8babdc412 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/statistics/tunnel_termination_point/__init__.py @@ -0,0 +1,435 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 tunnel_termination_point(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/statistics/tunnel-termination-point. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Contains statistics attributes at the TE TTP level. + """ + __slots__ = ('_path_helper', '_extmethods', '__disables','__enables','__maintenance_clears','__maintenance_sets','__modifies','__downs','__ups','__in_service_clears','__in_service_sets',) + + _yang_name = 'tunnel-termination-point' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__disables = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="disables", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False) + self.__enables = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="enables", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False) + self.__maintenance_clears = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="maintenance-clears", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False) + self.__maintenance_sets = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="maintenance-sets", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False) + self.__modifies = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="modifies", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False) + self.__downs = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="downs", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False) + self.__ups = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="ups", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False) + self.__in_service_clears = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="in-service-clears", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False) + self.__in_service_sets = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="in-service-sets", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', 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 ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'statistics', 'tunnel-termination-point'] + + def _get_disables(self): + """ + Getter method for disables, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/statistics/tunnel_termination_point/disables (yang:counter32) + + YANG Description: Number of times that a TTP was disabled. + """ + return self.__disables + + def _set_disables(self, v, load=False): + """ + Setter method for disables, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/statistics/tunnel_termination_point/disables (yang:counter32) + If this variable is read-only (config: false) in the + source YANG file, then _set_disables is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_disables() directly. + + YANG Description: Number of times that a TTP was disabled. + """ + 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="disables", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """disables must be of a type compatible with yang:counter32""", + 'defined-type': "yang:counter32", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="disables", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False)""", + }) + + self.__disables = t + if hasattr(self, '_set'): + self._set() + + def _unset_disables(self): + self.__disables = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="disables", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False) + + + def _get_enables(self): + """ + Getter method for enables, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/statistics/tunnel_termination_point/enables (yang:counter32) + + YANG Description: Number of times that a TTP was enabled. + """ + return self.__enables + + def _set_enables(self, v, load=False): + """ + Setter method for enables, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/statistics/tunnel_termination_point/enables (yang:counter32) + If this variable is read-only (config: false) in the + source YANG file, then _set_enables is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_enables() directly. + + YANG Description: Number of times that a TTP was enabled. + """ + 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="enables", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """enables must be of a type compatible with yang:counter32""", + 'defined-type': "yang:counter32", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="enables", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False)""", + }) + + self.__enables = t + if hasattr(self, '_set'): + self._set() + + def _unset_enables(self): + self.__enables = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="enables", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False) + + + def _get_maintenance_clears(self): + """ + Getter method for maintenance_clears, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/statistics/tunnel_termination_point/maintenance_clears (yang:counter32) + + YANG Description: Number of times that a TTP was taken out of maintenance. + """ + return self.__maintenance_clears + + def _set_maintenance_clears(self, v, load=False): + """ + Setter method for maintenance_clears, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/statistics/tunnel_termination_point/maintenance_clears (yang:counter32) + If this variable is read-only (config: false) in the + source YANG file, then _set_maintenance_clears is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_maintenance_clears() directly. + + YANG Description: Number of times that a TTP was taken out of maintenance. + """ + 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="maintenance-clears", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """maintenance_clears must be of a type compatible with yang:counter32""", + 'defined-type': "yang:counter32", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="maintenance-clears", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False)""", + }) + + self.__maintenance_clears = t + if hasattr(self, '_set'): + self._set() + + def _unset_maintenance_clears(self): + self.__maintenance_clears = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="maintenance-clears", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False) + + + def _get_maintenance_sets(self): + """ + Getter method for maintenance_sets, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/statistics/tunnel_termination_point/maintenance_sets (yang:counter32) + + YANG Description: Number of times that a TTP was put in maintenance. + """ + return self.__maintenance_sets + + def _set_maintenance_sets(self, v, load=False): + """ + Setter method for maintenance_sets, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/statistics/tunnel_termination_point/maintenance_sets (yang:counter32) + If this variable is read-only (config: false) in the + source YANG file, then _set_maintenance_sets is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_maintenance_sets() directly. + + YANG Description: Number of times that a TTP was put in maintenance. + """ + 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="maintenance-sets", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """maintenance_sets must be of a type compatible with yang:counter32""", + 'defined-type': "yang:counter32", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="maintenance-sets", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False)""", + }) + + self.__maintenance_sets = t + if hasattr(self, '_set'): + self._set() + + def _unset_maintenance_sets(self): + self.__maintenance_sets = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="maintenance-sets", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False) + + + def _get_modifies(self): + """ + Getter method for modifies, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/statistics/tunnel_termination_point/modifies (yang:counter32) + + YANG Description: Number of times that a TTP was modified. + """ + return self.__modifies + + def _set_modifies(self, v, load=False): + """ + Setter method for modifies, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/statistics/tunnel_termination_point/modifies (yang:counter32) + If this variable is read-only (config: false) in the + source YANG file, then _set_modifies is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_modifies() directly. + + YANG Description: Number of times that a TTP was modified. + """ + 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="modifies", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """modifies must be of a type compatible with yang:counter32""", + 'defined-type': "yang:counter32", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="modifies", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False)""", + }) + + self.__modifies = t + if hasattr(self, '_set'): + self._set() + + def _unset_modifies(self): + self.__modifies = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="modifies", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False) + + + def _get_downs(self): + """ + Getter method for downs, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/statistics/tunnel_termination_point/downs (yang:counter32) + + YANG Description: Number of times that a TTP was set to an operational state +of 'down'. + """ + return self.__downs + + def _set_downs(self, v, load=False): + """ + Setter method for downs, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/statistics/tunnel_termination_point/downs (yang:counter32) + If this variable is read-only (config: false) in the + source YANG file, then _set_downs is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_downs() directly. + + YANG Description: Number of times that a TTP was set to an operational state +of 'down'. + """ + 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="downs", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """downs must be of a type compatible with yang:counter32""", + 'defined-type': "yang:counter32", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="downs", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False)""", + }) + + self.__downs = t + if hasattr(self, '_set'): + self._set() + + def _unset_downs(self): + self.__downs = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="downs", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False) + + + def _get_ups(self): + """ + Getter method for ups, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/statistics/tunnel_termination_point/ups (yang:counter32) + + YANG Description: Number of times that a TTP was set to an operational state +of 'up'. + """ + return self.__ups + + def _set_ups(self, v, load=False): + """ + Setter method for ups, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/statistics/tunnel_termination_point/ups (yang:counter32) + If this variable is read-only (config: false) in the + source YANG file, then _set_ups is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_ups() directly. + + YANG Description: Number of times that a TTP was set to an operational state +of 'up'. + """ + 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="ups", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """ups must be of a type compatible with yang:counter32""", + 'defined-type': "yang:counter32", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="ups", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False)""", + }) + + self.__ups = t + if hasattr(self, '_set'): + self._set() + + def _unset_ups(self): + self.__ups = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="ups", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False) + + + def _get_in_service_clears(self): + """ + Getter method for in_service_clears, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/statistics/tunnel_termination_point/in_service_clears (yang:counter32) + + YANG Description: Number of times that a TTP was taken out of service +(TE tunnel was released). + """ + return self.__in_service_clears + + def _set_in_service_clears(self, v, load=False): + """ + Setter method for in_service_clears, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/statistics/tunnel_termination_point/in_service_clears (yang:counter32) + If this variable is read-only (config: false) in the + source YANG file, then _set_in_service_clears is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_in_service_clears() directly. + + YANG Description: Number of times that a TTP was taken out of service +(TE tunnel was released). + """ + 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="in-service-clears", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """in_service_clears must be of a type compatible with yang:counter32""", + 'defined-type': "yang:counter32", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="in-service-clears", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False)""", + }) + + self.__in_service_clears = t + if hasattr(self, '_set'): + self._set() + + def _unset_in_service_clears(self): + self.__in_service_clears = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="in-service-clears", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False) + + + def _get_in_service_sets(self): + """ + Getter method for in_service_sets, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/statistics/tunnel_termination_point/in_service_sets (yang:counter32) + + YANG Description: Number of times that a TTP was put in service by a TE +tunnel (TE tunnel was set up). + """ + return self.__in_service_sets + + def _set_in_service_sets(self, v, load=False): + """ + Setter method for in_service_sets, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/statistics/tunnel_termination_point/in_service_sets (yang:counter32) + If this variable is read-only (config: false) in the + source YANG file, then _set_in_service_sets is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_in_service_sets() directly. + + YANG Description: Number of times that a TTP was put in service by a TE +tunnel (TE tunnel was set up). + """ + 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="in-service-sets", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """in_service_sets must be of a type compatible with yang:counter32""", + 'defined-type': "yang:counter32", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="in-service-sets", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False)""", + }) + + self.__in_service_sets = t + if hasattr(self, '_set'): + self._set() + + def _unset_in_service_sets(self): + self.__in_service_sets = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="in-service-sets", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False) + + disables = __builtin__.property(_get_disables) + enables = __builtin__.property(_get_enables) + maintenance_clears = __builtin__.property(_get_maintenance_clears) + maintenance_sets = __builtin__.property(_get_maintenance_sets) + modifies = __builtin__.property(_get_modifies) + downs = __builtin__.property(_get_downs) + ups = __builtin__.property(_get_ups) + in_service_clears = __builtin__.property(_get_in_service_clears) + in_service_sets = __builtin__.property(_get_in_service_sets) + + + _pyangbind_elements = OrderedDict([('disables', disables), ('enables', enables), ('maintenance_clears', maintenance_clears), ('maintenance_sets', maintenance_sets), ('modifies', modifies), ('downs', downs), ('ups', ups), ('in_service_clears', in_service_clears), ('in_service_sets', in_service_sets), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/supporting_tunnel_termination_point/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/supporting_tunnel_termination_point/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..2d4ca8bff453261b3dd00e5cb1de701663ac8e48 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/supporting_tunnel_termination_point/__init__.py @@ -0,0 +1,172 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 supporting_tunnel_termination_point(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/supporting-tunnel-termination-point. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Identifies the TTPs on which this TTP depends. + """ + __slots__ = ('_path_helper', '_extmethods', '__node_ref','__tunnel_tp_ref',) + + _yang_name = 'supporting-tunnel-termination-point' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__node_ref = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="node-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:uri', is_config=True) + self.__tunnel_tp_ref = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="tunnel-tp-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='binary', 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 ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'supporting-tunnel-termination-point'] + + def _get_node_ref(self): + """ + Getter method for node_ref, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/supporting_tunnel_termination_point/node_ref (inet:uri) + + YANG Description: This leaf identifies the node in which the supporting +TTP is present. +This node is either the supporting node or a node in +an underlay topology. + """ + return self.__node_ref + + def _set_node_ref(self, v, load=False): + """ + Setter method for node_ref, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/supporting_tunnel_termination_point/node_ref (inet:uri) + If this variable is read-only (config: false) in the + source YANG file, then _set_node_ref is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_node_ref() directly. + + YANG Description: This leaf identifies the node in which the supporting +TTP is present. +This node is either the supporting node or a node in +an underlay topology. + """ + 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-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:uri', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """node_ref must be of a type compatible with inet:uri""", + 'defined-type': "inet:uri", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="node-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:uri', is_config=True)""", + }) + + self.__node_ref = t + if hasattr(self, '_set'): + self._set() + + def _unset_node_ref(self): + self.__node_ref = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="node-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:uri', is_config=True) + + + def _get_tunnel_tp_ref(self): + """ + Getter method for tunnel_tp_ref, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/supporting_tunnel_termination_point/tunnel_tp_ref (binary) + + YANG Description: Reference to a TTP that is in either the supporting node +or a node in an underlay topology. + """ + return self.__tunnel_tp_ref + + def _set_tunnel_tp_ref(self, v, load=False): + """ + Setter method for tunnel_tp_ref, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/supporting_tunnel_termination_point/tunnel_tp_ref (binary) + If this variable is read-only (config: false) in the + source YANG file, then _set_tunnel_tp_ref is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tunnel_tp_ref() directly. + + YANG Description: Reference to a TTP that is in either the supporting node +or a node in an underlay topology. + """ + 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=YANGBinary, is_leaf=True, yang_name="tunnel-tp-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='binary', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tunnel_tp_ref must be of a type compatible with binary""", + 'defined-type': "binary", + 'generated-type': """YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="tunnel-tp-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='binary', is_config=True)""", + }) + + self.__tunnel_tp_ref = t + if hasattr(self, '_set'): + self._set() + + def _unset_tunnel_tp_ref(self): + self.__tunnel_tp_ref = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="tunnel-tp-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='binary', is_config=True) + + node_ref = __builtin__.property(_get_node_ref, _set_node_ref) + tunnel_tp_ref = __builtin__.property(_get_tunnel_tp_ref, _set_tunnel_tp_ref) + + + _pyangbind_elements = OrderedDict([('node_ref', node_ref), ('tunnel_tp_ref', tunnel_tp_ref), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/termination_point/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/termination_point/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..1665caff1547e59b85854466ac6f31d68743c33e --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/termination_point/__init__.py @@ -0,0 +1,339 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 supporting_termination_point +from . import te +from . import eth_svc +from . import eth_link_tp +class termination_point(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/termination-point. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: A termination point can terminate a link. +Depending on the type of topology, a termination point +could, for example, refer to a port or an interface. + """ + __slots__ = ('_path_helper', '_extmethods', '__tp_id','__supporting_termination_point','__te_tp_id','__te','__eth_svc','__eth_link_tp',) + + _yang_name = 'termination-point' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__tp_id = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="tp-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-network-topology', defining_module='ietf-network-topology', yang_type='tp-id', is_config=True) + self.__supporting_termination_point = YANGDynClass(base=YANGListType("network_ref node_ref tp_ref",supporting_termination_point.supporting_termination_point, yang_name="supporting-termination-point", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='network-ref node-ref tp-ref', extensions=None), is_container='list', yang_name="supporting-termination-point", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-network-topology', defining_module='ietf-network-topology', yang_type='list', is_config=True) + self.__te_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="te-tp-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-types:te-tp-id', is_config=True) + self.__te = YANGDynClass(base=te.te, is_container='container', yang_name="te", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__eth_svc = YANGDynClass(base=eth_svc.eth_svc, is_container='container', yang_name="eth-svc", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='container', is_config=True) + self.__eth_link_tp = YANGDynClass(base=eth_link_tp.eth_link_tp, is_container='container', yang_name="eth-link-tp", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-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 ['networks', 'network', 'node', 'termination-point'] + + def _get_tp_id(self): + """ + Getter method for tp_id, mapped from YANG variable /networks/network/node/termination_point/tp_id (tp-id) + + YANG Description: Termination point identifier. + """ + return self.__tp_id + + def _set_tp_id(self, v, load=False): + """ + Setter method for tp_id, mapped from YANG variable /networks/network/node/termination_point/tp_id (tp-id) + If this variable is read-only (config: false) in the + source YANG file, then _set_tp_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tp_id() directly. + + YANG Description: Termination point identifier. + """ + 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="tp-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-network-topology', defining_module='ietf-network-topology', yang_type='tp-id', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tp_id must be of a type compatible with tp-id""", + 'defined-type': "ietf-network-topology:tp-id", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="tp-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-network-topology', defining_module='ietf-network-topology', yang_type='tp-id', is_config=True)""", + }) + + self.__tp_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_tp_id(self): + self.__tp_id = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="tp-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-network-topology', defining_module='ietf-network-topology', yang_type='tp-id', is_config=True) + + + def _get_supporting_termination_point(self): + """ + Getter method for supporting_termination_point, mapped from YANG variable /networks/network/node/termination_point/supporting_termination_point (list) + + YANG Description: This list identifies any termination points on which a +given termination point depends or onto which it maps. +Those termination points will themselves be contained +in a supporting node. This dependency information can be +inferred from the dependencies between links. Therefore, +this item is not separately configurable. Hence, no +corresponding constraint needs to be articulated. +The corresponding information is simply provided by the +implementing system. + """ + return self.__supporting_termination_point + + def _set_supporting_termination_point(self, v, load=False): + """ + Setter method for supporting_termination_point, mapped from YANG variable /networks/network/node/termination_point/supporting_termination_point (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_supporting_termination_point is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_supporting_termination_point() directly. + + YANG Description: This list identifies any termination points on which a +given termination point depends or onto which it maps. +Those termination points will themselves be contained +in a supporting node. This dependency information can be +inferred from the dependencies between links. Therefore, +this item is not separately configurable. Hence, no +corresponding constraint needs to be articulated. +The corresponding information is simply provided by the +implementing system. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("network_ref node_ref tp_ref",supporting_termination_point.supporting_termination_point, yang_name="supporting-termination-point", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='network-ref node-ref tp-ref', extensions=None), is_container='list', yang_name="supporting-termination-point", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-network-topology', defining_module='ietf-network-topology', yang_type='list', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """supporting_termination_point must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("network_ref node_ref tp_ref",supporting_termination_point.supporting_termination_point, yang_name="supporting-termination-point", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='network-ref node-ref tp-ref', extensions=None), is_container='list', yang_name="supporting-termination-point", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-network-topology', defining_module='ietf-network-topology', yang_type='list', is_config=True)""", + }) + + self.__supporting_termination_point = t + if hasattr(self, '_set'): + self._set() + + def _unset_supporting_termination_point(self): + self.__supporting_termination_point = YANGDynClass(base=YANGListType("network_ref node_ref tp_ref",supporting_termination_point.supporting_termination_point, yang_name="supporting-termination-point", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='network-ref node-ref tp-ref', extensions=None), is_container='list', yang_name="supporting-termination-point", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-network-topology', defining_module='ietf-network-topology', yang_type='list', is_config=True) + + + def _get_te_tp_id(self): + """ + Getter method for te_tp_id, mapped from YANG variable /networks/network/node/termination_point/te_tp_id (te-types:te-tp-id) + + YANG Description: An identifier that uniquely identifies a TE termination +point. + """ + return self.__te_tp_id + + def _set_te_tp_id(self, v, load=False): + """ + Setter method for te_tp_id, mapped from YANG variable /networks/network/node/termination_point/te_tp_id (te-types:te-tp-id) + If this variable is read-only (config: false) in the + source YANG file, then _set_te_tp_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_te_tp_id() directly. + + YANG Description: An identifier that uniquely identifies a TE termination +point. + """ + 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),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="te-tp-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-types:te-tp-id', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """te_tp_id must be of a type compatible with te-types:te-tp-id""", + 'defined-type': "te-types:te-tp-id", + 'generated-type': """YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="te-tp-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-types:te-tp-id', is_config=True)""", + }) + + self.__te_tp_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_te_tp_id(self): + self.__te_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="te-tp-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-types:te-tp-id', is_config=True) + + + def _get_te(self): + """ + Getter method for te, mapped from YANG variable /networks/network/node/termination_point/te (container) + + YANG Description: Indicates TE support. + """ + return self.__te + + def _set_te(self, v, load=False): + """ + Setter method for te, mapped from YANG variable /networks/network/node/termination_point/te (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_te is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_te() directly. + + YANG Description: Indicates TE support. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=te.te, is_container='container', yang_name="te", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """te must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=te.te, is_container='container', yang_name="te", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__te = t + if hasattr(self, '_set'): + self._set() + + def _unset_te(self): + self.__te = YANGDynClass(base=te.te, is_container='container', yang_name="te", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_eth_svc(self): + """ + Getter method for eth_svc, mapped from YANG variable /networks/network/node/termination_point/eth_svc (container) + + YANG Description: ETH LTP Service attributes. + """ + return self.__eth_svc + + def _set_eth_svc(self, v, load=False): + """ + Setter method for eth_svc, mapped from YANG variable /networks/network/node/termination_point/eth_svc (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_eth_svc is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_eth_svc() directly. + + YANG Description: ETH LTP Service attributes. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=eth_svc.eth_svc, is_container='container', yang_name="eth-svc", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """eth_svc must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=eth_svc.eth_svc, is_container='container', yang_name="eth-svc", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='container', is_config=True)""", + }) + + self.__eth_svc = t + if hasattr(self, '_set'): + self._set() + + def _unset_eth_svc(self): + self.__eth_svc = YANGDynClass(base=eth_svc.eth_svc, is_container='container', yang_name="eth-svc", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='container', is_config=True) + + + def _get_eth_link_tp(self): + """ + Getter method for eth_link_tp, mapped from YANG variable /networks/network/node/termination_point/eth_link_tp (container) + + YANG Description: Attributes of the Ethernet Link Termination Point (LTP). + """ + return self.__eth_link_tp + + def _set_eth_link_tp(self, v, load=False): + """ + Setter method for eth_link_tp, mapped from YANG variable /networks/network/node/termination_point/eth_link_tp (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_eth_link_tp is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_eth_link_tp() directly. + + YANG Description: Attributes of the Ethernet Link Termination Point (LTP). + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=eth_link_tp.eth_link_tp, is_container='container', yang_name="eth-link-tp", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """eth_link_tp must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=eth_link_tp.eth_link_tp, is_container='container', yang_name="eth-link-tp", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='container', is_config=True)""", + }) + + self.__eth_link_tp = t + if hasattr(self, '_set'): + self._set() + + def _unset_eth_link_tp(self): + self.__eth_link_tp = YANGDynClass(base=eth_link_tp.eth_link_tp, is_container='container', yang_name="eth-link-tp", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='container', is_config=True) + + tp_id = __builtin__.property(_get_tp_id, _set_tp_id) + supporting_termination_point = __builtin__.property(_get_supporting_termination_point, _set_supporting_termination_point) + te_tp_id = __builtin__.property(_get_te_tp_id, _set_te_tp_id) + te = __builtin__.property(_get_te, _set_te) + eth_svc = __builtin__.property(_get_eth_svc, _set_eth_svc) + eth_link_tp = __builtin__.property(_get_eth_link_tp, _set_eth_link_tp) + + + _pyangbind_elements = OrderedDict([('tp_id', tp_id), ('supporting_termination_point', supporting_termination_point), ('te_tp_id', te_tp_id), ('te', te), ('eth_svc', eth_svc), ('eth_link_tp', eth_link_tp), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/termination_point/eth_link_tp/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/termination_point/eth_link_tp/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..d3de63b0fdd336fb163e7300fcca8cdb33e61fdc --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/termination_point/eth_link_tp/__init__.py @@ -0,0 +1,315 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 ingress_egress_bandwidth_profile +from . import ingress_bandwidth_profile +from . import egress_bandwidth_profile +class eth_link_tp(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/termination-point/eth-link-tp. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Attributes of the Ethernet Link Termination Point (LTP). + """ + __slots__ = ('_path_helper', '_extmethods', '__ltp_mac_address','__port_vlan_id','__maximum_frame_size','__ingress_egress_bandwidth_profile','__ingress_bandwidth_profile','__egress_bandwidth_profile',) + + _yang_name = 'eth-link-tp' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__ltp_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="ltp-mac-address", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='yang:mac-address', is_config=True) + self.__port_vlan_id = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="port-vlan-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True) + self.__maximum_frame_size = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['64 .. 65535']}), is_leaf=True, yang_name="maximum-frame-size", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint16', is_config=True) + self.__ingress_egress_bandwidth_profile = YANGDynClass(base=ingress_egress_bandwidth_profile.ingress_egress_bandwidth_profile, is_container='container', yang_name="ingress-egress-bandwidth-profile", parent=self, choice=('direction', 'symmetrical'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='container', is_config=True) + self.__ingress_bandwidth_profile = YANGDynClass(base=ingress_bandwidth_profile.ingress_bandwidth_profile, is_container='container', yang_name="ingress-bandwidth-profile", parent=self, choice=('direction', 'asymmetrical'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='container', is_config=True) + self.__egress_bandwidth_profile = YANGDynClass(base=egress_bandwidth_profile.egress_bandwidth_profile, is_container='container', yang_name="egress-bandwidth-profile", parent=self, choice=('direction', 'asymmetrical'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-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 ['networks', 'network', 'node', 'termination-point', 'eth-link-tp'] + + def _get_ltp_mac_address(self): + """ + Getter method for ltp_mac_address, mapped from YANG variable /networks/network/node/termination_point/eth_link_tp/ltp_mac_address (yang:mac-address) + + YANG Description: The MAC address of the Ethernet LTP. + """ + return self.__ltp_mac_address + + def _set_ltp_mac_address(self, v, load=False): + """ + Setter method for ltp_mac_address, mapped from YANG variable /networks/network/node/termination_point/eth_link_tp/ltp_mac_address (yang:mac-address) + If this variable is read-only (config: false) in the + source YANG file, then _set_ltp_mac_address is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_ltp_mac_address() directly. + + YANG Description: The MAC address of the Ethernet LTP. + """ + 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="ltp-mac-address", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='yang:mac-address', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """ltp_mac_address must be of a type compatible with yang:mac-address""", + 'defined-type': "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="ltp-mac-address", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='yang:mac-address', is_config=True)""", + }) + + self.__ltp_mac_address = t + if hasattr(self, '_set'): + self._set() + + def _unset_ltp_mac_address(self): + self.__ltp_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="ltp-mac-address", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='yang:mac-address', is_config=True) + + + def _get_port_vlan_id(self): + """ + Getter method for port_vlan_id, mapped from YANG variable /networks/network/node/termination_point/eth_link_tp/port_vlan_id (etht-types:vlanid) + + YANG Description: The Port VLAN ID of the Ethernet LTP. + """ + return self.__port_vlan_id + + def _set_port_vlan_id(self, v, load=False): + """ + Setter method for port_vlan_id, mapped from YANG variable /networks/network/node/termination_point/eth_link_tp/port_vlan_id (etht-types:vlanid) + If this variable is read-only (config: false) in the + source YANG file, then _set_port_vlan_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_port_vlan_id() directly. + + YANG Description: The Port VLAN ID of the Ethernet LTP. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="port-vlan-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """port_vlan_id must be of a type compatible with etht-types:vlanid""", + 'defined-type': "etht-types:vlanid", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="port-vlan-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True)""", + }) + + self.__port_vlan_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_port_vlan_id(self): + self.__port_vlan_id = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="port-vlan-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True) + + + def _get_maximum_frame_size(self): + """ + Getter method for maximum_frame_size, mapped from YANG variable /networks/network/node/termination_point/eth_link_tp/maximum_frame_size (uint16) + + YANG Description: Maximum frame size + """ + return self.__maximum_frame_size + + def _set_maximum_frame_size(self, v, load=False): + """ + Setter method for maximum_frame_size, mapped from YANG variable /networks/network/node/termination_point/eth_link_tp/maximum_frame_size (uint16) + If this variable is read-only (config: false) in the + source YANG file, then _set_maximum_frame_size is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_maximum_frame_size() directly. + + YANG Description: Maximum frame size + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['64 .. 65535']}), is_leaf=True, yang_name="maximum-frame-size", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint16', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """maximum_frame_size must be of a type compatible with uint16""", + 'defined-type': "uint16", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['64 .. 65535']}), is_leaf=True, yang_name="maximum-frame-size", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint16', is_config=True)""", + }) + + self.__maximum_frame_size = t + if hasattr(self, '_set'): + self._set() + + def _unset_maximum_frame_size(self): + self.__maximum_frame_size = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['64 .. 65535']}), is_leaf=True, yang_name="maximum-frame-size", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint16', is_config=True) + + + def _get_ingress_egress_bandwidth_profile(self): + """ + Getter method for ingress_egress_bandwidth_profile, mapped from YANG variable /networks/network/node/termination_point/eth_link_tp/ingress_egress_bandwidth_profile (container) + + YANG Description: The bandwith profile used in the ingress and egress +direction. + """ + return self.__ingress_egress_bandwidth_profile + + def _set_ingress_egress_bandwidth_profile(self, v, load=False): + """ + Setter method for ingress_egress_bandwidth_profile, mapped from YANG variable /networks/network/node/termination_point/eth_link_tp/ingress_egress_bandwidth_profile (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_ingress_egress_bandwidth_profile is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_ingress_egress_bandwidth_profile() directly. + + YANG Description: The bandwith profile used in the ingress and egress +direction. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=ingress_egress_bandwidth_profile.ingress_egress_bandwidth_profile, is_container='container', yang_name="ingress-egress-bandwidth-profile", parent=self, choice=('direction', 'symmetrical'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """ingress_egress_bandwidth_profile must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=ingress_egress_bandwidth_profile.ingress_egress_bandwidth_profile, is_container='container', yang_name="ingress-egress-bandwidth-profile", parent=self, choice=('direction', 'symmetrical'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='container', is_config=True)""", + }) + + self.__ingress_egress_bandwidth_profile = t + if hasattr(self, '_set'): + self._set() + + def _unset_ingress_egress_bandwidth_profile(self): + self.__ingress_egress_bandwidth_profile = YANGDynClass(base=ingress_egress_bandwidth_profile.ingress_egress_bandwidth_profile, is_container='container', yang_name="ingress-egress-bandwidth-profile", parent=self, choice=('direction', 'symmetrical'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='container', is_config=True) + + + def _get_ingress_bandwidth_profile(self): + """ + Getter method for ingress_bandwidth_profile, mapped from YANG variable /networks/network/node/termination_point/eth_link_tp/ingress_bandwidth_profile (container) + + YANG Description: The bandwidth profile used in the ingress direction. + """ + return self.__ingress_bandwidth_profile + + def _set_ingress_bandwidth_profile(self, v, load=False): + """ + Setter method for ingress_bandwidth_profile, mapped from YANG variable /networks/network/node/termination_point/eth_link_tp/ingress_bandwidth_profile (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_ingress_bandwidth_profile is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_ingress_bandwidth_profile() directly. + + YANG Description: The bandwidth profile used in the ingress direction. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=ingress_bandwidth_profile.ingress_bandwidth_profile, is_container='container', yang_name="ingress-bandwidth-profile", parent=self, choice=('direction', 'asymmetrical'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """ingress_bandwidth_profile must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=ingress_bandwidth_profile.ingress_bandwidth_profile, is_container='container', yang_name="ingress-bandwidth-profile", parent=self, choice=('direction', 'asymmetrical'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='container', is_config=True)""", + }) + + self.__ingress_bandwidth_profile = t + if hasattr(self, '_set'): + self._set() + + def _unset_ingress_bandwidth_profile(self): + self.__ingress_bandwidth_profile = YANGDynClass(base=ingress_bandwidth_profile.ingress_bandwidth_profile, is_container='container', yang_name="ingress-bandwidth-profile", parent=self, choice=('direction', 'asymmetrical'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='container', is_config=True) + + + def _get_egress_bandwidth_profile(self): + """ + Getter method for egress_bandwidth_profile, mapped from YANG variable /networks/network/node/termination_point/eth_link_tp/egress_bandwidth_profile (container) + + YANG Description: The bandwidth profile used in the egress direction. + """ + return self.__egress_bandwidth_profile + + def _set_egress_bandwidth_profile(self, v, load=False): + """ + Setter method for egress_bandwidth_profile, mapped from YANG variable /networks/network/node/termination_point/eth_link_tp/egress_bandwidth_profile (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_egress_bandwidth_profile is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_egress_bandwidth_profile() directly. + + YANG Description: The bandwidth profile used in the egress direction. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=egress_bandwidth_profile.egress_bandwidth_profile, is_container='container', yang_name="egress-bandwidth-profile", parent=self, choice=('direction', 'asymmetrical'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """egress_bandwidth_profile must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=egress_bandwidth_profile.egress_bandwidth_profile, is_container='container', yang_name="egress-bandwidth-profile", parent=self, choice=('direction', 'asymmetrical'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='container', is_config=True)""", + }) + + self.__egress_bandwidth_profile = t + if hasattr(self, '_set'): + self._set() + + def _unset_egress_bandwidth_profile(self): + self.__egress_bandwidth_profile = YANGDynClass(base=egress_bandwidth_profile.egress_bandwidth_profile, is_container='container', yang_name="egress-bandwidth-profile", parent=self, choice=('direction', 'asymmetrical'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='container', is_config=True) + + ltp_mac_address = __builtin__.property(_get_ltp_mac_address, _set_ltp_mac_address) + port_vlan_id = __builtin__.property(_get_port_vlan_id, _set_port_vlan_id) + maximum_frame_size = __builtin__.property(_get_maximum_frame_size, _set_maximum_frame_size) + ingress_egress_bandwidth_profile = __builtin__.property(_get_ingress_egress_bandwidth_profile, _set_ingress_egress_bandwidth_profile) + ingress_bandwidth_profile = __builtin__.property(_get_ingress_bandwidth_profile, _set_ingress_bandwidth_profile) + egress_bandwidth_profile = __builtin__.property(_get_egress_bandwidth_profile, _set_egress_bandwidth_profile) + + __choices__ = {'direction': {'symmetrical': ['ingress_egress_bandwidth_profile'], 'asymmetrical': ['ingress_bandwidth_profile', 'egress_bandwidth_profile']}} + _pyangbind_elements = OrderedDict([('ltp_mac_address', ltp_mac_address), ('port_vlan_id', port_vlan_id), ('maximum_frame_size', maximum_frame_size), ('ingress_egress_bandwidth_profile', ingress_egress_bandwidth_profile), ('ingress_bandwidth_profile', ingress_bandwidth_profile), ('egress_bandwidth_profile', egress_bandwidth_profile), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/termination_point/eth_link_tp/egress_bandwidth_profile/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/termination_point/eth_link_tp/egress_bandwidth_profile/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..f617b95776db84f7bbe980eabe8fcce0c66cd0d1 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/termination_point/eth_link_tp/egress_bandwidth_profile/__init__.py @@ -0,0 +1,355 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 egress_bandwidth_profile(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/termination-point/eth-link-tp/egress-bandwidth-profile. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: The bandwidth profile used in the egress direction. + """ + __slots__ = ('_path_helper', '_extmethods', '__bandwidth_profile_type','__CIR','__CBS','__EIR','__EBS','__color_aware','__coupling_flag',) + + _yang_name = 'egress-bandwidth-profile' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__bandwidth_profile_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'mef-10-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:mef-10-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:mef-10-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'rfc-2697-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:rfc-2697-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:rfc-2697-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'rfc-2698-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:rfc-2698-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:rfc-2698-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'rfc-4115-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:rfc-4115-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:rfc-4115-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}},), is_leaf=True, yang_name="bandwidth-profile-type", parent=self, choice=('direction', 'asymmetrical'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:bandwidth-profile-type', is_config=True) + self.__CIR = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="CIR", parent=self, choice=('direction', 'asymmetrical'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint64', is_config=True) + self.__CBS = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="CBS", parent=self, choice=('direction', 'asymmetrical'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint64', is_config=True) + self.__EIR = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="EIR", parent=self, choice=('direction', 'asymmetrical'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint64', is_config=True) + self.__EBS = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="EBS", parent=self, choice=('direction', 'asymmetrical'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint64', is_config=True) + self.__color_aware = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="color-aware", parent=self, choice=('direction', 'asymmetrical'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='boolean', is_config=True) + self.__coupling_flag = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="coupling-flag", parent=self, choice=('direction', 'asymmetrical'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', 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 ['networks', 'network', 'node', 'termination-point', 'eth-link-tp', 'egress-bandwidth-profile'] + + def _get_bandwidth_profile_type(self): + """ + Getter method for bandwidth_profile_type, mapped from YANG variable /networks/network/node/termination_point/eth_link_tp/egress_bandwidth_profile/bandwidth_profile_type (etht-types:bandwidth-profile-type) + + YANG Description: The type of bandwidth profile. + """ + return self.__bandwidth_profile_type + + def _set_bandwidth_profile_type(self, v, load=False): + """ + Setter method for bandwidth_profile_type, mapped from YANG variable /networks/network/node/termination_point/eth_link_tp/egress_bandwidth_profile/bandwidth_profile_type (etht-types:bandwidth-profile-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_bandwidth_profile_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_bandwidth_profile_type() directly. + + YANG Description: The type of bandwidth profile. + """ + 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={'mef-10-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:mef-10-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:mef-10-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'rfc-2697-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:rfc-2697-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:rfc-2697-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'rfc-2698-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:rfc-2698-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:rfc-2698-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'rfc-4115-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:rfc-4115-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:rfc-4115-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}},), is_leaf=True, yang_name="bandwidth-profile-type", parent=self, choice=('direction', 'asymmetrical'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:bandwidth-profile-type', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """bandwidth_profile_type must be of a type compatible with etht-types:bandwidth-profile-type""", + 'defined-type': "etht-types:bandwidth-profile-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'mef-10-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:mef-10-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:mef-10-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'rfc-2697-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:rfc-2697-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:rfc-2697-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'rfc-2698-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:rfc-2698-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:rfc-2698-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'rfc-4115-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:rfc-4115-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:rfc-4115-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}},), is_leaf=True, yang_name="bandwidth-profile-type", parent=self, choice=('direction', 'asymmetrical'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:bandwidth-profile-type', is_config=True)""", + }) + + self.__bandwidth_profile_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_bandwidth_profile_type(self): + self.__bandwidth_profile_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'mef-10-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:mef-10-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:mef-10-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'rfc-2697-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:rfc-2697-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:rfc-2697-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'rfc-2698-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:rfc-2698-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:rfc-2698-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'rfc-4115-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:rfc-4115-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:rfc-4115-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}},), is_leaf=True, yang_name="bandwidth-profile-type", parent=self, choice=('direction', 'asymmetrical'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:bandwidth-profile-type', is_config=True) + + + def _get_CIR(self): + """ + Getter method for CIR, mapped from YANG variable /networks/network/node/termination_point/eth_link_tp/egress_bandwidth_profile/CIR (uint64) + + YANG Description: Committed Information Rate in Kbps + """ + return self.__CIR + + def _set_CIR(self, v, load=False): + """ + Setter method for CIR, mapped from YANG variable /networks/network/node/termination_point/eth_link_tp/egress_bandwidth_profile/CIR (uint64) + If this variable is read-only (config: false) in the + source YANG file, then _set_CIR is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_CIR() directly. + + YANG Description: Committed Information Rate in Kbps + """ + 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="CIR", parent=self, choice=('direction', 'asymmetrical'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint64', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """CIR 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="CIR", parent=self, choice=('direction', 'asymmetrical'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint64', is_config=True)""", + }) + + self.__CIR = t + if hasattr(self, '_set'): + self._set() + + def _unset_CIR(self): + self.__CIR = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="CIR", parent=self, choice=('direction', 'asymmetrical'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint64', is_config=True) + + + def _get_CBS(self): + """ + Getter method for CBS, mapped from YANG variable /networks/network/node/termination_point/eth_link_tp/egress_bandwidth_profile/CBS (uint64) + + YANG Description: Committed Burst Size in in KBytes + """ + return self.__CBS + + def _set_CBS(self, v, load=False): + """ + Setter method for CBS, mapped from YANG variable /networks/network/node/termination_point/eth_link_tp/egress_bandwidth_profile/CBS (uint64) + If this variable is read-only (config: false) in the + source YANG file, then _set_CBS is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_CBS() directly. + + YANG Description: Committed Burst Size in in KBytes + """ + 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="CBS", parent=self, choice=('direction', 'asymmetrical'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint64', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """CBS 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="CBS", parent=self, choice=('direction', 'asymmetrical'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint64', is_config=True)""", + }) + + self.__CBS = t + if hasattr(self, '_set'): + self._set() + + def _unset_CBS(self): + self.__CBS = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="CBS", parent=self, choice=('direction', 'asymmetrical'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint64', is_config=True) + + + def _get_EIR(self): + """ + Getter method for EIR, mapped from YANG variable /networks/network/node/termination_point/eth_link_tp/egress_bandwidth_profile/EIR (uint64) + + YANG Description: Excess Information Rate in Kbps +In case of RFC 2698, PIR = CIR + EIR + """ + return self.__EIR + + def _set_EIR(self, v, load=False): + """ + Setter method for EIR, mapped from YANG variable /networks/network/node/termination_point/eth_link_tp/egress_bandwidth_profile/EIR (uint64) + If this variable is read-only (config: false) in the + source YANG file, then _set_EIR is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_EIR() directly. + + YANG Description: Excess Information Rate in Kbps +In case of RFC 2698, PIR = CIR + EIR + """ + 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="EIR", parent=self, choice=('direction', 'asymmetrical'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint64', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """EIR 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="EIR", parent=self, choice=('direction', 'asymmetrical'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint64', is_config=True)""", + }) + + self.__EIR = t + if hasattr(self, '_set'): + self._set() + + def _unset_EIR(self): + self.__EIR = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="EIR", parent=self, choice=('direction', 'asymmetrical'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint64', is_config=True) + + + def _get_EBS(self): + """ + Getter method for EBS, mapped from YANG variable /networks/network/node/termination_point/eth_link_tp/egress_bandwidth_profile/EBS (uint64) + + YANG Description: Excess Burst Size in KBytes. + In case of RFC 2698, PBS = CBS + EBS + """ + return self.__EBS + + def _set_EBS(self, v, load=False): + """ + Setter method for EBS, mapped from YANG variable /networks/network/node/termination_point/eth_link_tp/egress_bandwidth_profile/EBS (uint64) + If this variable is read-only (config: false) in the + source YANG file, then _set_EBS is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_EBS() directly. + + YANG Description: Excess Burst Size in KBytes. + In case of RFC 2698, PBS = CBS + EBS + """ + 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="EBS", parent=self, choice=('direction', 'asymmetrical'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint64', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """EBS 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="EBS", parent=self, choice=('direction', 'asymmetrical'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint64', is_config=True)""", + }) + + self.__EBS = t + if hasattr(self, '_set'): + self._set() + + def _unset_EBS(self): + self.__EBS = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="EBS", parent=self, choice=('direction', 'asymmetrical'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint64', is_config=True) + + + def _get_color_aware(self): + """ + Getter method for color_aware, mapped from YANG variable /networks/network/node/termination_point/eth_link_tp/egress_bandwidth_profile/color_aware (boolean) + + YANG Description: Indicates weather the color-mode is +color-aware or color-blind. + """ + return self.__color_aware + + def _set_color_aware(self, v, load=False): + """ + Setter method for color_aware, mapped from YANG variable /networks/network/node/termination_point/eth_link_tp/egress_bandwidth_profile/color_aware (boolean) + If this variable is read-only (config: false) in the + source YANG file, then _set_color_aware is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_color_aware() directly. + + YANG Description: Indicates weather the color-mode is +color-aware or color-blind. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBool, is_leaf=True, yang_name="color-aware", parent=self, choice=('direction', 'asymmetrical'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='boolean', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """color_aware must be of a type compatible with boolean""", + 'defined-type': "boolean", + 'generated-type': """YANGDynClass(base=YANGBool, is_leaf=True, yang_name="color-aware", parent=self, choice=('direction', 'asymmetrical'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='boolean', is_config=True)""", + }) + + self.__color_aware = t + if hasattr(self, '_set'): + self._set() + + def _unset_color_aware(self): + self.__color_aware = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="color-aware", parent=self, choice=('direction', 'asymmetrical'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='boolean', is_config=True) + + + def _get_coupling_flag(self): + """ + Getter method for coupling_flag, mapped from YANG variable /networks/network/node/termination_point/eth_link_tp/egress_bandwidth_profile/coupling_flag (boolean) + + YANG Description: Coupling Flag. + """ + return self.__coupling_flag + + def _set_coupling_flag(self, v, load=False): + """ + Setter method for coupling_flag, mapped from YANG variable /networks/network/node/termination_point/eth_link_tp/egress_bandwidth_profile/coupling_flag (boolean) + If this variable is read-only (config: false) in the + source YANG file, then _set_coupling_flag is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_coupling_flag() directly. + + YANG Description: Coupling Flag. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBool, is_leaf=True, yang_name="coupling-flag", parent=self, choice=('direction', 'asymmetrical'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='boolean', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """coupling_flag must be of a type compatible with boolean""", + 'defined-type': "boolean", + 'generated-type': """YANGDynClass(base=YANGBool, is_leaf=True, yang_name="coupling-flag", parent=self, choice=('direction', 'asymmetrical'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='boolean', is_config=True)""", + }) + + self.__coupling_flag = t + if hasattr(self, '_set'): + self._set() + + def _unset_coupling_flag(self): + self.__coupling_flag = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="coupling-flag", parent=self, choice=('direction', 'asymmetrical'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='boolean', is_config=True) + + bandwidth_profile_type = __builtin__.property(_get_bandwidth_profile_type, _set_bandwidth_profile_type) + CIR = __builtin__.property(_get_CIR, _set_CIR) + CBS = __builtin__.property(_get_CBS, _set_CBS) + EIR = __builtin__.property(_get_EIR, _set_EIR) + EBS = __builtin__.property(_get_EBS, _set_EBS) + color_aware = __builtin__.property(_get_color_aware, _set_color_aware) + coupling_flag = __builtin__.property(_get_coupling_flag, _set_coupling_flag) + + __choices__ = {'direction': {'asymmetrical': ['bandwidth_profile_type', 'CIR', 'CBS', 'EIR', 'EBS', 'color_aware', 'coupling_flag']}} + _pyangbind_elements = OrderedDict([('bandwidth_profile_type', bandwidth_profile_type), ('CIR', CIR), ('CBS', CBS), ('EIR', EIR), ('EBS', EBS), ('color_aware', color_aware), ('coupling_flag', coupling_flag), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/termination_point/eth_link_tp/ingress_bandwidth_profile/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/termination_point/eth_link_tp/ingress_bandwidth_profile/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..a3ec0871626ba67d06010ec0000c5c120b4fc71d --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/termination_point/eth_link_tp/ingress_bandwidth_profile/__init__.py @@ -0,0 +1,355 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 ingress_bandwidth_profile(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/termination-point/eth-link-tp/ingress-bandwidth-profile. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: The bandwidth profile used in the ingress direction. + """ + __slots__ = ('_path_helper', '_extmethods', '__bandwidth_profile_type','__CIR','__CBS','__EIR','__EBS','__color_aware','__coupling_flag',) + + _yang_name = 'ingress-bandwidth-profile' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__bandwidth_profile_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'mef-10-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:mef-10-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:mef-10-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'rfc-2697-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:rfc-2697-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:rfc-2697-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'rfc-2698-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:rfc-2698-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:rfc-2698-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'rfc-4115-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:rfc-4115-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:rfc-4115-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}},), is_leaf=True, yang_name="bandwidth-profile-type", parent=self, choice=('direction', 'asymmetrical'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:bandwidth-profile-type', is_config=True) + self.__CIR = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="CIR", parent=self, choice=('direction', 'asymmetrical'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint64', is_config=True) + self.__CBS = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="CBS", parent=self, choice=('direction', 'asymmetrical'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint64', is_config=True) + self.__EIR = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="EIR", parent=self, choice=('direction', 'asymmetrical'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint64', is_config=True) + self.__EBS = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="EBS", parent=self, choice=('direction', 'asymmetrical'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint64', is_config=True) + self.__color_aware = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="color-aware", parent=self, choice=('direction', 'asymmetrical'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='boolean', is_config=True) + self.__coupling_flag = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="coupling-flag", parent=self, choice=('direction', 'asymmetrical'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', 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 ['networks', 'network', 'node', 'termination-point', 'eth-link-tp', 'ingress-bandwidth-profile'] + + def _get_bandwidth_profile_type(self): + """ + Getter method for bandwidth_profile_type, mapped from YANG variable /networks/network/node/termination_point/eth_link_tp/ingress_bandwidth_profile/bandwidth_profile_type (etht-types:bandwidth-profile-type) + + YANG Description: The type of bandwidth profile. + """ + return self.__bandwidth_profile_type + + def _set_bandwidth_profile_type(self, v, load=False): + """ + Setter method for bandwidth_profile_type, mapped from YANG variable /networks/network/node/termination_point/eth_link_tp/ingress_bandwidth_profile/bandwidth_profile_type (etht-types:bandwidth-profile-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_bandwidth_profile_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_bandwidth_profile_type() directly. + + YANG Description: The type of bandwidth profile. + """ + 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={'mef-10-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:mef-10-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:mef-10-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'rfc-2697-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:rfc-2697-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:rfc-2697-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'rfc-2698-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:rfc-2698-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:rfc-2698-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'rfc-4115-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:rfc-4115-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:rfc-4115-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}},), is_leaf=True, yang_name="bandwidth-profile-type", parent=self, choice=('direction', 'asymmetrical'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:bandwidth-profile-type', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """bandwidth_profile_type must be of a type compatible with etht-types:bandwidth-profile-type""", + 'defined-type': "etht-types:bandwidth-profile-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'mef-10-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:mef-10-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:mef-10-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'rfc-2697-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:rfc-2697-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:rfc-2697-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'rfc-2698-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:rfc-2698-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:rfc-2698-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'rfc-4115-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:rfc-4115-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:rfc-4115-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}},), is_leaf=True, yang_name="bandwidth-profile-type", parent=self, choice=('direction', 'asymmetrical'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:bandwidth-profile-type', is_config=True)""", + }) + + self.__bandwidth_profile_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_bandwidth_profile_type(self): + self.__bandwidth_profile_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'mef-10-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:mef-10-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:mef-10-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'rfc-2697-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:rfc-2697-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:rfc-2697-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'rfc-2698-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:rfc-2698-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:rfc-2698-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'rfc-4115-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:rfc-4115-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:rfc-4115-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}},), is_leaf=True, yang_name="bandwidth-profile-type", parent=self, choice=('direction', 'asymmetrical'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:bandwidth-profile-type', is_config=True) + + + def _get_CIR(self): + """ + Getter method for CIR, mapped from YANG variable /networks/network/node/termination_point/eth_link_tp/ingress_bandwidth_profile/CIR (uint64) + + YANG Description: Committed Information Rate in Kbps + """ + return self.__CIR + + def _set_CIR(self, v, load=False): + """ + Setter method for CIR, mapped from YANG variable /networks/network/node/termination_point/eth_link_tp/ingress_bandwidth_profile/CIR (uint64) + If this variable is read-only (config: false) in the + source YANG file, then _set_CIR is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_CIR() directly. + + YANG Description: Committed Information Rate in Kbps + """ + 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="CIR", parent=self, choice=('direction', 'asymmetrical'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint64', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """CIR 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="CIR", parent=self, choice=('direction', 'asymmetrical'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint64', is_config=True)""", + }) + + self.__CIR = t + if hasattr(self, '_set'): + self._set() + + def _unset_CIR(self): + self.__CIR = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="CIR", parent=self, choice=('direction', 'asymmetrical'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint64', is_config=True) + + + def _get_CBS(self): + """ + Getter method for CBS, mapped from YANG variable /networks/network/node/termination_point/eth_link_tp/ingress_bandwidth_profile/CBS (uint64) + + YANG Description: Committed Burst Size in in KBytes + """ + return self.__CBS + + def _set_CBS(self, v, load=False): + """ + Setter method for CBS, mapped from YANG variable /networks/network/node/termination_point/eth_link_tp/ingress_bandwidth_profile/CBS (uint64) + If this variable is read-only (config: false) in the + source YANG file, then _set_CBS is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_CBS() directly. + + YANG Description: Committed Burst Size in in KBytes + """ + 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="CBS", parent=self, choice=('direction', 'asymmetrical'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint64', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """CBS 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="CBS", parent=self, choice=('direction', 'asymmetrical'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint64', is_config=True)""", + }) + + self.__CBS = t + if hasattr(self, '_set'): + self._set() + + def _unset_CBS(self): + self.__CBS = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="CBS", parent=self, choice=('direction', 'asymmetrical'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint64', is_config=True) + + + def _get_EIR(self): + """ + Getter method for EIR, mapped from YANG variable /networks/network/node/termination_point/eth_link_tp/ingress_bandwidth_profile/EIR (uint64) + + YANG Description: Excess Information Rate in Kbps +In case of RFC 2698, PIR = CIR + EIR + """ + return self.__EIR + + def _set_EIR(self, v, load=False): + """ + Setter method for EIR, mapped from YANG variable /networks/network/node/termination_point/eth_link_tp/ingress_bandwidth_profile/EIR (uint64) + If this variable is read-only (config: false) in the + source YANG file, then _set_EIR is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_EIR() directly. + + YANG Description: Excess Information Rate in Kbps +In case of RFC 2698, PIR = CIR + EIR + """ + 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="EIR", parent=self, choice=('direction', 'asymmetrical'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint64', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """EIR 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="EIR", parent=self, choice=('direction', 'asymmetrical'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint64', is_config=True)""", + }) + + self.__EIR = t + if hasattr(self, '_set'): + self._set() + + def _unset_EIR(self): + self.__EIR = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="EIR", parent=self, choice=('direction', 'asymmetrical'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint64', is_config=True) + + + def _get_EBS(self): + """ + Getter method for EBS, mapped from YANG variable /networks/network/node/termination_point/eth_link_tp/ingress_bandwidth_profile/EBS (uint64) + + YANG Description: Excess Burst Size in KBytes. + In case of RFC 2698, PBS = CBS + EBS + """ + return self.__EBS + + def _set_EBS(self, v, load=False): + """ + Setter method for EBS, mapped from YANG variable /networks/network/node/termination_point/eth_link_tp/ingress_bandwidth_profile/EBS (uint64) + If this variable is read-only (config: false) in the + source YANG file, then _set_EBS is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_EBS() directly. + + YANG Description: Excess Burst Size in KBytes. + In case of RFC 2698, PBS = CBS + EBS + """ + 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="EBS", parent=self, choice=('direction', 'asymmetrical'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint64', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """EBS 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="EBS", parent=self, choice=('direction', 'asymmetrical'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint64', is_config=True)""", + }) + + self.__EBS = t + if hasattr(self, '_set'): + self._set() + + def _unset_EBS(self): + self.__EBS = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="EBS", parent=self, choice=('direction', 'asymmetrical'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint64', is_config=True) + + + def _get_color_aware(self): + """ + Getter method for color_aware, mapped from YANG variable /networks/network/node/termination_point/eth_link_tp/ingress_bandwidth_profile/color_aware (boolean) + + YANG Description: Indicates weather the color-mode is +color-aware or color-blind. + """ + return self.__color_aware + + def _set_color_aware(self, v, load=False): + """ + Setter method for color_aware, mapped from YANG variable /networks/network/node/termination_point/eth_link_tp/ingress_bandwidth_profile/color_aware (boolean) + If this variable is read-only (config: false) in the + source YANG file, then _set_color_aware is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_color_aware() directly. + + YANG Description: Indicates weather the color-mode is +color-aware or color-blind. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBool, is_leaf=True, yang_name="color-aware", parent=self, choice=('direction', 'asymmetrical'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='boolean', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """color_aware must be of a type compatible with boolean""", + 'defined-type': "boolean", + 'generated-type': """YANGDynClass(base=YANGBool, is_leaf=True, yang_name="color-aware", parent=self, choice=('direction', 'asymmetrical'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='boolean', is_config=True)""", + }) + + self.__color_aware = t + if hasattr(self, '_set'): + self._set() + + def _unset_color_aware(self): + self.__color_aware = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="color-aware", parent=self, choice=('direction', 'asymmetrical'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='boolean', is_config=True) + + + def _get_coupling_flag(self): + """ + Getter method for coupling_flag, mapped from YANG variable /networks/network/node/termination_point/eth_link_tp/ingress_bandwidth_profile/coupling_flag (boolean) + + YANG Description: Coupling Flag. + """ + return self.__coupling_flag + + def _set_coupling_flag(self, v, load=False): + """ + Setter method for coupling_flag, mapped from YANG variable /networks/network/node/termination_point/eth_link_tp/ingress_bandwidth_profile/coupling_flag (boolean) + If this variable is read-only (config: false) in the + source YANG file, then _set_coupling_flag is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_coupling_flag() directly. + + YANG Description: Coupling Flag. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBool, is_leaf=True, yang_name="coupling-flag", parent=self, choice=('direction', 'asymmetrical'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='boolean', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """coupling_flag must be of a type compatible with boolean""", + 'defined-type': "boolean", + 'generated-type': """YANGDynClass(base=YANGBool, is_leaf=True, yang_name="coupling-flag", parent=self, choice=('direction', 'asymmetrical'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='boolean', is_config=True)""", + }) + + self.__coupling_flag = t + if hasattr(self, '_set'): + self._set() + + def _unset_coupling_flag(self): + self.__coupling_flag = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="coupling-flag", parent=self, choice=('direction', 'asymmetrical'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='boolean', is_config=True) + + bandwidth_profile_type = __builtin__.property(_get_bandwidth_profile_type, _set_bandwidth_profile_type) + CIR = __builtin__.property(_get_CIR, _set_CIR) + CBS = __builtin__.property(_get_CBS, _set_CBS) + EIR = __builtin__.property(_get_EIR, _set_EIR) + EBS = __builtin__.property(_get_EBS, _set_EBS) + color_aware = __builtin__.property(_get_color_aware, _set_color_aware) + coupling_flag = __builtin__.property(_get_coupling_flag, _set_coupling_flag) + + __choices__ = {'direction': {'asymmetrical': ['bandwidth_profile_type', 'CIR', 'CBS', 'EIR', 'EBS', 'color_aware', 'coupling_flag']}} + _pyangbind_elements = OrderedDict([('bandwidth_profile_type', bandwidth_profile_type), ('CIR', CIR), ('CBS', CBS), ('EIR', EIR), ('EBS', EBS), ('color_aware', color_aware), ('coupling_flag', coupling_flag), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/termination_point/eth_link_tp/ingress_egress_bandwidth_profile/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/termination_point/eth_link_tp/ingress_egress_bandwidth_profile/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..87d611cce246d950b52cf903fb9991bfe3f89eb7 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/termination_point/eth_link_tp/ingress_egress_bandwidth_profile/__init__.py @@ -0,0 +1,356 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 ingress_egress_bandwidth_profile(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/termination-point/eth-link-tp/ingress-egress-bandwidth-profile. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: The bandwith profile used in the ingress and egress +direction. + """ + __slots__ = ('_path_helper', '_extmethods', '__bandwidth_profile_type','__CIR','__CBS','__EIR','__EBS','__color_aware','__coupling_flag',) + + _yang_name = 'ingress-egress-bandwidth-profile' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__bandwidth_profile_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'mef-10-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:mef-10-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:mef-10-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'rfc-2697-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:rfc-2697-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:rfc-2697-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'rfc-2698-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:rfc-2698-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:rfc-2698-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'rfc-4115-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:rfc-4115-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:rfc-4115-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}},), is_leaf=True, yang_name="bandwidth-profile-type", parent=self, choice=('direction', 'symmetrical'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:bandwidth-profile-type', is_config=True) + self.__CIR = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="CIR", parent=self, choice=('direction', 'symmetrical'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint64', is_config=True) + self.__CBS = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="CBS", parent=self, choice=('direction', 'symmetrical'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint64', is_config=True) + self.__EIR = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="EIR", parent=self, choice=('direction', 'symmetrical'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint64', is_config=True) + self.__EBS = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="EBS", parent=self, choice=('direction', 'symmetrical'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint64', is_config=True) + self.__color_aware = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="color-aware", parent=self, choice=('direction', 'symmetrical'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='boolean', is_config=True) + self.__coupling_flag = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="coupling-flag", parent=self, choice=('direction', 'symmetrical'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', 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 ['networks', 'network', 'node', 'termination-point', 'eth-link-tp', 'ingress-egress-bandwidth-profile'] + + def _get_bandwidth_profile_type(self): + """ + Getter method for bandwidth_profile_type, mapped from YANG variable /networks/network/node/termination_point/eth_link_tp/ingress_egress_bandwidth_profile/bandwidth_profile_type (etht-types:bandwidth-profile-type) + + YANG Description: The type of bandwidth profile. + """ + return self.__bandwidth_profile_type + + def _set_bandwidth_profile_type(self, v, load=False): + """ + Setter method for bandwidth_profile_type, mapped from YANG variable /networks/network/node/termination_point/eth_link_tp/ingress_egress_bandwidth_profile/bandwidth_profile_type (etht-types:bandwidth-profile-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_bandwidth_profile_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_bandwidth_profile_type() directly. + + YANG Description: The type of bandwidth profile. + """ + 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={'mef-10-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:mef-10-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:mef-10-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'rfc-2697-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:rfc-2697-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:rfc-2697-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'rfc-2698-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:rfc-2698-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:rfc-2698-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'rfc-4115-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:rfc-4115-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:rfc-4115-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}},), is_leaf=True, yang_name="bandwidth-profile-type", parent=self, choice=('direction', 'symmetrical'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:bandwidth-profile-type', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """bandwidth_profile_type must be of a type compatible with etht-types:bandwidth-profile-type""", + 'defined-type': "etht-types:bandwidth-profile-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'mef-10-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:mef-10-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:mef-10-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'rfc-2697-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:rfc-2697-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:rfc-2697-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'rfc-2698-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:rfc-2698-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:rfc-2698-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'rfc-4115-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:rfc-4115-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:rfc-4115-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}},), is_leaf=True, yang_name="bandwidth-profile-type", parent=self, choice=('direction', 'symmetrical'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:bandwidth-profile-type', is_config=True)""", + }) + + self.__bandwidth_profile_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_bandwidth_profile_type(self): + self.__bandwidth_profile_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'mef-10-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:mef-10-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:mef-10-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'rfc-2697-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:rfc-2697-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:rfc-2697-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'rfc-2698-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:rfc-2698-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:rfc-2698-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'rfc-4115-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:rfc-4115-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:rfc-4115-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}},), is_leaf=True, yang_name="bandwidth-profile-type", parent=self, choice=('direction', 'symmetrical'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:bandwidth-profile-type', is_config=True) + + + def _get_CIR(self): + """ + Getter method for CIR, mapped from YANG variable /networks/network/node/termination_point/eth_link_tp/ingress_egress_bandwidth_profile/CIR (uint64) + + YANG Description: Committed Information Rate in Kbps + """ + return self.__CIR + + def _set_CIR(self, v, load=False): + """ + Setter method for CIR, mapped from YANG variable /networks/network/node/termination_point/eth_link_tp/ingress_egress_bandwidth_profile/CIR (uint64) + If this variable is read-only (config: false) in the + source YANG file, then _set_CIR is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_CIR() directly. + + YANG Description: Committed Information Rate in Kbps + """ + 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="CIR", parent=self, choice=('direction', 'symmetrical'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint64', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """CIR 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="CIR", parent=self, choice=('direction', 'symmetrical'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint64', is_config=True)""", + }) + + self.__CIR = t + if hasattr(self, '_set'): + self._set() + + def _unset_CIR(self): + self.__CIR = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="CIR", parent=self, choice=('direction', 'symmetrical'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint64', is_config=True) + + + def _get_CBS(self): + """ + Getter method for CBS, mapped from YANG variable /networks/network/node/termination_point/eth_link_tp/ingress_egress_bandwidth_profile/CBS (uint64) + + YANG Description: Committed Burst Size in in KBytes + """ + return self.__CBS + + def _set_CBS(self, v, load=False): + """ + Setter method for CBS, mapped from YANG variable /networks/network/node/termination_point/eth_link_tp/ingress_egress_bandwidth_profile/CBS (uint64) + If this variable is read-only (config: false) in the + source YANG file, then _set_CBS is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_CBS() directly. + + YANG Description: Committed Burst Size in in KBytes + """ + 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="CBS", parent=self, choice=('direction', 'symmetrical'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint64', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """CBS 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="CBS", parent=self, choice=('direction', 'symmetrical'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint64', is_config=True)""", + }) + + self.__CBS = t + if hasattr(self, '_set'): + self._set() + + def _unset_CBS(self): + self.__CBS = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="CBS", parent=self, choice=('direction', 'symmetrical'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint64', is_config=True) + + + def _get_EIR(self): + """ + Getter method for EIR, mapped from YANG variable /networks/network/node/termination_point/eth_link_tp/ingress_egress_bandwidth_profile/EIR (uint64) + + YANG Description: Excess Information Rate in Kbps +In case of RFC 2698, PIR = CIR + EIR + """ + return self.__EIR + + def _set_EIR(self, v, load=False): + """ + Setter method for EIR, mapped from YANG variable /networks/network/node/termination_point/eth_link_tp/ingress_egress_bandwidth_profile/EIR (uint64) + If this variable is read-only (config: false) in the + source YANG file, then _set_EIR is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_EIR() directly. + + YANG Description: Excess Information Rate in Kbps +In case of RFC 2698, PIR = CIR + EIR + """ + 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="EIR", parent=self, choice=('direction', 'symmetrical'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint64', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """EIR 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="EIR", parent=self, choice=('direction', 'symmetrical'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint64', is_config=True)""", + }) + + self.__EIR = t + if hasattr(self, '_set'): + self._set() + + def _unset_EIR(self): + self.__EIR = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="EIR", parent=self, choice=('direction', 'symmetrical'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint64', is_config=True) + + + def _get_EBS(self): + """ + Getter method for EBS, mapped from YANG variable /networks/network/node/termination_point/eth_link_tp/ingress_egress_bandwidth_profile/EBS (uint64) + + YANG Description: Excess Burst Size in KBytes. + In case of RFC 2698, PBS = CBS + EBS + """ + return self.__EBS + + def _set_EBS(self, v, load=False): + """ + Setter method for EBS, mapped from YANG variable /networks/network/node/termination_point/eth_link_tp/ingress_egress_bandwidth_profile/EBS (uint64) + If this variable is read-only (config: false) in the + source YANG file, then _set_EBS is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_EBS() directly. + + YANG Description: Excess Burst Size in KBytes. + In case of RFC 2698, PBS = CBS + EBS + """ + 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="EBS", parent=self, choice=('direction', 'symmetrical'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint64', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """EBS 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="EBS", parent=self, choice=('direction', 'symmetrical'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint64', is_config=True)""", + }) + + self.__EBS = t + if hasattr(self, '_set'): + self._set() + + def _unset_EBS(self): + self.__EBS = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="EBS", parent=self, choice=('direction', 'symmetrical'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint64', is_config=True) + + + def _get_color_aware(self): + """ + Getter method for color_aware, mapped from YANG variable /networks/network/node/termination_point/eth_link_tp/ingress_egress_bandwidth_profile/color_aware (boolean) + + YANG Description: Indicates weather the color-mode is +color-aware or color-blind. + """ + return self.__color_aware + + def _set_color_aware(self, v, load=False): + """ + Setter method for color_aware, mapped from YANG variable /networks/network/node/termination_point/eth_link_tp/ingress_egress_bandwidth_profile/color_aware (boolean) + If this variable is read-only (config: false) in the + source YANG file, then _set_color_aware is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_color_aware() directly. + + YANG Description: Indicates weather the color-mode is +color-aware or color-blind. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBool, is_leaf=True, yang_name="color-aware", parent=self, choice=('direction', 'symmetrical'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='boolean', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """color_aware must be of a type compatible with boolean""", + 'defined-type': "boolean", + 'generated-type': """YANGDynClass(base=YANGBool, is_leaf=True, yang_name="color-aware", parent=self, choice=('direction', 'symmetrical'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='boolean', is_config=True)""", + }) + + self.__color_aware = t + if hasattr(self, '_set'): + self._set() + + def _unset_color_aware(self): + self.__color_aware = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="color-aware", parent=self, choice=('direction', 'symmetrical'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='boolean', is_config=True) + + + def _get_coupling_flag(self): + """ + Getter method for coupling_flag, mapped from YANG variable /networks/network/node/termination_point/eth_link_tp/ingress_egress_bandwidth_profile/coupling_flag (boolean) + + YANG Description: Coupling Flag. + """ + return self.__coupling_flag + + def _set_coupling_flag(self, v, load=False): + """ + Setter method for coupling_flag, mapped from YANG variable /networks/network/node/termination_point/eth_link_tp/ingress_egress_bandwidth_profile/coupling_flag (boolean) + If this variable is read-only (config: false) in the + source YANG file, then _set_coupling_flag is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_coupling_flag() directly. + + YANG Description: Coupling Flag. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBool, is_leaf=True, yang_name="coupling-flag", parent=self, choice=('direction', 'symmetrical'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='boolean', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """coupling_flag must be of a type compatible with boolean""", + 'defined-type': "boolean", + 'generated-type': """YANGDynClass(base=YANGBool, is_leaf=True, yang_name="coupling-flag", parent=self, choice=('direction', 'symmetrical'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='boolean', is_config=True)""", + }) + + self.__coupling_flag = t + if hasattr(self, '_set'): + self._set() + + def _unset_coupling_flag(self): + self.__coupling_flag = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="coupling-flag", parent=self, choice=('direction', 'symmetrical'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='boolean', is_config=True) + + bandwidth_profile_type = __builtin__.property(_get_bandwidth_profile_type, _set_bandwidth_profile_type) + CIR = __builtin__.property(_get_CIR, _set_CIR) + CBS = __builtin__.property(_get_CBS, _set_CBS) + EIR = __builtin__.property(_get_EIR, _set_EIR) + EBS = __builtin__.property(_get_EBS, _set_EBS) + color_aware = __builtin__.property(_get_color_aware, _set_color_aware) + coupling_flag = __builtin__.property(_get_coupling_flag, _set_coupling_flag) + + __choices__ = {'direction': {'symmetrical': ['bandwidth_profile_type', 'CIR', 'CBS', 'EIR', 'EBS', 'color_aware', 'coupling_flag']}} + _pyangbind_elements = OrderedDict([('bandwidth_profile_type', bandwidth_profile_type), ('CIR', CIR), ('CBS', CBS), ('EIR', EIR), ('EBS', EBS), ('color_aware', color_aware), ('coupling_flag', coupling_flag), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/termination_point/eth_svc/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/termination_point/eth_svc/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..940aa4ef9675dada114c2f07edf2d05dae6248a7 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/termination_point/eth_svc/__init__.py @@ -0,0 +1,158 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 supported_classification +from . import supported_vlan_operations +class eth_svc(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/termination-point/eth-svc. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: ETH LTP Service attributes. + """ + __slots__ = ('_path_helper', '_extmethods', '__supported_classification','__supported_vlan_operations',) + + _yang_name = 'eth-svc' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__supported_classification = YANGDynClass(base=supported_classification.supported_classification, is_container='container', yang_name="supported-classification", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='container', is_config=True) + self.__supported_vlan_operations = YANGDynClass(base=supported_vlan_operations.supported_vlan_operations, is_container='container', yang_name="supported-vlan-operations", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-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 ['networks', 'network', 'node', 'termination-point', 'eth-svc'] + + def _get_supported_classification(self): + """ + Getter method for supported_classification, mapped from YANG variable /networks/network/node/termination_point/eth_svc/supported_classification (container) + + YANG Description: Service classification capability supported by the +Ethernet Link Termination Point (LTP). + """ + return self.__supported_classification + + def _set_supported_classification(self, v, load=False): + """ + Setter method for supported_classification, mapped from YANG variable /networks/network/node/termination_point/eth_svc/supported_classification (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_supported_classification is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_supported_classification() directly. + + YANG Description: Service classification capability supported by the +Ethernet Link Termination Point (LTP). + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=supported_classification.supported_classification, is_container='container', yang_name="supported-classification", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """supported_classification must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=supported_classification.supported_classification, is_container='container', yang_name="supported-classification", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='container', is_config=True)""", + }) + + self.__supported_classification = t + if hasattr(self, '_set'): + self._set() + + def _unset_supported_classification(self): + self.__supported_classification = YANGDynClass(base=supported_classification.supported_classification, is_container='container', yang_name="supported-classification", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='container', is_config=True) + + + def _get_supported_vlan_operations(self): + """ + Getter method for supported_vlan_operations, mapped from YANG variable /networks/network/node/termination_point/eth_svc/supported_vlan_operations (container) + + YANG Description: Reports the VLAN operations supported by the ETH LTP. + """ + return self.__supported_vlan_operations + + def _set_supported_vlan_operations(self, v, load=False): + """ + Setter method for supported_vlan_operations, mapped from YANG variable /networks/network/node/termination_point/eth_svc/supported_vlan_operations (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_supported_vlan_operations is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_supported_vlan_operations() directly. + + YANG Description: Reports the VLAN operations supported by the ETH LTP. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=supported_vlan_operations.supported_vlan_operations, is_container='container', yang_name="supported-vlan-operations", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """supported_vlan_operations must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=supported_vlan_operations.supported_vlan_operations, is_container='container', yang_name="supported-vlan-operations", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='container', is_config=True)""", + }) + + self.__supported_vlan_operations = t + if hasattr(self, '_set'): + self._set() + + def _unset_supported_vlan_operations(self): + self.__supported_vlan_operations = YANGDynClass(base=supported_vlan_operations.supported_vlan_operations, is_container='container', yang_name="supported-vlan-operations", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='container', is_config=True) + + supported_classification = __builtin__.property(_get_supported_classification, _set_supported_classification) + supported_vlan_operations = __builtin__.property(_get_supported_vlan_operations, _set_supported_vlan_operations) + + + _pyangbind_elements = OrderedDict([('supported_classification', supported_classification), ('supported_vlan_operations', supported_vlan_operations), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/termination_point/eth_svc/supported_classification/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/termination_point/eth_svc/supported_classification/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..5a244125d7f6954bc9f25d2c7c3a38d5ae19d443 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/termination_point/eth_svc/supported_classification/__init__.py @@ -0,0 +1,160 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 vlan_classification +class supported_classification(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/termination-point/eth-svc/supported-classification. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Service classification capability supported by the +Ethernet Link Termination Point (LTP). + """ + __slots__ = ('_path_helper', '_extmethods', '__port_classification','__vlan_classification',) + + _yang_name = 'supported-classification' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__port_classification = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="port-classification", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='boolean', is_config=True) + self.__vlan_classification = YANGDynClass(base=vlan_classification.vlan_classification, is_container='container', yang_name="vlan-classification", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-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 ['networks', 'network', 'node', 'termination-point', 'eth-svc', 'supported-classification'] + + def _get_port_classification(self): + """ + Getter method for port_classification, mapped from YANG variable /networks/network/node/termination_point/eth_svc/supported_classification/port_classification (boolean) + + YANG Description: Indicates that the ETH LTP support port-based service +classification. + """ + return self.__port_classification + + def _set_port_classification(self, v, load=False): + """ + Setter method for port_classification, mapped from YANG variable /networks/network/node/termination_point/eth_svc/supported_classification/port_classification (boolean) + If this variable is read-only (config: false) in the + source YANG file, then _set_port_classification is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_port_classification() directly. + + YANG Description: Indicates that the ETH LTP support port-based service +classification. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBool, is_leaf=True, yang_name="port-classification", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='boolean', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """port_classification must be of a type compatible with boolean""", + 'defined-type': "boolean", + 'generated-type': """YANGDynClass(base=YANGBool, is_leaf=True, yang_name="port-classification", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='boolean', is_config=True)""", + }) + + self.__port_classification = t + if hasattr(self, '_set'): + self._set() + + def _unset_port_classification(self): + self.__port_classification = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="port-classification", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='boolean', is_config=True) + + + def _get_vlan_classification(self): + """ + Getter method for vlan_classification, mapped from YANG variable /networks/network/node/termination_point/eth_svc/supported_classification/vlan_classification (container) + + YANG Description: Service classification capabilities based on the VLAN +tag(s) supported by the ETH LTP. + """ + return self.__vlan_classification + + def _set_vlan_classification(self, v, load=False): + """ + Setter method for vlan_classification, mapped from YANG variable /networks/network/node/termination_point/eth_svc/supported_classification/vlan_classification (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_vlan_classification is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_vlan_classification() directly. + + YANG Description: Service classification capabilities based on the VLAN +tag(s) supported by the ETH LTP. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=vlan_classification.vlan_classification, is_container='container', yang_name="vlan-classification", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """vlan_classification must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=vlan_classification.vlan_classification, is_container='container', yang_name="vlan-classification", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='container', is_config=True)""", + }) + + self.__vlan_classification = t + if hasattr(self, '_set'): + self._set() + + def _unset_vlan_classification(self): + self.__vlan_classification = YANGDynClass(base=vlan_classification.vlan_classification, is_container='container', yang_name="vlan-classification", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='container', is_config=True) + + port_classification = __builtin__.property(_get_port_classification, _set_port_classification) + vlan_classification = __builtin__.property(_get_vlan_classification, _set_vlan_classification) + + + _pyangbind_elements = OrderedDict([('port_classification', port_classification), ('vlan_classification', vlan_classification), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/termination_point/eth_svc/supported_classification/vlan_classification/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/termination_point/eth_svc/supported_classification/vlan_classification/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..fa8bc5167d0fbc7e572ff4b3b30c94d83f39f033 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/termination_point/eth_svc/supported_classification/vlan_classification/__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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 outer_tag +from . import second_tag +class vlan_classification(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/termination-point/eth-svc/supported-classification/vlan-classification. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Service classification capabilities based on the VLAN +tag(s) supported by the ETH LTP. + """ + __slots__ = ('_path_helper', '_extmethods', '__vlan_tag_classification','__outer_tag','__second_tag',) + + _yang_name = 'vlan-classification' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__vlan_tag_classification = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="vlan-tag-classification", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='boolean', is_config=True) + self.__outer_tag = YANGDynClass(base=outer_tag.outer_tag, is_container='container', yang_name="outer-tag", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='container', is_config=True) + self.__second_tag = YANGDynClass(base=second_tag.second_tag, is_container='container', yang_name="second-tag", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-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 ['networks', 'network', 'node', 'termination-point', 'eth-svc', 'supported-classification', 'vlan-classification'] + + def _get_vlan_tag_classification(self): + """ + Getter method for vlan_tag_classification, mapped from YANG variable /networks/network/node/termination_point/eth_svc/supported_classification/vlan_classification/vlan_tag_classification (boolean) + + YANG Description: Indicates that the ETH LTP supports VLAN service +classification. + """ + return self.__vlan_tag_classification + + def _set_vlan_tag_classification(self, v, load=False): + """ + Setter method for vlan_tag_classification, mapped from YANG variable /networks/network/node/termination_point/eth_svc/supported_classification/vlan_classification/vlan_tag_classification (boolean) + If this variable is read-only (config: false) in the + source YANG file, then _set_vlan_tag_classification is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_vlan_tag_classification() directly. + + YANG Description: Indicates that the ETH LTP supports VLAN service +classification. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBool, is_leaf=True, yang_name="vlan-tag-classification", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='boolean', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """vlan_tag_classification must be of a type compatible with boolean""", + 'defined-type': "boolean", + 'generated-type': """YANGDynClass(base=YANGBool, is_leaf=True, yang_name="vlan-tag-classification", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='boolean', is_config=True)""", + }) + + self.__vlan_tag_classification = t + if hasattr(self, '_set'): + self._set() + + def _unset_vlan_tag_classification(self): + self.__vlan_tag_classification = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="vlan-tag-classification", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='boolean', is_config=True) + + + def _get_outer_tag(self): + """ + Getter method for outer_tag, mapped from YANG variable /networks/network/node/termination_point/eth_svc/supported_classification/vlan_classification/outer_tag (container) + + YANG Description: Service classification capabilities based on the outer +VLAN tag, supported by the ETH LTP. + """ + return self.__outer_tag + + def _set_outer_tag(self, v, load=False): + """ + Setter method for outer_tag, mapped from YANG variable /networks/network/node/termination_point/eth_svc/supported_classification/vlan_classification/outer_tag (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_outer_tag is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_outer_tag() directly. + + YANG Description: Service classification capabilities based on the outer +VLAN tag, supported by the ETH LTP. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=outer_tag.outer_tag, is_container='container', yang_name="outer-tag", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """outer_tag must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=outer_tag.outer_tag, is_container='container', yang_name="outer-tag", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='container', is_config=True)""", + }) + + self.__outer_tag = t + if hasattr(self, '_set'): + self._set() + + def _unset_outer_tag(self): + self.__outer_tag = YANGDynClass(base=outer_tag.outer_tag, is_container='container', yang_name="outer-tag", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='container', is_config=True) + + + def _get_second_tag(self): + """ + Getter method for second_tag, mapped from YANG variable /networks/network/node/termination_point/eth_svc/supported_classification/vlan_classification/second_tag (container) + + YANG Description: Service classification capabilities based on the second +VLAN tag, supported by the ETH LTP. + """ + return self.__second_tag + + def _set_second_tag(self, v, load=False): + """ + Setter method for second_tag, mapped from YANG variable /networks/network/node/termination_point/eth_svc/supported_classification/vlan_classification/second_tag (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_second_tag is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_second_tag() directly. + + YANG Description: Service classification capabilities based on the second +VLAN tag, supported by the ETH LTP. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=second_tag.second_tag, is_container='container', yang_name="second-tag", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """second_tag must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=second_tag.second_tag, is_container='container', yang_name="second-tag", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='container', is_config=True)""", + }) + + self.__second_tag = t + if hasattr(self, '_set'): + self._set() + + def _unset_second_tag(self): + self.__second_tag = YANGDynClass(base=second_tag.second_tag, is_container='container', yang_name="second-tag", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='container', is_config=True) + + vlan_tag_classification = __builtin__.property(_get_vlan_tag_classification, _set_vlan_tag_classification) + outer_tag = __builtin__.property(_get_outer_tag, _set_outer_tag) + second_tag = __builtin__.property(_get_second_tag, _set_second_tag) + + + _pyangbind_elements = OrderedDict([('vlan_tag_classification', vlan_tag_classification), ('outer_tag', outer_tag), ('second_tag', second_tag), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/termination_point/eth_svc/supported_classification/vlan_classification/outer_tag/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/termination_point/eth_svc/supported_classification/vlan_classification/outer_tag/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..83e6e19a283bf7dba975d3a2c460eff16791b659 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/termination_point/eth_svc/supported_classification/vlan_classification/outer_tag/__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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 outer_tag(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/termination-point/eth-svc/supported-classification/vlan-classification/outer-tag. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Service classification capabilities based on the outer +VLAN tag, supported by the ETH LTP. + """ + __slots__ = ('_path_helper', '_extmethods', '__supported_tag_types','__vlan_bundling','__vlan_range',) + + _yang_name = 'outer-tag' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__supported_tag_types = YANGDynClass(unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'classify-c-vlan': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:classify-c-vlan': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:classify-c-vlan': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'classify-s-vlan': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:classify-s-vlan': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:classify-s-vlan': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'classify-s-or-c-vlan': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:classify-s-or-c-vlan': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:classify-s-or-c-vlan': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}},)), is_leaf=False, yang_name="supported-tag-types", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:eth-tag-classify', is_config=True) + self.__vlan_bundling = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="vlan-bundling", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='boolean', is_config=True) + self.__vlan_range = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="vlan-range", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vid-range-type', 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 ['networks', 'network', 'node', 'termination-point', 'eth-svc', 'supported-classification', 'vlan-classification', 'outer-tag'] + + def _get_supported_tag_types(self): + """ + Getter method for supported_tag_types, mapped from YANG variable /networks/network/node/termination_point/eth_svc/supported_classification/vlan_classification/outer_tag/supported_tag_types (etht-types:eth-tag-classify) + + YANG Description: List of VLAN tag types that can be used for the VLAN +classification. In case VLAN classification is not +supported, the list is empty. + """ + return self.__supported_tag_types + + def _set_supported_tag_types(self, v, load=False): + """ + Setter method for supported_tag_types, mapped from YANG variable /networks/network/node/termination_point/eth_svc/supported_classification/vlan_classification/outer_tag/supported_tag_types (etht-types:eth-tag-classify) + If this variable is read-only (config: false) in the + source YANG file, then _set_supported_tag_types is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_supported_tag_types() directly. + + YANG Description: List of VLAN tag types that can be used for the VLAN +classification. In case VLAN classification is not +supported, the list is empty. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'classify-c-vlan': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:classify-c-vlan': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:classify-c-vlan': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'classify-s-vlan': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:classify-s-vlan': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:classify-s-vlan': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'classify-s-or-c-vlan': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:classify-s-or-c-vlan': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:classify-s-or-c-vlan': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}},)), is_leaf=False, yang_name="supported-tag-types", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:eth-tag-classify', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """supported_tag_types must be of a type compatible with etht-types:eth-tag-classify""", + 'defined-type': "etht-types:eth-tag-classify", + 'generated-type': """YANGDynClass(unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'classify-c-vlan': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:classify-c-vlan': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:classify-c-vlan': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'classify-s-vlan': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:classify-s-vlan': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:classify-s-vlan': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'classify-s-or-c-vlan': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:classify-s-or-c-vlan': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:classify-s-or-c-vlan': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}},)), is_leaf=False, yang_name="supported-tag-types", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:eth-tag-classify', is_config=True)""", + }) + + self.__supported_tag_types = t + if hasattr(self, '_set'): + self._set() + + def _unset_supported_tag_types(self): + self.__supported_tag_types = YANGDynClass(unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'classify-c-vlan': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:classify-c-vlan': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:classify-c-vlan': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'classify-s-vlan': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:classify-s-vlan': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:classify-s-vlan': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'classify-s-or-c-vlan': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:classify-s-or-c-vlan': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:classify-s-or-c-vlan': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}},)), is_leaf=False, yang_name="supported-tag-types", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:eth-tag-classify', is_config=True) + + + def _get_vlan_bundling(self): + """ + Getter method for vlan_bundling, mapped from YANG variable /networks/network/node/termination_point/eth_svc/supported_classification/vlan_classification/outer_tag/vlan_bundling (boolean) + + YANG Description: In case VLAN classification is supported, indicates whether +VLAN bundling classification is also supported. + """ + return self.__vlan_bundling + + def _set_vlan_bundling(self, v, load=False): + """ + Setter method for vlan_bundling, mapped from YANG variable /networks/network/node/termination_point/eth_svc/supported_classification/vlan_classification/outer_tag/vlan_bundling (boolean) + If this variable is read-only (config: false) in the + source YANG file, then _set_vlan_bundling is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_vlan_bundling() directly. + + YANG Description: In case VLAN classification is supported, indicates whether +VLAN bundling classification is also supported. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBool, is_leaf=True, yang_name="vlan-bundling", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='boolean', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """vlan_bundling must be of a type compatible with boolean""", + 'defined-type': "boolean", + 'generated-type': """YANGDynClass(base=YANGBool, is_leaf=True, yang_name="vlan-bundling", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='boolean', is_config=True)""", + }) + + self.__vlan_bundling = t + if hasattr(self, '_set'): + self._set() + + def _unset_vlan_bundling(self): + self.__vlan_bundling = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="vlan-bundling", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='boolean', is_config=True) + + + def _get_vlan_range(self): + """ + Getter method for vlan_range, mapped from YANG variable /networks/network/node/termination_point/eth_svc/supported_classification/vlan_classification/outer_tag/vlan_range (etht-types:vid-range-type) + + YANG Description: In case VLAN classification is supported, indicates the +of available VLAN ID values. + """ + return self.__vlan_range + + def _set_vlan_range(self, v, load=False): + """ + Setter method for vlan_range, mapped from YANG variable /networks/network/node/termination_point/eth_svc/supported_classification/vlan_classification/outer_tag/vlan_range (etht-types:vid-range-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_vlan_range is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_vlan_range() directly. + + YANG Description: In case VLAN classification is supported, indicates the +of available VLAN ID values. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="vlan-range", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vid-range-type', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """vlan_range must be of a type compatible with etht-types:vid-range-type""", + 'defined-type': "etht-types:vid-range-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="vlan-range", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vid-range-type', is_config=True)""", + }) + + self.__vlan_range = t + if hasattr(self, '_set'): + self._set() + + def _unset_vlan_range(self): + self.__vlan_range = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="vlan-range", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vid-range-type', is_config=True) + + supported_tag_types = __builtin__.property(_get_supported_tag_types, _set_supported_tag_types) + vlan_bundling = __builtin__.property(_get_vlan_bundling, _set_vlan_bundling) + vlan_range = __builtin__.property(_get_vlan_range, _set_vlan_range) + + + _pyangbind_elements = OrderedDict([('supported_tag_types', supported_tag_types), ('vlan_bundling', vlan_bundling), ('vlan_range', vlan_range), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/termination_point/eth_svc/supported_classification/vlan_classification/second_tag/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/termination_point/eth_svc/supported_classification/vlan_classification/second_tag/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..98c6f24622bbb21c4721caa5f47b926b56bb48b2 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/termination_point/eth_svc/supported_classification/vlan_classification/second_tag/__init__.py @@ -0,0 +1,243 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 second_tag(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/termination-point/eth-svc/supported-classification/vlan-classification/second-tag. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Service classification capabilities based on the second +VLAN tag, supported by the ETH LTP. + """ + __slots__ = ('_path_helper', '_extmethods', '__second_tag_classification','__supported_tag_types','__vlan_bundling','__vlan_range',) + + _yang_name = 'second-tag' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__second_tag_classification = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="second-tag-classification", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='boolean', is_config=True) + self.__supported_tag_types = YANGDynClass(unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'classify-c-vlan': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:classify-c-vlan': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:classify-c-vlan': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'classify-s-vlan': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:classify-s-vlan': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:classify-s-vlan': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'classify-s-or-c-vlan': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:classify-s-or-c-vlan': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:classify-s-or-c-vlan': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}},)), is_leaf=False, yang_name="supported-tag-types", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:eth-tag-classify', is_config=True) + self.__vlan_bundling = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="vlan-bundling", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='boolean', is_config=True) + self.__vlan_range = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="vlan-range", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vid-range-type', 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 ['networks', 'network', 'node', 'termination-point', 'eth-svc', 'supported-classification', 'vlan-classification', 'second-tag'] + + def _get_second_tag_classification(self): + """ + Getter method for second_tag_classification, mapped from YANG variable /networks/network/node/termination_point/eth_svc/supported_classification/vlan_classification/second_tag/second_tag_classification (boolean) + + YANG Description: Indicates that the ETH LTP support VLAN service +classification based on the second VLAN tag. + """ + return self.__second_tag_classification + + def _set_second_tag_classification(self, v, load=False): + """ + Setter method for second_tag_classification, mapped from YANG variable /networks/network/node/termination_point/eth_svc/supported_classification/vlan_classification/second_tag/second_tag_classification (boolean) + If this variable is read-only (config: false) in the + source YANG file, then _set_second_tag_classification is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_second_tag_classification() directly. + + YANG Description: Indicates that the ETH LTP support VLAN service +classification based on the second VLAN tag. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBool, is_leaf=True, yang_name="second-tag-classification", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='boolean', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """second_tag_classification must be of a type compatible with boolean""", + 'defined-type': "boolean", + 'generated-type': """YANGDynClass(base=YANGBool, is_leaf=True, yang_name="second-tag-classification", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='boolean', is_config=True)""", + }) + + self.__second_tag_classification = t + if hasattr(self, '_set'): + self._set() + + def _unset_second_tag_classification(self): + self.__second_tag_classification = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="second-tag-classification", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='boolean', is_config=True) + + + def _get_supported_tag_types(self): + """ + Getter method for supported_tag_types, mapped from YANG variable /networks/network/node/termination_point/eth_svc/supported_classification/vlan_classification/second_tag/supported_tag_types (etht-types:eth-tag-classify) + + YANG Description: List of VLAN tag types that can be used for the VLAN +classification. In case VLAN classification is not +supported, the list is empty. + """ + return self.__supported_tag_types + + def _set_supported_tag_types(self, v, load=False): + """ + Setter method for supported_tag_types, mapped from YANG variable /networks/network/node/termination_point/eth_svc/supported_classification/vlan_classification/second_tag/supported_tag_types (etht-types:eth-tag-classify) + If this variable is read-only (config: false) in the + source YANG file, then _set_supported_tag_types is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_supported_tag_types() directly. + + YANG Description: List of VLAN tag types that can be used for the VLAN +classification. In case VLAN classification is not +supported, the list is empty. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'classify-c-vlan': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:classify-c-vlan': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:classify-c-vlan': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'classify-s-vlan': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:classify-s-vlan': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:classify-s-vlan': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'classify-s-or-c-vlan': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:classify-s-or-c-vlan': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:classify-s-or-c-vlan': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}},)), is_leaf=False, yang_name="supported-tag-types", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:eth-tag-classify', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """supported_tag_types must be of a type compatible with etht-types:eth-tag-classify""", + 'defined-type': "etht-types:eth-tag-classify", + 'generated-type': """YANGDynClass(unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'classify-c-vlan': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:classify-c-vlan': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:classify-c-vlan': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'classify-s-vlan': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:classify-s-vlan': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:classify-s-vlan': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'classify-s-or-c-vlan': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:classify-s-or-c-vlan': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:classify-s-or-c-vlan': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}},)), is_leaf=False, yang_name="supported-tag-types", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:eth-tag-classify', is_config=True)""", + }) + + self.__supported_tag_types = t + if hasattr(self, '_set'): + self._set() + + def _unset_supported_tag_types(self): + self.__supported_tag_types = YANGDynClass(unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'classify-c-vlan': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:classify-c-vlan': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:classify-c-vlan': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'classify-s-vlan': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:classify-s-vlan': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:classify-s-vlan': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'classify-s-or-c-vlan': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:classify-s-or-c-vlan': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:classify-s-or-c-vlan': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}},)), is_leaf=False, yang_name="supported-tag-types", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:eth-tag-classify', is_config=True) + + + def _get_vlan_bundling(self): + """ + Getter method for vlan_bundling, mapped from YANG variable /networks/network/node/termination_point/eth_svc/supported_classification/vlan_classification/second_tag/vlan_bundling (boolean) + + YANG Description: In case VLAN classification is supported, indicates whether +VLAN bundling classification is also supported. + """ + return self.__vlan_bundling + + def _set_vlan_bundling(self, v, load=False): + """ + Setter method for vlan_bundling, mapped from YANG variable /networks/network/node/termination_point/eth_svc/supported_classification/vlan_classification/second_tag/vlan_bundling (boolean) + If this variable is read-only (config: false) in the + source YANG file, then _set_vlan_bundling is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_vlan_bundling() directly. + + YANG Description: In case VLAN classification is supported, indicates whether +VLAN bundling classification is also supported. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBool, is_leaf=True, yang_name="vlan-bundling", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='boolean', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """vlan_bundling must be of a type compatible with boolean""", + 'defined-type': "boolean", + 'generated-type': """YANGDynClass(base=YANGBool, is_leaf=True, yang_name="vlan-bundling", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='boolean', is_config=True)""", + }) + + self.__vlan_bundling = t + if hasattr(self, '_set'): + self._set() + + def _unset_vlan_bundling(self): + self.__vlan_bundling = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="vlan-bundling", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='boolean', is_config=True) + + + def _get_vlan_range(self): + """ + Getter method for vlan_range, mapped from YANG variable /networks/network/node/termination_point/eth_svc/supported_classification/vlan_classification/second_tag/vlan_range (etht-types:vid-range-type) + + YANG Description: In case VLAN classification is supported, indicates the +of available VLAN ID values. + """ + return self.__vlan_range + + def _set_vlan_range(self, v, load=False): + """ + Setter method for vlan_range, mapped from YANG variable /networks/network/node/termination_point/eth_svc/supported_classification/vlan_classification/second_tag/vlan_range (etht-types:vid-range-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_vlan_range is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_vlan_range() directly. + + YANG Description: In case VLAN classification is supported, indicates the +of available VLAN ID values. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="vlan-range", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vid-range-type', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """vlan_range must be of a type compatible with etht-types:vid-range-type""", + 'defined-type': "etht-types:vid-range-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="vlan-range", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vid-range-type', is_config=True)""", + }) + + self.__vlan_range = t + if hasattr(self, '_set'): + self._set() + + def _unset_vlan_range(self): + self.__vlan_range = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="vlan-range", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vid-range-type', is_config=True) + + second_tag_classification = __builtin__.property(_get_second_tag_classification, _set_second_tag_classification) + supported_tag_types = __builtin__.property(_get_supported_tag_types, _set_supported_tag_types) + vlan_bundling = __builtin__.property(_get_vlan_bundling, _set_vlan_bundling) + vlan_range = __builtin__.property(_get_vlan_range, _set_vlan_range) + + + _pyangbind_elements = OrderedDict([('second_tag_classification', second_tag_classification), ('supported_tag_types', supported_tag_types), ('vlan_bundling', vlan_bundling), ('vlan_range', vlan_range), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/termination_point/eth_svc/supported_vlan_operations/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/termination_point/eth_svc/supported_vlan_operations/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..9b5cfc5b2abbecc54199df5db879f059fbd6fdfc --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/termination_point/eth_svc/supported_vlan_operations/__init__.py @@ -0,0 +1,240 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 vlan_pop +from . import vlan_push +class supported_vlan_operations(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/termination-point/eth-svc/supported-vlan-operations. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Reports the VLAN operations supported by the ETH LTP. + """ + __slots__ = ('_path_helper', '_extmethods', '__asymmetrical_operations','__transparent_vlan_operations','__vlan_pop','__vlan_push',) + + _yang_name = 'supported-vlan-operations' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__asymmetrical_operations = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="asymmetrical-operations", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='boolean', is_config=True) + self.__transparent_vlan_operations = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="transparent-vlan-operations", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='boolean', is_config=True) + self.__vlan_pop = YANGDynClass(base=vlan_pop.vlan_pop, is_container='container', yang_name="vlan-pop", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='container', is_config=True) + self.__vlan_push = YANGDynClass(base=vlan_push.vlan_push, is_container='container', yang_name="vlan-push", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-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 ['networks', 'network', 'node', 'termination-point', 'eth-svc', 'supported-vlan-operations'] + + def _get_asymmetrical_operations(self): + """ + Getter method for asymmetrical_operations, mapped from YANG variable /networks/network/node/termination_point/eth_svc/supported_vlan_operations/asymmetrical_operations (boolean) + + YANG Description: Indicates whether the ETH LTP supports also asymmetrical +VLAN operations.It is assumed that symmetrical VLAN +operations are alwyas supported. + """ + return self.__asymmetrical_operations + + def _set_asymmetrical_operations(self, v, load=False): + """ + Setter method for asymmetrical_operations, mapped from YANG variable /networks/network/node/termination_point/eth_svc/supported_vlan_operations/asymmetrical_operations (boolean) + If this variable is read-only (config: false) in the + source YANG file, then _set_asymmetrical_operations is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_asymmetrical_operations() directly. + + YANG Description: Indicates whether the ETH LTP supports also asymmetrical +VLAN operations.It is assumed that symmetrical VLAN +operations are alwyas supported. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBool, is_leaf=True, yang_name="asymmetrical-operations", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='boolean', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """asymmetrical_operations must be of a type compatible with boolean""", + 'defined-type': "boolean", + 'generated-type': """YANGDynClass(base=YANGBool, is_leaf=True, yang_name="asymmetrical-operations", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='boolean', is_config=True)""", + }) + + self.__asymmetrical_operations = t + if hasattr(self, '_set'): + self._set() + + def _unset_asymmetrical_operations(self): + self.__asymmetrical_operations = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="asymmetrical-operations", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='boolean', is_config=True) + + + def _get_transparent_vlan_operations(self): + """ + Getter method for transparent_vlan_operations, mapped from YANG variable /networks/network/node/termination_point/eth_svc/supported_vlan_operations/transparent_vlan_operations (boolean) + + YANG Description: Indicates that the ETH LTP supports transparent +operations. + """ + return self.__transparent_vlan_operations + + def _set_transparent_vlan_operations(self, v, load=False): + """ + Setter method for transparent_vlan_operations, mapped from YANG variable /networks/network/node/termination_point/eth_svc/supported_vlan_operations/transparent_vlan_operations (boolean) + If this variable is read-only (config: false) in the + source YANG file, then _set_transparent_vlan_operations is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_transparent_vlan_operations() directly. + + YANG Description: Indicates that the ETH LTP supports transparent +operations. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBool, is_leaf=True, yang_name="transparent-vlan-operations", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='boolean', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """transparent_vlan_operations must be of a type compatible with boolean""", + 'defined-type': "boolean", + 'generated-type': """YANGDynClass(base=YANGBool, is_leaf=True, yang_name="transparent-vlan-operations", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='boolean', is_config=True)""", + }) + + self.__transparent_vlan_operations = t + if hasattr(self, '_set'): + self._set() + + def _unset_transparent_vlan_operations(self): + self.__transparent_vlan_operations = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="transparent-vlan-operations", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='boolean', is_config=True) + + + def _get_vlan_pop(self): + """ + Getter method for vlan_pop, mapped from YANG variable /networks/network/node/termination_point/eth_svc/supported_vlan_operations/vlan_pop (container) + + YANG Description: Indicates VLAN pop or swap operations capabilities. + """ + return self.__vlan_pop + + def _set_vlan_pop(self, v, load=False): + """ + Setter method for vlan_pop, mapped from YANG variable /networks/network/node/termination_point/eth_svc/supported_vlan_operations/vlan_pop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_vlan_pop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_vlan_pop() directly. + + YANG Description: Indicates VLAN pop or swap operations capabilities. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=vlan_pop.vlan_pop, is_container='container', yang_name="vlan-pop", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """vlan_pop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=vlan_pop.vlan_pop, is_container='container', yang_name="vlan-pop", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='container', is_config=True)""", + }) + + self.__vlan_pop = t + if hasattr(self, '_set'): + self._set() + + def _unset_vlan_pop(self): + self.__vlan_pop = YANGDynClass(base=vlan_pop.vlan_pop, is_container='container', yang_name="vlan-pop", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='container', is_config=True) + + + def _get_vlan_push(self): + """ + Getter method for vlan_push, mapped from YANG variable /networks/network/node/termination_point/eth_svc/supported_vlan_operations/vlan_push (container) + + YANG Description: Indicates VLAN push or swap operations capabilities. + """ + return self.__vlan_push + + def _set_vlan_push(self, v, load=False): + """ + Setter method for vlan_push, mapped from YANG variable /networks/network/node/termination_point/eth_svc/supported_vlan_operations/vlan_push (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_vlan_push is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_vlan_push() directly. + + YANG Description: Indicates VLAN push or swap operations capabilities. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=vlan_push.vlan_push, is_container='container', yang_name="vlan-push", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """vlan_push must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=vlan_push.vlan_push, is_container='container', yang_name="vlan-push", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='container', is_config=True)""", + }) + + self.__vlan_push = t + if hasattr(self, '_set'): + self._set() + + def _unset_vlan_push(self): + self.__vlan_push = YANGDynClass(base=vlan_push.vlan_push, is_container='container', yang_name="vlan-push", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='container', is_config=True) + + asymmetrical_operations = __builtin__.property(_get_asymmetrical_operations, _set_asymmetrical_operations) + transparent_vlan_operations = __builtin__.property(_get_transparent_vlan_operations, _set_transparent_vlan_operations) + vlan_pop = __builtin__.property(_get_vlan_pop, _set_vlan_pop) + vlan_push = __builtin__.property(_get_vlan_push, _set_vlan_push) + + + _pyangbind_elements = OrderedDict([('asymmetrical_operations', asymmetrical_operations), ('transparent_vlan_operations', transparent_vlan_operations), ('vlan_pop', vlan_pop), ('vlan_push', vlan_push), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/termination_point/eth_svc/supported_vlan_operations/vlan_pop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/termination_point/eth_svc/supported_vlan_operations/vlan_pop/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..bfeb46635eb64c076046b58e2b9b5a6c61ae314a --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/termination_point/eth_svc/supported_vlan_operations/vlan_pop/__init__.py @@ -0,0 +1,158 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 vlan_pop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/termination-point/eth-svc/supported-vlan-operations/vlan-pop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Indicates VLAN pop or swap operations capabilities. + """ + __slots__ = ('_path_helper', '_extmethods', '__vlan_pop_operations','__max_pop_tags',) + + _yang_name = 'vlan-pop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__vlan_pop_operations = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="vlan-pop-operations", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='boolean', is_config=True) + self.__max_pop_tags = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['1..2']}), is_leaf=True, yang_name="max-pop-tags", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', 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 ['networks', 'network', 'node', 'termination-point', 'eth-svc', 'supported-vlan-operations', 'vlan-pop'] + + def _get_vlan_pop_operations(self): + """ + Getter method for vlan_pop_operations, mapped from YANG variable /networks/network/node/termination_point/eth_svc/supported_vlan_operations/vlan_pop/vlan_pop_operations (boolean) + + YANG Description: Indicates that the ETH LTP supports VLAN pop or +swap operations. + """ + return self.__vlan_pop_operations + + def _set_vlan_pop_operations(self, v, load=False): + """ + Setter method for vlan_pop_operations, mapped from YANG variable /networks/network/node/termination_point/eth_svc/supported_vlan_operations/vlan_pop/vlan_pop_operations (boolean) + If this variable is read-only (config: false) in the + source YANG file, then _set_vlan_pop_operations is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_vlan_pop_operations() directly. + + YANG Description: Indicates that the ETH LTP supports VLAN pop or +swap operations. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBool, is_leaf=True, yang_name="vlan-pop-operations", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='boolean', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """vlan_pop_operations must be of a type compatible with boolean""", + 'defined-type': "boolean", + 'generated-type': """YANGDynClass(base=YANGBool, is_leaf=True, yang_name="vlan-pop-operations", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='boolean', is_config=True)""", + }) + + self.__vlan_pop_operations = t + if hasattr(self, '_set'): + self._set() + + def _unset_vlan_pop_operations(self): + self.__vlan_pop_operations = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="vlan-pop-operations", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='boolean', is_config=True) + + + def _get_max_pop_tags(self): + """ + Getter method for max_pop_tags, mapped from YANG variable /networks/network/node/termination_point/eth_svc/supported_vlan_operations/vlan_pop/max_pop_tags (uint8) + + YANG Description: Indicates the maximum number of tags that can be +popped/swapped. + """ + return self.__max_pop_tags + + def _set_max_pop_tags(self, v, load=False): + """ + Setter method for max_pop_tags, mapped from YANG variable /networks/network/node/termination_point/eth_svc/supported_vlan_operations/vlan_pop/max_pop_tags (uint8) + If this variable is read-only (config: false) in the + source YANG file, then _set_max_pop_tags is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_max_pop_tags() directly. + + YANG Description: Indicates the maximum number of tags that can be +popped/swapped. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['1..2']}), is_leaf=True, yang_name="max-pop-tags", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint8', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """max_pop_tags must be of a type compatible with uint8""", + 'defined-type': "uint8", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['1..2']}), is_leaf=True, yang_name="max-pop-tags", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint8', is_config=True)""", + }) + + self.__max_pop_tags = t + if hasattr(self, '_set'): + self._set() + + def _unset_max_pop_tags(self): + self.__max_pop_tags = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['1..2']}), is_leaf=True, yang_name="max-pop-tags", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint8', is_config=True) + + vlan_pop_operations = __builtin__.property(_get_vlan_pop_operations, _set_vlan_pop_operations) + max_pop_tags = __builtin__.property(_get_max_pop_tags, _set_max_pop_tags) + + + _pyangbind_elements = OrderedDict([('vlan_pop_operations', vlan_pop_operations), ('max_pop_tags', max_pop_tags), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/termination_point/eth_svc/supported_vlan_operations/vlan_push/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/termination_point/eth_svc/supported_vlan_operations/vlan_push/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..256af6aa1ae152bd499817fa829dc8f9554e2e36 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/termination_point/eth_svc/supported_vlan_operations/vlan_push/__init__.py @@ -0,0 +1,201 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 outer_tag +from . import second_tag +class vlan_push(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/termination-point/eth-svc/supported-vlan-operations/vlan-push. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Indicates VLAN push or swap operations capabilities. + """ + __slots__ = ('_path_helper', '_extmethods', '__vlan_push_operation','__outer_tag','__second_tag',) + + _yang_name = 'vlan-push' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__vlan_push_operation = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="vlan-push-operation", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='boolean', is_config=True) + self.__outer_tag = YANGDynClass(base=outer_tag.outer_tag, is_container='container', yang_name="outer-tag", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='container', is_config=True) + self.__second_tag = YANGDynClass(base=second_tag.second_tag, is_container='container', yang_name="second-tag", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-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 ['networks', 'network', 'node', 'termination-point', 'eth-svc', 'supported-vlan-operations', 'vlan-push'] + + def _get_vlan_push_operation(self): + """ + Getter method for vlan_push_operation, mapped from YANG variable /networks/network/node/termination_point/eth_svc/supported_vlan_operations/vlan_push/vlan_push_operation (boolean) + + YANG Description: Indicates that the ETH LTP supports VLAN push or +swap operations. + """ + return self.__vlan_push_operation + + def _set_vlan_push_operation(self, v, load=False): + """ + Setter method for vlan_push_operation, mapped from YANG variable /networks/network/node/termination_point/eth_svc/supported_vlan_operations/vlan_push/vlan_push_operation (boolean) + If this variable is read-only (config: false) in the + source YANG file, then _set_vlan_push_operation is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_vlan_push_operation() directly. + + YANG Description: Indicates that the ETH LTP supports VLAN push or +swap operations. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBool, is_leaf=True, yang_name="vlan-push-operation", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='boolean', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """vlan_push_operation must be of a type compatible with boolean""", + 'defined-type': "boolean", + 'generated-type': """YANGDynClass(base=YANGBool, is_leaf=True, yang_name="vlan-push-operation", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='boolean', is_config=True)""", + }) + + self.__vlan_push_operation = t + if hasattr(self, '_set'): + self._set() + + def _unset_vlan_push_operation(self): + self.__vlan_push_operation = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="vlan-push-operation", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='boolean', is_config=True) + + + def _get_outer_tag(self): + """ + Getter method for outer_tag, mapped from YANG variable /networks/network/node/termination_point/eth_svc/supported_vlan_operations/vlan_push/outer_tag (container) + + YANG Description: Indicates the supported VLAN operation capabilities +on the outer VLAN tag. + """ + return self.__outer_tag + + def _set_outer_tag(self, v, load=False): + """ + Setter method for outer_tag, mapped from YANG variable /networks/network/node/termination_point/eth_svc/supported_vlan_operations/vlan_push/outer_tag (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_outer_tag is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_outer_tag() directly. + + YANG Description: Indicates the supported VLAN operation capabilities +on the outer VLAN tag. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=outer_tag.outer_tag, is_container='container', yang_name="outer-tag", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """outer_tag must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=outer_tag.outer_tag, is_container='container', yang_name="outer-tag", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='container', is_config=True)""", + }) + + self.__outer_tag = t + if hasattr(self, '_set'): + self._set() + + def _unset_outer_tag(self): + self.__outer_tag = YANGDynClass(base=outer_tag.outer_tag, is_container='container', yang_name="outer-tag", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='container', is_config=True) + + + def _get_second_tag(self): + """ + Getter method for second_tag, mapped from YANG variable /networks/network/node/termination_point/eth_svc/supported_vlan_operations/vlan_push/second_tag (container) + + YANG Description: Indicates the supported VLAN operation capabilities +on the second VLAN tag. + """ + return self.__second_tag + + def _set_second_tag(self, v, load=False): + """ + Setter method for second_tag, mapped from YANG variable /networks/network/node/termination_point/eth_svc/supported_vlan_operations/vlan_push/second_tag (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_second_tag is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_second_tag() directly. + + YANG Description: Indicates the supported VLAN operation capabilities +on the second VLAN tag. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=second_tag.second_tag, is_container='container', yang_name="second-tag", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """second_tag must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=second_tag.second_tag, is_container='container', yang_name="second-tag", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='container', is_config=True)""", + }) + + self.__second_tag = t + if hasattr(self, '_set'): + self._set() + + def _unset_second_tag(self): + self.__second_tag = YANGDynClass(base=second_tag.second_tag, is_container='container', yang_name="second-tag", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='container', is_config=True) + + vlan_push_operation = __builtin__.property(_get_vlan_push_operation, _set_vlan_push_operation) + outer_tag = __builtin__.property(_get_outer_tag, _set_outer_tag) + second_tag = __builtin__.property(_get_second_tag, _set_second_tag) + + + _pyangbind_elements = OrderedDict([('vlan_push_operation', vlan_push_operation), ('outer_tag', outer_tag), ('second_tag', second_tag), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/termination_point/eth_svc/supported_vlan_operations/vlan_push/outer_tag/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/termination_point/eth_svc/supported_vlan_operations/vlan_push/outer_tag/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..c468dbf17f31906148b09a9ee4841a4d241bdc91 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/termination_point/eth_svc/supported_vlan_operations/vlan_push/outer_tag/__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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 outer_tag(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/termination-point/eth-svc/supported-vlan-operations/vlan-push/outer-tag. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Indicates the supported VLAN operation capabilities +on the outer VLAN tag. + """ + __slots__ = ('_path_helper', '_extmethods', '__supported_tag_types','__vlan_range',) + + _yang_name = 'outer-tag' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__supported_tag_types = YANGDynClass(unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 's-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:s-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:s-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}},)), is_leaf=False, yang_name="supported-tag-types", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:eth-tag-type', is_config=True) + self.__vlan_range = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="vlan-range", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vid-range-type', 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 ['networks', 'network', 'node', 'termination-point', 'eth-svc', 'supported-vlan-operations', 'vlan-push', 'outer-tag'] + + def _get_supported_tag_types(self): + """ + Getter method for supported_tag_types, mapped from YANG variable /networks/network/node/termination_point/eth_svc/supported_vlan_operations/vlan_push/outer_tag/supported_tag_types (etht-types:eth-tag-type) + + YANG Description: List of VLAN tag types that can be used to push or swap a +VLAN tag. In case VLAN push/swap is not supported, the list +is empty. + """ + return self.__supported_tag_types + + def _set_supported_tag_types(self, v, load=False): + """ + Setter method for supported_tag_types, mapped from YANG variable /networks/network/node/termination_point/eth_svc/supported_vlan_operations/vlan_push/outer_tag/supported_tag_types (etht-types:eth-tag-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_supported_tag_types is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_supported_tag_types() directly. + + YANG Description: List of VLAN tag types that can be used to push or swap a +VLAN tag. In case VLAN push/swap is not supported, the list +is empty. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 's-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:s-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:s-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}},)), is_leaf=False, yang_name="supported-tag-types", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:eth-tag-type', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """supported_tag_types must be of a type compatible with etht-types:eth-tag-type""", + 'defined-type': "etht-types:eth-tag-type", + 'generated-type': """YANGDynClass(unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 's-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:s-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:s-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}},)), is_leaf=False, yang_name="supported-tag-types", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:eth-tag-type', is_config=True)""", + }) + + self.__supported_tag_types = t + if hasattr(self, '_set'): + self._set() + + def _unset_supported_tag_types(self): + self.__supported_tag_types = YANGDynClass(unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 's-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:s-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:s-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}},)), is_leaf=False, yang_name="supported-tag-types", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:eth-tag-type', is_config=True) + + + def _get_vlan_range(self): + """ + Getter method for vlan_range, mapped from YANG variable /networks/network/node/termination_point/eth_svc/supported_vlan_operations/vlan_push/outer_tag/vlan_range (etht-types:vid-range-type) + + YANG Description: In case VLAN push/swap operation is supported, the range +of available VLAN ID values. + """ + return self.__vlan_range + + def _set_vlan_range(self, v, load=False): + """ + Setter method for vlan_range, mapped from YANG variable /networks/network/node/termination_point/eth_svc/supported_vlan_operations/vlan_push/outer_tag/vlan_range (etht-types:vid-range-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_vlan_range is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_vlan_range() directly. + + YANG Description: In case VLAN push/swap operation is supported, the range +of available VLAN ID values. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="vlan-range", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vid-range-type', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """vlan_range must be of a type compatible with etht-types:vid-range-type""", + 'defined-type': "etht-types:vid-range-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="vlan-range", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vid-range-type', is_config=True)""", + }) + + self.__vlan_range = t + if hasattr(self, '_set'): + self._set() + + def _unset_vlan_range(self): + self.__vlan_range = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="vlan-range", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vid-range-type', is_config=True) + + supported_tag_types = __builtin__.property(_get_supported_tag_types, _set_supported_tag_types) + vlan_range = __builtin__.property(_get_vlan_range, _set_vlan_range) + + + _pyangbind_elements = OrderedDict([('supported_tag_types', supported_tag_types), ('vlan_range', vlan_range), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/termination_point/eth_svc/supported_vlan_operations/vlan_push/second_tag/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/termination_point/eth_svc/supported_vlan_operations/vlan_push/second_tag/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..33831d33113ddb21f1e4625e8b02aebb973d1fc8 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/termination_point/eth_svc/supported_vlan_operations/vlan_push/second_tag/__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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 second_tag(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/termination-point/eth-svc/supported-vlan-operations/vlan-push/second-tag. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Indicates the supported VLAN operation capabilities +on the second VLAN tag. + """ + __slots__ = ('_path_helper', '_extmethods', '__push_second_tag','__supported_tag_types','__vlan_range',) + + _yang_name = 'second-tag' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__push_second_tag = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="push-second-tag", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='boolean', is_config=True) + self.__supported_tag_types = YANGDynClass(unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 's-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:s-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:s-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}},)), is_leaf=False, yang_name="supported-tag-types", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:eth-tag-type', is_config=True) + self.__vlan_range = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="vlan-range", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vid-range-type', 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 ['networks', 'network', 'node', 'termination-point', 'eth-svc', 'supported-vlan-operations', 'vlan-push', 'second-tag'] + + def _get_push_second_tag(self): + """ + Getter method for push_second_tag, mapped from YANG variable /networks/network/node/termination_point/eth_svc/supported_vlan_operations/vlan_push/second_tag/push_second_tag (boolean) + + YANG Description: Indicates that the ETH LTP supports VLAN push or swap +operations for the second VLAN tag. + """ + return self.__push_second_tag + + def _set_push_second_tag(self, v, load=False): + """ + Setter method for push_second_tag, mapped from YANG variable /networks/network/node/termination_point/eth_svc/supported_vlan_operations/vlan_push/second_tag/push_second_tag (boolean) + If this variable is read-only (config: false) in the + source YANG file, then _set_push_second_tag is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_push_second_tag() directly. + + YANG Description: Indicates that the ETH LTP supports VLAN push or swap +operations for the second VLAN tag. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBool, is_leaf=True, yang_name="push-second-tag", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='boolean', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """push_second_tag must be of a type compatible with boolean""", + 'defined-type': "boolean", + 'generated-type': """YANGDynClass(base=YANGBool, is_leaf=True, yang_name="push-second-tag", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='boolean', is_config=True)""", + }) + + self.__push_second_tag = t + if hasattr(self, '_set'): + self._set() + + def _unset_push_second_tag(self): + self.__push_second_tag = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="push-second-tag", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='boolean', is_config=True) + + + def _get_supported_tag_types(self): + """ + Getter method for supported_tag_types, mapped from YANG variable /networks/network/node/termination_point/eth_svc/supported_vlan_operations/vlan_push/second_tag/supported_tag_types (etht-types:eth-tag-type) + + YANG Description: List of VLAN tag types that can be used to push or swap a +VLAN tag. In case VLAN push/swap is not supported, the list +is empty. + """ + return self.__supported_tag_types + + def _set_supported_tag_types(self, v, load=False): + """ + Setter method for supported_tag_types, mapped from YANG variable /networks/network/node/termination_point/eth_svc/supported_vlan_operations/vlan_push/second_tag/supported_tag_types (etht-types:eth-tag-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_supported_tag_types is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_supported_tag_types() directly. + + YANG Description: List of VLAN tag types that can be used to push or swap a +VLAN tag. In case VLAN push/swap is not supported, the list +is empty. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 's-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:s-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:s-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}},)), is_leaf=False, yang_name="supported-tag-types", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:eth-tag-type', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """supported_tag_types must be of a type compatible with etht-types:eth-tag-type""", + 'defined-type': "etht-types:eth-tag-type", + 'generated-type': """YANGDynClass(unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 's-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:s-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:s-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}},)), is_leaf=False, yang_name="supported-tag-types", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:eth-tag-type', is_config=True)""", + }) + + self.__supported_tag_types = t + if hasattr(self, '_set'): + self._set() + + def _unset_supported_tag_types(self): + self.__supported_tag_types = YANGDynClass(unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 's-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:s-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:s-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}},)), is_leaf=False, yang_name="supported-tag-types", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:eth-tag-type', is_config=True) + + + def _get_vlan_range(self): + """ + Getter method for vlan_range, mapped from YANG variable /networks/network/node/termination_point/eth_svc/supported_vlan_operations/vlan_push/second_tag/vlan_range (etht-types:vid-range-type) + + YANG Description: In case VLAN push/swap operation is supported, the range +of available VLAN ID values. + """ + return self.__vlan_range + + def _set_vlan_range(self, v, load=False): + """ + Setter method for vlan_range, mapped from YANG variable /networks/network/node/termination_point/eth_svc/supported_vlan_operations/vlan_push/second_tag/vlan_range (etht-types:vid-range-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_vlan_range is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_vlan_range() directly. + + YANG Description: In case VLAN push/swap operation is supported, the range +of available VLAN ID values. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="vlan-range", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vid-range-type', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """vlan_range must be of a type compatible with etht-types:vid-range-type""", + 'defined-type': "etht-types:vid-range-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="vlan-range", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vid-range-type', is_config=True)""", + }) + + self.__vlan_range = t + if hasattr(self, '_set'): + self._set() + + def _unset_vlan_range(self): + self.__vlan_range = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="vlan-range", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vid-range-type', is_config=True) + + push_second_tag = __builtin__.property(_get_push_second_tag, _set_push_second_tag) + supported_tag_types = __builtin__.property(_get_supported_tag_types, _set_supported_tag_types) + vlan_range = __builtin__.property(_get_vlan_range, _set_vlan_range) + + + _pyangbind_elements = OrderedDict([('push_second_tag', push_second_tag), ('supported_tag_types', supported_tag_types), ('vlan_range', vlan_range), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/termination_point/supporting_termination_point/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/termination_point/supporting_termination_point/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..cb2a897c8b0ccb1e091bf4907d42c7e6c3a32f11 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/termination_point/supporting_termination_point/__init__.py @@ -0,0 +1,222 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 supporting_termination_point(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/termination-point/supporting-termination-point. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: This list identifies any termination points on which a +given termination point depends or onto which it maps. +Those termination points will themselves be contained +in a supporting node. This dependency information can be +inferred from the dependencies between links. Therefore, +this item is not separately configurable. Hence, no +corresponding constraint needs to be articulated. +The corresponding information is simply provided by the +implementing system. + """ + __slots__ = ('_path_helper', '_extmethods', '__network_ref','__node_ref','__tp_ref',) + + _yang_name = 'supporting-termination-point' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__network_ref = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="network-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-network-topology', defining_module='ietf-network-topology', yang_type='leafref', is_config=True) + self.__node_ref = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="node-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-network-topology', defining_module='ietf-network-topology', yang_type='leafref', is_config=True) + self.__tp_ref = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="tp-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-network-topology', defining_module='ietf-network-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 ['networks', 'network', 'node', 'termination-point', 'supporting-termination-point'] + + def _get_network_ref(self): + """ + Getter method for network_ref, mapped from YANG variable /networks/network/node/termination_point/supporting_termination_point/network_ref (leafref) + + YANG Description: This leaf identifies in which topology the +supporting termination point is present. + """ + return self.__network_ref + + def _set_network_ref(self, v, load=False): + """ + Setter method for network_ref, mapped from YANG variable /networks/network/node/termination_point/supporting_termination_point/network_ref (leafref) + If this variable is read-only (config: false) in the + source YANG file, then _set_network_ref is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_network_ref() directly. + + YANG Description: This leaf identifies in which topology the +supporting termination point is present. + """ + 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="network-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-network-topology', defining_module='ietf-network-topology', yang_type='leafref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """network_ref must be of a type compatible with leafref""", + 'defined-type': "leafref", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="network-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-network-topology', defining_module='ietf-network-topology', yang_type='leafref', is_config=True)""", + }) + + self.__network_ref = t + if hasattr(self, '_set'): + self._set() + + def _unset_network_ref(self): + self.__network_ref = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="network-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-network-topology', defining_module='ietf-network-topology', yang_type='leafref', is_config=True) + + + def _get_node_ref(self): + """ + Getter method for node_ref, mapped from YANG variable /networks/network/node/termination_point/supporting_termination_point/node_ref (leafref) + + YANG Description: This leaf identifies in which node the supporting +termination point is present. + """ + return self.__node_ref + + def _set_node_ref(self, v, load=False): + """ + Setter method for node_ref, mapped from YANG variable /networks/network/node/termination_point/supporting_termination_point/node_ref (leafref) + If this variable is read-only (config: false) in the + source YANG file, then _set_node_ref is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_node_ref() directly. + + YANG Description: This leaf identifies in which node the supporting +termination point is present. + """ + 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-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-network-topology', defining_module='ietf-network-topology', yang_type='leafref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """node_ref must be of a type compatible with leafref""", + 'defined-type': "leafref", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="node-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-network-topology', defining_module='ietf-network-topology', yang_type='leafref', is_config=True)""", + }) + + self.__node_ref = t + if hasattr(self, '_set'): + self._set() + + def _unset_node_ref(self): + self.__node_ref = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="node-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-network-topology', defining_module='ietf-network-topology', yang_type='leafref', is_config=True) + + + def _get_tp_ref(self): + """ + Getter method for tp_ref, mapped from YANG variable /networks/network/node/termination_point/supporting_termination_point/tp_ref (leafref) + + YANG Description: Reference to the underlay node (the underlay node must +be in a different topology). + """ + return self.__tp_ref + + def _set_tp_ref(self, v, load=False): + """ + Setter method for tp_ref, mapped from YANG variable /networks/network/node/termination_point/supporting_termination_point/tp_ref (leafref) + If this variable is read-only (config: false) in the + source YANG file, then _set_tp_ref is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tp_ref() directly. + + YANG Description: Reference to the underlay node (the underlay node must +be in a different topology). + """ + 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="tp-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-network-topology', defining_module='ietf-network-topology', yang_type='leafref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tp_ref must be of a type compatible with leafref""", + 'defined-type': "leafref", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="tp-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-network-topology', defining_module='ietf-network-topology', yang_type='leafref', is_config=True)""", + }) + + self.__tp_ref = t + if hasattr(self, '_set'): + self._set() + + def _unset_tp_ref(self): + self.__tp_ref = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="tp-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-network-topology', defining_module='ietf-network-topology', yang_type='leafref', is_config=True) + + network_ref = __builtin__.property(_get_network_ref, _set_network_ref) + node_ref = __builtin__.property(_get_node_ref, _set_node_ref) + tp_ref = __builtin__.property(_get_tp_ref, _set_tp_ref) + + + _pyangbind_elements = OrderedDict([('network_ref', network_ref), ('node_ref', node_ref), ('tp_ref', tp_ref), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/termination_point/te/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/termination_point/te/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..4c7ab6264207b95a60a64c48b47c0bcc373b6e22 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/termination_point/te/__init__.py @@ -0,0 +1,445 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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_switching_capability +from . import geolocation +from . import otn_ltp +from . import client_svc +class te(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/termination-point/te. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Indicates TE support. + """ + __slots__ = ('_path_helper', '_extmethods', '__admin_status','__name','__interface_switching_capability','__inter_domain_plug_id','__inter_layer_lock_id','__oper_status','__geolocation','__otn_ltp','__client_svc',) + + _yang_name = 'te' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__admin_status = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'up': {}, 'down': {}, 'testing': {}, 'preparing-maintenance': {}, 'maintenance': {}, 'unknown': {}},), is_leaf=True, yang_name="admin-status", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-types:te-admin-status', is_config=True) + 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='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=True) + self.__interface_switching_capability = YANGDynClass(base=YANGListType("switching_capability encoding",interface_switching_capability.interface_switching_capability, yang_name="interface-switching-capability", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='switching-capability encoding', extensions=None), is_container='list', yang_name="interface-switching-capability", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + self.__inter_domain_plug_id = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="inter-domain-plug-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='binary', is_config=True) + self.__inter_layer_lock_id = YANGDynClass(unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32)), is_leaf=False, yang_name="inter-layer-lock-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + self.__oper_status = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'up': {}, 'down': {}, 'testing': {}, 'preparing-maintenance': {}, 'maintenance': {}, 'unknown': {}},), is_leaf=True, yang_name="oper-status", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-types:te-oper-status', is_config=False) + self.__geolocation = YANGDynClass(base=geolocation.geolocation, is_container='container', yang_name="geolocation", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__otn_ltp = YANGDynClass(base=otn_ltp.otn_ltp, is_container='container', yang_name="otn-ltp", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + self.__client_svc = YANGDynClass(base=client_svc.client_svc, is_container='container', yang_name="client-svc", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-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 ['networks', 'network', 'node', 'termination-point', 'te'] + + def _get_admin_status(self): + """ + Getter method for admin_status, mapped from YANG variable /networks/network/node/termination_point/te/admin_status (te-types:te-admin-status) + + YANG Description: The administrative state of the LTP. + """ + return self.__admin_status + + def _set_admin_status(self, v, load=False): + """ + Setter method for admin_status, mapped from YANG variable /networks/network/node/termination_point/te/admin_status (te-types:te-admin-status) + 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 administrative state of the LTP. + """ + 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': {}, 'preparing-maintenance': {}, 'maintenance': {}, 'unknown': {}},), is_leaf=True, yang_name="admin-status", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-types:te-admin-status', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """admin_status must be of a type compatible with te-types:te-admin-status""", + 'defined-type': "te-types:te-admin-status", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'up': {}, 'down': {}, 'testing': {}, 'preparing-maintenance': {}, 'maintenance': {}, 'unknown': {}},), is_leaf=True, yang_name="admin-status", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-types:te-admin-status', is_config=True)""", + }) + + 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': {}, 'preparing-maintenance': {}, 'maintenance': {}, 'unknown': {}},), is_leaf=True, yang_name="admin-status", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-types:te-admin-status', is_config=True) + + + def _get_name(self): + """ + Getter method for name, mapped from YANG variable /networks/network/node/termination_point/te/name (string) + + YANG Description: A descriptive name for the LTP. + """ + return self.__name + + def _set_name(self, v, load=False): + """ + Setter method for name, mapped from YANG variable /networks/network/node/termination_point/te/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: A descriptive name for the LTP. + """ + 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='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', 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='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', 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='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=True) + + + def _get_interface_switching_capability(self): + """ + Getter method for interface_switching_capability, mapped from YANG variable /networks/network/node/termination_point/te/interface_switching_capability (list) + + YANG Description: List of ISCDs for this link. + """ + return self.__interface_switching_capability + + def _set_interface_switching_capability(self, v, load=False): + """ + Setter method for interface_switching_capability, mapped from YANG variable /networks/network/node/termination_point/te/interface_switching_capability (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_interface_switching_capability is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_interface_switching_capability() directly. + + YANG Description: List of ISCDs for this link. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("switching_capability encoding",interface_switching_capability.interface_switching_capability, yang_name="interface-switching-capability", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='switching-capability encoding', extensions=None), is_container='list', yang_name="interface-switching-capability", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """interface_switching_capability must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("switching_capability encoding",interface_switching_capability.interface_switching_capability, yang_name="interface-switching-capability", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='switching-capability encoding', extensions=None), is_container='list', yang_name="interface-switching-capability", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True)""", + }) + + self.__interface_switching_capability = t + if hasattr(self, '_set'): + self._set() + + def _unset_interface_switching_capability(self): + self.__interface_switching_capability = YANGDynClass(base=YANGListType("switching_capability encoding",interface_switching_capability.interface_switching_capability, yang_name="interface-switching-capability", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='switching-capability encoding', extensions=None), is_container='list', yang_name="interface-switching-capability", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + + + def _get_inter_domain_plug_id(self): + """ + Getter method for inter_domain_plug_id, mapped from YANG variable /networks/network/node/termination_point/te/inter_domain_plug_id (binary) + + YANG Description: A network-wide unique number that identifies on the +network a connection that supports a given inter-domain +TE link. This is a more flexible alternative to specifying +'remote-te-node-id' and 'remote-te-link-tp-id' on a TE link +when the provider either does not know 'remote-te-node-id' +and 'remote-te-link-tp-id' or needs to give the client the +flexibility to mix and match multiple topologies. + """ + return self.__inter_domain_plug_id + + def _set_inter_domain_plug_id(self, v, load=False): + """ + Setter method for inter_domain_plug_id, mapped from YANG variable /networks/network/node/termination_point/te/inter_domain_plug_id (binary) + If this variable is read-only (config: false) in the + source YANG file, then _set_inter_domain_plug_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_inter_domain_plug_id() directly. + + YANG Description: A network-wide unique number that identifies on the +network a connection that supports a given inter-domain +TE link. This is a more flexible alternative to specifying +'remote-te-node-id' and 'remote-te-link-tp-id' on a TE link +when the provider either does not know 'remote-te-node-id' +and 'remote-te-link-tp-id' or needs to give the client the +flexibility to mix and match multiple topologies. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBinary, is_leaf=True, yang_name="inter-domain-plug-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='binary', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """inter_domain_plug_id must be of a type compatible with binary""", + 'defined-type': "binary", + 'generated-type': """YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="inter-domain-plug-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='binary', is_config=True)""", + }) + + self.__inter_domain_plug_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_inter_domain_plug_id(self): + self.__inter_domain_plug_id = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="inter-domain-plug-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='binary', is_config=True) + + + def _get_inter_layer_lock_id(self): + """ + Getter method for inter_layer_lock_id, mapped from YANG variable /networks/network/node/termination_point/te/inter_layer_lock_id (uint32) + + YANG Description: Inter-layer lock ID, used for path computation in a TE +topology covering multiple layers or multiple regions. + """ + return self.__inter_layer_lock_id + + def _set_inter_layer_lock_id(self, v, load=False): + """ + Setter method for inter_layer_lock_id, mapped from YANG variable /networks/network/node/termination_point/te/inter_layer_lock_id (uint32) + If this variable is read-only (config: false) in the + source YANG file, then _set_inter_layer_lock_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_inter_layer_lock_id() directly. + + YANG Description: Inter-layer lock ID, used for path computation in a TE +topology covering multiple layers or multiple regions. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32)), is_leaf=False, yang_name="inter-layer-lock-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """inter_layer_lock_id must be of a type compatible with uint32""", + 'defined-type': "uint32", + 'generated-type': """YANGDynClass(unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32)), is_leaf=False, yang_name="inter-layer-lock-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True)""", + }) + + self.__inter_layer_lock_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_inter_layer_lock_id(self): + self.__inter_layer_lock_id = YANGDynClass(unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32)), is_leaf=False, yang_name="inter-layer-lock-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + + + def _get_oper_status(self): + """ + Getter method for oper_status, mapped from YANG variable /networks/network/node/termination_point/te/oper_status (te-types:te-oper-status) + + YANG Description: The current operational state of the LTP. + """ + return self.__oper_status + + def _set_oper_status(self, v, load=False): + """ + Setter method for oper_status, mapped from YANG variable /networks/network/node/termination_point/te/oper_status (te-types:te-oper-status) + 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 LTP. + """ + 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': {}, 'preparing-maintenance': {}, 'maintenance': {}, 'unknown': {}},), is_leaf=True, yang_name="oper-status", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-types:te-oper-status', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """oper_status must be of a type compatible with te-types:te-oper-status""", + 'defined-type': "te-types:te-oper-status", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'up': {}, 'down': {}, 'testing': {}, 'preparing-maintenance': {}, 'maintenance': {}, 'unknown': {}},), is_leaf=True, yang_name="oper-status", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-types:te-oper-status', 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': {}, 'down': {}, 'testing': {}, 'preparing-maintenance': {}, 'maintenance': {}, 'unknown': {}},), is_leaf=True, yang_name="oper-status", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-types:te-oper-status', is_config=False) + + + def _get_geolocation(self): + """ + Getter method for geolocation, mapped from YANG variable /networks/network/node/termination_point/te/geolocation (container) + + YANG Description: Contains a GPS location. + """ + return self.__geolocation + + def _set_geolocation(self, v, load=False): + """ + Setter method for geolocation, mapped from YANG variable /networks/network/node/termination_point/te/geolocation (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_geolocation is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_geolocation() directly. + + YANG Description: Contains a GPS location. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=geolocation.geolocation, is_container='container', yang_name="geolocation", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """geolocation must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=geolocation.geolocation, is_container='container', yang_name="geolocation", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__geolocation = t + if hasattr(self, '_set'): + self._set() + + def _unset_geolocation(self): + self.__geolocation = YANGDynClass(base=geolocation.geolocation, is_container='container', yang_name="geolocation", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_otn_ltp(self): + """ + Getter method for otn_ltp, mapped from YANG variable /networks/network/node/termination_point/te/otn_ltp (container) + + YANG Description: Attributes of the OTN Link Termination Point (LTP). + """ + return self.__otn_ltp + + def _set_otn_ltp(self, v, load=False): + """ + Setter method for otn_ltp, mapped from YANG variable /networks/network/node/termination_point/te/otn_ltp (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_otn_ltp is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_otn_ltp() directly. + + YANG Description: Attributes of the OTN Link Termination Point (LTP). + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=otn_ltp.otn_ltp, is_container='container', yang_name="otn-ltp", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """otn_ltp must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=otn_ltp.otn_ltp, is_container='container', yang_name="otn-ltp", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True)""", + }) + + self.__otn_ltp = t + if hasattr(self, '_set'): + self._set() + + def _unset_otn_ltp(self): + self.__otn_ltp = YANGDynClass(base=otn_ltp.otn_ltp, is_container='container', yang_name="otn-ltp", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + + + def _get_client_svc(self): + """ + Getter method for client_svc, mapped from YANG variable /networks/network/node/termination_point/te/client_svc (container) + + YANG Description: OTN LTP Service attributes. + """ + return self.__client_svc + + def _set_client_svc(self, v, load=False): + """ + Setter method for client_svc, mapped from YANG variable /networks/network/node/termination_point/te/client_svc (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_client_svc is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_client_svc() directly. + + YANG Description: OTN LTP Service attributes. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=client_svc.client_svc, is_container='container', yang_name="client-svc", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """client_svc must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=client_svc.client_svc, is_container='container', yang_name="client-svc", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True)""", + }) + + self.__client_svc = t + if hasattr(self, '_set'): + self._set() + + def _unset_client_svc(self): + self.__client_svc = YANGDynClass(base=client_svc.client_svc, is_container='container', yang_name="client-svc", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + + admin_status = __builtin__.property(_get_admin_status, _set_admin_status) + name = __builtin__.property(_get_name, _set_name) + interface_switching_capability = __builtin__.property(_get_interface_switching_capability, _set_interface_switching_capability) + inter_domain_plug_id = __builtin__.property(_get_inter_domain_plug_id, _set_inter_domain_plug_id) + inter_layer_lock_id = __builtin__.property(_get_inter_layer_lock_id, _set_inter_layer_lock_id) + oper_status = __builtin__.property(_get_oper_status) + geolocation = __builtin__.property(_get_geolocation) + otn_ltp = __builtin__.property(_get_otn_ltp, _set_otn_ltp) + client_svc = __builtin__.property(_get_client_svc, _set_client_svc) + + + _pyangbind_elements = OrderedDict([('admin_status', admin_status), ('name', name), ('interface_switching_capability', interface_switching_capability), ('inter_domain_plug_id', inter_domain_plug_id), ('inter_layer_lock_id', inter_layer_lock_id), ('oper_status', oper_status), ('geolocation', geolocation), ('otn_ltp', otn_ltp), ('client_svc', client_svc), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/termination_point/te/client_svc/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/termination_point/te/client_svc/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..6dd0b2c132eb9356cec14f32df2042636d14d032 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/termination_point/te/client_svc/__init__.py @@ -0,0 +1,115 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 client_svc(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/termination-point/te/client-svc. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: OTN LTP Service attributes. + """ + __slots__ = ('_path_helper', '_extmethods', '__supported_client_signal',) + + _yang_name = 'client-svc' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__supported_client_signal = YANGDynClass(unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ETH-1Gb': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ETH-1Gb': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ETH-1Gb': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ETH-10Gb-LAN': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ETH-10Gb-LAN': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ETH-10Gb-LAN': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ETH-10Gb-WAN': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ETH-10Gb-WAN': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ETH-10Gb-WAN': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ETH-40Gb': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ETH-40Gb': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ETH-40Gb': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ETH-100Gb': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ETH-100Gb': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ETH-100Gb': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'STM-1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:STM-1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:STM-1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'STM-4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:STM-4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:STM-4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'STM-16': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:STM-16': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:STM-16': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'STM-64': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:STM-64': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:STM-64': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'STM-256': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:STM-256': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:STM-256': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'OC-3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:OC-3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:OC-3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'OC-12': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:OC-12': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:OC-12': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'OC-48': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:OC-48': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:OC-48': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'OC-192': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:OC-192': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:OC-192': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'OC-768': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:OC-768': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:OC-768': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'FC-100': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:FC-100': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:FC-100': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'FC-200': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:FC-200': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:FC-200': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'FC-400': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:FC-400': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:FC-400': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'FC-800': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:FC-800': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:FC-800': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'FC-1200': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:FC-1200': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:FC-1200': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'FC-1600': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:FC-1600': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:FC-1600': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'FC-3200': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:FC-3200': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:FC-3200': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'FICON-4G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:FICON-4G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:FICON-4G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'FICON-8G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:FICON-8G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:FICON-8G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},)), is_leaf=False, yang_name="supported-client-signal", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', 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 ['networks', 'network', 'node', 'termination-point', 'te', 'client-svc'] + + def _get_supported_client_signal(self): + """ + Getter method for supported_client_signal, mapped from YANG variable /networks/network/node/termination_point/te/client_svc/supported_client_signal (identityref) + + YANG Description: List of client signal types supported by the LTP. + """ + return self.__supported_client_signal + + def _set_supported_client_signal(self, v, load=False): + """ + Setter method for supported_client_signal, mapped from YANG variable /networks/network/node/termination_point/te/client_svc/supported_client_signal (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_supported_client_signal is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_supported_client_signal() directly. + + YANG Description: List of client signal types supported by the LTP. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ETH-1Gb': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ETH-1Gb': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ETH-1Gb': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ETH-10Gb-LAN': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ETH-10Gb-LAN': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ETH-10Gb-LAN': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ETH-10Gb-WAN': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ETH-10Gb-WAN': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ETH-10Gb-WAN': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ETH-40Gb': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ETH-40Gb': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ETH-40Gb': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ETH-100Gb': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ETH-100Gb': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ETH-100Gb': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'STM-1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:STM-1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:STM-1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'STM-4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:STM-4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:STM-4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'STM-16': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:STM-16': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:STM-16': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'STM-64': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:STM-64': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:STM-64': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'STM-256': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:STM-256': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:STM-256': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'OC-3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:OC-3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:OC-3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'OC-12': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:OC-12': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:OC-12': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'OC-48': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:OC-48': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:OC-48': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'OC-192': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:OC-192': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:OC-192': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'OC-768': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:OC-768': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:OC-768': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'FC-100': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:FC-100': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:FC-100': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'FC-200': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:FC-200': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:FC-200': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'FC-400': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:FC-400': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:FC-400': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'FC-800': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:FC-800': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:FC-800': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'FC-1200': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:FC-1200': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:FC-1200': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'FC-1600': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:FC-1600': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:FC-1600': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'FC-3200': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:FC-3200': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:FC-3200': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'FICON-4G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:FICON-4G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:FICON-4G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'FICON-8G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:FICON-8G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:FICON-8G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},)), is_leaf=False, yang_name="supported-client-signal", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """supported_client_signal must be of a type compatible with identityref""", + 'defined-type': "ietf-otn-topology:identityref", + 'generated-type': """YANGDynClass(unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ETH-1Gb': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ETH-1Gb': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ETH-1Gb': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ETH-10Gb-LAN': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ETH-10Gb-LAN': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ETH-10Gb-LAN': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ETH-10Gb-WAN': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ETH-10Gb-WAN': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ETH-10Gb-WAN': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ETH-40Gb': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ETH-40Gb': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ETH-40Gb': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ETH-100Gb': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ETH-100Gb': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ETH-100Gb': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'STM-1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:STM-1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:STM-1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'STM-4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:STM-4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:STM-4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'STM-16': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:STM-16': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:STM-16': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'STM-64': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:STM-64': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:STM-64': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'STM-256': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:STM-256': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:STM-256': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'OC-3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:OC-3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:OC-3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'OC-12': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:OC-12': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:OC-12': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'OC-48': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:OC-48': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:OC-48': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'OC-192': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:OC-192': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:OC-192': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'OC-768': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:OC-768': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:OC-768': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'FC-100': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:FC-100': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:FC-100': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'FC-200': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:FC-200': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:FC-200': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'FC-400': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:FC-400': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:FC-400': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'FC-800': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:FC-800': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:FC-800': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'FC-1200': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:FC-1200': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:FC-1200': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'FC-1600': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:FC-1600': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:FC-1600': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'FC-3200': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:FC-3200': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:FC-3200': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'FICON-4G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:FICON-4G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:FICON-4G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'FICON-8G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:FICON-8G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:FICON-8G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},)), is_leaf=False, yang_name="supported-client-signal", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True)""", + }) + + self.__supported_client_signal = t + if hasattr(self, '_set'): + self._set() + + def _unset_supported_client_signal(self): + self.__supported_client_signal = YANGDynClass(unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ETH-1Gb': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ETH-1Gb': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ETH-1Gb': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ETH-10Gb-LAN': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ETH-10Gb-LAN': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ETH-10Gb-LAN': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ETH-10Gb-WAN': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ETH-10Gb-WAN': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ETH-10Gb-WAN': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ETH-40Gb': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ETH-40Gb': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ETH-40Gb': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ETH-100Gb': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ETH-100Gb': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ETH-100Gb': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'STM-1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:STM-1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:STM-1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'STM-4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:STM-4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:STM-4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'STM-16': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:STM-16': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:STM-16': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'STM-64': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:STM-64': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:STM-64': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'STM-256': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:STM-256': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:STM-256': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'OC-3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:OC-3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:OC-3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'OC-12': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:OC-12': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:OC-12': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'OC-48': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:OC-48': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:OC-48': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'OC-192': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:OC-192': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:OC-192': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'OC-768': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:OC-768': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:OC-768': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'FC-100': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:FC-100': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:FC-100': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'FC-200': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:FC-200': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:FC-200': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'FC-400': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:FC-400': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:FC-400': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'FC-800': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:FC-800': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:FC-800': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'FC-1200': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:FC-1200': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:FC-1200': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'FC-1600': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:FC-1600': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:FC-1600': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'FC-3200': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:FC-3200': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:FC-3200': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'FICON-4G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:FICON-4G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:FICON-4G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'FICON-8G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:FICON-8G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:FICON-8G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},)), is_leaf=False, yang_name="supported-client-signal", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + + supported_client_signal = __builtin__.property(_get_supported_client_signal, _set_supported_client_signal) + + + _pyangbind_elements = OrderedDict([('supported_client_signal', supported_client_signal), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/termination_point/te/geolocation/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/termination_point/te/geolocation/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..a02b6d62f533c3c9ae8d2e8acb5a9f889e35d107 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/termination_point/te/geolocation/__init__.py @@ -0,0 +1,193 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 geolocation(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/termination-point/te/geolocation. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Contains a GPS location. + """ + __slots__ = ('_path_helper', '_extmethods', '__altitude','__latitude','__longitude',) + + _yang_name = 'geolocation' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__altitude = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['-9223372036854775808..9223372036854775807']}, int_size=64), is_leaf=True, yang_name="altitude", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='int64', is_config=False) + self.__latitude = YANGDynClass(base=RestrictedClassType(base_type=RestrictedPrecisionDecimalType(precision=8), restriction_dict={'range': ['-90..90']}), is_leaf=True, yang_name="latitude", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='geographic-coordinate-degree', is_config=False) + self.__longitude = YANGDynClass(base=RestrictedClassType(base_type=RestrictedPrecisionDecimalType(precision=8), restriction_dict={'range': ['-180..180']}), is_leaf=True, yang_name="longitude", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='geographic-coordinate-degree', 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 ['networks', 'network', 'node', 'termination-point', 'te', 'geolocation'] + + def _get_altitude(self): + """ + Getter method for altitude, mapped from YANG variable /networks/network/node/termination_point/te/geolocation/altitude (int64) + + YANG Description: Distance above sea level. + """ + return self.__altitude + + def _set_altitude(self, v, load=False): + """ + Setter method for altitude, mapped from YANG variable /networks/network/node/termination_point/te/geolocation/altitude (int64) + If this variable is read-only (config: false) in the + source YANG file, then _set_altitude is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_altitude() directly. + + YANG Description: Distance above sea level. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['-9223372036854775808..9223372036854775807']}, int_size=64), is_leaf=True, yang_name="altitude", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='int64', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """altitude must be of a type compatible with int64""", + 'defined-type': "int64", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['-9223372036854775808..9223372036854775807']}, int_size=64), is_leaf=True, yang_name="altitude", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='int64', is_config=False)""", + }) + + self.__altitude = t + if hasattr(self, '_set'): + self._set() + + def _unset_altitude(self): + self.__altitude = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['-9223372036854775808..9223372036854775807']}, int_size=64), is_leaf=True, yang_name="altitude", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='int64', is_config=False) + + + def _get_latitude(self): + """ + Getter method for latitude, mapped from YANG variable /networks/network/node/termination_point/te/geolocation/latitude (geographic-coordinate-degree) + + YANG Description: Relative position north or south on the Earth's surface. + """ + return self.__latitude + + def _set_latitude(self, v, load=False): + """ + Setter method for latitude, mapped from YANG variable /networks/network/node/termination_point/te/geolocation/latitude (geographic-coordinate-degree) + If this variable is read-only (config: false) in the + source YANG file, then _set_latitude is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_latitude() directly. + + YANG Description: Relative position north or south on the Earth's surface. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedPrecisionDecimalType(precision=8), restriction_dict={'range': ['-90..90']}), is_leaf=True, yang_name="latitude", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='geographic-coordinate-degree', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """latitude must be of a type compatible with geographic-coordinate-degree""", + 'defined-type': "ietf-te-topology:geographic-coordinate-degree", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedPrecisionDecimalType(precision=8), restriction_dict={'range': ['-90..90']}), is_leaf=True, yang_name="latitude", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='geographic-coordinate-degree', is_config=False)""", + }) + + self.__latitude = t + if hasattr(self, '_set'): + self._set() + + def _unset_latitude(self): + self.__latitude = YANGDynClass(base=RestrictedClassType(base_type=RestrictedPrecisionDecimalType(precision=8), restriction_dict={'range': ['-90..90']}), is_leaf=True, yang_name="latitude", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='geographic-coordinate-degree', is_config=False) + + + def _get_longitude(self): + """ + Getter method for longitude, mapped from YANG variable /networks/network/node/termination_point/te/geolocation/longitude (geographic-coordinate-degree) + + YANG Description: Angular distance east or west on the Earth's surface. + """ + return self.__longitude + + def _set_longitude(self, v, load=False): + """ + Setter method for longitude, mapped from YANG variable /networks/network/node/termination_point/te/geolocation/longitude (geographic-coordinate-degree) + If this variable is read-only (config: false) in the + source YANG file, then _set_longitude is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_longitude() directly. + + YANG Description: Angular distance east or west on the Earth's surface. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedPrecisionDecimalType(precision=8), restriction_dict={'range': ['-180..180']}), is_leaf=True, yang_name="longitude", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='geographic-coordinate-degree', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """longitude must be of a type compatible with geographic-coordinate-degree""", + 'defined-type': "ietf-te-topology:geographic-coordinate-degree", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedPrecisionDecimalType(precision=8), restriction_dict={'range': ['-180..180']}), is_leaf=True, yang_name="longitude", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='geographic-coordinate-degree', is_config=False)""", + }) + + self.__longitude = t + if hasattr(self, '_set'): + self._set() + + def _unset_longitude(self): + self.__longitude = YANGDynClass(base=RestrictedClassType(base_type=RestrictedPrecisionDecimalType(precision=8), restriction_dict={'range': ['-180..180']}), is_leaf=True, yang_name="longitude", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='geographic-coordinate-degree', is_config=False) + + altitude = __builtin__.property(_get_altitude) + latitude = __builtin__.property(_get_latitude) + longitude = __builtin__.property(_get_longitude) + + + _pyangbind_elements = OrderedDict([('altitude', altitude), ('latitude', latitude), ('longitude', longitude), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/termination_point/te/interface_switching_capability/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/termination_point/te/interface_switching_capability/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e158b30c3d4afc9e375d2057280337481b40634d --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/termination_point/te/interface_switching_capability/__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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 max_lsp_bandwidth +class interface_switching_capability(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/termination-point/te/interface-switching-capability. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: List of ISCDs for this link. + """ + __slots__ = ('_path_helper', '_extmethods', '__switching_capability','__encoding','__max_lsp_bandwidth',) + + _yang_name = 'interface-switching-capability' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__switching_capability = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'switching-psc1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-psc1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-psc1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-evpl': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-evpl': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-evpl': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-l2sc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-l2sc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-l2sc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-tdm': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-tdm': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-tdm': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-otn': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-otn': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-otn': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-dcsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-dcsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-dcsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-lsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-lsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-lsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-fsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-fsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-fsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="switching-capability", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + self.__encoding = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'lsp-encoding-packet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-packet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-packet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-ethernet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-ethernet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-ethernet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-pdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-pdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-pdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-sdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-sdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-sdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-digital-wrapper': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-digital-wrapper': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-digital-wrapper': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-lambda': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-lambda': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-lambda': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-fiber': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-fiber': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-fiber': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-fiber-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-fiber-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-fiber-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-oduk': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-oduk': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-oduk': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-optical-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-optical-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-optical-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-line': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-line': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-line': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="encoding", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + self.__max_lsp_bandwidth = YANGDynClass(base=YANGListType("priority",max_lsp_bandwidth.max_lsp_bandwidth, yang_name="max-lsp-bandwidth", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='priority', extensions=None), is_container='list', yang_name="max-lsp-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-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 ['networks', 'network', 'node', 'termination-point', 'te', 'interface-switching-capability'] + + def _get_switching_capability(self): + """ + Getter method for switching_capability, mapped from YANG variable /networks/network/node/termination_point/te/interface_switching_capability/switching_capability (identityref) + + YANG Description: Switching capability for this interface. + """ + return self.__switching_capability + + def _set_switching_capability(self, v, load=False): + """ + Setter method for switching_capability, mapped from YANG variable /networks/network/node/termination_point/te/interface_switching_capability/switching_capability (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_switching_capability is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_switching_capability() directly. + + YANG Description: Switching capability for this 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=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'switching-psc1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-psc1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-psc1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-evpl': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-evpl': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-evpl': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-l2sc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-l2sc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-l2sc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-tdm': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-tdm': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-tdm': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-otn': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-otn': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-otn': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-dcsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-dcsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-dcsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-lsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-lsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-lsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-fsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-fsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-fsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="switching-capability", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """switching_capability must be of a type compatible with identityref""", + 'defined-type': "ietf-te-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'switching-psc1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-psc1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-psc1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-evpl': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-evpl': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-evpl': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-l2sc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-l2sc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-l2sc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-tdm': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-tdm': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-tdm': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-otn': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-otn': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-otn': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-dcsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-dcsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-dcsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-lsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-lsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-lsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-fsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-fsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-fsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="switching-capability", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True)""", + }) + + self.__switching_capability = t + if hasattr(self, '_set'): + self._set() + + def _unset_switching_capability(self): + self.__switching_capability = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'switching-psc1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-psc1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-psc1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-evpl': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-evpl': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-evpl': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-l2sc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-l2sc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-l2sc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-tdm': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-tdm': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-tdm': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-otn': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-otn': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-otn': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-dcsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-dcsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-dcsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-lsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-lsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-lsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-fsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-fsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-fsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="switching-capability", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + + + def _get_encoding(self): + """ + Getter method for encoding, mapped from YANG variable /networks/network/node/termination_point/te/interface_switching_capability/encoding (identityref) + + YANG Description: Encoding supported by this interface. + """ + return self.__encoding + + def _set_encoding(self, v, load=False): + """ + Setter method for encoding, mapped from YANG variable /networks/network/node/termination_point/te/interface_switching_capability/encoding (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_encoding is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_encoding() directly. + + YANG Description: Encoding supported by this 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=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'lsp-encoding-packet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-packet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-packet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-ethernet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-ethernet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-ethernet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-pdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-pdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-pdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-sdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-sdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-sdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-digital-wrapper': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-digital-wrapper': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-digital-wrapper': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-lambda': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-lambda': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-lambda': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-fiber': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-fiber': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-fiber': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-fiber-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-fiber-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-fiber-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-oduk': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-oduk': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-oduk': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-optical-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-optical-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-optical-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-line': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-line': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-line': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="encoding", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """encoding must be of a type compatible with identityref""", + 'defined-type': "ietf-te-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'lsp-encoding-packet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-packet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-packet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-ethernet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-ethernet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-ethernet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-pdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-pdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-pdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-sdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-sdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-sdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-digital-wrapper': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-digital-wrapper': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-digital-wrapper': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-lambda': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-lambda': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-lambda': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-fiber': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-fiber': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-fiber': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-fiber-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-fiber-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-fiber-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-oduk': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-oduk': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-oduk': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-optical-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-optical-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-optical-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-line': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-line': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-line': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="encoding", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True)""", + }) + + self.__encoding = t + if hasattr(self, '_set'): + self._set() + + def _unset_encoding(self): + self.__encoding = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'lsp-encoding-packet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-packet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-packet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-ethernet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-ethernet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-ethernet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-pdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-pdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-pdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-sdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-sdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-sdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-digital-wrapper': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-digital-wrapper': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-digital-wrapper': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-lambda': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-lambda': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-lambda': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-fiber': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-fiber': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-fiber': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-fiber-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-fiber-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-fiber-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-oduk': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-oduk': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-oduk': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-optical-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-optical-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-optical-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-line': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-line': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-line': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="encoding", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + + + def _get_max_lsp_bandwidth(self): + """ + Getter method for max_lsp_bandwidth, mapped from YANG variable /networks/network/node/termination_point/te/interface_switching_capability/max_lsp_bandwidth (list) + + YANG Description: Maximum Label Switched Path (LSP) bandwidth at +priorities 0-7. + """ + return self.__max_lsp_bandwidth + + def _set_max_lsp_bandwidth(self, v, load=False): + """ + Setter method for max_lsp_bandwidth, mapped from YANG variable /networks/network/node/termination_point/te/interface_switching_capability/max_lsp_bandwidth (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_max_lsp_bandwidth is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_max_lsp_bandwidth() directly. + + YANG Description: Maximum Label Switched Path (LSP) bandwidth at +priorities 0-7. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("priority",max_lsp_bandwidth.max_lsp_bandwidth, yang_name="max-lsp-bandwidth", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='priority', extensions=None), is_container='list', yang_name="max-lsp-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """max_lsp_bandwidth must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("priority",max_lsp_bandwidth.max_lsp_bandwidth, yang_name="max-lsp-bandwidth", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='priority', extensions=None), is_container='list', yang_name="max-lsp-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True)""", + }) + + self.__max_lsp_bandwidth = t + if hasattr(self, '_set'): + self._set() + + def _unset_max_lsp_bandwidth(self): + self.__max_lsp_bandwidth = YANGDynClass(base=YANGListType("priority",max_lsp_bandwidth.max_lsp_bandwidth, yang_name="max-lsp-bandwidth", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='priority', extensions=None), is_container='list', yang_name="max-lsp-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + + switching_capability = __builtin__.property(_get_switching_capability, _set_switching_capability) + encoding = __builtin__.property(_get_encoding, _set_encoding) + max_lsp_bandwidth = __builtin__.property(_get_max_lsp_bandwidth, _set_max_lsp_bandwidth) + + + _pyangbind_elements = OrderedDict([('switching_capability', switching_capability), ('encoding', encoding), ('max_lsp_bandwidth', max_lsp_bandwidth), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/termination_point/te/interface_switching_capability/max_lsp_bandwidth/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/termination_point/te/interface_switching_capability/max_lsp_bandwidth/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..429b0f18b34d3f4e3e7889f94f21ff4b8191f59e --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/termination_point/te/interface_switching_capability/max_lsp_bandwidth/__init__.py @@ -0,0 +1,163 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 te_bandwidth +class max_lsp_bandwidth(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/termination-point/te/interface-switching-capability/max-lsp-bandwidth. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Maximum Label Switched Path (LSP) bandwidth at +priorities 0-7. + """ + __slots__ = ('_path_helper', '_extmethods', '__priority','__te_bandwidth',) + + _yang_name = 'max-lsp-bandwidth' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__priority = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..7']}), is_leaf=True, yang_name="priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint8', is_config=True) + self.__te_bandwidth = YANGDynClass(base=te_bandwidth.te_bandwidth, is_container='container', yang_name="te-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-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 ['networks', 'network', 'node', 'termination-point', 'te', 'interface-switching-capability', 'max-lsp-bandwidth'] + + def _get_priority(self): + """ + Getter method for priority, mapped from YANG variable /networks/network/node/termination_point/te/interface_switching_capability/max_lsp_bandwidth/priority (uint8) + + YANG Description: Priority. + """ + return self.__priority + + def _set_priority(self, v, load=False): + """ + Setter method for priority, mapped from YANG variable /networks/network/node/termination_point/te/interface_switching_capability/max_lsp_bandwidth/priority (uint8) + If this variable is read-only (config: false) in the + source YANG file, then _set_priority is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_priority() directly. + + YANG Description: Priority. + """ + 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=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..7']}), is_leaf=True, yang_name="priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint8', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """priority must be of a type compatible with uint8""", + 'defined-type': "uint8", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..7']}), is_leaf=True, yang_name="priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint8', is_config=True)""", + }) + + self.__priority = t + if hasattr(self, '_set'): + self._set() + + def _unset_priority(self): + self.__priority = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..7']}), is_leaf=True, yang_name="priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint8', is_config=True) + + + def _get_te_bandwidth(self): + """ + Getter method for te_bandwidth, mapped from YANG variable /networks/network/node/termination_point/te/interface_switching_capability/max_lsp_bandwidth/te_bandwidth (container) + + YANG Description: Container that specifies TE bandwidth. The choices +can be augmented for specific data-plane technologies. + """ + return self.__te_bandwidth + + def _set_te_bandwidth(self, v, load=False): + """ + Setter method for te_bandwidth, mapped from YANG variable /networks/network/node/termination_point/te/interface_switching_capability/max_lsp_bandwidth/te_bandwidth (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_te_bandwidth is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_te_bandwidth() directly. + + YANG Description: Container that specifies TE bandwidth. The choices +can be augmented for specific data-plane technologies. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=te_bandwidth.te_bandwidth, is_container='container', yang_name="te-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """te_bandwidth must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=te_bandwidth.te_bandwidth, is_container='container', yang_name="te-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__te_bandwidth = t + if hasattr(self, '_set'): + self._set() + + def _unset_te_bandwidth(self): + self.__te_bandwidth = YANGDynClass(base=te_bandwidth.te_bandwidth, is_container='container', yang_name="te-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + priority = __builtin__.property(_get_priority, _set_priority) + te_bandwidth = __builtin__.property(_get_te_bandwidth, _set_te_bandwidth) + + + _pyangbind_elements = OrderedDict([('priority', priority), ('te_bandwidth', te_bandwidth), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/termination_point/te/interface_switching_capability/max_lsp_bandwidth/te_bandwidth/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/termination_point/te/interface_switching_capability/max_lsp_bandwidth/te_bandwidth/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..d0326e850714e3aa15d050e62a22139d5403a2c5 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/termination_point/te/interface_switching_capability/max_lsp_bandwidth/te_bandwidth/__init__.py @@ -0,0 +1,195 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 otn +class te_bandwidth(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/termination-point/te/interface-switching-capability/max-lsp-bandwidth/te-bandwidth. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Container that specifies TE bandwidth. The choices +can be augmented for specific data-plane technologies. + """ + __slots__ = ('_path_helper', '_extmethods', '__generic','__otn','__eth_bandwidth',) + + _yang_name = 'te-bandwidth' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__generic = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+(,(0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+))*'}), is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-bandwidth', is_config=True) + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + self.__eth_bandwidth = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), restriction_dict={'range': ['0..10000000000']}), is_leaf=True, yang_name="eth-bandwidth", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint64', 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 ['networks', 'network', 'node', 'termination-point', 'te', 'interface-switching-capability', 'max-lsp-bandwidth', 'te-bandwidth'] + + def _get_generic(self): + """ + Getter method for generic, mapped from YANG variable /networks/network/node/termination_point/te/interface_switching_capability/max_lsp_bandwidth/te_bandwidth/generic (te-bandwidth) + + YANG Description: Bandwidth specified in a generic format. + """ + return self.__generic + + def _set_generic(self, v, load=False): + """ + Setter method for generic, mapped from YANG variable /networks/network/node/termination_point/te/interface_switching_capability/max_lsp_bandwidth/te_bandwidth/generic (te-bandwidth) + If this variable is read-only (config: false) in the + source YANG file, then _set_generic is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_generic() directly. + + YANG Description: Bandwidth specified in a generic format. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+(,(0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+))*'}), is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-bandwidth', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """generic must be of a type compatible with te-bandwidth""", + 'defined-type': "ietf-te-topology:te-bandwidth", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+(,(0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+))*'}), is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-bandwidth', is_config=True)""", + }) + + self.__generic = t + if hasattr(self, '_set'): + self._set() + + def _unset_generic(self): + self.__generic = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+(,(0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+))*'}), is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-bandwidth', is_config=True) + + + def _get_otn(self): + """ + Getter method for otn, mapped from YANG variable /networks/network/node/termination_point/te/interface_switching_capability/max_lsp_bandwidth/te_bandwidth/otn (container) + + YANG Description: Maximum bandwidth attributes for OTN paths. + """ + return self.__otn + + def _set_otn(self, v, load=False): + """ + Setter method for otn, mapped from YANG variable /networks/network/node/termination_point/te/interface_switching_capability/max_lsp_bandwidth/te_bandwidth/otn (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_otn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_otn() directly. + + YANG Description: Maximum bandwidth attributes for OTN paths. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """otn must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True)""", + }) + + self.__otn = t + if hasattr(self, '_set'): + self._set() + + def _unset_otn(self): + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + + + def _get_eth_bandwidth(self): + """ + Getter method for eth_bandwidth, mapped from YANG variable /networks/network/node/termination_point/te/interface_switching_capability/max_lsp_bandwidth/te_bandwidth/eth_bandwidth (uint64) + + YANG Description: Available bandwith value expressed in kilobits per second + """ + return self.__eth_bandwidth + + def _set_eth_bandwidth(self, v, load=False): + """ + Setter method for eth_bandwidth, mapped from YANG variable /networks/network/node/termination_point/te/interface_switching_capability/max_lsp_bandwidth/te_bandwidth/eth_bandwidth (uint64) + If this variable is read-only (config: false) in the + source YANG file, then _set_eth_bandwidth is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_eth_bandwidth() directly. + + YANG Description: Available bandwith value expressed in kilobits per second + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), restriction_dict={'range': ['0..10000000000']}), is_leaf=True, yang_name="eth-bandwidth", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint64', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """eth_bandwidth must be of a type compatible with uint64""", + 'defined-type': "uint64", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), restriction_dict={'range': ['0..10000000000']}), is_leaf=True, yang_name="eth-bandwidth", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint64', is_config=True)""", + }) + + self.__eth_bandwidth = t + if hasattr(self, '_set'): + self._set() + + def _unset_eth_bandwidth(self): + self.__eth_bandwidth = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), restriction_dict={'range': ['0..10000000000']}), is_leaf=True, yang_name="eth-bandwidth", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint64', is_config=True) + + generic = __builtin__.property(_get_generic, _set_generic) + otn = __builtin__.property(_get_otn, _set_otn) + eth_bandwidth = __builtin__.property(_get_eth_bandwidth, _set_eth_bandwidth) + + __choices__ = {'technology': {'generic': ['generic'], 'otn': ['otn'], 'eth': ['eth_bandwidth']}} + _pyangbind_elements = OrderedDict([('generic', generic), ('otn', otn), ('eth_bandwidth', eth_bandwidth), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/termination_point/te/interface_switching_capability/max_lsp_bandwidth/te_bandwidth/otn/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/termination_point/te/interface_switching_capability/max_lsp_bandwidth/te_bandwidth/otn/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..fcfb11adfec58d72cfc94e2aa1f099c63909e491 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/termination_point/te/interface_switching_capability/max_lsp_bandwidth/te_bandwidth/otn/__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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 otn(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/termination-point/te/interface-switching-capability/max-lsp-bandwidth/te-bandwidth/otn. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Maximum bandwidth attributes for OTN paths. + """ + __slots__ = ('_path_helper', '_extmethods', '__odu_type','__max_ts_number',) + + _yang_name = 'otn' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__odu_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="odu-type", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + self.__max_ts_number = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="max-ts-number", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', 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 ['networks', 'network', 'node', 'termination-point', 'te', 'interface-switching-capability', 'max-lsp-bandwidth', 'te-bandwidth', 'otn'] + + def _get_odu_type(self): + """ + Getter method for odu_type, mapped from YANG variable /networks/network/node/termination_point/te/interface_switching_capability/max_lsp_bandwidth/te_bandwidth/otn/odu_type (identityref) + + YANG Description: ODU type + """ + return self.__odu_type + + def _set_odu_type(self, v, load=False): + """ + Setter method for odu_type, mapped from YANG variable /networks/network/node/termination_point/te/interface_switching_capability/max_lsp_bandwidth/te_bandwidth/otn/odu_type (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_odu_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_odu_type() directly. + + YANG Description: ODU type + """ + 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={'ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="odu-type", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """odu_type must be of a type compatible with identityref""", + 'defined-type': "ietf-otn-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="odu-type", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True)""", + }) + + self.__odu_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_odu_type(self): + self.__odu_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="odu-type", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + + + def _get_max_ts_number(self): + """ + Getter method for max_ts_number, mapped from YANG variable /networks/network/node/termination_point/te/interface_switching_capability/max_lsp_bandwidth/te_bandwidth/otn/max_ts_number (uint16) + + YANG Description: The maximum number of Tributary Slots (TS) that could be +used by an ODUflex LSP. + """ + return self.__max_ts_number + + def _set_max_ts_number(self, v, load=False): + """ + Setter method for max_ts_number, mapped from YANG variable /networks/network/node/termination_point/te/interface_switching_capability/max_lsp_bandwidth/te_bandwidth/otn/max_ts_number (uint16) + If this variable is read-only (config: false) in the + source YANG file, then _set_max_ts_number is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_max_ts_number() directly. + + YANG Description: The maximum number of Tributary Slots (TS) that could be +used by an ODUflex LSP. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="max-ts-number", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """max_ts_number must be of a type compatible with uint16""", + 'defined-type': "uint16", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="max-ts-number", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', is_config=True)""", + }) + + self.__max_ts_number = t + if hasattr(self, '_set'): + self._set() + + def _unset_max_ts_number(self): + self.__max_ts_number = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="max-ts-number", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', is_config=True) + + odu_type = __builtin__.property(_get_odu_type, _set_odu_type) + max_ts_number = __builtin__.property(_get_max_ts_number, _set_max_ts_number) + + __choices__ = {'technology': {'otn': ['odu_type', 'max_ts_number']}} + _pyangbind_elements = OrderedDict([('odu_type', odu_type), ('max_ts_number', max_ts_number), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/termination_point/te/otn_ltp/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/termination_point/te/otn_ltp/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..55ef3745b5e210ddd9b045fb2e6e3fbc2f615a0b --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/termination_point/te/otn_ltp/__init__.py @@ -0,0 +1,121 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 otn_ltp(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/termination-point/te/otn-ltp. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Attributes of the OTN Link Termination Point (LTP). + """ + __slots__ = ('_path_helper', '_extmethods', '__odtu_flex_type',) + + _yang_name = 'otn-ltp' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__odtu_flex_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'2': {}, '3': {}, '4': {}, 'Cn': {}},), is_leaf=True, yang_name="odtu-flex-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='l1-types:odtu-flex-type', 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 ['networks', 'network', 'node', 'termination-point', 'te', 'otn-ltp'] + + def _get_odtu_flex_type(self): + """ + Getter method for odtu_flex_type, mapped from YANG variable /networks/network/node/termination_point/te/otn_ltp/odtu_flex_type (l1-types:odtu-flex-type) + + YANG Description: The type of Optical Data Tributary Unit (ODTU) +whose nominal bitrate is used to compute the number of +Tributary Slots (TS) required by the ODUflex LSPs set up +on this OTN Link Termination Point (LTP). + """ + return self.__odtu_flex_type + + def _set_odtu_flex_type(self, v, load=False): + """ + Setter method for odtu_flex_type, mapped from YANG variable /networks/network/node/termination_point/te/otn_ltp/odtu_flex_type (l1-types:odtu-flex-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_odtu_flex_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_odtu_flex_type() directly. + + YANG Description: The type of Optical Data Tributary Unit (ODTU) +whose nominal bitrate is used to compute the number of +Tributary Slots (TS) required by the ODUflex LSPs set up +on this OTN Link Termination Point (LTP). + """ + 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={'2': {}, '3': {}, '4': {}, 'Cn': {}},), is_leaf=True, yang_name="odtu-flex-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='l1-types:odtu-flex-type', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """odtu_flex_type must be of a type compatible with l1-types:odtu-flex-type""", + 'defined-type': "l1-types:odtu-flex-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'2': {}, '3': {}, '4': {}, 'Cn': {}},), is_leaf=True, yang_name="odtu-flex-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='l1-types:odtu-flex-type', is_config=True)""", + }) + + self.__odtu_flex_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_odtu_flex_type(self): + self.__odtu_flex_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'2': {}, '3': {}, '4': {}, 'Cn': {}},), is_leaf=True, yang_name="odtu-flex-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='l1-types:odtu-flex-type', is_config=True) + + odtu_flex_type = __builtin__.property(_get_odtu_flex_type, _set_odtu_flex_type) + + + _pyangbind_elements = OrderedDict([('odtu_flex_type', odtu_flex_type), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/supporting_network/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/supporting_network/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..183db82648fefbeabe860b6e497697abe039dca5 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/supporting_network/__init__.py @@ -0,0 +1,121 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 supporting_network(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/supporting-network. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: An underlay network, used to represent layered network +topologies. + """ + __slots__ = ('_path_helper', '_extmethods', '__network_ref',) + + _yang_name = 'supporting-network' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__network_ref = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="network-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-network', defining_module='ietf-network', 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 ['networks', 'network', 'supporting-network'] + + def _get_network_ref(self): + """ + Getter method for network_ref, mapped from YANG variable /networks/network/supporting_network/network_ref (leafref) + + YANG Description: References the underlay network. + """ + return self.__network_ref + + def _set_network_ref(self, v, load=False): + """ + Setter method for network_ref, mapped from YANG variable /networks/network/supporting_network/network_ref (leafref) + If this variable is read-only (config: false) in the + source YANG file, then _set_network_ref is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_network_ref() directly. + + YANG Description: References the underlay network. + """ + 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="network-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-network', defining_module='ietf-network', yang_type='leafref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """network_ref must be of a type compatible with leafref""", + 'defined-type': "leafref", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="network-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-network', defining_module='ietf-network', yang_type='leafref', is_config=True)""", + }) + + self.__network_ref = t + if hasattr(self, '_set'): + self._set() + + def _unset_network_ref(self): + self.__network_ref = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="network-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-network', defining_module='ietf-network', yang_type='leafref', is_config=True) + + network_ref = __builtin__.property(_get_network_ref, _set_network_ref) + + + _pyangbind_elements = OrderedDict([('network_ref', network_ref), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/te/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/te/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..ac4025b544207cde7e99d97cb6b94c02bd7c0ca6 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/te/__init__.py @@ -0,0 +1,283 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 nsrlg +from . import geolocation +class te(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/te. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Indicates TE support. + """ + __slots__ = ('_path_helper', '_extmethods', '__name','__preference','__optimization_criterion','__nsrlg','__geolocation',) + + _yang_name = 'te' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _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='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=True) + self.__preference = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['1..255']}), is_leaf=True, yang_name="preference", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint8', is_config=True) + self.__optimization_criterion = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'of-minimize-cost-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-cost-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-cost-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-minimize-load-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-load-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-load-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-maximize-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-maximize-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-maximize-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-minimize-agg-bandwidth-consumption': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-agg-bandwidth-consumption': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-agg-bandwidth-consumption': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-minimize-load-most-loaded-link': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-load-most-loaded-link': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-load-most-loaded-link': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-minimize-cost-path-set': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-cost-path-set': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-cost-path-set': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="optimization-criterion", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + self.__nsrlg = YANGDynClass(base=YANGListType("id",nsrlg.nsrlg, yang_name="nsrlg", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='id', extensions=None), is_container='list', yang_name="nsrlg", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + self.__geolocation = YANGDynClass(base=geolocation.geolocation, is_container='container', yang_name="geolocation", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', 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 ['networks', 'network', 'te'] + + def _get_name(self): + """ + Getter method for name, mapped from YANG variable /networks/network/te/name (string) + + YANG Description: Name of the TE topology. This attribute is optional and can +be specified by the operator to describe the TE topology, +which can be useful when 'network-id' (RFC 8345) is not +descriptive and not modifiable because of being generated +by the system. + """ + return self.__name + + def _set_name(self, v, load=False): + """ + Setter method for name, mapped from YANG variable /networks/network/te/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: Name of the TE topology. This attribute is optional and can +be specified by the operator to describe the TE topology, +which can be useful when 'network-id' (RFC 8345) is not +descriptive and not modifiable because of being generated +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='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', 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='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', 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='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=True) + + + def _get_preference(self): + """ + Getter method for preference, mapped from YANG variable /networks/network/te/preference (uint8) + + YANG Description: Specifies a preference for this topology. A lower number +indicates a higher preference. + """ + return self.__preference + + def _set_preference(self, v, load=False): + """ + Setter method for preference, mapped from YANG variable /networks/network/te/preference (uint8) + If this variable is read-only (config: false) in the + source YANG file, then _set_preference is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_preference() directly. + + YANG Description: Specifies a preference for this topology. A lower number +indicates a higher preference. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['1..255']}), is_leaf=True, yang_name="preference", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint8', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """preference must be of a type compatible with uint8""", + 'defined-type': "uint8", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['1..255']}), is_leaf=True, yang_name="preference", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint8', is_config=True)""", + }) + + self.__preference = t + if hasattr(self, '_set'): + self._set() + + def _unset_preference(self): + self.__preference = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['1..255']}), is_leaf=True, yang_name="preference", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint8', is_config=True) + + + def _get_optimization_criterion(self): + """ + Getter method for optimization_criterion, mapped from YANG variable /networks/network/te/optimization_criterion (identityref) + + YANG Description: Optimization criterion applied to this topology. + """ + return self.__optimization_criterion + + def _set_optimization_criterion(self, v, load=False): + """ + Setter method for optimization_criterion, mapped from YANG variable /networks/network/te/optimization_criterion (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_optimization_criterion is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_optimization_criterion() directly. + + YANG Description: Optimization criterion applied to this topology. + """ + 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={'of-minimize-cost-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-cost-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-cost-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-minimize-load-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-load-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-load-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-maximize-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-maximize-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-maximize-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-minimize-agg-bandwidth-consumption': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-agg-bandwidth-consumption': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-agg-bandwidth-consumption': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-minimize-load-most-loaded-link': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-load-most-loaded-link': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-load-most-loaded-link': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-minimize-cost-path-set': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-cost-path-set': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-cost-path-set': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="optimization-criterion", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """optimization_criterion must be of a type compatible with identityref""", + 'defined-type': "ietf-te-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'of-minimize-cost-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-cost-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-cost-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-minimize-load-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-load-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-load-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-maximize-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-maximize-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-maximize-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-minimize-agg-bandwidth-consumption': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-agg-bandwidth-consumption': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-agg-bandwidth-consumption': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-minimize-load-most-loaded-link': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-load-most-loaded-link': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-load-most-loaded-link': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-minimize-cost-path-set': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-cost-path-set': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-cost-path-set': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="optimization-criterion", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True)""", + }) + + self.__optimization_criterion = t + if hasattr(self, '_set'): + self._set() + + def _unset_optimization_criterion(self): + self.__optimization_criterion = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'of-minimize-cost-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-cost-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-cost-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-minimize-load-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-load-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-load-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-maximize-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-maximize-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-maximize-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-minimize-agg-bandwidth-consumption': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-agg-bandwidth-consumption': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-agg-bandwidth-consumption': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-minimize-load-most-loaded-link': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-load-most-loaded-link': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-load-most-loaded-link': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-minimize-cost-path-set': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-cost-path-set': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-cost-path-set': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="optimization-criterion", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + + + def _get_nsrlg(self): + """ + Getter method for nsrlg, mapped from YANG variable /networks/network/te/nsrlg (list) + + YANG Description: List of NSRLGs (Non-Shared Risk Link Groups). + """ + return self.__nsrlg + + def _set_nsrlg(self, v, load=False): + """ + Setter method for nsrlg, mapped from YANG variable /networks/network/te/nsrlg (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_nsrlg is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_nsrlg() directly. + + YANG Description: List of NSRLGs (Non-Shared Risk Link Groups). + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("id",nsrlg.nsrlg, yang_name="nsrlg", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='id', extensions=None), is_container='list', yang_name="nsrlg", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """nsrlg must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("id",nsrlg.nsrlg, yang_name="nsrlg", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='id', extensions=None), is_container='list', yang_name="nsrlg", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True)""", + }) + + self.__nsrlg = t + if hasattr(self, '_set'): + self._set() + + def _unset_nsrlg(self): + self.__nsrlg = YANGDynClass(base=YANGListType("id",nsrlg.nsrlg, yang_name="nsrlg", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='id', extensions=None), is_container='list', yang_name="nsrlg", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + + + def _get_geolocation(self): + """ + Getter method for geolocation, mapped from YANG variable /networks/network/te/geolocation (container) + + YANG Description: Contains a GPS location. + """ + return self.__geolocation + + def _set_geolocation(self, v, load=False): + """ + Setter method for geolocation, mapped from YANG variable /networks/network/te/geolocation (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_geolocation is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_geolocation() directly. + + YANG Description: Contains a GPS location. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=geolocation.geolocation, is_container='container', yang_name="geolocation", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """geolocation must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=geolocation.geolocation, is_container='container', yang_name="geolocation", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__geolocation = t + if hasattr(self, '_set'): + self._set() + + def _unset_geolocation(self): + self.__geolocation = YANGDynClass(base=geolocation.geolocation, is_container='container', yang_name="geolocation", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + name = __builtin__.property(_get_name, _set_name) + preference = __builtin__.property(_get_preference, _set_preference) + optimization_criterion = __builtin__.property(_get_optimization_criterion, _set_optimization_criterion) + nsrlg = __builtin__.property(_get_nsrlg, _set_nsrlg) + geolocation = __builtin__.property(_get_geolocation) + + + _pyangbind_elements = OrderedDict([('name', name), ('preference', preference), ('optimization_criterion', optimization_criterion), ('nsrlg', nsrlg), ('geolocation', geolocation), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/te/geolocation/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/te/geolocation/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..b415c4e437a0693b84f7d82acc94981186f0f8b2 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/te/geolocation/__init__.py @@ -0,0 +1,193 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 geolocation(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/te/geolocation. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Contains a GPS location. + """ + __slots__ = ('_path_helper', '_extmethods', '__altitude','__latitude','__longitude',) + + _yang_name = 'geolocation' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__altitude = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['-9223372036854775808..9223372036854775807']}, int_size=64), is_leaf=True, yang_name="altitude", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='int64', is_config=False) + self.__latitude = YANGDynClass(base=RestrictedClassType(base_type=RestrictedPrecisionDecimalType(precision=8), restriction_dict={'range': ['-90..90']}), is_leaf=True, yang_name="latitude", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='geographic-coordinate-degree', is_config=False) + self.__longitude = YANGDynClass(base=RestrictedClassType(base_type=RestrictedPrecisionDecimalType(precision=8), restriction_dict={'range': ['-180..180']}), is_leaf=True, yang_name="longitude", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='geographic-coordinate-degree', 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 ['networks', 'network', 'te', 'geolocation'] + + def _get_altitude(self): + """ + Getter method for altitude, mapped from YANG variable /networks/network/te/geolocation/altitude (int64) + + YANG Description: Distance above sea level. + """ + return self.__altitude + + def _set_altitude(self, v, load=False): + """ + Setter method for altitude, mapped from YANG variable /networks/network/te/geolocation/altitude (int64) + If this variable is read-only (config: false) in the + source YANG file, then _set_altitude is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_altitude() directly. + + YANG Description: Distance above sea level. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['-9223372036854775808..9223372036854775807']}, int_size=64), is_leaf=True, yang_name="altitude", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='int64', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """altitude must be of a type compatible with int64""", + 'defined-type': "int64", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['-9223372036854775808..9223372036854775807']}, int_size=64), is_leaf=True, yang_name="altitude", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='int64', is_config=False)""", + }) + + self.__altitude = t + if hasattr(self, '_set'): + self._set() + + def _unset_altitude(self): + self.__altitude = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['-9223372036854775808..9223372036854775807']}, int_size=64), is_leaf=True, yang_name="altitude", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='int64', is_config=False) + + + def _get_latitude(self): + """ + Getter method for latitude, mapped from YANG variable /networks/network/te/geolocation/latitude (geographic-coordinate-degree) + + YANG Description: Relative position north or south on the Earth's surface. + """ + return self.__latitude + + def _set_latitude(self, v, load=False): + """ + Setter method for latitude, mapped from YANG variable /networks/network/te/geolocation/latitude (geographic-coordinate-degree) + If this variable is read-only (config: false) in the + source YANG file, then _set_latitude is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_latitude() directly. + + YANG Description: Relative position north or south on the Earth's surface. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedPrecisionDecimalType(precision=8), restriction_dict={'range': ['-90..90']}), is_leaf=True, yang_name="latitude", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='geographic-coordinate-degree', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """latitude must be of a type compatible with geographic-coordinate-degree""", + 'defined-type': "ietf-te-topology:geographic-coordinate-degree", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedPrecisionDecimalType(precision=8), restriction_dict={'range': ['-90..90']}), is_leaf=True, yang_name="latitude", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='geographic-coordinate-degree', is_config=False)""", + }) + + self.__latitude = t + if hasattr(self, '_set'): + self._set() + + def _unset_latitude(self): + self.__latitude = YANGDynClass(base=RestrictedClassType(base_type=RestrictedPrecisionDecimalType(precision=8), restriction_dict={'range': ['-90..90']}), is_leaf=True, yang_name="latitude", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='geographic-coordinate-degree', is_config=False) + + + def _get_longitude(self): + """ + Getter method for longitude, mapped from YANG variable /networks/network/te/geolocation/longitude (geographic-coordinate-degree) + + YANG Description: Angular distance east or west on the Earth's surface. + """ + return self.__longitude + + def _set_longitude(self, v, load=False): + """ + Setter method for longitude, mapped from YANG variable /networks/network/te/geolocation/longitude (geographic-coordinate-degree) + If this variable is read-only (config: false) in the + source YANG file, then _set_longitude is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_longitude() directly. + + YANG Description: Angular distance east or west on the Earth's surface. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedPrecisionDecimalType(precision=8), restriction_dict={'range': ['-180..180']}), is_leaf=True, yang_name="longitude", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='geographic-coordinate-degree', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """longitude must be of a type compatible with geographic-coordinate-degree""", + 'defined-type': "ietf-te-topology:geographic-coordinate-degree", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedPrecisionDecimalType(precision=8), restriction_dict={'range': ['-180..180']}), is_leaf=True, yang_name="longitude", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='geographic-coordinate-degree', is_config=False)""", + }) + + self.__longitude = t + if hasattr(self, '_set'): + self._set() + + def _unset_longitude(self): + self.__longitude = YANGDynClass(base=RestrictedClassType(base_type=RestrictedPrecisionDecimalType(precision=8), restriction_dict={'range': ['-180..180']}), is_leaf=True, yang_name="longitude", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='geographic-coordinate-degree', is_config=False) + + altitude = __builtin__.property(_get_altitude) + latitude = __builtin__.property(_get_latitude) + longitude = __builtin__.property(_get_longitude) + + + _pyangbind_elements = OrderedDict([('altitude', altitude), ('latitude', latitude), ('longitude', longitude), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/te/nsrlg/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/te/nsrlg/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..d905efa92274df84bd826567b5bfc0580daa9c2c --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/te/nsrlg/__init__.py @@ -0,0 +1,159 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 nsrlg(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/te/nsrlg. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: List of NSRLGs (Non-Shared Risk Link Groups). + """ + __slots__ = ('_path_helper', '_extmethods', '__id','__disjointness',) + + _yang_name = 'nsrlg' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__id = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + self.__disjointness = YANGDynClass(base=YANGBitsType(allowed_bits={'node': '0', 'link': '1', 'srlg': '2'}), is_leaf=True, yang_name="disjointness", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-types:te-path-disjointness', 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 ['networks', 'network', 'te', 'nsrlg'] + + def _get_id(self): + """ + Getter method for id, mapped from YANG variable /networks/network/te/nsrlg/id (uint32) + + YANG Description: Identifies the NSRLG entry. + """ + return self.__id + + def _set_id(self, v, load=False): + """ + Setter method for id, mapped from YANG variable /networks/network/te/nsrlg/id (uint32) + 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: Identifies the NSRLG entry. + """ + 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=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """id 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="id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True)""", + }) + + self.__id = t + if hasattr(self, '_set'): + self._set() + + def _unset_id(self): + self.__id = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + + + def _get_disjointness(self): + """ + Getter method for disjointness, mapped from YANG variable /networks/network/te/nsrlg/disjointness (te-types:te-path-disjointness) + + YANG Description: The type of resource disjointness. + """ + return self.__disjointness + + def _set_disjointness(self, v, load=False): + """ + Setter method for disjointness, mapped from YANG variable /networks/network/te/nsrlg/disjointness (te-types:te-path-disjointness) + If this variable is read-only (config: false) in the + source YANG file, then _set_disjointness is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_disjointness() directly. + + YANG Description: The type of resource disjointness. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBitsType(allowed_bits={'node': '0', 'link': '1', 'srlg': '2'}), is_leaf=True, yang_name="disjointness", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-types:te-path-disjointness', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """disjointness must be of a type compatible with te-types:te-path-disjointness""", + 'defined-type': "te-types:te-path-disjointness", + 'generated-type': """YANGDynClass(base=YANGBitsType(allowed_bits={'node': '0', 'link': '1', 'srlg': '2'}), is_leaf=True, yang_name="disjointness", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-types:te-path-disjointness', is_config=True)""", + }) + + self.__disjointness = t + if hasattr(self, '_set'): + self._set() + + def _unset_disjointness(self): + self.__disjointness = YANGDynClass(base=YANGBitsType(allowed_bits={'node': '0', 'link': '1', 'srlg': '2'}), is_leaf=True, yang_name="disjointness", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-types:te-path-disjointness', is_config=True) + + id = __builtin__.property(_get_id, _set_id) + disjointness = __builtin__.property(_get_disjointness, _set_disjointness) + + + _pyangbind_elements = OrderedDict([('id', id), ('disjointness', disjointness), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/te_topology_identifier/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/te_topology_identifier/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..0e29c5c0ce0ce7088e547f05b5ccd9ba78064714 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/te_topology_identifier/__init__.py @@ -0,0 +1,205 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 te_topology_identifier(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/te-topology-identifier. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: TE topology identifier container. + """ + __slots__ = ('_path_helper', '_extmethods', '__provider_id','__client_id','__topology_id',) + + _yang_name = 'te-topology-identifier' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__provider_id = 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="provider-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-global-id', is_config=True) + self.__client_id = 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="client-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-global-id', is_config=True) + self.__topology_id = YANGDynClass(base=[RestrictedClassType(base_type=six.text_type, restriction_dict={'length': ['0']}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([a-zA-Z0-9\\-_.]+:)*/?([a-zA-Z0-9\\-_.]+)(/[a-zA-Z0-9\\-_.]+)*'}),], default=six.text_type(""), is_leaf=True, yang_name="topology-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-topology-id', 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 ['networks', 'network', 'te-topology-identifier'] + + def _get_provider_id(self): + """ + Getter method for provider_id, mapped from YANG variable /networks/network/te_topology_identifier/provider_id (te-global-id) + + YANG Description: An identifier to uniquely identify a provider. +If omitted, it assumes that the topology provider ID +value = 0 (the default). + """ + return self.__provider_id + + def _set_provider_id(self, v, load=False): + """ + Setter method for provider_id, mapped from YANG variable /networks/network/te_topology_identifier/provider_id (te-global-id) + If this variable is read-only (config: false) in the + source YANG file, then _set_provider_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_provider_id() directly. + + YANG Description: An identifier to uniquely identify a provider. +If omitted, it assumes that the topology provider ID +value = 0 (the default). + """ + 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="provider-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-global-id', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """provider_id must be of a type compatible with te-global-id""", + 'defined-type': "ietf-te-topology:te-global-id", + '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="provider-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-global-id', is_config=True)""", + }) + + self.__provider_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_provider_id(self): + self.__provider_id = 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="provider-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-global-id', is_config=True) + + + def _get_client_id(self): + """ + Getter method for client_id, mapped from YANG variable /networks/network/te_topology_identifier/client_id (te-global-id) + + YANG Description: An identifier to uniquely identify a client. +If omitted, it assumes that the topology client ID +value = 0 (the default). + """ + return self.__client_id + + def _set_client_id(self, v, load=False): + """ + Setter method for client_id, mapped from YANG variable /networks/network/te_topology_identifier/client_id (te-global-id) + If this variable is read-only (config: false) in the + source YANG file, then _set_client_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_client_id() directly. + + YANG Description: An identifier to uniquely identify a client. +If omitted, it assumes that the topology client ID +value = 0 (the default). + """ + 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="client-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-global-id', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """client_id must be of a type compatible with te-global-id""", + 'defined-type': "ietf-te-topology:te-global-id", + '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="client-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-global-id', is_config=True)""", + }) + + self.__client_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_client_id(self): + self.__client_id = 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="client-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-global-id', is_config=True) + + + def _get_topology_id(self): + """ + Getter method for topology_id, mapped from YANG variable /networks/network/te_topology_identifier/topology_id (te-topology-id) + + YANG Description: When the datastore contains several topologies, +'topology-id' distinguishes between them. If omitted, +the default (empty) string for this leaf is assumed. + """ + return self.__topology_id + + def _set_topology_id(self, v, load=False): + """ + Setter method for topology_id, mapped from YANG variable /networks/network/te_topology_identifier/topology_id (te-topology-id) + If this variable is read-only (config: false) in the + source YANG file, then _set_topology_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_topology_id() directly. + + YANG Description: When the datastore contains several topologies, +'topology-id' distinguishes between them. If omitted, +the default (empty) string for this leaf is assumed. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=[RestrictedClassType(base_type=six.text_type, restriction_dict={'length': ['0']}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([a-zA-Z0-9\\-_.]+:)*/?([a-zA-Z0-9\\-_.]+)(/[a-zA-Z0-9\\-_.]+)*'}),], default=six.text_type(""), is_leaf=True, yang_name="topology-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-topology-id', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """topology_id must be of a type compatible with te-topology-id""", + 'defined-type': "ietf-te-topology:te-topology-id", + 'generated-type': """YANGDynClass(base=[RestrictedClassType(base_type=six.text_type, restriction_dict={'length': ['0']}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([a-zA-Z0-9\\-_.]+:)*/?([a-zA-Z0-9\\-_.]+)(/[a-zA-Z0-9\\-_.]+)*'}),], default=six.text_type(""), is_leaf=True, yang_name="topology-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-topology-id', is_config=True)""", + }) + + self.__topology_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_topology_id(self): + self.__topology_id = YANGDynClass(base=[RestrictedClassType(base_type=six.text_type, restriction_dict={'length': ['0']}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([a-zA-Z0-9\\-_.]+:)*/?([a-zA-Z0-9\\-_.]+)(/[a-zA-Z0-9\\-_.]+)*'}),], default=six.text_type(""), is_leaf=True, yang_name="topology-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-topology-id', is_config=True) + + provider_id = __builtin__.property(_get_provider_id, _set_provider_id) + client_id = __builtin__.property(_get_client_id, _set_client_id) + topology_id = __builtin__.property(_get_topology_id, _set_topology_id) + + + _pyangbind_elements = OrderedDict([('provider_id', provider_id), ('client_id', client_id), ('topology_id', topology_id), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..f38ba7bb87b27b1b38d6ddfc53b91a3da54725b3 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/__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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 templates +class te(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/te. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Indicates TE support. + """ + __slots__ = ('_path_helper', '_extmethods', '__templates',) + + _yang_name = 'te' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__templates = YANGDynClass(base=templates.templates, is_container='container', yang_name="templates", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-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 ['networks', 'te'] + + def _get_templates(self): + """ + Getter method for templates, mapped from YANG variable /networks/te/templates (container) + + YANG Description: Configuration parameters for templates used for a TE +topology. + """ + return self.__templates + + def _set_templates(self, v, load=False): + """ + Setter method for templates, mapped from YANG variable /networks/te/templates (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_templates is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_templates() directly. + + YANG Description: Configuration parameters for templates used for a TE +topology. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=templates.templates, is_container='container', yang_name="templates", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """templates must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=templates.templates, is_container='container', yang_name="templates", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__templates = t + if hasattr(self, '_set'): + self._set() + + def _unset_templates(self): + self.__templates = YANGDynClass(base=templates.templates, is_container='container', yang_name="templates", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + templates = __builtin__.property(_get_templates, _set_templates) + + + _pyangbind_elements = OrderedDict([('templates', templates), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..645419914f817871e91adda32f9897db9a534f13 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/__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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 node_template +from . import link_template +class templates(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/te/templates. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Configuration parameters for templates used for a TE +topology. + """ + __slots__ = ('_path_helper', '_extmethods', '__node_template','__link_template',) + + _yang_name = 'templates' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__node_template = YANGDynClass(base=YANGListType("name",node_template.node_template, yang_name="node-template", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='name', extensions=None), is_container='list', yang_name="node-template", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + self.__link_template = YANGDynClass(base=YANGListType("name",link_template.link_template, yang_name="link-template", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='name', extensions=None), is_container='list', yang_name="link-template", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-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 ['networks', 'te', 'templates'] + + def _get_node_template(self): + """ + Getter method for node_template, mapped from YANG variable /networks/te/templates/node_template (list) + + YANG Description: The list of TE node templates used to define sharable +and reusable TE node attributes. + """ + return self.__node_template + + def _set_node_template(self, v, load=False): + """ + Setter method for node_template, mapped from YANG variable /networks/te/templates/node_template (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_node_template is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_node_template() directly. + + YANG Description: The list of TE node templates used to define sharable +and reusable TE node attributes. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("name",node_template.node_template, yang_name="node-template", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='name', extensions=None), is_container='list', yang_name="node-template", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """node_template must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("name",node_template.node_template, yang_name="node-template", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='name', extensions=None), is_container='list', yang_name="node-template", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True)""", + }) + + self.__node_template = t + if hasattr(self, '_set'): + self._set() + + def _unset_node_template(self): + self.__node_template = YANGDynClass(base=YANGListType("name",node_template.node_template, yang_name="node-template", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='name', extensions=None), is_container='list', yang_name="node-template", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + + + def _get_link_template(self): + """ + Getter method for link_template, mapped from YANG variable /networks/te/templates/link_template (list) + + YANG Description: The list of TE link templates used to define sharable +and reusable TE link attributes. + """ + return self.__link_template + + def _set_link_template(self, v, load=False): + """ + Setter method for link_template, mapped from YANG variable /networks/te/templates/link_template (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_link_template is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_link_template() directly. + + YANG Description: The list of TE link templates used to define sharable +and reusable TE link attributes. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("name",link_template.link_template, yang_name="link-template", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='name', extensions=None), is_container='list', yang_name="link-template", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """link_template must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("name",link_template.link_template, yang_name="link-template", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='name', extensions=None), is_container='list', yang_name="link-template", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True)""", + }) + + self.__link_template = t + if hasattr(self, '_set'): + self._set() + + def _unset_link_template(self): + self.__link_template = YANGDynClass(base=YANGListType("name",link_template.link_template, yang_name="link-template", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='name', extensions=None), is_container='list', yang_name="link-template", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + + node_template = __builtin__.property(_get_node_template, _set_node_template) + link_template = __builtin__.property(_get_link_template, _set_link_template) + + + _pyangbind_elements = OrderedDict([('node_template', node_template), ('link_template', link_template), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..132c4dbd381d0ed0ea94e36b83b95653c4f73b71 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/__init__.py @@ -0,0 +1,251 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 te_link_attributes +class link_template(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/te/templates/link-template. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: The list of TE link templates used to define sharable +and reusable TE link attributes. + """ + __slots__ = ('_path_helper', '_extmethods', '__name','__priority','__reference_change_policy','__te_link_attributes',) + + _yang_name = 'link-template' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__name = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '/?([a-zA-Z0-9\\-_.]+)(/[a-zA-Z0-9\\-_.]+)*'}), is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-types:te-template-name', is_config=True) + self.__priority = YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), is_leaf=True, yang_name="priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint16', is_config=True) + self.__reference_change_policy = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'no-action': {}, 'not-allowed': {}, 'cascade': {}},), is_leaf=True, yang_name="reference-change-policy", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='enumeration', is_config=True) + self.__te_link_attributes = YANGDynClass(base=te_link_attributes.te_link_attributes, is_container='container', yang_name="te-link-attributes", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-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 ['networks', 'te', 'templates', 'link-template'] + + def _get_name(self): + """ + Getter method for name, mapped from YANG variable /networks/te/templates/link_template/name (te-types:te-template-name) + + YANG Description: The name to identify a TE link template. + """ + return self.__name + + def _set_name(self, v, load=False): + """ + Setter method for name, mapped from YANG variable /networks/te/templates/link_template/name (te-types:te-template-name) + 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 to identify a TE link template. + """ + 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=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '/?([a-zA-Z0-9\\-_.]+)(/[a-zA-Z0-9\\-_.]+)*'}), is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-types:te-template-name', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """name must be of a type compatible with te-types:te-template-name""", + 'defined-type': "te-types:te-template-name", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '/?([a-zA-Z0-9\\-_.]+)(/[a-zA-Z0-9\\-_.]+)*'}), is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-types:te-template-name', is_config=True)""", + }) + + self.__name = t + if hasattr(self, '_set'): + self._set() + + def _unset_name(self): + self.__name = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '/?([a-zA-Z0-9\\-_.]+)(/[a-zA-Z0-9\\-_.]+)*'}), is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-types:te-template-name', is_config=True) + + + def _get_priority(self): + """ + Getter method for priority, mapped from YANG variable /networks/te/templates/link_template/priority (uint16) + + YANG Description: The preference value for resolving conflicts between +different templates. When two or more templates specify +values for one configuration attribute, the value from the +template with the highest priority is used. +A lower number indicates a higher priority. The highest +priority is 0. + """ + return self.__priority + + def _set_priority(self, v, load=False): + """ + Setter method for priority, mapped from YANG variable /networks/te/templates/link_template/priority (uint16) + If this variable is read-only (config: false) in the + source YANG file, then _set_priority is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_priority() directly. + + YANG Description: The preference value for resolving conflicts between +different templates. When two or more templates specify +values for one configuration attribute, the value from the +template with the highest priority is used. +A lower number indicates a higher priority. The highest +priority is 0. + """ + 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="priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint16', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """priority 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="priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint16', is_config=True)""", + }) + + self.__priority = t + if hasattr(self, '_set'): + self._set() + + def _unset_priority(self): + self.__priority = YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), is_leaf=True, yang_name="priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint16', is_config=True) + + + def _get_reference_change_policy(self): + """ + Getter method for reference_change_policy, mapped from YANG variable /networks/te/templates/link_template/reference_change_policy (enumeration) + + YANG Description: This attribute specifies the action taken for a +configuration node that has a reference to this template. + """ + return self.__reference_change_policy + + def _set_reference_change_policy(self, v, load=False): + """ + Setter method for reference_change_policy, mapped from YANG variable /networks/te/templates/link_template/reference_change_policy (enumeration) + If this variable is read-only (config: false) in the + source YANG file, then _set_reference_change_policy is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_reference_change_policy() directly. + + YANG Description: This attribute specifies the action taken for a +configuration node that has a reference to this template. + """ + 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={'no-action': {}, 'not-allowed': {}, 'cascade': {}},), is_leaf=True, yang_name="reference-change-policy", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='enumeration', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """reference_change_policy must be of a type compatible with enumeration""", + 'defined-type': "ietf-te-topology:enumeration", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'no-action': {}, 'not-allowed': {}, 'cascade': {}},), is_leaf=True, yang_name="reference-change-policy", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='enumeration', is_config=True)""", + }) + + self.__reference_change_policy = t + if hasattr(self, '_set'): + self._set() + + def _unset_reference_change_policy(self): + self.__reference_change_policy = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'no-action': {}, 'not-allowed': {}, 'cascade': {}},), is_leaf=True, yang_name="reference-change-policy", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='enumeration', is_config=True) + + + def _get_te_link_attributes(self): + """ + Getter method for te_link_attributes, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes (container) + + YANG Description: Link attributes in a TE topology. + """ + return self.__te_link_attributes + + def _set_te_link_attributes(self, v, load=False): + """ + Setter method for te_link_attributes, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_te_link_attributes is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_te_link_attributes() directly. + + YANG Description: Link attributes in a TE topology. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=te_link_attributes.te_link_attributes, is_container='container', yang_name="te-link-attributes", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """te_link_attributes must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=te_link_attributes.te_link_attributes, is_container='container', yang_name="te-link-attributes", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__te_link_attributes = t + if hasattr(self, '_set'): + self._set() + + def _unset_te_link_attributes(self): + self.__te_link_attributes = YANGDynClass(base=te_link_attributes.te_link_attributes, is_container='container', yang_name="te-link-attributes", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + name = __builtin__.property(_get_name, _set_name) + priority = __builtin__.property(_get_priority, _set_priority) + reference_change_policy = __builtin__.property(_get_reference_change_policy, _set_reference_change_policy) + te_link_attributes = __builtin__.property(_get_te_link_attributes, _set_te_link_attributes) + + + _pyangbind_elements = OrderedDict([('name', name), ('priority', priority), ('reference_change_policy', reference_change_policy), ('te_link_attributes', te_link_attributes), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..b694dcce0e503c6b8324322681c3e8721ed5e6b1 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/__init__.py @@ -0,0 +1,858 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 external_domain +from . import underlay +from . import interface_switching_capability +from . import label_restrictions +from . import max_link_bandwidth +from . import max_resv_link_bandwidth +from . import unreserved_bandwidth +from . import te_srlgs +from . import te_nsrlgs +class te_link_attributes(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/te/templates/link-template/te-link-attributes. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Link attributes in a TE topology. + """ + __slots__ = ('_path_helper', '_extmethods', '__access_type','__external_domain','__is_abstract','__name','__underlay','__admin_status','__link_index','__administrative_group','__interface_switching_capability','__label_restrictions','__link_protection_type','__max_link_bandwidth','__max_resv_link_bandwidth','__unreserved_bandwidth','__te_default_metric','__te_delay_metric','__te_igp_metric','__te_srlgs','__te_nsrlgs',) + + _yang_name = 'te-link-attributes' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__access_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'point-to-point': {}, 'multi-access': {}},), is_leaf=True, yang_name="access-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-types:te-link-access-type', is_config=True) + self.__external_domain = YANGDynClass(base=external_domain.external_domain, is_container='container', yang_name="external-domain", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__is_abstract = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="is-abstract", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='empty', is_config=True) + 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='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=True) + self.__underlay = YANGDynClass(base=underlay.underlay, is_container='container', yang_name="underlay", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__admin_status = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'up': {}, 'down': {}, 'testing': {}, 'preparing-maintenance': {}, 'maintenance': {}, 'unknown': {}},), is_leaf=True, yang_name="admin-status", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-types:te-admin-status', is_config=True) + self.__link_index = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="link-index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint64', is_config=True) + self.__administrative_group = YANGDynClass(base=[RestrictedClassType(base_type=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}), restriction_dict={'length': ['1..11']}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}),], is_leaf=True, yang_name="administrative-group", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-types:admin-groups', is_config=True) + self.__interface_switching_capability = YANGDynClass(base=YANGListType("switching_capability encoding",interface_switching_capability.interface_switching_capability, yang_name="interface-switching-capability", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='switching-capability encoding', extensions=None), is_container='list', yang_name="interface-switching-capability", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + self.__label_restrictions = YANGDynClass(base=label_restrictions.label_restrictions, is_container='container', yang_name="label-restrictions", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__link_protection_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'link-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-shared': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-shared': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-shared': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-enhanced': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-enhanced': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-enhanced': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="link-protection-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + self.__max_link_bandwidth = YANGDynClass(base=max_link_bandwidth.max_link_bandwidth, is_container='container', yang_name="max-link-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__max_resv_link_bandwidth = YANGDynClass(base=max_resv_link_bandwidth.max_resv_link_bandwidth, is_container='container', yang_name="max-resv-link-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__unreserved_bandwidth = YANGDynClass(base=YANGListType("priority",unreserved_bandwidth.unreserved_bandwidth, yang_name="unreserved-bandwidth", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='priority', extensions=None), is_container='list', yang_name="unreserved-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + self.__te_default_metric = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="te-default-metric", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + self.__te_delay_metric = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="te-delay-metric", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + self.__te_igp_metric = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="te-igp-metric", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + self.__te_srlgs = YANGDynClass(base=te_srlgs.te_srlgs, is_container='container', yang_name="te-srlgs", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__te_nsrlgs = YANGDynClass(base=te_nsrlgs.te_nsrlgs, is_container='container', yang_name="te-nsrlgs", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-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 ['networks', 'te', 'templates', 'link-template', 'te-link-attributes'] + + def _get_access_type(self): + """ + Getter method for access_type, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/access_type (te-types:te-link-access-type) + + YANG Description: Link access type, which can be point-to-point or +multi-access. + """ + return self.__access_type + + def _set_access_type(self, v, load=False): + """ + Setter method for access_type, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/access_type (te-types:te-link-access-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_access_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_access_type() directly. + + YANG Description: Link access type, which can be point-to-point or +multi-access. + """ + 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={'point-to-point': {}, 'multi-access': {}},), is_leaf=True, yang_name="access-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-types:te-link-access-type', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """access_type must be of a type compatible with te-types:te-link-access-type""", + 'defined-type': "te-types:te-link-access-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'point-to-point': {}, 'multi-access': {}},), is_leaf=True, yang_name="access-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-types:te-link-access-type', is_config=True)""", + }) + + self.__access_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_access_type(self): + self.__access_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'point-to-point': {}, 'multi-access': {}},), is_leaf=True, yang_name="access-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-types:te-link-access-type', is_config=True) + + + def _get_external_domain(self): + """ + Getter method for external_domain, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/external_domain (container) + + YANG Description: For an inter-domain link, specifies the attributes of +the remote end of the link, to facilitate the signaling at +the local end. + """ + return self.__external_domain + + def _set_external_domain(self, v, load=False): + """ + Setter method for external_domain, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/external_domain (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_external_domain is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_external_domain() directly. + + YANG Description: For an inter-domain link, specifies the attributes of +the remote end of the link, to facilitate the signaling at +the local end. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=external_domain.external_domain, is_container='container', yang_name="external-domain", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """external_domain must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=external_domain.external_domain, is_container='container', yang_name="external-domain", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__external_domain = t + if hasattr(self, '_set'): + self._set() + + def _unset_external_domain(self): + self.__external_domain = YANGDynClass(base=external_domain.external_domain, is_container='container', yang_name="external-domain", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_is_abstract(self): + """ + Getter method for is_abstract, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/is_abstract (empty) + + YANG Description: Present if the link is abstract. + """ + return self.__is_abstract + + def _set_is_abstract(self, v, load=False): + """ + Setter method for is_abstract, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/is_abstract (empty) + If this variable is read-only (config: false) in the + source YANG file, then _set_is_abstract is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_is_abstract() directly. + + YANG Description: Present if the link is abstract. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBool, is_leaf=True, yang_name="is-abstract", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='empty', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """is_abstract must be of a type compatible with empty""", + 'defined-type': "empty", + 'generated-type': """YANGDynClass(base=YANGBool, is_leaf=True, yang_name="is-abstract", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='empty', is_config=True)""", + }) + + self.__is_abstract = t + if hasattr(self, '_set'): + self._set() + + def _unset_is_abstract(self): + self.__is_abstract = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="is-abstract", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='empty', is_config=True) + + + def _get_name(self): + """ + Getter method for name, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/name (string) + + YANG Description: Link name. + """ + return self.__name + + def _set_name(self, v, load=False): + """ + Setter method for name, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/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: Link name. + """ + 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='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', 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='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', 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='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=True) + + + def _get_underlay(self): + """ + Getter method for underlay, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay (container) + + YANG Description: Attributes of the TE link underlay. + """ + return self.__underlay + + def _set_underlay(self, v, load=False): + """ + Setter method for underlay, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_underlay is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_underlay() directly. + + YANG Description: Attributes of the TE link underlay. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=underlay.underlay, is_container='container', yang_name="underlay", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """underlay must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=underlay.underlay, is_container='container', yang_name="underlay", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__underlay = t + if hasattr(self, '_set'): + self._set() + + def _unset_underlay(self): + self.__underlay = YANGDynClass(base=underlay.underlay, is_container='container', yang_name="underlay", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_admin_status(self): + """ + Getter method for admin_status, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/admin_status (te-types:te-admin-status) + + YANG Description: The administrative state of the link. + """ + return self.__admin_status + + def _set_admin_status(self, v, load=False): + """ + Setter method for admin_status, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/admin_status (te-types:te-admin-status) + 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 administrative state of the link. + """ + 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': {}, 'preparing-maintenance': {}, 'maintenance': {}, 'unknown': {}},), is_leaf=True, yang_name="admin-status", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-types:te-admin-status', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """admin_status must be of a type compatible with te-types:te-admin-status""", + 'defined-type': "te-types:te-admin-status", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'up': {}, 'down': {}, 'testing': {}, 'preparing-maintenance': {}, 'maintenance': {}, 'unknown': {}},), is_leaf=True, yang_name="admin-status", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-types:te-admin-status', is_config=True)""", + }) + + 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': {}, 'preparing-maintenance': {}, 'maintenance': {}, 'unknown': {}},), is_leaf=True, yang_name="admin-status", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-types:te-admin-status', is_config=True) + + + def _get_link_index(self): + """ + Getter method for link_index, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/link_index (uint64) + + YANG Description: The link identifier. If OSPF is used, this object +represents an ospfLsdbID. If IS-IS is used, this object +represents an isisLSPID. If a locally configured link is +used, this object represents a unique value, which is +locally defined in a router. + """ + return self.__link_index + + def _set_link_index(self, v, load=False): + """ + Setter method for link_index, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/link_index (uint64) + If this variable is read-only (config: false) in the + source YANG file, then _set_link_index is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_link_index() directly. + + YANG Description: The link identifier. If OSPF is used, this object +represents an ospfLsdbID. If IS-IS is used, this object +represents an isisLSPID. If a locally configured link is +used, this object represents a unique value, which is +locally defined in a router. + """ + 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="link-index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint64', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """link_index 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="link-index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint64', is_config=True)""", + }) + + self.__link_index = t + if hasattr(self, '_set'): + self._set() + + def _unset_link_index(self): + self.__link_index = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="link-index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint64', is_config=True) + + + def _get_administrative_group(self): + """ + Getter method for administrative_group, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/administrative_group (te-types:admin-groups) + + YANG Description: Administrative group or color of the link. +This attribute covers both administrative groups (defined +in RFCs 3630 and 5305) and Extended Administrative Groups +(defined in RFC 7308). + """ + return self.__administrative_group + + def _set_administrative_group(self, v, load=False): + """ + Setter method for administrative_group, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/administrative_group (te-types:admin-groups) + If this variable is read-only (config: false) in the + source YANG file, then _set_administrative_group is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_administrative_group() directly. + + YANG Description: Administrative group or color of the link. +This attribute covers both administrative groups (defined +in RFCs 3630 and 5305) and Extended Administrative Groups +(defined in RFC 7308). + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=[RestrictedClassType(base_type=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}), restriction_dict={'length': ['1..11']}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}),], is_leaf=True, yang_name="administrative-group", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-types:admin-groups', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """administrative_group must be of a type compatible with te-types:admin-groups""", + 'defined-type': "te-types:admin-groups", + 'generated-type': """YANGDynClass(base=[RestrictedClassType(base_type=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}), restriction_dict={'length': ['1..11']}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}),], is_leaf=True, yang_name="administrative-group", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-types:admin-groups', is_config=True)""", + }) + + self.__administrative_group = t + if hasattr(self, '_set'): + self._set() + + def _unset_administrative_group(self): + self.__administrative_group = YANGDynClass(base=[RestrictedClassType(base_type=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}), restriction_dict={'length': ['1..11']}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}),], is_leaf=True, yang_name="administrative-group", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-types:admin-groups', is_config=True) + + + def _get_interface_switching_capability(self): + """ + Getter method for interface_switching_capability, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/interface_switching_capability (list) + + YANG Description: List of ISCDs for this link. + """ + return self.__interface_switching_capability + + def _set_interface_switching_capability(self, v, load=False): + """ + Setter method for interface_switching_capability, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/interface_switching_capability (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_interface_switching_capability is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_interface_switching_capability() directly. + + YANG Description: List of ISCDs for this link. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("switching_capability encoding",interface_switching_capability.interface_switching_capability, yang_name="interface-switching-capability", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='switching-capability encoding', extensions=None), is_container='list', yang_name="interface-switching-capability", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """interface_switching_capability must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("switching_capability encoding",interface_switching_capability.interface_switching_capability, yang_name="interface-switching-capability", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='switching-capability encoding', extensions=None), is_container='list', yang_name="interface-switching-capability", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True)""", + }) + + self.__interface_switching_capability = t + if hasattr(self, '_set'): + self._set() + + def _unset_interface_switching_capability(self): + self.__interface_switching_capability = YANGDynClass(base=YANGListType("switching_capability encoding",interface_switching_capability.interface_switching_capability, yang_name="interface-switching-capability", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='switching-capability encoding', extensions=None), is_container='list', yang_name="interface-switching-capability", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + + + def _get_label_restrictions(self): + """ + Getter method for label_restrictions, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/label_restrictions (container) + + YANG Description: The label restrictions container. + """ + return self.__label_restrictions + + def _set_label_restrictions(self, v, load=False): + """ + Setter method for label_restrictions, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/label_restrictions (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_label_restrictions is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_label_restrictions() directly. + + YANG Description: The label restrictions container. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=label_restrictions.label_restrictions, is_container='container', yang_name="label-restrictions", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """label_restrictions must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=label_restrictions.label_restrictions, is_container='container', yang_name="label-restrictions", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__label_restrictions = t + if hasattr(self, '_set'): + self._set() + + def _unset_label_restrictions(self): + self.__label_restrictions = YANGDynClass(base=label_restrictions.label_restrictions, is_container='container', yang_name="label-restrictions", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_link_protection_type(self): + """ + Getter method for link_protection_type, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/link_protection_type (identityref) + + YANG Description: Link Protection Type desired for this link. + """ + return self.__link_protection_type + + def _set_link_protection_type(self, v, load=False): + """ + Setter method for link_protection_type, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/link_protection_type (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_link_protection_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_link_protection_type() directly. + + YANG Description: Link Protection Type desired for this link. + """ + 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={'link-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-shared': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-shared': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-shared': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-enhanced': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-enhanced': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-enhanced': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="link-protection-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """link_protection_type must be of a type compatible with identityref""", + 'defined-type': "ietf-te-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'link-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-shared': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-shared': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-shared': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-enhanced': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-enhanced': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-enhanced': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="link-protection-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True)""", + }) + + self.__link_protection_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_link_protection_type(self): + self.__link_protection_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'link-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-shared': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-shared': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-shared': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-enhanced': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-enhanced': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-enhanced': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="link-protection-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + + + def _get_max_link_bandwidth(self): + """ + Getter method for max_link_bandwidth, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/max_link_bandwidth (container) + + YANG Description: Maximum bandwidth that can be seen on this link in this +direction. Units are in bytes per second. + """ + return self.__max_link_bandwidth + + def _set_max_link_bandwidth(self, v, load=False): + """ + Setter method for max_link_bandwidth, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/max_link_bandwidth (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_max_link_bandwidth is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_max_link_bandwidth() directly. + + YANG Description: Maximum bandwidth that can be seen on this link in this +direction. Units are in bytes per second. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=max_link_bandwidth.max_link_bandwidth, is_container='container', yang_name="max-link-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """max_link_bandwidth must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=max_link_bandwidth.max_link_bandwidth, is_container='container', yang_name="max-link-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__max_link_bandwidth = t + if hasattr(self, '_set'): + self._set() + + def _unset_max_link_bandwidth(self): + self.__max_link_bandwidth = YANGDynClass(base=max_link_bandwidth.max_link_bandwidth, is_container='container', yang_name="max-link-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_max_resv_link_bandwidth(self): + """ + Getter method for max_resv_link_bandwidth, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/max_resv_link_bandwidth (container) + + YANG Description: Maximum amount of bandwidth that can be reserved in this +direction in this link. Units are in bytes per second. + """ + return self.__max_resv_link_bandwidth + + def _set_max_resv_link_bandwidth(self, v, load=False): + """ + Setter method for max_resv_link_bandwidth, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/max_resv_link_bandwidth (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_max_resv_link_bandwidth is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_max_resv_link_bandwidth() directly. + + YANG Description: Maximum amount of bandwidth that can be reserved in this +direction in this link. Units are in bytes per second. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=max_resv_link_bandwidth.max_resv_link_bandwidth, is_container='container', yang_name="max-resv-link-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """max_resv_link_bandwidth must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=max_resv_link_bandwidth.max_resv_link_bandwidth, is_container='container', yang_name="max-resv-link-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__max_resv_link_bandwidth = t + if hasattr(self, '_set'): + self._set() + + def _unset_max_resv_link_bandwidth(self): + self.__max_resv_link_bandwidth = YANGDynClass(base=max_resv_link_bandwidth.max_resv_link_bandwidth, is_container='container', yang_name="max-resv-link-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_unreserved_bandwidth(self): + """ + Getter method for unreserved_bandwidth, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/unreserved_bandwidth (list) + + YANG Description: Unreserved bandwidth for priority levels 0-7. Units are in +bytes per second. + """ + return self.__unreserved_bandwidth + + def _set_unreserved_bandwidth(self, v, load=False): + """ + Setter method for unreserved_bandwidth, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/unreserved_bandwidth (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_unreserved_bandwidth is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_unreserved_bandwidth() directly. + + YANG Description: Unreserved bandwidth for priority levels 0-7. Units are in +bytes per second. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("priority",unreserved_bandwidth.unreserved_bandwidth, yang_name="unreserved-bandwidth", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='priority', extensions=None), is_container='list', yang_name="unreserved-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """unreserved_bandwidth must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("priority",unreserved_bandwidth.unreserved_bandwidth, yang_name="unreserved-bandwidth", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='priority', extensions=None), is_container='list', yang_name="unreserved-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True)""", + }) + + self.__unreserved_bandwidth = t + if hasattr(self, '_set'): + self._set() + + def _unset_unreserved_bandwidth(self): + self.__unreserved_bandwidth = YANGDynClass(base=YANGListType("priority",unreserved_bandwidth.unreserved_bandwidth, yang_name="unreserved-bandwidth", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='priority', extensions=None), is_container='list', yang_name="unreserved-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + + + def _get_te_default_metric(self): + """ + Getter method for te_default_metric, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/te_default_metric (uint32) + + YANG Description: Traffic Engineering metric. + """ + return self.__te_default_metric + + def _set_te_default_metric(self, v, load=False): + """ + Setter method for te_default_metric, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/te_default_metric (uint32) + If this variable is read-only (config: false) in the + source YANG file, then _set_te_default_metric is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_te_default_metric() directly. + + YANG Description: Traffic Engineering metric. + """ + 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="te-default-metric", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """te_default_metric 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="te-default-metric", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True)""", + }) + + self.__te_default_metric = t + if hasattr(self, '_set'): + self._set() + + def _unset_te_default_metric(self): + self.__te_default_metric = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="te-default-metric", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + + + def _get_te_delay_metric(self): + """ + Getter method for te_delay_metric, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/te_delay_metric (uint32) + + YANG Description: Traffic Engineering delay metric. + """ + return self.__te_delay_metric + + def _set_te_delay_metric(self, v, load=False): + """ + Setter method for te_delay_metric, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/te_delay_metric (uint32) + If this variable is read-only (config: false) in the + source YANG file, then _set_te_delay_metric is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_te_delay_metric() directly. + + YANG Description: Traffic Engineering delay metric. + """ + 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="te-delay-metric", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """te_delay_metric 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="te-delay-metric", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True)""", + }) + + self.__te_delay_metric = t + if hasattr(self, '_set'): + self._set() + + def _unset_te_delay_metric(self): + self.__te_delay_metric = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="te-delay-metric", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + + + def _get_te_igp_metric(self): + """ + Getter method for te_igp_metric, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/te_igp_metric (uint32) + + YANG Description: IGP metric used for Traffic Engineering. + """ + return self.__te_igp_metric + + def _set_te_igp_metric(self, v, load=False): + """ + Setter method for te_igp_metric, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/te_igp_metric (uint32) + If this variable is read-only (config: false) in the + source YANG file, then _set_te_igp_metric is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_te_igp_metric() directly. + + YANG Description: IGP metric used for Traffic Engineering. + """ + 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="te-igp-metric", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """te_igp_metric 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="te-igp-metric", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True)""", + }) + + self.__te_igp_metric = t + if hasattr(self, '_set'): + self._set() + + def _unset_te_igp_metric(self): + self.__te_igp_metric = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="te-igp-metric", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + + + def _get_te_srlgs(self): + """ + Getter method for te_srlgs, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/te_srlgs (container) + + YANG Description: Contains a list of SRLGs. + """ + return self.__te_srlgs + + def _set_te_srlgs(self, v, load=False): + """ + Setter method for te_srlgs, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/te_srlgs (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_te_srlgs is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_te_srlgs() directly. + + YANG Description: Contains a list of SRLGs. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=te_srlgs.te_srlgs, is_container='container', yang_name="te-srlgs", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """te_srlgs must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=te_srlgs.te_srlgs, is_container='container', yang_name="te-srlgs", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__te_srlgs = t + if hasattr(self, '_set'): + self._set() + + def _unset_te_srlgs(self): + self.__te_srlgs = YANGDynClass(base=te_srlgs.te_srlgs, is_container='container', yang_name="te-srlgs", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_te_nsrlgs(self): + """ + Getter method for te_nsrlgs, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/te_nsrlgs (container) + + YANG Description: Contains a list of NSRLGs (Non-Shared Risk Link Groups). +When an abstract TE link is configured, this list specifies +the request that underlay TE paths need to be mutually +disjoint with other TE links in the same groups. + """ + return self.__te_nsrlgs + + def _set_te_nsrlgs(self, v, load=False): + """ + Setter method for te_nsrlgs, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/te_nsrlgs (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_te_nsrlgs is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_te_nsrlgs() directly. + + YANG Description: Contains a list of NSRLGs (Non-Shared Risk Link Groups). +When an abstract TE link is configured, this list specifies +the request that underlay TE paths need to be mutually +disjoint with other TE links in the same groups. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=te_nsrlgs.te_nsrlgs, is_container='container', yang_name="te-nsrlgs", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """te_nsrlgs must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=te_nsrlgs.te_nsrlgs, is_container='container', yang_name="te-nsrlgs", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__te_nsrlgs = t + if hasattr(self, '_set'): + self._set() + + def _unset_te_nsrlgs(self): + self.__te_nsrlgs = YANGDynClass(base=te_nsrlgs.te_nsrlgs, is_container='container', yang_name="te-nsrlgs", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + access_type = __builtin__.property(_get_access_type, _set_access_type) + external_domain = __builtin__.property(_get_external_domain, _set_external_domain) + is_abstract = __builtin__.property(_get_is_abstract, _set_is_abstract) + name = __builtin__.property(_get_name, _set_name) + underlay = __builtin__.property(_get_underlay, _set_underlay) + admin_status = __builtin__.property(_get_admin_status, _set_admin_status) + link_index = __builtin__.property(_get_link_index, _set_link_index) + administrative_group = __builtin__.property(_get_administrative_group, _set_administrative_group) + interface_switching_capability = __builtin__.property(_get_interface_switching_capability, _set_interface_switching_capability) + label_restrictions = __builtin__.property(_get_label_restrictions, _set_label_restrictions) + link_protection_type = __builtin__.property(_get_link_protection_type, _set_link_protection_type) + max_link_bandwidth = __builtin__.property(_get_max_link_bandwidth, _set_max_link_bandwidth) + max_resv_link_bandwidth = __builtin__.property(_get_max_resv_link_bandwidth, _set_max_resv_link_bandwidth) + unreserved_bandwidth = __builtin__.property(_get_unreserved_bandwidth, _set_unreserved_bandwidth) + te_default_metric = __builtin__.property(_get_te_default_metric, _set_te_default_metric) + te_delay_metric = __builtin__.property(_get_te_delay_metric, _set_te_delay_metric) + te_igp_metric = __builtin__.property(_get_te_igp_metric, _set_te_igp_metric) + te_srlgs = __builtin__.property(_get_te_srlgs, _set_te_srlgs) + te_nsrlgs = __builtin__.property(_get_te_nsrlgs, _set_te_nsrlgs) + + + _pyangbind_elements = OrderedDict([('access_type', access_type), ('external_domain', external_domain), ('is_abstract', is_abstract), ('name', name), ('underlay', underlay), ('admin_status', admin_status), ('link_index', link_index), ('administrative_group', administrative_group), ('interface_switching_capability', interface_switching_capability), ('label_restrictions', label_restrictions), ('link_protection_type', link_protection_type), ('max_link_bandwidth', max_link_bandwidth), ('max_resv_link_bandwidth', max_resv_link_bandwidth), ('unreserved_bandwidth', unreserved_bandwidth), ('te_default_metric', te_default_metric), ('te_delay_metric', te_delay_metric), ('te_igp_metric', te_igp_metric), ('te_srlgs', te_srlgs), ('te_nsrlgs', te_nsrlgs), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/external_domain/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/external_domain/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..9d40db38071f2c0e5472e5a698f7627a335af544 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/external_domain/__init__.py @@ -0,0 +1,205 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 external_domain(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/te/templates/link-template/te-link-attributes/external-domain. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: For an inter-domain link, specifies the attributes of +the remote end of the link, to facilitate the signaling at +the local end. + """ + __slots__ = ('_path_helper', '_extmethods', '__network_ref','__remote_te_node_id','__remote_te_link_tp_id',) + + _yang_name = 'external-domain' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__network_ref = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="network-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=True) + self.__remote_te_node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="remote-te-node-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-types:te-node-id', is_config=True) + self.__remote_te_link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="remote-te-link-tp-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-types:te-tp-id', 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 ['networks', 'te', 'templates', 'link-template', 'te-link-attributes', 'external-domain'] + + def _get_network_ref(self): + """ + Getter method for network_ref, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/external_domain/network_ref (leafref) + + YANG Description: Used to reference a network -- for example, an underlay +network. + """ + return self.__network_ref + + def _set_network_ref(self, v, load=False): + """ + Setter method for network_ref, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/external_domain/network_ref (leafref) + If this variable is read-only (config: false) in the + source YANG file, then _set_network_ref is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_network_ref() directly. + + YANG Description: Used to reference a network -- for example, an underlay +network. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="network-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """network_ref must be of a type compatible with leafref""", + 'defined-type': "leafref", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="network-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=True)""", + }) + + self.__network_ref = t + if hasattr(self, '_set'): + self._set() + + def _unset_network_ref(self): + self.__network_ref = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="network-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=True) + + + def _get_remote_te_node_id(self): + """ + Getter method for remote_te_node_id, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/external_domain/remote_te_node_id (te-types:te-node-id) + + YANG Description: Remote TE node identifier, used together with +'remote-te-link-tp-id' to identify the remote Link +Termination Point (LTP) in a different domain. + """ + return self.__remote_te_node_id + + def _set_remote_te_node_id(self, v, load=False): + """ + Setter method for remote_te_node_id, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/external_domain/remote_te_node_id (te-types:te-node-id) + If this variable is read-only (config: false) in the + source YANG file, then _set_remote_te_node_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_remote_te_node_id() directly. + + YANG Description: Remote TE node identifier, used together with +'remote-te-link-tp-id' to identify the remote Link +Termination Point (LTP) in a different domain. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="remote-te-node-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-types:te-node-id', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """remote_te_node_id must be of a type compatible with te-types:te-node-id""", + 'defined-type': "te-types:te-node-id", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="remote-te-node-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-types:te-node-id', is_config=True)""", + }) + + self.__remote_te_node_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_remote_te_node_id(self): + self.__remote_te_node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="remote-te-node-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-types:te-node-id', is_config=True) + + + def _get_remote_te_link_tp_id(self): + """ + Getter method for remote_te_link_tp_id, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/external_domain/remote_te_link_tp_id (te-types:te-tp-id) + + YANG Description: Remote TE LTP identifier, used together with +'remote-te-node-id' to identify the remote LTP in a +different domain. + """ + return self.__remote_te_link_tp_id + + def _set_remote_te_link_tp_id(self, v, load=False): + """ + Setter method for remote_te_link_tp_id, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/external_domain/remote_te_link_tp_id (te-types:te-tp-id) + If this variable is read-only (config: false) in the + source YANG file, then _set_remote_te_link_tp_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_remote_te_link_tp_id() directly. + + YANG Description: Remote TE LTP identifier, used together with +'remote-te-node-id' to identify the remote LTP in a +different domain. + """ + 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),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="remote-te-link-tp-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-types:te-tp-id', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """remote_te_link_tp_id must be of a type compatible with te-types:te-tp-id""", + 'defined-type': "te-types:te-tp-id", + 'generated-type': """YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="remote-te-link-tp-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-types:te-tp-id', is_config=True)""", + }) + + self.__remote_te_link_tp_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_remote_te_link_tp_id(self): + self.__remote_te_link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="remote-te-link-tp-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-types:te-tp-id', is_config=True) + + network_ref = __builtin__.property(_get_network_ref, _set_network_ref) + remote_te_node_id = __builtin__.property(_get_remote_te_node_id, _set_remote_te_node_id) + remote_te_link_tp_id = __builtin__.property(_get_remote_te_link_tp_id, _set_remote_te_link_tp_id) + + + _pyangbind_elements = OrderedDict([('network_ref', network_ref), ('remote_te_node_id', remote_te_node_id), ('remote_te_link_tp_id', remote_te_link_tp_id), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/interface_switching_capability/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/interface_switching_capability/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..ce33e949d3254a05332244d538c14451be0692c9 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/interface_switching_capability/__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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 max_lsp_bandwidth +class interface_switching_capability(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/te/templates/link-template/te-link-attributes/interface-switching-capability. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: List of ISCDs for this link. + """ + __slots__ = ('_path_helper', '_extmethods', '__switching_capability','__encoding','__max_lsp_bandwidth',) + + _yang_name = 'interface-switching-capability' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__switching_capability = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'switching-psc1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-psc1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-psc1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-evpl': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-evpl': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-evpl': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-l2sc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-l2sc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-l2sc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-tdm': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-tdm': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-tdm': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-otn': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-otn': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-otn': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-dcsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-dcsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-dcsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-lsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-lsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-lsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-fsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-fsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-fsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="switching-capability", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + self.__encoding = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'lsp-encoding-packet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-packet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-packet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-ethernet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-ethernet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-ethernet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-pdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-pdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-pdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-sdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-sdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-sdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-digital-wrapper': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-digital-wrapper': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-digital-wrapper': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-lambda': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-lambda': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-lambda': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-fiber': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-fiber': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-fiber': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-fiber-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-fiber-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-fiber-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-oduk': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-oduk': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-oduk': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-optical-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-optical-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-optical-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-line': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-line': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-line': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="encoding", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + self.__max_lsp_bandwidth = YANGDynClass(base=YANGListType("priority",max_lsp_bandwidth.max_lsp_bandwidth, yang_name="max-lsp-bandwidth", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='priority', extensions=None), is_container='list', yang_name="max-lsp-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-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 ['networks', 'te', 'templates', 'link-template', 'te-link-attributes', 'interface-switching-capability'] + + def _get_switching_capability(self): + """ + Getter method for switching_capability, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/interface_switching_capability/switching_capability (identityref) + + YANG Description: Switching capability for this interface. + """ + return self.__switching_capability + + def _set_switching_capability(self, v, load=False): + """ + Setter method for switching_capability, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/interface_switching_capability/switching_capability (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_switching_capability is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_switching_capability() directly. + + YANG Description: Switching capability for this 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=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'switching-psc1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-psc1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-psc1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-evpl': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-evpl': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-evpl': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-l2sc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-l2sc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-l2sc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-tdm': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-tdm': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-tdm': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-otn': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-otn': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-otn': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-dcsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-dcsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-dcsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-lsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-lsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-lsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-fsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-fsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-fsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="switching-capability", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """switching_capability must be of a type compatible with identityref""", + 'defined-type': "ietf-te-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'switching-psc1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-psc1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-psc1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-evpl': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-evpl': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-evpl': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-l2sc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-l2sc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-l2sc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-tdm': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-tdm': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-tdm': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-otn': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-otn': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-otn': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-dcsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-dcsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-dcsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-lsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-lsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-lsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-fsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-fsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-fsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="switching-capability", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True)""", + }) + + self.__switching_capability = t + if hasattr(self, '_set'): + self._set() + + def _unset_switching_capability(self): + self.__switching_capability = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'switching-psc1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-psc1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-psc1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-evpl': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-evpl': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-evpl': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-l2sc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-l2sc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-l2sc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-tdm': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-tdm': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-tdm': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-otn': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-otn': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-otn': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-dcsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-dcsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-dcsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-lsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-lsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-lsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-fsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-fsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-fsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="switching-capability", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + + + def _get_encoding(self): + """ + Getter method for encoding, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/interface_switching_capability/encoding (identityref) + + YANG Description: Encoding supported by this interface. + """ + return self.__encoding + + def _set_encoding(self, v, load=False): + """ + Setter method for encoding, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/interface_switching_capability/encoding (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_encoding is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_encoding() directly. + + YANG Description: Encoding supported by this 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=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'lsp-encoding-packet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-packet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-packet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-ethernet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-ethernet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-ethernet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-pdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-pdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-pdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-sdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-sdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-sdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-digital-wrapper': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-digital-wrapper': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-digital-wrapper': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-lambda': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-lambda': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-lambda': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-fiber': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-fiber': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-fiber': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-fiber-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-fiber-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-fiber-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-oduk': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-oduk': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-oduk': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-optical-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-optical-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-optical-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-line': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-line': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-line': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="encoding", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """encoding must be of a type compatible with identityref""", + 'defined-type': "ietf-te-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'lsp-encoding-packet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-packet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-packet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-ethernet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-ethernet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-ethernet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-pdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-pdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-pdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-sdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-sdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-sdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-digital-wrapper': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-digital-wrapper': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-digital-wrapper': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-lambda': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-lambda': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-lambda': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-fiber': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-fiber': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-fiber': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-fiber-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-fiber-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-fiber-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-oduk': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-oduk': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-oduk': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-optical-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-optical-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-optical-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-line': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-line': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-line': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="encoding", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True)""", + }) + + self.__encoding = t + if hasattr(self, '_set'): + self._set() + + def _unset_encoding(self): + self.__encoding = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'lsp-encoding-packet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-packet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-packet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-ethernet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-ethernet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-ethernet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-pdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-pdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-pdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-sdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-sdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-sdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-digital-wrapper': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-digital-wrapper': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-digital-wrapper': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-lambda': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-lambda': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-lambda': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-fiber': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-fiber': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-fiber': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-fiber-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-fiber-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-fiber-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-oduk': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-oduk': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-oduk': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-optical-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-optical-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-optical-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-line': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-line': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-line': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="encoding", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + + + def _get_max_lsp_bandwidth(self): + """ + Getter method for max_lsp_bandwidth, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/interface_switching_capability/max_lsp_bandwidth (list) + + YANG Description: Maximum Label Switched Path (LSP) bandwidth at +priorities 0-7. + """ + return self.__max_lsp_bandwidth + + def _set_max_lsp_bandwidth(self, v, load=False): + """ + Setter method for max_lsp_bandwidth, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/interface_switching_capability/max_lsp_bandwidth (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_max_lsp_bandwidth is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_max_lsp_bandwidth() directly. + + YANG Description: Maximum Label Switched Path (LSP) bandwidth at +priorities 0-7. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("priority",max_lsp_bandwidth.max_lsp_bandwidth, yang_name="max-lsp-bandwidth", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='priority', extensions=None), is_container='list', yang_name="max-lsp-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """max_lsp_bandwidth must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("priority",max_lsp_bandwidth.max_lsp_bandwidth, yang_name="max-lsp-bandwidth", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='priority', extensions=None), is_container='list', yang_name="max-lsp-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True)""", + }) + + self.__max_lsp_bandwidth = t + if hasattr(self, '_set'): + self._set() + + def _unset_max_lsp_bandwidth(self): + self.__max_lsp_bandwidth = YANGDynClass(base=YANGListType("priority",max_lsp_bandwidth.max_lsp_bandwidth, yang_name="max-lsp-bandwidth", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='priority', extensions=None), is_container='list', yang_name="max-lsp-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + + switching_capability = __builtin__.property(_get_switching_capability, _set_switching_capability) + encoding = __builtin__.property(_get_encoding, _set_encoding) + max_lsp_bandwidth = __builtin__.property(_get_max_lsp_bandwidth, _set_max_lsp_bandwidth) + + + _pyangbind_elements = OrderedDict([('switching_capability', switching_capability), ('encoding', encoding), ('max_lsp_bandwidth', max_lsp_bandwidth), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/interface_switching_capability/max_lsp_bandwidth/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/interface_switching_capability/max_lsp_bandwidth/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..976aba2418eaf78a4d4570a95dda27bb90af6034 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/interface_switching_capability/max_lsp_bandwidth/__init__.py @@ -0,0 +1,163 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 te_bandwidth +class max_lsp_bandwidth(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/te/templates/link-template/te-link-attributes/interface-switching-capability/max-lsp-bandwidth. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Maximum Label Switched Path (LSP) bandwidth at +priorities 0-7. + """ + __slots__ = ('_path_helper', '_extmethods', '__priority','__te_bandwidth',) + + _yang_name = 'max-lsp-bandwidth' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__priority = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..7']}), is_leaf=True, yang_name="priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint8', is_config=True) + self.__te_bandwidth = YANGDynClass(base=te_bandwidth.te_bandwidth, is_container='container', yang_name="te-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-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 ['networks', 'te', 'templates', 'link-template', 'te-link-attributes', 'interface-switching-capability', 'max-lsp-bandwidth'] + + def _get_priority(self): + """ + Getter method for priority, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/interface_switching_capability/max_lsp_bandwidth/priority (uint8) + + YANG Description: Priority. + """ + return self.__priority + + def _set_priority(self, v, load=False): + """ + Setter method for priority, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/interface_switching_capability/max_lsp_bandwidth/priority (uint8) + If this variable is read-only (config: false) in the + source YANG file, then _set_priority is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_priority() directly. + + YANG Description: Priority. + """ + 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=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..7']}), is_leaf=True, yang_name="priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint8', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """priority must be of a type compatible with uint8""", + 'defined-type': "uint8", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..7']}), is_leaf=True, yang_name="priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint8', is_config=True)""", + }) + + self.__priority = t + if hasattr(self, '_set'): + self._set() + + def _unset_priority(self): + self.__priority = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..7']}), is_leaf=True, yang_name="priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint8', is_config=True) + + + def _get_te_bandwidth(self): + """ + Getter method for te_bandwidth, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/interface_switching_capability/max_lsp_bandwidth/te_bandwidth (container) + + YANG Description: Container that specifies TE bandwidth. The choices +can be augmented for specific data-plane technologies. + """ + return self.__te_bandwidth + + def _set_te_bandwidth(self, v, load=False): + """ + Setter method for te_bandwidth, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/interface_switching_capability/max_lsp_bandwidth/te_bandwidth (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_te_bandwidth is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_te_bandwidth() directly. + + YANG Description: Container that specifies TE bandwidth. The choices +can be augmented for specific data-plane technologies. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=te_bandwidth.te_bandwidth, is_container='container', yang_name="te-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """te_bandwidth must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=te_bandwidth.te_bandwidth, is_container='container', yang_name="te-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__te_bandwidth = t + if hasattr(self, '_set'): + self._set() + + def _unset_te_bandwidth(self): + self.__te_bandwidth = YANGDynClass(base=te_bandwidth.te_bandwidth, is_container='container', yang_name="te-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + priority = __builtin__.property(_get_priority, _set_priority) + te_bandwidth = __builtin__.property(_get_te_bandwidth, _set_te_bandwidth) + + + _pyangbind_elements = OrderedDict([('priority', priority), ('te_bandwidth', te_bandwidth), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/interface_switching_capability/max_lsp_bandwidth/te_bandwidth/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/interface_switching_capability/max_lsp_bandwidth/te_bandwidth/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..f4549d5dfb7a767c1bb84378643b464cb0788e9e --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/interface_switching_capability/max_lsp_bandwidth/te_bandwidth/__init__.py @@ -0,0 +1,195 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 otn +class te_bandwidth(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/te/templates/link-template/te-link-attributes/interface-switching-capability/max-lsp-bandwidth/te-bandwidth. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Container that specifies TE bandwidth. The choices +can be augmented for specific data-plane technologies. + """ + __slots__ = ('_path_helper', '_extmethods', '__generic','__otn','__eth_bandwidth',) + + _yang_name = 'te-bandwidth' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__generic = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+(,(0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+))*'}), is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-bandwidth', is_config=True) + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + self.__eth_bandwidth = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), restriction_dict={'range': ['0..10000000000']}), is_leaf=True, yang_name="eth-bandwidth", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint64', 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 ['networks', 'te', 'templates', 'link-template', 'te-link-attributes', 'interface-switching-capability', 'max-lsp-bandwidth', 'te-bandwidth'] + + def _get_generic(self): + """ + Getter method for generic, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/interface_switching_capability/max_lsp_bandwidth/te_bandwidth/generic (te-bandwidth) + + YANG Description: Bandwidth specified in a generic format. + """ + return self.__generic + + def _set_generic(self, v, load=False): + """ + Setter method for generic, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/interface_switching_capability/max_lsp_bandwidth/te_bandwidth/generic (te-bandwidth) + If this variable is read-only (config: false) in the + source YANG file, then _set_generic is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_generic() directly. + + YANG Description: Bandwidth specified in a generic format. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+(,(0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+))*'}), is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-bandwidth', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """generic must be of a type compatible with te-bandwidth""", + 'defined-type': "ietf-te-topology:te-bandwidth", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+(,(0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+))*'}), is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-bandwidth', is_config=True)""", + }) + + self.__generic = t + if hasattr(self, '_set'): + self._set() + + def _unset_generic(self): + self.__generic = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+(,(0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+))*'}), is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-bandwidth', is_config=True) + + + def _get_otn(self): + """ + Getter method for otn, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/interface_switching_capability/max_lsp_bandwidth/te_bandwidth/otn (container) + + YANG Description: Maximum bandwidth attributes for OTN paths. + """ + return self.__otn + + def _set_otn(self, v, load=False): + """ + Setter method for otn, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/interface_switching_capability/max_lsp_bandwidth/te_bandwidth/otn (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_otn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_otn() directly. + + YANG Description: Maximum bandwidth attributes for OTN paths. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """otn must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True)""", + }) + + self.__otn = t + if hasattr(self, '_set'): + self._set() + + def _unset_otn(self): + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + + + def _get_eth_bandwidth(self): + """ + Getter method for eth_bandwidth, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/interface_switching_capability/max_lsp_bandwidth/te_bandwidth/eth_bandwidth (uint64) + + YANG Description: Available bandwith value expressed in kilobits per second + """ + return self.__eth_bandwidth + + def _set_eth_bandwidth(self, v, load=False): + """ + Setter method for eth_bandwidth, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/interface_switching_capability/max_lsp_bandwidth/te_bandwidth/eth_bandwidth (uint64) + If this variable is read-only (config: false) in the + source YANG file, then _set_eth_bandwidth is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_eth_bandwidth() directly. + + YANG Description: Available bandwith value expressed in kilobits per second + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), restriction_dict={'range': ['0..10000000000']}), is_leaf=True, yang_name="eth-bandwidth", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint64', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """eth_bandwidth must be of a type compatible with uint64""", + 'defined-type': "uint64", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), restriction_dict={'range': ['0..10000000000']}), is_leaf=True, yang_name="eth-bandwidth", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint64', is_config=True)""", + }) + + self.__eth_bandwidth = t + if hasattr(self, '_set'): + self._set() + + def _unset_eth_bandwidth(self): + self.__eth_bandwidth = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), restriction_dict={'range': ['0..10000000000']}), is_leaf=True, yang_name="eth-bandwidth", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint64', is_config=True) + + generic = __builtin__.property(_get_generic, _set_generic) + otn = __builtin__.property(_get_otn, _set_otn) + eth_bandwidth = __builtin__.property(_get_eth_bandwidth, _set_eth_bandwidth) + + __choices__ = {'technology': {'generic': ['generic'], 'otn': ['otn'], 'eth': ['eth_bandwidth']}} + _pyangbind_elements = OrderedDict([('generic', generic), ('otn', otn), ('eth_bandwidth', eth_bandwidth), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/interface_switching_capability/max_lsp_bandwidth/te_bandwidth/otn/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/interface_switching_capability/max_lsp_bandwidth/te_bandwidth/otn/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..d630e831749e4a8bc2bd99ea36f7890f8bd6cbd2 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/interface_switching_capability/max_lsp_bandwidth/te_bandwidth/otn/__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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 otn(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/te/templates/link-template/te-link-attributes/interface-switching-capability/max-lsp-bandwidth/te-bandwidth/otn. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Maximum bandwidth attributes for OTN paths. + """ + __slots__ = ('_path_helper', '_extmethods', '__odu_type','__max_ts_number',) + + _yang_name = 'otn' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__odu_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="odu-type", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + self.__max_ts_number = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="max-ts-number", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', 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 ['networks', 'te', 'templates', 'link-template', 'te-link-attributes', 'interface-switching-capability', 'max-lsp-bandwidth', 'te-bandwidth', 'otn'] + + def _get_odu_type(self): + """ + Getter method for odu_type, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/interface_switching_capability/max_lsp_bandwidth/te_bandwidth/otn/odu_type (identityref) + + YANG Description: ODU type + """ + return self.__odu_type + + def _set_odu_type(self, v, load=False): + """ + Setter method for odu_type, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/interface_switching_capability/max_lsp_bandwidth/te_bandwidth/otn/odu_type (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_odu_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_odu_type() directly. + + YANG Description: ODU type + """ + 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={'ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="odu-type", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """odu_type must be of a type compatible with identityref""", + 'defined-type': "ietf-otn-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="odu-type", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True)""", + }) + + self.__odu_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_odu_type(self): + self.__odu_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="odu-type", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + + + def _get_max_ts_number(self): + """ + Getter method for max_ts_number, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/interface_switching_capability/max_lsp_bandwidth/te_bandwidth/otn/max_ts_number (uint16) + + YANG Description: The maximum number of Tributary Slots (TS) that could be +used by an ODUflex LSP. + """ + return self.__max_ts_number + + def _set_max_ts_number(self, v, load=False): + """ + Setter method for max_ts_number, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/interface_switching_capability/max_lsp_bandwidth/te_bandwidth/otn/max_ts_number (uint16) + If this variable is read-only (config: false) in the + source YANG file, then _set_max_ts_number is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_max_ts_number() directly. + + YANG Description: The maximum number of Tributary Slots (TS) that could be +used by an ODUflex LSP. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="max-ts-number", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """max_ts_number must be of a type compatible with uint16""", + 'defined-type': "uint16", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="max-ts-number", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', is_config=True)""", + }) + + self.__max_ts_number = t + if hasattr(self, '_set'): + self._set() + + def _unset_max_ts_number(self): + self.__max_ts_number = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="max-ts-number", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', is_config=True) + + odu_type = __builtin__.property(_get_odu_type, _set_odu_type) + max_ts_number = __builtin__.property(_get_max_ts_number, _set_max_ts_number) + + __choices__ = {'technology': {'otn': ['odu_type', 'max_ts_number']}} + _pyangbind_elements = OrderedDict([('odu_type', odu_type), ('max_ts_number', max_ts_number), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/label_restrictions/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/label_restrictions/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..c3f81b42ba49fecd0e18e4e8e531d59d87bbffad --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/label_restrictions/__init__.py @@ -0,0 +1,120 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 label_restriction +class label_restrictions(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/te/templates/link-template/te-link-attributes/label-restrictions. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: The label restrictions container. + """ + __slots__ = ('_path_helper', '_extmethods', '__label_restriction',) + + _yang_name = 'label-restrictions' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__label_restriction = YANGDynClass(base=YANGListType("index",label_restriction.label_restriction, yang_name="label-restriction", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='index', extensions=None), is_container='list', yang_name="label-restriction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-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 ['networks', 'te', 'templates', 'link-template', 'te-link-attributes', 'label-restrictions'] + + def _get_label_restriction(self): + """ + Getter method for label_restriction, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/label_restrictions/label_restriction (list) + + YANG Description: The absence of the label restrictions container implies +that all labels are acceptable; otherwise, only restricted +labels are available. + """ + return self.__label_restriction + + def _set_label_restriction(self, v, load=False): + """ + Setter method for label_restriction, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/label_restrictions/label_restriction (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_label_restriction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_label_restriction() directly. + + YANG Description: The absence of the label restrictions container implies +that all labels are acceptable; otherwise, only restricted +labels are available. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("index",label_restriction.label_restriction, yang_name="label-restriction", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='index', extensions=None), is_container='list', yang_name="label-restriction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """label_restriction must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("index",label_restriction.label_restriction, yang_name="label-restriction", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='index', extensions=None), is_container='list', yang_name="label-restriction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True)""", + }) + + self.__label_restriction = t + if hasattr(self, '_set'): + self._set() + + def _unset_label_restriction(self): + self.__label_restriction = YANGDynClass(base=YANGListType("index",label_restriction.label_restriction, yang_name="label-restriction", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='index', extensions=None), is_container='list', yang_name="label-restriction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + + label_restriction = __builtin__.property(_get_label_restriction, _set_label_restriction) + + + _pyangbind_elements = OrderedDict([('label_restriction', label_restriction), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/label_restrictions/label_restriction/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/label_restrictions/label_restriction/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..aff15591b93e1cde0955cf81f4e68d3af0bbbdb3 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/label_restrictions/label_restriction/__init__.py @@ -0,0 +1,450 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 label_start +from . import label_end +from . import label_step +from . import otn_label_range +from . import ethernet_label_range +class label_restriction(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/te/templates/link-template/te-link-attributes/label-restrictions/label-restriction. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: The absence of the label restrictions container implies +that all labels are acceptable; otherwise, only restricted +labels are available. + """ + __slots__ = ('_path_helper', '_extmethods', '__restriction','__index','__label_start','__label_end','__label_step','__range_bitmap','__otn_label_range','__ethernet_label_range',) + + _yang_name = 'label-restriction' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__restriction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'inclusive': {}, 'exclusive': {}},), default=six.text_type("inclusive"), is_leaf=True, yang_name="restriction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='enumeration', is_config=True) + self.__index = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + self.__label_start = YANGDynClass(base=label_start.label_start, is_container='container', yang_name="label-start", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__label_end = YANGDynClass(base=label_end.label_end, is_container='container', yang_name="label-end", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__label_step = YANGDynClass(base=label_step.label_step, is_container='container', yang_name="label-step", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__range_bitmap = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}), is_leaf=True, yang_name="range-bitmap", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:hex-string', is_config=True) + self.__otn_label_range = YANGDynClass(base=otn_label_range.otn_label_range, is_container='container', yang_name="otn-label-range", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + self.__ethernet_label_range = YANGDynClass(base=ethernet_label_range.ethernet_label_range, is_container='container', yang_name="ethernet-label-range", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-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 ['networks', 'te', 'templates', 'link-template', 'te-link-attributes', 'label-restrictions', 'label-restriction'] + + def _get_restriction(self): + """ + Getter method for restriction, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/label_restrictions/label_restriction/restriction (enumeration) + + YANG Description: Indicates whether the list item is inclusive or exclusive. + """ + return self.__restriction + + def _set_restriction(self, v, load=False): + """ + Setter method for restriction, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/label_restrictions/label_restriction/restriction (enumeration) + If this variable is read-only (config: false) in the + source YANG file, then _set_restriction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_restriction() directly. + + YANG Description: Indicates whether the list item is inclusive or exclusive. + """ + 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={'inclusive': {}, 'exclusive': {}},), default=six.text_type("inclusive"), is_leaf=True, yang_name="restriction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='enumeration', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """restriction must be of a type compatible with enumeration""", + 'defined-type': "ietf-te-topology:enumeration", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'inclusive': {}, 'exclusive': {}},), default=six.text_type("inclusive"), is_leaf=True, yang_name="restriction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='enumeration', is_config=True)""", + }) + + self.__restriction = t + if hasattr(self, '_set'): + self._set() + + def _unset_restriction(self): + self.__restriction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'inclusive': {}, 'exclusive': {}},), default=six.text_type("inclusive"), is_leaf=True, yang_name="restriction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='enumeration', is_config=True) + + + def _get_index(self): + """ + Getter method for index, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/label_restrictions/label_restriction/index (uint32) + + YANG Description: The index of the label restriction list entry. + """ + return self.__index + + def _set_index(self, v, load=False): + """ + Setter method for index, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/label_restrictions/label_restriction/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 label restriction list entry. + """ + 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=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', 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), is_leaf=True, yang_name="index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', 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), is_leaf=True, yang_name="index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + + + def _get_label_start(self): + """ + Getter method for label_start, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/label_restrictions/label_restriction/label_start (container) + + YANG Description: This is the starting label if a label range is specified. +This is the label value if a single label is specified, +in which case the 'label-end' attribute is not set. + """ + return self.__label_start + + def _set_label_start(self, v, load=False): + """ + Setter method for label_start, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/label_restrictions/label_restriction/label_start (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_label_start is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_label_start() directly. + + YANG Description: This is the starting label if a label range is specified. +This is the label value if a single label is specified, +in which case the 'label-end' attribute is not set. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=label_start.label_start, is_container='container', yang_name="label-start", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """label_start must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=label_start.label_start, is_container='container', yang_name="label-start", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__label_start = t + if hasattr(self, '_set'): + self._set() + + def _unset_label_start(self): + self.__label_start = YANGDynClass(base=label_start.label_start, is_container='container', yang_name="label-start", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_label_end(self): + """ + Getter method for label_end, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/label_restrictions/label_restriction/label_end (container) + + YANG Description: This is the ending label if a label range is specified. +This attribute is not set if a single label is specified. + """ + return self.__label_end + + def _set_label_end(self, v, load=False): + """ + Setter method for label_end, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/label_restrictions/label_restriction/label_end (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_label_end is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_label_end() directly. + + YANG Description: This is the ending label if a label range is specified. +This attribute is not set if a single label is specified. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=label_end.label_end, is_container='container', yang_name="label-end", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """label_end must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=label_end.label_end, is_container='container', yang_name="label-end", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__label_end = t + if hasattr(self, '_set'): + self._set() + + def _unset_label_end(self): + self.__label_end = YANGDynClass(base=label_end.label_end, is_container='container', yang_name="label-end", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_label_step(self): + """ + Getter method for label_step, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/label_restrictions/label_restriction/label_step (container) + + YANG Description: The step increment between labels in the label range. +The label start/end values will have to be consistent +with the sign of label step. For example, +'label-start' < 'label-end' enforces 'label-step' > 0 +'label-start' > 'label-end' enforces 'label-step' < 0. + """ + return self.__label_step + + def _set_label_step(self, v, load=False): + """ + Setter method for label_step, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/label_restrictions/label_restriction/label_step (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_label_step is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_label_step() directly. + + YANG Description: The step increment between labels in the label range. +The label start/end values will have to be consistent +with the sign of label step. For example, +'label-start' < 'label-end' enforces 'label-step' > 0 +'label-start' > 'label-end' enforces 'label-step' < 0. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=label_step.label_step, is_container='container', yang_name="label-step", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """label_step must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=label_step.label_step, is_container='container', yang_name="label-step", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__label_step = t + if hasattr(self, '_set'): + self._set() + + def _unset_label_step(self): + self.__label_step = YANGDynClass(base=label_step.label_step, is_container='container', yang_name="label-step", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_range_bitmap(self): + """ + Getter method for range_bitmap, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/label_restrictions/label_restriction/range_bitmap (yang:hex-string) + + YANG Description: When there are gaps between 'label-start' and 'label-end', +this attribute is used to specify the positions +of the used labels. This is represented in big endian as +'hex-string'. +The most significant byte in the hex-string is the farthest +to the left in the byte sequence. Leading zero bytes in the +configured value may be omitted for brevity. +Each bit position in the 'range-bitmap' 'hex-string' maps +to a label in the range derived from 'label-start'. + +For example, assuming that 'label-start' = 16000 and +'range-bitmap' = 0x01000001, then: + +- bit position (0) is set, and the corresponding mapped + label from the range is 16000 + (0 * 'label-step') or + 16000 for default 'label-step' = 1. +- bit position (24) is set, and the corresponding mapped + label from the range is 16000 + (24 * 'label-step') or + 16024 for default 'label-step' = 1. + """ + return self.__range_bitmap + + def _set_range_bitmap(self, v, load=False): + """ + Setter method for range_bitmap, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/label_restrictions/label_restriction/range_bitmap (yang:hex-string) + If this variable is read-only (config: false) in the + source YANG file, then _set_range_bitmap is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_range_bitmap() directly. + + YANG Description: When there are gaps between 'label-start' and 'label-end', +this attribute is used to specify the positions +of the used labels. This is represented in big endian as +'hex-string'. +The most significant byte in the hex-string is the farthest +to the left in the byte sequence. Leading zero bytes in the +configured value may be omitted for brevity. +Each bit position in the 'range-bitmap' 'hex-string' maps +to a label in the range derived from 'label-start'. + +For example, assuming that 'label-start' = 16000 and +'range-bitmap' = 0x01000001, then: + +- bit position (0) is set, and the corresponding mapped + label from the range is 16000 + (0 * 'label-step') or + 16000 for default 'label-step' = 1. +- bit position (24) is set, and the corresponding mapped + label from the range is 16000 + (24 * 'label-step') or + 16024 for default 'label-step' = 1. + """ + 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})*)?'}), is_leaf=True, yang_name="range-bitmap", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:hex-string', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """range_bitmap must be of a type compatible with yang:hex-string""", + 'defined-type': "yang:hex-string", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}), is_leaf=True, yang_name="range-bitmap", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:hex-string', is_config=True)""", + }) + + self.__range_bitmap = t + if hasattr(self, '_set'): + self._set() + + def _unset_range_bitmap(self): + self.__range_bitmap = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}), is_leaf=True, yang_name="range-bitmap", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:hex-string', is_config=True) + + + def _get_otn_label_range(self): + """ + Getter method for otn_label_range, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/label_restrictions/label_restriction/otn_label_range (container) + + YANG Description: Label range information for OTN. + """ + return self.__otn_label_range + + def _set_otn_label_range(self, v, load=False): + """ + Setter method for otn_label_range, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/label_restrictions/label_restriction/otn_label_range (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_otn_label_range is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_otn_label_range() directly. + + YANG Description: Label range information for OTN. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=otn_label_range.otn_label_range, is_container='container', yang_name="otn-label-range", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """otn_label_range must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=otn_label_range.otn_label_range, is_container='container', yang_name="otn-label-range", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True)""", + }) + + self.__otn_label_range = t + if hasattr(self, '_set'): + self._set() + + def _unset_otn_label_range(self): + self.__otn_label_range = YANGDynClass(base=otn_label_range.otn_label_range, is_container='container', yang_name="otn-label-range", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + + + def _get_ethernet_label_range(self): + """ + Getter method for ethernet_label_range, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/label_restrictions/label_restriction/ethernet_label_range (container) + + YANG Description: Ethernet-specific label range related information. + """ + return self.__ethernet_label_range + + def _set_ethernet_label_range(self, v, load=False): + """ + Setter method for ethernet_label_range, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/label_restrictions/label_restriction/ethernet_label_range (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_ethernet_label_range is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_ethernet_label_range() directly. + + YANG Description: Ethernet-specific label range related information. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=ethernet_label_range.ethernet_label_range, is_container='container', yang_name="ethernet-label-range", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """ethernet_label_range must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=ethernet_label_range.ethernet_label_range, is_container='container', yang_name="ethernet-label-range", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='container', is_config=True)""", + }) + + self.__ethernet_label_range = t + if hasattr(self, '_set'): + self._set() + + def _unset_ethernet_label_range(self): + self.__ethernet_label_range = YANGDynClass(base=ethernet_label_range.ethernet_label_range, is_container='container', yang_name="ethernet-label-range", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='container', is_config=True) + + restriction = __builtin__.property(_get_restriction, _set_restriction) + index = __builtin__.property(_get_index, _set_index) + label_start = __builtin__.property(_get_label_start, _set_label_start) + label_end = __builtin__.property(_get_label_end, _set_label_end) + label_step = __builtin__.property(_get_label_step, _set_label_step) + range_bitmap = __builtin__.property(_get_range_bitmap, _set_range_bitmap) + otn_label_range = __builtin__.property(_get_otn_label_range, _set_otn_label_range) + ethernet_label_range = __builtin__.property(_get_ethernet_label_range, _set_ethernet_label_range) + + + _pyangbind_elements = OrderedDict([('restriction', restriction), ('index', index), ('label_start', label_start), ('label_end', label_end), ('label_step', label_step), ('range_bitmap', range_bitmap), ('otn_label_range', otn_label_range), ('ethernet_label_range', ethernet_label_range), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/label_restrictions/label_restriction/ethernet_label_range/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/label_restrictions/label_restriction/ethernet_label_range/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..eae880f42853b13c519ca86c5ebe6851f7553575 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/label_restrictions/label_restriction/ethernet_label_range/__init__.py @@ -0,0 +1,154 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 ethernet_label_range(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/te/templates/link-template/te-link-attributes/label-restrictions/label-restriction/ethernet-label-range. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Ethernet-specific label range related information. + """ + __slots__ = ('_path_helper', '_extmethods', '__tag_type','__priority',) + + _yang_name = 'ethernet-label-range' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__tag_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 's-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:s-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:s-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}},), is_leaf=True, yang_name="tag-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:eth-tag-type', is_config=True) + self.__priority = YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), is_leaf=True, yang_name="priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', 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 ['networks', 'te', 'templates', 'link-template', 'te-link-attributes', 'label-restrictions', 'label-restriction', 'ethernet-label-range'] + + def _get_tag_type(self): + """ + Getter method for tag_type, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/label_restrictions/label_restriction/ethernet_label_range/tag_type (etht-types:eth-tag-type) + + YANG Description: VLAN tag type. + """ + return self.__tag_type + + def _set_tag_type(self, v, load=False): + """ + Setter method for tag_type, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/label_restrictions/label_restriction/ethernet_label_range/tag_type (etht-types:eth-tag-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_tag_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tag_type() directly. + + YANG Description: VLAN tag type. + """ + 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={'c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 's-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:s-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:s-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}},), is_leaf=True, yang_name="tag-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:eth-tag-type', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tag_type must be of a type compatible with etht-types:eth-tag-type""", + 'defined-type': "etht-types:eth-tag-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 's-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:s-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:s-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}},), is_leaf=True, yang_name="tag-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:eth-tag-type', is_config=True)""", + }) + + self.__tag_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_tag_type(self): + self.__tag_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 's-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:s-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:s-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}},), is_leaf=True, yang_name="tag-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:eth-tag-type', is_config=True) + + + def _get_priority(self): + """ + Getter method for priority, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/label_restrictions/label_restriction/ethernet_label_range/priority (uint8) + + YANG Description: priority. + """ + return self.__priority + + def _set_priority(self, v, load=False): + """ + Setter method for priority, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/label_restrictions/label_restriction/ethernet_label_range/priority (uint8) + If this variable is read-only (config: false) in the + source YANG file, then _set_priority is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_priority() directly. + + YANG Description: priority. + """ + 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="priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint8', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """priority 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="priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint8', is_config=True)""", + }) + + self.__priority = t + if hasattr(self, '_set'): + self._set() + + def _unset_priority(self): + self.__priority = YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), is_leaf=True, yang_name="priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint8', is_config=True) + + tag_type = __builtin__.property(_get_tag_type, _set_tag_type) + priority = __builtin__.property(_get_priority, _set_priority) + + + _pyangbind_elements = OrderedDict([('tag_type', tag_type), ('priority', priority), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/label_restrictions/label_restriction/label_end/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/label_restrictions/label_restriction/label_end/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e9e68e82813498c6f37d21826d7ce86a9a0ae979 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/label_restrictions/label_restriction/label_end/__init__.py @@ -0,0 +1,119 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 te_label +class label_end(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/te/templates/link-template/te-link-attributes/label-restrictions/label-restriction/label-end. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: This is the ending label if a label range is specified. +This attribute is not set if a single label is specified. + """ + __slots__ = ('_path_helper', '_extmethods', '__te_label',) + + _yang_name = 'label-end' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__te_label = YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-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 ['networks', 'te', 'templates', 'link-template', 'te-link-attributes', 'label-restrictions', 'label-restriction', 'label-end'] + + def _get_te_label(self): + """ + Getter method for te_label, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/label_restrictions/label_restriction/label_end/te_label (container) + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + return self.__te_label + + def _set_te_label(self, v, load=False): + """ + Setter method for te_label, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/label_restrictions/label_restriction/label_end/te_label (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_te_label is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_te_label() directly. + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """te_label must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__te_label = t + if hasattr(self, '_set'): + self._set() + + def _unset_te_label(self): + self.__te_label = YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + te_label = __builtin__.property(_get_te_label, _set_te_label) + + + _pyangbind_elements = OrderedDict([('te_label', te_label), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/label_restrictions/label_restriction/label_end/te_label/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/label_restrictions/label_restriction/label_end/te_label/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..1fdead5d277f6d95d4940f56956903e08eb0dee6 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/label_restrictions/label_restriction/label_end/te_label/__init__.py @@ -0,0 +1,234 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 otn +class te_label(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/te/templates/link-template/te-link-attributes/label-restrictions/label-restriction/label-end/te-label. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + __slots__ = ('_path_helper', '_extmethods', '__generic','__otn','__vlanid','__direction',) + + _yang_name = 'te-label' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__generic = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True) + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + self.__vlanid = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True) + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', 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 ['networks', 'te', 'templates', 'link-template', 'te-link-attributes', 'label-restrictions', 'label-restriction', 'label-end', 'te-label'] + + def _get_generic(self): + """ + Getter method for generic, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/label_restrictions/label_restriction/label_end/te_label/generic (rt-types:generalized-label) + + YANG Description: TE label specified in a generic format. + """ + return self.__generic + + def _set_generic(self, v, load=False): + """ + Setter method for generic, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/label_restrictions/label_restriction/label_end/te_label/generic (rt-types:generalized-label) + If this variable is read-only (config: false) in the + source YANG file, then _set_generic is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_generic() directly. + + YANG Description: TE label specified in a generic format. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """generic must be of a type compatible with rt-types:generalized-label""", + 'defined-type': "rt-types:generalized-label", + 'generated-type': """YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True)""", + }) + + self.__generic = t + if hasattr(self, '_set'): + self._set() + + def _unset_generic(self): + self.__generic = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True) + + + def _get_otn(self): + """ + Getter method for otn, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/label_restrictions/label_restriction/label_end/te_label/otn (container) + + YANG Description: Label start or label end for OTN. + """ + return self.__otn + + def _set_otn(self, v, load=False): + """ + Setter method for otn, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/label_restrictions/label_restriction/label_end/te_label/otn (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_otn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_otn() directly. + + YANG Description: Label start or label end for OTN. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """otn must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True)""", + }) + + self.__otn = t + if hasattr(self, '_set'): + self._set() + + def _unset_otn(self): + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + + + def _get_vlanid(self): + """ + Getter method for vlanid, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/label_restrictions/label_restriction/label_end/te_label/vlanid (etht-types:vlanid) + + YANG Description: VLAN tag id. + """ + return self.__vlanid + + def _set_vlanid(self, v, load=False): + """ + Setter method for vlanid, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/label_restrictions/label_restriction/label_end/te_label/vlanid (etht-types:vlanid) + If this variable is read-only (config: false) in the + source YANG file, then _set_vlanid is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_vlanid() directly. + + YANG Description: VLAN tag id. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """vlanid must be of a type compatible with etht-types:vlanid""", + 'defined-type': "etht-types:vlanid", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True)""", + }) + + self.__vlanid = t + if hasattr(self, '_set'): + self._set() + + def _unset_vlanid(self): + self.__vlanid = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True) + + + def _get_direction(self): + """ + Getter method for direction, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/label_restrictions/label_restriction/label_end/te_label/direction (te-label-direction) + + YANG Description: Label direction. + """ + return self.__direction + + def _set_direction(self, v, load=False): + """ + Setter method for direction, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/label_restrictions/label_restriction/label_end/te_label/direction (te-label-direction) + If this variable is read-only (config: false) in the + source YANG file, then _set_direction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_direction() directly. + + YANG Description: Label direction. + """ + 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={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """direction must be of a type compatible with te-label-direction""", + 'defined-type': "ietf-te-topology:te-label-direction", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=True)""", + }) + + self.__direction = t + if hasattr(self, '_set'): + self._set() + + def _unset_direction(self): + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=True) + + generic = __builtin__.property(_get_generic, _set_generic) + otn = __builtin__.property(_get_otn, _set_otn) + vlanid = __builtin__.property(_get_vlanid, _set_vlanid) + direction = __builtin__.property(_get_direction, _set_direction) + + __choices__ = {'technology': {'generic': ['generic'], 'otn': ['otn'], 'eth': ['vlanid']}} + _pyangbind_elements = OrderedDict([('generic', generic), ('otn', otn), ('vlanid', vlanid), ('direction', direction), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/label_restrictions/label_restriction/label_end/te_label/otn/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/label_restrictions/label_restriction/label_end/te_label/otn/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..c0cf47b54de55389fa826072cfca14ed282cdef3 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/label_restrictions/label_restriction/label_end/te_label/otn/__init__.py @@ -0,0 +1,154 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 otn(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/te/templates/link-template/te-link-attributes/label-restrictions/label-restriction/label-end/te-label/otn. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Label start or label end for OTN. + """ + __slots__ = ('_path_helper', '_extmethods', '__tpn','__ts',) + + _yang_name = 'otn' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__tpn = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('range-type', 'trib-port'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True) + self.__ts = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts", parent=self, choice=('range-type', 'trib-slot'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-ts', 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 ['networks', 'te', 'templates', 'link-template', 'te-link-attributes', 'label-restrictions', 'label-restriction', 'label-end', 'te-label', 'otn'] + + def _get_tpn(self): + """ + Getter method for tpn, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/label_restrictions/label_restriction/label_end/te_label/otn/tpn (otn-tpn) + + YANG Description: Tributary Port Number (TPN). + """ + return self.__tpn + + def _set_tpn(self, v, load=False): + """ + Setter method for tpn, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/label_restrictions/label_restriction/label_end/te_label/otn/tpn (otn-tpn) + If this variable is read-only (config: false) in the + source YANG file, then _set_tpn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tpn() directly. + + YANG Description: Tributary Port Number (TPN). + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('range-type', 'trib-port'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tpn must be of a type compatible with otn-tpn""", + 'defined-type': "ietf-otn-topology:otn-tpn", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('range-type', 'trib-port'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True)""", + }) + + self.__tpn = t + if hasattr(self, '_set'): + self._set() + + def _unset_tpn(self): + self.__tpn = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('range-type', 'trib-port'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True) + + + def _get_ts(self): + """ + Getter method for ts, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/label_restrictions/label_restriction/label_end/te_label/otn/ts (otn-ts) + + YANG Description: Tributary Slot (TS) number. + """ + return self.__ts + + def _set_ts(self, v, load=False): + """ + Setter method for ts, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/label_restrictions/label_restriction/label_end/te_label/otn/ts (otn-ts) + If this variable is read-only (config: false) in the + source YANG file, then _set_ts is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_ts() directly. + + YANG Description: Tributary Slot (TS) number. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts", parent=self, choice=('range-type', 'trib-slot'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-ts', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """ts must be of a type compatible with otn-ts""", + 'defined-type': "ietf-otn-topology:otn-ts", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts", parent=self, choice=('range-type', 'trib-slot'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-ts', is_config=True)""", + }) + + self.__ts = t + if hasattr(self, '_set'): + self._set() + + def _unset_ts(self): + self.__ts = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts", parent=self, choice=('range-type', 'trib-slot'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-ts', is_config=True) + + tpn = __builtin__.property(_get_tpn, _set_tpn) + ts = __builtin__.property(_get_ts, _set_ts) + + __choices__ = {'range-type': {'trib-port': ['tpn'], 'trib-slot': ['ts']}} + _pyangbind_elements = OrderedDict([('tpn', tpn), ('ts', ts), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/label_restrictions/label_restriction/label_start/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/label_restrictions/label_restriction/label_start/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..c9b398df7aaa03b2d953e5db080c54f940869194 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/label_restrictions/label_restriction/label_start/__init__.py @@ -0,0 +1,120 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 te_label +class label_start(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/te/templates/link-template/te-link-attributes/label-restrictions/label-restriction/label-start. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: This is the starting label if a label range is specified. +This is the label value if a single label is specified, +in which case the 'label-end' attribute is not set. + """ + __slots__ = ('_path_helper', '_extmethods', '__te_label',) + + _yang_name = 'label-start' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__te_label = YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-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 ['networks', 'te', 'templates', 'link-template', 'te-link-attributes', 'label-restrictions', 'label-restriction', 'label-start'] + + def _get_te_label(self): + """ + Getter method for te_label, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/label_restrictions/label_restriction/label_start/te_label (container) + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + return self.__te_label + + def _set_te_label(self, v, load=False): + """ + Setter method for te_label, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/label_restrictions/label_restriction/label_start/te_label (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_te_label is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_te_label() directly. + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """te_label must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__te_label = t + if hasattr(self, '_set'): + self._set() + + def _unset_te_label(self): + self.__te_label = YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + te_label = __builtin__.property(_get_te_label, _set_te_label) + + + _pyangbind_elements = OrderedDict([('te_label', te_label), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/label_restrictions/label_restriction/label_start/te_label/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/label_restrictions/label_restriction/label_start/te_label/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..bbd976bc987b02e370bcc7f9cea8e155e4b97a5d --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/label_restrictions/label_restriction/label_start/te_label/__init__.py @@ -0,0 +1,234 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 otn +class te_label(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/te/templates/link-template/te-link-attributes/label-restrictions/label-restriction/label-start/te-label. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + __slots__ = ('_path_helper', '_extmethods', '__generic','__otn','__vlanid','__direction',) + + _yang_name = 'te-label' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__generic = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True) + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + self.__vlanid = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True) + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', 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 ['networks', 'te', 'templates', 'link-template', 'te-link-attributes', 'label-restrictions', 'label-restriction', 'label-start', 'te-label'] + + def _get_generic(self): + """ + Getter method for generic, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/label_restrictions/label_restriction/label_start/te_label/generic (rt-types:generalized-label) + + YANG Description: TE label specified in a generic format. + """ + return self.__generic + + def _set_generic(self, v, load=False): + """ + Setter method for generic, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/label_restrictions/label_restriction/label_start/te_label/generic (rt-types:generalized-label) + If this variable is read-only (config: false) in the + source YANG file, then _set_generic is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_generic() directly. + + YANG Description: TE label specified in a generic format. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """generic must be of a type compatible with rt-types:generalized-label""", + 'defined-type': "rt-types:generalized-label", + 'generated-type': """YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True)""", + }) + + self.__generic = t + if hasattr(self, '_set'): + self._set() + + def _unset_generic(self): + self.__generic = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True) + + + def _get_otn(self): + """ + Getter method for otn, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/label_restrictions/label_restriction/label_start/te_label/otn (container) + + YANG Description: Label start or label end for OTN. + """ + return self.__otn + + def _set_otn(self, v, load=False): + """ + Setter method for otn, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/label_restrictions/label_restriction/label_start/te_label/otn (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_otn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_otn() directly. + + YANG Description: Label start or label end for OTN. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """otn must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True)""", + }) + + self.__otn = t + if hasattr(self, '_set'): + self._set() + + def _unset_otn(self): + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + + + def _get_vlanid(self): + """ + Getter method for vlanid, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/label_restrictions/label_restriction/label_start/te_label/vlanid (etht-types:vlanid) + + YANG Description: VLAN tag id. + """ + return self.__vlanid + + def _set_vlanid(self, v, load=False): + """ + Setter method for vlanid, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/label_restrictions/label_restriction/label_start/te_label/vlanid (etht-types:vlanid) + If this variable is read-only (config: false) in the + source YANG file, then _set_vlanid is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_vlanid() directly. + + YANG Description: VLAN tag id. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """vlanid must be of a type compatible with etht-types:vlanid""", + 'defined-type': "etht-types:vlanid", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True)""", + }) + + self.__vlanid = t + if hasattr(self, '_set'): + self._set() + + def _unset_vlanid(self): + self.__vlanid = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True) + + + def _get_direction(self): + """ + Getter method for direction, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/label_restrictions/label_restriction/label_start/te_label/direction (te-label-direction) + + YANG Description: Label direction. + """ + return self.__direction + + def _set_direction(self, v, load=False): + """ + Setter method for direction, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/label_restrictions/label_restriction/label_start/te_label/direction (te-label-direction) + If this variable is read-only (config: false) in the + source YANG file, then _set_direction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_direction() directly. + + YANG Description: Label direction. + """ + 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={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """direction must be of a type compatible with te-label-direction""", + 'defined-type': "ietf-te-topology:te-label-direction", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=True)""", + }) + + self.__direction = t + if hasattr(self, '_set'): + self._set() + + def _unset_direction(self): + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=True) + + generic = __builtin__.property(_get_generic, _set_generic) + otn = __builtin__.property(_get_otn, _set_otn) + vlanid = __builtin__.property(_get_vlanid, _set_vlanid) + direction = __builtin__.property(_get_direction, _set_direction) + + __choices__ = {'technology': {'generic': ['generic'], 'otn': ['otn'], 'eth': ['vlanid']}} + _pyangbind_elements = OrderedDict([('generic', generic), ('otn', otn), ('vlanid', vlanid), ('direction', direction), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/label_restrictions/label_restriction/label_start/te_label/otn/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/label_restrictions/label_restriction/label_start/te_label/otn/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..900ca9468dc43801e52b5939966added4e6516f9 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/label_restrictions/label_restriction/label_start/te_label/otn/__init__.py @@ -0,0 +1,154 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 otn(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/te/templates/link-template/te-link-attributes/label-restrictions/label-restriction/label-start/te-label/otn. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Label start or label end for OTN. + """ + __slots__ = ('_path_helper', '_extmethods', '__tpn','__ts',) + + _yang_name = 'otn' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__tpn = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('range-type', 'trib-port'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True) + self.__ts = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts", parent=self, choice=('range-type', 'trib-slot'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-ts', 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 ['networks', 'te', 'templates', 'link-template', 'te-link-attributes', 'label-restrictions', 'label-restriction', 'label-start', 'te-label', 'otn'] + + def _get_tpn(self): + """ + Getter method for tpn, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/label_restrictions/label_restriction/label_start/te_label/otn/tpn (otn-tpn) + + YANG Description: Tributary Port Number (TPN). + """ + return self.__tpn + + def _set_tpn(self, v, load=False): + """ + Setter method for tpn, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/label_restrictions/label_restriction/label_start/te_label/otn/tpn (otn-tpn) + If this variable is read-only (config: false) in the + source YANG file, then _set_tpn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tpn() directly. + + YANG Description: Tributary Port Number (TPN). + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('range-type', 'trib-port'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tpn must be of a type compatible with otn-tpn""", + 'defined-type': "ietf-otn-topology:otn-tpn", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('range-type', 'trib-port'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True)""", + }) + + self.__tpn = t + if hasattr(self, '_set'): + self._set() + + def _unset_tpn(self): + self.__tpn = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('range-type', 'trib-port'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True) + + + def _get_ts(self): + """ + Getter method for ts, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/label_restrictions/label_restriction/label_start/te_label/otn/ts (otn-ts) + + YANG Description: Tributary Slot (TS) number. + """ + return self.__ts + + def _set_ts(self, v, load=False): + """ + Setter method for ts, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/label_restrictions/label_restriction/label_start/te_label/otn/ts (otn-ts) + If this variable is read-only (config: false) in the + source YANG file, then _set_ts is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_ts() directly. + + YANG Description: Tributary Slot (TS) number. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts", parent=self, choice=('range-type', 'trib-slot'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-ts', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """ts must be of a type compatible with otn-ts""", + 'defined-type': "ietf-otn-topology:otn-ts", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts", parent=self, choice=('range-type', 'trib-slot'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-ts', is_config=True)""", + }) + + self.__ts = t + if hasattr(self, '_set'): + self._set() + + def _unset_ts(self): + self.__ts = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts", parent=self, choice=('range-type', 'trib-slot'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-ts', is_config=True) + + tpn = __builtin__.property(_get_tpn, _set_tpn) + ts = __builtin__.property(_get_ts, _set_ts) + + __choices__ = {'range-type': {'trib-port': ['tpn'], 'trib-slot': ['ts']}} + _pyangbind_elements = OrderedDict([('tpn', tpn), ('ts', ts), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/label_restrictions/label_restriction/label_step/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/label_restrictions/label_restriction/label_step/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..8b580328d5b57041494b1b0beb8a6ebbaf8f60b2 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/label_restrictions/label_restriction/label_step/__init__.py @@ -0,0 +1,200 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 otn +class label_step(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/te/templates/link-template/te-link-attributes/label-restrictions/label-restriction/label-step. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: The step increment between labels in the label range. +The label start/end values will have to be consistent +with the sign of label step. For example, +'label-start' < 'label-end' enforces 'label-step' > 0 +'label-start' > 'label-end' enforces 'label-step' < 0. + """ + __slots__ = ('_path_helper', '_extmethods', '__generic','__otn','__eth_step',) + + _yang_name = 'label-step' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__generic = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['-2147483648..2147483647']}, int_size=32), default=RestrictedClassType(base_type=long, restriction_dict={'range': ['-2147483648..2147483647']}, int_size=32)(1), is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='int32', is_config=True) + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + self.__eth_step = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), default=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16)(1), is_leaf=True, yang_name="eth-step", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint16', 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 ['networks', 'te', 'templates', 'link-template', 'te-link-attributes', 'label-restrictions', 'label-restriction', 'label-step'] + + def _get_generic(self): + """ + Getter method for generic, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/label_restrictions/label_restriction/label_step/generic (int32) + + YANG Description: Label range step. + """ + return self.__generic + + def _set_generic(self, v, load=False): + """ + Setter method for generic, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/label_restrictions/label_restriction/label_step/generic (int32) + If this variable is read-only (config: false) in the + source YANG file, then _set_generic is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_generic() directly. + + YANG Description: Label range step. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['-2147483648..2147483647']}, int_size=32), default=RestrictedClassType(base_type=long, restriction_dict={'range': ['-2147483648..2147483647']}, int_size=32)(1), is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='int32', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """generic must be of a type compatible with int32""", + 'defined-type': "int32", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['-2147483648..2147483647']}, int_size=32), default=RestrictedClassType(base_type=long, restriction_dict={'range': ['-2147483648..2147483647']}, int_size=32)(1), is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='int32', is_config=True)""", + }) + + self.__generic = t + if hasattr(self, '_set'): + self._set() + + def _unset_generic(self): + self.__generic = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['-2147483648..2147483647']}, int_size=32), default=RestrictedClassType(base_type=long, restriction_dict={'range': ['-2147483648..2147483647']}, int_size=32)(1), is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='int32', is_config=True) + + + def _get_otn(self): + """ + Getter method for otn, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/label_restrictions/label_restriction/label_step/otn (container) + + YANG Description: Label step for OTN + """ + return self.__otn + + def _set_otn(self, v, load=False): + """ + Setter method for otn, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/label_restrictions/label_restriction/label_step/otn (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_otn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_otn() directly. + + YANG Description: Label step for OTN + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """otn must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True)""", + }) + + self.__otn = t + if hasattr(self, '_set'): + self._set() + + def _unset_otn(self): + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + + + def _get_eth_step(self): + """ + Getter method for eth_step, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/label_restrictions/label_restriction/label_step/eth_step (uint16) + + YANG Description: Label step which represent possible increments for +an Ethernet VLAN tag. + """ + return self.__eth_step + + def _set_eth_step(self, v, load=False): + """ + Setter method for eth_step, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/label_restrictions/label_restriction/label_step/eth_step (uint16) + If this variable is read-only (config: false) in the + source YANG file, then _set_eth_step is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_eth_step() directly. + + YANG Description: Label step which represent possible increments for +an Ethernet VLAN tag. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), default=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16)(1), is_leaf=True, yang_name="eth-step", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint16', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """eth_step must be of a type compatible with uint16""", + 'defined-type': "uint16", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), default=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16)(1), is_leaf=True, yang_name="eth-step", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint16', is_config=True)""", + }) + + self.__eth_step = t + if hasattr(self, '_set'): + self._set() + + def _unset_eth_step(self): + self.__eth_step = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), default=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16)(1), is_leaf=True, yang_name="eth-step", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint16', is_config=True) + + generic = __builtin__.property(_get_generic, _set_generic) + otn = __builtin__.property(_get_otn, _set_otn) + eth_step = __builtin__.property(_get_eth_step, _set_eth_step) + + __choices__ = {'technology': {'generic': ['generic'], 'otn': ['otn'], 'eth': ['eth_step']}} + _pyangbind_elements = OrderedDict([('generic', generic), ('otn', otn), ('eth_step', eth_step), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/label_restrictions/label_restriction/label_step/otn/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/label_restrictions/label_restriction/label_step/otn/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..d47950a6b20dc33b6fc4c56ec038ba6bdf6ed032 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/label_restrictions/label_restriction/label_step/otn/__init__.py @@ -0,0 +1,158 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 otn(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/te/templates/link-template/te-link-attributes/label-restrictions/label-restriction/label-step/otn. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Label step for OTN + """ + __slots__ = ('_path_helper', '_extmethods', '__tpn','__ts',) + + _yang_name = 'otn' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__tpn = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('range-type', 'trib-port'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True) + self.__ts = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts", parent=self, choice=('range-type', 'trib-slot'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-ts', 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 ['networks', 'te', 'templates', 'link-template', 'te-link-attributes', 'label-restrictions', 'label-restriction', 'label-step', 'otn'] + + def _get_tpn(self): + """ + Getter method for tpn, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/label_restrictions/label_restriction/label_step/otn/tpn (otn-tpn) + + YANG Description: Label step which represents possible increments for +Tributary Port Number (TPN). + """ + return self.__tpn + + def _set_tpn(self, v, load=False): + """ + Setter method for tpn, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/label_restrictions/label_restriction/label_step/otn/tpn (otn-tpn) + If this variable is read-only (config: false) in the + source YANG file, then _set_tpn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tpn() directly. + + YANG Description: Label step which represents possible increments for +Tributary Port Number (TPN). + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('range-type', 'trib-port'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tpn must be of a type compatible with otn-tpn""", + 'defined-type': "ietf-otn-topology:otn-tpn", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('range-type', 'trib-port'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True)""", + }) + + self.__tpn = t + if hasattr(self, '_set'): + self._set() + + def _unset_tpn(self): + self.__tpn = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('range-type', 'trib-port'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True) + + + def _get_ts(self): + """ + Getter method for ts, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/label_restrictions/label_restriction/label_step/otn/ts (otn-ts) + + YANG Description: Label step which represents possible increments for +Tributary Slot (TS) number. + """ + return self.__ts + + def _set_ts(self, v, load=False): + """ + Setter method for ts, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/label_restrictions/label_restriction/label_step/otn/ts (otn-ts) + If this variable is read-only (config: false) in the + source YANG file, then _set_ts is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_ts() directly. + + YANG Description: Label step which represents possible increments for +Tributary Slot (TS) number. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts", parent=self, choice=('range-type', 'trib-slot'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-ts', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """ts must be of a type compatible with otn-ts""", + 'defined-type': "ietf-otn-topology:otn-ts", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts", parent=self, choice=('range-type', 'trib-slot'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-ts', is_config=True)""", + }) + + self.__ts = t + if hasattr(self, '_set'): + self._set() + + def _unset_ts(self): + self.__ts = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts", parent=self, choice=('range-type', 'trib-slot'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-ts', is_config=True) + + tpn = __builtin__.property(_get_tpn, _set_tpn) + ts = __builtin__.property(_get_ts, _set_ts) + + __choices__ = {'range-type': {'trib-port': ['tpn'], 'trib-slot': ['ts']}} + _pyangbind_elements = OrderedDict([('tpn', tpn), ('ts', ts), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/label_restrictions/label_restriction/otn_label_range/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/label_restrictions/label_restriction/otn_label_range/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..2a0404874f34a50caea7e5927ab64ad601e9357b --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/label_restrictions/label_restriction/otn_label_range/__init__.py @@ -0,0 +1,256 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 otn_label_range(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/te/templates/link-template/te-link-attributes/label-restrictions/label-restriction/otn-label-range. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Label range information for OTN. + """ + __slots__ = ('_path_helper', '_extmethods', '__range_type','__tsg','__odu_type_list','__priority',) + + _yang_name = 'otn-label-range' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__range_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'trib-slot': {}, 'trib-port': {}},), is_leaf=True, yang_name="range-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-label-range-type', is_config=True) + self.__tsg = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + self.__odu_type_list = YANGDynClass(unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},)), is_leaf=False, yang_name="odu-type-list", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + self.__priority = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..7']}), is_leaf=True, yang_name="priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', 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 ['networks', 'te', 'templates', 'link-template', 'te-link-attributes', 'label-restrictions', 'label-restriction', 'otn-label-range'] + + def _get_range_type(self): + """ + Getter method for range_type, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/label_restrictions/label_restriction/otn_label_range/range_type (otn-label-range-type) + + YANG Description: The type of range (e.g., TPN or TS) +to which the label range applies + """ + return self.__range_type + + def _set_range_type(self, v, load=False): + """ + Setter method for range_type, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/label_restrictions/label_restriction/otn_label_range/range_type (otn-label-range-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_range_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_range_type() directly. + + YANG Description: The type of range (e.g., TPN or TS) +to which the label range applies + """ + 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={'trib-slot': {}, 'trib-port': {}},), is_leaf=True, yang_name="range-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-label-range-type', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """range_type must be of a type compatible with otn-label-range-type""", + 'defined-type': "ietf-otn-topology:otn-label-range-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'trib-slot': {}, 'trib-port': {}},), is_leaf=True, yang_name="range-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-label-range-type', is_config=True)""", + }) + + self.__range_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_range_type(self): + self.__range_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'trib-slot': {}, 'trib-port': {}},), is_leaf=True, yang_name="range-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-label-range-type', is_config=True) + + + def _get_tsg(self): + """ + Getter method for tsg, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/label_restrictions/label_restriction/otn_label_range/tsg (identityref) + + YANG Description: Tributary slot granularity (TSG) to which the label range +applies. + +This leaf MUST be present when the range-type is TS. + +This leaf MAY be omitted when mapping an ODUk over an OTUk +Link. In this case the range-type is tpn, with only one +entry (ODUk), and the tpn range has only one value (1). + """ + return self.__tsg + + def _set_tsg(self, v, load=False): + """ + Setter method for tsg, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/label_restrictions/label_restriction/otn_label_range/tsg (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_tsg is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tsg() directly. + + YANG Description: Tributary slot granularity (TSG) to which the label range +applies. + +This leaf MUST be present when the range-type is TS. + +This leaf MAY be omitted when mapping an ODUk over an OTUk +Link. In this case the range-type is tpn, with only one +entry (ODUk), and the tpn range has only one value (1). + """ + 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={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tsg must be of a type compatible with identityref""", + 'defined-type': "ietf-otn-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True)""", + }) + + self.__tsg = t + if hasattr(self, '_set'): + self._set() + + def _unset_tsg(self): + self.__tsg = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + + + def _get_odu_type_list(self): + """ + Getter method for odu_type_list, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/label_restrictions/label_restriction/otn_label_range/odu_type_list (identityref) + + YANG Description: List of ODU types to which the label range applies. + +An Empty odu-type-list means that the label range +applies to all the supported ODU types. + """ + return self.__odu_type_list + + def _set_odu_type_list(self, v, load=False): + """ + Setter method for odu_type_list, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/label_restrictions/label_restriction/otn_label_range/odu_type_list (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_odu_type_list is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_odu_type_list() directly. + + YANG Description: List of ODU types to which the label range applies. + +An Empty odu-type-list means that the label range +applies to all the supported ODU types. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},)), is_leaf=False, yang_name="odu-type-list", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """odu_type_list must be of a type compatible with identityref""", + 'defined-type': "ietf-otn-topology:identityref", + 'generated-type': """YANGDynClass(unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},)), is_leaf=False, yang_name="odu-type-list", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True)""", + }) + + self.__odu_type_list = t + if hasattr(self, '_set'): + self._set() + + def _unset_odu_type_list(self): + self.__odu_type_list = YANGDynClass(unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},)), is_leaf=False, yang_name="odu-type-list", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + + + def _get_priority(self): + """ + Getter method for priority, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/label_restrictions/label_restriction/otn_label_range/priority (uint8) + + YANG Description: Priority in Interface Switching Capability +Descriptor (ISCD). + """ + return self.__priority + + def _set_priority(self, v, load=False): + """ + Setter method for priority, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/label_restrictions/label_restriction/otn_label_range/priority (uint8) + If this variable is read-only (config: false) in the + source YANG file, then _set_priority is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_priority() directly. + + YANG Description: Priority in Interface Switching Capability +Descriptor (ISCD). + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..7']}), is_leaf=True, yang_name="priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint8', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """priority must be of a type compatible with uint8""", + 'defined-type': "uint8", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..7']}), is_leaf=True, yang_name="priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint8', is_config=True)""", + }) + + self.__priority = t + if hasattr(self, '_set'): + self._set() + + def _unset_priority(self): + self.__priority = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..7']}), is_leaf=True, yang_name="priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint8', is_config=True) + + range_type = __builtin__.property(_get_range_type, _set_range_type) + tsg = __builtin__.property(_get_tsg, _set_tsg) + odu_type_list = __builtin__.property(_get_odu_type_list, _set_odu_type_list) + priority = __builtin__.property(_get_priority, _set_priority) + + + _pyangbind_elements = OrderedDict([('range_type', range_type), ('tsg', tsg), ('odu_type_list', odu_type_list), ('priority', priority), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/max_link_bandwidth/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/max_link_bandwidth/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..d5fb70e3ab9ccd69c82c1cf46382de6397cf5b61 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/max_link_bandwidth/__init__.py @@ -0,0 +1,119 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 te_bandwidth +class max_link_bandwidth(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/te/templates/link-template/te-link-attributes/max-link-bandwidth. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Maximum bandwidth that can be seen on this link in this +direction. Units are in bytes per second. + """ + __slots__ = ('_path_helper', '_extmethods', '__te_bandwidth',) + + _yang_name = 'max-link-bandwidth' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__te_bandwidth = YANGDynClass(base=te_bandwidth.te_bandwidth, is_container='container', yang_name="te-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-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 ['networks', 'te', 'templates', 'link-template', 'te-link-attributes', 'max-link-bandwidth'] + + def _get_te_bandwidth(self): + """ + Getter method for te_bandwidth, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/max_link_bandwidth/te_bandwidth (container) + + YANG Description: Container that specifies TE bandwidth. The choices +can be augmented for specific data-plane technologies. + """ + return self.__te_bandwidth + + def _set_te_bandwidth(self, v, load=False): + """ + Setter method for te_bandwidth, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/max_link_bandwidth/te_bandwidth (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_te_bandwidth is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_te_bandwidth() directly. + + YANG Description: Container that specifies TE bandwidth. The choices +can be augmented for specific data-plane technologies. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=te_bandwidth.te_bandwidth, is_container='container', yang_name="te-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """te_bandwidth must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=te_bandwidth.te_bandwidth, is_container='container', yang_name="te-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__te_bandwidth = t + if hasattr(self, '_set'): + self._set() + + def _unset_te_bandwidth(self): + self.__te_bandwidth = YANGDynClass(base=te_bandwidth.te_bandwidth, is_container='container', yang_name="te-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + te_bandwidth = __builtin__.property(_get_te_bandwidth, _set_te_bandwidth) + + + _pyangbind_elements = OrderedDict([('te_bandwidth', te_bandwidth), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/max_link_bandwidth/te_bandwidth/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/max_link_bandwidth/te_bandwidth/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..1d86069ed591451e2f3e16f76df5e7a8a3b64717 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/max_link_bandwidth/te_bandwidth/__init__.py @@ -0,0 +1,195 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 otn +class te_bandwidth(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/te/templates/link-template/te-link-attributes/max-link-bandwidth/te-bandwidth. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Container that specifies TE bandwidth. The choices +can be augmented for specific data-plane technologies. + """ + __slots__ = ('_path_helper', '_extmethods', '__generic','__otn','__eth_bandwidth',) + + _yang_name = 'te-bandwidth' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__generic = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+(,(0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+))*'}), is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-bandwidth', is_config=True) + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + self.__eth_bandwidth = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), restriction_dict={'range': ['0..10000000000']}), is_leaf=True, yang_name="eth-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint64', 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 ['networks', 'te', 'templates', 'link-template', 'te-link-attributes', 'max-link-bandwidth', 'te-bandwidth'] + + def _get_generic(self): + """ + Getter method for generic, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/max_link_bandwidth/te_bandwidth/generic (te-bandwidth) + + YANG Description: Bandwidth specified in a generic format. + """ + return self.__generic + + def _set_generic(self, v, load=False): + """ + Setter method for generic, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/max_link_bandwidth/te_bandwidth/generic (te-bandwidth) + If this variable is read-only (config: false) in the + source YANG file, then _set_generic is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_generic() directly. + + YANG Description: Bandwidth specified in a generic format. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+(,(0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+))*'}), is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-bandwidth', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """generic must be of a type compatible with te-bandwidth""", + 'defined-type': "ietf-te-topology:te-bandwidth", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+(,(0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+))*'}), is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-bandwidth', is_config=True)""", + }) + + self.__generic = t + if hasattr(self, '_set'): + self._set() + + def _unset_generic(self): + self.__generic = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+(,(0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+))*'}), is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-bandwidth', is_config=True) + + + def _get_otn(self): + """ + Getter method for otn, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/max_link_bandwidth/te_bandwidth/otn (container) + + YANG Description: Bandwidth attributes for OTN links + """ + return self.__otn + + def _set_otn(self, v, load=False): + """ + Setter method for otn, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/max_link_bandwidth/te_bandwidth/otn (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_otn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_otn() directly. + + YANG Description: Bandwidth attributes for OTN links + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=otn.otn, is_container='container', yang_name="otn", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """otn must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True)""", + }) + + self.__otn = t + if hasattr(self, '_set'): + self._set() + + def _unset_otn(self): + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + + + def _get_eth_bandwidth(self): + """ + Getter method for eth_bandwidth, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/max_link_bandwidth/te_bandwidth/eth_bandwidth (uint64) + + YANG Description: Available bandwith value expressed in kilobits per second + """ + return self.__eth_bandwidth + + def _set_eth_bandwidth(self, v, load=False): + """ + Setter method for eth_bandwidth, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/max_link_bandwidth/te_bandwidth/eth_bandwidth (uint64) + If this variable is read-only (config: false) in the + source YANG file, then _set_eth_bandwidth is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_eth_bandwidth() directly. + + YANG Description: Available bandwith value expressed in kilobits per second + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), restriction_dict={'range': ['0..10000000000']}), is_leaf=True, yang_name="eth-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint64', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """eth_bandwidth must be of a type compatible with uint64""", + 'defined-type': "uint64", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), restriction_dict={'range': ['0..10000000000']}), is_leaf=True, yang_name="eth-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint64', is_config=True)""", + }) + + self.__eth_bandwidth = t + if hasattr(self, '_set'): + self._set() + + def _unset_eth_bandwidth(self): + self.__eth_bandwidth = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), restriction_dict={'range': ['0..10000000000']}), is_leaf=True, yang_name="eth-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint64', is_config=True) + + generic = __builtin__.property(_get_generic, _set_generic) + otn = __builtin__.property(_get_otn, _set_otn) + eth_bandwidth = __builtin__.property(_get_eth_bandwidth, _set_eth_bandwidth) + + __choices__ = {'technology': {'generic': ['generic']}} + _pyangbind_elements = OrderedDict([('generic', generic), ('otn', otn), ('eth_bandwidth', eth_bandwidth), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/max_link_bandwidth/te_bandwidth/otn/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/max_link_bandwidth/te_bandwidth/otn/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..4528f641f19c93a78b10dc1c9eb80a09c5e76330 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/max_link_bandwidth/te_bandwidth/otn/__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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 odulist +class otn(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/te/templates/link-template/te-link-attributes/max-link-bandwidth/te-bandwidth/otn. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Bandwidth attributes for OTN links + """ + __slots__ = ('_path_helper', '_extmethods', '__odulist',) + + _yang_name = 'otn' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__odulist = YANGDynClass(base=YANGListType("odu_type",odulist.odulist, yang_name="odulist", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='odu-type', extensions=None), is_container='list', yang_name="odulist", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-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 ['networks', 'te', 'templates', 'link-template', 'te-link-attributes', 'max-link-bandwidth', 'te-bandwidth', 'otn'] + + def _get_odulist(self): + """ + Getter method for odulist, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/max_link_bandwidth/te_bandwidth/otn/odulist (list) + + YANG Description: OTN bandwidth definition + """ + return self.__odulist + + def _set_odulist(self, v, load=False): + """ + Setter method for odulist, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/max_link_bandwidth/te_bandwidth/otn/odulist (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_odulist is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_odulist() directly. + + YANG Description: OTN bandwidth definition + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("odu_type",odulist.odulist, yang_name="odulist", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='odu-type', extensions=None), is_container='list', yang_name="odulist", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='list', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """odulist must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("odu_type",odulist.odulist, yang_name="odulist", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='odu-type', extensions=None), is_container='list', yang_name="odulist", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='list', is_config=True)""", + }) + + self.__odulist = t + if hasattr(self, '_set'): + self._set() + + def _unset_odulist(self): + self.__odulist = YANGDynClass(base=YANGListType("odu_type",odulist.odulist, yang_name="odulist", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='odu-type', extensions=None), is_container='list', yang_name="odulist", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='list', is_config=True) + + odulist = __builtin__.property(_get_odulist, _set_odulist) + + + _pyangbind_elements = OrderedDict([('odulist', odulist), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/max_link_bandwidth/te_bandwidth/otn/odulist/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/max_link_bandwidth/te_bandwidth/otn/odulist/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..f17480835eb314d55951ac73ac41f347eff40547 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/max_link_bandwidth/te_bandwidth/otn/odulist/__init__.py @@ -0,0 +1,200 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 odulist(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/te/templates/link-template/te-link-attributes/max-link-bandwidth/te-bandwidth/otn/odulist. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: OTN bandwidth definition + """ + __slots__ = ('_path_helper', '_extmethods', '__odu_type','__number','__ts_number',) + + _yang_name = 'odulist' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__odu_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="odu-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + self.__number = YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), is_leaf=True, yang_name="number", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', is_config=True) + self.__ts_number = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts-number", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', 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 ['networks', 'te', 'templates', 'link-template', 'te-link-attributes', 'max-link-bandwidth', 'te-bandwidth', 'otn', 'odulist'] + + def _get_odu_type(self): + """ + Getter method for odu_type, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/max_link_bandwidth/te_bandwidth/otn/odulist/odu_type (identityref) + + YANG Description: ODU type + """ + return self.__odu_type + + def _set_odu_type(self, v, load=False): + """ + Setter method for odu_type, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/max_link_bandwidth/te_bandwidth/otn/odulist/odu_type (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_odu_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_odu_type() directly. + + YANG Description: ODU type + """ + 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=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="odu-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """odu_type must be of a type compatible with identityref""", + 'defined-type': "ietf-otn-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="odu-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True)""", + }) + + self.__odu_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_odu_type(self): + self.__odu_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="odu-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + + + def _get_number(self): + """ + Getter method for number, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/max_link_bandwidth/te_bandwidth/otn/odulist/number (uint16) + + YANG Description: Number of ODUs + """ + return self.__number + + def _set_number(self, v, load=False): + """ + Setter method for number, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/max_link_bandwidth/te_bandwidth/otn/odulist/number (uint16) + If this variable is read-only (config: false) in the + source YANG file, then _set_number is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_number() directly. + + YANG Description: Number of ODUs + """ + 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="number", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """number 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="number", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', is_config=True)""", + }) + + self.__number = t + if hasattr(self, '_set'): + self._set() + + def _unset_number(self): + self.__number = YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), is_leaf=True, yang_name="number", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', is_config=True) + + + def _get_ts_number(self): + """ + Getter method for ts_number, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/max_link_bandwidth/te_bandwidth/otn/odulist/ts_number (uint16) + + YANG Description: The number of Tributary Slots (TS) that +could be used by all the ODUflex LSPs. + """ + return self.__ts_number + + def _set_ts_number(self, v, load=False): + """ + Setter method for ts_number, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/max_link_bandwidth/te_bandwidth/otn/odulist/ts_number (uint16) + If this variable is read-only (config: false) in the + source YANG file, then _set_ts_number is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_ts_number() directly. + + YANG Description: The number of Tributary Slots (TS) that +could be used by all the ODUflex LSPs. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts-number", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """ts_number must be of a type compatible with uint16""", + 'defined-type': "uint16", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts-number", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', is_config=True)""", + }) + + self.__ts_number = t + if hasattr(self, '_set'): + self._set() + + def _unset_ts_number(self): + self.__ts_number = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts-number", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', is_config=True) + + odu_type = __builtin__.property(_get_odu_type, _set_odu_type) + number = __builtin__.property(_get_number, _set_number) + ts_number = __builtin__.property(_get_ts_number, _set_ts_number) + + + _pyangbind_elements = OrderedDict([('odu_type', odu_type), ('number', number), ('ts_number', ts_number), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/max_resv_link_bandwidth/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/max_resv_link_bandwidth/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..7f16f359f8f89ae2ed3046dd2490c1899fc563e0 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/max_resv_link_bandwidth/__init__.py @@ -0,0 +1,119 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 te_bandwidth +class max_resv_link_bandwidth(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/te/templates/link-template/te-link-attributes/max-resv-link-bandwidth. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Maximum amount of bandwidth that can be reserved in this +direction in this link. Units are in bytes per second. + """ + __slots__ = ('_path_helper', '_extmethods', '__te_bandwidth',) + + _yang_name = 'max-resv-link-bandwidth' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__te_bandwidth = YANGDynClass(base=te_bandwidth.te_bandwidth, is_container='container', yang_name="te-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-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 ['networks', 'te', 'templates', 'link-template', 'te-link-attributes', 'max-resv-link-bandwidth'] + + def _get_te_bandwidth(self): + """ + Getter method for te_bandwidth, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/max_resv_link_bandwidth/te_bandwidth (container) + + YANG Description: Container that specifies TE bandwidth. The choices +can be augmented for specific data-plane technologies. + """ + return self.__te_bandwidth + + def _set_te_bandwidth(self, v, load=False): + """ + Setter method for te_bandwidth, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/max_resv_link_bandwidth/te_bandwidth (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_te_bandwidth is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_te_bandwidth() directly. + + YANG Description: Container that specifies TE bandwidth. The choices +can be augmented for specific data-plane technologies. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=te_bandwidth.te_bandwidth, is_container='container', yang_name="te-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """te_bandwidth must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=te_bandwidth.te_bandwidth, is_container='container', yang_name="te-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__te_bandwidth = t + if hasattr(self, '_set'): + self._set() + + def _unset_te_bandwidth(self): + self.__te_bandwidth = YANGDynClass(base=te_bandwidth.te_bandwidth, is_container='container', yang_name="te-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + te_bandwidth = __builtin__.property(_get_te_bandwidth, _set_te_bandwidth) + + + _pyangbind_elements = OrderedDict([('te_bandwidth', te_bandwidth), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/max_resv_link_bandwidth/te_bandwidth/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/max_resv_link_bandwidth/te_bandwidth/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..f781d9af530b8a9c1f7da8a0751288dc7d863ea8 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/max_resv_link_bandwidth/te_bandwidth/__init__.py @@ -0,0 +1,195 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 otn +class te_bandwidth(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/te/templates/link-template/te-link-attributes/max-resv-link-bandwidth/te-bandwidth. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Container that specifies TE bandwidth. The choices +can be augmented for specific data-plane technologies. + """ + __slots__ = ('_path_helper', '_extmethods', '__generic','__otn','__eth_bandwidth',) + + _yang_name = 'te-bandwidth' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__generic = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+(,(0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+))*'}), is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-bandwidth', is_config=True) + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + self.__eth_bandwidth = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), restriction_dict={'range': ['0..10000000000']}), is_leaf=True, yang_name="eth-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint64', 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 ['networks', 'te', 'templates', 'link-template', 'te-link-attributes', 'max-resv-link-bandwidth', 'te-bandwidth'] + + def _get_generic(self): + """ + Getter method for generic, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/max_resv_link_bandwidth/te_bandwidth/generic (te-bandwidth) + + YANG Description: Bandwidth specified in a generic format. + """ + return self.__generic + + def _set_generic(self, v, load=False): + """ + Setter method for generic, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/max_resv_link_bandwidth/te_bandwidth/generic (te-bandwidth) + If this variable is read-only (config: false) in the + source YANG file, then _set_generic is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_generic() directly. + + YANG Description: Bandwidth specified in a generic format. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+(,(0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+))*'}), is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-bandwidth', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """generic must be of a type compatible with te-bandwidth""", + 'defined-type': "ietf-te-topology:te-bandwidth", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+(,(0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+))*'}), is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-bandwidth', is_config=True)""", + }) + + self.__generic = t + if hasattr(self, '_set'): + self._set() + + def _unset_generic(self): + self.__generic = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+(,(0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+))*'}), is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-bandwidth', is_config=True) + + + def _get_otn(self): + """ + Getter method for otn, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/max_resv_link_bandwidth/te_bandwidth/otn (container) + + YANG Description: Bandwidth attributes for OTN links + """ + return self.__otn + + def _set_otn(self, v, load=False): + """ + Setter method for otn, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/max_resv_link_bandwidth/te_bandwidth/otn (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_otn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_otn() directly. + + YANG Description: Bandwidth attributes for OTN links + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=otn.otn, is_container='container', yang_name="otn", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """otn must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True)""", + }) + + self.__otn = t + if hasattr(self, '_set'): + self._set() + + def _unset_otn(self): + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + + + def _get_eth_bandwidth(self): + """ + Getter method for eth_bandwidth, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/max_resv_link_bandwidth/te_bandwidth/eth_bandwidth (uint64) + + YANG Description: Available bandwith value expressed in kilobits per second + """ + return self.__eth_bandwidth + + def _set_eth_bandwidth(self, v, load=False): + """ + Setter method for eth_bandwidth, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/max_resv_link_bandwidth/te_bandwidth/eth_bandwidth (uint64) + If this variable is read-only (config: false) in the + source YANG file, then _set_eth_bandwidth is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_eth_bandwidth() directly. + + YANG Description: Available bandwith value expressed in kilobits per second + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), restriction_dict={'range': ['0..10000000000']}), is_leaf=True, yang_name="eth-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint64', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """eth_bandwidth must be of a type compatible with uint64""", + 'defined-type': "uint64", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), restriction_dict={'range': ['0..10000000000']}), is_leaf=True, yang_name="eth-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint64', is_config=True)""", + }) + + self.__eth_bandwidth = t + if hasattr(self, '_set'): + self._set() + + def _unset_eth_bandwidth(self): + self.__eth_bandwidth = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), restriction_dict={'range': ['0..10000000000']}), is_leaf=True, yang_name="eth-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint64', is_config=True) + + generic = __builtin__.property(_get_generic, _set_generic) + otn = __builtin__.property(_get_otn, _set_otn) + eth_bandwidth = __builtin__.property(_get_eth_bandwidth, _set_eth_bandwidth) + + __choices__ = {'technology': {'generic': ['generic']}} + _pyangbind_elements = OrderedDict([('generic', generic), ('otn', otn), ('eth_bandwidth', eth_bandwidth), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/max_resv_link_bandwidth/te_bandwidth/otn/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/max_resv_link_bandwidth/te_bandwidth/otn/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..eee723135eb0db06133e8ca55942f87df26ceb18 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/max_resv_link_bandwidth/te_bandwidth/otn/__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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 odulist +class otn(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/te/templates/link-template/te-link-attributes/max-resv-link-bandwidth/te-bandwidth/otn. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Bandwidth attributes for OTN links + """ + __slots__ = ('_path_helper', '_extmethods', '__odulist',) + + _yang_name = 'otn' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__odulist = YANGDynClass(base=YANGListType("odu_type",odulist.odulist, yang_name="odulist", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='odu-type', extensions=None), is_container='list', yang_name="odulist", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-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 ['networks', 'te', 'templates', 'link-template', 'te-link-attributes', 'max-resv-link-bandwidth', 'te-bandwidth', 'otn'] + + def _get_odulist(self): + """ + Getter method for odulist, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/max_resv_link_bandwidth/te_bandwidth/otn/odulist (list) + + YANG Description: OTN bandwidth definition + """ + return self.__odulist + + def _set_odulist(self, v, load=False): + """ + Setter method for odulist, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/max_resv_link_bandwidth/te_bandwidth/otn/odulist (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_odulist is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_odulist() directly. + + YANG Description: OTN bandwidth definition + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("odu_type",odulist.odulist, yang_name="odulist", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='odu-type', extensions=None), is_container='list', yang_name="odulist", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='list', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """odulist must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("odu_type",odulist.odulist, yang_name="odulist", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='odu-type', extensions=None), is_container='list', yang_name="odulist", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='list', is_config=True)""", + }) + + self.__odulist = t + if hasattr(self, '_set'): + self._set() + + def _unset_odulist(self): + self.__odulist = YANGDynClass(base=YANGListType("odu_type",odulist.odulist, yang_name="odulist", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='odu-type', extensions=None), is_container='list', yang_name="odulist", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='list', is_config=True) + + odulist = __builtin__.property(_get_odulist, _set_odulist) + + + _pyangbind_elements = OrderedDict([('odulist', odulist), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/max_resv_link_bandwidth/te_bandwidth/otn/odulist/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/max_resv_link_bandwidth/te_bandwidth/otn/odulist/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..98d18da300ccb4b910b13932a23d6978b3f4e8a7 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/max_resv_link_bandwidth/te_bandwidth/otn/odulist/__init__.py @@ -0,0 +1,200 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 odulist(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/te/templates/link-template/te-link-attributes/max-resv-link-bandwidth/te-bandwidth/otn/odulist. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: OTN bandwidth definition + """ + __slots__ = ('_path_helper', '_extmethods', '__odu_type','__number','__ts_number',) + + _yang_name = 'odulist' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__odu_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="odu-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + self.__number = YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), is_leaf=True, yang_name="number", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', is_config=True) + self.__ts_number = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts-number", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', 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 ['networks', 'te', 'templates', 'link-template', 'te-link-attributes', 'max-resv-link-bandwidth', 'te-bandwidth', 'otn', 'odulist'] + + def _get_odu_type(self): + """ + Getter method for odu_type, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/max_resv_link_bandwidth/te_bandwidth/otn/odulist/odu_type (identityref) + + YANG Description: ODU type + """ + return self.__odu_type + + def _set_odu_type(self, v, load=False): + """ + Setter method for odu_type, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/max_resv_link_bandwidth/te_bandwidth/otn/odulist/odu_type (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_odu_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_odu_type() directly. + + YANG Description: ODU type + """ + 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=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="odu-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """odu_type must be of a type compatible with identityref""", + 'defined-type': "ietf-otn-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="odu-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True)""", + }) + + self.__odu_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_odu_type(self): + self.__odu_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="odu-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + + + def _get_number(self): + """ + Getter method for number, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/max_resv_link_bandwidth/te_bandwidth/otn/odulist/number (uint16) + + YANG Description: Number of ODUs + """ + return self.__number + + def _set_number(self, v, load=False): + """ + Setter method for number, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/max_resv_link_bandwidth/te_bandwidth/otn/odulist/number (uint16) + If this variable is read-only (config: false) in the + source YANG file, then _set_number is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_number() directly. + + YANG Description: Number of ODUs + """ + 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="number", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """number 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="number", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', is_config=True)""", + }) + + self.__number = t + if hasattr(self, '_set'): + self._set() + + def _unset_number(self): + self.__number = YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), is_leaf=True, yang_name="number", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', is_config=True) + + + def _get_ts_number(self): + """ + Getter method for ts_number, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/max_resv_link_bandwidth/te_bandwidth/otn/odulist/ts_number (uint16) + + YANG Description: The number of Tributary Slots (TS) that +could be used by all the ODUflex LSPs. + """ + return self.__ts_number + + def _set_ts_number(self, v, load=False): + """ + Setter method for ts_number, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/max_resv_link_bandwidth/te_bandwidth/otn/odulist/ts_number (uint16) + If this variable is read-only (config: false) in the + source YANG file, then _set_ts_number is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_ts_number() directly. + + YANG Description: The number of Tributary Slots (TS) that +could be used by all the ODUflex LSPs. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts-number", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """ts_number must be of a type compatible with uint16""", + 'defined-type': "uint16", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts-number", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', is_config=True)""", + }) + + self.__ts_number = t + if hasattr(self, '_set'): + self._set() + + def _unset_ts_number(self): + self.__ts_number = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts-number", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', is_config=True) + + odu_type = __builtin__.property(_get_odu_type, _set_odu_type) + number = __builtin__.property(_get_number, _set_number) + ts_number = __builtin__.property(_get_ts_number, _set_ts_number) + + + _pyangbind_elements = OrderedDict([('odu_type', odu_type), ('number', number), ('ts_number', ts_number), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/te_nsrlgs/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/te_nsrlgs/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..a3ab4519d2d470e434a4b44c39901af19ab97150 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/te_nsrlgs/__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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 te_nsrlgs(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/te/templates/link-template/te-link-attributes/te-nsrlgs. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Contains a list of NSRLGs (Non-Shared Risk Link Groups). +When an abstract TE link is configured, this list specifies +the request that underlay TE paths need to be mutually +disjoint with other TE links in the same groups. + """ + __slots__ = ('_path_helper', '_extmethods', '__id',) + + _yang_name = 'te-nsrlgs' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__id = YANGDynClass(unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32)), is_leaf=False, yang_name="id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', 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 ['networks', 'te', 'templates', 'link-template', 'te-link-attributes', 'te-nsrlgs'] + + def _get_id(self): + """ + Getter method for id, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/te_nsrlgs/id (uint32) + + YANG Description: NSRLG ID, uniquely configured within a topology. + """ + return self.__id + + def _set_id(self, v, load=False): + """ + Setter method for id, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/te_nsrlgs/id (uint32) + 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: NSRLG ID, uniquely configured within a topology. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32)), is_leaf=False, yang_name="id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """id must be of a type compatible with uint32""", + 'defined-type': "uint32", + 'generated-type': """YANGDynClass(unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32)), is_leaf=False, yang_name="id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True)""", + }) + + self.__id = t + if hasattr(self, '_set'): + self._set() + + def _unset_id(self): + self.__id = YANGDynClass(unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32)), is_leaf=False, yang_name="id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + + id = __builtin__.property(_get_id, _set_id) + + + _pyangbind_elements = OrderedDict([('id', id), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/te_srlgs/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/te_srlgs/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..65f81a17e81c5170aa76cd7bf6588bce9fa1d2c8 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/te_srlgs/__init__.py @@ -0,0 +1,115 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 te_srlgs(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/te/templates/link-template/te-link-attributes/te-srlgs. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Contains a list of SRLGs. + """ + __slots__ = ('_path_helper', '_extmethods', '__value',) + + _yang_name = 'te-srlgs' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__value = YANGDynClass(unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32)), is_leaf=False, yang_name="value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-types:srlg', 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 ['networks', 'te', 'templates', 'link-template', 'te-link-attributes', 'te-srlgs'] + + def _get_value(self): + """ + Getter method for value, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/te_srlgs/value (te-types:srlg) + + YANG Description: SRLG value. + """ + return self.__value + + def _set_value(self, v, load=False): + """ + Setter method for value, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/te_srlgs/value (te-types:srlg) + 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: SRLG value. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32)), is_leaf=False, yang_name="value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-types:srlg', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """value must be of a type compatible with te-types:srlg""", + 'defined-type': "te-types:srlg", + 'generated-type': """YANGDynClass(unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32)), is_leaf=False, yang_name="value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-types:srlg', is_config=True)""", + }) + + self.__value = t + if hasattr(self, '_set'): + self._set() + + def _unset_value(self): + self.__value = YANGDynClass(unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32)), is_leaf=False, yang_name="value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-types:srlg', is_config=True) + + value = __builtin__.property(_get_value, _set_value) + + + _pyangbind_elements = OrderedDict([('value', value), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/underlay/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/underlay/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..a1b69d2e20a1ae79da37311f698137534492b2ce --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/underlay/__init__.py @@ -0,0 +1,326 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 primary_path +from . import backup_path +from . import tunnel_termination_points +from . import tunnels +class underlay(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/te/templates/link-template/te-link-attributes/underlay. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Attributes of the TE link underlay. + """ + __slots__ = ('_path_helper', '_extmethods', '__enabled','__primary_path','__backup_path','__protection_type','__tunnel_termination_points','__tunnels',) + + _yang_name = 'underlay' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__enabled = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="enabled", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='boolean', is_config=True) + self.__primary_path = YANGDynClass(base=primary_path.primary_path, is_container='container', yang_name="primary-path", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__backup_path = YANGDynClass(base=YANGListType("index",backup_path.backup_path, yang_name="backup-path", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='index', extensions=None), is_container='list', yang_name="backup-path", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + self.__protection_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'lsp-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-reroute-extra': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-reroute-extra': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-reroute-extra': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-reroute': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-reroute': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-reroute': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-1-for-n': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-1-for-n': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-1-for-n': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-unidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-unidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-unidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-bidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-bidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-bidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="protection-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + self.__tunnel_termination_points = YANGDynClass(base=tunnel_termination_points.tunnel_termination_points, is_container='container', yang_name="tunnel-termination-points", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__tunnels = YANGDynClass(base=tunnels.tunnels, is_container='container', yang_name="tunnels", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-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 ['networks', 'te', 'templates', 'link-template', 'te-link-attributes', 'underlay'] + + def _get_enabled(self): + """ + Getter method for enabled, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay/enabled (boolean) + + YANG Description: 'true' if the underlay is enabled. +'false' if the underlay is disabled. + """ + return self.__enabled + + def _set_enabled(self, v, load=False): + """ + Setter method for enabled, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay/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: 'true' if the underlay is enabled. +'false' if the underlay is disabled. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBool, is_leaf=True, yang_name="enabled", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', 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, is_leaf=True, yang_name="enabled", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='boolean', is_config=True)""", + }) + + self.__enabled = t + if hasattr(self, '_set'): + self._set() + + def _unset_enabled(self): + self.__enabled = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="enabled", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='boolean', is_config=True) + + + def _get_primary_path(self): + """ + Getter method for primary_path, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay/primary_path (container) + + YANG Description: The service path on the underlay topology that +supports this link. + """ + return self.__primary_path + + def _set_primary_path(self, v, load=False): + """ + Setter method for primary_path, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay/primary_path (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_primary_path is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_primary_path() directly. + + YANG Description: The service path on the underlay topology that +supports this link. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=primary_path.primary_path, is_container='container', yang_name="primary-path", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """primary_path must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=primary_path.primary_path, is_container='container', yang_name="primary-path", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__primary_path = t + if hasattr(self, '_set'): + self._set() + + def _unset_primary_path(self): + self.__primary_path = YANGDynClass(base=primary_path.primary_path, is_container='container', yang_name="primary-path", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_backup_path(self): + """ + Getter method for backup_path, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay/backup_path (list) + + YANG Description: A list of backup service paths on the underlay topology that +protect the underlay primary path. If the primary path is +not protected, the list contains zero elements. If the +primary path is protected, the list contains one or more +elements. + """ + return self.__backup_path + + def _set_backup_path(self, v, load=False): + """ + Setter method for backup_path, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay/backup_path (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_backup_path is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_backup_path() directly. + + YANG Description: A list of backup service paths on the underlay topology that +protect the underlay primary path. If the primary path is +not protected, the list contains zero elements. If the +primary path is protected, the list contains one or more +elements. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("index",backup_path.backup_path, yang_name="backup-path", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='index', extensions=None), is_container='list', yang_name="backup-path", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """backup_path must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("index",backup_path.backup_path, yang_name="backup-path", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='index', extensions=None), is_container='list', yang_name="backup-path", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True)""", + }) + + self.__backup_path = t + if hasattr(self, '_set'): + self._set() + + def _unset_backup_path(self): + self.__backup_path = YANGDynClass(base=YANGListType("index",backup_path.backup_path, yang_name="backup-path", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='index', extensions=None), is_container='list', yang_name="backup-path", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + + + def _get_protection_type(self): + """ + Getter method for protection_type, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay/protection_type (identityref) + + YANG Description: Underlay protection type desired for this link. + """ + return self.__protection_type + + def _set_protection_type(self, v, load=False): + """ + Setter method for protection_type, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay/protection_type (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_protection_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_protection_type() directly. + + YANG Description: Underlay protection type desired for this link. + """ + 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={'lsp-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-reroute-extra': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-reroute-extra': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-reroute-extra': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-reroute': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-reroute': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-reroute': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-1-for-n': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-1-for-n': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-1-for-n': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-unidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-unidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-unidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-bidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-bidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-bidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="protection-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """protection_type must be of a type compatible with identityref""", + 'defined-type': "ietf-te-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'lsp-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-reroute-extra': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-reroute-extra': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-reroute-extra': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-reroute': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-reroute': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-reroute': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-1-for-n': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-1-for-n': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-1-for-n': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-unidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-unidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-unidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-bidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-bidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-bidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="protection-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True)""", + }) + + self.__protection_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_protection_type(self): + self.__protection_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'lsp-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-reroute-extra': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-reroute-extra': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-reroute-extra': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-reroute': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-reroute': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-reroute': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-1-for-n': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-1-for-n': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-1-for-n': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-unidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-unidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-unidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-bidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-bidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-bidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="protection-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + + + def _get_tunnel_termination_points(self): + """ + Getter method for tunnel_termination_points, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay/tunnel_termination_points (container) + + YANG Description: Underlay TTPs desired for this link. + """ + return self.__tunnel_termination_points + + def _set_tunnel_termination_points(self, v, load=False): + """ + Setter method for tunnel_termination_points, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay/tunnel_termination_points (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_tunnel_termination_points is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tunnel_termination_points() directly. + + YANG Description: Underlay TTPs desired for this link. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=tunnel_termination_points.tunnel_termination_points, is_container='container', yang_name="tunnel-termination-points", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tunnel_termination_points must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=tunnel_termination_points.tunnel_termination_points, is_container='container', yang_name="tunnel-termination-points", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__tunnel_termination_points = t + if hasattr(self, '_set'): + self._set() + + def _unset_tunnel_termination_points(self): + self.__tunnel_termination_points = YANGDynClass(base=tunnel_termination_points.tunnel_termination_points, is_container='container', yang_name="tunnel-termination-points", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_tunnels(self): + """ + Getter method for tunnels, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay/tunnels (container) + + YANG Description: Underlay TE tunnels supporting this TE link. + """ + return self.__tunnels + + def _set_tunnels(self, v, load=False): + """ + Setter method for tunnels, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay/tunnels (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_tunnels is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tunnels() directly. + + YANG Description: Underlay TE tunnels supporting this TE link. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=tunnels.tunnels, is_container='container', yang_name="tunnels", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tunnels must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=tunnels.tunnels, is_container='container', yang_name="tunnels", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__tunnels = t + if hasattr(self, '_set'): + self._set() + + def _unset_tunnels(self): + self.__tunnels = YANGDynClass(base=tunnels.tunnels, is_container='container', yang_name="tunnels", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + enabled = __builtin__.property(_get_enabled, _set_enabled) + primary_path = __builtin__.property(_get_primary_path, _set_primary_path) + backup_path = __builtin__.property(_get_backup_path, _set_backup_path) + protection_type = __builtin__.property(_get_protection_type, _set_protection_type) + tunnel_termination_points = __builtin__.property(_get_tunnel_termination_points, _set_tunnel_termination_points) + tunnels = __builtin__.property(_get_tunnels, _set_tunnels) + + + _pyangbind_elements = OrderedDict([('enabled', enabled), ('primary_path', primary_path), ('backup_path', backup_path), ('protection_type', protection_type), ('tunnel_termination_points', tunnel_termination_points), ('tunnels', tunnels), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/underlay/backup_path/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/underlay/backup_path/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..fe3e9714fa8fedb7896385b782e128c751ce5075 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/underlay/backup_path/__init__.py @@ -0,0 +1,207 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 path_element +class backup_path(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/te/templates/link-template/te-link-attributes/underlay/backup-path. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: A list of backup service paths on the underlay topology that +protect the underlay primary path. If the primary path is +not protected, the list contains zero elements. If the +primary path is protected, the list contains one or more +elements. + """ + __slots__ = ('_path_helper', '_extmethods', '__index','__network_ref','__path_element',) + + _yang_name = 'backup-path' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _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), is_leaf=True, yang_name="index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + self.__network_ref = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="network-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=True) + self.__path_element = YANGDynClass(base=YANGListType("path_element_id",path_element.path_element, yang_name="path-element", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='path-element-id', extensions=None), is_container='list', yang_name="path-element", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-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 ['networks', 'te', 'templates', 'link-template', 'te-link-attributes', 'underlay', 'backup-path'] + + def _get_index(self): + """ + Getter method for index, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay/backup_path/index (uint32) + + YANG Description: A sequence number to identify a backup path. + """ + return self.__index + + def _set_index(self, v, load=False): + """ + Setter method for index, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay/backup_path/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: A sequence number to identify a backup path. + """ + 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=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', 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), is_leaf=True, yang_name="index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', 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), is_leaf=True, yang_name="index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + + + def _get_network_ref(self): + """ + Getter method for network_ref, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay/backup_path/network_ref (leafref) + + YANG Description: Used to reference a network -- for example, an underlay +network. + """ + return self.__network_ref + + def _set_network_ref(self, v, load=False): + """ + Setter method for network_ref, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay/backup_path/network_ref (leafref) + If this variable is read-only (config: false) in the + source YANG file, then _set_network_ref is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_network_ref() directly. + + YANG Description: Used to reference a network -- for example, an underlay +network. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="network-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """network_ref must be of a type compatible with leafref""", + 'defined-type': "leafref", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="network-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=True)""", + }) + + self.__network_ref = t + if hasattr(self, '_set'): + self._set() + + def _unset_network_ref(self): + self.__network_ref = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="network-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=True) + + + def _get_path_element(self): + """ + Getter method for path_element, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay/backup_path/path_element (list) + + YANG Description: A list of path elements describing the backup service +path. + """ + return self.__path_element + + def _set_path_element(self, v, load=False): + """ + Setter method for path_element, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay/backup_path/path_element (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_element is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_element() directly. + + YANG Description: A list of path elements describing the backup service +path. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("path_element_id",path_element.path_element, yang_name="path-element", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='path-element-id', extensions=None), is_container='list', yang_name="path-element", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_element must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("path_element_id",path_element.path_element, yang_name="path-element", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='path-element-id', extensions=None), is_container='list', yang_name="path-element", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True)""", + }) + + self.__path_element = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_element(self): + self.__path_element = YANGDynClass(base=YANGListType("path_element_id",path_element.path_element, yang_name="path-element", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='path-element-id', extensions=None), is_container='list', yang_name="path-element", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + + index = __builtin__.property(_get_index, _set_index) + network_ref = __builtin__.property(_get_network_ref, _set_network_ref) + path_element = __builtin__.property(_get_path_element, _set_path_element) + + + _pyangbind_elements = OrderedDict([('index', index), ('network_ref', network_ref), ('path_element', path_element), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/underlay/backup_path/path_element/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/underlay/backup_path/path_element/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..62e01431a8b8667754b9feb85a0fe97891a4f021 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/underlay/backup_path/path_element/__init__.py @@ -0,0 +1,321 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 numbered_node_hop +from . import numbered_link_hop +from . import unnumbered_link_hop +from . import as_number_hop +from . import label_hop +class path_element(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/te/templates/link-template/te-link-attributes/underlay/backup-path/path-element. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: A list of path elements describing the backup service +path. + """ + __slots__ = ('_path_helper', '_extmethods', '__path_element_id','__numbered_node_hop','__numbered_link_hop','__unnumbered_link_hop','__as_number_hop','__label_hop',) + + _yang_name = 'path-element' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__path_element_id = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="path-element-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + self.__numbered_node_hop = YANGDynClass(base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__numbered_link_hop = YANGDynClass(base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__unnumbered_link_hop = YANGDynClass(base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__as_number_hop = YANGDynClass(base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__label_hop = YANGDynClass(base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-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 ['networks', 'te', 'templates', 'link-template', 'te-link-attributes', 'underlay', 'backup-path', 'path-element'] + + def _get_path_element_id(self): + """ + Getter method for path_element_id, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay/backup_path/path_element/path_element_id (uint32) + + YANG Description: To identify the element in a path. + """ + return self.__path_element_id + + def _set_path_element_id(self, v, load=False): + """ + Setter method for path_element_id, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay/backup_path/path_element/path_element_id (uint32) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_element_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_element_id() directly. + + YANG Description: To identify the element in a path. + """ + 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=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="path-element-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_element_id 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="path-element-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True)""", + }) + + self.__path_element_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_element_id(self): + self.__path_element_id = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="path-element-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + + + def _get_numbered_node_hop(self): + """ + Getter method for numbered_node_hop, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay/backup_path/path_element/numbered_node_hop (container) + + YANG Description: Numbered node route hop. + """ + return self.__numbered_node_hop + + def _set_numbered_node_hop(self, v, load=False): + """ + Setter method for numbered_node_hop, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay/backup_path/path_element/numbered_node_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_numbered_node_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_numbered_node_hop() directly. + + YANG Description: Numbered node route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """numbered_node_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__numbered_node_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_numbered_node_hop(self): + self.__numbered_node_hop = YANGDynClass(base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_numbered_link_hop(self): + """ + Getter method for numbered_link_hop, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay/backup_path/path_element/numbered_link_hop (container) + + YANG Description: Numbered link explicit route hop. + """ + return self.__numbered_link_hop + + def _set_numbered_link_hop(self, v, load=False): + """ + Setter method for numbered_link_hop, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay/backup_path/path_element/numbered_link_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_numbered_link_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_numbered_link_hop() directly. + + YANG Description: Numbered link explicit route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """numbered_link_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__numbered_link_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_numbered_link_hop(self): + self.__numbered_link_hop = YANGDynClass(base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_unnumbered_link_hop(self): + """ + Getter method for unnumbered_link_hop, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay/backup_path/path_element/unnumbered_link_hop (container) + + YANG Description: Unnumbered link explicit route hop. + """ + return self.__unnumbered_link_hop + + def _set_unnumbered_link_hop(self, v, load=False): + """ + Setter method for unnumbered_link_hop, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay/backup_path/path_element/unnumbered_link_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_unnumbered_link_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_unnumbered_link_hop() directly. + + YANG Description: Unnumbered link explicit route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """unnumbered_link_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__unnumbered_link_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_unnumbered_link_hop(self): + self.__unnumbered_link_hop = YANGDynClass(base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_as_number_hop(self): + """ + Getter method for as_number_hop, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay/backup_path/path_element/as_number_hop (container) + + YANG Description: AS explicit route hop. + """ + return self.__as_number_hop + + def _set_as_number_hop(self, v, load=False): + """ + Setter method for as_number_hop, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay/backup_path/path_element/as_number_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_as_number_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_as_number_hop() directly. + + YANG Description: AS explicit route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """as_number_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__as_number_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_as_number_hop(self): + self.__as_number_hop = YANGDynClass(base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_label_hop(self): + """ + Getter method for label_hop, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay/backup_path/path_element/label_hop (container) + + YANG Description: Label hop type. + """ + return self.__label_hop + + def _set_label_hop(self, v, load=False): + """ + Setter method for label_hop, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay/backup_path/path_element/label_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_label_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_label_hop() directly. + + YANG Description: Label hop type. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """label_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__label_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_label_hop(self): + self.__label_hop = YANGDynClass(base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + path_element_id = __builtin__.property(_get_path_element_id, _set_path_element_id) + numbered_node_hop = __builtin__.property(_get_numbered_node_hop, _set_numbered_node_hop) + numbered_link_hop = __builtin__.property(_get_numbered_link_hop, _set_numbered_link_hop) + unnumbered_link_hop = __builtin__.property(_get_unnumbered_link_hop, _set_unnumbered_link_hop) + as_number_hop = __builtin__.property(_get_as_number_hop, _set_as_number_hop) + label_hop = __builtin__.property(_get_label_hop, _set_label_hop) + + __choices__ = {'type': {'numbered-node-hop': ['numbered_node_hop'], 'numbered-link-hop': ['numbered_link_hop'], 'unnumbered-link-hop': ['unnumbered_link_hop'], 'as-number': ['as_number_hop'], 'label': ['label_hop']}} + _pyangbind_elements = OrderedDict([('path_element_id', path_element_id), ('numbered_node_hop', numbered_node_hop), ('numbered_link_hop', numbered_link_hop), ('unnumbered_link_hop', unnumbered_link_hop), ('as_number_hop', as_number_hop), ('label_hop', label_hop), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/underlay/backup_path/path_element/as_number_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/underlay/backup_path/path_element/as_number_hop/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..25cce73149e731c24b64df4ea40309919eb43fa0 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/underlay/backup_path/path_element/as_number_hop/__init__.py @@ -0,0 +1,154 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 as_number_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/te/templates/link-template/te-link-attributes/underlay/backup-path/path-element/as-number-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: AS explicit route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__as_number','__hop_type',) + + _yang_name = 'as-number-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__as_number = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=True) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', 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 ['networks', 'te', 'templates', 'link-template', 'te-link-attributes', 'underlay', 'backup-path', 'path-element', 'as-number-hop'] + + def _get_as_number(self): + """ + Getter method for as_number, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay/backup_path/path_element/as_number_hop/as_number (inet:as-number) + + YANG Description: The Autonomous System (AS) number. + """ + return self.__as_number + + def _set_as_number(self, v, load=False): + """ + Setter method for as_number, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay/backup_path/path_element/as_number_hop/as_number (inet:as-number) + If this variable is read-only (config: false) in the + source YANG file, then _set_as_number is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_as_number() directly. + + YANG Description: The Autonomous System (AS) number. + """ + 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="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """as_number must be of a type compatible with inet:as-number""", + 'defined-type': "inet:as-number", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=True)""", + }) + + self.__as_number = t + if hasattr(self, '_set'): + self._set() + + def _unset_as_number(self): + self.__as_number = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=True) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay/backup_path/path_element/as_number_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay/backup_path/path_element/as_number_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + 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={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + + as_number = __builtin__.property(_get_as_number, _set_as_number) + hop_type = __builtin__.property(_get_hop_type, _set_hop_type) + + __choices__ = {'type': {'as-number': ['as_number', 'hop_type']}} + _pyangbind_elements = OrderedDict([('as_number', as_number), ('hop_type', hop_type), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/underlay/backup_path/path_element/label_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/underlay/backup_path/path_element/label_hop/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..602bbac44c1d43dbe2f772cfdc19c2db2e1fcc5d --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/underlay/backup_path/path_element/label_hop/__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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 te_label +class label_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/te/templates/link-template/te-link-attributes/underlay/backup-path/path-element/label-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Label hop type. + """ + __slots__ = ('_path_helper', '_extmethods', '__te_label',) + + _yang_name = 'label-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__te_label = YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-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 ['networks', 'te', 'templates', 'link-template', 'te-link-attributes', 'underlay', 'backup-path', 'path-element', 'label-hop'] + + def _get_te_label(self): + """ + Getter method for te_label, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay/backup_path/path_element/label_hop/te_label (container) + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + return self.__te_label + + def _set_te_label(self, v, load=False): + """ + Setter method for te_label, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay/backup_path/path_element/label_hop/te_label (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_te_label is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_te_label() directly. + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """te_label must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__te_label = t + if hasattr(self, '_set'): + self._set() + + def _unset_te_label(self): + self.__te_label = YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + te_label = __builtin__.property(_get_te_label, _set_te_label) + + __choices__ = {'type': {'label': ['te_label']}} + _pyangbind_elements = OrderedDict([('te_label', te_label), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/underlay/backup_path/path_element/label_hop/te_label/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/underlay/backup_path/path_element/label_hop/te_label/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..1cfac3e4fdd6fd7bea33cb632d29de441573493a --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/underlay/backup_path/path_element/label_hop/te_label/__init__.py @@ -0,0 +1,234 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 otn +class te_label(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/te/templates/link-template/te-link-attributes/underlay/backup-path/path-element/label-hop/te-label. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + __slots__ = ('_path_helper', '_extmethods', '__generic','__otn','__vlanid','__direction',) + + _yang_name = 'te-label' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__generic = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True) + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + self.__vlanid = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True) + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', 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 ['networks', 'te', 'templates', 'link-template', 'te-link-attributes', 'underlay', 'backup-path', 'path-element', 'label-hop', 'te-label'] + + def _get_generic(self): + """ + Getter method for generic, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay/backup_path/path_element/label_hop/te_label/generic (rt-types:generalized-label) + + YANG Description: TE label specified in a generic format. + """ + return self.__generic + + def _set_generic(self, v, load=False): + """ + Setter method for generic, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay/backup_path/path_element/label_hop/te_label/generic (rt-types:generalized-label) + If this variable is read-only (config: false) in the + source YANG file, then _set_generic is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_generic() directly. + + YANG Description: TE label specified in a generic format. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """generic must be of a type compatible with rt-types:generalized-label""", + 'defined-type': "rt-types:generalized-label", + 'generated-type': """YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True)""", + }) + + self.__generic = t + if hasattr(self, '_set'): + self._set() + + def _unset_generic(self): + self.__generic = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True) + + + def _get_otn(self): + """ + Getter method for otn, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay/backup_path/path_element/label_hop/te_label/otn (container) + + YANG Description: Label hop for OTN. + """ + return self.__otn + + def _set_otn(self, v, load=False): + """ + Setter method for otn, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay/backup_path/path_element/label_hop/te_label/otn (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_otn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_otn() directly. + + YANG Description: Label hop for OTN. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """otn must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True)""", + }) + + self.__otn = t + if hasattr(self, '_set'): + self._set() + + def _unset_otn(self): + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + + + def _get_vlanid(self): + """ + Getter method for vlanid, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay/backup_path/path_element/label_hop/te_label/vlanid (etht-types:vlanid) + + YANG Description: VLAN tag id. + """ + return self.__vlanid + + def _set_vlanid(self, v, load=False): + """ + Setter method for vlanid, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay/backup_path/path_element/label_hop/te_label/vlanid (etht-types:vlanid) + If this variable is read-only (config: false) in the + source YANG file, then _set_vlanid is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_vlanid() directly. + + YANG Description: VLAN tag id. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """vlanid must be of a type compatible with etht-types:vlanid""", + 'defined-type': "etht-types:vlanid", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True)""", + }) + + self.__vlanid = t + if hasattr(self, '_set'): + self._set() + + def _unset_vlanid(self): + self.__vlanid = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True) + + + def _get_direction(self): + """ + Getter method for direction, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay/backup_path/path_element/label_hop/te_label/direction (te-label-direction) + + YANG Description: Label direction. + """ + return self.__direction + + def _set_direction(self, v, load=False): + """ + Setter method for direction, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay/backup_path/path_element/label_hop/te_label/direction (te-label-direction) + If this variable is read-only (config: false) in the + source YANG file, then _set_direction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_direction() directly. + + YANG Description: Label direction. + """ + 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={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """direction must be of a type compatible with te-label-direction""", + 'defined-type': "ietf-te-topology:te-label-direction", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=True)""", + }) + + self.__direction = t + if hasattr(self, '_set'): + self._set() + + def _unset_direction(self): + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=True) + + generic = __builtin__.property(_get_generic, _set_generic) + otn = __builtin__.property(_get_otn, _set_otn) + vlanid = __builtin__.property(_get_vlanid, _set_vlanid) + direction = __builtin__.property(_get_direction, _set_direction) + + __choices__ = {'technology': {'generic': ['generic'], 'otn': ['otn'], 'eth': ['vlanid']}, 'type': {'label': ['direction']}} + _pyangbind_elements = OrderedDict([('generic', generic), ('otn', otn), ('vlanid', vlanid), ('direction', direction), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/underlay/backup_path/path_element/label_hop/te_label/otn/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/underlay/backup_path/path_element/label_hop/te_label/otn/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..7510f12e33f23f0b40fe4445df6ec5b66163bf5c --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/underlay/backup_path/path_element/label_hop/te_label/otn/__init__.py @@ -0,0 +1,209 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 otn(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/te/templates/link-template/te-link-attributes/underlay/backup-path/path-element/label-hop/te-label/otn. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Label hop for OTN. + """ + __slots__ = ('_path_helper', '_extmethods', '__tpn','__tsg','__ts_list',) + + _yang_name = 'otn' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__tpn = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True) + self.__tsg = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + self.__ts_list = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-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 ['networks', 'te', 'templates', 'link-template', 'te-link-attributes', 'underlay', 'backup-path', 'path-element', 'label-hop', 'te-label', 'otn'] + + def _get_tpn(self): + """ + Getter method for tpn, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay/backup_path/path_element/label_hop/te_label/otn/tpn (otn-tpn) + + YANG Description: Tributary Port Number (TPN). + """ + return self.__tpn + + def _set_tpn(self, v, load=False): + """ + Setter method for tpn, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay/backup_path/path_element/label_hop/te_label/otn/tpn (otn-tpn) + If this variable is read-only (config: false) in the + source YANG file, then _set_tpn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tpn() directly. + + YANG Description: Tributary Port Number (TPN). + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tpn must be of a type compatible with otn-tpn""", + 'defined-type': "ietf-otn-topology:otn-tpn", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True)""", + }) + + self.__tpn = t + if hasattr(self, '_set'): + self._set() + + def _unset_tpn(self): + self.__tpn = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True) + + + def _get_tsg(self): + """ + Getter method for tsg, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay/backup_path/path_element/label_hop/te_label/otn/tsg (identityref) + + YANG Description: Tributary Slot Granularity (TSG). + """ + return self.__tsg + + def _set_tsg(self, v, load=False): + """ + Setter method for tsg, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay/backup_path/path_element/label_hop/te_label/otn/tsg (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_tsg is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tsg() directly. + + YANG Description: Tributary Slot Granularity (TSG). + """ + 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={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tsg must be of a type compatible with identityref""", + 'defined-type': "ietf-otn-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True)""", + }) + + self.__tsg = t + if hasattr(self, '_set'): + self._set() + + def _unset_tsg(self): + self.__tsg = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + + + def _get_ts_list(self): + """ + Getter method for ts_list, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay/backup_path/path_element/label_hop/te_label/otn/ts_list (string) + + YANG Description: A list of available Tributary Slots (TS) ranging + + + + +between 1 and 4095. If multiple values or +ranges are given, they all MUST be disjoint +and MUST be in ascending order. +For example 1-20,25,50-1000. + """ + return self.__ts_list + + def _set_ts_list(self, v, load=False): + """ + Setter method for ts_list, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay/backup_path/path_element/label_hop/te_label/otn/ts_list (string) + If this variable is read-only (config: false) in the + source YANG file, then _set_ts_list is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_ts_list() directly. + + YANG Description: A list of available Tributary Slots (TS) ranging + + + + +between 1 and 4095. If multiple values or +ranges are given, they all MUST be disjoint +and MUST be in ascending order. +For example 1-20,25,50-1000. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='string', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """ts_list must be of a type compatible with string""", + 'defined-type': "string", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='string', is_config=True)""", + }) + + self.__ts_list = t + if hasattr(self, '_set'): + self._set() + + def _unset_ts_list(self): + self.__ts_list = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='string', is_config=True) + + tpn = __builtin__.property(_get_tpn, _set_tpn) + tsg = __builtin__.property(_get_tsg, _set_tsg) + ts_list = __builtin__.property(_get_ts_list, _set_ts_list) + + __choices__ = {'technology': {'otn': ['tpn', 'tsg', 'ts_list']}} + _pyangbind_elements = OrderedDict([('tpn', tpn), ('tsg', tsg), ('ts_list', ts_list), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/underlay/backup_path/path_element/numbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/underlay/backup_path/path_element/numbered_link_hop/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..ebe98f0b08aec3aa09534cbaff924f6a1ed62468 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/underlay/backup_path/path_element/numbered_link_hop/__init__.py @@ -0,0 +1,193 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 numbered_link_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/te/templates/link-template/te-link-attributes/underlay/backup-path/path-element/numbered-link-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Numbered link explicit route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__link_tp_id','__hop_type','__direction',) + + _yang_name = 'numbered-link-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', 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 ['networks', 'te', 'templates', 'link-template', 'te-link-attributes', 'underlay', 'backup-path', 'path-element', 'numbered-link-hop'] + + def _get_link_tp_id(self): + """ + Getter method for link_tp_id, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay/backup_path/path_element/numbered_link_hop/link_tp_id (te-tp-id) + + YANG Description: TE Link Termination Point (LTP) identifier. + """ + return self.__link_tp_id + + def _set_link_tp_id(self, v, load=False): + """ + Setter method for link_tp_id, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay/backup_path/path_element/numbered_link_hop/link_tp_id (te-tp-id) + If this variable is read-only (config: false) in the + source YANG file, then _set_link_tp_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_link_tp_id() directly. + + YANG Description: TE Link Termination Point (LTP) identifier. + """ + 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),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """link_tp_id must be of a type compatible with te-tp-id""", + 'defined-type': "ietf-te-topology:te-tp-id", + 'generated-type': """YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True)""", + }) + + self.__link_tp_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_link_tp_id(self): + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay/backup_path/path_element/numbered_link_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay/backup_path/path_element/numbered_link_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + 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={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + + + def _get_direction(self): + """ + Getter method for direction, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay/backup_path/path_element/numbered_link_hop/direction (te-link-direction) + + YANG Description: Link route object direction. + """ + return self.__direction + + def _set_direction(self, v, load=False): + """ + Setter method for direction, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay/backup_path/path_element/numbered_link_hop/direction (te-link-direction) + If this variable is read-only (config: false) in the + source YANG file, then _set_direction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_direction() directly. + + YANG Description: Link route object direction. + """ + 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={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """direction must be of a type compatible with te-link-direction""", + 'defined-type': "ietf-te-topology:te-link-direction", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True)""", + }) + + self.__direction = t + if hasattr(self, '_set'): + self._set() + + def _unset_direction(self): + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True) + + link_tp_id = __builtin__.property(_get_link_tp_id, _set_link_tp_id) + hop_type = __builtin__.property(_get_hop_type, _set_hop_type) + direction = __builtin__.property(_get_direction, _set_direction) + + __choices__ = {'type': {'numbered-link-hop': ['link_tp_id', 'hop_type', 'direction']}} + _pyangbind_elements = OrderedDict([('link_tp_id', link_tp_id), ('hop_type', hop_type), ('direction', direction), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/underlay/backup_path/path_element/numbered_node_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/underlay/backup_path/path_element/numbered_node_hop/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..204c0ffd8ad8b1c7e89d46c844ea1cc1cebce0d4 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/underlay/backup_path/path_element/numbered_node_hop/__init__.py @@ -0,0 +1,154 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 numbered_node_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/te/templates/link-template/te-link-attributes/underlay/backup-path/path-element/numbered-node-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Numbered node route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__node_id','__hop_type',) + + _yang_name = 'numbered-node-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', 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 ['networks', 'te', 'templates', 'link-template', 'te-link-attributes', 'underlay', 'backup-path', 'path-element', 'numbered-node-hop'] + + def _get_node_id(self): + """ + Getter method for node_id, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay/backup_path/path_element/numbered_node_hop/node_id (te-node-id) + + YANG Description: The identifier of a node in the TE topology. + """ + return self.__node_id + + def _set_node_id(self, v, load=False): + """ + Setter method for node_id, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay/backup_path/path_element/numbered_node_hop/node_id (te-node-id) + 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. + + YANG Description: The identifier of a node in the TE topology. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """node_id must be of a type compatible with te-node-id""", + 'defined-type': "ietf-te-topology:te-node-id", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True)""", + }) + + self.__node_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_node_id(self): + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay/backup_path/path_element/numbered_node_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay/backup_path/path_element/numbered_node_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + 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={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + + node_id = __builtin__.property(_get_node_id, _set_node_id) + hop_type = __builtin__.property(_get_hop_type, _set_hop_type) + + __choices__ = {'type': {'numbered-node-hop': ['node_id', 'hop_type']}} + _pyangbind_elements = OrderedDict([('node_id', node_id), ('hop_type', hop_type), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/underlay/backup_path/path_element/unnumbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/underlay/backup_path/path_element/unnumbered_link_hop/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..49f6d816662decf8ca1f139939ba5d953981810b --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/underlay/backup_path/path_element/unnumbered_link_hop/__init__.py @@ -0,0 +1,236 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 unnumbered_link_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/te/templates/link-template/te-link-attributes/underlay/backup-path/path-element/unnumbered-link-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Unnumbered link explicit route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__link_tp_id','__node_id','__hop_type','__direction',) + + _yang_name = 'unnumbered-link-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True) + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', 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 ['networks', 'te', 'templates', 'link-template', 'te-link-attributes', 'underlay', 'backup-path', 'path-element', 'unnumbered-link-hop'] + + def _get_link_tp_id(self): + """ + Getter method for link_tp_id, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay/backup_path/path_element/unnumbered_link_hop/link_tp_id (te-tp-id) + + YANG Description: TE LTP identifier. The combination of the TE link ID +and the TE node ID is used to identify an unnumbered +TE link. + """ + return self.__link_tp_id + + def _set_link_tp_id(self, v, load=False): + """ + Setter method for link_tp_id, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay/backup_path/path_element/unnumbered_link_hop/link_tp_id (te-tp-id) + If this variable is read-only (config: false) in the + source YANG file, then _set_link_tp_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_link_tp_id() directly. + + YANG Description: TE LTP identifier. The combination of the TE link ID +and the TE node ID is used to identify an unnumbered +TE link. + """ + 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),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """link_tp_id must be of a type compatible with te-tp-id""", + 'defined-type': "ietf-te-topology:te-tp-id", + 'generated-type': """YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True)""", + }) + + self.__link_tp_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_link_tp_id(self): + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True) + + + def _get_node_id(self): + """ + Getter method for node_id, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay/backup_path/path_element/unnumbered_link_hop/node_id (te-node-id) + + YANG Description: The identifier of a node in the TE topology. + """ + return self.__node_id + + def _set_node_id(self, v, load=False): + """ + Setter method for node_id, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay/backup_path/path_element/unnumbered_link_hop/node_id (te-node-id) + 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. + + YANG Description: The identifier of a node in the TE topology. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """node_id must be of a type compatible with te-node-id""", + 'defined-type': "ietf-te-topology:te-node-id", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True)""", + }) + + self.__node_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_node_id(self): + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay/backup_path/path_element/unnumbered_link_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay/backup_path/path_element/unnumbered_link_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + 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={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + + + def _get_direction(self): + """ + Getter method for direction, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay/backup_path/path_element/unnumbered_link_hop/direction (te-link-direction) + + YANG Description: Link route object direction. + """ + return self.__direction + + def _set_direction(self, v, load=False): + """ + Setter method for direction, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay/backup_path/path_element/unnumbered_link_hop/direction (te-link-direction) + If this variable is read-only (config: false) in the + source YANG file, then _set_direction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_direction() directly. + + YANG Description: Link route object direction. + """ + 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={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """direction must be of a type compatible with te-link-direction""", + 'defined-type': "ietf-te-topology:te-link-direction", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True)""", + }) + + self.__direction = t + if hasattr(self, '_set'): + self._set() + + def _unset_direction(self): + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True) + + link_tp_id = __builtin__.property(_get_link_tp_id, _set_link_tp_id) + node_id = __builtin__.property(_get_node_id, _set_node_id) + hop_type = __builtin__.property(_get_hop_type, _set_hop_type) + direction = __builtin__.property(_get_direction, _set_direction) + + __choices__ = {'type': {'unnumbered-link-hop': ['link_tp_id', 'node_id', 'hop_type', 'direction']}} + _pyangbind_elements = OrderedDict([('link_tp_id', link_tp_id), ('node_id', node_id), ('hop_type', hop_type), ('direction', direction), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/underlay/primary_path/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/underlay/primary_path/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..111fdc4e380a501eb41dc18ba865f2be42349691 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/underlay/primary_path/__init__.py @@ -0,0 +1,158 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 path_element +class primary_path(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/te/templates/link-template/te-link-attributes/underlay/primary-path. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: The service path on the underlay topology that +supports this link. + """ + __slots__ = ('_path_helper', '_extmethods', '__network_ref','__path_element',) + + _yang_name = 'primary-path' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__network_ref = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="network-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=True) + self.__path_element = YANGDynClass(base=YANGListType("path_element_id",path_element.path_element, yang_name="path-element", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='path-element-id', extensions=None), is_container='list', yang_name="path-element", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-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 ['networks', 'te', 'templates', 'link-template', 'te-link-attributes', 'underlay', 'primary-path'] + + def _get_network_ref(self): + """ + Getter method for network_ref, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay/primary_path/network_ref (leafref) + + YANG Description: Used to reference a network -- for example, an underlay +network. + """ + return self.__network_ref + + def _set_network_ref(self, v, load=False): + """ + Setter method for network_ref, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay/primary_path/network_ref (leafref) + If this variable is read-only (config: false) in the + source YANG file, then _set_network_ref is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_network_ref() directly. + + YANG Description: Used to reference a network -- for example, an underlay +network. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="network-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """network_ref must be of a type compatible with leafref""", + 'defined-type': "leafref", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="network-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=True)""", + }) + + self.__network_ref = t + if hasattr(self, '_set'): + self._set() + + def _unset_network_ref(self): + self.__network_ref = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="network-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=True) + + + def _get_path_element(self): + """ + Getter method for path_element, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay/primary_path/path_element (list) + + YANG Description: A list of path elements describing the service path. + """ + return self.__path_element + + def _set_path_element(self, v, load=False): + """ + Setter method for path_element, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay/primary_path/path_element (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_element is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_element() directly. + + YANG Description: A list of path elements describing the service path. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("path_element_id",path_element.path_element, yang_name="path-element", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='path-element-id', extensions=None), is_container='list', yang_name="path-element", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_element must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("path_element_id",path_element.path_element, yang_name="path-element", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='path-element-id', extensions=None), is_container='list', yang_name="path-element", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True)""", + }) + + self.__path_element = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_element(self): + self.__path_element = YANGDynClass(base=YANGListType("path_element_id",path_element.path_element, yang_name="path-element", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='path-element-id', extensions=None), is_container='list', yang_name="path-element", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + + network_ref = __builtin__.property(_get_network_ref, _set_network_ref) + path_element = __builtin__.property(_get_path_element, _set_path_element) + + + _pyangbind_elements = OrderedDict([('network_ref', network_ref), ('path_element', path_element), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/underlay/primary_path/path_element/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/underlay/primary_path/path_element/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..71c1bd0cc81cbe80bda97bef7e92a130a1e1b45a --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/underlay/primary_path/path_element/__init__.py @@ -0,0 +1,320 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 numbered_node_hop +from . import numbered_link_hop +from . import unnumbered_link_hop +from . import as_number_hop +from . import label_hop +class path_element(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/te/templates/link-template/te-link-attributes/underlay/primary-path/path-element. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: A list of path elements describing the service path. + """ + __slots__ = ('_path_helper', '_extmethods', '__path_element_id','__numbered_node_hop','__numbered_link_hop','__unnumbered_link_hop','__as_number_hop','__label_hop',) + + _yang_name = 'path-element' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__path_element_id = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="path-element-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + self.__numbered_node_hop = YANGDynClass(base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__numbered_link_hop = YANGDynClass(base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__unnumbered_link_hop = YANGDynClass(base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__as_number_hop = YANGDynClass(base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__label_hop = YANGDynClass(base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-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 ['networks', 'te', 'templates', 'link-template', 'te-link-attributes', 'underlay', 'primary-path', 'path-element'] + + def _get_path_element_id(self): + """ + Getter method for path_element_id, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay/primary_path/path_element/path_element_id (uint32) + + YANG Description: To identify the element in a path. + """ + return self.__path_element_id + + def _set_path_element_id(self, v, load=False): + """ + Setter method for path_element_id, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay/primary_path/path_element/path_element_id (uint32) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_element_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_element_id() directly. + + YANG Description: To identify the element in a path. + """ + 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=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="path-element-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_element_id 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="path-element-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True)""", + }) + + self.__path_element_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_element_id(self): + self.__path_element_id = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="path-element-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + + + def _get_numbered_node_hop(self): + """ + Getter method for numbered_node_hop, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay/primary_path/path_element/numbered_node_hop (container) + + YANG Description: Numbered node route hop. + """ + return self.__numbered_node_hop + + def _set_numbered_node_hop(self, v, load=False): + """ + Setter method for numbered_node_hop, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay/primary_path/path_element/numbered_node_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_numbered_node_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_numbered_node_hop() directly. + + YANG Description: Numbered node route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """numbered_node_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__numbered_node_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_numbered_node_hop(self): + self.__numbered_node_hop = YANGDynClass(base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_numbered_link_hop(self): + """ + Getter method for numbered_link_hop, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay/primary_path/path_element/numbered_link_hop (container) + + YANG Description: Numbered link explicit route hop. + """ + return self.__numbered_link_hop + + def _set_numbered_link_hop(self, v, load=False): + """ + Setter method for numbered_link_hop, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay/primary_path/path_element/numbered_link_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_numbered_link_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_numbered_link_hop() directly. + + YANG Description: Numbered link explicit route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """numbered_link_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__numbered_link_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_numbered_link_hop(self): + self.__numbered_link_hop = YANGDynClass(base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_unnumbered_link_hop(self): + """ + Getter method for unnumbered_link_hop, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay/primary_path/path_element/unnumbered_link_hop (container) + + YANG Description: Unnumbered link explicit route hop. + """ + return self.__unnumbered_link_hop + + def _set_unnumbered_link_hop(self, v, load=False): + """ + Setter method for unnumbered_link_hop, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay/primary_path/path_element/unnumbered_link_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_unnumbered_link_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_unnumbered_link_hop() directly. + + YANG Description: Unnumbered link explicit route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """unnumbered_link_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__unnumbered_link_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_unnumbered_link_hop(self): + self.__unnumbered_link_hop = YANGDynClass(base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_as_number_hop(self): + """ + Getter method for as_number_hop, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay/primary_path/path_element/as_number_hop (container) + + YANG Description: AS explicit route hop. + """ + return self.__as_number_hop + + def _set_as_number_hop(self, v, load=False): + """ + Setter method for as_number_hop, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay/primary_path/path_element/as_number_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_as_number_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_as_number_hop() directly. + + YANG Description: AS explicit route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """as_number_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__as_number_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_as_number_hop(self): + self.__as_number_hop = YANGDynClass(base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_label_hop(self): + """ + Getter method for label_hop, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay/primary_path/path_element/label_hop (container) + + YANG Description: Label hop type. + """ + return self.__label_hop + + def _set_label_hop(self, v, load=False): + """ + Setter method for label_hop, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay/primary_path/path_element/label_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_label_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_label_hop() directly. + + YANG Description: Label hop type. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """label_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__label_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_label_hop(self): + self.__label_hop = YANGDynClass(base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + path_element_id = __builtin__.property(_get_path_element_id, _set_path_element_id) + numbered_node_hop = __builtin__.property(_get_numbered_node_hop, _set_numbered_node_hop) + numbered_link_hop = __builtin__.property(_get_numbered_link_hop, _set_numbered_link_hop) + unnumbered_link_hop = __builtin__.property(_get_unnumbered_link_hop, _set_unnumbered_link_hop) + as_number_hop = __builtin__.property(_get_as_number_hop, _set_as_number_hop) + label_hop = __builtin__.property(_get_label_hop, _set_label_hop) + + __choices__ = {'type': {'numbered-node-hop': ['numbered_node_hop'], 'numbered-link-hop': ['numbered_link_hop'], 'unnumbered-link-hop': ['unnumbered_link_hop'], 'as-number': ['as_number_hop'], 'label': ['label_hop']}} + _pyangbind_elements = OrderedDict([('path_element_id', path_element_id), ('numbered_node_hop', numbered_node_hop), ('numbered_link_hop', numbered_link_hop), ('unnumbered_link_hop', unnumbered_link_hop), ('as_number_hop', as_number_hop), ('label_hop', label_hop), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/underlay/primary_path/path_element/as_number_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/underlay/primary_path/path_element/as_number_hop/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..37b1d287a11f717964e71e43e2721cc84a4b55ff --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/underlay/primary_path/path_element/as_number_hop/__init__.py @@ -0,0 +1,154 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 as_number_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/te/templates/link-template/te-link-attributes/underlay/primary-path/path-element/as-number-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: AS explicit route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__as_number','__hop_type',) + + _yang_name = 'as-number-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__as_number = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=True) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', 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 ['networks', 'te', 'templates', 'link-template', 'te-link-attributes', 'underlay', 'primary-path', 'path-element', 'as-number-hop'] + + def _get_as_number(self): + """ + Getter method for as_number, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay/primary_path/path_element/as_number_hop/as_number (inet:as-number) + + YANG Description: The Autonomous System (AS) number. + """ + return self.__as_number + + def _set_as_number(self, v, load=False): + """ + Setter method for as_number, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay/primary_path/path_element/as_number_hop/as_number (inet:as-number) + If this variable is read-only (config: false) in the + source YANG file, then _set_as_number is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_as_number() directly. + + YANG Description: The Autonomous System (AS) number. + """ + 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="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """as_number must be of a type compatible with inet:as-number""", + 'defined-type': "inet:as-number", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=True)""", + }) + + self.__as_number = t + if hasattr(self, '_set'): + self._set() + + def _unset_as_number(self): + self.__as_number = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=True) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay/primary_path/path_element/as_number_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay/primary_path/path_element/as_number_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + 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={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + + as_number = __builtin__.property(_get_as_number, _set_as_number) + hop_type = __builtin__.property(_get_hop_type, _set_hop_type) + + __choices__ = {'type': {'as-number': ['as_number', 'hop_type']}} + _pyangbind_elements = OrderedDict([('as_number', as_number), ('hop_type', hop_type), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/underlay/primary_path/path_element/label_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/underlay/primary_path/path_element/label_hop/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..d2a98a8c6dbd034bc2ac51d8e418def432acd0fd --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/underlay/primary_path/path_element/label_hop/__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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 te_label +class label_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/te/templates/link-template/te-link-attributes/underlay/primary-path/path-element/label-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Label hop type. + """ + __slots__ = ('_path_helper', '_extmethods', '__te_label',) + + _yang_name = 'label-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__te_label = YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-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 ['networks', 'te', 'templates', 'link-template', 'te-link-attributes', 'underlay', 'primary-path', 'path-element', 'label-hop'] + + def _get_te_label(self): + """ + Getter method for te_label, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay/primary_path/path_element/label_hop/te_label (container) + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + return self.__te_label + + def _set_te_label(self, v, load=False): + """ + Setter method for te_label, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay/primary_path/path_element/label_hop/te_label (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_te_label is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_te_label() directly. + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """te_label must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__te_label = t + if hasattr(self, '_set'): + self._set() + + def _unset_te_label(self): + self.__te_label = YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + te_label = __builtin__.property(_get_te_label, _set_te_label) + + __choices__ = {'type': {'label': ['te_label']}} + _pyangbind_elements = OrderedDict([('te_label', te_label), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/underlay/primary_path/path_element/label_hop/te_label/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/underlay/primary_path/path_element/label_hop/te_label/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..b61128caea73a0a628b73a92ff26c1a826f5eb51 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/underlay/primary_path/path_element/label_hop/te_label/__init__.py @@ -0,0 +1,234 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 otn +class te_label(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/te/templates/link-template/te-link-attributes/underlay/primary-path/path-element/label-hop/te-label. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + __slots__ = ('_path_helper', '_extmethods', '__generic','__otn','__vlanid','__direction',) + + _yang_name = 'te-label' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__generic = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True) + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + self.__vlanid = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True) + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', 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 ['networks', 'te', 'templates', 'link-template', 'te-link-attributes', 'underlay', 'primary-path', 'path-element', 'label-hop', 'te-label'] + + def _get_generic(self): + """ + Getter method for generic, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay/primary_path/path_element/label_hop/te_label/generic (rt-types:generalized-label) + + YANG Description: TE label specified in a generic format. + """ + return self.__generic + + def _set_generic(self, v, load=False): + """ + Setter method for generic, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay/primary_path/path_element/label_hop/te_label/generic (rt-types:generalized-label) + If this variable is read-only (config: false) in the + source YANG file, then _set_generic is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_generic() directly. + + YANG Description: TE label specified in a generic format. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """generic must be of a type compatible with rt-types:generalized-label""", + 'defined-type': "rt-types:generalized-label", + 'generated-type': """YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True)""", + }) + + self.__generic = t + if hasattr(self, '_set'): + self._set() + + def _unset_generic(self): + self.__generic = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True) + + + def _get_otn(self): + """ + Getter method for otn, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay/primary_path/path_element/label_hop/te_label/otn (container) + + YANG Description: Label hop for OTN. + """ + return self.__otn + + def _set_otn(self, v, load=False): + """ + Setter method for otn, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay/primary_path/path_element/label_hop/te_label/otn (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_otn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_otn() directly. + + YANG Description: Label hop for OTN. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """otn must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True)""", + }) + + self.__otn = t + if hasattr(self, '_set'): + self._set() + + def _unset_otn(self): + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + + + def _get_vlanid(self): + """ + Getter method for vlanid, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay/primary_path/path_element/label_hop/te_label/vlanid (etht-types:vlanid) + + YANG Description: VLAN tag id. + """ + return self.__vlanid + + def _set_vlanid(self, v, load=False): + """ + Setter method for vlanid, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay/primary_path/path_element/label_hop/te_label/vlanid (etht-types:vlanid) + If this variable is read-only (config: false) in the + source YANG file, then _set_vlanid is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_vlanid() directly. + + YANG Description: VLAN tag id. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """vlanid must be of a type compatible with etht-types:vlanid""", + 'defined-type': "etht-types:vlanid", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True)""", + }) + + self.__vlanid = t + if hasattr(self, '_set'): + self._set() + + def _unset_vlanid(self): + self.__vlanid = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True) + + + def _get_direction(self): + """ + Getter method for direction, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay/primary_path/path_element/label_hop/te_label/direction (te-label-direction) + + YANG Description: Label direction. + """ + return self.__direction + + def _set_direction(self, v, load=False): + """ + Setter method for direction, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay/primary_path/path_element/label_hop/te_label/direction (te-label-direction) + If this variable is read-only (config: false) in the + source YANG file, then _set_direction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_direction() directly. + + YANG Description: Label direction. + """ + 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={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """direction must be of a type compatible with te-label-direction""", + 'defined-type': "ietf-te-topology:te-label-direction", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=True)""", + }) + + self.__direction = t + if hasattr(self, '_set'): + self._set() + + def _unset_direction(self): + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=True) + + generic = __builtin__.property(_get_generic, _set_generic) + otn = __builtin__.property(_get_otn, _set_otn) + vlanid = __builtin__.property(_get_vlanid, _set_vlanid) + direction = __builtin__.property(_get_direction, _set_direction) + + __choices__ = {'technology': {'generic': ['generic'], 'otn': ['otn'], 'eth': ['vlanid']}, 'type': {'label': ['direction']}} + _pyangbind_elements = OrderedDict([('generic', generic), ('otn', otn), ('vlanid', vlanid), ('direction', direction), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/underlay/primary_path/path_element/label_hop/te_label/otn/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/underlay/primary_path/path_element/label_hop/te_label/otn/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..c629a4834ee93a4e1b4d3119f00668b93b541bb2 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/underlay/primary_path/path_element/label_hop/te_label/otn/__init__.py @@ -0,0 +1,209 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 otn(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/te/templates/link-template/te-link-attributes/underlay/primary-path/path-element/label-hop/te-label/otn. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Label hop for OTN. + """ + __slots__ = ('_path_helper', '_extmethods', '__tpn','__tsg','__ts_list',) + + _yang_name = 'otn' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__tpn = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True) + self.__tsg = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + self.__ts_list = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-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 ['networks', 'te', 'templates', 'link-template', 'te-link-attributes', 'underlay', 'primary-path', 'path-element', 'label-hop', 'te-label', 'otn'] + + def _get_tpn(self): + """ + Getter method for tpn, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay/primary_path/path_element/label_hop/te_label/otn/tpn (otn-tpn) + + YANG Description: Tributary Port Number (TPN). + """ + return self.__tpn + + def _set_tpn(self, v, load=False): + """ + Setter method for tpn, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay/primary_path/path_element/label_hop/te_label/otn/tpn (otn-tpn) + If this variable is read-only (config: false) in the + source YANG file, then _set_tpn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tpn() directly. + + YANG Description: Tributary Port Number (TPN). + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tpn must be of a type compatible with otn-tpn""", + 'defined-type': "ietf-otn-topology:otn-tpn", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True)""", + }) + + self.__tpn = t + if hasattr(self, '_set'): + self._set() + + def _unset_tpn(self): + self.__tpn = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True) + + + def _get_tsg(self): + """ + Getter method for tsg, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay/primary_path/path_element/label_hop/te_label/otn/tsg (identityref) + + YANG Description: Tributary Slot Granularity (TSG). + """ + return self.__tsg + + def _set_tsg(self, v, load=False): + """ + Setter method for tsg, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay/primary_path/path_element/label_hop/te_label/otn/tsg (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_tsg is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tsg() directly. + + YANG Description: Tributary Slot Granularity (TSG). + """ + 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={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tsg must be of a type compatible with identityref""", + 'defined-type': "ietf-otn-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True)""", + }) + + self.__tsg = t + if hasattr(self, '_set'): + self._set() + + def _unset_tsg(self): + self.__tsg = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + + + def _get_ts_list(self): + """ + Getter method for ts_list, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay/primary_path/path_element/label_hop/te_label/otn/ts_list (string) + + YANG Description: A list of available Tributary Slots (TS) ranging + + + + +between 1 and 4095. If multiple values or +ranges are given, they all MUST be disjoint +and MUST be in ascending order. +For example 1-20,25,50-1000. + """ + return self.__ts_list + + def _set_ts_list(self, v, load=False): + """ + Setter method for ts_list, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay/primary_path/path_element/label_hop/te_label/otn/ts_list (string) + If this variable is read-only (config: false) in the + source YANG file, then _set_ts_list is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_ts_list() directly. + + YANG Description: A list of available Tributary Slots (TS) ranging + + + + +between 1 and 4095. If multiple values or +ranges are given, they all MUST be disjoint +and MUST be in ascending order. +For example 1-20,25,50-1000. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='string', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """ts_list must be of a type compatible with string""", + 'defined-type': "string", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='string', is_config=True)""", + }) + + self.__ts_list = t + if hasattr(self, '_set'): + self._set() + + def _unset_ts_list(self): + self.__ts_list = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='string', is_config=True) + + tpn = __builtin__.property(_get_tpn, _set_tpn) + tsg = __builtin__.property(_get_tsg, _set_tsg) + ts_list = __builtin__.property(_get_ts_list, _set_ts_list) + + __choices__ = {'technology': {'otn': ['tpn', 'tsg', 'ts_list']}} + _pyangbind_elements = OrderedDict([('tpn', tpn), ('tsg', tsg), ('ts_list', ts_list), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/underlay/primary_path/path_element/numbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/underlay/primary_path/path_element/numbered_link_hop/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..b3b44095b856017f9bc9f0a8a48d9ccfb1104ef5 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/underlay/primary_path/path_element/numbered_link_hop/__init__.py @@ -0,0 +1,193 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 numbered_link_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/te/templates/link-template/te-link-attributes/underlay/primary-path/path-element/numbered-link-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Numbered link explicit route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__link_tp_id','__hop_type','__direction',) + + _yang_name = 'numbered-link-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', 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 ['networks', 'te', 'templates', 'link-template', 'te-link-attributes', 'underlay', 'primary-path', 'path-element', 'numbered-link-hop'] + + def _get_link_tp_id(self): + """ + Getter method for link_tp_id, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay/primary_path/path_element/numbered_link_hop/link_tp_id (te-tp-id) + + YANG Description: TE Link Termination Point (LTP) identifier. + """ + return self.__link_tp_id + + def _set_link_tp_id(self, v, load=False): + """ + Setter method for link_tp_id, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay/primary_path/path_element/numbered_link_hop/link_tp_id (te-tp-id) + If this variable is read-only (config: false) in the + source YANG file, then _set_link_tp_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_link_tp_id() directly. + + YANG Description: TE Link Termination Point (LTP) identifier. + """ + 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),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """link_tp_id must be of a type compatible with te-tp-id""", + 'defined-type': "ietf-te-topology:te-tp-id", + 'generated-type': """YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True)""", + }) + + self.__link_tp_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_link_tp_id(self): + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay/primary_path/path_element/numbered_link_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay/primary_path/path_element/numbered_link_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + 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={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + + + def _get_direction(self): + """ + Getter method for direction, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay/primary_path/path_element/numbered_link_hop/direction (te-link-direction) + + YANG Description: Link route object direction. + """ + return self.__direction + + def _set_direction(self, v, load=False): + """ + Setter method for direction, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay/primary_path/path_element/numbered_link_hop/direction (te-link-direction) + If this variable is read-only (config: false) in the + source YANG file, then _set_direction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_direction() directly. + + YANG Description: Link route object direction. + """ + 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={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """direction must be of a type compatible with te-link-direction""", + 'defined-type': "ietf-te-topology:te-link-direction", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True)""", + }) + + self.__direction = t + if hasattr(self, '_set'): + self._set() + + def _unset_direction(self): + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True) + + link_tp_id = __builtin__.property(_get_link_tp_id, _set_link_tp_id) + hop_type = __builtin__.property(_get_hop_type, _set_hop_type) + direction = __builtin__.property(_get_direction, _set_direction) + + __choices__ = {'type': {'numbered-link-hop': ['link_tp_id', 'hop_type', 'direction']}} + _pyangbind_elements = OrderedDict([('link_tp_id', link_tp_id), ('hop_type', hop_type), ('direction', direction), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/underlay/primary_path/path_element/numbered_node_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/underlay/primary_path/path_element/numbered_node_hop/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..4e0f06397674b361981c7f12ed512c5ac95e4797 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/underlay/primary_path/path_element/numbered_node_hop/__init__.py @@ -0,0 +1,154 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 numbered_node_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/te/templates/link-template/te-link-attributes/underlay/primary-path/path-element/numbered-node-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Numbered node route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__node_id','__hop_type',) + + _yang_name = 'numbered-node-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', 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 ['networks', 'te', 'templates', 'link-template', 'te-link-attributes', 'underlay', 'primary-path', 'path-element', 'numbered-node-hop'] + + def _get_node_id(self): + """ + Getter method for node_id, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay/primary_path/path_element/numbered_node_hop/node_id (te-node-id) + + YANG Description: The identifier of a node in the TE topology. + """ + return self.__node_id + + def _set_node_id(self, v, load=False): + """ + Setter method for node_id, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay/primary_path/path_element/numbered_node_hop/node_id (te-node-id) + 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. + + YANG Description: The identifier of a node in the TE topology. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """node_id must be of a type compatible with te-node-id""", + 'defined-type': "ietf-te-topology:te-node-id", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True)""", + }) + + self.__node_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_node_id(self): + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay/primary_path/path_element/numbered_node_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay/primary_path/path_element/numbered_node_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + 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={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + + node_id = __builtin__.property(_get_node_id, _set_node_id) + hop_type = __builtin__.property(_get_hop_type, _set_hop_type) + + __choices__ = {'type': {'numbered-node-hop': ['node_id', 'hop_type']}} + _pyangbind_elements = OrderedDict([('node_id', node_id), ('hop_type', hop_type), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/underlay/primary_path/path_element/unnumbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/underlay/primary_path/path_element/unnumbered_link_hop/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..6f04ec7fc1e3908e2db02cb47ca3160c58402fc2 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/underlay/primary_path/path_element/unnumbered_link_hop/__init__.py @@ -0,0 +1,236 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 unnumbered_link_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/te/templates/link-template/te-link-attributes/underlay/primary-path/path-element/unnumbered-link-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Unnumbered link explicit route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__link_tp_id','__node_id','__hop_type','__direction',) + + _yang_name = 'unnumbered-link-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True) + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', 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 ['networks', 'te', 'templates', 'link-template', 'te-link-attributes', 'underlay', 'primary-path', 'path-element', 'unnumbered-link-hop'] + + def _get_link_tp_id(self): + """ + Getter method for link_tp_id, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay/primary_path/path_element/unnumbered_link_hop/link_tp_id (te-tp-id) + + YANG Description: TE LTP identifier. The combination of the TE link ID +and the TE node ID is used to identify an unnumbered +TE link. + """ + return self.__link_tp_id + + def _set_link_tp_id(self, v, load=False): + """ + Setter method for link_tp_id, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay/primary_path/path_element/unnumbered_link_hop/link_tp_id (te-tp-id) + If this variable is read-only (config: false) in the + source YANG file, then _set_link_tp_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_link_tp_id() directly. + + YANG Description: TE LTP identifier. The combination of the TE link ID +and the TE node ID is used to identify an unnumbered +TE link. + """ + 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),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """link_tp_id must be of a type compatible with te-tp-id""", + 'defined-type': "ietf-te-topology:te-tp-id", + 'generated-type': """YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True)""", + }) + + self.__link_tp_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_link_tp_id(self): + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True) + + + def _get_node_id(self): + """ + Getter method for node_id, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay/primary_path/path_element/unnumbered_link_hop/node_id (te-node-id) + + YANG Description: The identifier of a node in the TE topology. + """ + return self.__node_id + + def _set_node_id(self, v, load=False): + """ + Setter method for node_id, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay/primary_path/path_element/unnumbered_link_hop/node_id (te-node-id) + 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. + + YANG Description: The identifier of a node in the TE topology. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """node_id must be of a type compatible with te-node-id""", + 'defined-type': "ietf-te-topology:te-node-id", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True)""", + }) + + self.__node_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_node_id(self): + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay/primary_path/path_element/unnumbered_link_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay/primary_path/path_element/unnumbered_link_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + 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={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + + + def _get_direction(self): + """ + Getter method for direction, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay/primary_path/path_element/unnumbered_link_hop/direction (te-link-direction) + + YANG Description: Link route object direction. + """ + return self.__direction + + def _set_direction(self, v, load=False): + """ + Setter method for direction, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay/primary_path/path_element/unnumbered_link_hop/direction (te-link-direction) + If this variable is read-only (config: false) in the + source YANG file, then _set_direction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_direction() directly. + + YANG Description: Link route object direction. + """ + 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={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """direction must be of a type compatible with te-link-direction""", + 'defined-type': "ietf-te-topology:te-link-direction", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True)""", + }) + + self.__direction = t + if hasattr(self, '_set'): + self._set() + + def _unset_direction(self): + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True) + + link_tp_id = __builtin__.property(_get_link_tp_id, _set_link_tp_id) + node_id = __builtin__.property(_get_node_id, _set_node_id) + hop_type = __builtin__.property(_get_hop_type, _set_hop_type) + direction = __builtin__.property(_get_direction, _set_direction) + + __choices__ = {'type': {'unnumbered-link-hop': ['link_tp_id', 'node_id', 'hop_type', 'direction']}} + _pyangbind_elements = OrderedDict([('link_tp_id', link_tp_id), ('node_id', node_id), ('hop_type', hop_type), ('direction', direction), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/underlay/tunnel_termination_points/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/underlay/tunnel_termination_points/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..801aa8c429415ab363b69a8abcada745f901a81a --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/underlay/tunnel_termination_points/__init__.py @@ -0,0 +1,154 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 tunnel_termination_points(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/te/templates/link-template/te-link-attributes/underlay/tunnel-termination-points. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Underlay TTPs desired for this link. + """ + __slots__ = ('_path_helper', '_extmethods', '__source','__destination',) + + _yang_name = 'tunnel-termination-points' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__source = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="source", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='binary', is_config=True) + self.__destination = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="destination", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='binary', 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 ['networks', 'te', 'templates', 'link-template', 'te-link-attributes', 'underlay', 'tunnel-termination-points'] + + def _get_source(self): + """ + Getter method for source, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay/tunnel_termination_points/source (binary) + + YANG Description: Source TTP identifier. + """ + return self.__source + + def _set_source(self, v, load=False): + """ + Setter method for source, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay/tunnel_termination_points/source (binary) + If this variable is read-only (config: false) in the + source YANG file, then _set_source is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_source() directly. + + YANG Description: Source TTP identifier. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBinary, is_leaf=True, yang_name="source", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='binary', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """source must be of a type compatible with binary""", + 'defined-type': "binary", + 'generated-type': """YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="source", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='binary', is_config=True)""", + }) + + self.__source = t + if hasattr(self, '_set'): + self._set() + + def _unset_source(self): + self.__source = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="source", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='binary', is_config=True) + + + def _get_destination(self): + """ + Getter method for destination, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay/tunnel_termination_points/destination (binary) + + YANG Description: Destination TTP identifier. + """ + return self.__destination + + def _set_destination(self, v, load=False): + """ + Setter method for destination, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay/tunnel_termination_points/destination (binary) + If this variable is read-only (config: false) in the + source YANG file, then _set_destination is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_destination() directly. + + YANG Description: Destination TTP identifier. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBinary, is_leaf=True, yang_name="destination", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='binary', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """destination must be of a type compatible with binary""", + 'defined-type': "binary", + 'generated-type': """YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="destination", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='binary', is_config=True)""", + }) + + self.__destination = t + if hasattr(self, '_set'): + self._set() + + def _unset_destination(self): + self.__destination = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="destination", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='binary', is_config=True) + + source = __builtin__.property(_get_source, _set_source) + destination = __builtin__.property(_get_destination, _set_destination) + + + _pyangbind_elements = OrderedDict([('source', source), ('destination', destination), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/underlay/tunnels/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/underlay/tunnels/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e2a5a218a8a938a331e0d9435a8369a3a4b6861b --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/underlay/tunnels/__init__.py @@ -0,0 +1,167 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 tunnel +class tunnels(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/te/templates/link-template/te-link-attributes/underlay/tunnels. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Underlay TE tunnels supporting this TE link. + """ + __slots__ = ('_path_helper', '_extmethods', '__sharing','__tunnel',) + + _yang_name = 'tunnels' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__sharing = YANGDynClass(base=YANGBool, default=YANGBool("true"), is_leaf=True, yang_name="sharing", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='boolean', is_config=True) + self.__tunnel = YANGDynClass(base=YANGListType("tunnel_name",tunnel.tunnel, yang_name="tunnel", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='tunnel-name', extensions=None), is_container='list', yang_name="tunnel", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-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 ['networks', 'te', 'templates', 'link-template', 'te-link-attributes', 'underlay', 'tunnels'] + + def _get_sharing(self): + """ + Getter method for sharing, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay/tunnels/sharing (boolean) + + YANG Description: 'true' if the underlay tunnel can be shared with other +TE links; +'false' if the underlay tunnel is dedicated to this +TE link. +This leaf is the default option for all TE tunnels +and may be overridden by the per-TE-tunnel value. + """ + return self.__sharing + + def _set_sharing(self, v, load=False): + """ + Setter method for sharing, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay/tunnels/sharing (boolean) + If this variable is read-only (config: false) in the + source YANG file, then _set_sharing is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_sharing() directly. + + YANG Description: 'true' if the underlay tunnel can be shared with other +TE links; +'false' if the underlay tunnel is dedicated to this +TE link. +This leaf is the default option for all TE tunnels +and may be overridden by the per-TE-tunnel value. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBool, default=YANGBool("true"), is_leaf=True, yang_name="sharing", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='boolean', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """sharing must be of a type compatible with boolean""", + 'defined-type': "boolean", + 'generated-type': """YANGDynClass(base=YANGBool, default=YANGBool("true"), is_leaf=True, yang_name="sharing", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='boolean', is_config=True)""", + }) + + self.__sharing = t + if hasattr(self, '_set'): + self._set() + + def _unset_sharing(self): + self.__sharing = YANGDynClass(base=YANGBool, default=YANGBool("true"), is_leaf=True, yang_name="sharing", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='boolean', is_config=True) + + + def _get_tunnel(self): + """ + Getter method for tunnel, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay/tunnels/tunnel (list) + + YANG Description: Zero, one, or more underlay TE tunnels that support this +TE link. + """ + return self.__tunnel + + def _set_tunnel(self, v, load=False): + """ + Setter method for tunnel, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay/tunnels/tunnel (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_tunnel is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tunnel() directly. + + YANG Description: Zero, one, or more underlay TE tunnels that support this +TE link. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("tunnel_name",tunnel.tunnel, yang_name="tunnel", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='tunnel-name', extensions=None), is_container='list', yang_name="tunnel", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tunnel must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("tunnel_name",tunnel.tunnel, yang_name="tunnel", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='tunnel-name', extensions=None), is_container='list', yang_name="tunnel", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True)""", + }) + + self.__tunnel = t + if hasattr(self, '_set'): + self._set() + + def _unset_tunnel(self): + self.__tunnel = YANGDynClass(base=YANGListType("tunnel_name",tunnel.tunnel, yang_name="tunnel", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='tunnel-name', extensions=None), is_container='list', yang_name="tunnel", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + + sharing = __builtin__.property(_get_sharing, _set_sharing) + tunnel = __builtin__.property(_get_tunnel, _set_tunnel) + + + _pyangbind_elements = OrderedDict([('sharing', sharing), ('tunnel', tunnel), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/underlay/tunnels/tunnel/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/underlay/tunnels/tunnel/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..24bfd8831ebc0ea3189d0346790c3048acdba6c2 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/underlay/tunnels/tunnel/__init__.py @@ -0,0 +1,170 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 tunnel(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/te/templates/link-template/te-link-attributes/underlay/tunnels/tunnel. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Zero, one, or more underlay TE tunnels that support this +TE link. + """ + __slots__ = ('_path_helper', '_extmethods', '__tunnel_name','__sharing',) + + _yang_name = 'tunnel' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__tunnel_name = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="tunnel-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=True) + self.__sharing = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="sharing", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', 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 ['networks', 'te', 'templates', 'link-template', 'te-link-attributes', 'underlay', 'tunnels', 'tunnel'] + + def _get_tunnel_name(self): + """ + Getter method for tunnel_name, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay/tunnels/tunnel/tunnel_name (string) + + YANG Description: A tunnel name uniquely identifies an underlay TE tunnel, +used together with the 'source-node' value for this +link. + """ + return self.__tunnel_name + + def _set_tunnel_name(self, v, load=False): + """ + Setter method for tunnel_name, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay/tunnels/tunnel/tunnel_name (string) + If this variable is read-only (config: false) in the + source YANG file, then _set_tunnel_name is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tunnel_name() directly. + + YANG Description: A tunnel name uniquely identifies an underlay TE tunnel, +used together with the 'source-node' value for this +link. + """ + 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="tunnel-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tunnel_name must be of a type compatible with string""", + 'defined-type': "string", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="tunnel-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=True)""", + }) + + self.__tunnel_name = t + if hasattr(self, '_set'): + self._set() + + def _unset_tunnel_name(self): + self.__tunnel_name = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="tunnel-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=True) + + + def _get_sharing(self): + """ + Getter method for sharing, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay/tunnels/tunnel/sharing (boolean) + + YANG Description: 'true' if the underlay tunnel can be shared with other +TE links; +'false' if the underlay tunnel is dedicated to this +TE link. + """ + return self.__sharing + + def _set_sharing(self, v, load=False): + """ + Setter method for sharing, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay/tunnels/tunnel/sharing (boolean) + If this variable is read-only (config: false) in the + source YANG file, then _set_sharing is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_sharing() directly. + + YANG Description: 'true' if the underlay tunnel can be shared with other +TE links; +'false' if the underlay tunnel is dedicated to this +TE link. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBool, is_leaf=True, yang_name="sharing", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='boolean', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """sharing must be of a type compatible with boolean""", + 'defined-type': "boolean", + 'generated-type': """YANGDynClass(base=YANGBool, is_leaf=True, yang_name="sharing", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='boolean', is_config=True)""", + }) + + self.__sharing = t + if hasattr(self, '_set'): + self._set() + + def _unset_sharing(self): + self.__sharing = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="sharing", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='boolean', is_config=True) + + tunnel_name = __builtin__.property(_get_tunnel_name, _set_tunnel_name) + sharing = __builtin__.property(_get_sharing, _set_sharing) + + + _pyangbind_elements = OrderedDict([('tunnel_name', tunnel_name), ('sharing', sharing), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/unreserved_bandwidth/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/unreserved_bandwidth/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..47c06f99ed81c233e11a6a4ab3cfbdd169adfa3d --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/unreserved_bandwidth/__init__.py @@ -0,0 +1,163 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 te_bandwidth +class unreserved_bandwidth(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/te/templates/link-template/te-link-attributes/unreserved-bandwidth. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Unreserved bandwidth for priority levels 0-7. Units are in +bytes per second. + """ + __slots__ = ('_path_helper', '_extmethods', '__priority','__te_bandwidth',) + + _yang_name = 'unreserved-bandwidth' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__priority = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..7']}), is_leaf=True, yang_name="priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint8', is_config=True) + self.__te_bandwidth = YANGDynClass(base=te_bandwidth.te_bandwidth, is_container='container', yang_name="te-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-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 ['networks', 'te', 'templates', 'link-template', 'te-link-attributes', 'unreserved-bandwidth'] + + def _get_priority(self): + """ + Getter method for priority, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/unreserved_bandwidth/priority (uint8) + + YANG Description: Priority. + """ + return self.__priority + + def _set_priority(self, v, load=False): + """ + Setter method for priority, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/unreserved_bandwidth/priority (uint8) + If this variable is read-only (config: false) in the + source YANG file, then _set_priority is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_priority() directly. + + YANG Description: Priority. + """ + 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=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..7']}), is_leaf=True, yang_name="priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint8', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """priority must be of a type compatible with uint8""", + 'defined-type': "uint8", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..7']}), is_leaf=True, yang_name="priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint8', is_config=True)""", + }) + + self.__priority = t + if hasattr(self, '_set'): + self._set() + + def _unset_priority(self): + self.__priority = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..7']}), is_leaf=True, yang_name="priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint8', is_config=True) + + + def _get_te_bandwidth(self): + """ + Getter method for te_bandwidth, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/unreserved_bandwidth/te_bandwidth (container) + + YANG Description: Container that specifies TE bandwidth. The choices +can be augmented for specific data-plane technologies. + """ + return self.__te_bandwidth + + def _set_te_bandwidth(self, v, load=False): + """ + Setter method for te_bandwidth, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/unreserved_bandwidth/te_bandwidth (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_te_bandwidth is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_te_bandwidth() directly. + + YANG Description: Container that specifies TE bandwidth. The choices +can be augmented for specific data-plane technologies. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=te_bandwidth.te_bandwidth, is_container='container', yang_name="te-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """te_bandwidth must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=te_bandwidth.te_bandwidth, is_container='container', yang_name="te-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__te_bandwidth = t + if hasattr(self, '_set'): + self._set() + + def _unset_te_bandwidth(self): + self.__te_bandwidth = YANGDynClass(base=te_bandwidth.te_bandwidth, is_container='container', yang_name="te-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + priority = __builtin__.property(_get_priority, _set_priority) + te_bandwidth = __builtin__.property(_get_te_bandwidth, _set_te_bandwidth) + + + _pyangbind_elements = OrderedDict([('priority', priority), ('te_bandwidth', te_bandwidth), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/unreserved_bandwidth/te_bandwidth/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/unreserved_bandwidth/te_bandwidth/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..35527bd359c6dd41044a11d2bf1a195eee833692 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/unreserved_bandwidth/te_bandwidth/__init__.py @@ -0,0 +1,195 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 otn +class te_bandwidth(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/te/templates/link-template/te-link-attributes/unreserved-bandwidth/te-bandwidth. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Container that specifies TE bandwidth. The choices +can be augmented for specific data-plane technologies. + """ + __slots__ = ('_path_helper', '_extmethods', '__generic','__otn','__eth_bandwidth',) + + _yang_name = 'te-bandwidth' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__generic = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+(,(0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+))*'}), is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-bandwidth', is_config=True) + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + self.__eth_bandwidth = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), restriction_dict={'range': ['0..10000000000']}), is_leaf=True, yang_name="eth-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint64', 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 ['networks', 'te', 'templates', 'link-template', 'te-link-attributes', 'unreserved-bandwidth', 'te-bandwidth'] + + def _get_generic(self): + """ + Getter method for generic, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/unreserved_bandwidth/te_bandwidth/generic (te-bandwidth) + + YANG Description: Bandwidth specified in a generic format. + """ + return self.__generic + + def _set_generic(self, v, load=False): + """ + Setter method for generic, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/unreserved_bandwidth/te_bandwidth/generic (te-bandwidth) + If this variable is read-only (config: false) in the + source YANG file, then _set_generic is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_generic() directly. + + YANG Description: Bandwidth specified in a generic format. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+(,(0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+))*'}), is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-bandwidth', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """generic must be of a type compatible with te-bandwidth""", + 'defined-type': "ietf-te-topology:te-bandwidth", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+(,(0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+))*'}), is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-bandwidth', is_config=True)""", + }) + + self.__generic = t + if hasattr(self, '_set'): + self._set() + + def _unset_generic(self): + self.__generic = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+(,(0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+))*'}), is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-bandwidth', is_config=True) + + + def _get_otn(self): + """ + Getter method for otn, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/unreserved_bandwidth/te_bandwidth/otn (container) + + YANG Description: Bandwidth attributes for OTN links + """ + return self.__otn + + def _set_otn(self, v, load=False): + """ + Setter method for otn, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/unreserved_bandwidth/te_bandwidth/otn (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_otn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_otn() directly. + + YANG Description: Bandwidth attributes for OTN links + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=otn.otn, is_container='container', yang_name="otn", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """otn must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True)""", + }) + + self.__otn = t + if hasattr(self, '_set'): + self._set() + + def _unset_otn(self): + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + + + def _get_eth_bandwidth(self): + """ + Getter method for eth_bandwidth, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/unreserved_bandwidth/te_bandwidth/eth_bandwidth (uint64) + + YANG Description: Available bandwith value expressed in kilobits per second + """ + return self.__eth_bandwidth + + def _set_eth_bandwidth(self, v, load=False): + """ + Setter method for eth_bandwidth, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/unreserved_bandwidth/te_bandwidth/eth_bandwidth (uint64) + If this variable is read-only (config: false) in the + source YANG file, then _set_eth_bandwidth is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_eth_bandwidth() directly. + + YANG Description: Available bandwith value expressed in kilobits per second + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), restriction_dict={'range': ['0..10000000000']}), is_leaf=True, yang_name="eth-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint64', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """eth_bandwidth must be of a type compatible with uint64""", + 'defined-type': "uint64", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), restriction_dict={'range': ['0..10000000000']}), is_leaf=True, yang_name="eth-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint64', is_config=True)""", + }) + + self.__eth_bandwidth = t + if hasattr(self, '_set'): + self._set() + + def _unset_eth_bandwidth(self): + self.__eth_bandwidth = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), restriction_dict={'range': ['0..10000000000']}), is_leaf=True, yang_name="eth-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint64', is_config=True) + + generic = __builtin__.property(_get_generic, _set_generic) + otn = __builtin__.property(_get_otn, _set_otn) + eth_bandwidth = __builtin__.property(_get_eth_bandwidth, _set_eth_bandwidth) + + __choices__ = {'technology': {'generic': ['generic']}} + _pyangbind_elements = OrderedDict([('generic', generic), ('otn', otn), ('eth_bandwidth', eth_bandwidth), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/unreserved_bandwidth/te_bandwidth/otn/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/unreserved_bandwidth/te_bandwidth/otn/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..9f57b381bec178b2717de2c4649de47d4da213fa --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/unreserved_bandwidth/te_bandwidth/otn/__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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 odulist +class otn(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/te/templates/link-template/te-link-attributes/unreserved-bandwidth/te-bandwidth/otn. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Bandwidth attributes for OTN links + """ + __slots__ = ('_path_helper', '_extmethods', '__odulist',) + + _yang_name = 'otn' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__odulist = YANGDynClass(base=YANGListType("odu_type",odulist.odulist, yang_name="odulist", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='odu-type', extensions=None), is_container='list', yang_name="odulist", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-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 ['networks', 'te', 'templates', 'link-template', 'te-link-attributes', 'unreserved-bandwidth', 'te-bandwidth', 'otn'] + + def _get_odulist(self): + """ + Getter method for odulist, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/unreserved_bandwidth/te_bandwidth/otn/odulist (list) + + YANG Description: OTN bandwidth definition + """ + return self.__odulist + + def _set_odulist(self, v, load=False): + """ + Setter method for odulist, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/unreserved_bandwidth/te_bandwidth/otn/odulist (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_odulist is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_odulist() directly. + + YANG Description: OTN bandwidth definition + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("odu_type",odulist.odulist, yang_name="odulist", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='odu-type', extensions=None), is_container='list', yang_name="odulist", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='list', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """odulist must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("odu_type",odulist.odulist, yang_name="odulist", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='odu-type', extensions=None), is_container='list', yang_name="odulist", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='list', is_config=True)""", + }) + + self.__odulist = t + if hasattr(self, '_set'): + self._set() + + def _unset_odulist(self): + self.__odulist = YANGDynClass(base=YANGListType("odu_type",odulist.odulist, yang_name="odulist", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='odu-type', extensions=None), is_container='list', yang_name="odulist", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='list', is_config=True) + + odulist = __builtin__.property(_get_odulist, _set_odulist) + + + _pyangbind_elements = OrderedDict([('odulist', odulist), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/unreserved_bandwidth/te_bandwidth/otn/odulist/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/unreserved_bandwidth/te_bandwidth/otn/odulist/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..67eca2bd3a766d00b7814ac69f20e3d102340322 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/unreserved_bandwidth/te_bandwidth/otn/odulist/__init__.py @@ -0,0 +1,200 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 odulist(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/te/templates/link-template/te-link-attributes/unreserved-bandwidth/te-bandwidth/otn/odulist. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: OTN bandwidth definition + """ + __slots__ = ('_path_helper', '_extmethods', '__odu_type','__number','__ts_number',) + + _yang_name = 'odulist' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__odu_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="odu-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + self.__number = YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), is_leaf=True, yang_name="number", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', is_config=True) + self.__ts_number = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts-number", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', 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 ['networks', 'te', 'templates', 'link-template', 'te-link-attributes', 'unreserved-bandwidth', 'te-bandwidth', 'otn', 'odulist'] + + def _get_odu_type(self): + """ + Getter method for odu_type, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/unreserved_bandwidth/te_bandwidth/otn/odulist/odu_type (identityref) + + YANG Description: ODU type + """ + return self.__odu_type + + def _set_odu_type(self, v, load=False): + """ + Setter method for odu_type, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/unreserved_bandwidth/te_bandwidth/otn/odulist/odu_type (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_odu_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_odu_type() directly. + + YANG Description: ODU type + """ + 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=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="odu-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """odu_type must be of a type compatible with identityref""", + 'defined-type': "ietf-otn-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="odu-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True)""", + }) + + self.__odu_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_odu_type(self): + self.__odu_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="odu-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + + + def _get_number(self): + """ + Getter method for number, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/unreserved_bandwidth/te_bandwidth/otn/odulist/number (uint16) + + YANG Description: Number of ODUs + """ + return self.__number + + def _set_number(self, v, load=False): + """ + Setter method for number, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/unreserved_bandwidth/te_bandwidth/otn/odulist/number (uint16) + If this variable is read-only (config: false) in the + source YANG file, then _set_number is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_number() directly. + + YANG Description: Number of ODUs + """ + 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="number", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """number 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="number", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', is_config=True)""", + }) + + self.__number = t + if hasattr(self, '_set'): + self._set() + + def _unset_number(self): + self.__number = YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), is_leaf=True, yang_name="number", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', is_config=True) + + + def _get_ts_number(self): + """ + Getter method for ts_number, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/unreserved_bandwidth/te_bandwidth/otn/odulist/ts_number (uint16) + + YANG Description: The number of Tributary Slots (TS) that +could be used by all the ODUflex LSPs. + """ + return self.__ts_number + + def _set_ts_number(self, v, load=False): + """ + Setter method for ts_number, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/unreserved_bandwidth/te_bandwidth/otn/odulist/ts_number (uint16) + If this variable is read-only (config: false) in the + source YANG file, then _set_ts_number is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_ts_number() directly. + + YANG Description: The number of Tributary Slots (TS) that +could be used by all the ODUflex LSPs. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts-number", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """ts_number must be of a type compatible with uint16""", + 'defined-type': "uint16", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts-number", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', is_config=True)""", + }) + + self.__ts_number = t + if hasattr(self, '_set'): + self._set() + + def _unset_ts_number(self): + self.__ts_number = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts-number", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', is_config=True) + + odu_type = __builtin__.property(_get_odu_type, _set_odu_type) + number = __builtin__.property(_get_number, _set_number) + ts_number = __builtin__.property(_get_ts_number, _set_ts_number) + + + _pyangbind_elements = OrderedDict([('odu_type', odu_type), ('number', number), ('ts_number', ts_number), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/node_template/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/node_template/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..f7a053a348c85efac3411e2dd277608a439868ef --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/node_template/__init__.py @@ -0,0 +1,251 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 te_node_attributes +class node_template(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/te/templates/node-template. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: The list of TE node templates used to define sharable +and reusable TE node attributes. + """ + __slots__ = ('_path_helper', '_extmethods', '__name','__priority','__reference_change_policy','__te_node_attributes',) + + _yang_name = 'node-template' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__name = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '/?([a-zA-Z0-9\\-_.]+)(/[a-zA-Z0-9\\-_.]+)*'}), is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-types:te-template-name', is_config=True) + self.__priority = YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), is_leaf=True, yang_name="priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint16', is_config=True) + self.__reference_change_policy = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'no-action': {}, 'not-allowed': {}, 'cascade': {}},), is_leaf=True, yang_name="reference-change-policy", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='enumeration', is_config=True) + self.__te_node_attributes = YANGDynClass(base=te_node_attributes.te_node_attributes, is_container='container', yang_name="te-node-attributes", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-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 ['networks', 'te', 'templates', 'node-template'] + + def _get_name(self): + """ + Getter method for name, mapped from YANG variable /networks/te/templates/node_template/name (te-types:te-template-name) + + YANG Description: The name to identify a TE node template. + """ + return self.__name + + def _set_name(self, v, load=False): + """ + Setter method for name, mapped from YANG variable /networks/te/templates/node_template/name (te-types:te-template-name) + 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 to identify a TE node template. + """ + 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=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '/?([a-zA-Z0-9\\-_.]+)(/[a-zA-Z0-9\\-_.]+)*'}), is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-types:te-template-name', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """name must be of a type compatible with te-types:te-template-name""", + 'defined-type': "te-types:te-template-name", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '/?([a-zA-Z0-9\\-_.]+)(/[a-zA-Z0-9\\-_.]+)*'}), is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-types:te-template-name', is_config=True)""", + }) + + self.__name = t + if hasattr(self, '_set'): + self._set() + + def _unset_name(self): + self.__name = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '/?([a-zA-Z0-9\\-_.]+)(/[a-zA-Z0-9\\-_.]+)*'}), is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-types:te-template-name', is_config=True) + + + def _get_priority(self): + """ + Getter method for priority, mapped from YANG variable /networks/te/templates/node_template/priority (uint16) + + YANG Description: The preference value for resolving conflicts between +different templates. When two or more templates specify +values for one configuration attribute, the value from the +template with the highest priority is used. +A lower number indicates a higher priority. The highest +priority is 0. + """ + return self.__priority + + def _set_priority(self, v, load=False): + """ + Setter method for priority, mapped from YANG variable /networks/te/templates/node_template/priority (uint16) + If this variable is read-only (config: false) in the + source YANG file, then _set_priority is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_priority() directly. + + YANG Description: The preference value for resolving conflicts between +different templates. When two or more templates specify +values for one configuration attribute, the value from the +template with the highest priority is used. +A lower number indicates a higher priority. The highest +priority is 0. + """ + 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="priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint16', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """priority 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="priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint16', is_config=True)""", + }) + + self.__priority = t + if hasattr(self, '_set'): + self._set() + + def _unset_priority(self): + self.__priority = YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), is_leaf=True, yang_name="priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint16', is_config=True) + + + def _get_reference_change_policy(self): + """ + Getter method for reference_change_policy, mapped from YANG variable /networks/te/templates/node_template/reference_change_policy (enumeration) + + YANG Description: This attribute specifies the action taken for a +configuration node that has a reference to this template. + """ + return self.__reference_change_policy + + def _set_reference_change_policy(self, v, load=False): + """ + Setter method for reference_change_policy, mapped from YANG variable /networks/te/templates/node_template/reference_change_policy (enumeration) + If this variable is read-only (config: false) in the + source YANG file, then _set_reference_change_policy is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_reference_change_policy() directly. + + YANG Description: This attribute specifies the action taken for a +configuration node that has a reference to this template. + """ + 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={'no-action': {}, 'not-allowed': {}, 'cascade': {}},), is_leaf=True, yang_name="reference-change-policy", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='enumeration', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """reference_change_policy must be of a type compatible with enumeration""", + 'defined-type': "ietf-te-topology:enumeration", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'no-action': {}, 'not-allowed': {}, 'cascade': {}},), is_leaf=True, yang_name="reference-change-policy", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='enumeration', is_config=True)""", + }) + + self.__reference_change_policy = t + if hasattr(self, '_set'): + self._set() + + def _unset_reference_change_policy(self): + self.__reference_change_policy = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'no-action': {}, 'not-allowed': {}, 'cascade': {}},), is_leaf=True, yang_name="reference-change-policy", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='enumeration', is_config=True) + + + def _get_te_node_attributes(self): + """ + Getter method for te_node_attributes, mapped from YANG variable /networks/te/templates/node_template/te_node_attributes (container) + + YANG Description: Contains node attributes in a TE topology. + """ + return self.__te_node_attributes + + def _set_te_node_attributes(self, v, load=False): + """ + Setter method for te_node_attributes, mapped from YANG variable /networks/te/templates/node_template/te_node_attributes (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_te_node_attributes is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_te_node_attributes() directly. + + YANG Description: Contains node attributes in a TE topology. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=te_node_attributes.te_node_attributes, is_container='container', yang_name="te-node-attributes", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """te_node_attributes must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=te_node_attributes.te_node_attributes, is_container='container', yang_name="te-node-attributes", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__te_node_attributes = t + if hasattr(self, '_set'): + self._set() + + def _unset_te_node_attributes(self): + self.__te_node_attributes = YANGDynClass(base=te_node_attributes.te_node_attributes, is_container='container', yang_name="te-node-attributes", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + name = __builtin__.property(_get_name, _set_name) + priority = __builtin__.property(_get_priority, _set_priority) + reference_change_policy = __builtin__.property(_get_reference_change_policy, _set_reference_change_policy) + te_node_attributes = __builtin__.property(_get_te_node_attributes, _set_te_node_attributes) + + + _pyangbind_elements = OrderedDict([('name', name), ('priority', priority), ('reference_change_policy', reference_change_policy), ('te_node_attributes', te_node_attributes), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/node_template/te_node_attributes/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/node_template/te_node_attributes/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..32a98a2da6054d90d8f7eaff7bb3571af18d93a9 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/node_template/te_node_attributes/__init__.py @@ -0,0 +1,317 @@ +# -*- 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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 underlay_topology +class te_node_attributes(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/te/templates/node-template/te-node-attributes. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Contains node attributes in a TE topology. + """ + __slots__ = ('_path_helper', '_extmethods', '__admin_status','__domain_id','__is_abstract','__name','__signaling_address','__underlay_topology',) + + _yang_name = 'te-node-attributes' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__admin_status = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'up': {}, 'down': {}, 'testing': {}, 'preparing-maintenance': {}, 'maintenance': {}, 'unknown': {}},), is_leaf=True, yang_name="admin-status", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-types:te-admin-status', is_config=True) + self.__domain_id = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="domain-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + self.__is_abstract = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="is-abstract", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='empty', is_config=True) + 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='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=True) + self.__signaling_address = YANGDynClass(unique=True, base=TypedListType(allowed_type=[RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),]), is_leaf=False, yang_name="signaling-address", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:ip-address', is_config=True) + self.__underlay_topology = YANGDynClass(base=underlay_topology.underlay_topology, is_container='container', yang_name="underlay-topology", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-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 ['networks', 'te', 'templates', 'node-template', 'te-node-attributes'] + + def _get_admin_status(self): + """ + Getter method for admin_status, mapped from YANG variable /networks/te/templates/node_template/te_node_attributes/admin_status (te-types:te-admin-status) + + YANG Description: The administrative state of the link. + """ + return self.__admin_status + + def _set_admin_status(self, v, load=False): + """ + Setter method for admin_status, mapped from YANG variable /networks/te/templates/node_template/te_node_attributes/admin_status (te-types:te-admin-status) + 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 administrative state of the link. + """ + 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': {}, 'preparing-maintenance': {}, 'maintenance': {}, 'unknown': {}},), is_leaf=True, yang_name="admin-status", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-types:te-admin-status', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """admin_status must be of a type compatible with te-types:te-admin-status""", + 'defined-type': "te-types:te-admin-status", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'up': {}, 'down': {}, 'testing': {}, 'preparing-maintenance': {}, 'maintenance': {}, 'unknown': {}},), is_leaf=True, yang_name="admin-status", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-types:te-admin-status', is_config=True)""", + }) + + 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': {}, 'preparing-maintenance': {}, 'maintenance': {}, 'unknown': {}},), is_leaf=True, yang_name="admin-status", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-types:te-admin-status', is_config=True) + + + def _get_domain_id(self): + """ + Getter method for domain_id, mapped from YANG variable /networks/te/templates/node_template/te_node_attributes/domain_id (uint32) + + YANG Description: Identifies the domain to which this node belongs. +This attribute is used to support inter-domain links. + """ + return self.__domain_id + + def _set_domain_id(self, v, load=False): + """ + Setter method for domain_id, mapped from YANG variable /networks/te/templates/node_template/te_node_attributes/domain_id (uint32) + If this variable is read-only (config: false) in the + source YANG file, then _set_domain_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_domain_id() directly. + + YANG Description: Identifies the domain to which this node belongs. +This attribute is used to support inter-domain links. + """ + 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="domain-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """domain_id 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="domain-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True)""", + }) + + self.__domain_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_domain_id(self): + self.__domain_id = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="domain-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + + + def _get_is_abstract(self): + """ + Getter method for is_abstract, mapped from YANG variable /networks/te/templates/node_template/te_node_attributes/is_abstract (empty) + + YANG Description: Present if the node is abstract; not present if the node +is actual. + """ + return self.__is_abstract + + def _set_is_abstract(self, v, load=False): + """ + Setter method for is_abstract, mapped from YANG variable /networks/te/templates/node_template/te_node_attributes/is_abstract (empty) + If this variable is read-only (config: false) in the + source YANG file, then _set_is_abstract is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_is_abstract() directly. + + YANG Description: Present if the node is abstract; not present if the node +is actual. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBool, is_leaf=True, yang_name="is-abstract", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='empty', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """is_abstract must be of a type compatible with empty""", + 'defined-type': "empty", + 'generated-type': """YANGDynClass(base=YANGBool, is_leaf=True, yang_name="is-abstract", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='empty', is_config=True)""", + }) + + self.__is_abstract = t + if hasattr(self, '_set'): + self._set() + + def _unset_is_abstract(self): + self.__is_abstract = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="is-abstract", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='empty', is_config=True) + + + def _get_name(self): + """ + Getter method for name, mapped from YANG variable /networks/te/templates/node_template/te_node_attributes/name (string) + + YANG Description: Node name. + """ + return self.__name + + def _set_name(self, v, load=False): + """ + Setter method for name, mapped from YANG variable /networks/te/templates/node_template/te_node_attributes/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: Node name. + """ + 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='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', 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='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', 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='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=True) + + + def _get_signaling_address(self): + """ + Getter method for signaling_address, mapped from YANG variable /networks/te/templates/node_template/te_node_attributes/signaling_address (inet:ip-address) + + YANG Description: The node's signaling address. + """ + return self.__signaling_address + + def _set_signaling_address(self, v, load=False): + """ + Setter method for signaling_address, mapped from YANG variable /networks/te/templates/node_template/te_node_attributes/signaling_address (inet:ip-address) + If this variable is read-only (config: false) in the + source YANG file, then _set_signaling_address is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_signaling_address() directly. + + YANG Description: The node's signaling address. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,unique=True, base=TypedListType(allowed_type=[RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),]), is_leaf=False, yang_name="signaling-address", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:ip-address', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """signaling_address must be of a type compatible with inet:ip-address""", + 'defined-type': "inet:ip-address", + 'generated-type': """YANGDynClass(unique=True, base=TypedListType(allowed_type=[RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),]), is_leaf=False, yang_name="signaling-address", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:ip-address', is_config=True)""", + }) + + self.__signaling_address = t + if hasattr(self, '_set'): + self._set() + + def _unset_signaling_address(self): + self.__signaling_address = YANGDynClass(unique=True, base=TypedListType(allowed_type=[RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),]), is_leaf=False, yang_name="signaling-address", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:ip-address', is_config=True) + + + def _get_underlay_topology(self): + """ + Getter method for underlay_topology, mapped from YANG variable /networks/te/templates/node_template/te_node_attributes/underlay_topology (container) + + YANG Description: When an abstract node encapsulates a topology, the +attributes in this container point to said topology. + """ + return self.__underlay_topology + + def _set_underlay_topology(self, v, load=False): + """ + Setter method for underlay_topology, mapped from YANG variable /networks/te/templates/node_template/te_node_attributes/underlay_topology (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_underlay_topology is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_underlay_topology() directly. + + YANG Description: When an abstract node encapsulates a topology, the +attributes in this container point to said topology. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=underlay_topology.underlay_topology, is_container='container', yang_name="underlay-topology", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """underlay_topology must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=underlay_topology.underlay_topology, is_container='container', yang_name="underlay-topology", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__underlay_topology = t + if hasattr(self, '_set'): + self._set() + + def _unset_underlay_topology(self): + self.__underlay_topology = YANGDynClass(base=underlay_topology.underlay_topology, is_container='container', yang_name="underlay-topology", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + admin_status = __builtin__.property(_get_admin_status, _set_admin_status) + domain_id = __builtin__.property(_get_domain_id, _set_domain_id) + is_abstract = __builtin__.property(_get_is_abstract, _set_is_abstract) + name = __builtin__.property(_get_name, _set_name) + signaling_address = __builtin__.property(_get_signaling_address, _set_signaling_address) + underlay_topology = __builtin__.property(_get_underlay_topology, _set_underlay_topology) + + + _pyangbind_elements = OrderedDict([('admin_status', admin_status), ('domain_id', domain_id), ('is_abstract', is_abstract), ('name', name), ('signaling_address', signaling_address), ('underlay_topology', underlay_topology), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/node_template/te_node_attributes/underlay_topology/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/node_template/te_node_attributes/underlay_topology/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..9480263d4de5279198cbd72bc71789529f67ef92 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/node_template/te_node_attributes/underlay_topology/__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.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +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 underlay_topology(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/te/templates/node-template/te-node-attributes/underlay-topology. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: When an abstract node encapsulates a topology, the +attributes in this container point to said topology. + """ + __slots__ = ('_path_helper', '_extmethods', '__network_ref',) + + _yang_name = 'underlay-topology' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__network_ref = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="network-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-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 ['networks', 'te', 'templates', 'node-template', 'te-node-attributes', 'underlay-topology'] + + def _get_network_ref(self): + """ + Getter method for network_ref, mapped from YANG variable /networks/te/templates/node_template/te_node_attributes/underlay_topology/network_ref (leafref) + + YANG Description: Used to reference a network -- for example, an underlay +network. + """ + return self.__network_ref + + def _set_network_ref(self, v, load=False): + """ + Setter method for network_ref, mapped from YANG variable /networks/te/templates/node_template/te_node_attributes/underlay_topology/network_ref (leafref) + If this variable is read-only (config: false) in the + source YANG file, then _set_network_ref is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_network_ref() directly. + + YANG Description: Used to reference a network -- for example, an underlay +network. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="network-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """network_ref must be of a type compatible with leafref""", + 'defined-type': "leafref", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="network-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=True)""", + }) + + self.__network_ref = t + if hasattr(self, '_set'): + self._set() + + def _unset_network_ref(self): + self.__network_ref = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="network-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=True) + + network_ref = __builtin__.property(_get_network_ref, _set_network_ref) + + + _pyangbind_elements = OrderedDict([('network_ref', network_ref), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/build-yang-bindings.sh b/src/nbi/service/rest_server/nbi_plugins/ietf_network/build-yang-bindings.sh new file mode 100755 index 0000000000000000000000000000000000000000..4de5f1a1fc00410a14fb4ec8f2dd4d341f0f869a --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/build-yang-bindings.sh @@ -0,0 +1,40 @@ +#!/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. + +BASE_PATH=~/tfs-ctrl/src/nbi/service/rest_server/nbi_plugins/ietf_network +IETF_MODELS_PATH=${BASE_PATH}/yang + +cd ${BASE_PATH} +export PYBINDPLUGIN=`/usr/bin/env python -c 'import pyangbind; import os; print ("{}/plugin".format(os.path.dirname(pyangbind.__file__)))'` + +rm -rf bindings + +# -p ${OC_HERCULES_MODELS_PATH}/ +# --split-class-dir openconfig_hercules +# --presence +pyang --plugindir $PYBINDPLUGIN -p ${IETF_MODELS_PATH}/ -f pybind --split-class-dir bindings \ + ${IETF_MODELS_PATH}/ietf-network-topology@2018-02-26.yang \ + ${IETF_MODELS_PATH}/ietf-network@2018-02-26.yang \ + ${IETF_MODELS_PATH}/ietf-te-topology@2020-08-06.yang \ + ${IETF_MODELS_PATH}/ietf-otn-topology@2023-07-06.yang \ + ${IETF_MODELS_PATH}/ietf-eth-te-topology@2023-09-28.yang + +# ${IETF_MODELS_PATH}/iana-routing-types@2017-12-04.yang \ +# ${IETF_MODELS_PATH}/ietf-inet-types@2013-07-15.yang \ +# ${IETF_MODELS_PATH}/ietf-layer1-types@2022-10-14.yang \ +# ${IETF_MODELS_PATH}/ietf-routing-types@2017-12-04.yang \ +# ${IETF_MODELS_PATH}/ietf-te-packet-types@2020-06-10.yang \ +# ${IETF_MODELS_PATH}/ietf-te-types@2020-06-10.yang \ +# ${IETF_MODELS_PATH}/ietf-yang-types@2013-07-15.yang \ diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/yang/iana-routing-types@2017-12-04.yang b/src/nbi/service/rest_server/nbi_plugins/ietf_network/yang/iana-routing-types@2017-12-04.yang new file mode 100644 index 0000000000000000000000000000000000000000..250cba4b695e269116e181b46226bae7dab7604d --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/yang/iana-routing-types@2017-12-04.yang @@ -0,0 +1,473 @@ + module iana-routing-types { + namespace "urn:ietf:params:xml:ns:yang:iana-routing-types"; + prefix iana-rt-types; + + organization + "IANA"; + contact + "Internet Assigned Numbers Authority + + Postal: ICANN + 12025 Waterfront Drive, Suite 300 + Los Angeles, CA 90094-2536 + United States of America + Tel: +1 310 301 5800 + "; + + description + "This module contains a collection of YANG data types + considered defined by IANA and used for routing + protocols. + + Copyright (c) 2017 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 + (https://trustee.ietf.org/license-info). + + This version of this YANG module is part of RFC 8294; see + the RFC itself for full legal notices."; + + revision 2017-12-04 { + description "Initial revision."; + reference + "RFC 8294: Common YANG Data Types for the Routing Area. + Section 4."; + } + + /*** Collection of IANA types related to routing ***/ + /*** IANA Address Family enumeration ***/ + + typedef address-family { + type enumeration { + enum ipv4 { + value 1; + description + "IPv4 Address Family."; + } + + enum ipv6 { + value 2; + description + "IPv6 Address Family."; + } + + enum nsap { + value 3; + description + "OSI Network Service Access Point (NSAP) Address Family."; + } + + enum hdlc { + value 4; + description + "High-Level Data Link Control (HDLC) Address Family."; + } + + enum bbn1822 { + value 5; + description + "Bolt, Beranek, and Newman Report 1822 (BBN 1822) + Address Family."; + } + + enum ieee802 { + value 6; + description + "IEEE 802 Committee Address Family + (aka Media Access Control (MAC) address)."; + } + + enum e163 { + value 7; + description + "ITU-T E.163 Address Family."; + } + + enum e164 { + value 8; + description + "ITU-T E.164 (Switched Multimegabit Data Service (SMDS), + Frame Relay, ATM) Address Family."; + } + + enum f69 { + value 9; + description + "ITU-T F.69 (Telex) Address Family."; + } + + enum x121 { + value 10; + description + "ITU-T X.121 (X.25, Frame Relay) Address Family."; + } + + enum ipx { + value 11; + description + "Novell Internetwork Packet Exchange (IPX) + Address Family."; + } + + enum appletalk { + value 12; + description + "Apple AppleTalk Address Family."; + } + + enum decnet-iv { + value 13; + description + "Digital Equipment DECnet Phase IV Address Family."; + } + + enum vines { + value 14; + description + "Banyan Vines Address Family."; + } + + enum e164-nsap { + value 15; + description + "ITU-T E.164 with NSAP sub-address Address Family."; + } + + enum dns { + value 16; + description + "Domain Name System (DNS) Address Family."; + } + + enum distinguished-name { + value 17; + description + "Distinguished Name Address Family."; + } + + enum as-num { + value 18; + description + "Autonomous System (AS) Number Address Family."; + } + + enum xtp-v4 { + value 19; + description + "Xpress Transport Protocol (XTP) over IPv4 + Address Family."; + } + + enum xtp-v6 { + value 20; + description + "XTP over IPv6 Address Family."; + } + + enum xtp-native { + value 21; + description + "XTP native mode Address Family."; + } + + enum fc-port { + value 22; + description + "Fibre Channel (FC) World-Wide Port Name Address Family."; + } + + enum fc-node { + value 23; + description + "FC World-Wide Node Name Address Family."; + } + + enum gwid { + value 24; + description + "ATM Gateway Identifier (GWID) Number Address Family."; + } + + enum l2vpn { + value 25; + description + "Layer 2 VPN (L2VPN) Address Family."; + } + + enum mpls-tp-section-eid { + value 26; + description + "MPLS Transport Profile (MPLS-TP) Section Endpoint + Identifier Address Family."; + } + + enum mpls-tp-lsp-eid { + value 27; + description + "MPLS-TP Label Switched Path (LSP) Endpoint Identifier + Address Family."; + } + + enum mpls-tp-pwe-eid { + value 28; + description + "MPLS-TP Pseudowire Endpoint Identifier Address Family."; + } + + enum mt-v4 { + value 29; + description + "Multi-Topology IPv4 Address Family."; + } + + enum mt-v6 { + value 30; + description + "Multi-Topology IPv6 Address Family."; + } + + enum eigrp-common-sf { + value 16384; + description + "Enhanced Interior Gateway Routing Protocol (EIGRP) + Common Service Family Address Family."; + } + + enum eigrp-v4-sf { + value 16385; + description + "EIGRP IPv4 Service Family Address Family."; + } + + enum eigrp-v6-sf { + value 16386; + description + "EIGRP IPv6 Service Family Address Family."; + } + + enum lcaf { + value 16387; + description + "Locator/ID Separation Protocol (LISP) + Canonical Address Format (LCAF) Address Family."; + } + + enum bgp-ls { + value 16388; + description + "Border Gateway Protocol - Link State (BGP-LS) + Address Family."; + } + + enum mac-48 { + value 16389; + description + "IEEE 48-bit MAC Address Family."; + } + + enum mac-64 { + value 16390; + description + "IEEE 64-bit MAC Address Family."; + } + + enum trill-oui { + value 16391; + description + "Transparent Interconnection of Lots of Links (TRILL) + IEEE Organizationally Unique Identifier (OUI) + Address Family."; + } + + enum trill-mac-24 { + value 16392; + description + "TRILL final 3 octets of 48-bit MAC Address Family."; + } + + enum trill-mac-40 { + value 16393; + description + "TRILL final 5 octets of 64-bit MAC Address Family."; + } + + enum ipv6-64 { + value 16394; + description + "First 8 octets (64 bits) of IPv6 address + Address Family."; + } + + enum trill-rbridge-port-id { + value 16395; + description + "TRILL Routing Bridge (RBridge) Port ID Address Family."; + } + + enum trill-nickname { + value 16396; + description + "TRILL Nickname Address Family."; + } + } + + description + "Enumeration containing all the IANA-defined + Address Families."; + + } + + /*** Subsequent Address Family Identifiers (SAFIs) ***/ + /*** for multiprotocol BGP enumeration ***/ + + typedef bgp-safi { + type enumeration { + enum unicast-safi { + value 1; + description + "Unicast SAFI."; + } + + enum multicast-safi { + value 2; + description + "Multicast SAFI."; + } + + enum labeled-unicast-safi { + value 4; + description + "Labeled Unicast SAFI."; + } + + enum multicast-vpn-safi { + value 5; + description + "Multicast VPN SAFI."; + } + + enum pseudowire-safi { + value 6; + description + "Multi-segment Pseudowire VPN SAFI."; + } + + enum tunnel-encap-safi { + value 7; + description + "Tunnel Encap SAFI."; + } + + enum mcast-vpls-safi { + value 8; + description + "Multicast Virtual Private LAN Service (VPLS) SAFI."; + } + + enum tunnel-safi { + value 64; + description + "Tunnel SAFI."; + } + + enum vpls-safi { + value 65; + description + "VPLS SAFI."; + } + + enum mdt-safi { + value 66; + description + "Multicast Distribution Tree (MDT) SAFI."; + } + + enum v4-over-v6-safi { + value 67; + description + "IPv4 over IPv6 SAFI."; + } + + enum v6-over-v4-safi { + value 68; + description + "IPv6 over IPv4 SAFI."; + } + + enum l1-vpn-auto-discovery-safi { + value 69; + description + "Layer 1 VPN Auto-Discovery SAFI."; + } + + enum evpn-safi { + value 70; + description + "Ethernet VPN (EVPN) SAFI."; + } + + enum bgp-ls-safi { + value 71; + description + "BGP-LS SAFI."; + } + + enum bgp-ls-vpn-safi { + value 72; + description + "BGP-LS VPN SAFI."; + } + + enum sr-te-safi { + value 73; + description + "Segment Routing - Traffic Engineering (SR-TE) SAFI."; + } + + enum labeled-vpn-safi { + value 128; + description + "MPLS Labeled VPN SAFI."; + } + + enum multicast-mpls-vpn-safi { + value 129; + description + "Multicast for BGP/MPLS IP VPN SAFI."; + } + + enum route-target-safi { + value 132; + description + "Route Target SAFI."; + } + + enum ipv4-flow-spec-safi { + value 133; + description + "IPv4 Flow Specification SAFI."; + } + + enum vpnv4-flow-spec-safi { + value 134; + description + "IPv4 VPN Flow Specification SAFI."; + } + + enum vpn-auto-discovery-safi { + value 140; + description + "VPN Auto-Discovery SAFI."; + } + } + description + "Enumeration for BGP SAFI."; + reference + "RFC 4760: Multiprotocol Extensions for BGP-4."; + } + } diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/yang/ietf-eth-te-topology@2023-09-28.yang b/src/nbi/service/rest_server/nbi_plugins/ietf_network/yang/ietf-eth-te-topology@2023-09-28.yang new file mode 100644 index 0000000000000000000000000000000000000000..b182f7f5a323d1a50c1ab53715b96e02758ea327 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/yang/ietf-eth-te-topology@2023-09-28.yang @@ -0,0 +1,2275 @@ + module ietf-eth-te-topology { + yang-version 1.1; + namespace "urn:ietf:params:xml:ns:yang:ietf-eth-te-topology"; + prefix "etht"; + + import ietf-network { + prefix "nw"; + reference + "RFC 8345: A YANG Data Model for Network Topologies"; + } + + import ietf-network-topology { + prefix "nt"; + reference + "RFC 8345: A YANG Data Model for Network Topologies"; + } + + import ietf-te-topology { + prefix "tet"; + reference + "RFC 8795: YANG Data Model for Traffic Engineering + (TE) Topologies"; + } + + import ietf-yang-types { + prefix "yang"; + reference + "RFC 6991: Common YANG Data Types"; + } + + import ietf-eth-tran-types { + prefix "etht-types"; + reference + "RFC YYYY: A YANG Data Model for Transport Network Client + Signals"; + } + // RFC Ed.: replace YYYY with actual RFC number, update date + // information and remove this note + + organization + "IETF CCAMP Working Group"; + contact + "WG Web: + WG List: + + Editor: Haomian Zheng + + + Editor: Italo Busi + + + Editor: Aihua Guo + + + Editor: Yunbin Xu + + + Editor: Yang Zhao + + + Editor: Xufeng Liu + "; + + description + "This module defines a YANG data model for describing + layer-2 Ethernet transport topologies. The model fully + conforms to the Network Management Datastore + Architecture (NMDA). + + Copyright (c) 2023 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. + + The key words 'MUST', 'MUST NOT', 'REQUIRED', 'SHALL', 'SHALL + NOT', 'SHOULD', 'SHOULD NOT', 'RECOMMENDED', 'NOT RECOMMENDED', + 'MAY', and 'OPTIONAL' in this document are to be interpreted as + described in BCP 14 (RFC 2119) (RFC 8174) when, and only when, + they appear in all capitals, as shown here."; + + revision 2023-09-28 { + description + "Initial Revision"; + reference + "RFC XXXX: A YANG Data Model for Ethernet TE Topology"; + // RFC Ed.: replace XXXX with actual RFC number, update date + // information and remove this note + } + + /* + * Groupings + */ + + grouping label-range-info { + description + "Ethernet technology-specific label range related + information with a presence container indicating that the + label range is an Ethernet technology-specific label range. + + This grouping SHOULD be used together with the + eth-label and eth-label-step groupings to provide Ethernet + technology-specific label information to the models which + use the label-restriction-info grouping defined in the module + ietf-te-types."; + + container ethernet-label-range { + presence + "Indicates the label range is an Ethernet label range. + + This container must not be present if there are other + presence containers or attributes indicating another type + of label range."; + description + "Ethernet-specific label range related information."; + + uses etht-types:eth-label-restriction; + } + } + + grouping eth-tran-topology-type { + description + "Identifies the Ethernet Transport topology type"; + + container eth-tran-topology { + presence "indicates a topology type of + Ethernet Transport Network."; + description "Eth transport topology type"; + } + } + + grouping ltp-bandwidth-profiles { + description + "A grouping which represents the bandwidth profile(s) + for the ETH LTP."; + + choice direction { + description + "Whether the bandwidth profiles are symmetrical or + asymmetrical"; + case symmetrical { + description + "The same bandwidth profile is used to describe the ingress + and the egress bandwidth profile."; + + container ingress-egress-bandwidth-profile { + description + "The bandwith profile used in the ingress and egress + direction."; + uses etht-types:etht-bandwidth-profiles; + } + } + case asymmetrical { + description + "Different ingress and egress bandwidth profiles + can be specified."; + container ingress-bandwidth-profile { + description + "The bandwidth profile used in the ingress direction."; + uses etht-types:etht-bandwidth-profiles; + } + container egress-bandwidth-profile { + description + "The bandwidth profile used in the egress direction."; + uses etht-types:etht-bandwidth-profiles; + } + } + } + } + grouping eth-ltp-attributes { + description + "Ethernet transport Link Termination Point (LTP) attributes"; + + leaf ltp-mac-address { + type yang:mac-address; + description + "The MAC address of the Ethernet LTP."; + } + leaf port-vlan-id { + type etht-types:vlanid; + description + "The Port VLAN ID of the Ethernet LTP."; + reference + "IEEE 802.1Q: Virtual Bridged Local Area Networks"; + } + leaf maximum-frame-size { + type uint16 { + range "64 .. 65535"; + } + description + "Maximum frame size"; + reference + "IEEE 802.1Q: Virtual Bridged Local Area Networks"; + } + uses ltp-bandwidth-profiles; + } + + grouping svc-vlan-classification { + description + "Grouping defining the capabilities for VLAN classification."; + + leaf-list supported-tag-types { + type etht-types:eth-tag-classify; + description + "List of VLAN tag types that can be used for the VLAN + classification. In case VLAN classification is not + supported, the list is empty."; + } + leaf vlan-bundling { + type boolean; + description + "In case VLAN classification is supported, indicates whether + VLAN bundling classification is also supported."; + reference + "MEF 10.3: Ethernet Services Attributes Phase 3"; + } + leaf vlan-range { + type etht-types:vid-range-type; + description + "In case VLAN classification is supported, indicates the + of available VLAN ID values."; + } + } + + grouping svc-vlan-push { + description + "Grouping defining the capabilities for VLAN push or swap + operations."; + + leaf-list supported-tag-types { + type etht-types:eth-tag-type; + description + "List of VLAN tag types that can be used to push or swap a + VLAN tag. In case VLAN push/swap is not supported, the list + is empty."; + reference + "IEEE 802.1Q: Virtual Bridged Local Area Networks"; + } + leaf vlan-range { + type etht-types:vid-range-type; + description + "In case VLAN push/swap operation is supported, the range + of available VLAN ID values."; + } + } + + grouping eth-svc-attributes { + description + "Ethernet Link Termination Point (LTP) service attributes."; + + container supported-classification { + description + "Service classification capability supported by the + Ethernet Link Termination Point (LTP)."; + + leaf port-classification { + type boolean; + description + "Indicates that the ETH LTP support port-based service + classification."; + } + container vlan-classification { + description + "Service classification capabilities based on the VLAN + tag(s) supported by the ETH LTP."; + leaf vlan-tag-classification { + type boolean; + description + "Indicates that the ETH LTP supports VLAN service + classification."; + } + container outer-tag { + description + "Service classification capabilities based on the outer + VLAN tag, supported by the ETH LTP."; + uses svc-vlan-classification; + } + container second-tag { + description + "Service classification capabilities based on the second + VLAN tag, supported by the ETH LTP."; + leaf second-tag-classification { + type boolean; + must ". = 'false' or " + + "../../vlan-tag-classification = 'true'" { + description + "VLAN service classification based on the second + VLAN tag can be supported only when VLAN service + classification"; + } + description + "Indicates that the ETH LTP support VLAN service + classification based on the second VLAN tag."; + } + uses svc-vlan-classification; + } + } + } + + container supported-vlan-operations { + description + "Reports the VLAN operations supported by the ETH LTP."; + + leaf asymmetrical-operations { + type boolean; + description + "Indicates whether the ETH LTP supports also asymmetrical + VLAN operations.It is assumed that symmetrical VLAN + operations are alwyas supported."; + } + leaf transparent-vlan-operations { + type boolean; + description + "Indicates that the ETH LTP supports transparent + operations."; + } + container vlan-pop { + description + "Indicates VLAN pop or swap operations capabilities."; + + leaf vlan-pop-operations { + type boolean; + description + "Indicates that the ETH LTP supports VLAN pop or + swap operations."; + } + leaf max-pop-tags { + type uint8 { + range "1..2"; + } + description + "Indicates the maximum number of tags that can be + popped/swapped."; + } + } + container vlan-push { + description + "Indicates VLAN push or swap operations capabilities."; + + leaf vlan-push-operation { + type boolean; + description + "Indicates that the ETH LTP supports VLAN push or + swap operations."; + } + container outer-tag { + description + "Indicates the supported VLAN operation capabilities + on the outer VLAN tag."; + uses svc-vlan-push; + } + container second-tag { + description + "Indicates the supported VLAN operation capabilities + on the second VLAN tag."; + leaf push-second-tag { + type boolean; + description + "Indicates that the ETH LTP supports VLAN push or swap + operations for the second VLAN tag."; + } + uses svc-vlan-push; + } + } + } + } + + /* + * Data nodes + */ + + augment "/nw:networks/nw:network/nw:network-types/" + + "tet:te-topology" { + description + "Augment network types to include ETH transport newtork"; + + uses eth-tran-topology-type; + } + + augment "/nw:networks/nw:network/nw:node/tet:te" + + "/tet:te-node-attributes" { + when "../../../nw:network-types/tet:te-topology/" + + "etht:eth-tran-topology" { + description "Augment only for Ethernet transport network."; + } + description "Augment TE node attributes."; + container eth-node { + presence "The TE node is an Ethernet node."; + description + "Presence container used only to indicate that the TE node + is an Ethernet node."; + } + } + + augment "/nw:networks/nw:network/nt:link" { + when "../nw:network-types/tet:te-topology/" + + "etht:eth-tran-topology" { + description "Augment only for Ethernet transport network."; + } + description "Augment link configuration"; + + container eth-svc { + presence + "When present, indicates that the Link supports Ethernet + client signals."; + description + "Presence container used only to indicate that the link + supports Ethernet client signals."; + } + } + + augment "/nw:networks/nw:network/nw:node/nt:termination-point" { + when "../../nw:network-types/tet:te-topology/" + + "etht:eth-tran-topology" { + description "Augment only for Ethernet transport network."; + } + description + "Augment ETH LTP attributes"; + + container eth-svc { + presence + "When present, indicates that the Link Termination Point + (LTP) supports Ethernet client signals."; + description + "ETH LTP Service attributes."; + + uses eth-svc-attributes; + } + container eth-link-tp { + description + "Attributes of the Ethernet Link Termination Point (LTP)."; + uses eth-ltp-attributes; + } + } + + /* + * Augment TE bandwidth + */ + + augment "/nw:networks/nw:network/nw:node/nt:termination-point/" + + "tet:te/" + + "tet:interface-switching-capability/tet:max-lsp-bandwidth/" + + "tet:te-bandwidth/tet:technology" { + when "../../../../../../nw:network-types/tet:te-topology/" + + "etht:eth-tran-topology" { + description + "Augmentation parameters apply only for networks with + Ethernet topology type."; + } + description + "Augment maximum LSP TE bandwidth for the link termination + point (LTP)."; + case eth { + uses etht-types:eth-bandwidth; + } + } + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:te-node-attributes/tet:connectivity-matrices/" + + "tet:path-constraints/tet:te-bandwidth/tet:technology" { + when "../../../../../../nw:network-types/tet:te-topology/" + + "etht:eth-tran-topology" { + description + "Augmentation parameters apply only for networks with + Ethernet topology type."; + } + description + "Augment TE bandwidth path constraints of the TE node + connectivity matrices."; + case eth { + uses etht-types:eth-bandwidth; + } + } + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:te-node-attributes/tet:connectivity-matrices/" + + "tet:connectivity-matrix/" + + "tet:path-constraints/tet:te-bandwidth/tet:technology" { + when "../../../../../../../nw:network-types/tet:te-topology/" + + "etht:eth-tran-topology" { + description + "Augmentation parameters apply only for networks with + Ethernet topology type."; + } + description + "Augment TE bandwidth path constraints of the + connectivity matrix entry."; + case eth { + uses etht-types:eth-bandwidth; + } + } + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:information-source-entry/tet:connectivity-matrices/" + + "tet:path-constraints/tet:te-bandwidth/tet:technology" { + when "../../../../../../nw:network-types/tet:te-topology/" + + "etht:eth-tran-topology" { + description + "Augmentation parameters apply only for networks with + Ethernet topology type."; + } + description + "Augment TE bandwidth path constraints of the TE node + connectivity matrices information source."; + case eth { + uses etht-types:eth-bandwidth; + } + } + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:information-source-entry/tet:connectivity-matrices/" + + "tet:connectivity-matrix/" + + "tet:path-constraints/tet:te-bandwidth/tet:technology" { + when "../../../../../../../nw:network-types/tet:te-topology/" + + "etht:eth-tran-topology" { + description + "Augmentation parameters apply only for networks with + Ethernet topology type."; + } + description + "Augment TE bandwidth path constraints of the + connectivity matrix entry information source"; + case eth { + uses etht-types:eth-bandwidth; + } + } + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:tunnel-termination-point/" + + "tet:client-layer-adaptation/tet:switching-capability/" + + "tet:te-bandwidth/tet:technology" { + when "../../../../../../nw:network-types/tet:te-topology/" + + "etht:eth-tran-topology" { + description + "Augmentation parameters apply only for networks with + Ethernet topology type."; + } + description + "Augment client TE bandwidth of the tunnel termination point + (TTP)"; + case eth { + uses etht-types:eth-bandwidth; + } + } + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:tunnel-termination-point/" + + "tet:local-link-connectivities/tet:path-constraints/" + + "tet:te-bandwidth/tet:technology" { + when "../../../../../../nw:network-types/tet:te-topology/" + + "etht:eth-tran-topology" { + description + "Augmentation parameters apply only for networks with + Ethernet topology type."; + } + description + "Augment TE bandwidth path constraints for the TTP + Local Link Connectivities."; + case eth { + uses etht-types:eth-bandwidth; + } + } + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:tunnel-termination-point/" + + "tet:local-link-connectivities/" + + "tet:local-link-connectivity/tet:path-constraints/" + + "tet:te-bandwidth/tet:technology" { + when "../../../../../../../nw:network-types/tet:te-topology/" + + "etht:eth-tran-topology" { + description + "Augmentation parameters apply only for networks with + Ethernet topology type."; + } + description + "Augment TE bandwidth path constraints for the TTP + Local Link Connectivity entry."; + case eth { + uses etht-types:eth-bandwidth; + } + } + + augment "/nw:networks/nw:network/nt:link/tet:te/" + + "tet:te-link-attributes/" + + "tet:interface-switching-capability/tet:max-lsp-bandwidth/" + + "tet:te-bandwidth/tet:technology" { + when "../../../../../../nw:network-types/tet:te-topology/" + + "etht:eth-tran-topology" { + description + "Augmentation parameters apply only for networks with + Ethernet topology type."; + } + description + "Augment maximum LSP TE bandwidth for the TE link."; + case eth { + uses etht-types:eth-bandwidth; + } + } + + augment "/nw:networks/nw:network/nt:link/tet:te/" + + "tet:te-link-attributes/" + + "tet:max-link-bandwidth/" + + "tet:te-bandwidth" { + when "../../../../../nw:network-types/tet:te-topology/" + + "etht:eth-tran-topology" { + description + "Augmentation parameters apply only for networks with + Ethernet topology type."; + } + description + "Augment maximum TE bandwidth for the TE link"; + uses etht-types:eth-bandwidth; + } + + augment "/nw:networks/nw:network/nt:link/tet:te/" + + "tet:te-link-attributes/" + + "tet:max-resv-link-bandwidth/" + + "tet:te-bandwidth" { + when "../../../../../nw:network-types/tet:te-topology/" + + "etht:eth-tran-topology" { + description + "Augmentation parameters apply only for networks with + Ethernet topology type."; + } + description + "Augment maximum reservable TE bandwidth for the TE link"; + uses etht-types:eth-bandwidth; + } + + augment "/nw:networks/nw:network/nt:link/tet:te/" + + "tet:te-link-attributes/" + + "tet:unreserved-bandwidth/" + + "tet:te-bandwidth" { + when "../../../../../nw:network-types/tet:te-topology/" + + "etht:eth-tran-topology" { + description + "Augmentation parameters apply only for networks with + Ethernet topology type."; + } + description + "Augment unreserved TE bandwidth for the TE Link"; + uses etht-types:eth-bandwidth; + } + + augment "/nw:networks/nw:network/nt:link/tet:te/" + + "tet:information-source-entry/" + + "tet:interface-switching-capability/" + + "tet:max-lsp-bandwidth/" + + "tet:te-bandwidth/tet:technology" { + when "../../../../../../nw:network-types/tet:te-topology/" + + "etht:eth-tran-topology" { + description + "Augmentation parameters apply only for networks with + Ethernet topology type."; + } + description + "Augment maximum LSP TE bandwidth for the TE link + information source"; + case eth { + uses etht-types:eth-bandwidth; + } + } + + augment "/nw:networks/nw:network/nt:link/tet:te/" + + "tet:information-source-entry/" + + "tet:max-link-bandwidth/" + + "tet:te-bandwidth" { + when "../../../../../nw:network-types/tet:te-topology/" + + "etht:eth-tran-topology" { + description + "Augmentation parameters apply only for networks with + Ethernet topology type."; + } + description + "Augment maximum TE bandwidth for the TE link + information source"; + uses etht-types:eth-bandwidth; + } + + augment "/nw:networks/nw:network/nt:link/tet:te/" + + "tet:information-source-entry/" + + "tet:max-resv-link-bandwidth/" + + "tet:te-bandwidth" { + when "../../../../../nw:network-types/tet:te-topology/" + + "etht:eth-tran-topology" { + description + "Augmentation parameters apply only for networks with + Ethernet topology type."; + } + description + "Augment maximum reservable TE bandwidth for the TE link + information-source"; + uses etht-types:eth-bandwidth; + } + + augment "/nw:networks/nw:network/nt:link/tet:te/" + + "tet:information-source-entry/" + + "tet:unreserved-bandwidth/" + + "tet:te-bandwidth" { + when "../../../../../nw:network-types/tet:te-topology/" + + "etht:eth-tran-topology" { + description + "Augmentation parameters apply only for networks with + Ethernet topology type."; + } + description + "Augment unreserved TE bandwidth of the TE link + information source"; + uses etht-types:eth-bandwidth; + } + + augment "/nw:networks/tet:te/tet:templates/" + + "tet:link-template/tet:te-link-attributes/" + + "tet:interface-switching-capability/" + + "tet:max-lsp-bandwidth/" + + "tet:te-bandwidth/tet:technology" { + description + "Augment maximum LSP TE bandwidth of the TE link + template"; + case eth { + uses etht-types:eth-bandwidth; + } + } + + augment "/nw:networks/tet:te/tet:templates/" + + "tet:link-template/tet:te-link-attributes/" + + "tet:max-link-bandwidth/" + + "tet:te-bandwidth" { + description + "Augment maximum TE bandwidth the TE link template"; + uses etht-types:eth-bandwidth; + } + + augment "/nw:networks/tet:te/tet:templates/" + + "tet:link-template/tet:te-link-attributes/" + + "tet:max-resv-link-bandwidth/" + + "tet:te-bandwidth" { + description + "Augment maximum reservable TE bandwidth for the TE link + template."; + uses etht-types:eth-bandwidth; + } + + augment "/nw:networks/tet:te/tet:templates/" + + "tet:link-template/tet:te-link-attributes/" + + "tet:unreserved-bandwidth/" + + "tet:te-bandwidth" { + description + "Augment unreserved TE bandwidth the TE link template"; + uses etht-types:eth-bandwidth; + } + + /* + * Augment TE label range information + */ + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:te-node-attributes/tet:connectivity-matrices/" + + "tet:label-restrictions/tet:label-restriction" { + when "../../../../../../nw:network-types/tet:te-topology/" + + "etht:eth-tran-topology" { + description + "Augmentation parameters apply only for networks with + Ethernet topology type."; + } + description + "Augment TE label range information for the TE node + connectivity matrices."; + uses label-range-info; + } + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:te-node-attributes/tet:connectivity-matrices/" + + "tet:connectivity-matrix/tet:from/" + + "tet:label-restrictions/tet:label-restriction" { + when "../../../../../../../../nw:network-types/tet:te-topology/" + + "etht:eth-tran-topology" { + description + "Augmentation parameters apply only for networks with + Ethernet topology type."; + } + description + "Augment TE label range information for the source LTP + of the connectivity matrix entry."; + uses label-range-info; + } + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:te-node-attributes/tet:connectivity-matrices/" + + "tet:connectivity-matrix/tet:to/" + + "tet:label-restrictions/tet:label-restriction" { + when "../../../../../../../../nw:network-types/tet:te-topology/" + + "etht:eth-tran-topology" { + description + "Augmentation parameters apply only for networks with + Ethernet topology type."; + } + description + "Augment TE label range information for the destination LTP + of the connectivity matrix entry."; + uses label-range-info; + } + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:information-source-entry/" + + "tet:connectivity-matrices/tet:label-restrictions/" + + "tet:label-restriction" { + when "../../../../../../nw:network-types/tet:te-topology/" + + "etht:eth-tran-topology" { + description + "Augmentation parameters apply only for networks with + Ethernet topology type."; + } + description + "Augment TE label range information for the TE node + connectivity matrices information source."; + uses label-range-info; + } + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:information-source-entry/tet:connectivity-matrices/" + + "tet:connectivity-matrix/" + + "tet:from/tet:label-restrictions/tet:label-restriction" { + when "../../../../../../../../nw:network-types/tet:te-topology/" + + "etht:eth-tran-topology" { + description + "Augmentation parameters apply only for networks with + Ethernet topology type."; + } + description + "Augment TE label range information for the source LTP + of the connectivity matrix entry information source."; + uses label-range-info; + } + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:information-source-entry/tet:connectivity-matrices/" + + "tet:connectivity-matrix/" + + "tet:to/tet:label-restrictions/tet:label-restriction" { + when "../../../../../../../../nw:network-types/tet:te-topology/" + + "etht:eth-tran-topology" { + description + "Augmentation parameters apply only for networks with + Ethernet topology type."; + } + description + "Augment TE label range information for the destination LTP + of the connectivity matrix entry information source."; + uses label-range-info; + } + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:tunnel-termination-point/" + + "tet:local-link-connectivities/" + + "tet:label-restrictions/tet:label-restriction" { + when "../../../../../../nw:network-types/tet:te-topology/" + + "etht:eth-tran-topology" { + description + "Augmentation parameters apply only for networks with + Ethernet topology type."; + } + description + "Augment TE label range information for the TTP + Local Link Connectivities."; + uses label-range-info; + } + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:tunnel-termination-point/" + + "tet:local-link-connectivities/" + + "tet:local-link-connectivity/" + + "tet:label-restrictions/tet:label-restriction" { + when "../../../../../../../nw:network-types/tet:te-topology/" + + "etht:eth-tran-topology" { + description + "Augmentation parameters apply only for networks with + Ethernet topology type."; + } + description + "Augment TE label range information for the TTP + Local Link Connectivity entry."; + uses label-range-info; + } + + augment "/nw:networks/nw:network/nt:link/tet:te/" + + "tet:te-link-attributes/" + + "tet:label-restrictions/tet:label-restriction" { + when "../../../../../nw:network-types/tet:te-topology/" + + "etht:eth-tran-topology" { + description + "Augmentation parameters apply only for networks with + Ethernet topology type."; + } + description + "Augment TE label range information for the TE link."; + uses label-range-info; + } + + augment "/nw:networks/nw:network/nt:link/tet:te/" + + "tet:information-source-entry/" + + "tet:label-restrictions/tet:label-restriction" { + when "../../../../../nw:network-types/tet:te-topology/" + + "etht:eth-tran-topology" { + description + "Augmentation parameters apply only for networks with + Ethernet topology type."; + } + description + "Augment TE label range information for the TE link + information source."; + uses label-range-info; + } + + augment "/nw:networks/tet:te/tet:templates/" + + "tet:link-template/tet:te-link-attributes/" + + "tet:label-restrictions/tet:label-restriction" { + description + "Augment TE label range information for the TE link template."; + uses label-range-info; + } + + /* + * Augment TE label. + */ + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:te-node-attributes/tet:connectivity-matrices/" + + "tet:label-restrictions/tet:label-restriction/" + + "tet:label-start/" + + "tet:te-label/tet:technology" { + when "../../../../../../../../nw:network-types/tet:te-topology/" + + "etht:eth-tran-topology" { + description + "Augmentation parameters apply only for networks with + Ethernet topology type."; + } + description + "Augment TE label range start for the TE node + connectivity matrices"; + case eth { + uses etht-types:eth-label; + } + } + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:te-node-attributes/tet:connectivity-matrices/" + + "tet:label-restrictions/" + + "tet:label-restriction/tet:label-end/" + + "tet:te-label/tet:technology" { + when "../../../../../../../../nw:network-types/tet:te-topology/" + + "etht:eth-tran-topology" { + description + "Augmentation parameters apply only for networks with + Ethernet topology type."; + } + description + "Augment TE label range end for the TE node + connectivity matrices"; + case eth { + uses etht-types:eth-label; + } + } + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:te-node-attributes/tet:connectivity-matrices/" + + "tet:label-restrictions/" + + "tet:label-restriction/tet:label-step/" + + "tet:technology" { + when "../../../../../../../nw:network-types/tet:te-topology/" + + "etht:eth-tran-topology" { + description + "Augmentation parameters apply only for networks with + Ethernet topology type."; + } + description + "Augment TE label range step for the TE node + connectivity matrices"; + case eth { + uses etht-types:eth-label-step; + } + } + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:te-node-attributes/tet:connectivity-matrices/" + + "tet:underlay/tet:primary-path/tet:path-element/" + + "tet:type/tet:label/tet:label-hop/" + + "tet:te-label/tet:technology" { + when "../../../../../../../../../" + + "nw:network-types/tet:te-topology/" + + "etht:eth-tran-topology" { + description + "Augmentation parameters apply only for networks with + Ethernet topology type."; + } + description + "Augment TE label hop for the underlay primary path of the + TE node connectivity matrices"; + case eth { + uses etht-types:eth-label; + } + } + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:te-node-attributes/tet:connectivity-matrices/" + + "tet:underlay/tet:backup-path/tet:path-element/" + + "tet:type/tet:label/tet:label-hop/" + + "tet:te-label/tet:technology" { + when "../../../../../../../../../" + + "nw:network-types/tet:te-topology/" + + "etht:eth-tran-topology" { + description + "Augmentation parameters apply only for networks with + Ethernet topology type."; + } + description + "Augment TE label hop for the underlay backup path of the + TE node connectivity matrices"; + case eth { + uses etht-types:eth-label; + } + } + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:te-node-attributes/tet:connectivity-matrices/" + + "tet:optimizations/tet:algorithm/tet:metric/" + + "tet:optimization-metric/" + + "tet:explicit-route-exclude-objects/" + + "tet:route-object-exclude-object/" + + "tet:type/tet:label/tet:label-hop/" + + "tet:te-label/tet:technology" { + when "../../../../../../../../../../" + + "nw:network-types/tet:te-topology/" + + "etht:eth-tran-topology" { + description + "Augmentation parameters apply only for networks with + Ethernet topology type."; + } + description + "Augment TE label hop for the explicit route objects excluded + by the path computation of the TE node connectivity + matrices"; + case eth { + uses etht-types:eth-label; + } + } + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:te-node-attributes/tet:connectivity-matrices/" + + "tet:optimizations/tet:algorithm/tet:metric/" + + "tet:optimization-metric/" + + "tet:explicit-route-include-objects/" + + "tet:route-object-include-object/" + + "tet:type/tet:label/tet:label-hop/" + + "tet:te-label/tet:technology" { + when "../../../../../../../../../../" + + "nw:network-types/tet:te-topology/" + + "etht:eth-tran-topology" { + description + "Augmentation parameters apply only for networks with + Ethernet topology type."; + } + description + "Augment TE label hop for the explicit route objects included + by the path computation of the TE node connectivity + matrices"; + case eth { + uses etht-types:eth-label; + } + } + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:te-node-attributes/tet:connectivity-matrices/" + + "tet:path-properties/tet:path-route-objects/" + + "tet:path-route-object/tet:type/tet:label/tet:label-hop/" + + "tet:te-label/tet:technology" { + when "../../../../../../../../../" + + "nw:network-types/tet:te-topology/" + + "etht:eth-tran-topology" { + description + "Augmentation parameters apply only for networks with + Ethernet topology type."; + } + description + "Augment TE label hop for the computed path route objects + of the TE node connectivity matrices"; + case eth { + uses etht-types:eth-label; + } + } + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:te-node-attributes/tet:connectivity-matrices/" + + "tet:connectivity-matrix/tet:from/" + + "tet:label-restrictions/tet:label-restriction/" + + "tet:label-start/" + + "tet:te-label/tet:technology" { + when "../../../../../../../../../../" + + "nw:network-types/tet:te-topology/" + + "etht:eth-tran-topology" { + description + "Augmentation parameters apply only for networks with + Ethernet topology type."; + } + description + "Augment TE label range start for the source LTP + of the connectivity matrix entry."; + case eth { + uses etht-types:eth-label; + } + } + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:te-node-attributes/tet:connectivity-matrices/" + + "tet:connectivity-matrix/tet:from/" + + "tet:label-restrictions/tet:label-restriction/" + + "tet:label-end/" + + "tet:te-label/tet:technology" { + when "../../../../../../../../../../" + + "nw:network-types/tet:te-topology/" + + "etht:eth-tran-topology" { + description + "Augmentation parameters apply only for networks with + Ethernet topology type."; + } + description + "Augment TE label range end for the source LTP + of the connectivity matrix entry."; + case eth { + uses etht-types:eth-label; + } + } + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:te-node-attributes/tet:connectivity-matrices/" + + "tet:connectivity-matrix/tet:from/" + + "tet:label-restrictions/tet:label-restriction/" + + "tet:label-step/" + + "tet:technology" { + when "../../../../../../../../../" + + "nw:network-types/tet:te-topology/" + + "etht:eth-tran-topology" { + description + "Augmentation parameters apply only for networks with + Ethernet topology type."; + } + description + "Augment TE label range step for the source LTP + of the connectivity matrix entry."; + case eth { + uses etht-types:eth-label-step; + } + } + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:te-node-attributes/tet:connectivity-matrices/" + + "tet:connectivity-matrix/tet:to/" + + "tet:label-restrictions/tet:label-restriction/" + + "tet:label-start/" + + "tet:te-label/tet:technology" { + when "../../../../../../../../../../" + + "nw:network-types/tet:te-topology/" + + "etht:eth-tran-topology" { + description + "Augmentation parameters apply only for networks with + Ethernet topology type."; + } + description + "Augment TE label range start for the destination LTP + of the connectivity matrix entry."; + case eth { + uses etht-types:eth-label; + } + } + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:te-node-attributes/tet:connectivity-matrices/" + + "tet:connectivity-matrix/tet:to/" + + "tet:label-restrictions/tet:label-restriction/" + + "tet:label-end/" + + "tet:te-label/tet:technology" { + when "../../../../../../../../../../" + + "nw:network-types/tet:te-topology/" + + "etht:eth-tran-topology" { + description + "Augmentation parameters apply only for networks with + Ethernet topology type."; + } + description + "Augment TE label range end for the destination LTP + of the connectivity matrix entry."; + case eth { + uses etht-types:eth-label; + } + } + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:te-node-attributes/tet:connectivity-matrices/" + + "tet:connectivity-matrix/tet:to/" + + "tet:label-restrictions/tet:label-restriction/" + + "tet:label-step/" + + "tet:technology" { + when "../../../../../../../../../" + + "nw:network-types/tet:te-topology/" + + "etht:eth-tran-topology" { + description + "Augmentation parameters apply only for networks with + Ethernet topology type."; + } + description + "Augment TE label range step for the destination LTP + of the connectivity matrix entry."; + case eth { + uses etht-types:eth-label-step; + } + } + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:te-node-attributes/tet:connectivity-matrices/" + + "tet:connectivity-matrix/" + + "tet:underlay/tet:primary-path/tet:path-element/" + + "tet:type/tet:label/tet:label-hop/" + + "tet:te-label/tet:technology" { + when "../../../../../../../../../../" + + "nw:network-types/tet:te-topology/" + + "etht:eth-tran-topology" { + description + "Augmentation parameters apply only for networks with + Ethernet topology type."; + } + description + "Augment TE label hop for the underlay primary path + of the connectivity matrix entry."; + case eth { + uses etht-types:eth-label; + } + } + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:te-node-attributes/tet:connectivity-matrices/" + + "tet:connectivity-matrix/" + + "tet:underlay/tet:backup-path/tet:path-element/" + + "tet:type/tet:label/tet:label-hop/" + + "tet:te-label/tet:technology" { + when "../../../../../../../../../../" + + "nw:network-types/tet:te-topology/" + + "etht:eth-tran-topology" { + description + "Augmentation parameters apply only for networks with + Ethernet topology type."; + } + description + "Augment TE label hop for the underlay backup path + of the connectivity matrix entry."; + case eth { + uses etht-types:eth-label; + } + } + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:te-node-attributes/tet:connectivity-matrices/" + + "tet:connectivity-matrix/tet:optimizations/" + + "tet:algorithm/tet:metric/tet:optimization-metric/" + + "tet:explicit-route-exclude-objects/" + + "tet:route-object-exclude-object/tet:type/" + + "tet:label/tet:label-hop/tet:te-label/tet:technology" { + when "../../../../../../../../../../../" + + "nw:network-types/tet:te-topology/" + + "etht:eth-tran-topology" { + description + "Augmentation parameters apply only for networks with + Ethernet topology type."; + } + description + "Augment TE label hop for the explicit route objects excluded + by the path computation of the connectivity matrix entry."; + case eth { + uses etht-types:eth-label; + } + } + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:te-node-attributes/tet:connectivity-matrices/" + + "tet:connectivity-matrix/tet:optimizations/" + + "tet:algorithm/tet:metric/tet:optimization-metric/" + + "tet:explicit-route-include-objects/" + + "tet:route-object-include-object/tet:type/" + + "tet:label/tet:label-hop/tet:te-label/tet:technology" { + when "../../../../../../../../../../../" + + "nw:network-types/tet:te-topology/" + + "etht:eth-tran-topology" { + description + "Augmentation parameters apply only for networks with + Ethernet topology type."; + } + description + "Augment TE label hop for the explicit route objects included + by the path computation of the connectivity matrix entry."; + case eth { + uses etht-types:eth-label; + } + } + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:te-node-attributes/tet:connectivity-matrices/" + + "tet:connectivity-matrix/" + + "tet:path-properties/tet:path-route-objects/" + + "tet:path-route-object/tet:type/" + + "tet:label/tet:label-hop/tet:te-label/tet:technology" { + when "../../../../../../../../../../" + + "nw:network-types/tet:te-topology/" + + "etht:eth-tran-topology" { + description + "Augmentation parameters apply only for networks with + Ethernet topology type."; + } + description + "Augment TE label hop for the computed path route objects + of the connectivity matrix entry."; + case eth { + uses etht-types:eth-label; + } + } + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:information-source-entry/" + + "tet:connectivity-matrices/tet:label-restrictions/" + + "tet:label-restriction/" + + "tet:label-start/tet:te-label/tet:technology" { + when "../../../../../../../../" + + "nw:network-types/tet:te-topology/" + + "etht:eth-tran-topology" { + description + "Augmentation parameters apply only for networks with + Ethernet topology type."; + } + description + "Augment TE label range start for the TE node connectivity + matrices information source."; + case eth { + uses etht-types:eth-label; + } + } + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:information-source-entry/" + + "tet:connectivity-matrices/tet:label-restrictions/" + + "tet:label-restriction/" + + "tet:label-end/tet:te-label/tet:technology" { + when "../../../../../../../../" + + "nw:network-types/tet:te-topology/" + + "etht:eth-tran-topology" { + description + "Augmentation parameters apply only for networks with + Ethernet topology type."; + } + description + "Augment TE label range end for the TE node connectivity + matrices information source."; + case eth { + uses etht-types:eth-label; + } + } + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:information-source-entry/" + + "tet:connectivity-matrices/tet:label-restrictions/" + + "tet:label-restriction/" + + "tet:label-step/tet:technology" { + when "../../../../../../../" + + "nw:network-types/tet:te-topology/" + + "etht:eth-tran-topology" { + description + "Augmentation parameters apply only for networks with + Ethernet topology type."; + } + description + "Augment TE label range step for the TE node connectivity + matrices information source."; + case eth { + uses etht-types:eth-label-step; + } + } + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:information-source-entry/tet:connectivity-matrices/" + + "tet:underlay/tet:primary-path/tet:path-element/tet:type/" + + "tet:label/tet:label-hop/tet:te-label/tet:technology" { + when "../../../../../../../../../" + + "nw:network-types/tet:te-topology/" + + "etht:eth-tran-topology" { + description + "Augmentation parameters apply only for networks with + Ethernet topology type."; + } + description + "Augment TE label hop for the underlay primary path + of the TE node connectivity matrices of the information + source entry."; + case eth { + uses etht-types:eth-label; + } + } + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:information-source-entry/tet:connectivity-matrices/" + + "tet:underlay/tet:backup-path/tet:path-element/tet:type/" + + "tet:label/tet:label-hop/tet:te-label/tet:technology" { + when "../../../../../../../../../" + + "nw:network-types/tet:te-topology/" + + "etht:eth-tran-topology" { + description + "Augmentation parameters apply only for networks with + Ethernet topology type."; + } + description + "Augment TE label hop for the underlay backup path + of the TE node connectivity matrices of the information + source entry."; + case eth { + uses etht-types:eth-label; + } + } + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:information-source-entry/tet:connectivity-matrices/" + + "tet:optimizations/tet:algorithm/tet:metric/" + + "tet:optimization-metric/" + + "tet:explicit-route-exclude-objects/" + + "tet:route-object-exclude-object/tet:type/" + + "tet:label/tet:label-hop/tet:te-label/tet:technology" { + when "../../../../../../../../../../" + + "nw:network-types/tet:te-topology/" + + "etht:eth-tran-topology" { + description + "Augmentation parameters apply only for networks with + Ethernet topology type."; + } + description + "Augment TE label hop for the explicit route objects excluded + by the path computation of the TE node connectivity matrices + information source."; + case eth { + uses etht-types:eth-label; + } + } + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:information-source-entry/tet:connectivity-matrices/" + + "tet:optimizations/tet:algorithm/tet:metric/" + + "tet:optimization-metric/" + + "tet:explicit-route-include-objects/" + + "tet:route-object-include-object/tet:type/" + + "tet:label/tet:label-hop/tet:te-label/tet:technology" { + when "../../../../../../../../../../" + + "nw:network-types/tet:te-topology/" + + "etht:eth-tran-topology" { + description + "Augmentation parameters apply only for networks with + Ethernet topology type."; + } + description + "Augment TE label hop for the explicit route objects included + by the path computation of the TE node connectivity matrices + information source."; + case eth { + uses etht-types:eth-label; + } + } + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:information-source-entry/tet:connectivity-matrices/" + + "tet:path-properties/tet:path-route-objects/" + + "tet:path-route-object/tet:type/" + + "tet:label/tet:label-hop/tet:te-label/tet:technology" { + when "../../../../../../../../../" + + "nw:network-types/tet:te-topology/" + + "etht:eth-tran-topology" { + description + "Augmentation parameters apply only for networks with + Ethernet topology type."; + } + description + "Augment TE label hop for the computed path route objects + of the TE node connectivity matrices information source."; + case eth { + uses etht-types:eth-label; + } + } + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:information-source-entry/tet:connectivity-matrices/" + + "tet:connectivity-matrix/" + + "tet:from/tet:label-restrictions/" + + "tet:label-restriction/" + + "tet:label-start/tet:te-label/tet:technology" { + when "../../../../../../../../../../" + + "nw:network-types/tet:te-topology/" + + "etht:eth-tran-topology" { + description + "Augmentation parameters apply only for networks with + Ethernet topology type."; + } + description + "Augment TE label range start for the source LTP + of the connectivity matrix entry information source."; + case eth { + uses etht-types:eth-label; + } + } + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:information-source-entry/tet:connectivity-matrices/" + + "tet:connectivity-matrix/" + + "tet:from/tet:label-restrictions/" + + "tet:label-restriction/" + + "tet:label-end/tet:te-label/tet:technology" { + when "../../../../../../../../../../" + + "nw:network-types/tet:te-topology/" + + "etht:eth-tran-topology" { + description + "Augmentation parameters apply only for networks with + Ethernet topology type."; + } + description + "Augment TE label range end for the source LTP + of the connectivity matrix entry information source."; + case eth { + uses etht-types:eth-label; + } + } + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:information-source-entry/tet:connectivity-matrices/" + + "tet:connectivity-matrix/" + + "tet:from/tet:label-restrictions/" + + "tet:label-restriction/" + + "tet:label-step/tet:technology" { + when "../../../../../../../../../" + + "nw:network-types/tet:te-topology/" + + "etht:eth-tran-topology" { + description + "Augmentation parameters apply only for networks with + Ethernet topology type."; + } + description + "Augment TE label range step for the source LTP + of the connectivity matrix entry information source."; + case eth { + uses etht-types:eth-label-step; + } + } + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:information-source-entry/tet:connectivity-matrices/" + + "tet:connectivity-matrix/" + + "tet:to/tet:label-restrictions/tet:label-restriction/" + + "tet:label-start/tet:te-label/tet:technology" { + when "../../../../../../../../../../" + + "nw:network-types/tet:te-topology/" + + "etht:eth-tran-topology" { + description + "Augmentation parameters apply only for networks with + Ethernet topology type."; + } + description + "Augment TE label range start for the destination LTP + of the connectivity matrix entry information source."; + case eth { + uses etht-types:eth-label; + } + } + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:information-source-entry/tet:connectivity-matrices/" + + "tet:connectivity-matrix/" + + "tet:to/tet:label-restrictions/tet:label-restriction/" + + "tet:label-end/tet:te-label/tet:technology" { + when "../../../../../../../../../../" + + "nw:network-types/tet:te-topology/" + + "etht:eth-tran-topology" { + description + "Augmentation parameters apply only for networks with + Ethernet topology type."; + } + description + "Augment TE label range end for the destination LTP + of the connectivity matrix entry information source."; + case eth { + uses etht-types:eth-label; + } + } + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:information-source-entry/tet:connectivity-matrices/" + + "tet:connectivity-matrix/" + + "tet:to/tet:label-restrictions/tet:label-restriction/" + + "tet:label-step/tet:technology" { + when "../../../../../../../../../" + + "nw:network-types/tet:te-topology/" + + "etht:eth-tran-topology" { + description + "Augmentation parameters apply only for networks with + Ethernet topology type."; + } + description + "Augment TE label range step for the destination LTP + of the connectivity matrix entry information source."; + case eth { + uses etht-types:eth-label-step; + } + } + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:information-source-entry/tet:connectivity-matrices/" + + "tet:connectivity-matrix/" + + "tet:underlay/tet:primary-path/tet:path-element/tet:type/" + + "tet:label/tet:label-hop/tet:te-label/tet:technology" { + when "../../../../../../../../../../" + + "nw:network-types/tet:te-topology/" + + "etht:eth-tran-topology" { + description + "Augmentation parameters apply only for networks with + Ethernet topology type."; + } + description + "Augment TE label hop for the underlay primary path + of the connectivity matrix entry information source."; + case eth { + uses etht-types:eth-label; + } + } + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:information-source-entry/tet:connectivity-matrices/" + + "tet:connectivity-matrix/" + + "tet:underlay/tet:backup-path/tet:path-element/tet:type/" + + "tet:label/tet:label-hop/tet:te-label/tet:technology" { + when "../../../../../../../../../../" + + "nw:network-types/tet:te-topology/" + + "etht:eth-tran-topology" { + description + "Augmentation parameters apply only for networks with + Ethernet topology type."; + } + description + "Augment TE label hop for the underlay backup path + of the connectivity matrix entry information source."; + case eth { + uses etht-types:eth-label; + } + } + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:information-source-entry/tet:connectivity-matrices/" + + "tet:connectivity-matrix/" + + "tet:optimizations/tet:algorithm/tet:metric/" + + "tet:optimization-metric/" + + "tet:explicit-route-exclude-objects/" + + "tet:route-object-exclude-object/tet:type/" + + "tet:label/tet:label-hop/tet:te-label/tet:technology" { + when "../../../../../../../../../../../" + + "nw:network-types/tet:te-topology/" + + "etht:eth-tran-topology" { + description + "Augmentation parameters apply only for networks with + Ethernet topology type."; + } + description + "Augment TE label hop for the explicit route objects excluded + by the path computation of the connectivity matrix entry + information source."; + case eth { + uses etht-types:eth-label; + } + } + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:information-source-entry/tet:connectivity-matrices/" + + "tet:connectivity-matrix/" + + "tet:optimizations/tet:algorithm/tet:metric/" + + "tet:optimization-metric/" + + "tet:explicit-route-include-objects/" + + "tet:route-object-include-object/tet:type/" + + "tet:label/tet:label-hop/tet:te-label/tet:technology" { + when "../../../../../../../../../../../" + + "nw:network-types/tet:te-topology/" + + "etht:eth-tran-topology" { + description + "Augmentation parameters apply only for networks with + Ethernet topology type."; + } + description + "Augment TE label hop for the explicit route objects included + by the path computation of the connectivity matrix entry + information source."; + case eth { + uses etht-types:eth-label; + } + } + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:information-source-entry/tet:connectivity-matrices/" + + "tet:connectivity-matrix/" + + "tet:path-properties/tet:path-route-objects/" + + "tet:path-route-object/tet:type/" + + "tet:label/tet:label-hop/tet:te-label/tet:technology" { + when "../../../../../../../../../../" + + "nw:network-types/tet:te-topology/" + + "etht:eth-tran-topology" { + description + "Augmentation parameters apply only for networks with + Ethernet topology type."; + } + description + "Augment TE label hop for the computed path route objects + of the connectivity matrix entry information source."; + case eth { + uses etht-types:eth-label; + } + } + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:tunnel-termination-point/" + + "tet:local-link-connectivities/" + + "tet:label-restrictions/tet:label-restriction/" + + "tet:label-start/" + + "tet:te-label/tet:technology" { + when "../../../../../../../../" + + "nw:network-types/tet:te-topology/" + + "etht:eth-tran-topology" { + description + "Augmentation parameters apply only for networks with + Ethernet topology type."; + } + description + "Augment TE label range start for the TTP + Local Link Connectivities."; + case eth { + uses etht-types:eth-label; + } + } + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:tunnel-termination-point/" + + "tet:local-link-connectivities/" + + "tet:label-restrictions/tet:label-restriction/" + + "tet:label-end/" + + "tet:te-label/tet:technology"{ + when "../../../../../../../../" + + "nw:network-types/tet:te-topology/" + + "etht:eth-tran-topology" { + description + "Augmentation parameters apply only for networks with + Ethernet topology type."; + } + description + "Augment TE label range end for the TTP + Local Link Connectivities."; + case eth { + uses etht-types:eth-label; + } + } + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:tunnel-termination-point/" + + "tet:local-link-connectivities/" + + "tet:label-restrictions/tet:label-restriction/" + + "tet:label-step/" + + "tet:technology"{ + when "../../../../../../../" + + "nw:network-types/tet:te-topology/" + + "etht:eth-tran-topology" { + description + "Augmentation parameters apply only for networks with + Ethernet topology type."; + } + description + "Augment TE label range step for the TTP + Local Link Connectivities."; + case eth { + uses etht-types:eth-label-step; + } + } + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:tunnel-termination-point/" + + "tet:local-link-connectivities/" + + "tet:underlay/tet:primary-path/tet:path-element/tet:type/" + + "tet:label/tet:label-hop/tet:te-label/tet:technology" { + when "../../../../../../../../../" + + "nw:network-types/tet:te-topology/" + + "etht:eth-tran-topology" { + description + "Augmentation parameters apply only for networks with + Ethernet topology type."; + } + description + "Augment TE label hop for the underlay primary path + of the TTP Local Link Connectivities."; + case eth { + uses etht-types:eth-label; + } + } + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:tunnel-termination-point/" + + "tet:local-link-connectivities/" + + "tet:underlay/tet:backup-path/tet:path-element/tet:type/" + + "tet:label/tet:label-hop/tet:te-label/tet:technology" { + when "../../../../../../../../../" + + "nw:network-types/tet:te-topology/" + + "etht:eth-tran-topology" { + description + "Augmentation parameters apply only for networks with + Ethernet topology type."; + } + description + "Augment TE label hop for the underlay backup path + of the TTP Local Link Connectivities."; + case eth { + uses etht-types:eth-label; + } + } + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:tunnel-termination-point/" + + "tet:local-link-connectivities/" + + "tet:optimizations/tet:algorithm/tet:metric/" + + "tet:optimization-metric/" + + "tet:explicit-route-exclude-objects/" + + "tet:route-object-exclude-object/tet:type/" + + "tet:label/tet:label-hop/tet:te-label/tet:technology" { + when "../../../../../../../../../../" + + "nw:network-types/tet:te-topology/" + + "etht:eth-tran-topology" { + description + "Augmentation parameters apply only for networks with + Ethernet topology type."; + } + description + "Augment TE label hop for the explicit route objects excluded + by the path computation of the TTP Local Link + Connectivities."; + case eth { + uses etht-types:eth-label; + } + } + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:tunnel-termination-point/" + + "tet:local-link-connectivities/" + + "tet:optimizations/tet:algorithm/tet:metric/" + + "tet:optimization-metric/" + + "tet:explicit-route-include-objects/" + + "tet:route-object-include-object/tet:type/" + + "tet:label/tet:label-hop/tet:te-label/tet:technology" { + when "../../../../../../../../../../" + + "nw:network-types/tet:te-topology/" + + "etht:eth-tran-topology" { + description + "Augmentation parameters apply only for networks with + Ethernet topology type."; + } + description + "Augment TE label hop for the explicit route objects included + by the path computation of the TTP Local Link + Connectivities."; + case eth { + uses etht-types:eth-label; + } + } + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:tunnel-termination-point/" + + "tet:local-link-connectivities/" + + "tet:path-properties/tet:path-route-objects/" + + "tet:path-route-object/tet:type/" + + "tet:label/tet:label-hop/tet:te-label/tet:technology" { + when "../../../../../../../../../" + + "nw:network-types/tet:te-topology/" + + "etht:eth-tran-topology" { + description + "Augmentation parameters apply only for networks with + Ethernet topology type."; + } + description + "Augment TE label hop for the computed path route objects + of the TTP Local Link Connectivities."; + case eth { + uses etht-types:eth-label; + } + } + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:tunnel-termination-point/" + + "tet:local-link-connectivities/" + + "tet:local-link-connectivity/" + + "tet:label-restrictions/tet:label-restriction/" + + "tet:label-start/tet:te-label/tet:technology" { + when "../../../../../../../../../" + + "nw:network-types/tet:te-topology/" + + "etht:eth-tran-topology" { + description + "Augmentation parameters apply only for networks with + Ethernet topology type."; + } + description + "Augment TE label range start for the TTP + Local Link Connectivity entry."; + case eth { + uses etht-types:eth-label; + } + } + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:tunnel-termination-point/" + + "tet:local-link-connectivities/" + + "tet:local-link-connectivity/" + + "tet:label-restrictions/tet:label-restriction/" + + "tet:label-end/tet:te-label/tet:technology" { + when "../../../../../../../../../" + + "nw:network-types/tet:te-topology/" + + "etht:eth-tran-topology" { + description + "Augmentation parameters apply only for networks with + Ethernet topology type."; + } + description + "Augment TE label range end for the TTP + Local Link Connectivity entry."; + case eth { + uses etht-types:eth-label; + } + } + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:tunnel-termination-point/" + + "tet:local-link-connectivities/" + + "tet:local-link-connectivity/" + + "tet:label-restrictions/tet:label-restriction/" + + "tet:label-step/tet:technology" { + when "../../../../../../../../" + + "nw:network-types/tet:te-topology/" + + "etht:eth-tran-topology" { + description + "Augmentation parameters apply only for networks with + Ethernet topology type."; + } + description + "Augment TE label range step for the TTP + Local Link Connectivity entry."; + case eth { + uses etht-types:eth-label-step; + } + } + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:tunnel-termination-point/" + + "tet:local-link-connectivities/" + + "tet:local-link-connectivity/" + + "tet:underlay/tet:primary-path/tet:path-element/tet:type/" + + "tet:label/tet:label-hop/tet:te-label/tet:technology" { + when "../../../../../../../../../../" + + "nw:network-types/tet:te-topology/" + + "etht:eth-tran-topology" { + description + "Augmentation parameters apply only for networks with + Ethernet topology type."; + } + description + "Augment TE label hop for the underlay primary path + of the TTP Local Link Connectivity entry."; + case eth { + uses etht-types:eth-label; + } + } + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:tunnel-termination-point/" + + "tet:local-link-connectivities/" + + "tet:local-link-connectivity/" + + "tet:underlay/tet:backup-path/tet:path-element/tet:type/" + + "tet:label/tet:label-hop/tet:te-label/tet:technology" { + when "../../../../../../../../../../" + + "nw:network-types/tet:te-topology/" + + "etht:eth-tran-topology" { + description + "Augmentation parameters apply only for networks with + Ethernet topology type."; + } + description + "Augment TE label hop for the underlay backup path + of the TTP Local Link Connectivity entry."; + case eth { + uses etht-types:eth-label; + } + } + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:tunnel-termination-point/" + + "tet:local-link-connectivities/" + + "tet:local-link-connectivity/" + + "tet:optimizations/tet:algorithm/tet:metric/" + + "tet:optimization-metric/" + + "tet:explicit-route-exclude-objects/" + + "tet:route-object-exclude-object/tet:type/" + + "tet:label/tet:label-hop/tet:te-label/tet:technology" { + when "../../../../../../../../../../../" + + "nw:network-types/tet:te-topology/" + + "etht:eth-tran-topology" { + description + "Augmentation parameters apply only for networks with + Ethernet topology type."; + } + description + "Augment TE label hop for the explicit route objects excluded + by the path computation of the TTP Local Link + Connectivity entry."; + case eth { + uses etht-types:eth-label; + } + } + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:tunnel-termination-point/" + + "tet:local-link-connectivities/" + + "tet:local-link-connectivity/" + + "tet:optimizations/tet:algorithm/tet:metric/" + + "tet:optimization-metric/" + + "tet:explicit-route-include-objects/" + + "tet:route-object-include-object/tet:type/" + + "tet:label/tet:label-hop/tet:te-label/tet:technology" { + when "../../../../../../../../../../../" + + "nw:network-types/tet:te-topology/" + + "etht:eth-tran-topology" { + description + "Augmentation parameters apply only for networks with + Ethernet topology type."; + } + description + "Augment TE label hop for the explicit route objects included + by the path computation of the TTP Local Link + Connectivity entry."; + case eth { + uses etht-types:eth-label; + } + } + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:tunnel-termination-point/" + + "tet:local-link-connectivities/" + + "tet:local-link-connectivity/" + + "tet:path-properties/tet:path-route-objects/" + + "tet:path-route-object/tet:type/" + + "tet:label/tet:label-hop/tet:te-label/tet:technology" { + when "../../../../../../../../../../" + + "nw:network-types/tet:te-topology/" + + "etht:eth-tran-topology" { + description + "Augmentation parameters apply only for networks with + Ethernet topology type."; + } + description + "Augment TE label hop for the computed path route objects + of the TTP Local Link Connectivity entry."; + case eth { + uses etht-types:eth-label; + } + } + augment "/nw:networks/nw:network/nt:link/tet:te/" + + "tet:te-link-attributes/" + + "tet:underlay/tet:primary-path/tet:path-element/tet:type/" + + "tet:label/tet:label-hop/tet:te-label/tet:technology" { + when "../../../../../../../../" + + "nw:network-types/tet:te-topology/" + + "etht:eth-tran-topology" { + description + "Augmentation parameters apply only for networks with + Ethernet topology type."; + } + description + "Augment TE label hop for the underlay primary path + of the TE link."; + case eth { + uses etht-types:eth-label; + } + } + + augment "/nw:networks/nw:network/nt:link/tet:te/" + + "tet:te-link-attributes/" + + "tet:underlay/tet:backup-path/tet:path-element/tet:type/" + + "tet:label/tet:label-hop/tet:te-label/tet:technology" { + when "../../../../../../../../" + + "nw:network-types/tet:te-topology/" + + "etht:eth-tran-topology" { + description + "Augmentation parameters apply only for networks with + Ethernet topology type."; + } + description + "Augment TE label hop for the underlay backup path + of the TE link."; + case eth { + uses etht-types:eth-label; + } + } + + augment "/nw:networks/nw:network/nt:link/tet:te/" + + "tet:te-link-attributes/" + + "tet:label-restrictions/tet:label-restriction/" + + "tet:label-start/tet:te-label/tet:technology" { + when "../../../../../../../nw:network-types/tet:te-topology/" + + "etht:eth-tran-topology" { + description + "Augmentation parameters apply only for networks with + Ethernet topology type."; + } + description + "Augment TE label range start for the TE link."; + case eth { + uses etht-types:eth-label; + } + } + + augment "/nw:networks/nw:network/nt:link/tet:te/" + + "tet:te-link-attributes/" + + "tet:label-restrictions/tet:label-restriction/" + + "tet:label-end/tet:te-label/tet:technology" { + when "../../../../../../../nw:network-types/tet:te-topology/" + + "etht:eth-tran-topology" { + description + "Augmentation parameters apply only for networks with + Ethernet topology type."; + } + description + "Augment TE label range end for the TE link."; + case eth { + uses etht-types:eth-label; + } + } + + augment "/nw:networks/nw:network/nt:link/tet:te/" + + "tet:te-link-attributes/" + + "tet:label-restrictions/tet:label-restriction/" + + "tet:label-step/tet:technology" { + when "../../../../../../nw:network-types/tet:te-topology/" + + "etht:eth-tran-topology" { + description + "Augmentation parameters apply only for networks with + Ethernet topology type."; + } + description + "Augment TE label range step for the TE link."; + case eth { + uses etht-types:eth-label-step; + } + } + + augment "/nw:networks/nw:network/nt:link/tet:te/" + + "tet:information-source-entry/" + + "tet:label-restrictions/tet:label-restriction/" + + "tet:label-start/tet:te-label/tet:technology" { + when "../../../../../../../nw:network-types/tet:te-topology/" + + "etht:eth-tran-topology" { + description + "Augmentation parameters apply only for networks with + Ethernet topology type."; + } + description + "Augment TE label range start for the TE link + information source."; + case eth { + uses etht-types:eth-label; + } + } + + augment "/nw:networks/nw:network/nt:link/tet:te/" + + "tet:information-source-entry/" + + "tet:label-restrictions/tet:label-restriction/" + + "tet:label-end/tet:te-label/tet:technology" { + when "../../../../../../../nw:network-types/tet:te-topology/" + + "etht:eth-tran-topology" { + description + "Augmentation parameters apply only for networks with + Ethernet topology type."; + } + description + "Augment TE label range end for the TE link + information source."; + case eth { + uses etht-types:eth-label; + } + } + + augment "/nw:networks/nw:network/nt:link/tet:te/" + + "tet:information-source-entry/" + + "tet:label-restrictions/tet:label-restriction/" + + "tet:label-step/tet:technology" { + when "../../../../../../nw:network-types/tet:te-topology/" + + "etht:eth-tran-topology" { + description + "Augmentation parameters apply only for networks with + Ethernet topology type."; + } + description + "Augment TE label range step for the TE link + information source."; + case eth { + uses etht-types:eth-label-step; + } + } + + augment "/nw:networks/tet:te/tet:templates/" + + "tet:link-template/tet:te-link-attributes/" + + "tet:underlay/tet:primary-path/tet:path-element/tet:type/" + + "tet:label/tet:label-hop/tet:te-label/tet:technology" { + description + "Augment TE label hop for the underlay primary path + of the TE link template."; + case eth { + uses etht-types:eth-label; + } + } + + augment "/nw:networks/tet:te/tet:templates/" + + "tet:link-template/tet:te-link-attributes/" + + "tet:underlay/tet:backup-path/tet:path-element/tet:type/" + + "tet:label/tet:label-hop/tet:te-label/tet:technology" { + description + "Augment TE label hop for the underlay backup path + of the TE link template."; + case eth { + uses etht-types:eth-label; + } + } + + augment "/nw:networks/tet:te/tet:templates/" + + "tet:link-template/tet:te-link-attributes/" + + "tet:label-restrictions/tet:label-restriction/" + + "tet:label-start/tet:te-label/tet:technology" { + description + "Augment TE label range start for the TE link template."; + case eth { + uses etht-types:eth-label; + } + } + + augment "/nw:networks/tet:te/tet:templates/" + + "tet:link-template/tet:te-link-attributes/" + + "tet:label-restrictions/tet:label-restriction/" + + "tet:label-end/tet:te-label/tet:technology" { + description + "Augment TE label range end for the TE link template."; + case eth { + uses etht-types:eth-label; + } + } + + augment "/nw:networks/tet:te/tet:templates/" + + "tet:link-template/tet:te-link-attributes/" + + "tet:label-restrictions/tet:label-restriction/" + + "tet:label-step/tet:technology" { + description + "Augment TE label range step for the TE link template."; + case eth { + uses etht-types:eth-label-step; + } + } + + } diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/yang/ietf-eth-tran-service@2023-10-23.yang b/src/nbi/service/rest_server/nbi_plugins/ietf_network/yang/ietf-eth-tran-service@2023-10-23.yang new file mode 100644 index 0000000000000000000000000000000000000000..222066adf0e1ece5f964fbabb170edf92d57b21e --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/yang/ietf-eth-tran-service@2023-10-23.yang @@ -0,0 +1,1004 @@ + module ietf-eth-tran-service { + yang-version 1.1; + namespace "urn:ietf:params:xml:ns:yang:ietf-eth-tran-service"; + + prefix "ethtsvc"; + import ietf-yang-types { + prefix "yang"; + reference "RFC 6991 - Common YANG Data Types"; + } + + import ietf-network { + prefix "nw"; + reference "RFC8345 - A YANG Data Model for Network Topologies"; + } + + import ietf-network-topology { + prefix "nt"; + reference "RFC8345 - A YANG Data Model for Network Topologies"; + } + + import ietf-te-types { + prefix "te-types"; + reference "RFC 8776 - Traffic Engineering Common YANG Types"; + } + + import ietf-eth-tran-types { + prefix "etht-types"; + reference "RFC XXXX - A YANG Data Model for Transport + Network Client Signals"; + } + + import ietf-routing-types { + prefix "rt-types"; + reference "RFC 8294 - Common YANG Data Types for the + Routing Area"; + + } + + import ietf-te { + prefix "te"; + reference "RFC YYYY - A YANG Data Model for Traffic + Engineering Tunnels and Interfaces"; + } + + organization + "Internet Engineering Task Force (IETF) CCAMP WG"; + contact + " + WG List: + + ID-draft editor: + Haomian Zheng (zhenghaomian@huawei.com); + Italo Busi (italo.busi@huawei.com); + Aihua Guo (aihuaguo.ietf@gmail.com); + Anton Snitser (antons@sedonasys.com);0 + Francesco Lazzeri (francesco.lazzeri@ericsson.com); + Yunbin Xu (xuyunbin@caict.ac.cn); + Yang Zhao (zhaoyangyjy@chinamobile.com); + Xufeng Liu (xufeng.liu.ietf@gmail.com); + Giuseppe Fioccola (giuseppe.fioccola@huawei.com); + Chaode Yu (yuchaode@huawei.com) + "; + + description + "This module defines a YANG data model for describing + the Ethernet services. The model fully conforms to the + Network Management Datastore Architecture (NMDA). + + Copyright (c) 2021 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 + (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 2023-10-23 { + description + "version -04 as an WG document"; + reference + "draft-ietf-ccamp-client-signal-yang"; + } + + /* + * Groupings + */ + + grouping vlan-classification { + description + "A grouping which represents classification + on an 802.1Q VLAN tag."; + + leaf tag-type { + type etht-types:eth-tag-classify; + description + "The tag type used for VLAN classification."; + } + choice individual-bundling-vlan { + description + "VLAN based classification can be individual + or bundling."; + + case individual-vlan { + leaf vlan-value { + type etht-types:vlanid; + description + "VLAN ID value."; + } + } + + case vlan-bundling { + leaf vlan-range { + type etht-types:vid-range-type; + description + "List of VLAN ID values."; + } + } + } + } + + grouping vlan-write { + description + "A grouping which represents push/pop operations + of an 802.1Q VLAN tag."; + + leaf tag-type { + type etht-types:eth-tag-type; + description + "The VLAN tag type to push/swap."; + } + leaf vlan-value { + type etht-types:vlanid; + description + "The VLAN ID value to push/swap."; + } + /* + * To be added: this attribute is used when: + * a) the ETH service has only one CoS (as in current version) + * b) as a default when a mapping between a given CoS value + * and the PCP value is not defined (in future versions) + */ + leaf default-pcp { + type uint8 { + range "0..7"; + } + description + "The default Priority Code Point (PCP) value to push/swap"; + } + } + + grouping vlan-operations { + description + "A grouping which represents VLAN operations."; + + leaf pop-tags { + type uint8 { + range "1..2"; + } + description + "The number of VLAN tags to pop (or swap if used in + conjunction with push-tags)"; + } + container push-tags { + description + "The VLAN tags to push (or swap if used in + conjunction with pop-tags)"; + + container outer-tag { + presence + "Indicates existence of the outermost VLAN tag to + push/swap"; + + description + "The outermost VLAN tag to push/swap."; + + uses vlan-write; + } + container second-tag { + must + '../outer-tag/tag-type = "etht-types:s-vlan-tag-type" and ' + + 'tag-type = "etht-types:c-vlan-tag-type"' + { + + error-message + " + When pushing/swapping two tags, the outermost tag must + be specified and of S-VLAN type and the second + outermost tag must be of C-VLAN tag type. + "; + description + " + For IEEE 802.1Q interoperability, when pushing/swapping + two tags, it is required that the outermost tag exists + and is an S-VLAN, and the second outermost tag is a + C-VLAN. + "; + } + + presence + "Indicates existence of a second outermost VLAN tag to + push/swap"; + + description + "The second outermost VLAN tag to push/swap."; + uses vlan-write; + } + } + } + + grouping named-or-value-bandwidth-profile { + description + "A grouping to configure a bandwdith profile either by + referencing a named bandwidth profile or by + configuring the values of the bandwidth profile attributes."; + choice style { + description + "Whether the bandwidth profile is named or defined by value"; + + case named { + description + "Named bandwidth profile."; + leaf bandwidth-profile-name { + type leafref { + path "/ethtsvc:etht-svc/ethtsvc:globals/" + + "ethtsvc:named-bandwidth-profiles/" + + "ethtsvc:bandwidth-profile-name"; + } + description + "Name of the bandwidth profile."; + } + } + case value { + description + "Bandwidth profile configured by value."; + uses etht-types:etht-bandwidth-profiles; + } + } + } + + grouping bandwidth-profiles { + description + "A grouping which represent bandwidth profile configuration."; + + choice direction { + description + "Whether the bandwidth profiles are symmetrical or + asymmetrical"; + case symmetrical { + description + "The same bandwidth profile is used to describe both + the ingress and the egress bandwidth profile."; + container ingress-egress-bandwidth-profile { + description + "The bandwdith profile used in both directions."; + uses named-or-value-bandwidth-profile; + } + } + case asymmetrical { + description + "Ingress and egress bandwidth profiles can be specified."; + container ingress-bandwidth-profile { + description + "The bandwdith profile used in the ingress direction."; + uses named-or-value-bandwidth-profile; + } + container egress-bandwidth-profile { + description + "The bandwdith profile used in the egress direction."; + uses named-or-value-bandwidth-profile; + } + } + } + } + + grouping etht-svc-access-parameters { + description + "ETH services access parameters"; + + leaf access-node-id { + type te-types:te-node-id; + description + "The identifier of the access node in + the ETH TE topology."; + } + + leaf access-node-uri { + type nw:node-id; + description + "The identifier of the access node in the network."; + } + + leaf access-ltp-id { + type te-types:te-tp-id; + description + "The TE link termination point identifier, used + together with access-node-id to identify the + access LTP."; + } + + leaf access-ltp-uri { + type nt:tp-id; + description + "The link termination point identifier in network topology, + used together with access-node-uri to identify the + access LTP."; + } + + leaf access-role { + type identityref { + base etht-types:access-role; + } + description + "Indicate the role of access, e.g., working or protection. "; + } + + container pm-config { + uses pm-config-grouping; + description + "This grouping is used to set the threshold value for + performance monitoring. "; + } + + container state { + config false; + description + "The state is used to monitor the status of service. "; + leaf operational-state { + type identityref { + base te-types:tunnel-state-type; + } + description + "Indicating the operational state of client signal. "; + } + leaf provisioning-state { + type identityref { + base te-types:lsp-state-type; + } + description + "Indicating the provisional state of client signal, + especially when there is a change, i.e., revise, create. "; + } + } + + leaf performance { + type identityref { + base etht-types:performance; + } + config false; + description + "Performance Monitoring for the service. "; + } + + } + + grouping etht-svc-tunnel-parameters { + description + "ETH services tunnel parameters."; + choice technology { + description + "Service multiplexing is optional and flexible."; + + case native-ethernet { + /* + placeholder to support proprietary multiplexing + (for further discussion) + */ + list eth-tunnels { + key name; + description + "ETH Tunnel list in native Ethernet scenario."; + uses tunnels-grouping; + } + } + + case frame-base { + list otn-tunnels { + key name; + description + "OTN Tunnel list in Frame-based scenario."; + uses tunnels-grouping; + } + } + + case mpls-tp { + container pw { + description + "Pseudowire information for Ethernet over MPLS-TP."; + uses pw-segment-grouping; + } + } + } + + /* + * Open issue: can we constraints it to be used only with mp services? + */ + leaf src-split-horizon-group { + type string; + description + "Identify a split horizon group at the Tunnel source TTP"; + } + leaf dst-split-horizon-group { + type string; + description + "Identify a split horizon group at the Tunnel destination TTP"; + } + } + + grouping etht-svc-pm-threshold-config { + description + "Configuraiton parameters for Ethernet service PM thresholds."; + + leaf sending-rate-high { + type uint64; + description + "High threshold of packet sending rate in kbps."; + } + leaf sending-rate-low { + type uint64; + description + "Low threshold of packet sending rate in kbps."; + } + leaf receiving-rate-high { + type uint64; + description + "High threshold of packet receiving rate in kbps."; + } + leaf receiving-rate-low { + type uint64; + description + "Low threshold of packet receiving rate in kbps."; + } + } + + grouping etht-svc-pm-stats { + description + "Ethernet service PM statistics."; + + leaf sending-rate-too-high { + type uint32; + description + "Counter that indicates the number of times the + sending rate is above the high threshold"; + } + leaf sending-rate-too-low { + type uint32; + description + "Counter that indicates the number of times the + sending rate is below the low threshold"; + } + leaf receiving-rate-too-high { + type uint32; + description + "Counter that indicates the number of times the + receiving rate is above the high threshold"; + } + leaf receiving-rate-too-low { + type uint32; + description + "Counter that indicates the number of times the + receiving rate is below the low threshold"; + } + } + + grouping etht-svc-instance-config { + description + "Configuraiton parameters for Ethernet services."; + + leaf etht-svc-name { + type string; + description + "Name of the ETH service."; + } + + leaf etht-svc-title { + type string; + description + "The Identifier of the ETH service."; + } + + leaf user-label { + type string; + description + "Alias of the ETH service."; + } + + leaf etht-svc-descr { + type string; + description + "Description of the ETH service."; + } + + leaf etht-svc-customer { + type string; + description + "Customer of the ETH service."; + } + + leaf etht-svc-type { + type etht-types:service-type; + description + "Type of ETH service (p2p, mp2mp or rmp)."; + /* Add default as p2p */ + } + + leaf etht-svc-lifecycle { + type etht-types:lifecycle-status; + description + "Lifecycle state of ETH service."; + /* Add default as installed */ + } + uses te-types:te-topology-identifier; + + uses resilience-grouping; + list etht-svc-end-points { + key etht-svc-end-point-name; + description + "The logical end point for the ETH service. "; + uses etht-svc-end-point-grouping; + } + + container alarm-shreshold { + description "threshold configuration for the E2E client signal"; + uses alarm-shreshold-grouping; + } + + container underlay { + description + "The unterlay tunnel information that carrying the + ETH service. "; + uses etht-svc-tunnel-parameters; + } + + leaf admin-status { + type identityref { + base te-types:tunnel-admin-state-type; + } + default te-types:tunnel-admin-state-up; + description "ETH service administrative state."; + } + } + + grouping etht-svc-instance-state { + description + "State parameters for Ethernet services."; + + leaf operational-state { + type identityref { + base te-types:tunnel-state-type; + } + default te-types:tunnel-state-up; + description "ETH service operational state."; + } + leaf provisioning-state { + type identityref { + base te-types:lsp-state-type; + } + description "ETH service provisioning state."; + } + leaf creation-time { + type yang:date-and-time; + description + "Time of ETH service creation."; + } + leaf last-updated-time { + type yang:date-and-time; + description + "Time of ETH service last update."; + } + + leaf created-by { + type string; + description + "The client signal is created by whom, + can be a system or staff ID."; + } + leaf last-updated-by { + type string; + description + "The client signal is last updated by whom, + can be a system or staff ID."; + } + leaf owned-by { + type string; + description + "The client signal is last updated by whom, + can be a system ID."; + } + container pm-state { + description + "PM data of E2E Ethernet service"; + uses pm-state-grouping; + } + container error-info { + description "error messages of configuration"; + uses error-info-grouping; + } + } + + grouping pm-state-grouping { + leaf latency { + description + "latency value of the E2E Ethernet service"; + type uint32; + units microsecond; + } + } + + grouping error-info-grouping { + leaf error-code { + description "error code"; + type uint16; + } + + leaf error-description { + description "detail message of error"; + type string; + } + + leaf error-timestamp { + description "the date and time error is happened"; + type yang:date-and-time; + } + } + + grouping alarm-shreshold-grouping { + leaf latency-threshold { + description "a threshold for the E2E client signal service's + latency. Once the latency value exceed this threshold, an alarm + should be triggered."; + type uint32; + units microsecond; + } + } + + /* + * Data nodes + */ + + container etht-svc { + description + "ETH services."; + + container globals { + description + "Globals Ethernet configuration data container"; + list named-bandwidth-profiles { + key bandwidth-profile-name; + description + "List of named bandwidth profiles used by + Ethernet services."; + + leaf bandwidth-profile-name { + type string; + description + "Name of the bandwidth profile."; + } + uses etht-types:etht-bandwidth-profiles; + } + } + list etht-svc-instances { + key etht-svc-name; + description + "The list of p2p ETH service instances"; + + uses etht-svc-instance-config; + + container state { + config false; + description + "Ethernet Service states."; + + uses etht-svc-instance-state; + } + } + } + + grouping resilience-grouping { + description + "Grouping for resilience configuration. "; + container resilience { + description + "To configure the data plane protection parameters, + currently a placeholder only, future candidate attributes + include, Revert, WTR, Hold-off Timer, ..."; + uses te:protection-restoration-properties; + } + } + + grouping etht-svc-end-point-grouping { + description + "Grouping for the end point configuration."; + leaf etht-svc-end-point-name { + type string; + description + "The name of the logical end point of ETH service. "; + } + + leaf etht-svc-end-point-id { + type string; + description + "The identifier of the logical end point of ETH service."; + } + + leaf etht-svc-end-point-descr { + type string; + description + "The description of the logical end point of ETH service. "; + } + + leaf topology-role { + type identityref { + base etht-types:topology-role; + } + description + "Indicating the underlay topology role, + e.g., hub,spoke, any-to-any "; + } + + container resilience { + description + "Placeholder for resilience configuration, for future study. "; + } + + list etht-svc-access-points { + key access-point-id; + min-elements "1"; + /* + Open Issue: + Is it possible to limit the max-elements only for p2p services? + max-elements "2"; + */ + description + "List of the ETH trasport services access point instances."; + + leaf access-point-id { + type string; + description + "ID of the service access point instance"; + } + uses etht-svc-access-parameters; + } + + leaf service-classification-type { + type identityref { + base etht-types:service-classification-type; + } + description + "Service classification type."; + } + + choice service-classification { + description + "Access classification can be port-based or + VLAN based."; + case port-classification { + /* no additional information */ + } + + case vlan-classification { + container outer-tag { + presence "The outermost VLAN tag exists"; + description + "Classifies traffic using the outermost VLAN tag."; + + uses vlan-classification; + } + container second-tag { + must + '../outer-tag/tag-type = "etht-types:classify-s-vlan" and ' + + 'tag-type = "etht-types:classify-c-vlan"' + { + error-message + " + When matching two tags, the outermost tag must be + specified and of S-VLAN type and the second + outermost tag must be of C-VLAN tag type. + "; + description + " + For IEEE 802.1Q interoperability, when matching two + tags, it is required that the outermost tag exists + and is an S-VLAN, and the second outermost tag is a + C-VLAN. + "; + } + presence "The second outermost VLAN tag exists"; + + description + "Classifies traffic using the second outermost VLAN tag."; + + uses vlan-classification; + } + } + } + + /* + * Open issue: can we constraints it to be used only with mp services? + */ + leaf split-horizon-group { + type string; + description "Identify a split horizon group"; + } + uses bandwidth-profiles; + + container vlan-operations { + description + "Configuration of VLAN operations."; + choice direction { + description + "Whether the VLAN operations are symmetrical or + asymmetrical"; + case symmetrical { + container symmetrical-operation { + uses vlan-operations; + description + "Symmetrical operations. + Expressed in the ingress direction, but + the reverse operation is applied to egress traffic"; + } + } + case asymmetrical { + container asymmetrical-operation { + description "Asymmetrical operations"; + container ingress { + uses vlan-operations; + description "Ingress operations"; + } + container egress { + uses vlan-operations; + description "Egress operations"; + } + } + } + } + } + } + + grouping pm-config-grouping { + description + "Grouping used for Performance Monitoring Configuration. "; + leaf pm-enable { + type boolean; + description + "Whether to enable the performance monitoring."; + } + + leaf sending-rate-high { + type uint64; + description + "The upperbound of sending rate."; + } + + leaf sending-rate-low { + type uint64; + description + "The lowerbound of sending rate."; + } + + leaf receiving-rate-high { + type uint64; + description + "The upperbound of receiving rate."; + } + + leaf receiving-rate-low { + type uint64; + description + "The lowerbound of receiving rate."; + } + } + + grouping pw-segment-grouping { + description + "Grouping used for PW configuration. "; + leaf pw-id { + type string; + description + "The Identifier information of pseudowire. "; + } + + leaf pw-name { + type string; + description + "The name information of pseudowire."; + } + + leaf transmit-label { + type rt-types:mpls-label; + description + "Transmit label information in PW. "; + } + + leaf receive-label { + type rt-types:mpls-label; + description + "Receive label information in PW. "; + } + leaf encapsulation-type { + type identityref { + base etht-types:encapsulation-type; + } + description + "The encapsulation type, raw or tag. "; + } + + leaf oper-status { + type identityref { + base te-types:tunnel-state-type; + } + config false; + description + "The operational state of the PW segment. "; + } + + container ingress-bandwidth-profile { + description + "Bandwidth Profile for ingress. "; + uses pw-segment-named-or-value-bandwidth-profile; + } + + list pw-paths { + key path-id; + description + "A list of pw paths. "; + + leaf path-id { + type uint8; + description + "The identifier of pw paths. "; + + } + + list tp-tunnels { + key name; + description + "Names of TP Tunnel underlay"; + leaf name { + type string; + description + "Names of TP Tunnel underlay"; + } + } + } + + } + grouping pw-segment-named-or-value-bandwidth-profile { + description + "A grouping to configure a bandwdith profile either by + referencing a named bandwidth profile or by + configuring the values of the bandwidth profile attributes."; + choice style { + description + "Whether the bandwidth profile is named or defined by value"; + case named { + description + "Named bandwidth profile."; + leaf bandwidth-profile-name { + type leafref { + path "/ethtsvc:etht-svc/ethtsvc:globals/" + + "ethtsvc:named-bandwidth-profiles/" + + "ethtsvc:bandwidth-profile-name"; + } + description + "Name of the bandwidth profile."; + } + } + case value { + description + "Bandwidth profile configured by value."; + uses etht-types:pw-segement-bandwidth-profile-grouping; + } + } + } + + grouping tunnels-grouping { + description + "A group of tunnels. "; + leaf name { + type leafref { + path "/te:te/te:tunnels/te:tunnel/te:name"; + require-instance false; + } + description "Dependency tunnel name"; + } + leaf encoding { + type identityref { + base te-types:lsp-encoding-types; + } + description "LSP encoding type"; + reference "RFC3945"; + } + leaf switching-type { + type identityref { + base te-types:switching-capabilities; + } + description "LSP switching type"; + reference "RFC3945"; + } + } + } diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/yang/ietf-eth-tran-types@2023-10-23.yang b/src/nbi/service/rest_server/nbi_plugins/ietf_network/yang/ietf-eth-tran-types@2023-10-23.yang new file mode 100644 index 0000000000000000000000000000000000000000..f46908b34f3cc30a0b19359c032a7cd8856b1b08 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/yang/ietf-eth-tran-types@2023-10-23.yang @@ -0,0 +1,457 @@ + module ietf-eth-tran-types { + yang-version 1.1; + namespace "urn:ietf:params:xml:ns:yang:ietf-eth-tran-types"; + + prefix "etht-types"; + + organization + "Internet Engineering Task Force (IETF) CCAMP WG"; + contact + " + WG List: + + ID-draft editor: + Haomian Zheng (zhenghaomian@huawei.com); + Italo Busi (italo.busi@huawei.com); + Aihua Guo (aihuaguo.ietf@gmail.com); + Anton Snitser (antons@sedonasys.com); + Francesco Lazzeri (francesco.lazzeri@ericsson.com); + Yunbin Xu (xuyunbin@caict.ac.cn); + Yang Zhao (zhaoyangyjy@chinamobile.com); + Xufeng Liu (xufeng.liu.ietf@gmail.com); + Giuseppe Fioccola (giuseppe.fioccola@huawei.com); + Chaode Yu (yuchaode@huawei.com) + "; + + description + "This module defines the ETH types. + The model fully conforms to the Network Management + Datastore Architecture (NMDA). + + Copyright (c) 2019 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 + (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 2023-10-23 { + description + "version -05 as a WG draft"; + reference + "draft-ietf-ccamp-client-signal-yang"; + } + + /* + * Identities + */ + + identity eth-vlan-tag-type { + description + "ETH VLAN tag type."; + } + + identity c-vlan-tag-type { + base eth-vlan-tag-type; + description + "802.1Q Customer VLAN"; + } + + identity s-vlan-tag-type { + base eth-vlan-tag-type; + description + "802.1Q Service VLAN (QinQ)"; + } + + identity service-classification-type { + description + "Service classification."; + } + + identity port-classification { + base service-classification-type; + description + "Port classification."; + } + identity vlan-classification { + base service-classification-type; + description + "VLAN classification."; + } + + identity eth-vlan-tag-classify { + description + "VLAN tag classification."; + } + + identity classify-c-vlan { + base eth-vlan-tag-classify; + description + "Classify 802.1Q Customer VLAN tag. + Only C-tag type is accepted"; + } + + identity classify-s-vlan { + base eth-vlan-tag-classify; + description + "Classify 802.1Q Service VLAN (QinQ) tag. + Only S-tag type is accepted"; + } + + identity classify-s-or-c-vlan { + base eth-vlan-tag-classify; + description + "Classify S-VLAN or C-VLAN tag-classify. + Either tag is accepted"; + } + + identity bandwidth-profile-type-ir { + description + "Bandwidth Profile Types"; + } + + identity mef-10-bwp { + base bandwidth-profile-type-ir; + description + "MEF 10 Bandwidth Profile"; + } + + identity rfc-2697-bwp { + base bandwidth-profile-type-ir; + description + "RFC 2697 Bandwidth Profile"; + } + identity rfc-2698-bwp { + base bandwidth-profile-type-ir; + description + "RFC 2698 Bandwidth Profile"; + } + + identity rfc-4115-bwp { + base bandwidth-profile-type-ir; + description + "RFC 4115 Bandwidth Profile"; + } + + identity service-type-ir { + description + "Type of Ethernet service."; + } + + identity p2p-svc { + base service-type-ir; + description + "Ethernet point-to-point service (EPL, EVPL)."; + } + + identity rmp-svc { + base service-type-ir; + description + "Ethernet rooted-multitpoint service (E-TREE, EP-TREE)."; + } + + identity mp2mp-svc { + base service-type-ir; + description + "Ethernet multipoint-to-multitpoint service (E-LAN, EP-LAN)."; + } + + identity lifecycle-status-ir { + description + "Lifecycle Status."; + } + + identity installed { + base lifecycle-status-ir; + description + "Installed."; + } + + identity planned { + base lifecycle-status-ir; + description + "Planned."; + } + + identity pending-removal { + base lifecycle-status-ir; + description + "Pending Removal."; + } + + /* + * Type Definitions + */ + + typedef eth-tag-type { + type identityref { + base eth-vlan-tag-type; + } + description + "Identifies a specific ETH VLAN tag type."; + } + + typedef eth-tag-classify { + type identityref { + base eth-vlan-tag-classify; + } + description + "Identifies a specific VLAN tag classification."; + } + + typedef vlanid { + type uint16 { + range "1..4094"; + } + description + "The 12-bit VLAN-ID used in the VLAN Tag header."; + } + + typedef vid-range-type { + type string { + pattern "([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?" + + "(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)"; + } + description + "A list of VLAN Ids, or non overlapping VLAN ranges, in + ascending order, between 1 and 4094. + This type is used to match an ordered list of VLAN Ids, or + contiguous ranges of VLAN Ids. Valid VLAN Ids must be in the + range 1 to 4094, and included in the list in non overlapping + ascending order. + + For example: 1,10-100,50,500-1000"; + } + + typedef bandwidth-profile-type { + type identityref { + base bandwidth-profile-type-ir; + } + description + "Identifies a specific Bandwidth Profile type."; + } + + typedef service-type { + type identityref { + base service-type-ir; + } + description + "Identifies the type of Ethernet service."; + } + + typedef lifecycle-status { + type identityref { + base lifecycle-status-ir; + } + description + "Identifies the lLifecycle Status ."; + } + + /* + * Grouping Definitions + */ + + grouping etht-bandwidth-profiles { + description + "Bandwidth profile configuration paramters."; + + leaf bandwidth-profile-type { + type etht-types:bandwidth-profile-type; + description + "The type of bandwidth profile."; + } + leaf CIR { + type uint64; + description + "Committed Information Rate in Kbps"; + } + leaf CBS { + type uint64; + description + "Committed Burst Size in in KBytes"; + } + leaf EIR { + type uint64; + /* Need to indicate that EIR is not supported by RFC 2697 + + must + '../bw-profile-type = "mef-10-bwp" or ' + + '../bw-profile-type = "rfc-2698-bwp" or ' + + '../bw-profile-type = "rfc-4115-bwp"' + + must + '../bw-profile-type != "rfc-2697-bwp"' + */ + description + "Excess Information Rate in Kbps + In case of RFC 2698, PIR = CIR + EIR"; + } + leaf EBS { + type uint64; + description + "Excess Burst Size in KBytes. + In case of RFC 2698, PBS = CBS + EBS"; + } + leaf color-aware { + type boolean; + description + "Indicates weather the color-mode is + color-aware or color-blind."; + } + leaf coupling-flag { + type boolean; + /* Need to indicate that Coupling Flag is defined only for MEF 10 + + must + '../bw-profile-type = "mef-10-bwp"' + */ + description + "Coupling Flag."; + } + } + + identity topology-role { + description + "The role of underlay topology: e.g., hub, spoke, + any-to-any."; + } + + identity resilience { + description + "Placeholder for resilience information in data plane, + for future study. "; + } + + identity access-role { + description + "Indicating whether the access is a working or protection access."; + } + + identity root-primary { + base access-role; + description + "Designates the primary root UNI of an E-Tree service, and may also + designates the UNI access role of E-LINE and E-LAN service."; + } + + identity root-backup { + base access-role; + description + "Designates the backup root UNI of an E-Tree service."; + } + + identity leaf-access { + base access-role; + description + "Designates the leaf UNI of an E-Tree service."; + } + + identity leaf-edge { + base access-role; + description ""; + } + + identity performance { + description + "Placeholder for performance information, for future study."; + } + + identity encapsulation-type { + description + "Indicating how the service is encapsulated (to PW), e.g, raw or tag. "; + } + grouping pw-segement-bandwidth-profile-grouping { + description + "bandwidth profile grouping for PW segment. "; + leaf bandwidth-profile-type { + type etht-types:bandwidth-profile-type; + description + "The type of bandwidth profile."; + } + leaf CIR { + type uint64; + description + "Committed Information Rate in Kbps"; + } + leaf CBS { + type uint64; + description + "Committed Burst Size in in KBytes"; + } + leaf EIR { + type uint64; + /* Need to indicate that EIR is not supported by RFC 2697 + + must + '../bw-profile-type = "mef-10-bwp" or ' + + '../bw-profile-type = "rfc-2698-bwp" or ' + + '../bw-profile-type = "rfc-4115-bwp"' + + must + '../bw-profile-type != "rfc-2697-bwp"' + */ + description + "Excess Information Rate in Kbps + In case of RFC 2698, PIR = CIR + EIR"; + } + leaf EBS { + type uint64; + description + "Excess Burst Size in KBytes. + In case of RFC 2698, PBS = CBS + EBS"; + } + } + grouping eth-bandwidth { + description + "Available bandwith for ethernet."; + leaf eth-bandwidth { + type uint64{ + range "0..10000000000"; + } + units "Kbps"; + description + "Available bandwith value expressed in kilobits per second"; + } + } + + grouping eth-label-restriction { + description + "Label Restriction for ethernet."; + leaf tag-type { + type etht-types:eth-tag-type; + description "VLAN tag type."; + } + leaf priority { + type uint8; + description "priority."; + } + } + grouping eth-label { + description + "Label for ethernet."; + leaf vlanid { + type etht-types:vlanid; + description + "VLAN tag id."; + } + } + + grouping eth-label-step { + description "Label step for Ethernet VLAN"; + leaf eth-step { + type uint16 { + range "1..4095"; + } + default 1; + description + "Label step which represent possible increments for + an Ethernet VLAN tag."; + reference + "IEEE 802.1ad: Provider Bridges."; + } + } + } diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/yang/ietf-inet-types@2013-07-15.yang b/src/nbi/service/rest_server/nbi_plugins/ietf_network/yang/ietf-inet-types@2013-07-15.yang new file mode 100644 index 0000000000000000000000000000000000000000..790bafc31dd7dc3582ef1c765fe104145b8a6016 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/yang/ietf-inet-types@2013-07-15.yang @@ -0,0 +1,459 @@ + module ietf-inet-types { + + namespace "urn:ietf:params:xml:ns:yang:ietf-inet-types"; + prefix "inet"; + + organization + "IETF NETMOD (NETCONF Data Modeling Language) Working Group"; + + contact + "WG Web: + WG List: + + WG Chair: David Kessens + + + WG Chair: Juergen Schoenwaelder + + + Editor: Juergen Schoenwaelder + "; + + description + "This module contains a collection of generally useful derived + YANG data types for Internet addresses and related things. + + Copyright (c) 2013 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). + + This version of this YANG module is part of RFC 6991; see + the RFC itself for full legal notices."; + + revision 2013-07-15 { + description + "This revision adds the following new data types: + - ip-address-no-zone + - ipv4-address-no-zone + - ipv6-address-no-zone"; + reference + "RFC 6991: Common YANG Data Types"; + } + + revision 2010-09-24 { + description + "Initial revision."; + reference + "RFC 6021: Common YANG Data Types"; + } + + /*** collection of types related to protocol fields ***/ + + typedef ip-version { + type enumeration { + enum unknown { + value "0"; + description + "An unknown or unspecified version of the Internet + protocol."; + } + enum ipv4 { + value "1"; + description + "The IPv4 protocol as defined in RFC 791."; + } + enum ipv6 { + value "2"; + description + "The IPv6 protocol as defined in RFC 2460."; + } + } + description + "This value represents the version of the IP protocol. + + In the value set and its semantics, this type is equivalent + to the InetVersion textual convention of the SMIv2."; + reference + "RFC 791: Internet Protocol + RFC 2460: Internet Protocol, Version 6 (IPv6) Specification + RFC 4001: Textual Conventions for Internet Network Addresses"; + } + + typedef dscp { + type uint8 { + range "0..63"; + } + description + "The dscp type represents a Differentiated Services Code Point + that may be used for marking packets in a traffic stream. + + In the value set and its semantics, this type is equivalent + to the Dscp textual convention of the SMIv2."; + reference + "RFC 3289: Management Information Base for the Differentiated + Services Architecture + RFC 2474: Definition of the Differentiated Services Field + (DS Field) in the IPv4 and IPv6 Headers + RFC 2780: IANA Allocation Guidelines For Values In + the Internet Protocol and Related Headers"; + } + + typedef ipv6-flow-label { + type uint32 { + range "0..1048575"; + } + description + "The ipv6-flow-label type represents the flow identifier or Flow + Label in an IPv6 packet header that may be used to + discriminate traffic flows. + + In the value set and its semantics, this type is equivalent + to the IPv6FlowLabel textual convention of the SMIv2."; + reference + "RFC 3595: Textual Conventions for IPv6 Flow Label + RFC 2460: Internet Protocol, Version 6 (IPv6) Specification"; + } + + typedef port-number { + type uint16 { + range "0..65535"; + } + description + "The port-number type represents a 16-bit port number of an + Internet transport-layer protocol such as UDP, TCP, DCCP, or + SCTP. Port numbers are assigned by IANA. A current list of + all assignments is available from . + + Note that the port number value zero is reserved by IANA. In + situations where the value zero does not make sense, it can + be excluded by subtyping the port-number type. + In the value set and its semantics, this type is equivalent + to the InetPortNumber textual convention of the SMIv2."; + reference + "RFC 768: User Datagram Protocol + RFC 793: Transmission Control Protocol + RFC 4960: Stream Control Transmission Protocol + RFC 4340: Datagram Congestion Control Protocol (DCCP) + RFC 4001: Textual Conventions for Internet Network Addresses"; + } + + /*** collection of types related to autonomous systems ***/ + + typedef as-number { + type uint32; + description + "The as-number type represents autonomous system numbers + which identify an Autonomous System (AS). An AS is a set + of routers under a single technical administration, using + an interior gateway protocol and common metrics to route + packets within the AS, and using an exterior gateway + protocol to route packets to other ASes. IANA maintains + the AS number space and has delegated large parts to the + regional registries. + + Autonomous system numbers were originally limited to 16 + bits. BGP extensions have enlarged the autonomous system + number space to 32 bits. This type therefore uses an uint32 + base type without a range restriction in order to support + a larger autonomous system number space. + + In the value set and its semantics, this type is equivalent + to the InetAutonomousSystemNumber textual convention of + the SMIv2."; + reference + "RFC 1930: Guidelines for creation, selection, and registration + of an Autonomous System (AS) + RFC 4271: A Border Gateway Protocol 4 (BGP-4) + RFC 4001: Textual Conventions for Internet Network Addresses + RFC 6793: BGP Support for Four-Octet Autonomous System (AS) + Number Space"; + } + + /*** collection of types related to IP addresses and hostnames ***/ + + typedef ip-address { + type union { + type inet:ipv4-address; + type inet:ipv6-address; + } + description + "The ip-address type represents an IP address and is IP + version neutral. The format of the textual representation + implies the IP version. This type supports scoped addresses + by allowing zone identifiers in the address format."; + reference + "RFC 4007: IPv6 Scoped Address Architecture"; + } + + typedef ipv4-address { + type string { + pattern + '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.){3}' + + '([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])' + + '(%[\p{N}\p{L}]+)?'; + } + description + "The ipv4-address type represents an IPv4 address in + dotted-quad notation. The IPv4 address may include a zone + index, separated by a % sign. + + The zone index is used to disambiguate identical address + values. For link-local addresses, the zone index will + typically be the interface index number or the name of an + interface. If the zone index is not present, the default + zone of the device will be used. + + The canonical format for the zone index is the numerical + format"; + } + + typedef ipv6-address { + type string { + pattern '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}' + + '((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|' + + '(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\.){3}' + + '(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))' + + '(%[\p{N}\p{L}]+)?'; + pattern '(([^:]+:){6}(([^:]+:[^:]+)|(.*\..*)))|' + + '((([^:]+:)*[^:]+)?::(([^:]+:)*[^:]+)?)' + + '(%.+)?'; + } + description + "The ipv6-address type represents an IPv6 address in full, + mixed, shortened, and shortened-mixed notation. The IPv6 + address may include a zone index, separated by a % sign. + + The zone index is used to disambiguate identical address + values. For link-local addresses, the zone index will + typically be the interface index number or the name of an + interface. If the zone index is not present, the default + zone of the device will be used. + + The canonical format of IPv6 addresses uses the textual + representation defined in Section 4 of RFC 5952. The + canonical format for the zone index is the numerical + format as described in Section 11.2 of RFC 4007."; + reference + "RFC 4291: IP Version 6 Addressing Architecture + RFC 4007: IPv6 Scoped Address Architecture + RFC 5952: A Recommendation for IPv6 Address Text + Representation"; + } + + typedef ip-address-no-zone { + type union { + type inet:ipv4-address-no-zone; + type inet:ipv6-address-no-zone; + } + description + "The ip-address-no-zone type represents an IP address and is + IP version neutral. The format of the textual representation + implies the IP version. This type does not support scoped + addresses since it does not allow zone identifiers in the + address format."; + reference + "RFC 4007: IPv6 Scoped Address Architecture"; + } + + typedef ipv4-address-no-zone { + type inet:ipv4-address { + pattern '[0-9\.]*'; + } + description + "An IPv4 address without a zone index. This type, derived from + ipv4-address, may be used in situations where the zone is + known from the context and hence no zone index is needed."; + } + + typedef ipv6-address-no-zone { + type inet:ipv6-address { + pattern '[0-9a-fA-F:\.]*'; + } + description + "An IPv6 address without a zone index. This type, derived from + ipv6-address, may be used in situations where the zone is + known from the context and hence no zone index is needed."; + reference + "RFC 4291: IP Version 6 Addressing Architecture + RFC 4007: IPv6 Scoped Address Architecture + RFC 5952: A Recommendation for IPv6 Address Text + Representation"; + } + + typedef ip-prefix { + type union { + type inet:ipv4-prefix; + type inet:ipv6-prefix; + } + description + "The ip-prefix type represents an IP prefix and is IP + version neutral. The format of the textual representations + implies the IP version."; + } + + typedef ipv4-prefix { + type string { + pattern + '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.){3}' + + '([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])' + + '/(([0-9])|([1-2][0-9])|(3[0-2]))'; + } + description + "The ipv4-prefix type represents an IPv4 address prefix. + The prefix length is given by the number following the + slash character and must be less than or equal to 32. + + A prefix length value of n corresponds to an IP address + mask that has n contiguous 1-bits from the most + significant bit (MSB) and all other bits set to 0. + + The canonical format of an IPv4 prefix has all bits of + the IPv4 address set to zero that are not part of the + IPv4 prefix."; + } + + typedef ipv6-prefix { + type string { + pattern '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}' + + '((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|' + + '(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\.){3}' + + '(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))' + + '(/(([0-9])|([0-9]{2})|(1[0-1][0-9])|(12[0-8])))'; + pattern '(([^:]+:){6}(([^:]+:[^:]+)|(.*\..*)))|' + + '((([^:]+:)*[^:]+)?::(([^:]+:)*[^:]+)?)' + + '(/.+)'; + } + + description + "The ipv6-prefix type represents an IPv6 address prefix. + The prefix length is given by the number following the + slash character and must be less than or equal to 128. + + A prefix length value of n corresponds to an IP address + mask that has n contiguous 1-bits from the most + significant bit (MSB) and all other bits set to 0. + + The IPv6 address should have all bits that do not belong + to the prefix set to zero. + + The canonical format of an IPv6 prefix has all bits of + the IPv6 address set to zero that are not part of the + IPv6 prefix. Furthermore, the IPv6 address is represented + as defined in Section 4 of RFC 5952."; + reference + "RFC 5952: A Recommendation for IPv6 Address Text + Representation"; + } + + /*** collection of domain name and URI types ***/ + + typedef domain-name { + type string { + pattern + '((([a-zA-Z0-9_]([a-zA-Z0-9\-_]){0,61})?[a-zA-Z0-9]\.)*' + + '([a-zA-Z0-9_]([a-zA-Z0-9\-_]){0,61})?[a-zA-Z0-9]\.?)' + + '|\.'; + length "1..253"; + } + description + "The domain-name type represents a DNS domain name. The + name SHOULD be fully qualified whenever possible. + + Internet domain names are only loosely specified. Section + 3.5 of RFC 1034 recommends a syntax (modified in Section + 2.1 of RFC 1123). The pattern above is intended to allow + for current practice in domain name use, and some possible + future expansion. It is designed to hold various types of + domain names, including names used for A or AAAA records + (host names) and other records, such as SRV records. Note + that Internet host names have a stricter syntax (described + in RFC 952) than the DNS recommendations in RFCs 1034 and + 1123, and that systems that want to store host names in + schema nodes using the domain-name type are recommended to + adhere to this stricter standard to ensure interoperability. + + The encoding of DNS names in the DNS protocol is limited + to 255 characters. Since the encoding consists of labels + prefixed by a length bytes and there is a trailing NULL + byte, only 253 characters can appear in the textual dotted + notation. + + The description clause of schema nodes using the domain-name + type MUST describe when and how these names are resolved to + IP addresses. Note that the resolution of a domain-name value + may require to query multiple DNS records (e.g., A for IPv4 + and AAAA for IPv6). The order of the resolution process and + which DNS record takes precedence can either be defined + explicitly or may depend on the configuration of the + resolver. + + Domain-name values use the US-ASCII encoding. Their canonical + format uses lowercase US-ASCII characters. Internationalized + domain names MUST be A-labels as per RFC 5890."; + reference + "RFC 952: DoD Internet Host Table Specification + RFC 1034: Domain Names - Concepts and Facilities + RFC 1123: Requirements for Internet Hosts -- Application + and Support + RFC 2782: A DNS RR for specifying the location of services + (DNS SRV) + RFC 5890: Internationalized Domain Names in Applications + (IDNA): Definitions and Document Framework"; + } + + typedef host { + type union { + type inet:ip-address; + type inet:domain-name; + } + description + "The host type represents either an IP address or a DNS + domain name."; + } + + typedef uri { + type string; + description + "The uri type represents a Uniform Resource Identifier + (URI) as defined by STD 66. + + Objects using the uri type MUST be in US-ASCII encoding, + and MUST be normalized as described by RFC 3986 Sections + 6.2.1, 6.2.2.1, and 6.2.2.2. All unnecessary + percent-encoding is removed, and all case-insensitive + characters are set to lowercase except for hexadecimal + digits, which are normalized to uppercase as described in + Section 6.2.2.1. + + The purpose of this normalization is to help provide + unique URIs. Note that this normalization is not + sufficient to provide uniqueness. Two URIs that are + textually distinct after this normalization may still be + equivalent. + + Objects using the uri type may restrict the schemes that + they permit. For example, 'data:' and 'urn:' schemes + might not be appropriate. + + A zero-length URI is not a valid URI. This can be used to + express 'URI absent' where required. + + In the value set and its semantics, this type is equivalent + to the Uri SMIv2 textual convention defined in RFC 5017."; + reference + "RFC 3986: Uniform Resource Identifier (URI): Generic Syntax + RFC 3305: Report from the Joint W3C/IETF URI Planning Interest + Group: Uniform Resource Identifiers (URIs), URLs, + and Uniform Resource Names (URNs): Clarifications + and Recommendations + RFC 5017: MIB Textual Conventions for Uniform Resource + Identifiers (URIs)"; + } + + } diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/yang/ietf-layer1-types@2022-10-14.yang b/src/nbi/service/rest_server/nbi_plugins/ietf_network/yang/ietf-layer1-types@2022-10-14.yang new file mode 100644 index 0000000000000000000000000000000000000000..188336931c36000b287bad5258550e7d3fa7016b --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/yang/ietf-layer1-types@2022-10-14.yang @@ -0,0 +1,1414 @@ + module ietf-layer1-types { + yang-version 1.1; + namespace "urn:ietf:params:xml:ns:yang:ietf-layer1-types"; + prefix "l1-types"; + + import ietf-routing-types { + prefix rt-types; + reference + "RFC 8294: Common YANG Data Types for the Routing Area"; + } + + organization + "IETF CCAMP Working Group"; + contact + "WG Web: + WG List: + + Editor: Haomian Zheng + + + Editor: Italo Busi + "; + + description + "This module defines Layer 1 types. The model fully conforms + to the Network Management Datastore Architecture (NMDA). + + 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. + + The key words 'MUST', 'MUST NOT', 'REQUIRED', 'SHALL', 'SHALL + NOT', 'SHOULD', 'SHOULD NOT', 'RECOMMENDED', 'NOT RECOMMENDED', + 'MAY', and 'OPTIONAL' in this document are to be interpreted as + described in BCP 14 (RFC 2119) (RFC 8174) when, and only when, + + + + + they appear in all capitals, as shown here."; + + revision "2022-10-14" { + description + "Initial Version"; + reference + "RFC XXXX: A YANG Data Model for Layer 1 Types"; + // RFC Editor: replace XXXX with actual RFC number, update date + // information and remove this note + } + + /* + * Identities + */ + + identity tributary-slot-granularity { + description + "Tributary Slot Granularity (TSG)"; + reference + "ITU-T G.709 v6.0 (06/2020): Interfaces for the Optical + Transport Network (OTN)"; + } + + identity tsg-1.25G { + base tributary-slot-granularity; + description + "1.25G tributary slot granularity"; + } + + identity tsg-2.5G { + base tributary-slot-granularity; + description + "2.5G tributary slot granularity"; + } + + identity tsg-5G { + base tributary-slot-granularity; + description + "5G tributary slot granularity"; + } + + identity odu-type { + description + "Base identity from which specific Optical Data Unit (ODU) + type is derived."; + reference + "RFC7139: GMPLS Signaling Extensions for Control of Evolving + G.709 Optical Transport Networks + + + + + ITU-T G.709 v6.0 (06/2020): Interfaces for the Optical + Transport Network (OTN)"; + } + + identity ODU0 { + base odu-type; + description + "ODU0 type (1.24Gb/s)."; + reference + "RFC7139: GMPLS Signaling Extensions for Control of Evolving + G.709 Optical Transport Networks + + ITU-T G.709 v6.0 (06/2020): Interfaces for the Optical + Transport Network (OTN)"; + } + + identity ODU1 { + base odu-type; + description + "ODU1 type (2.49Gb/s)."; + reference + "RFC7139: GMPLS Signaling Extensions for Control of Evolving + G.709 Optical Transport Networks + + ITU-T G.709 v6.0 (06/2020): Interfaces for the Optical + Transport Network (OTN)"; + } + + identity ODU2 { + base odu-type; + description + "ODU2 type (10.03Gb/s)."; + reference + "RFC7139: GMPLS Signaling Extensions for Control of Evolving + G.709 Optical Transport Networks + + ITU-T G.709 v6.0 (06/2020): Interfaces for the Optical + Transport Network (OTN)"; + } + + identity ODU2e { + base odu-type; + description + "ODU2e type (10.39Gb/s)."; + reference + "RFC7139: GMPLS Signaling Extensions for Control of Evolving + G.709 Optical Transport Networks + + + + + ITU-T G.709 v6.0 (06/2020): Interfaces for the Optical + Transport Network (OTN)"; + } + + identity ODU3 { + base odu-type; + description + "ODU3 type (40.31Gb/s)."; + reference + "RFC7139: GMPLS Signaling Extensions for Control of Evolving + G.709 Optical Transport Networks + + ITU-T G.709 v6.0 (06/2020): Interfaces for the Optical + Transport Network (OTN)"; + } + + identity ODU4 { + base odu-type; + description + "ODU4 type (104.79Gb/s)."; + reference + "RFC7139: GMPLS Signaling Extensions for Control of Evolving + G.709 Optical Transport Networks + + ITU-T G.709 v6.0 (06/2020): Interfaces for the Optical + Transport Network (OTN)"; + } + + identity ODUflex { + base odu-type; + description + "ODUflex type (flexible bit rate, not resizable). + + It could be used for any type of ODUflex, including + ODUflex(CBR), ODUflex(GFP), ODUflex(GFP,n,k), ODUflex(IMP,s), + ODUflex(IMP) and ODUflex(FlexE-aware)."; + reference + "RFC7139: GMPLS Signaling Extensions for Control of Evolving + G.709 Optical Transport Networks + + ITU-T G.709 v6.0 (06/2020): Interfaces for the Optical + Transport Network (OTN)"; + } + + identity ODUflex-resizable { + base odu-type; + description + "ODUflex protocol (flexible bit rate, resizable). + + + + + It could be used only for ODUflex(GFP,n,k)."; + reference + "RFC7139: GMPLS Signaling Extensions for Control of Evolving + G.709 Optical Transport Networks + + ITU-T G.709 v6.0 (06/2020): Interfaces for the Optical + Transport Network (OTN)"; + } + + identity protocol { + description + "Base identity from which specific protocol is derived."; + reference + "MEF63: Subscriber Layer 1 Service Attributes"; + } + + identity Ethernet { + base protocol; + description + "Ethernet protocol."; + reference + "MEF63: Subscriber Layer 1 Service Attributes"; + } + + identity Fibre-Channel { + base protocol; + description + "Fibre-Channel (FC) protocol."; + reference + "MEF63: Subscriber Layer 1 Service Attributes"; + } + + identity SDH { + base protocol; + description + "SDH protocol."; + reference + "MEF63: Subscriber Layer 1 Service Attributes"; + } + + identity SONET { + base protocol; + description + "SONET protocol."; + reference + "MEF63: Subscriber Layer 1 Service Attributes"; + } + + + + + identity client-signal { + description + "Base identity from which specific Constant Bit Rate (CBR) + client signal is derived"; + } + + identity coding-func { + description + "Base identity from which specific coding function + is derived."; + reference + "MEF63: Subscriber Layer 1 Service Attributes"; + } + + identity ETH-1Gb { + base client-signal; + description + "Client signal type of 1GbE"; + reference + "RFC7139: GMPLS Signaling Extensions for Control of Evolving + G.709 Optical Transport Networks + + ITU-T G.709 v6.0 (06/2020): Interfaces for the Optical + Transport Network (OTN)"; + } + + identity ETH-10Gb-LAN { + base client-signal; + description + "Client signal type of ETH-10Gb-LAN (10.3 Gb/s)"; + reference + "RFC7139: GMPLS Signaling Extensions for Control of Evolving + G.709 Optical Transport Networks + + ITU-T G.709 v6.0 (06/2020): Interfaces for the Optical + Transport Network (OTN) + + IEEE 802.3-2018, Clause 49: IEEE Standard for Ethernet"; + } + + identity ETH-10Gb-WAN { + base client-signal; + description + "Client signal type of ETH-10Gb-WAN (9.95 Gb/s)"; + reference + "RFC7139: GMPLS Signaling Extensions for Control of Evolving + G.709 Optical Transport Networks + + + + + ITU-T G.709 v6.0 (06/2020): Interfaces for the Optical + Transport Network (OTN) + + IEEE 802.3-2018, Clause 50: IEEE Standard for Ethernet"; + } + + identity ETH-40Gb { + base client-signal; + description + "Client signal type of 40GbE"; + reference + "RFC7139: GMPLS Signaling Extensions for Control of Evolving + G.709 Optical Transport Networks + + ITU-T G.709 v6.0 (06/2020): Interfaces for the Optical + Transport Network (OTN)"; + } + + identity ETH-100Gb { + base client-signal; + description + "Client signal type of 100GbE"; + reference + "RFC7139: GMPLS Signaling Extensions for Control of Evolving + G.709 Optical Transport Networks + + ITU-T G.709 v6.0 (06/2020): Interfaces for the Optical + Transport Network (OTN)"; + } + + identity STM-1 { + base client-signal; + base coding-func; + description + "Client signal type of STM-1; + STM-1 G.707 (N=1) coding function."; + reference + "RFC7139: GMPLS Signaling Extensions for Control of Evolving + G.709 Optical Transport Networks + + ITU-T G.709 v6.0 (06/2020): Interfaces for the Optical + Transport Network (OTN) + + MEF63: Subscriber Layer 1 Service Attributes"; + } + + identity STM-4 { + base client-signal; + + + + + base coding-func; + description + "Client signal type of STM-4; + STM-4 G.707 (N=4) coding function."; + reference + "RFC7139: GMPLS Signaling Extensions for Control of Evolving + G.709 Optical Transport Networks + + ITU-T G.709 v6.0 (06/2020): Interfaces for the Optical + Transport Network (OTN) + + MEF63: Subscriber Layer 1 Service Attributes"; + } + + identity STM-16 { + base client-signal; + base coding-func; + description + "Client signal type of STM-16; + STM-16 G.707 (N=16) coding function."; + reference + "RFC7139: GMPLS Signaling Extensions for Control of Evolving + G.709 Optical Transport Networks + + ITU-T G.709 v6.0 (06/2020): Interfaces for the Optical + Transport Network (OTN) + + MEF63: Subscriber Layer 1 Service Attributes"; + } + + identity STM-64 { + base client-signal; + base coding-func; + description + "Client signal type of STM-64; + STM-64 G.707 (N=64) coding function."; + reference + "RFC7139: GMPLS Signaling Extensions for Control of Evolving + G.709 Optical Transport Networks + + ITU-T G.709 v6.0 (06/2020): Interfaces for the Optical + Transport Network (OTN) + + MEF63: Subscriber Layer 1 Service Attributes"; + } + + identity STM-256 { + base client-signal; + + + + + base coding-func; + description + "Client signal type of STM-256; + STM-256 G.707 (N=256) coding function."; + reference + "RFC7139: GMPLS Signaling Extensions for Control of Evolving + G.709 Optical Transport Networks + + ITU-T G.709 v6.0 (06/2020): Interfaces for the Optical + Transport Network (OTN) + + MEF63: Subscriber Layer 1 Service Attributes"; + } + + identity OC-3 { + base client-signal; + base coding-func; + description + "Client signal type of OC3; + OC-3 GR-253-CORE (N=3) coding function."; + reference + "ANSI T1.105-1995: Synchronous Optical Network (SONET) + Basic Description including Multiplex Structure, Rates, + and Formats + + MEF63: Subscriber Layer 1 Service Attributes"; + } + + identity OC-12 { + base client-signal; + base coding-func; + description + "Client signal type of OC12; + OC-12 GR-253-CORE (N=12) coding function."; + reference + "ANSI T1.105-1995: Synchronous Optical Network (SONET) + Basic Description including Multiplex Structure, Rates, + and Formats + + MEF63: Subscriber Layer 1 Service Attributes"; + } + + identity OC-48 { + base client-signal; + base coding-func; + description + "Client signal type of OC48; + OC-48 GR-253-CORE (N=48) coding function."; + + + + + reference + "ANSI T1.105-1995: Synchronous Optical Network (SONET) + Basic Description including Multiplex Structure, Rates, + and Formats + + MEF63: Subscriber Layer 1 Service Attributes"; + } + + identity OC-192 { + base client-signal; + base coding-func; + description + "Client signal type of OC192; + OC-192 GR-253-CORE (N=192) coding function."; + reference + "ANSI T1.105-1995: Synchronous Optical Network (SONET) + Basic Description including Multiplex Structure, Rates, + and Formats + + MEF63: Subscriber Layer 1 Service Attributes"; + } + + identity OC-768 { + base client-signal; + base coding-func; + description + "Client signal type of OC768; + OC-768 GR-253-CORE (N=768) coding function."; + reference + "ANSI T1.105-1995: Synchronous Optical Network (SONET) + Basic Description including Multiplex Structure, Rates, + and Formats + + MEF63: Subscriber Layer 1 Service Attributes"; + } + + identity FC-100 { + base client-signal; + base coding-func; + description + "Client signal type of Fibre Channel FC-100; + FC-100 FC-FS-2 (1.0625 Gb/s) coding function."; + reference + "RFC7139: GMPLS Signaling Extensions for Control of Evolving + G.709 Optical Transport Networks + + ITU-T G.709 v6.0 (06/2020): Interfaces for the Optical + Transport Network (OTN) + + + + + MEF63: Subscriber Layer 1 Service Attributes"; + } + + identity FC-200 { + base client-signal; + base coding-func; + description + "Client signal type of Fibre Channel FC-200; + FC-200 FC-FS-2 (2.125 Gb/s) coding function."; + reference + "RFC7139: GMPLS Signaling Extensions for Control of Evolving + G.709 Optical Transport Networks + + ITU-T G.709 v6.0 (06/2020): Interfaces for the Optical + Transport Network (OTN) + + MEF63: Subscriber Layer 1 Service Attributes"; + } + + identity FC-400 { + base client-signal; + base coding-func; + description + "Client signal type of Fibre Channel FC-400; + FC-400 FC-FS-2 (4.250 Gb/s) coding function."; + reference + "RFC7139: GMPLS Signaling Extensions for Control of Evolving + G.709 Optical Transport Networks + + ITU-T G.709 v6.0 (06/2020): Interfaces for the Optical + Transport Network (OTN) + + MEF63: Subscriber Layer 1 Service Attributes"; + } + + identity FC-800 { + base client-signal; + base coding-func; + description + "Client signal type of Fibre Channel FC-800; + FC-800 FC-FS-2 (8.500 Gb/s) coding function."; + reference + "RFC7139: GMPLS Signaling Extensions for Control of Evolving + G.709 Optical Transport Networks + + ITU-T G.709 v6.0 (06/2020): Interfaces for the Optical + Transport Network (OTN) + + + + + MEF63: Subscriber Layer 1 Service Attributes"; + } + + identity FC-1200 { + base client-signal; + base coding-func; + description + "Client signal type of Fibre Channel FC-1200; + FC-1200 FC-10GFC (10.51875 Gb/s) coding function."; + reference + "RFC7139: GMPLS Signaling Extensions for Control of Evolving + G.709 Optical Transport Networks + + ITU-T G.709 v6.0 (06/2020): Interfaces for the Optical + Transport Network (OTN) + + MEF63: Subscriber Layer 1 Service Attributes"; + } + + identity FC-1600 { + base client-signal; + base coding-func; + description + "Client signal type of Fibre Channel FC-1600; + FC-1600 FC-FS-3 (14.025 Gb/s) coding function."; + reference + "RFC7139: GMPLS Signaling Extensions for Control of Evolving + G.709 Optical Transport Networks + + ITU-T G.709 v6.0 (06/2020): Interfaces for the Optical + Transport Network (OTN) + + MEF63: Subscriber Layer 1 Service Attributes"; + } + + identity FC-3200 { + base client-signal; + base coding-func; + description + "Client signal type of Fibre Channel FC-3200; + FC-3200 FC-FS-4 (28.05 Gb/s) coding function."; + reference + "RFC7139: GMPLS Signaling Extensions for Control of Evolving + G.709 Optical Transport Networks + + ITU-T G.709 v6.0 (06/2020): Interfaces for the Optical + Transport Network (OTN) + + + + + MEF63: Subscriber Layer 1 Service Attributes"; + } + + identity FICON-4G { + base client-signal; + description + "Client signal type of Fibre Connection 4G"; + reference + "RFC7139: GMPLS Signaling Extensions for Control of Evolving + G.709 Optical Transport Networks + + ITU-T G.709 v6.0 (06/2020): Interfaces for the Optical + Transport Network (OTN)"; + } + + identity FICON-8G { + base client-signal; + description + "Client signal type of Fibre Connection 8G"; + reference + "RFC7139: GMPLS Signaling Extensions for Control of Evolving + G.709 Optical Transport Networks + + ITU-T G.709 v6.0 (06/2020): Interfaces for the Optical + Transport Network (OTN)"; + } + + identity ETH-1000X { + base coding-func; + description + "1000BASE-X PCS clause 36 coding function."; + reference + "MEF63: Subscriber Layer 1 Service Attributes"; + } + + identity ETH-10GW { + base coding-func; + description + "10GBASE-W (WAN PHY) PCS clause 49 and WIS clause 50 + coding function."; + reference + "MEF63: Subscriber Layer 1 Service Attributes"; + } + + identity ETH-10GR { + base coding-func; + description + "10GBASE-R (LAN PHY) PCS clause 49 coding function."; + + + + + reference + "MEF63: Subscriber Layer 1 Service Attributes"; + } + + identity ETH-40GR { + base coding-func; + description + "40GBASE-R PCS clause 82 coding function."; + reference + "MEF63: Subscriber Layer 1 Service Attributes"; + } + + identity ETH-100GR { + base coding-func; + description + "100GBASE-R PCS clause 82 coding function."; + reference + "MEF63: Subscriber Layer 1 Service Attributes"; + } + + identity optical-interface-func { + description + "Base identity from which optical-interface-function + is derived."; + reference + "MEF63: Subscriber Layer 1 Service Attributes"; + } + + identity SX-PMD-1000 { + base optical-interface-func; + description + "SX-PMD-clause-38 Optical Interface function for + 1000BASE-X PCS-36"; + reference + "MEF63: Subscriber Layer 1 Service Attributes"; + } + + identity LX-PMD-1000 { + base optical-interface-func; + description + "LX-PMD-clause-38 Optical Interface function for + 1000BASE-X PCS-36"; + reference + "MEF63: Subscriber Layer 1 Service Attributes"; + } + + identity LX10-PMD-1000 { + base optical-interface-func; + + + + + description + "LX10-PMD-clause-59 Optical Interface function for + 1000BASE-X PCS-36"; + reference + "MEF63: Subscriber Layer 1 Service Attributes"; + } + + identity BX10-PMD-1000 { + base optical-interface-func; + description + "BX10-PMD-clause-59 Optical Interface function for + 1000BASE-X PCS-36"; + reference + "MEF63: Subscriber Layer 1 Service Attributes"; + } + + identity LW-PMD-10G { + base optical-interface-func; + description + "LW-PMD-clause-52 Optical Interface function for + 10GBASE-W PCS-49-WIS-50"; + reference + "MEF63: Subscriber Layer 1 Service Attributes"; + } + + identity EW-PMD-10G { + base optical-interface-func; + description + "EW-PMD-clause-52 Optical Interface function for + 10GBASE-W PCS-49-WIS-50"; + reference + "MEF63: Subscriber Layer 1 Service Attributes"; + } + + identity LR-PMD-10G { + base optical-interface-func; + description + "LR-PMD-clause-52 Optical Interface function for + 10GBASE-R PCS-49"; + reference + "MEF63: Subscriber Layer 1 Service Attributes"; + } + + identity ER-PMD-10G { + base optical-interface-func; + description + "ER-PMD-clause-52 Optical Interface function for + 10GBASE-R PCS-49"; + + + + + reference + "MEF63: Subscriber Layer 1 Service Attributes"; + } + + identity LR4-PMD-40G { + base optical-interface-func; + description + "LR4-PMD-clause-87 Optical Interface function for + 40GBASE-R PCS-82"; + reference + "MEF63: Subscriber Layer 1 Service Attributes"; + } + + identity ER4-PMD-40G { + base optical-interface-func; + description + "ER4-PMD-clause-87 Optical Interface function for + 40GBASE-R PCS-82"; + reference + "MEF63: Subscriber Layer 1 Service Attributes"; + } + + identity FR-PMD-40G { + base optical-interface-func; + description + "FR-PMD-clause-89 Optical Interface function for + 40GBASE-R PCS-82"; + reference + "MEF63: Subscriber Layer 1 Service Attributes"; + } + + identity LR4-PMD-100G { + base optical-interface-func; + description + "LR4-PMD-clause-88 Optical Interface function for + 100GBASE-R PCS-82"; + reference + "MEF63: Subscriber Layer 1 Service Attributes"; + } + + identity ER4-PMD-100G { + base optical-interface-func; + description + "ER4-PMD-clause-88 Optical Interface function for + 100GBASE-R PCS-82"; + reference + "MEF63: Subscriber Layer 1 Service Attributes"; + } + + + + + /* + * Typedefs + */ + + typedef otn-tpn { + type uint16 { + range "1..4095"; + } + description + "Tributary Port Number (TPN) for OTN. "; + reference + "RFC7139: GMPLS Signaling Extensions for Control of Evolving + G.709 Optical Transport Networks."; + } + + typedef otn-ts { + type uint16 { + range "1..4095"; + } + description + "Tributary Slot (TS) for OTN."; + reference + "RFC7139: GMPLS Signaling Extensions for Control of Evolving + G.709 Optical Transport Networks."; + } + + typedef otn-label-range-type { + type enumeration { + enum trib-slot { + description + "Defines a range of OTN tributary slots (TS)."; + } + enum trib-port { + description + "Defines a range of OTN tributary ports (TPN)."; + } + } + description + "Defines the type of OTN label range: TS or TPN. "; + } + + typedef gfp-k { + type enumeration { + enum 2 { + description + "The ODU2.ts rate (1,249,177.230 kbit/s) is used + to compute the rate of an ODUflex(GFP,n,2). "; + } + + + + + enum 3 { + description + "The ODU3.ts rate (1,254,470.354 kbit/s) is used + to compute the rate of an ODUflex(GFP,n,3). "; + } + enum 4 { + description + "The ODU4.ts rate (1,301,467.133 kbit/s) is used + to compute the rate of an ODUflex(GFP,n,4). "; + } + } + description + "The ODUk.ts used to compute the rate of an ODUflex(GFP,n,k)"; + reference + "ITU-T G.709 v6.0 (06/2020), Table 7-8 and L.7: Interfaces for + the Optical Transport Network (OTN)"; + } + + typedef flexe-client-rate { + type union { + type uint16; + type enumeration { + enum "10G" { + description + "Represents a 10G FlexE Client signal (s=2)"; + } + enum "40G" { + description + "Represents a 40G FlexE Client signal (s=8)"; + } + } + } + description + "The FlexE Client signal rate (s x 5,156,250.000 kbit/s) + used to compute the rate of an ODUflex(IMP, s). + Valid values for s are s=2 (10G), s=4 (40G) and + s=5 x n (n x 25G). + In the first two cases an enumeration value + (either 10G or 40G) is used, while in the latter case + the value of n is used"; + reference + "ITU-T G.709 v6.0 (06/2020), Table 7-2: Interfaces for the + Optical Transport Network (OTN)"; + } + + typedef odtu-flex-type { + type enumeration { + enum "2" { + + + + + description + "The ODTU2.ts ODTU type."; + } + enum "3" { + description + "The ODTU3.ts ODTU type."; + } + enum "4" { + description + "The ODTU4.ts ODTU type."; + } + enum "Cn" { + description + "The ODTUCn.ts ODTU type."; + } + } + description + "The type of Optical Data Tributary Unit (ODTU), + whose nominal bitrate is used to compute the number of + Tributary Slots (TS) required by an ODUflex LSP, according to + the (19-1a) and (20-1a) formulas defined in G.709."; + reference + "ITU-T G.709 v6.0 (06/2020), Table 7-7, clause 19.6 and + clause 20.5: Interfaces for the Optical Transport + Network (OTN)"; + } + + typedef bandwidth-scientific-notation { + type string { + pattern + '0(\.0?)?([eE](\+)?0?)?|' + + '[1-9](\.[0-9]{0,6})?[eE](\+)?(9[0-6]|[1-8][0-9]|0?[0-9])?'; + } + units "bps"; + description + "Bandwidth values, expressed using the scientific notation + in bits per second. + + The encoding format is the external decimal-significant + character sequences specified in IEEE 754 and ISO/IEC C99 + for 32-bit decimal floating-point numbers: + (-1)**(S) * 10**(Exponent) * (Significant), + where Significant uses 7 digits. + + An implementation for this representation MAY use decimal32 + or binary32. The range of the Exponent is from -95 to +96 + for decimal32, and from -38 to +38 for binary32. + As a bandwidth value, the format is restricted to be + + + + + normalized, non-negative, and non-fraction: + n.dddddde{+}dd, N.DDDDDDE{+}DD, 0e0 or 0E0, + where 'd' and 'D' are decimal digits; 'n' and 'N' are + non-zero decimal digits; 'e' and 'E' indicate a power of ten. + Some examples are 0e0, 1e10, and 9.953e9."; + reference + "IEEE Std 754-2008: IEEE Standard for Floating-Point + Arithmetic. + ISO/IEC C99: Information technology - Programming + Languages - C."; + } + + /* + * Groupings + */ + + grouping otn-link-bandwidth { + description + "Bandwidth attributes for OTN links"; + container otn { + description + "Bandwidth attributes for OTN links"; + list odulist { + key "odu-type"; + description + "OTN bandwidth definition"; + leaf odu-type { + type identityref { + base odu-type; + } + description "ODU type"; + } + leaf number { + type uint16; + description "Number of ODUs"; + } + leaf ts-number { + when 'derived-from-or-self(../odu-type,"ODUflex") or + derived-from-or-self(../odu-type, + "ODUflex-resizable")' { + description + "Applicable when odu-type is ODUflex or + ODUflex-resizable"; + } + type uint16 { + range "1..4095"; + } + description + + + + + "The number of Tributary Slots (TS) that + could be used by all the ODUflex LSPs."; + } + } + } + } + + grouping otn-path-bandwidth { + description + "Bandwidth attributes for OTN paths."; + container otn { + description + "Bandwidth attributes for OTN paths."; + leaf odu-type { + type identityref { + base odu-type; + } + description "ODU type"; + } + choice oduflex-type { + when 'derived-from-or-self(./odu-type,"ODUflex") or + derived-from-or-self(./odu-type, + "ODUflex-resizable")' { + description + "Applicable when odu-type is ODUflex or + ODUflex-resizable"; + } + description + "Types of ODUflex used to compute the ODUflex + nominal bit rate."; + reference + "ITU-T G.709 v6.0 (06/2020), Table 7-2: Interfaces for the + Optical Transport Network (OTN)"; + case generic { + leaf nominal-bit-rate { + type union { + type l1-types:bandwidth-scientific-notation; + type rt-types:bandwidth-ieee-float32; + } + mandatory true; + description + "Nominal ODUflex bit rate."; + } + } + case cbr { + leaf client-type { + type identityref { + base client-signal; + + + + + } + mandatory true; + description + "The type of Constant Bit Rate (CBR) client signal + of an ODUflex(CBR)."; + } + } + case gfp-n-k { + leaf gfp-n { + type uint8 { + range "1..80"; + } + mandatory true; + description + "The value of n for an ODUflex(GFP,n,k)."; + reference + "ITU-T G.709 v6.0 (06/2020), Tables 7-8 and L.7: + Interfaces for the Optical Transport Network (OTN)"; + } + leaf gfp-k { + type gfp-k; + description + "The value of k for an ODUflex(GFP,n,k). + + If omitted, it is calculated from the value of gfp-n + as described in Table 7-8 of G.709"; + reference + "ITU-T G.709 v6.0 (06/2020), Tables 7-8 and L.7: + Interfaces for the Optical Transport Network (OTN)"; + } + } + case flexe-client { + leaf flexe-client { + type flexe-client-rate; + mandatory true; + description + "The rate of the FlexE-client for an ODUflex(IMP,s)."; + } + } + case flexe-aware { + leaf flexe-aware-n { + type uint16; + mandatory true; + description + "The rate of FlexE-aware client signal + for ODUflex(FlexE-aware)"; + } + } + + + + + case packet { + leaf opuflex-payload-rate { + type union { + type l1-types:bandwidth-scientific-notation; + type rt-types:bandwidth-ieee-float32; + } + mandatory true; + description + "Either the GFP-F encapsulated packet client nominal + bit rate for an ODUflex(GFP) or the 64b/66b encoded + packet client nominal bit rate for an ODUflex(IMP)."; + } + } + } + } + } + + grouping otn-max-path-bandwidth { + description + "Maximum bandwidth attributes for OTN paths."; + container otn { + description + "Maximum bandwidth attributes for OTN paths."; + leaf odu-type { + type identityref { + base odu-type; + } + description "ODU type"; + } + leaf max-ts-number { + when 'derived-from-or-self(../odu-type,"ODUflex") or + derived-from-or-self(../odu-type, + "ODUflex-resizable")' { + description + "Applicable when odu-type is ODUflex or + ODUflex-resizable"; + } + type uint16 { + range "1..4095"; + } + description + "The maximum number of Tributary Slots (TS) that could be + used by an ODUflex LSP."; + } + } + } + + grouping otn-label-range-info { + + + + + description + "Label range information for OTN. + + This grouping SHOULD be used together with the + otn-label-start-end and otn-label-step groupings to provide + OTN technology-specific label information to the models which + use the label-restriction-info grouping defined in the module + ietf-te-types."; + container otn-label-range { + description + "Label range information for OTN."; + leaf range-type { + type otn-label-range-type; + description "The type of range (e.g., TPN or TS) + to which the label range applies"; + } + leaf tsg { + type identityref { + base tributary-slot-granularity; + } + description + "Tributary slot granularity (TSG) to which the label range + applies. + + This leaf MUST be present when the range-type is TS. + + This leaf MAY be omitted when mapping an ODUk over an OTUk + Link. In this case the range-type is tpn, with only one + entry (ODUk), and the tpn range has only one value (1)."; + reference + "ITU-T G.709 v6.0 (06/2020): Interfaces for the Optical + Transport Network (OTN)"; + } + leaf-list odu-type-list { + type identityref { + base odu-type; + } + description + "List of ODU types to which the label range applies. + + An Empty odu-type-list means that the label range + applies to all the supported ODU types."; + } + leaf priority { + type uint8 { + range 0..7; + } + description + + + + + "Priority in Interface Switching Capability + Descriptor (ISCD)."; + reference + "RFC4203: OSPF Extensions in Support of Generalized + Multi-Protocol Label Switching (GMPLS)"; + } + } + } + + grouping otn-label-start-end { + description + "The OTN label-start or label-end used to specify an OTN label + range. + + This grouping is dependent on the range-type defined in the + otn-label-range-info grouping. + + This grouping SHOULD be used together with the + otn-label-range-info and otn-label-step groupings to provide + OTN technology-specific label information to the models which + use the label-restriction-info grouping defined in the module + ietf-te-types."; + container otn { + description + "Label start or label end for OTN."; + choice range-type { + description + "OTN label range type, either TPN range or TS range"; + case trib-port { + leaf tpn { + when "../../../../otn-label-range/range-type = + 'trib-port'" { + description + "Valid only when range-type represented by + trib-port"; + } + type otn-tpn; + description + "Tributary Port Number (TPN)."; + reference + "RFC7139: GMPLS Signaling Extensions for Control of + Evolving G.709 Optical Transport Networks."; + } + } + case trib-slot { + leaf ts { + when "../../../../otn-label-range/range-type = + 'trib-slot'" { + + + + + description + "Valid only when range-type represented by + trib-slot"; + } + type otn-ts; + description + "Tributary Slot (TS) number."; + reference + "RFC7139: GMPLS Signaling Extensions for Control of + Evolving G.709 Optical Transport Networks"; + } + } + } + } + } + + grouping otn-label-hop { + description "OTN Label"; + reference + "RFC7139, section 6: GMPLS Signaling Extensions for Control of + Evolving G.709 Optical Transport Networks"; + container otn { + description + "Label hop for OTN."; + leaf tpn { + type otn-tpn; + description + "Tributary Port Number (TPN)."; + reference + "RFC7139: GMPLS Signaling Extensions for Control of + Evolving G.709 Optical Transport Networks."; + } + leaf tsg { + type identityref { + base tributary-slot-granularity; + } + description "Tributary Slot Granularity (TSG)."; + reference + "ITU-T G.709 v6.0 (06/2020): Interfaces for the Optical + Transport Network (OTN)"; + } + leaf ts-list { + type string { + pattern "([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?" + + "(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)"; + } + description + "A list of available Tributary Slots (TS) ranging + + + + + between 1 and 4095. If multiple values or + ranges are given, they all MUST be disjoint + and MUST be in ascending order. + For example 1-20,25,50-1000."; + reference + "RFC 7139: GMPLS Signaling Extensions for Control + of Evolving G.709 Optical Transport Networks"; + } + } + } + + grouping otn-label-step { + description + "Label step for OTN. + + This grouping is dependent on the range-type defined in the + otn-label-range-info grouping. + + This grouping SHOULD be used together with the + otn-label-range-info and otn-label-start-end groupings to + provide OTN technology-specific label information to the + models which use the label-restriction-info grouping defined + in the module ietf-te-types."; + container otn { + description + "Label step for OTN"; + choice range-type { + description + "OTN label range type, either TPN range or TS range"; + case trib-port { + leaf tpn { + when "../../../otn-label-range/range-type = + 'trib-port'" { + description + "Valid only when range-type represented by + trib-port"; + } + type otn-tpn; + description + "Label step which represents possible increments for + Tributary Port Number (TPN)."; + reference + "RFC7139: GMPLS Signaling Extensions for Control of + Evolving G.709 Optical Transport Networks."; + } + } + case trib-slot { + leaf ts { + + + + + when "../../../otn-label-range/range-type = + 'trib-slot'" { + description + "Valid only when range-type represented by + trib-slot"; + } + type otn-ts; + description + "Label step which represents possible increments for + Tributary Slot (TS) number."; + reference + "RFC7139: GMPLS Signaling Extensions for Control of + Evolving G.709 Optical Transport Networks."; + } + } + } + } + } + } diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/yang/ietf-network-topology@2018-02-26.yang b/src/nbi/service/rest_server/nbi_plugins/ietf_network/yang/ietf-network-topology@2018-02-26.yang new file mode 100644 index 0000000000000000000000000000000000000000..0538ac01b629e80db37bd66a3128ac5e04dfbcef --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/yang/ietf-network-topology@2018-02-26.yang @@ -0,0 +1,294 @@ + module ietf-network-topology { + yang-version 1.1; + namespace "urn:ietf:params:xml:ns:yang:ietf-network-topology"; + prefix nt; + + import ietf-inet-types { + prefix inet; + reference + "RFC 6991: Common YANG Data Types"; + } + import ietf-network { + prefix nw; + reference + "RFC 8345: A YANG Data Model for Network Topologies"; + } + + organization + "IETF I2RS (Interface to the Routing System) Working Group"; + + contact + "WG Web: + WG List: + + Editor: Alexander Clemm + + + Editor: Jan Medved + + + Editor: Robert Varga + + + Editor: Nitin Bahadur + + + Editor: Hariharan Ananthakrishnan + + + Editor: Xufeng Liu + "; + + description + "This module defines a common base model for a network topology, + augmenting the base network data model with links to connect + nodes, as well as termination points to terminate links + on nodes. + + Copyright (c) 2018 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 + (https://trustee.ietf.org/license-info). + + This version of this YANG module is part of RFC 8345; + see the RFC itself for full legal notices."; + + revision 2018-02-26 { + description + "Initial revision."; + reference + "RFC 8345: A YANG Data Model for Network Topologies"; + } + + typedef link-id { + type inet:uri; + description + "An identifier for a link in a topology. The precise + structure of the link-id will be up to the implementation. + The identifier SHOULD be chosen such that the same link in a + real network topology will always be identified through the + same identifier, even if the data model is instantiated in + separate datastores. An implementation MAY choose to capture + semantics in the identifier -- for example, to indicate the + type of link and/or the type of topology of which the link is + a part."; + } + + typedef tp-id { + type inet:uri; + description + "An identifier for termination points on a node. The precise + structure of the tp-id will be up to the implementation. + The identifier SHOULD be chosen such that the same termination + point in a real network topology will always be identified + through the same identifier, even if the data model is + instantiated in separate datastores. An implementation MAY + choose to capture semantics in the identifier -- for example, + to indicate the type of termination point and/or the type of + node that contains the termination point."; + } + + grouping link-ref { + description + "This grouping can be used to reference a link in a specific + network. Although it is not used in this module, it is + defined here for the convenience of augmenting modules."; + leaf link-ref { + type leafref { + path "/nw:networks/nw:network[nw:network-id=current()/../"+ + "network-ref]/nt:link/nt:link-id"; + require-instance false; + } + description + "A type for an absolute reference to a link instance. + (This type should not be used for relative references. + In such a case, a relative path should be used instead.)"; + } + uses nw:network-ref; + } + + grouping tp-ref { + description + "This grouping can be used to reference a termination point + in a specific node. Although it is not used in this module, + it is defined here for the convenience of augmenting + modules."; + leaf tp-ref { + type leafref { + path "/nw:networks/nw:network[nw:network-id=current()/../"+ + "network-ref]/nw:node[nw:node-id=current()/../"+ + "node-ref]/nt:termination-point/nt:tp-id"; + require-instance false; + } + description + "A type for an absolute reference to a termination point. + (This type should not be used for relative references. + In such a case, a relative path should be used instead.)"; + } + uses nw:node-ref; + } + + augment "/nw:networks/nw:network" { + description + "Add links to the network data model."; + list link { + key "link-id"; + description + "A network link connects a local (source) node and + a remote (destination) node via a set of the respective + node's termination points. It is possible to have several + links between the same source and destination nodes. + Likewise, a link could potentially be re-homed between + termination points. Therefore, in order to ensure that we + would always know to distinguish between links, every link + is identified by a dedicated link identifier. Note that a + link models a point-to-point link, not a multipoint link."; + leaf link-id { + type link-id; + description + "The identifier of a link in the topology. + A link is specific to a topology to which it belongs."; + } + container source { + description + "This container holds the logical source of a particular + link."; + leaf source-node { + type leafref { + path "../../../nw:node/nw:node-id"; + require-instance false; + } + description + "Source node identifier. Must be in the same topology."; + } + leaf source-tp { + type leafref { + path "../../../nw:node[nw:node-id=current()/../"+ + "source-node]/termination-point/tp-id"; + require-instance false; + } + description + "This termination point is located within the source node + and terminates the link."; + } + } + + container destination { + description + "This container holds the logical destination of a + particular link."; + leaf dest-node { + type leafref { + path "../../../nw:node/nw:node-id"; + require-instance false; + } + description + "Destination node identifier. Must be in the same + network."; + } + leaf dest-tp { + type leafref { + path "../../../nw:node[nw:node-id=current()/../"+ + "dest-node]/termination-point/tp-id"; + require-instance false; + } + description + "This termination point is located within the + destination node and terminates the link."; + } + } + list supporting-link { + key "network-ref link-ref"; + description + "Identifies the link or links on which this link depends."; + leaf network-ref { + type leafref { + path "../../../nw:supporting-network/nw:network-ref"; + require-instance false; + } + description + "This leaf identifies in which underlay topology + the supporting link is present."; + } + + leaf link-ref { + type leafref { + path "/nw:networks/nw:network[nw:network-id=current()/"+ + "../network-ref]/link/link-id"; + require-instance false; + } + description + "This leaf identifies a link that is a part + of this link's underlay. Reference loops in which + a link identifies itself as its underlay, either + directly or transitively, are not allowed."; + } + } + } + } + augment "/nw:networks/nw:network/nw:node" { + description + "Augments termination points that terminate links. + Termination points can ultimately be mapped to interfaces."; + list termination-point { + key "tp-id"; + description + "A termination point can terminate a link. + Depending on the type of topology, a termination point + could, for example, refer to a port or an interface."; + leaf tp-id { + type tp-id; + description + "Termination point identifier."; + } + list supporting-termination-point { + key "network-ref node-ref tp-ref"; + description + "This list identifies any termination points on which a + given termination point depends or onto which it maps. + Those termination points will themselves be contained + in a supporting node. This dependency information can be + inferred from the dependencies between links. Therefore, + this item is not separately configurable. Hence, no + corresponding constraint needs to be articulated. + The corresponding information is simply provided by the + implementing system."; + + leaf network-ref { + type leafref { + path "../../../nw:supporting-node/nw:network-ref"; + require-instance false; + } + description + "This leaf identifies in which topology the + supporting termination point is present."; + } + leaf node-ref { + type leafref { + path "../../../nw:supporting-node/nw:node-ref"; + require-instance false; + } + description + "This leaf identifies in which node the supporting + termination point is present."; + } + leaf tp-ref { + type leafref { + path "/nw:networks/nw:network[nw:network-id=current()/"+ + "../network-ref]/nw:node[nw:node-id=current()/../"+ + "node-ref]/termination-point/tp-id"; + require-instance false; + } + description + "Reference to the underlay node (the underlay node must + be in a different topology)."; + } + } + } + } + } diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/yang/ietf-network@2018-02-26.yang b/src/nbi/service/rest_server/nbi_plugins/ietf_network/yang/ietf-network@2018-02-26.yang new file mode 100644 index 0000000000000000000000000000000000000000..d9da81eeebefad9054a43af552de3d51f20bcd56 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/yang/ietf-network@2018-02-26.yang @@ -0,0 +1,193 @@ + module ietf-network { + yang-version 1.1; + namespace "urn:ietf:params:xml:ns:yang:ietf-network"; + prefix nw; + + import ietf-inet-types { + prefix inet; + reference + "RFC 6991: Common YANG Data Types"; + } + + organization + "IETF I2RS (Interface to the Routing System) Working Group"; + + contact + "WG Web: + WG List: + + Editor: Alexander Clemm + + + Editor: Jan Medved + + + Editor: Robert Varga + + + Editor: Nitin Bahadur + + + Editor: Hariharan Ananthakrishnan + + + Editor: Xufeng Liu + "; + + description + "This module defines a common base data model for a collection + of nodes in a network. Node definitions are further used + in network topologies and inventories. + + Copyright (c) 2018 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 + (https://trustee.ietf.org/license-info). + + This version of this YANG module is part of RFC 8345; + see the RFC itself for full legal notices."; + + revision 2018-02-26 { + description + "Initial revision."; + reference + "RFC 8345: A YANG Data Model for Network Topologies"; + } + + typedef node-id { + type inet:uri; + description + "Identifier for a node. The precise structure of the node-id + will be up to the implementation. For example, some + implementations MAY pick a URI that includes the network-id + as part of the path. The identifier SHOULD be chosen + such that the same node in a real network topology will + always be identified through the same identifier, even if + the data model is instantiated in separate datastores. An + implementation MAY choose to capture semantics in the + identifier -- for example, to indicate the type of node."; + } + + typedef network-id { + type inet:uri; + description + "Identifier for a network. The precise structure of the + network-id will be up to the implementation. The identifier + SHOULD be chosen such that the same network will always be + identified through the same identifier, even if the data model + is instantiated in separate datastores. An implementation MAY + choose to capture semantics in the identifier -- for example, + to indicate the type of network."; + } + + grouping network-ref { + description + "Contains the information necessary to reference a network -- + for example, an underlay network."; + leaf network-ref { + type leafref { + path "/nw:networks/nw:network/nw:network-id"; + require-instance false; + } + description + "Used to reference a network -- for example, an underlay + network."; + } + } + + grouping node-ref { + description + "Contains the information necessary to reference a node."; + leaf node-ref { + type leafref { + path "/nw:networks/nw:network[nw:network-id=current()/../"+ + "network-ref]/nw:node/nw:node-id"; + require-instance false; + } + description + "Used to reference a node. + Nodes are identified relative to the network that + contains them."; + } + uses network-ref; + } + + container networks { + description + "Serves as a top-level container for a list of networks."; + list network { + key "network-id"; + description + "Describes a network. + A network typically contains an inventory of nodes, + topological information (augmented through the + network-topology data model), and layering information."; + leaf network-id { + type network-id; + description + "Identifies a network."; + } + container network-types { + description + "Serves as an augmentation target. + The network type is indicated through corresponding + presence containers augmented into this container."; + } + list supporting-network { + key "network-ref"; + description + "An underlay network, used to represent layered network + topologies."; + leaf network-ref { + type leafref { + path "/nw:networks/nw:network/nw:network-id"; + require-instance false; + } + description + "References the underlay network."; + } + } + + list node { + key "node-id"; + description + "The inventory of nodes of this network."; + leaf node-id { + type node-id; + description + "Uniquely identifies a node within the containing + network."; + } + list supporting-node { + key "network-ref node-ref"; + description + "Represents another node that is in an underlay network + and that supports this node. Used to represent layering + structure."; + leaf network-ref { + type leafref { + path "../../../nw:supporting-network/nw:network-ref"; + require-instance false; + } + description + "References the underlay network of which the + underlay node is a part."; + } + leaf node-ref { + type leafref { + path "/nw:networks/nw:network/nw:node/nw:node-id"; + require-instance false; + } + description + "References the underlay node itself."; + } + } + } + } + } + } diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/yang/ietf-otn-topology@2023-07-06.yang b/src/nbi/service/rest_server/nbi_plugins/ietf_network/yang/ietf-otn-topology@2023-07-06.yang new file mode 100644 index 0000000000000000000000000000000000000000..587612e8e7acb1f2eedb329b2f13a1a0626f3181 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/yang/ietf-otn-topology@2023-07-06.yang @@ -0,0 +1,2405 @@ + module ietf-otn-topology { + yang-version 1.1; + namespace "urn:ietf:params:xml:ns:yang:ietf-otn-topology"; + prefix "otnt"; + + import ietf-network { + prefix "nw"; + reference "RFC 8345: A YANG Data Model for Network Topologies"; + } + + import ietf-network-topology { + prefix "nt"; + reference "RFC 8345: A YANG Data Model for Network Topologies"; + } + + import ietf-te-topology { + prefix "tet"; + reference + "RFC 8795: YANG Data Model for Traffic Engineering + (TE) Topologies"; + } + + import ietf-layer1-types { + prefix "l1-types"; + reference + "I-D.ietf-ccamp-layer1-types: A YANG Data Model + for Layer 1 Types"; + } + + organization + "IETF CCAMP Working Group"; + contact + "WG Web: + WG List: + + Editor: Haomian Zheng + + + Editor: Italo Busi + + + Editor: Xufeng Liu + + + Editor: Sergio Belotti + + + + + + Editor: Oscar Gonzalez de Dios + "; + + description + "This module defines a protocol independent Layer 1/ODU topology + data model. The model fully conforms + to the Network Management Datastore Architecture (NMDA). + + Copyright (c) 2023 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. + + The key words 'MUST', 'MUST NOT', 'REQUIRED', 'SHALL', 'SHALL + NOT', 'SHOULD', 'SHOULD NOT', 'RECOMMENDED', 'NOT RECOMMENDED', + 'MAY', and 'OPTIONAL' in this document are to be interpreted as + described in BCP 14 (RFC 2119) (RFC 8174) when, and only when, + they appear in all capitals, as shown here."; + + revision 2023-07-06 { + description + "Initial Revision"; + reference + "RFC XXXX: A YANG Data Model for Optical Transport Network + Topology"; + // RFC Ed.: replace XXXX with actual RFC number, update date + // information and remove this note + } + + /* + * Groupings + */ + + grouping label-range-info { + description + "OTN technology-specific label range related information with + a presence container indicating that the label range is an + OTN technology-specific label range. + + This grouping SHOULD be used together with the + + + + + otn-label-start-end and otn-label-step groupings to provide + OTN technology-specific label information to the models which + use the label-restriction-info grouping defined in the module + ietf-te-types."; + uses l1-types:otn-label-range-info { + refine otn-label-range { + presence + "Indicates the label range is an OTN label range. + + This container MUST NOT be present if there are other + presence containers or attributes indicating another type + of label range."; + } + } + } + + /* + * Data nodes + */ + + augment "/nw:networks/nw:network/nw:network-types/" + + "tet:te-topology" { + container otn-topology { + presence "indicates a topology type of Optical Transport + Network (OTN)-electrical layer."; + description "OTN topology type"; + } + description "augment network types to include OTN newtork"; + } + + augment "/nw:networks/nw:network/nw:node/tet:te" + + "/tet:te-node-attributes" { + when "../../../nw:network-types/tet:te-topology/" + + "otnt:otn-topology" { + description "Augment only for OTN network."; + } + description "Augment TE node attributes."; + container otn-node { + presence "The TE node is an OTN node."; + description + "Introduce new TE node type for OTN node."; + } + } + + augment "/nw:networks/nw:network/nt:link/tet:te/" + + "tet:te-link-attributes" { + when "../../../nw:network-types/tet:te-topology/" + + "otnt:otn-topology" { + + + + + description "Augment only for OTN network."; + } + description "Augment link configuration"; + + container otn-link { + description + "Attributes of the OTN Link."; + leaf odtu-flex-type { + type l1-types:odtu-flex-type; + description + "The type of Optical Data Tributary Unit (ODTU) + whose nominal bitrate is used to compute the number of + Tributary Slots (TS) required by the ODUflex LSPs set up + on this OTN Link."; + } + leaf tsg { + type identityref { + base l1-types:tributary-slot-granularity; + } + description "Tributary slot granularity."; + reference + "ITU-T G.709 v6.0 (06/2020): Interfaces for the Optical + Transport Network (OTN)"; + } + leaf distance { + type uint32; + description "distance in the unit of kilometers"; + } + } + container client-svc { + presence + "When present, indicates that the Link supports Costant + Bit Rate (CBR) client signals."; + description + "Attributes of the Link supporting CBR client signals."; + leaf-list supported-client-signal { + type identityref { + base l1-types:client-signal; + } + min-elements 1; + description + "List of client signal types supported by the Link."; + } + } + } + + augment "/nw:networks/nw:network/nw:node/nt:termination-point/" + + "tet:te" { + + + + + when "../../../nw:network-types/tet:te-topology/" + + "otnt:otn-topology" { + description "Augment only for OTN network"; + } + description "OTN TP attributes config in ODU topology."; + + container otn-ltp { + description + "Attributes of the OTN Link Termination Point (LTP)."; + leaf odtu-flex-type { + type l1-types:odtu-flex-type; + description + "The type of Optical Data Tributary Unit (ODTU) + whose nominal bitrate is used to compute the number of + Tributary Slots (TS) required by the ODUflex LSPs set up + on this OTN Link Termination Point (LTP)."; + } + } + container client-svc { + presence + "When present, indicates that the Link Termination Point + (LTP) supports Costant Bit Rate (CBR) client signals."; + description + "OTN LTP Service attributes."; + leaf-list supported-client-signal { + type identityref { + base l1-types:client-signal; + } + description + "List of client signal types supported by the LTP."; + } + } + } + + /* + * Augment TE bandwidth + */ + + augment "/nw:networks/nw:network/nw:node/nt:termination-point/" + + "tet:te/" + + "tet:interface-switching-capability/tet:max-lsp-bandwidth/" + + "tet:te-bandwidth/tet:technology" { + when "../../../../../../nw:network-types/tet:te-topology/" + + "otnt:otn-topology" { + description + "Augmentation parameters apply only for networks with + OTN topology type."; + } + + + + + description + "Augment maximum LSP TE bandwidth for the link termination + point (LTP)."; + case otn { + uses l1-types:otn-max-path-bandwidth { + description + "The odtu-flex-type attribute of the OTN Link Termination + Point (LTP) is used to compute the number of Tributary + Slots (TS) required by the ODUflex LSPs set up on this + OTN LTP."; + } + } + } + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:te-node-attributes/tet:connectivity-matrices/" + + "tet:path-constraints/tet:te-bandwidth/tet:technology" { + when "../../../../../../nw:network-types/tet:te-topology/" + + "otnt:otn-topology" { + description + "Augmentation parameters apply only for networks with + OTN topology type."; + } + description + "Augment TE bandwidth path constraints of the TE node + connectivity matrices."; + case otn { + uses l1-types:otn-link-bandwidth { + augment otn { + description + "Augment OTN link bandwidth information."; + leaf odtu-flex-type { + type l1-types:odtu-flex-type; + description + "The type of Optical Data Tributary Unit (ODTU) + whose nominal bitrate is used to compute the number of + Tributary Slots (TS) required by the ODUflex LSPs + set up along the underlay paths of these OTN + connectivity matrices."; + } + } + } + } + } + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:te-node-attributes/tet:connectivity-matrices/" + + "tet:connectivity-matrix/" + + + + + + "tet:path-constraints/tet:te-bandwidth/tet:technology" { + when "../../../../../../../nw:network-types/tet:te-topology/" + + "otnt:otn-topology" { + description + "Augmentation parameters apply only for networks with + OTN topology type."; + } + description + "Augment TE bandwidth path constraints of the + connectivity matrix entry."; + case otn { + uses l1-types:otn-link-bandwidth { + augment otn { + description + "Augment OTN link bandwidth information."; + leaf odtu-flex-type { + type l1-types:odtu-flex-type; + description + "The type of Optical Data Tributary Unit (ODTU) + whose nominal bitrate is used to compute the number of + Tributary Slots (TS) required by the ODUflex LSPs + set up along the underlay path of this OTN + connectivity matrix entry."; + } + } + } + } + } + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:information-source-entry/tet:connectivity-matrices/" + + "tet:path-constraints/tet:te-bandwidth/tet:technology" { + when "../../../../../../nw:network-types/tet:te-topology/" + + "otnt:otn-topology" { + description + "Augmentation parameters apply only for networks with + OTN topology type."; + } + description + "Augment TE bandwidth path constraints of the TE node + connectivity matrices information source."; + case otn { + uses l1-types:otn-link-bandwidth { + augment otn { + description + "Augment OTN link bandwidth information."; + leaf odtu-flex-type { + type l1-types:odtu-flex-type; + + + + + description + "The type of Optical Data Tributary Unit (ODTU) + whose nominal bitrate is used to compute the number of + Tributary Slots (TS) required by the ODUflex LSPs + set up along the underlay paths of these OTN + connectivity matrices."; + } + } + } + } + } + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:information-source-entry/tet:connectivity-matrices/" + + "tet:connectivity-matrix/" + + "tet:path-constraints/tet:te-bandwidth/tet:technology" { + when "../../../../../../../nw:network-types/tet:te-topology/" + + "otnt:otn-topology" { + description + "Augmentation parameters apply only for networks with + OTN topology type."; + } + description + "Augment TE bandwidth path constraints of the + connectivity matrix entry information source"; + case otn { + uses l1-types:otn-link-bandwidth { + augment otn { + description + "Augment OTN link bandwidth information."; + leaf odtu-flex-type { + type l1-types:odtu-flex-type; + description + "The type of Optical Data Tributary Unit (ODTU) + whose nominal bitrate is used to compute the number of + Tributary Slots (TS) required by the ODUflex LSPs + set up along the underlay path of this OTN + connectivity matrix entry."; + } + } + } + } + } + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:tunnel-termination-point/" + + "tet:client-layer-adaptation/tet:switching-capability/" + + "tet:te-bandwidth/tet:technology" { + + + + + when "../../../../../../nw:network-types/tet:te-topology/" + + "otnt:otn-topology" { + description + "Augmentation parameters apply only for networks with + OTN topology type."; + } + description + "Augment client TE bandwidth of the tunnel termination point + (TTP)"; + case otn { + uses l1-types:otn-link-bandwidth { + augment otn { + description + "Augment OTN link bandwidth information."; + leaf odtu-flex-type { + type l1-types:odtu-flex-type; + description + "The type of Optical Data Tributary Unit (ODTU) + whose nominal bitrate is used to compute the number of + Tributary Slots (TS) required by the ODUflex LSPs + terminated on this OTN Tunnel Termination Point + (TTP)."; + } + } + } + } + } + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:tunnel-termination-point/" + + "tet:local-link-connectivities/tet:path-constraints/" + + "tet:te-bandwidth/tet:technology" { + when "../../../../../../nw:network-types/tet:te-topology/" + + "otnt:otn-topology" { + description + "Augmentation parameters apply only for networks with + OTN topology type."; + } + description + "Augment TE bandwidth path constraints for the TTP + Local Link Connectivities."; + case otn { + uses l1-types:otn-link-bandwidth { + augment otn { + description + "Augment OTN link bandwidth information."; + leaf odtu-flex-type { + type l1-types:odtu-flex-type; + + + + + description + "The type of Optical Data Tributary Unit (ODTU) + whose nominal bitrate is used to compute the number of + Tributary Slots (TS) required by the ODUflex LSPs + set up along the underlay paths of these OTN Local + Link Connectivities."; + } + } + } + } + } + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:tunnel-termination-point/" + + "tet:local-link-connectivities/" + + "tet:local-link-connectivity/tet:path-constraints/" + + "tet:te-bandwidth/tet:technology" { + when "../../../../../../../nw:network-types/tet:te-topology/" + + "otnt:otn-topology" { + description + "Augmentation parameters apply only for networks with + OTN topology type."; + } + description + "Augment TE bandwidth path constraints for the TTP + Local Link Connectivity entry."; + case otn { + uses l1-types:otn-link-bandwidth { + augment otn { + description + "Augment OTN link bandwidth information."; + leaf odtu-flex-type { + type l1-types:odtu-flex-type; + description + "The type of Optical Data Tributary Unit (ODTU) + whose nominal bitrate is used to compute the number of + Tributary Slots (TS) required by the ODUflex LSPs + set up along the underlay path of this OTN Local + Link Connectivyt entry."; + } + } + } + } + } + + augment "/nw:networks/nw:network/nt:link/tet:te/" + + "tet:te-link-attributes/" + + "tet:interface-switching-capability/tet:max-lsp-bandwidth/" + + + + + + "tet:te-bandwidth/tet:technology" { + when "../../../../../../nw:network-types/tet:te-topology/" + + "otnt:otn-topology" { + description + "Augmentation parameters apply only for networks with + OTN topology type."; + } + description + "Augment maximum LSP TE bandwidth for the TE link."; + case otn { + uses l1-types:otn-max-path-bandwidth { + description + "The odtu-flex-type attribute of the OTN Link is used + to compute the number of Tributary Slots (TS) required + by the ODUflex LSPs set up on this OTN Link."; + } + } + } + + augment "/nw:networks/nw:network/nt:link/tet:te/" + + "tet:te-link-attributes/" + + "tet:max-link-bandwidth/" + + "tet:te-bandwidth" { + when "../../../../../nw:network-types/tet:te-topology/" + + "otnt:otn-topology" { + description + "Augmentation parameters apply only for networks with + OTN topology type."; + } + description + "Augment maximum TE bandwidth for the TE link"; + uses l1-types:otn-link-bandwidth { + description + "The odtu-flex-type attribute of the OTN Link is used + to compute the number of Tributary Slots (TS) required + by the ODUflex LSPs set up on this OTN Link."; + } + } + + augment "/nw:networks/nw:network/nt:link/tet:te/" + + "tet:te-link-attributes/" + + "tet:max-resv-link-bandwidth/" + + "tet:te-bandwidth" { + when "../../../../../nw:network-types/tet:te-topology/" + + "otnt:otn-topology" { + description + "Augmentation parameters apply only for networks with + OTN topology type."; + + + + + } + description + "Augment maximum reservable TE bandwidth for the TE link"; + uses l1-types:otn-link-bandwidth { + description + "The odtu-flex-type attribute of the OTN Link is used + to compute the number of Tributary Slots (TS) required + by the ODUflex LSPs set up on this OTN Link."; + } + } + + augment "/nw:networks/nw:network/nt:link/tet:te/" + + "tet:te-link-attributes/" + + "tet:unreserved-bandwidth/" + + "tet:te-bandwidth" { + when "../../../../../nw:network-types/tet:te-topology/" + + "otnt:otn-topology" { + description + "Augmentation parameters apply only for networks with + OTN topology type."; + } + description + "Augment unreserved TE bandwidth for the TE Link"; + uses l1-types:otn-link-bandwidth { + description + "The odtu-flex-type attribute of the OTN Link is used + to compute the number of Tributary Slots (TS) required + by the ODUflex LSPs set up on this OTN Link."; + } + } + + augment "/nw:networks/nw:network/nt:link/tet:te/" + + "tet:information-source-entry/" + + "tet:interface-switching-capability/" + + "tet:max-lsp-bandwidth/" + + "tet:te-bandwidth/tet:technology" { + when "../../../../../../nw:network-types/tet:te-topology/" + + "otnt:otn-topology" { + description + "Augmentation parameters apply only for networks with + OTN topology type."; + } + description + "Augment maximum LSP TE bandwidth for the TE link + information source"; + case otn { + uses l1-types:otn-max-path-bandwidth { + description + + + + + "The odtu-flex-type attribute of the OTN Link is used + to compute the number of Tributary Slots (TS) required + by the ODUflex LSPs set up on this OTN Link."; + } + } + } + + augment "/nw:networks/nw:network/nt:link/tet:te/" + + "tet:information-source-entry/" + + "tet:max-link-bandwidth/" + + "tet:te-bandwidth" { + when "../../../../../nw:network-types/tet:te-topology/" + + "otnt:otn-topology" { + description + "Augmentation parameters apply only for networks with + OTN topology type."; + } + description + "Augment maximum TE bandwidth for the TE link + information source"; + uses l1-types:otn-link-bandwidth { + description + "The odtu-flex-type attribute of the OTN Link is used + to compute the number of Tributary Slots (TS) required + by the ODUflex LSPs set up on this OTN Link."; + } + } + + augment "/nw:networks/nw:network/nt:link/tet:te/" + + "tet:information-source-entry/" + + "tet:max-resv-link-bandwidth/" + + "tet:te-bandwidth" { + when "../../../../../nw:network-types/tet:te-topology/" + + "otnt:otn-topology" { + description + "Augmentation parameters apply only for networks with + OTN topology type."; + } + description + "Augment maximum reservable TE bandwidth for the TE link + information-source"; + uses l1-types:otn-link-bandwidth { + description + "The odtu-flex-type attribute of the OTN Link is used + to compute the number of Tributary Slots (TS) required + by the ODUflex LSPs set up on this OTN Link."; + } + } + + + + + augment "/nw:networks/nw:network/nt:link/tet:te/" + + "tet:information-source-entry/" + + "tet:unreserved-bandwidth/" + + "tet:te-bandwidth" { + when "../../../../../nw:network-types/tet:te-topology/" + + "otnt:otn-topology" { + description + "Augmentation parameters apply only for networks with + OTN topology type."; + } + description + "Augment unreserved TE bandwidth of the TE link + information source"; + uses l1-types:otn-link-bandwidth { + description + "The odtu-flex-type attribute of the OTN Link is used + to compute the number of Tributary Slots (TS) required + by the ODUflex LSPs set up on this OTN Link."; + } + } + + augment "/nw:networks/tet:te/tet:templates/" + + "tet:link-template/tet:te-link-attributes/" + + "tet:interface-switching-capability/" + + "tet:max-lsp-bandwidth/" + + "tet:te-bandwidth/tet:technology" { + description + "Augment maximum LSP TE bandwidth of the TE link + template"; + case otn { + uses l1-types:otn-max-path-bandwidth { + description + "The odtu-flex-type attribute of the OTN Link is used + to compute the number of Tributary Slots (TS) required + by the ODUflex LSPs set up on the OTN Link that uses this + Link Template."; + } + } + } + + augment "/nw:networks/tet:te/tet:templates/" + + "tet:link-template/tet:te-link-attributes/" + + "tet:max-link-bandwidth/" + + "tet:te-bandwidth" { + description + "Augment maximum TE bandwidth the TE link template"; + uses l1-types:otn-link-bandwidth { + description + + + + + "The odtu-flex-type attribute of the OTN Link is used + to compute the number of Tributary Slots (TS) required + by the ODUflex LSPs set up on the OTN Link that uses this + Link Template."; + } + } + + augment "/nw:networks/tet:te/tet:templates/" + + "tet:link-template/tet:te-link-attributes/" + + "tet:max-resv-link-bandwidth/" + + "tet:te-bandwidth" { + description + "Augment maximum reservable TE bandwidth for the TE link + template."; + uses l1-types:otn-link-bandwidth { + description + "The odtu-flex-type attribute of the OTN Link is used + to compute the number of Tributary Slots (TS) required + by the ODUflex LSPs set up on the OTN Link that uses this + Link Template."; + } + } + + augment "/nw:networks/tet:te/tet:templates/" + + "tet:link-template/tet:te-link-attributes/" + + "tet:unreserved-bandwidth/" + + "tet:te-bandwidth" { + description + "Augment unreserved TE bandwidth the TE link template"; + uses l1-types:otn-link-bandwidth { + description + "The odtu-flex-type attribute of the OTN Link is used + to compute the number of Tributary Slots (TS) required + by the ODUflex LSPs set up on the OTN Link that uses this + Link Template."; + } + } + + /* + * Augment TE label range information + */ + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:te-node-attributes/tet:connectivity-matrices/" + + "tet:label-restrictions/tet:label-restriction" { + when "../../../../../../nw:network-types/tet:te-topology/" + + "otnt:otn-topology" { + description + + + + + "Augmentation parameters apply only for networks with + OTN topology type."; + } + description + "Augment TE label range information for the TE node + connectivity matrices."; + uses label-range-info; + } + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:te-node-attributes/tet:connectivity-matrices/" + + "tet:connectivity-matrix/tet:from/" + + "tet:label-restrictions/tet:label-restriction" { + when "../../../../../../../../nw:network-types/tet:te-topology/" + + "otnt:otn-topology" { + description + "Augmentation parameters apply only for networks with + OTN topology type."; + } + description + "Augment TE label range information for the source LTP + of the connectivity matrix entry."; + uses label-range-info; + } + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:te-node-attributes/tet:connectivity-matrices/" + + "tet:connectivity-matrix/tet:to/" + + "tet:label-restrictions/tet:label-restriction" { + when "../../../../../../../../nw:network-types/tet:te-topology/" + + "otnt:otn-topology" { + description + "Augmentation parameters apply only for networks with + OTN topology type."; + } + description + "Augment TE label range information for the destination LTP + of the connectivity matrix entry."; + uses label-range-info; + } + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:information-source-entry/" + + "tet:connectivity-matrices/tet:label-restrictions/" + + "tet:label-restriction" { + when "../../../../../../nw:network-types/tet:te-topology/" + + "otnt:otn-topology" { + description + + + + + "Augmentation parameters apply only for networks with + OTN topology type."; + } + description + "Augment TE label range information for the TE node + connectivity matrices information source."; + uses label-range-info; + } + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:information-source-entry/tet:connectivity-matrices/" + + "tet:connectivity-matrix/" + + "tet:from/tet:label-restrictions/tet:label-restriction" { + when "../../../../../../../../nw:network-types/tet:te-topology/" + + "otnt:otn-topology" { + description + "Augmentation parameters apply only for networks with + OTN topology type."; + } + description + "Augment TE label range information for the source LTP + of the connectivity matrix entry information source."; + uses label-range-info; + } + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:information-source-entry/tet:connectivity-matrices/" + + "tet:connectivity-matrix/" + + "tet:to/tet:label-restrictions/tet:label-restriction" { + when "../../../../../../../../nw:network-types/tet:te-topology/" + + "otnt:otn-topology" { + description + "Augmentation parameters apply only for networks with + OTN topology type."; + } + description + "Augment TE label range information for the destination LTP + of the connectivity matrix entry information source."; + uses label-range-info; + } + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:tunnel-termination-point/" + + "tet:local-link-connectivities/" + + "tet:label-restrictions/tet:label-restriction" { + when "../../../../../../nw:network-types/tet:te-topology/" + + "otnt:otn-topology" { + description + + + + + "Augmentation parameters apply only for networks with + OTN topology type."; + } + description + "Augment TE label range information for the TTP + Local Link Connectivities."; + uses label-range-info; + } + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:tunnel-termination-point/" + + "tet:local-link-connectivities/" + + "tet:local-link-connectivity/" + + "tet:label-restrictions/tet:label-restriction" { + when "../../../../../../../nw:network-types/tet:te-topology/" + + "otnt:otn-topology" { + description + "Augmentation parameters apply only for networks with + OTN topology type."; + } + description + "Augment TE label range information for the TTP + Local Link Connectivity entry."; + uses label-range-info; + } + + augment "/nw:networks/nw:network/nt:link/tet:te/" + + "tet:te-link-attributes/" + + "tet:label-restrictions/tet:label-restriction" { + when "../../../../../nw:network-types/tet:te-topology/" + + "otnt:otn-topology" { + description + "Augmentation parameters apply only for networks with + OTN topology type."; + } + description + "Augment TE label range information for the TE link."; + uses label-range-info; + } + + augment "/nw:networks/nw:network/nt:link/tet:te/" + + "tet:information-source-entry/" + + "tet:label-restrictions/tet:label-restriction" { + when "../../../../../nw:network-types/tet:te-topology/" + + "otnt:otn-topology" { + description + "Augmentation parameters apply only for networks with + OTN topology type."; + + + + + } + description + "Augment TE label range information for the TE link + information source."; + uses label-range-info; + } + + augment "/nw:networks/tet:te/tet:templates/" + + "tet:link-template/tet:te-link-attributes/" + + "tet:label-restrictions/tet:label-restriction" { + description + "Augment TE label range information for the TE link template."; + uses label-range-info; + } + + /* + * Augment TE label + */ + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:te-node-attributes/tet:connectivity-matrices/" + + "tet:label-restrictions/tet:label-restriction/" + + "tet:label-start/" + + "tet:te-label/tet:technology" { + when "../../../../../../../../nw:network-types/tet:te-topology/" + + "otnt:otn-topology" { + description + "Augmentation parameters apply only for networks with + OTN topology type."; + } + description + "Augment TE label range start for the TE node + connectivity matrices"; + case otn { + uses l1-types:otn-label-start-end; + } + } + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:te-node-attributes/tet:connectivity-matrices/" + + "tet:label-restrictions/" + + "tet:label-restriction/tet:label-end/" + + "tet:te-label/tet:technology" { + when "../../../../../../../../nw:network-types/tet:te-topology/" + + "otnt:otn-topology" { + description + "Augmentation parameters apply only for networks with + OTN topology type."; + + + + + } + description + "Augment TE label range end for the TE node + connectivity matrices"; + case otn { + uses l1-types:otn-label-start-end; + } + } + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:te-node-attributes/tet:connectivity-matrices/" + + "tet:label-restrictions/" + + "tet:label-restriction/tet:label-step/" + + "tet:technology" { + when "../../../../../../../nw:network-types/tet:te-topology/" + + "otnt:otn-topology" { + description + "Augmentation parameters apply only for networks with + OTN topology type."; + } + description + "Augment TE label range step for the TE node + connectivity matrices"; + case otn { + uses l1-types:otn-label-step; + } + } + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:te-node-attributes/tet:connectivity-matrices/" + + "tet:underlay/tet:primary-path/tet:path-element/" + + "tet:type/tet:label/tet:label-hop/" + + "tet:te-label/tet:technology" { + when "../../../../../../../../../" + + "nw:network-types/tet:te-topology/" + + "otnt:otn-topology" { + description + "Augmentation parameters apply only for networks with + OTN topology type."; + } + description + "Augment TE label hop for the underlay primary path of the + TE node connectivity matrices"; + case otn { + uses l1-types:otn-label-hop; + } + } + + + + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:te-node-attributes/tet:connectivity-matrices/" + + "tet:underlay/tet:backup-path/tet:path-element/" + + "tet:type/tet:label/tet:label-hop/" + + "tet:te-label/tet:technology" { + when "../../../../../../../../../" + + "nw:network-types/tet:te-topology/" + + "otnt:otn-topology" { + description + "Augmentation parameters apply only for networks with + OTN topology type."; + } + description + "Augment TE label hop for the underlay backup path of the + TE node connectivity matrices"; + case otn { + uses l1-types:otn-label-hop; + } + } + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:te-node-attributes/tet:connectivity-matrices/" + + "tet:optimizations/tet:algorithm/tet:metric/" + + "tet:optimization-metric/" + + "tet:explicit-route-exclude-objects/" + + "tet:route-object-exclude-object/" + + "tet:type/tet:label/tet:label-hop/" + + "tet:te-label/tet:technology" { + when "../../../../../../../../../../" + + "nw:network-types/tet:te-topology/" + + "otnt:otn-topology" { + description + "Augmentation parameters apply only for networks with + OTN topology type."; + } + description + "Augment TE label hop for the explicit route objects excluded + by the path computation of the TE node connectivity + matrices"; + case otn { + uses l1-types:otn-label-hop; + } + } + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:te-node-attributes/tet:connectivity-matrices/" + + "tet:optimizations/tet:algorithm/tet:metric/" + + "tet:optimization-metric/" + + + + + + "tet:explicit-route-include-objects/" + + "tet:route-object-include-object/" + + "tet:type/tet:label/tet:label-hop/" + + "tet:te-label/tet:technology" { + when "../../../../../../../../../../" + + "nw:network-types/tet:te-topology/" + + "otnt:otn-topology" { + description + "Augmentation parameters apply only for networks with + OTN topology type."; + } + description + "Augment TE label hop for the explicit route objects included + by the path computation of the TE node connectivity + matrices"; + case otn { + uses l1-types:otn-label-hop; + } + } + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:te-node-attributes/tet:connectivity-matrices/" + + "tet:path-properties/tet:path-route-objects/" + + "tet:path-route-object/tet:type/tet:label/tet:label-hop/" + + "tet:te-label/tet:technology" { + when "../../../../../../../../../" + + "nw:network-types/tet:te-topology/" + + "otnt:otn-topology" { + description + "Augmentation parameters apply only for networks with + OTN topology type."; + } + description + "Augment TE label hop for the computed path route objects + of the TE node connectivity matrices"; + case otn { + uses l1-types:otn-label-hop; + } + } + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:te-node-attributes/tet:connectivity-matrices/" + + "tet:connectivity-matrix/tet:from/" + + "tet:label-restrictions/tet:label-restriction/" + + "tet:label-start/" + + "tet:te-label/tet:technology" { + when "../../../../../../../../../../" + + "nw:network-types/tet:te-topology/" + + + + + + "otnt:otn-topology" { + description + "Augmentation parameters apply only for networks with + OTN topology type."; + } + description + "Augment TE label range start for the source LTP + of the connectivity matrix entry."; + case otn { + uses l1-types:otn-label-start-end; + } + } + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:te-node-attributes/tet:connectivity-matrices/" + + "tet:connectivity-matrix/tet:from/" + + "tet:label-restrictions/tet:label-restriction/" + + "tet:label-end/" + + "tet:te-label/tet:technology" { + when "../../../../../../../../../../" + + "nw:network-types/tet:te-topology/" + + "otnt:otn-topology" { + description + "Augmentation parameters apply only for networks with + OTN topology type."; + } + description + "Augment TE label range end for the source LTP + of the connectivity matrix entry."; + case otn { + uses l1-types:otn-label-start-end; + } + } + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:te-node-attributes/tet:connectivity-matrices/" + + "tet:connectivity-matrix/tet:from/" + + "tet:label-restrictions/tet:label-restriction/" + + "tet:label-step/" + + "tet:technology" { + when "../../../../../../../../../" + + "nw:network-types/tet:te-topology/" + + "otnt:otn-topology" { + description + "Augmentation parameters apply only for networks with + OTN topology type."; + } + description + + + + + "Augment TE label range step for the source LTP + of the connectivity matrix entry."; + case otn { + uses l1-types:otn-label-step; + } + } + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:te-node-attributes/tet:connectivity-matrices/" + + "tet:connectivity-matrix/tet:to/" + + "tet:label-restrictions/tet:label-restriction/" + + "tet:label-start/" + + "tet:te-label/tet:technology" { + when "../../../../../../../../../../" + + "nw:network-types/tet:te-topology/" + + "otnt:otn-topology" { + description + "Augmentation parameters apply only for networks with + OTN topology type."; + } + description + "Augment TE label range start for the destination LTP + of the connectivity matrix entry."; + case otn { + uses l1-types:otn-label-start-end; + } + } + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:te-node-attributes/tet:connectivity-matrices/" + + "tet:connectivity-matrix/tet:to/" + + "tet:label-restrictions/tet:label-restriction/" + + "tet:label-end/" + + "tet:te-label/tet:technology" { + when "../../../../../../../../../../" + + "nw:network-types/tet:te-topology/" + + "otnt:otn-topology" { + description + "Augmentation parameters apply only for networks with + OTN topology type."; + } + description + "Augment TE label range end for the destination LTP + of the connectivity matrix entry."; + case otn { + uses l1-types:otn-label-start-end; + } + } + + + + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:te-node-attributes/tet:connectivity-matrices/" + + "tet:connectivity-matrix/tet:to/" + + "tet:label-restrictions/tet:label-restriction/" + + "tet:label-step/" + + "tet:technology" { + when "../../../../../../../../../" + + "nw:network-types/tet:te-topology/" + + "otnt:otn-topology" { + description + "Augmentation parameters apply only for networks with + OTN topology type."; + } + description + "Augment TE label range step for the destination LTP + of the connectivity matrix entry."; + case otn { + uses l1-types:otn-label-step; + } + } + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:te-node-attributes/tet:connectivity-matrices/" + + "tet:connectivity-matrix/" + + "tet:underlay/tet:primary-path/tet:path-element/" + + "tet:type/tet:label/tet:label-hop/" + + "tet:te-label/tet:technology" { + when "../../../../../../../../../../" + + "nw:network-types/tet:te-topology/" + + "otnt:otn-topology" { + description + "Augmentation parameters apply only for networks with + OTN topology type."; + } + description + "Augment TE label hop for the underlay primary path + of the connectivity matrix entry."; + case otn { + uses l1-types:otn-label-hop; + } + } + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:te-node-attributes/tet:connectivity-matrices/" + + "tet:connectivity-matrix/" + + "tet:underlay/tet:backup-path/tet:path-element/" + + "tet:type/tet:label/tet:label-hop/" + + "tet:te-label/tet:technology" { + + + + + when "../../../../../../../../../../" + + "nw:network-types/tet:te-topology/" + + "otnt:otn-topology" { + description + "Augmentation parameters apply only for networks with + OTN topology type."; + } + description + "Augment TE label hop for the underlay backup path + of the connectivity matrix entry."; + case otn { + uses l1-types:otn-label-hop; + } + } + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:te-node-attributes/tet:connectivity-matrices/" + + "tet:connectivity-matrix/tet:optimizations/" + + "tet:algorithm/tet:metric/tet:optimization-metric/" + + "tet:explicit-route-exclude-objects/" + + "tet:route-object-exclude-object/tet:type/" + + "tet:label/tet:label-hop/tet:te-label/tet:technology" { + when "../../../../../../../../../../../" + + "nw:network-types/tet:te-topology/" + + "otnt:otn-topology" { + description + "Augmentation parameters apply only for networks with + OTN topology type."; + } + description + "Augment TE label hop for the explicit route objects excluded + by the path computation of the connectivity matrix entry."; + case otn { + uses l1-types:otn-label-hop; + } + } + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:te-node-attributes/tet:connectivity-matrices/" + + "tet:connectivity-matrix/tet:optimizations/" + + "tet:algorithm/tet:metric/tet:optimization-metric/" + + "tet:explicit-route-include-objects/" + + "tet:route-object-include-object/tet:type/" + + "tet:label/tet:label-hop/tet:te-label/tet:technology" { + when "../../../../../../../../../../../" + + "nw:network-types/tet:te-topology/" + + "otnt:otn-topology" { + description + + + + + "Augmentation parameters apply only for networks with + OTN topology type."; + } + description + "Augment TE label hop for the explicit route objects included + by the path computation of the connectivity matrix entry."; + case otn { + uses l1-types:otn-label-hop; + } + } + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:te-node-attributes/tet:connectivity-matrices/" + + "tet:connectivity-matrix/" + + "tet:path-properties/tet:path-route-objects/" + + "tet:path-route-object/tet:type/" + + "tet:label/tet:label-hop/tet:te-label/tet:technology" { + when "../../../../../../../../../../" + + "nw:network-types/tet:te-topology/" + + "otnt:otn-topology" { + description + "Augmentation parameters apply only for networks with + OTN topology type."; + } + description + "Augment TE label hop for the computed path route objects + of the connectivity matrix entry."; + case otn { + uses l1-types:otn-label-hop; + } + } + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:information-source-entry/" + + "tet:connectivity-matrices/tet:label-restrictions/" + + "tet:label-restriction/" + + "tet:label-start/tet:te-label/tet:technology" { + when "../../../../../../../../" + + "nw:network-types/tet:te-topology/" + + "otnt:otn-topology" { + description + "Augmentation parameters apply only for networks with + OTN topology type."; + } + description + "Augment TE label range start for the TE node connectivity + matrices information source."; + case otn { + + + + + uses l1-types:otn-label-start-end; + } + } + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:information-source-entry/" + + "tet:connectivity-matrices/tet:label-restrictions/" + + "tet:label-restriction/" + + "tet:label-end/tet:te-label/tet:technology" { + when "../../../../../../../../" + + "nw:network-types/tet:te-topology/" + + "otnt:otn-topology" { + description + "Augmentation parameters apply only for networks with + OTN topology type."; + } + description + "Augment TE label range end for the TE node connectivity + matrices information source."; + case otn { + uses l1-types:otn-label-start-end; + } + } + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:information-source-entry/" + + "tet:connectivity-matrices/tet:label-restrictions/" + + "tet:label-restriction/" + + "tet:label-step/tet:technology" { + when "../../../../../../../" + + "nw:network-types/tet:te-topology/" + + "otnt:otn-topology" { + description + "Augmentation parameters apply only for networks with + OTN topology type."; + } + description + "Augment TE label range step for the TE node connectivity + matrices information source."; + case otn { + uses l1-types:otn-label-step; + } + } + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:information-source-entry/tet:connectivity-matrices/" + + "tet:underlay/tet:primary-path/tet:path-element/tet:type/" + + "tet:label/tet:label-hop/tet:te-label/tet:technology" { + + + + + when "../../../../../../../../../" + + "nw:network-types/tet:te-topology/" + + "otnt:otn-topology" { + description + "Augmentation parameters apply only for networks with + OTN topology type."; + } + description + "Augment TE label hop for the underlay primary path + of the TE node connectivity matrices of the information + source entry."; + case otn { + uses l1-types:otn-label-hop; + } + } + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:information-source-entry/tet:connectivity-matrices/" + + "tet:underlay/tet:backup-path/tet:path-element/tet:type/" + + "tet:label/tet:label-hop/tet:te-label/tet:technology" { + when "../../../../../../../../../" + + "nw:network-types/tet:te-topology/" + + "otnt:otn-topology" { + description + "Augmentation parameters apply only for networks with + OTN topology type."; + } + description + "Augment TE label hop for the underlay backup path + of the TE node connectivity matrices of the information + source entry."; + case otn { + uses l1-types:otn-label-hop; + } + } + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:information-source-entry/tet:connectivity-matrices/" + + "tet:optimizations/tet:algorithm/tet:metric/" + + "tet:optimization-metric/" + + "tet:explicit-route-exclude-objects/" + + "tet:route-object-exclude-object/tet:type/" + + "tet:label/tet:label-hop/tet:te-label/tet:technology" { + when "../../../../../../../../../../" + + "nw:network-types/tet:te-topology/" + + "otnt:otn-topology" { + description + "Augmentation parameters apply only for networks with + + + + + OTN topology type."; + } + description + "Augment TE label hop for the explicit route objects excluded + by the path computation of the TE node connectivity matrices + information source."; + case otn { + uses l1-types:otn-label-hop; + } + } + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:information-source-entry/tet:connectivity-matrices/" + + "tet:optimizations/tet:algorithm/tet:metric/" + + "tet:optimization-metric/" + + "tet:explicit-route-include-objects/" + + "tet:route-object-include-object/tet:type/" + + "tet:label/tet:label-hop/tet:te-label/tet:technology" { + when "../../../../../../../../../../" + + "nw:network-types/tet:te-topology/" + + "otnt:otn-topology" { + description + "Augmentation parameters apply only for networks with + OTN topology type."; + } + description + "Augment TE label hop for the explicit route objects included + by the path computation of the TE node connectivity matrices + information source."; + case otn { + uses l1-types:otn-label-hop; + } + } + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:information-source-entry/tet:connectivity-matrices/" + + "tet:path-properties/tet:path-route-objects/" + + "tet:path-route-object/tet:type/" + + "tet:label/tet:label-hop/tet:te-label/tet:technology" { + when "../../../../../../../../../" + + "nw:network-types/tet:te-topology/" + + "otnt:otn-topology" { + description + "Augmentation parameters apply only for networks with + OTN topology type."; + } + description + "Augment TE label hop for the computed path route objects + + + + + of the TE node connectivity matrices information source."; + case otn { + uses l1-types:otn-label-hop; + } + } + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:information-source-entry/tet:connectivity-matrices/" + + "tet:connectivity-matrix/" + + "tet:from/tet:label-restrictions/" + + "tet:label-restriction/" + + "tet:label-start/tet:te-label/tet:technology" { + when "../../../../../../../../../../" + + "nw:network-types/tet:te-topology/" + + "otnt:otn-topology" { + description + "Augmentation parameters apply only for networks with + OTN topology type."; + } + description + "Augment TE label range start for the source LTP + of the connectivity matrix entry information source."; + case otn { + uses l1-types:otn-label-start-end; + } + } + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:information-source-entry/tet:connectivity-matrices/" + + "tet:connectivity-matrix/" + + "tet:from/tet:label-restrictions/" + + "tet:label-restriction/" + + "tet:label-end/tet:te-label/tet:technology" { + when "../../../../../../../../../../" + + "nw:network-types/tet:te-topology/" + + "otnt:otn-topology" { + description + "Augmentation parameters apply only for networks with + OTN topology type."; + } + description + "Augment TE label range end for the source LTP + of the connectivity matrix entry information source."; + case otn { + uses l1-types:otn-label-start-end; + } + } + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + + + + + "tet:information-source-entry/tet:connectivity-matrices/" + + "tet:connectivity-matrix/" + + "tet:from/tet:label-restrictions/" + + "tet:label-restriction/" + + "tet:label-step/tet:technology" { + when "../../../../../../../../../" + + "nw:network-types/tet:te-topology/" + + "otnt:otn-topology" { + description + "Augmentation parameters apply only for networks with + OTN topology type."; + } + description + "Augment TE label range step for the source LTP + of the connectivity matrix entry information source."; + case otn { + uses l1-types:otn-label-step; + } + } + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:information-source-entry/tet:connectivity-matrices/" + + "tet:connectivity-matrix/" + + "tet:to/tet:label-restrictions/tet:label-restriction/" + + "tet:label-start/tet:te-label/tet:technology" { + when "../../../../../../../../../../" + + "nw:network-types/tet:te-topology/" + + "otnt:otn-topology" { + description + "Augmentation parameters apply only for networks with + OTN topology type."; + } + description + "Augment TE label range start for the destination LTP + of the connectivity matrix entry information source."; + case otn { + uses l1-types:otn-label-start-end; + } + } + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:information-source-entry/tet:connectivity-matrices/" + + "tet:connectivity-matrix/" + + "tet:to/tet:label-restrictions/tet:label-restriction/" + + "tet:label-end/tet:te-label/tet:technology" { + when "../../../../../../../../../../" + + "nw:network-types/tet:te-topology/" + + "otnt:otn-topology" { + + + + + description + "Augmentation parameters apply only for networks with + OTN topology type."; + } + description + "Augment TE label range end for the destination LTP + of the connectivity matrix entry information source."; + case otn { + uses l1-types:otn-label-start-end; + } + } + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:information-source-entry/tet:connectivity-matrices/" + + "tet:connectivity-matrix/" + + "tet:to/tet:label-restrictions/tet:label-restriction/" + + "tet:label-step/tet:technology" { + when "../../../../../../../../../" + + "nw:network-types/tet:te-topology/" + + "otnt:otn-topology" { + description + "Augmentation parameters apply only for networks with + OTN topology type."; + } + description + "Augment TE label range step for the destination LTP + of the connectivity matrix entry information source."; + case otn { + uses l1-types:otn-label-step; + } + } + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:information-source-entry/tet:connectivity-matrices/" + + "tet:connectivity-matrix/" + + "tet:underlay/tet:primary-path/tet:path-element/tet:type/" + + "tet:label/tet:label-hop/tet:te-label/tet:technology" { + when "../../../../../../../../../../" + + "nw:network-types/tet:te-topology/" + + "otnt:otn-topology" { + description + "Augmentation parameters apply only for networks with + OTN topology type."; + } + description + "Augment TE label hop for the underlay primary path + of the connectivity matrix entry information source."; + case otn { + + + + + uses l1-types:otn-label-hop; + } + } + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:information-source-entry/tet:connectivity-matrices/" + + "tet:connectivity-matrix/" + + "tet:underlay/tet:backup-path/tet:path-element/tet:type/" + + "tet:label/tet:label-hop/tet:te-label/tet:technology" { + when "../../../../../../../../../../" + + "nw:network-types/tet:te-topology/" + + "otnt:otn-topology" { + description + "Augmentation parameters apply only for networks with + OTN topology type."; + } + description + "Augment TE label hop for the underlay backup path + of the connectivity matrix entry information source."; + case otn { + uses l1-types:otn-label-hop; + } + } + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:information-source-entry/tet:connectivity-matrices/" + + "tet:connectivity-matrix/" + + "tet:optimizations/tet:algorithm/tet:metric/" + + "tet:optimization-metric/" + + "tet:explicit-route-exclude-objects/" + + "tet:route-object-exclude-object/tet:type/" + + "tet:label/tet:label-hop/tet:te-label/tet:technology" { + when "../../../../../../../../../../../" + + "nw:network-types/tet:te-topology/" + + "otnt:otn-topology" { + description + "Augmentation parameters apply only for networks with + OTN topology type."; + } + description + "Augment TE label hop for the explicit route objects excluded + by the path computation of the connectivity matrix entry + information source."; + case otn { + uses l1-types:otn-label-hop; + } + } + + + + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:information-source-entry/tet:connectivity-matrices/" + + "tet:connectivity-matrix/" + + "tet:optimizations/tet:algorithm/tet:metric/" + + "tet:optimization-metric/" + + "tet:explicit-route-include-objects/" + + "tet:route-object-include-object/tet:type/" + + "tet:label/tet:label-hop/tet:te-label/tet:technology" { + when "../../../../../../../../../../../" + + "nw:network-types/tet:te-topology/" + + "otnt:otn-topology" { + description + "Augmentation parameters apply only for networks with + OTN topology type."; + } + description + "Augment TE label hop for the explicit route objects included + by the path computation of the connectivity matrix entry + information source."; + case otn { + uses l1-types:otn-label-hop; + } + } + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:information-source-entry/tet:connectivity-matrices/" + + "tet:connectivity-matrix/" + + "tet:path-properties/tet:path-route-objects/" + + "tet:path-route-object/tet:type/" + + "tet:label/tet:label-hop/tet:te-label/tet:technology" { + when "../../../../../../../../../../" + + "nw:network-types/tet:te-topology/" + + "otnt:otn-topology" { + description + "Augmentation parameters apply only for networks with + OTN topology type."; + } + description + "Augment TE label hop for the computed path route objects + of the connectivity matrix entry information source."; + case otn { + uses l1-types:otn-label-hop; + } + } + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:tunnel-termination-point/" + + "tet:local-link-connectivities/" + + + + + + "tet:label-restrictions/tet:label-restriction/" + + "tet:label-start/" + + "tet:te-label/tet:technology" { + when "../../../../../../../../" + + "nw:network-types/tet:te-topology/" + + "otnt:otn-topology" { + description + "Augmentation parameters apply only for networks with + OTN topology type."; + } + description + "Augment TE label range start for the TTP + Local Link Connectivities."; + case otn { + uses l1-types:otn-label-start-end; + } + } + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:tunnel-termination-point/" + + "tet:local-link-connectivities/" + + "tet:label-restrictions/tet:label-restriction/" + + "tet:label-end/" + + "tet:te-label/tet:technology"{ + when "../../../../../../../../" + + "nw:network-types/tet:te-topology/" + + "otnt:otn-topology" { + description + "Augmentation parameters apply only for networks with + OTN topology type."; + } + description + "Augment TE label range end for the TTP + Local Link Connectivities."; + case otn { + uses l1-types:otn-label-start-end; + } + } + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:tunnel-termination-point/" + + "tet:local-link-connectivities/" + + "tet:label-restrictions/tet:label-restriction/" + + "tet:label-step/" + + "tet:technology"{ + when "../../../../../../../" + + "nw:network-types/tet:te-topology/" + + "otnt:otn-topology" { + + + + + description + "Augmentation parameters apply only for networks with + OTN topology type."; + } + description + "Augment TE label range step for the TTP + Local Link Connectivities."; + case otn { + uses l1-types:otn-label-step; + } + } + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:tunnel-termination-point/" + + "tet:local-link-connectivities/" + + "tet:underlay/tet:primary-path/tet:path-element/tet:type/" + + "tet:label/tet:label-hop/tet:te-label/tet:technology" { + when "../../../../../../../../../" + + "nw:network-types/tet:te-topology/" + + "otnt:otn-topology" { + description + "Augmentation parameters apply only for networks with + OTN topology type."; + } + description + "Augment TE label hop for the underlay primary path + of the TTP Local Link Connectivities."; + case otn { + uses l1-types:otn-label-hop; + } + } + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:tunnel-termination-point/" + + "tet:local-link-connectivities/" + + "tet:underlay/tet:backup-path/tet:path-element/tet:type/" + + "tet:label/tet:label-hop/tet:te-label/tet:technology" { + when "../../../../../../../../../" + + "nw:network-types/tet:te-topology/" + + "otnt:otn-topology" { + description + "Augmentation parameters apply only for networks with + OTN topology type."; + } + description + "Augment TE label hop for the underlay backup path + of the TTP Local Link Connectivities."; + case otn { + + + + + uses l1-types:otn-label-hop; + } + } + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:tunnel-termination-point/" + + "tet:local-link-connectivities/" + + "tet:optimizations/tet:algorithm/tet:metric/" + + "tet:optimization-metric/" + + "tet:explicit-route-exclude-objects/" + + "tet:route-object-exclude-object/tet:type/" + + "tet:label/tet:label-hop/tet:te-label/tet:technology" { + when "../../../../../../../../../../" + + "nw:network-types/tet:te-topology/" + + "otnt:otn-topology" { + description + "Augmentation parameters apply only for networks with + OTN topology type."; + } + description + "Augment TE label hop for the explicit route objects excluded + by the path computation of the TTP Local Link + Connectivities."; + case otn { + uses l1-types:otn-label-hop; + } + } + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:tunnel-termination-point/" + + "tet:local-link-connectivities/" + + "tet:optimizations/tet:algorithm/tet:metric/" + + "tet:optimization-metric/" + + "tet:explicit-route-include-objects/" + + "tet:route-object-include-object/tet:type/" + + "tet:label/tet:label-hop/tet:te-label/tet:technology" { + when "../../../../../../../../../../" + + "nw:network-types/tet:te-topology/" + + "otnt:otn-topology" { + description + "Augmentation parameters apply only for networks with + OTN topology type."; + } + description + "Augment TE label hop for the explicit route objects included + by the path computation of the TTP Local Link + Connectivities."; + case otn { + + + + + uses l1-types:otn-label-hop; + } + } + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:tunnel-termination-point/" + + "tet:local-link-connectivities/" + + "tet:path-properties/tet:path-route-objects/" + + "tet:path-route-object/tet:type/" + + "tet:label/tet:label-hop/tet:te-label/tet:technology" { + when "../../../../../../../../../" + + "nw:network-types/tet:te-topology/" + + "otnt:otn-topology" { + description + "Augmentation parameters apply only for networks with + OTN topology type."; + } + description + "Augment TE label hop for the computed path route objects + of the TTP Local Link Connectivities."; + case otn { + uses l1-types:otn-label-hop; + } + } + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:tunnel-termination-point/" + + "tet:local-link-connectivities/" + + "tet:local-link-connectivity/" + + "tet:label-restrictions/tet:label-restriction/" + + "tet:label-start/tet:te-label/tet:technology" { + when "../../../../../../../../../" + + "nw:network-types/tet:te-topology/" + + "otnt:otn-topology" { + description + "Augmentation parameters apply only for networks with + OTN topology type."; + } + description + "Augment TE label range start for the TTP + Local Link Connectivity entry."; + case otn { + uses l1-types:otn-label-start-end; + } + } + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:tunnel-termination-point/" + + + + + + "tet:local-link-connectivities/" + + "tet:local-link-connectivity/" + + "tet:label-restrictions/tet:label-restriction/" + + "tet:label-end/tet:te-label/tet:technology" { + when "../../../../../../../../../" + + "nw:network-types/tet:te-topology/" + + "otnt:otn-topology" { + description + "Augmentation parameters apply only for networks with + OTN topology type."; + } + description + "Augment TE label range end for the TTP + Local Link Connectivity entry."; + case otn { + uses l1-types:otn-label-start-end; + } + } + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:tunnel-termination-point/" + + "tet:local-link-connectivities/" + + "tet:local-link-connectivity/" + + "tet:label-restrictions/tet:label-restriction/" + + "tet:label-step/tet:technology" { + when "../../../../../../../../" + + "nw:network-types/tet:te-topology/" + + "otnt:otn-topology" { + description + "Augmentation parameters apply only for networks with + OTN topology type."; + } + description + "Augment TE label range step for the TTP + Local Link Connectivity entry."; + case otn { + uses l1-types:otn-label-step; + } + } + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:tunnel-termination-point/" + + "tet:local-link-connectivities/" + + "tet:local-link-connectivity/" + + "tet:underlay/tet:primary-path/tet:path-element/tet:type/" + + "tet:label/tet:label-hop/tet:te-label/tet:technology" { + when "../../../../../../../../../../" + + "nw:network-types/tet:te-topology/" + + + + + + "otnt:otn-topology" { + description + "Augmentation parameters apply only for networks with + OTN topology type."; + } + description + "Augment TE label hop for the underlay primary path + of the TTP Local Link Connectivity entry."; + case otn { + uses l1-types:otn-label-hop; + } + } + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:tunnel-termination-point/" + + "tet:local-link-connectivities/" + + "tet:local-link-connectivity/" + + "tet:underlay/tet:backup-path/tet:path-element/tet:type/" + + "tet:label/tet:label-hop/tet:te-label/tet:technology" { + when "../../../../../../../../../../" + + "nw:network-types/tet:te-topology/" + + "otnt:otn-topology" { + description + "Augmentation parameters apply only for networks with + OTN topology type."; + } + description + "Augment TE label hop for the underlay backup path + of the TTP Local Link Connectivity entry."; + case otn { + uses l1-types:otn-label-hop; + } + } + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:tunnel-termination-point/" + + "tet:local-link-connectivities/" + + "tet:local-link-connectivity/" + + "tet:optimizations/tet:algorithm/tet:metric/" + + "tet:optimization-metric/" + + "tet:explicit-route-exclude-objects/" + + "tet:route-object-exclude-object/tet:type/" + + "tet:label/tet:label-hop/tet:te-label/tet:technology" { + when "../../../../../../../../../../../" + + "nw:network-types/tet:te-topology/" + + "otnt:otn-topology" { + description + "Augmentation parameters apply only for networks with + + + + + OTN topology type."; + } + description + "Augment TE label hop for the explicit route objects excluded + by the path computation of the TTP Local Link + Connectivity entry."; + case otn { + uses l1-types:otn-label-hop; + } + } + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:tunnel-termination-point/" + + "tet:local-link-connectivities/" + + "tet:local-link-connectivity/" + + "tet:optimizations/tet:algorithm/tet:metric/" + + "tet:optimization-metric/" + + "tet:explicit-route-include-objects/" + + "tet:route-object-include-object/tet:type/" + + "tet:label/tet:label-hop/tet:te-label/tet:technology" { + when "../../../../../../../../../../../" + + "nw:network-types/tet:te-topology/" + + "otnt:otn-topology" { + description + "Augmentation parameters apply only for networks with + OTN topology type."; + } + description + "Augment TE label hop for the explicit route objects included + by the path computation of the TTP Local Link + Connectivity entry."; + case otn { + uses l1-types:otn-label-hop; + } + } + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:tunnel-termination-point/" + + "tet:local-link-connectivities/" + + "tet:local-link-connectivity/" + + "tet:path-properties/tet:path-route-objects/" + + "tet:path-route-object/tet:type/" + + "tet:label/tet:label-hop/tet:te-label/tet:technology" { + when "../../../../../../../../../../" + + "nw:network-types/tet:te-topology/" + + "otnt:otn-topology" { + description + "Augmentation parameters apply only for networks with + + + + + OTN topology type."; + } + description + "Augment TE label hop for the computed path route objects + of the TTP Local Link Connectivity entry."; + case otn { + uses l1-types:otn-label-hop; + } + } + augment "/nw:networks/nw:network/nt:link/tet:te/" + + "tet:te-link-attributes/" + + "tet:underlay/tet:primary-path/tet:path-element/tet:type/" + + "tet:label/tet:label-hop/tet:te-label/tet:technology" { + when "../../../../../../../../" + + "nw:network-types/tet:te-topology/" + + "otnt:otn-topology" { + description + "Augmentation parameters apply only for networks with + OTN topology type."; + } + description + "Augment TE label hop for the underlay primary path + of the TE link."; + case otn { + uses l1-types:otn-label-hop; + } + } + + augment "/nw:networks/nw:network/nt:link/tet:te/" + + "tet:te-link-attributes/" + + "tet:underlay/tet:backup-path/tet:path-element/tet:type/" + + "tet:label/tet:label-hop/tet:te-label/tet:technology" { + when "../../../../../../../../" + + "nw:network-types/tet:te-topology/" + + "otnt:otn-topology" { + description + "Augmentation parameters apply only for networks with + OTN topology type."; + } + description + "Augment TE label hop for the underlay backup path + of the TE link."; + case otn { + uses l1-types:otn-label-hop; + } + } + + augment "/nw:networks/nw:network/nt:link/tet:te/" + + + + + + "tet:te-link-attributes/" + + "tet:label-restrictions/tet:label-restriction/" + + "tet:label-start/tet:te-label/tet:technology" { + when "../../../../../../../nw:network-types/tet:te-topology/" + + "otnt:otn-topology" { + description + "Augmentation parameters apply only for networks with + OTN topology type."; + } + description + "Augment TE label range start for the TE link."; + case otn { + uses l1-types:otn-label-start-end; + } + } + + augment "/nw:networks/nw:network/nt:link/tet:te/" + + "tet:te-link-attributes/" + + "tet:label-restrictions/tet:label-restriction/" + + "tet:label-end/tet:te-label/tet:technology" { + when "../../../../../../../nw:network-types/tet:te-topology/" + + "otnt:otn-topology" { + description + "Augmentation parameters apply only for networks with + OTN topology type."; + } + description + "Augment TE label range end for the TE link."; + case otn { + uses l1-types:otn-label-start-end; + } + } + + augment "/nw:networks/nw:network/nt:link/tet:te/" + + "tet:te-link-attributes/" + + "tet:label-restrictions/tet:label-restriction/" + + "tet:label-step/tet:technology" { + when "../../../../../../nw:network-types/tet:te-topology/" + + "otnt:otn-topology" { + description + "Augmentation parameters apply only for networks with + OTN topology type."; + } + description + "Augment TE label range step for the TE link."; + case otn { + uses l1-types:otn-label-step; + } + + + + + } + + augment "/nw:networks/nw:network/nt:link/tet:te/" + + "tet:information-source-entry/" + + "tet:label-restrictions/tet:label-restriction/" + + "tet:label-start/tet:te-label/tet:technology" { + when "../../../../../../../nw:network-types/tet:te-topology/" + + "otnt:otn-topology" { + description + "Augmentation parameters apply only for networks with + OTN topology type."; + } + description + "Augment TE label range start for the TE link + information source."; + case otn { + uses l1-types:otn-label-start-end; + } + } + + augment "/nw:networks/nw:network/nt:link/tet:te/" + + "tet:information-source-entry/" + + "tet:label-restrictions/tet:label-restriction/" + + "tet:label-end/tet:te-label/tet:technology" { + when "../../../../../../../nw:network-types/tet:te-topology/" + + "otnt:otn-topology" { + description + "Augmentation parameters apply only for networks with + OTN topology type."; + } + description + "Augment TE label range end for the TE link + information source."; + case otn { + uses l1-types:otn-label-start-end; + } + } + + augment "/nw:networks/nw:network/nt:link/tet:te/" + + "tet:information-source-entry/" + + "tet:label-restrictions/tet:label-restriction/" + + "tet:label-step/tet:technology" { + when "../../../../../../nw:network-types/tet:te-topology/" + + "otnt:otn-topology" { + description + "Augmentation parameters apply only for networks with + OTN topology type."; + } + + + + + description + "Augment TE label range step for the TE link + information source."; + case otn { + uses l1-types:otn-label-step; + } + } + + augment "/nw:networks/tet:te/tet:templates/" + + "tet:link-template/tet:te-link-attributes/" + + "tet:underlay/tet:primary-path/tet:path-element/tet:type/" + + "tet:label/tet:label-hop/tet:te-label/tet:technology" { + description + "Augment TE label hop for the underlay primary path + of the TE link template."; + case otn { + uses l1-types:otn-label-hop; + } + } + + augment "/nw:networks/tet:te/tet:templates/" + + "tet:link-template/tet:te-link-attributes/" + + "tet:underlay/tet:backup-path/tet:path-element/tet:type/" + + "tet:label/tet:label-hop/tet:te-label/tet:technology" { + description + "Augment TE label hop for the underlay backup path + of the TE link template."; + case otn { + uses l1-types:otn-label-hop; + } + } + + augment "/nw:networks/tet:te/tet:templates/" + + "tet:link-template/tet:te-link-attributes/" + + "tet:label-restrictions/tet:label-restriction/" + + "tet:label-start/tet:te-label/tet:technology" { + description + "Augment TE label range start for the TE link template."; + case otn { + uses l1-types:otn-label-start-end; + } + } + + augment "/nw:networks/tet:te/tet:templates/" + + "tet:link-template/tet:te-link-attributes/" + + "tet:label-restrictions/tet:label-restriction/" + + "tet:label-end/tet:te-label/tet:technology" { + description + + + + + "Augment TE label range end for the TE link template."; + case otn { + uses l1-types:otn-label-start-end; + } + } + + augment "/nw:networks/tet:te/tet:templates/" + + "tet:link-template/tet:te-link-attributes/" + + "tet:label-restrictions/tet:label-restriction/" + + "tet:label-step/tet:technology" { + description + "Augment TE label range step for the TE link template."; + case otn { + uses l1-types:otn-label-step; + } + } + } diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/yang/ietf-routing-types@2017-12-04.yang b/src/nbi/service/rest_server/nbi_plugins/ietf_network/yang/ietf-routing-types@2017-12-04.yang new file mode 100644 index 0000000000000000000000000000000000000000..695d9eaeb9e771b945397c8b1c817ce91b0414af --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/yang/ietf-routing-types@2017-12-04.yang @@ -0,0 +1,774 @@ + module ietf-routing-types { + namespace "urn:ietf:params:xml:ns:yang:ietf-routing-types"; + prefix rt-types; + + import ietf-yang-types { + prefix yang; + } + import ietf-inet-types { + prefix inet; + } + + organization + "IETF RTGWG - Routing Area Working Group"; + contact + "WG Web: + WG List: + + Editors: Xufeng Liu + + Yingzhen Qu + + Acee Lindem + + Christian Hopps + + Lou Berger + "; + + description + "This module contains a collection of YANG data types + considered generally useful for routing protocols. + + Copyright (c) 2017 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 + (https://trustee.ietf.org/license-info). + + This version of this YANG module is part of RFC 8294; see + the RFC itself for full legal notices."; + + revision 2017-12-04 { + description "Initial revision."; + reference + "RFC 8294: Common YANG Data Types for the Routing Area. + Section 3."; + } + + /*** Identities related to MPLS/GMPLS ***/ + + identity mpls-label-special-purpose-value { + description + "Base identity for deriving identities describing + special-purpose Multiprotocol Label Switching (MPLS) label + values."; + reference + "RFC 7274: Allocating and Retiring Special-Purpose MPLS + Labels."; + } + + identity ipv4-explicit-null-label { + base mpls-label-special-purpose-value; + description + "This identity represents the IPv4 Explicit NULL Label."; + reference + "RFC 3032: MPLS Label Stack Encoding. Section 2.1."; + } + + identity router-alert-label { + base mpls-label-special-purpose-value; + description + "This identity represents the Router Alert Label."; + reference + "RFC 3032: MPLS Label Stack Encoding. Section 2.1."; + } + + identity ipv6-explicit-null-label { + base mpls-label-special-purpose-value; + description + "This identity represents the IPv6 Explicit NULL Label."; + reference + "RFC 3032: MPLS Label Stack Encoding. Section 2.1."; + } + + identity implicit-null-label { + base mpls-label-special-purpose-value; + description + "This identity represents the Implicit NULL Label."; + reference + "RFC 3032: MPLS Label Stack Encoding. Section 2.1."; + } + + identity entropy-label-indicator { + base mpls-label-special-purpose-value; + description + "This identity represents the Entropy Label Indicator."; + reference + "RFC 6790: The Use of Entropy Labels in MPLS Forwarding. + Sections 3 and 10.1."; + } + + identity gal-label { + base mpls-label-special-purpose-value; + description + "This identity represents the Generic Associated Channel + (G-ACh) Label (GAL)."; + reference + "RFC 5586: MPLS Generic Associated Channel. + Sections 4 and 10."; + } + + identity oam-alert-label { + base mpls-label-special-purpose-value; + description + "This identity represents the OAM Alert Label."; + reference + "RFC 3429: Assignment of the 'OAM Alert Label' for + Multiprotocol Label Switching Architecture (MPLS) + Operation and Maintenance (OAM) Functions. + Sections 3 and 6."; + } + + identity extension-label { + base mpls-label-special-purpose-value; + description + "This identity represents the Extension Label."; + reference + "RFC 7274: Allocating and Retiring Special-Purpose MPLS + Labels. Sections 3.1 and 5."; + } + + /*** Collection of types related to routing ***/ + + typedef router-id { + type yang:dotted-quad; + description + "A 32-bit number in the dotted-quad format assigned to each + router. This number uniquely identifies the router within + an Autonomous System."; + } + + /*** Collection of types related to VPNs ***/ + + typedef route-target { + type string { + pattern + '(0:(6553[0-5]|655[0-2][0-9]|65[0-4][0-9]{2}|' + + '6[0-4][0-9]{3}|' + + '[1-5][0-9]{4}|[1-9][0-9]{0,3}|0):(429496729[0-5]|' + + '42949672[0-8][0-9]|' + + '4294967[01][0-9]{2}|429496[0-6][0-9]{3}|' + + '42949[0-5][0-9]{4}|' + + '4294[0-8][0-9]{5}|429[0-3][0-9]{6}|' + + '42[0-8][0-9]{7}|4[01][0-9]{8}|' + + '[1-3][0-9]{9}|[1-9][0-9]{0,8}|0))|' + + '(1:((([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|' + + '25[0-5])\.){3}([0-9]|[1-9][0-9]|' + + '1[0-9]{2}|2[0-4][0-9]|25[0-5])):(6553[0-5]|' + + '655[0-2][0-9]|' + + '65[0-4][0-9]{2}|6[0-4][0-9]{3}|' + + '[1-5][0-9]{4}|[1-9][0-9]{0,3}|0))|' + + '(2:(429496729[0-5]|42949672[0-8][0-9]|' + + '4294967[01][0-9]{2}|' + + '429496[0-6][0-9]{3}|42949[0-5][0-9]{4}|' + + '4294[0-8][0-9]{5}|' + + '429[0-3][0-9]{6}|42[0-8][0-9]{7}|4[01][0-9]{8}|' + + '[1-3][0-9]{9}|[1-9][0-9]{0,8}|0):' + + '(6553[0-5]|655[0-2][0-9]|65[0-4][0-9]{2}|' + + '6[0-4][0-9]{3}|' + + '[1-5][0-9]{4}|[1-9][0-9]{0,3}|0))|' + + '(6(:[a-fA-F0-9]{2}){6})|' + + '(([3-57-9a-fA-F]|[1-9a-fA-F][0-9a-fA-F]{1,3}):' + + '[0-9a-fA-F]{1,12})'; + } + + description + "A Route Target is an 8-octet BGP extended community + initially identifying a set of sites in a BGP VPN + (RFC 4364). However, it has since taken on a more general + role in BGP route filtering. A Route Target consists of two + or three fields: a 2-octet Type field, an administrator + field, and, optionally, an assigned number field. + + According to the data formats for types 0, 1, 2, and 6 as + defined in RFC 4360, RFC 5668, and RFC 7432, the encoding + pattern is defined as: + + 0:2-octet-asn:4-octet-number + 1:4-octet-ipv4addr:2-octet-number + 2:4-octet-asn:2-octet-number + 6:6-octet-mac-address + + Additionally, a generic pattern is defined for future + Route Target types: + + 2-octet-other-hex-number:6-octet-hex-number + + Some valid examples are 0:100:100, 1:1.1.1.1:100, + 2:1234567890:203, and 6:26:00:08:92:78:00."; + reference + "RFC 4360: BGP Extended Communities Attribute. + RFC 4364: BGP/MPLS IP Virtual Private Networks (VPNs). + RFC 5668: 4-Octet AS Specific BGP Extended Community. + RFC 7432: BGP MPLS-Based Ethernet VPN."; + } + + typedef ipv6-route-target { + type string { + pattern + '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}' + + '((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|' + + '(((25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])\.){3}' + + '(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])))' + + ':' + + '(6553[0-5]|655[0-2][0-9]|65[0-4][0-9]{2}|' + + '6[0-4][0-9]{3}|' + + '[1-5][0-9]{4}|[1-9][0-9]{0,3}|0)'; + pattern '((([^:]+:){6}(([^:]+:[^:]+)|(.*\..*)))|' + + '((([^:]+:)*[^:]+)?::(([^:]+:)*[^:]+)?))' + + ':' + + '(6553[0-5]|655[0-2][0-9]|65[0-4][0-9]{2}|' + + '6[0-4][0-9]{3}|' + + '[1-5][0-9]{4}|[1-9][0-9]{0,3}|0)'; + } + description + "An IPv6 Route Target is a 20-octet BGP IPv6 Address + Specific Extended Community serving the same function + as a standard 8-octet Route Target, except that it only + allows an IPv6 address as the global administrator. + The format is . + + Two valid examples are 2001:db8::1:6544 and + 2001:db8::5eb1:791:6b37:17958."; + reference + "RFC 5701: IPv6 Address Specific BGP Extended Community + Attribute."; + } + + typedef route-target-type { + type enumeration { + enum import { + value 0; + description + "The Route Target applies to route import."; + } + enum export { + value 1; + description + "The Route Target applies to route export."; + } + + enum both { + value 2; + description + "The Route Target applies to both route import and + route export."; + } + } + description + "Indicates the role a Route Target takes in route filtering."; + reference + "RFC 4364: BGP/MPLS IP Virtual Private Networks (VPNs)."; + } + + typedef route-distinguisher { + type string { + pattern + '(0:(6553[0-5]|655[0-2][0-9]|65[0-4][0-9]{2}|' + + '6[0-4][0-9]{3}|' + + '[1-5][0-9]{4}|[1-9][0-9]{0,3}|0):(429496729[0-5]|' + + '42949672[0-8][0-9]|' + + '4294967[01][0-9]{2}|429496[0-6][0-9]{3}|' + + '42949[0-5][0-9]{4}|' + + '4294[0-8][0-9]{5}|429[0-3][0-9]{6}|' + + '42[0-8][0-9]{7}|4[01][0-9]{8}|' + + '[1-3][0-9]{9}|[1-9][0-9]{0,8}|0))|' + + '(1:((([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|' + + '25[0-5])\.){3}([0-9]|[1-9][0-9]|' + + '1[0-9]{2}|2[0-4][0-9]|25[0-5])):(6553[0-5]|' + + '655[0-2][0-9]|' + + '65[0-4][0-9]{2}|6[0-4][0-9]{3}|' + + '[1-5][0-9]{4}|[1-9][0-9]{0,3}|0))|' + + '(2:(429496729[0-5]|42949672[0-8][0-9]|' + + '4294967[01][0-9]{2}|' + + '429496[0-6][0-9]{3}|42949[0-5][0-9]{4}|' + + '4294[0-8][0-9]{5}|' + + '429[0-3][0-9]{6}|42[0-8][0-9]{7}|4[01][0-9]{8}|' + + '[1-3][0-9]{9}|[1-9][0-9]{0,8}|0):' + + '(6553[0-5]|655[0-2][0-9]|65[0-4][0-9]{2}|' + + '6[0-4][0-9]{3}|' + + '[1-5][0-9]{4}|[1-9][0-9]{0,3}|0))|' + + '(6(:[a-fA-F0-9]{2}){6})|' + + '(([3-57-9a-fA-F]|[1-9a-fA-F][0-9a-fA-F]{1,3}):' + + '[0-9a-fA-F]{1,12})'; + } + + description + "A Route Distinguisher is an 8-octet value used to + distinguish routes from different BGP VPNs (RFC 4364). + A Route Distinguisher will have the same format as a + Route Target as per RFC 4360 and will consist of + two or three fields: a 2-octet Type field, an administrator + field, and, optionally, an assigned number field. + + According to the data formats for types 0, 1, 2, and 6 as + defined in RFC 4360, RFC 5668, and RFC 7432, the encoding + pattern is defined as: + + 0:2-octet-asn:4-octet-number + 1:4-octet-ipv4addr:2-octet-number + 2:4-octet-asn:2-octet-number + 6:6-octet-mac-address + + Additionally, a generic pattern is defined for future + route discriminator types: + + 2-octet-other-hex-number:6-octet-hex-number + + Some valid examples are 0:100:100, 1:1.1.1.1:100, + 2:1234567890:203, and 6:26:00:08:92:78:00."; + reference + "RFC 4360: BGP Extended Communities Attribute. + RFC 4364: BGP/MPLS IP Virtual Private Networks (VPNs). + RFC 5668: 4-Octet AS Specific BGP Extended Community. + RFC 7432: BGP MPLS-Based Ethernet VPN."; + } + + typedef route-origin { + type string { + pattern + '(0:(6553[0-5]|655[0-2][0-9]|65[0-4][0-9]{2}|' + + '6[0-4][0-9]{3}|' + + '[1-5][0-9]{4}|[1-9][0-9]{0,3}|0):(429496729[0-5]|' + + '42949672[0-8][0-9]|' + + '4294967[01][0-9]{2}|429496[0-6][0-9]{3}|' + + '42949[0-5][0-9]{4}|' + + '4294[0-8][0-9]{5}|429[0-3][0-9]{6}|' + + '42[0-8][0-9]{7}|4[01][0-9]{8}|' + + '[1-3][0-9]{9}|[1-9][0-9]{0,8}|0))|' + + '(1:((([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|' + + '25[0-5])\.){3}([0-9]|[1-9][0-9]|' + + '1[0-9]{2}|2[0-4][0-9]|25[0-5])):(6553[0-5]|' + + '655[0-2][0-9]|' + + '65[0-4][0-9]{2}|6[0-4][0-9]{3}|' + + '[1-5][0-9]{4}|[1-9][0-9]{0,3}|0))|' + + '(2:(429496729[0-5]|42949672[0-8][0-9]|' + + '4294967[01][0-9]{2}|' + + '429496[0-6][0-9]{3}|42949[0-5][0-9]{4}|' + + '4294[0-8][0-9]{5}|' + + '429[0-3][0-9]{6}|42[0-8][0-9]{7}|4[01][0-9]{8}|' + + '[1-3][0-9]{9}|[1-9][0-9]{0,8}|0):' + + '(6553[0-5]|655[0-2][0-9]|65[0-4][0-9]{2}|' + + '6[0-4][0-9]{3}|' + + '[1-5][0-9]{4}|[1-9][0-9]{0,3}|0))|' + + '(6(:[a-fA-F0-9]{2}){6})|' + + '(([3-57-9a-fA-F]|[1-9a-fA-F][0-9a-fA-F]{1,3}):' + + '[0-9a-fA-F]{1,12})'; + } + description + "A Route Origin is an 8-octet BGP extended community + identifying the set of sites where the BGP route + originated (RFC 4364). A Route Origin will have the same + format as a Route Target as per RFC 4360 and will consist + of two or three fields: a 2-octet Type field, an + administrator field, and, optionally, an assigned number + field. + + According to the data formats for types 0, 1, 2, and 6 as + defined in RFC 4360, RFC 5668, and RFC 7432, the encoding + pattern is defined as: + + 0:2-octet-asn:4-octet-number + 1:4-octet-ipv4addr:2-octet-number + 2:4-octet-asn:2-octet-number + 6:6-octet-mac-address + + Additionally, a generic pattern is defined for future + Route Origin types: + + 2-octet-other-hex-number:6-octet-hex-number + + Some valid examples are 0:100:100, 1:1.1.1.1:100, + 2:1234567890:203, and 6:26:00:08:92:78:00."; + reference + "RFC 4360: BGP Extended Communities Attribute. + RFC 4364: BGP/MPLS IP Virtual Private Networks (VPNs). + RFC 5668: 4-Octet AS Specific BGP Extended Community. + RFC 7432: BGP MPLS-Based Ethernet VPN."; + } + + typedef ipv6-route-origin { + type string { + pattern + '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}' + + '((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|' + + '(((25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])\.){3}' + + '(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])))' + + ':' + + '(6553[0-5]|655[0-2][0-9]|65[0-4][0-9]{2}|' + + '6[0-4][0-9]{3}|' + + '[1-5][0-9]{4}|[1-9][0-9]{0,3}|0)'; + pattern '((([^:]+:){6}(([^:]+:[^:]+)|(.*\..*)))|' + + '((([^:]+:)*[^:]+)?::(([^:]+:)*[^:]+)?))' + + ':' + + '(6553[0-5]|655[0-2][0-9]|65[0-4][0-9]{2}|' + + '6[0-4][0-9]{3}|' + + '[1-5][0-9]{4}|[1-9][0-9]{0,3}|0)'; + } + description + "An IPv6 Route Origin is a 20-octet BGP IPv6 Address + Specific Extended Community serving the same function + as a standard 8-octet route, except that it only allows + an IPv6 address as the global administrator. The format + is . + + Two valid examples are 2001:db8::1:6544 and + 2001:db8::5eb1:791:6b37:17958."; + reference + "RFC 5701: IPv6 Address Specific BGP Extended Community + Attribute."; + } + + /*** Collection of types common to multicast ***/ + + typedef ipv4-multicast-group-address { + type inet:ipv4-address { + pattern '(2((2[4-9])|(3[0-9]))\.).*'; + } + description + "This type represents an IPv4 multicast group address, + which is in the range of 224.0.0.0 to 239.255.255.255."; + reference + "RFC 1112: Host Extensions for IP Multicasting."; + } + + typedef ipv6-multicast-group-address { + type inet:ipv6-address { + pattern '(([fF]{2}[0-9a-fA-F]{2}):).*'; + } + description + "This type represents an IPv6 multicast group address, + which is in the range of ff00::/8."; + reference + "RFC 4291: IP Version 6 Addressing Architecture. Section 2.7. + RFC 7346: IPv6 Multicast Address Scopes."; + } + + typedef ip-multicast-group-address { + type union { + type ipv4-multicast-group-address; + type ipv6-multicast-group-address; + } + description + "This type represents a version-neutral IP multicast group + address. The format of the textual representation implies + the IP version."; + } + + typedef ipv4-multicast-source-address { + type union { + type enumeration { + enum * { + description + "Any source address."; + } + } + type inet:ipv4-address; + } + description + "Multicast source IPv4 address type."; + } + + typedef ipv6-multicast-source-address { + type union { + type enumeration { + enum * { + description + "Any source address."; + } + } + type inet:ipv6-address; + } + description + "Multicast source IPv6 address type."; + } + + /*** Collection of types common to protocols ***/ + + typedef bandwidth-ieee-float32 { + type string { + pattern + '0[xX](0((\.0?)?[pP](\+)?0?|(\.0?))|' + + '1(\.([0-9a-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\+)?(12[0-7]|' + + '1[01][0-9]|0?[0-9]?[0-9])?)'; + } + description + "Bandwidth in IEEE 754 floating-point 32-bit binary format: + (-1)**(S) * 2**(Exponent-127) * (1 + Fraction), + where Exponent uses 8 bits and Fraction uses 23 bits. + The units are octets per second. + The encoding format is the external hexadecimal-significant + character sequences specified in IEEE 754 and ISO/IEC C99. + The format is restricted to be normalized, non-negative, and + non-fraction: 0x1.hhhhhhp{+}d, 0X1.HHHHHHP{+}D, or 0x0p0, + where 'h' and 'H' are hexadecimal digits and 'd' and 'D' are + integers in the range of [0..127]. + + When six hexadecimal digits are used for 'hhhhhh' or + 'HHHHHH', the least significant digit must be an even + number. 'x' and 'X' indicate hexadecimal; 'p' and 'P' + indicate a power of two. Some examples are 0x0p0, 0x1p10, + and 0x1.abcde2p+20."; + reference + "IEEE Std 754-2008: IEEE Standard for Floating-Point + Arithmetic. + ISO/IEC C99: Information technology - Programming + Languages - C."; + } + + typedef link-access-type { + type enumeration { + enum broadcast { + description + "Specify broadcast multi-access network."; + } + enum non-broadcast-multiaccess { + description + "Specify Non-Broadcast Multi-Access (NBMA) network."; + } + enum point-to-multipoint { + description + "Specify point-to-multipoint network."; + } + enum point-to-point { + description + "Specify point-to-point network."; + } + } + description + "Link access type."; + } + + typedef timer-multiplier { + type uint8; + description + "The number of timer value intervals that should be + interpreted as a failure."; + } + + typedef timer-value-seconds16 { + type union { + type uint16 { + range "1..65535"; + } + type enumeration { + enum infinity { + description + "The timer is set to infinity."; + } + enum not-set { + description + "The timer is not set."; + } + } + } + units "seconds"; + description + "Timer value type, in seconds (16-bit range)."; + } + + typedef timer-value-seconds32 { + type union { + type uint32 { + range "1..4294967295"; + } + type enumeration { + enum infinity { + description + "The timer is set to infinity."; + } + enum not-set { + description + "The timer is not set."; + } + } + } + units "seconds"; + description + "Timer value type, in seconds (32-bit range)."; + } + + typedef timer-value-milliseconds { + type union { + type uint32 { + range "1..4294967295"; + } + type enumeration { + enum infinity { + description + "The timer is set to infinity."; + } + enum not-set { + description + "The timer is not set."; + } + } + } + units "milliseconds"; + description + "Timer value type, in milliseconds."; + } + + typedef percentage { + type uint8 { + range "0..100"; + } + description + "Integer indicating a percentage value."; + } + + typedef timeticks64 { + type uint64; + description + "This type is based on the timeticks type defined in + RFC 6991, but with 64-bit width. It represents the time, + modulo 2^64, in hundredths of a second between two epochs."; + reference + "RFC 6991: Common YANG Data Types."; + } + + typedef uint24 { + type uint32 { + range "0..16777215"; + } + description + "24-bit unsigned integer."; + } + + /*** Collection of types related to MPLS/GMPLS ***/ + + typedef generalized-label { + type binary; + description + "Generalized Label. Nodes sending and receiving the + Generalized Label are aware of the link-specific + label context and type."; + reference + "RFC 3471: Generalized Multi-Protocol Label Switching (GMPLS) + Signaling Functional Description. Section 3.2."; + } + + typedef mpls-label-special-purpose { + type identityref { + base mpls-label-special-purpose-value; + } + description + "This type represents the special-purpose MPLS label values."; + reference + "RFC 3032: MPLS Label Stack Encoding. + RFC 7274: Allocating and Retiring Special-Purpose MPLS + Labels."; + } + + typedef mpls-label-general-use { + type uint32 { + range "16..1048575"; + } + description + "The 20-bit label value in an MPLS label stack as specified + in RFC 3032. This label value does not include the + encodings of Traffic Class and TTL (Time to Live). + The label range specified by this type is for general use, + with special-purpose MPLS label values excluded."; + reference + "RFC 3032: MPLS Label Stack Encoding."; + } + + typedef mpls-label { + type union { + type mpls-label-special-purpose; + type mpls-label-general-use; + } + description + "The 20-bit label value in an MPLS label stack as specified + in RFC 3032. This label value does not include the + encodings of Traffic Class and TTL."; + reference + "RFC 3032: MPLS Label Stack Encoding."; + } + + /*** Groupings **/ + + grouping mpls-label-stack { + description + "This grouping specifies an MPLS label stack. The label + stack is encoded as a list of label stack entries. The + list key is an identifier that indicates the relative + ordering of each entry, with the lowest-value identifier + corresponding to the top of the label stack."; + container mpls-label-stack { + description + "Container for a list of MPLS label stack entries."; + list entry { + key "id"; + description + "List of MPLS label stack entries."; + leaf id { + type uint8; + description + "Identifies the entry in a sequence of MPLS label + stack entries. An entry with a smaller identifier + value precedes an entry with a larger identifier + value in the label stack. The value of this ID has + no semantic meaning other than relative ordering + and referencing the entry."; + } + leaf label { + type rt-types:mpls-label; + description + "Label value."; + } + + leaf ttl { + type uint8; + description + "Time to Live (TTL)."; + reference + "RFC 3032: MPLS Label Stack Encoding."; + } + leaf traffic-class { + type uint8 { + range "0..7"; + } + description + "Traffic Class (TC)."; + reference + "RFC 5462: Multiprotocol Label Switching (MPLS) Label + Stack Entry: 'EXP' Field Renamed to 'Traffic Class' + Field."; + } + } + } + } + + grouping vpn-route-targets { + description + "A grouping that specifies Route Target import-export rules + used in BGP-enabled VPNs."; + reference + "RFC 4364: BGP/MPLS IP Virtual Private Networks (VPNs). + RFC 4664: Framework for Layer 2 Virtual Private Networks + (L2VPNs)."; + list vpn-target { + key "route-target"; + description + "List of Route Targets."; + leaf route-target { + type rt-types:route-target; + description + "Route Target value."; + } + leaf route-target-type { + type rt-types:route-target-type; + mandatory true; + description + "Import/export type of the Route Target."; + } + } + } + } diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/yang/ietf-te-packet-types@2020-06-10.yang b/src/nbi/service/rest_server/nbi_plugins/ietf_network/yang/ietf-te-packet-types@2020-06-10.yang new file mode 100644 index 0000000000000000000000000000000000000000..8e7d4aafadcc34ec21dbf553d72852dc64624c4a --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/yang/ietf-te-packet-types@2020-06-10.yang @@ -0,0 +1,475 @@ +module ietf-te-packet-types { + yang-version 1.1; + namespace "urn:ietf:params:xml:ns:yang:ietf-te-packet-types"; + prefix te-packet-types; + + /* Import TE generic types */ + + import ietf-te-types { + prefix te-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: Tarek Saad + + + Editor: Rakesh Gandhi + + + Editor: Vishnu Pavan Beeram + + + Editor: Xufeng Liu + + + Editor: Igor Bryskin + "; + description + "This YANG module contains a collection of generally useful YANG + data type definitions specific to MPLS TE. The model fully + conforms to the Network Management Datastore Architecture + (NMDA). + + Copyright (c) 2020 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 + (https://trustee.ietf.org/license-info). + + This version of this YANG module is part of RFC 8776; see the + RFC itself for full legal notices."; + + revision 2020-06-10 { + description + "Latest revision of TE MPLS types."; + reference + "RFC 8776: Common YANG Data Types for Traffic Engineering"; + } + + /** + * Typedefs + */ + + typedef te-bandwidth-requested-type { + type enumeration { + enum specified { + description + "Bandwidth is explicitly specified."; + } + enum auto { + description + "Bandwidth is automatically computed."; + } + } + description + "Enumerated type for specifying whether bandwidth is + explicitly specified or automatically computed."; + } + + typedef te-class-type { + type uint8; + description + "Diffserv-TE Class-Type. Defines a set of Traffic Trunks + crossing a link that is governed by a specific set of + bandwidth constraints. Class-Type is used for the purposes + of link bandwidth allocation, constraint-based routing, and + admission control."; + reference + "RFC 4124: Protocol Extensions for Support of Diffserv-aware + MPLS Traffic Engineering"; + } + + typedef bc-type { + type uint8 { + range "0..7"; + } + description + "Diffserv-TE bandwidth constraints as defined in RFC 4124."; + reference + "RFC 4124: Protocol Extensions for Support of Diffserv-aware + MPLS Traffic Engineering"; + } + + typedef bandwidth-kbps { + type uint64; + units "Kbps"; + description + "Bandwidth values, expressed in kilobits per second."; + } + + typedef bandwidth-mbps { + type uint64; + units "Mbps"; + description + "Bandwidth values, expressed in megabits per second."; + } + + typedef bandwidth-gbps { + type uint64; + units "Gbps"; + description + "Bandwidth values, expressed in gigabits per second."; + } + + identity backup-protection-type { + description + "Base identity for the backup protection type."; + } + + identity backup-protection-link { + base backup-protection-type; + description + "Backup provides link protection only."; + } + + identity backup-protection-node-link { + base backup-protection-type; + description + "Backup offers node (preferred) or link protection."; + } + + identity bc-model-type { + description + "Base identity for the Diffserv-TE Bandwidth Constraints + Model type."; + reference + "RFC 4124: Protocol Extensions for Support of Diffserv-aware + MPLS Traffic Engineering"; + } + + identity bc-model-rdm { + base bc-model-type; + description + "Russian Dolls Bandwidth Constraints Model type."; + reference + "RFC 4127: Russian Dolls Bandwidth Constraints Model for + Diffserv-aware MPLS Traffic Engineering"; + } + + identity bc-model-mam { + base bc-model-type; + description + "Maximum Allocation Bandwidth Constraints Model type."; + reference + "RFC 4125: Maximum Allocation Bandwidth Constraints Model for + Diffserv-aware MPLS Traffic Engineering"; + } + + identity bc-model-mar { + base bc-model-type; + description + "Maximum Allocation with Reservation Bandwidth Constraints + Model type."; + reference + "RFC 4126: Max Allocation with Reservation Bandwidth + Constraints Model for Diffserv-aware MPLS Traffic Engineering + & Performance Comparisons"; + } + + grouping performance-metrics-attributes-packet { + description + "Contains PM attributes."; + uses te-types:performance-metrics-attributes { + augment "performance-metrics-one-way" { + leaf one-way-min-delay { + type uint32 { + range "0..16777215"; + } + description + "One-way minimum delay or latency in microseconds."; + } + leaf one-way-min-delay-normality { + type te-types:performance-metrics-normality; + default "normal"; + description + "One-way minimum delay or latency normality."; + } + leaf one-way-max-delay { + type uint32 { + range "0..16777215"; + } + description + "One-way maximum delay or latency in microseconds."; + } + leaf one-way-max-delay-normality { + type te-types:performance-metrics-normality; + default "normal"; + description + "One-way maximum delay or latency normality."; + } + leaf one-way-delay-variation { + type uint32 { + range "0..16777215"; + } + description + "One-way delay variation in microseconds."; + reference + "RFC 5481: Packet Delay Variation Applicability + Statement, Section 4.2"; + } + leaf one-way-delay-variation-normality { + type te-types:performance-metrics-normality; + default "normal"; + description + "One-way delay variation normality."; + reference + "RFC 7471: OSPF Traffic Engineering (TE) Metric + Extensions + RFC 7823: Performance-Based Path Selection for + Explicitly Routed Label Switched Paths (LSPs) Using + TE Metric Extensions + RFC 8570: IS-IS Traffic Engineering (TE) Metric + Extensions"; + } + leaf one-way-packet-loss { + type decimal64 { + fraction-digits 6; + range "0..50.331642"; + } + description + "One-way packet loss as a percentage of the total traffic + sent over a configurable interval. The finest precision + is 0.000003%, where the maximum is 50.331642%."; + reference + "RFC 8570: IS-IS Traffic Engineering (TE) Metric + Extensions, Section 4.4"; + } + leaf one-way-packet-loss-normality { + type te-types:performance-metrics-normality; + default "normal"; + description + "Packet loss normality."; + reference + "RFC 7471: OSPF Traffic Engineering (TE) Metric + Extensions + RFC 7823: Performance-Based Path Selection for + Explicitly Routed Label Switched Paths (LSPs) Using + TE Metric Extensions + RFC 8570: IS-IS Traffic Engineering (TE) Metric + Extensions"; + } + description + "PM one-way packet-specific augmentation for a generic PM + grouping."; + } + augment "performance-metrics-two-way" { + leaf two-way-min-delay { + type uint32 { + range "0..16777215"; + } + default "0"; + description + "Two-way minimum delay or latency in microseconds."; + } + leaf two-way-min-delay-normality { + type te-types:performance-metrics-normality; + default "normal"; + description + "Two-way minimum delay or latency normality."; + reference + "RFC 7471: OSPF Traffic Engineering (TE) Metric + Extensions + RFC 7823: Performance-Based Path Selection for + Explicitly Routed Label Switched Paths (LSPs) Using + TE Metric Extensions + RFC 8570: IS-IS Traffic Engineering (TE) Metric + Extensions"; + } + leaf two-way-max-delay { + type uint32 { + range "0..16777215"; + } + default "0"; + description + "Two-way maximum delay or latency in microseconds."; + } + leaf two-way-max-delay-normality { + type te-types:performance-metrics-normality; + default "normal"; + description + "Two-way maximum delay or latency normality."; + reference + "RFC 7471: OSPF Traffic Engineering (TE) Metric + Extensions + RFC 7823: Performance-Based Path Selection for + Explicitly Routed Label Switched Paths (LSPs) Using + TE Metric Extensions + RFC 8570: IS-IS Traffic Engineering (TE) Metric + Extensions"; + } + leaf two-way-delay-variation { + type uint32 { + range "0..16777215"; + } + default "0"; + description + "Two-way delay variation in microseconds."; + reference + "RFC 5481: Packet Delay Variation Applicability + Statement, Section 4.2"; + } + leaf two-way-delay-variation-normality { + type te-types:performance-metrics-normality; + default "normal"; + description + "Two-way delay variation normality."; + reference + "RFC 7471: OSPF Traffic Engineering (TE) Metric + Extensions + RFC 7823: Performance-Based Path Selection for + Explicitly Routed Label Switched Paths (LSPs) Using + TE Metric Extensions + RFC 8570: IS-IS Traffic Engineering (TE) Metric + Extensions"; + } + leaf two-way-packet-loss { + type decimal64 { + fraction-digits 6; + range "0..50.331642"; + } + default "0"; + description + "Two-way packet loss as a percentage of the total traffic + sent over a configurable interval. The finest precision + is 0.000003%."; + } + leaf two-way-packet-loss-normality { + type te-types:performance-metrics-normality; + default "normal"; + description + "Two-way packet loss normality."; + } + description + "PM two-way packet-specific augmentation for a generic PM + grouping."; + reference + "RFC 7471: OSPF Traffic Engineering (TE) Metric Extensions + RFC 7823: Performance-Based Path Selection for + Explicitly Routed Label Switched Paths (LSPs) Using + TE Metric Extensions + RFC 8570: IS-IS Traffic Engineering (TE) Metric + Extensions"; + } + } + } + + grouping one-way-performance-metrics-packet { + description + "One-way packet PM throttle grouping."; + leaf one-way-min-delay { + type uint32 { + range "0..16777215"; + } + default "0"; + description + "One-way minimum delay or latency in microseconds."; + } + leaf one-way-max-delay { + type uint32 { + range "0..16777215"; + } + default "0"; + description + "One-way maximum delay or latency in microseconds."; + } + leaf one-way-delay-variation { + type uint32 { + range "0..16777215"; + } + default "0"; + description + "One-way delay variation in microseconds."; + } + leaf one-way-packet-loss { + type decimal64 { + fraction-digits 6; + range "0..50.331642"; + } + default "0"; + description + "One-way packet loss as a percentage of the total traffic + sent over a configurable interval. The finest precision is + 0.000003%."; + } + } + + grouping two-way-performance-metrics-packet { + description + "Two-way packet PM throttle grouping."; + leaf two-way-min-delay { + type uint32 { + range "0..16777215"; + } + default "0"; + description + "Two-way minimum delay or latency in microseconds."; + } + leaf two-way-max-delay { + type uint32 { + range "0..16777215"; + } + default "0"; + description + "Two-way maximum delay or latency in microseconds."; + } + leaf two-way-delay-variation { + type uint32 { + range "0..16777215"; + } + default "0"; + description + "Two-way delay variation in microseconds."; + } + leaf two-way-packet-loss { + type decimal64 { + fraction-digits 6; + range "0..50.331642"; + } + default "0"; + description + "Two-way packet loss as a percentage of the total traffic + sent over a configurable interval. The finest precision is + 0.000003%."; + } + } + + grouping performance-metrics-throttle-container-packet { + description + "Packet PM threshold grouping."; + uses te-types:performance-metrics-throttle-container { + augment "throttle/threshold-out" { + uses one-way-performance-metrics-packet; + uses two-way-performance-metrics-packet; + description + "PM threshold-out packet augmentation for a + generic grouping."; + } + augment "throttle/threshold-in" { + uses one-way-performance-metrics-packet; + uses two-way-performance-metrics-packet; + description + "PM threshold-in packet augmentation for a + generic grouping."; + } + augment "throttle/threshold-accelerated-advertisement" { + uses one-way-performance-metrics-packet; + uses two-way-performance-metrics-packet; + description + "PM accelerated advertisement packet augmentation for a + generic grouping."; + } + } + } +} diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/yang/ietf-te-topology@2020-08-06.yang b/src/nbi/service/rest_server/nbi_plugins/ietf_network/yang/ietf-te-topology@2020-08-06.yang new file mode 100644 index 0000000000000000000000000000000000000000..6d76a77b21ba5609094a670290e5bd81562c3022 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/yang/ietf-te-topology@2020-08-06.yang @@ -0,0 +1,1952 @@ +module ietf-te-topology { + yang-version 1.1; + namespace "urn:ietf:params:xml:ns:yang:ietf-te-topology"; + prefix tet; + + import ietf-yang-types { + prefix yang; + reference + "RFC 6991: Common YANG Data Types"; + } + import ietf-inet-types { + prefix inet; + reference + "RFC 6991: Common YANG Data Types"; + } + import ietf-te-types { + prefix te-types; + reference + "RFC 8776: Common YANG Data Types for Traffic Engineering"; + } + import ietf-network { + prefix nw; + reference + "RFC 8345: A YANG Data Model for Network Topologies"; + } + import ietf-network-topology { + prefix nt; + reference + "RFC 8345: A YANG Data Model for Network Topologies"; + } + + organization + "IETF Traffic Engineering Architecture and Signaling (TEAS) + Working Group"; + contact + "WG Web: + WG List: + + Editor: Xufeng Liu + + + Editor: Igor Bryskin + + + Editor: Vishnu Pavan Beeram + + + Editor: Tarek Saad + + + Editor: Himanshu Shah + + + Editor: Oscar Gonzalez de Dios + "; + description + "This YANG module defines a TE topology model for representing, + retrieving, and manipulating technology-agnostic TE topologies. + + Copyright (c) 2020 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 + (https://trustee.ietf.org/license-info). + + This version of this YANG module is part of RFC 8795; see the + RFC itself for full legal notices."; + + revision 2020-08-06 { + description + "Initial revision."; + reference + "RFC 8795: YANG Data Model for Traffic Engineering (TE) + Topologies"; + } + + /* + * Features + */ + + feature nsrlg { + description + "This feature indicates that the system supports NSRLGs + (Non-Shared Risk Link Groups)."; + } + + feature te-topology-hierarchy { + description + "This feature indicates that the system allows an underlay + and/or overlay TE topology hierarchy."; + } + + feature template { + description + "This feature indicates that the system supports + template configuration."; + } + + /* + * Typedefs + */ + + typedef geographic-coordinate-degree { + type decimal64 { + fraction-digits 8; + } + description + "Decimal degree (DD) used to express latitude and longitude + geographic coordinates."; + } + // geographic-coordinate-degree + + typedef te-info-source { + type enumeration { + enum unknown { + description + "The source is unknown."; + } + enum locally-configured { + description + "Configured entity."; + } + enum ospfv2 { + description + "OSPFv2."; + } + enum ospfv3 { + description + "OSPFv3."; + } + enum isis { + description + "IS-IS."; + } + enum bgp-ls { + description + "BGP-LS."; + reference + "RFC 7752: North-Bound Distribution of Link-State and + Traffic Engineering (TE) Information Using BGP"; + } + enum system-processed { + description + "System-processed entity."; + } + enum other { + description + "Other source."; + } + } + description + "Describes the type of source that has provided the + related information, and the source's credibility."; + } + // te-info-source + + /* + * Groupings + */ + + grouping connectivity-matrix-entry-path-attributes { + description + "Attributes of a connectivity matrix entry."; + leaf is-allowed { + type boolean; + description + "'true' - switching is allowed; + 'false' - switching is disallowed."; + } + container underlay { + if-feature "te-topology-hierarchy"; + description + "Attributes of the TE link underlay."; + reference + "RFC 4206: Label Switched Paths (LSP) Hierarchy with + Generalized Multi-Protocol Label Switching (GMPLS) + Traffic Engineering (TE)"; + uses te-link-underlay-attributes; + } + uses te-types:generic-path-constraints; + uses te-types:generic-path-optimization; + uses te-types:generic-path-properties; + } + // connectivity-matrix-entry-path-attributes + + grouping geolocation-container { + description + "Contains a GPS location."; + container geolocation { + config false; + description + "Contains a GPS location."; + leaf altitude { + type int64; + units "millimeters"; + description + "Distance above sea level."; + } + leaf latitude { + type geographic-coordinate-degree { + range "-90..90"; + } + description + "Relative position north or south on the Earth's surface."; + } + leaf longitude { + type geographic-coordinate-degree { + range "-180..180"; + } + description + "Angular distance east or west on the Earth's surface."; + } + } + // geolocation + } + // geolocation-container + + grouping information-source-state-attributes { + description + "The attributes identifying the source that has provided the + related information, and the source's credibility."; + leaf credibility-preference { + type uint16; + description + "The preference value for calculating the Traffic + Engineering database credibility value used for + tie-break selection between different information-source + values. A higher value is preferable."; + } + leaf logical-network-element { + type string; + description + "When applicable, this is the name of a logical network + element from which the information is learned."; + } + leaf network-instance { + type string; + description + "When applicable, this is the name of a network instance + from which the information is learned."; + } + } + // information-source-state-attributes + + grouping information-source-per-link-attributes { + description + "Per-node container of the attributes identifying the source + that has provided the related information, and the source's + credibility."; + leaf information-source { + type te-info-source; + config false; + description + "Indicates the type of information source."; + } + leaf information-source-instance { + type string; + config false; + description + "The name indicating the instance of the information + source."; + } + container information-source-state { + config false; + description + "Contains state attributes related to the information + source."; + uses information-source-state-attributes; + container topology { + description + "When the information is processed by the system, + the attributes in this container indicate which topology + is used to generate the result information."; + uses nt:link-ref; + } + } + } + // information-source-per-link-attributes + + grouping information-source-per-node-attributes { + description + "Per-node container of the attributes identifying the source + that has provided the related information, and the source's + credibility."; + leaf information-source { + type te-info-source; + config false; + description + "Indicates the type of information source."; + } + leaf information-source-instance { + type string; + config false; + description + "The name indicating the instance of the information + source."; + } + container information-source-state { + config false; + description + "Contains state attributes related to the information + source."; + uses information-source-state-attributes; + container topology { + description + "When the information is processed by the system, + the attributes in this container indicate which topology + is used to generate the result information."; + uses nw:node-ref; + } + } + } + // information-source-per-node-attributes + + grouping interface-switching-capability-list { + description + "List of Interface Switching Capability Descriptors (ISCDs)."; + list interface-switching-capability { + key "switching-capability encoding"; + description + "List of ISCDs for this link."; + reference + "RFC 3471: Generalized Multi-Protocol Label Switching (GMPLS) + Signaling Functional Description + RFC 4203: OSPF Extensions in Support of Generalized + Multi-Protocol Label Switching (GMPLS)"; + leaf switching-capability { + type identityref { + base te-types:switching-capabilities; + } + description + "Switching capability for this interface."; + } + leaf encoding { + type identityref { + base te-types:lsp-encoding-types; + } + description + "Encoding supported by this interface."; + } + uses te-link-iscd-attributes; + } + // interface-switching-capability + } + // interface-switching-capability-list + + grouping statistics-per-link { + description + "Statistics attributes per TE link."; + leaf discontinuity-time { + type yang:date-and-time; + description + "The time of the most recent occasion at which any one or + more of this interface's counters suffered a + discontinuity. If no such discontinuities have occurred + since the last re-initialization of the local management + subsystem, then this node contains the time the local + management subsystem re-initialized itself."; + } + /* Administrative attributes */ + leaf disables { + type yang:counter32; + description + "Number of times that a link was disabled."; + } + leaf enables { + type yang:counter32; + description + "Number of times that a link was enabled."; + } + leaf maintenance-clears { + type yang:counter32; + description + "Number of times that a link was taken out of maintenance."; + } + leaf maintenance-sets { + type yang:counter32; + description + "Number of times that a link was put in maintenance."; + } + leaf modifies { + type yang:counter32; + description + "Number of times that a link was modified."; + } + /* Operational attributes */ + leaf downs { + type yang:counter32; + description + "Number of times that a link was set to an operational state + of 'down'."; + } + leaf ups { + type yang:counter32; + description + "Number of times that a link was set to an operational state + of 'up'."; + } + /* Recovery attributes */ + leaf fault-clears { + type yang:counter32; + description + "Number of times that a link experienced a fault-clear + event."; + } + leaf fault-detects { + type yang:counter32; + description + "Number of times that a link experienced fault detection."; + } + leaf protection-switches { + type yang:counter32; + description + "Number of times that a link experienced protection + switchover."; + } + leaf protection-reverts { + type yang:counter32; + description + "Number of times that a link experienced protection + reversion."; + } + leaf restoration-failures { + type yang:counter32; + description + "Number of times that a link experienced restoration + failure."; + } + leaf restoration-starts { + type yang:counter32; + description + "Number of times that a link experienced restoration + start."; + } + leaf restoration-successes { + type yang:counter32; + description + "Number of times that a link experienced restoration + success."; + } + leaf restoration-reversion-failures { + type yang:counter32; + description + "Number of times that a link experienced restoration + reversion failure."; + } + leaf restoration-reversion-starts { + type yang:counter32; + description + "Number of times that a link experienced restoration + reversion start."; + } + leaf restoration-reversion-successes { + type yang:counter32; + description + "Number of times that a link experienced restoration + reversion success."; + } + } + // statistics-per-link + + grouping statistics-per-node { + description + "Statistics attributes per TE node."; + leaf discontinuity-time { + type yang:date-and-time; + description + "The time of the most recent occasion at which any one or + more of this interface's counters suffered a + discontinuity. If no such discontinuities have occurred + since the last re-initialization of the local management + subsystem, then this node contains the time the local + management subsystem re-initialized itself."; + } + container node { + description + "Contains statistics attributes at the TE node level."; + leaf disables { + type yang:counter32; + description + "Number of times that a node was disabled."; + } + leaf enables { + type yang:counter32; + description + "Number of times that a node was enabled."; + } + leaf maintenance-sets { + type yang:counter32; + description + "Number of times that a node was put in maintenance."; + } + leaf maintenance-clears { + type yang:counter32; + description + "Number of times that a node was taken out of + maintenance."; + } + leaf modifies { + type yang:counter32; + description + "Number of times that a node was modified."; + } + } + // node + container connectivity-matrix-entry { + description + "Contains statistics attributes at the level of a + connectivity matrix entry."; + leaf creates { + type yang:counter32; + description + "Number of times that a connectivity matrix entry was + created."; + reference + "RFC 6241: Network Configuration Protocol (NETCONF), + Section 7.2, 'create' operation"; + } + leaf deletes { + type yang:counter32; + description + "Number of times that a connectivity matrix entry was + deleted."; + reference + "RFC 6241: Network Configuration Protocol (NETCONF), + Section 7.2, 'delete' operation"; + } + leaf disables { + type yang:counter32; + description + "Number of times that a connectivity matrix entry was + disabled."; + } + leaf enables { + type yang:counter32; + description + "Number of times that a connectivity matrix entry was + enabled."; + } + leaf modifies { + type yang:counter32; + description + "Number of times that a connectivity matrix entry was + modified."; + } + } + // connectivity-matrix-entry + } + // statistics-per-node + + grouping statistics-per-ttp { + description + "Statistics attributes per TE TTP (Tunnel Termination Point)."; + leaf discontinuity-time { + type yang:date-and-time; + description + "The time of the most recent occasion at which any one or + more of this interface's counters suffered a + discontinuity. If no such discontinuities have occurred + since the last re-initialization of the local management + subsystem, then this node contains the time the local + management subsystem re-initialized itself."; + } + container tunnel-termination-point { + description + "Contains statistics attributes at the TE TTP level."; + /* Administrative attributes */ + leaf disables { + type yang:counter32; + description + "Number of times that a TTP was disabled."; + } + leaf enables { + type yang:counter32; + description + "Number of times that a TTP was enabled."; + } + leaf maintenance-clears { + type yang:counter32; + description + "Number of times that a TTP was taken out of maintenance."; + } + leaf maintenance-sets { + type yang:counter32; + description + "Number of times that a TTP was put in maintenance."; + } + leaf modifies { + type yang:counter32; + description + "Number of times that a TTP was modified."; + } + /* Operational attributes */ + leaf downs { + type yang:counter32; + description + "Number of times that a TTP was set to an operational state + of 'down'."; + } + leaf ups { + type yang:counter32; + description + "Number of times that a TTP was set to an operational state + of 'up'."; + } + leaf in-service-clears { + type yang:counter32; + description + "Number of times that a TTP was taken out of service + (TE tunnel was released)."; + } + leaf in-service-sets { + type yang:counter32; + description + "Number of times that a TTP was put in service by a TE + tunnel (TE tunnel was set up)."; + } + } + // tunnel-termination-point + container local-link-connectivity { + description + "Contains statistics attributes at the TE LLCL (Local Link + Connectivity List) level."; + leaf creates { + type yang:counter32; + description + "Number of times that an LLCL entry was created."; + reference + "RFC 6241: Network Configuration Protocol (NETCONF), + Section 7.2, 'create' operation"; + } + leaf deletes { + type yang:counter32; + description + "Number of times that an LLCL entry was deleted."; + reference + "RFC 6241: Network Configuration Protocol (NETCONF), + Section 7.2, 'delete' operation"; + } + leaf disables { + type yang:counter32; + description + "Number of times that an LLCL entry was disabled."; + } + leaf enables { + type yang:counter32; + description + "Number of times that an LLCL entry was enabled."; + } + leaf modifies { + type yang:counter32; + description + "Number of times that an LLCL entry was modified."; + } + } + // local-link-connectivity + } + // statistics-per-ttp + + grouping te-link-augment { + description + "Augmentation for a TE link."; + uses te-link-config; + uses te-link-state-derived; + container statistics { + config false; + description + "Statistics data."; + uses statistics-per-link; + } + } + // te-link-augment + + grouping te-link-config { + description + "TE link configuration grouping."; + choice bundle-stack-level { + description + "The TE link can be partitioned into bundled links or + component links."; + case bundle { + container bundled-links { + description + "A set of bundled links."; + reference + "RFC 4201: Link Bundling in MPLS Traffic + Engineering (TE)"; + list bundled-link { + key "sequence"; + description + "Specifies a bundled interface that is + further partitioned."; + leaf sequence { + type uint32; + description + "Identifies the sequence in the bundle."; + } + } + } + } + case component { + container component-links { + description + "A set of component links."; + list component-link { + key "sequence"; + description + "Specifies a component interface that is + sufficient to unambiguously identify the + appropriate resources."; + leaf sequence { + type uint32; + description + "Identifies the sequence in the bundle."; + } + leaf src-interface-ref { + type string; + description + "Reference to a component link interface on the + source node."; + } + leaf des-interface-ref { + type string; + description + "Reference to a component link interface on the + destination node."; + } + } + } + } + } + // bundle-stack-level + leaf-list te-link-template { + if-feature "template"; + type leafref { + path "../../../../te/templates/link-template/name"; + } + description + "The reference to a TE link template."; + } + uses te-link-config-attributes; + } + // te-link-config + + grouping te-link-config-attributes { + description + "Link configuration attributes in a TE topology."; + container te-link-attributes { + description + "Link attributes in a TE topology."; + leaf access-type { + type te-types:te-link-access-type; + description + "Link access type, which can be point-to-point or + multi-access."; + } + container external-domain { + description + "For an inter-domain link, specifies the attributes of + the remote end of the link, to facilitate the signaling at + the local end."; + uses nw:network-ref; + leaf remote-te-node-id { + type te-types:te-node-id; + description + "Remote TE node identifier, used together with + 'remote-te-link-tp-id' to identify the remote Link + Termination Point (LTP) in a different domain."; + } + leaf remote-te-link-tp-id { + type te-types:te-tp-id; + description + "Remote TE LTP identifier, used together with + 'remote-te-node-id' to identify the remote LTP in a + different domain."; + } + } + leaf is-abstract { + type empty; + description + "Present if the link is abstract."; + } + leaf name { + type string; + description + "Link name."; + } + container underlay { + if-feature "te-topology-hierarchy"; + description + "Attributes of the TE link underlay."; + reference + "RFC 4206: Label Switched Paths (LSP) Hierarchy with + Generalized Multi-Protocol Label Switching (GMPLS) + Traffic Engineering (TE)"; + uses te-link-underlay-attributes; + } + leaf admin-status { + type te-types:te-admin-status; + description + "The administrative state of the link."; + } + uses te-link-info-attributes; + } + // te-link-attributes + } + // te-link-config-attributes + + grouping te-link-info-attributes { + description + "Advertised TE information attributes."; + leaf link-index { + type uint64; + description + "The link identifier. If OSPF is used, this object + represents an ospfLsdbID. If IS-IS is used, this object + represents an isisLSPID. If a locally configured link is + used, this object represents a unique value, which is + locally defined in a router."; + } + leaf administrative-group { + type te-types:admin-groups; + description + "Administrative group or color of the link. + This attribute covers both administrative groups (defined + in RFCs 3630 and 5305) and Extended Administrative Groups + (defined in RFC 7308)."; + reference + "RFC 3630: Traffic Engineering (TE) Extensions to OSPF + Version 2 + RFC 5305: IS-IS Extensions for Traffic Engineering + RFC 7308: Extended Administrative Groups in MPLS Traffic + Engineering (MPLS-TE)"; + } + uses interface-switching-capability-list; + uses te-types:label-set-info; + leaf link-protection-type { + type identityref { + base te-types:link-protection-type; + } + description + "Link Protection Type desired for this link."; + reference + "RFC 4202: Routing Extensions in Support of + Generalized Multi-Protocol Label Switching (GMPLS)"; + } + container max-link-bandwidth { + uses te-types:te-bandwidth; + description + "Maximum bandwidth that can be seen on this link in this + direction. Units are in bytes per second."; + reference + "RFC 3630: Traffic Engineering (TE) Extensions to OSPF + Version 2 + RFC 5305: IS-IS Extensions for Traffic Engineering"; + } + container max-resv-link-bandwidth { + uses te-types:te-bandwidth; + description + "Maximum amount of bandwidth that can be reserved in this + direction in this link. Units are in bytes per second."; + reference + "RFC 3630: Traffic Engineering (TE) Extensions to OSPF + Version 2 + RFC 5305: IS-IS Extensions for Traffic Engineering"; + } + list unreserved-bandwidth { + key "priority"; + max-elements 8; + description + "Unreserved bandwidth for priority levels 0-7. Units are in + bytes per second."; + reference + "RFC 3630: Traffic Engineering (TE) Extensions to OSPF + Version 2 + RFC 5305: IS-IS Extensions for Traffic Engineering"; + leaf priority { + type uint8 { + range "0..7"; + } + description + "Priority."; + } + uses te-types:te-bandwidth; + } + leaf te-default-metric { + type uint32; + description + "Traffic Engineering metric."; + reference + "RFC 3630: Traffic Engineering (TE) Extensions to OSPF + Version 2 + RFC 5305: IS-IS Extensions for Traffic Engineering"; + } + leaf te-delay-metric { + type uint32; + description + "Traffic Engineering delay metric."; + reference + "RFC 7471: OSPF Traffic Engineering (TE) Metric Extensions"; + } + leaf te-igp-metric { + type uint32; + description + "IGP metric used for Traffic Engineering."; + reference + "RFC 3785: Use of Interior Gateway Protocol (IGP) Metric as a + second MPLS Traffic Engineering (TE) Metric"; + } + container te-srlgs { + description + "Contains a list of SRLGs."; + leaf-list value { + type te-types:srlg; + description + "SRLG value."; + reference + "RFC 4202: Routing Extensions in Support of + Generalized Multi-Protocol Label Switching (GMPLS)"; + } + } + container te-nsrlgs { + if-feature "nsrlg"; + description + "Contains a list of NSRLGs (Non-Shared Risk Link Groups). + When an abstract TE link is configured, this list specifies + the request that underlay TE paths need to be mutually + disjoint with other TE links in the same groups."; + leaf-list id { + type uint32; + description + "NSRLG ID, uniquely configured within a topology."; + reference + "RFC 4872: RSVP-TE Extensions in Support of End-to-End + Generalized Multi-Protocol Label Switching (GMPLS) + Recovery"; + } + } + } + // te-link-info-attributes + + grouping te-link-iscd-attributes { + description + "TE link ISCD attributes."; + reference + "RFC 4203: OSPF Extensions in Support of Generalized + Multi-Protocol Label Switching (GMPLS), Section 1.4"; + list max-lsp-bandwidth { + key "priority"; + max-elements 8; + description + "Maximum Label Switched Path (LSP) bandwidth at + priorities 0-7."; + leaf priority { + type uint8 { + range "0..7"; + } + description + "Priority."; + } + uses te-types:te-bandwidth; + } + } + // te-link-iscd-attributes + + grouping te-link-state-derived { + description + "Link state attributes in a TE topology."; + leaf oper-status { + type te-types:te-oper-status; + config false; + description + "The current operational state of the link."; + } + leaf is-transitional { + type empty; + config false; + description + "Present if the link is transitional; used as an + alternative approach in lieu of 'inter-layer-lock-id' + for path computation in a TE topology covering multiple + layers or multiple regions."; + reference + "RFC 5212: Requirements for GMPLS-Based Multi-Region and + Multi-Layer Networks (MRN/MLN) + RFC 6001: Generalized MPLS (GMPLS) Protocol Extensions + for Multi-Layer and Multi-Region Networks (MLN/MRN)"; + } + uses information-source-per-link-attributes; + list information-source-entry { + key "information-source information-source-instance"; + config false; + description + "A list of information sources learned, including the source + that is used."; + uses information-source-per-link-attributes; + uses te-link-info-attributes; + } + container recovery { + config false; + description + "Status of the recovery process."; + leaf restoration-status { + type te-types:te-recovery-status; + description + "Restoration status."; + } + leaf protection-status { + type te-types:te-recovery-status; + description + "Protection status."; + } + } + container underlay { + if-feature "te-topology-hierarchy"; + config false; + description + "State attributes for the TE link underlay."; + leaf dynamic { + type boolean; + description + "'true' if the underlay is dynamically created."; + } + leaf committed { + type boolean; + description + "'true' if the underlay is committed."; + } + } + } + // te-link-state-derived + + grouping te-link-underlay-attributes { + description + "Attributes for the TE link underlay."; + reference + "RFC 4206: Label Switched Paths (LSP) Hierarchy with + Generalized Multi-Protocol Label Switching (GMPLS) + Traffic Engineering (TE)"; + leaf enabled { + type boolean; + description + "'true' if the underlay is enabled. + 'false' if the underlay is disabled."; + } + container primary-path { + description + "The service path on the underlay topology that + supports this link."; + uses nw:network-ref; + list path-element { + key "path-element-id"; + description + "A list of path elements describing the service path."; + leaf path-element-id { + type uint32; + description + "To identify the element in a path."; + } + uses te-path-element; + } + } + // primary-path + list backup-path { + key "index"; + description + "A list of backup service paths on the underlay topology that + protect the underlay primary path. If the primary path is + not protected, the list contains zero elements. If the + primary path is protected, the list contains one or more + elements."; + leaf index { + type uint32; + description + "A sequence number to identify a backup path."; + } + uses nw:network-ref; + list path-element { + key "path-element-id"; + description + "A list of path elements describing the backup service + path."; + leaf path-element-id { + type uint32; + description + "To identify the element in a path."; + } + uses te-path-element; + } + } + // backup-path + leaf protection-type { + type identityref { + base te-types:lsp-protection-type; + } + description + "Underlay protection type desired for this link."; + } + container tunnel-termination-points { + description + "Underlay TTPs desired for this link."; + leaf source { + type binary; + description + "Source TTP identifier."; + } + leaf destination { + type binary; + description + "Destination TTP identifier."; + } + } + container tunnels { + description + "Underlay TE tunnels supporting this TE link."; + leaf sharing { + type boolean; + default "true"; + description + "'true' if the underlay tunnel can be shared with other + TE links; + 'false' if the underlay tunnel is dedicated to this + TE link. + This leaf is the default option for all TE tunnels + and may be overridden by the per-TE-tunnel value."; + } + list tunnel { + key "tunnel-name"; + description + "Zero, one, or more underlay TE tunnels that support this + TE link."; + leaf tunnel-name { + type string; + description + "A tunnel name uniquely identifies an underlay TE tunnel, + used together with the 'source-node' value for this + link."; + reference + "RFC 3209: RSVP-TE: Extensions to RSVP for LSP Tunnels"; + } + leaf sharing { + type boolean; + description + "'true' if the underlay tunnel can be shared with other + TE links; + 'false' if the underlay tunnel is dedicated to this + TE link."; + } + } + // tunnel + } + // tunnels + } + // te-link-underlay-attributes + + grouping te-node-augment { + description + "Augmentation for a TE node."; + uses te-node-config; + uses te-node-state-derived; + container statistics { + config false; + description + "Statistics data."; + uses statistics-per-node; + } + list tunnel-termination-point { + key "tunnel-tp-id"; + description + "A termination point can terminate a tunnel."; + leaf tunnel-tp-id { + type binary; + description + "TTP identifier."; + } + uses te-node-tunnel-termination-point-config; + leaf oper-status { + type te-types:te-oper-status; + config false; + description + "The current operational state of the TTP."; + } + uses geolocation-container; + container statistics { + config false; + description + "Statistics data."; + uses statistics-per-ttp; + } + // Relationship to other TTPs + list supporting-tunnel-termination-point { + key "node-ref tunnel-tp-ref"; + description + "Identifies the TTPs on which this TTP depends."; + leaf node-ref { + type inet:uri; + description + "This leaf identifies the node in which the supporting + TTP is present. + This node is either the supporting node or a node in + an underlay topology."; + } + leaf tunnel-tp-ref { + type binary; + description + "Reference to a TTP that is in either the supporting node + or a node in an underlay topology."; + } + } + // supporting-tunnel-termination-point + } + // tunnel-termination-point + } + // te-node-augment + + grouping te-node-config { + description + "TE node configuration grouping."; + leaf-list te-node-template { + if-feature "template"; + type leafref { + path "../../../../te/templates/node-template/name"; + } + description + "The reference to a TE node template."; + } + uses te-node-config-attributes; + } + // te-node-config + + grouping te-node-config-attributes { + description + "Configuration node attributes in a TE topology."; + container te-node-attributes { + description + "Contains node attributes in a TE topology."; + leaf admin-status { + type te-types:te-admin-status; + description + "The administrative state of the link."; + } + uses te-node-connectivity-matrices; + uses te-node-info-attributes; + } + } + // te-node-config-attributes + + grouping te-node-config-attributes-template { + description + "Configuration node attributes for a template in a TE + topology."; + container te-node-attributes { + description + "Contains node attributes in a TE topology."; + leaf admin-status { + type te-types:te-admin-status; + description + "The administrative state of the link."; + } + uses te-node-info-attributes; + } + } + // te-node-config-attributes-template + + grouping te-node-connectivity-matrices { + description + "Connectivity matrix on a TE node."; + container connectivity-matrices { + description + "Contains a connectivity matrix on a TE node."; + leaf number-of-entries { + type uint16; + description + "The number of connectivity matrix entries. + If this number is specified in the configuration request, + the number is the requested number of entries, which may + not all be listed in the list; + if this number is reported in the state data, + the number is the current number of operational entries."; + } + uses te-types:label-set-info; + uses connectivity-matrix-entry-path-attributes; + list connectivity-matrix { + key "id"; + description + "Represents a node's switching limitations, i.e., + limitations in the interconnecting network TE links + across the node."; + reference + "RFC 7579: General Network Element Constraint Encoding + for GMPLS-Controlled Networks"; + leaf id { + type uint32; + description + "Identifies the connectivity matrix entry."; + } + } + // connectivity-matrix + } + // connectivity-matrices + } + // te-node-connectivity-matrices + + grouping te-node-connectivity-matrix-attributes { + description + "Termination point references of a connectivity matrix entry."; + container from { + description + "Reference to a source LTP."; + leaf tp-ref { + type leafref { + path "../../../../../../nt:termination-point/nt:tp-id"; + } + description + "Relative reference to a termination point."; + } + uses te-types:label-set-info; + } + container to { + description + "Reference to a destination LTP."; + leaf tp-ref { + type leafref { + path "../../../../../../nt:termination-point/nt:tp-id"; + } + description + "Relative reference to a termination point."; + } + uses te-types:label-set-info; + } + uses connectivity-matrix-entry-path-attributes; + } + // te-node-connectivity-matrix-attributes + + grouping te-node-info-attributes { + description + "Advertised TE information attributes."; + leaf domain-id { + type uint32; + description + "Identifies the domain to which this node belongs. + This attribute is used to support inter-domain links."; + reference + "RFC 5152: A Per-Domain Path Computation Method for + Establishing Inter-Domain Traffic Engineering (TE) + Label Switched Paths (LSPs) + RFC 5316: ISIS Extensions in Support of Inter-Autonomous + System (AS) MPLS and GMPLS Traffic Engineering + RFC 5392: OSPF Extensions in Support of Inter-Autonomous + System (AS) MPLS and GMPLS Traffic Engineering"; + } + leaf is-abstract { + type empty; + description + "Present if the node is abstract; not present if the node + is actual."; + } + leaf name { + type string; + description + "Node name."; + } + leaf-list signaling-address { + type inet:ip-address; + description + "The node's signaling address."; + } + container underlay-topology { + if-feature "te-topology-hierarchy"; + description + "When an abstract node encapsulates a topology, the + attributes in this container point to said topology."; + uses nw:network-ref; + } + } + // te-node-info-attributes + + grouping te-node-state-derived { + description + "Node state attributes in a TE topology."; + leaf oper-status { + type te-types:te-oper-status; + config false; + description + "The current operational state of the node."; + } + uses geolocation-container; + leaf is-multi-access-dr { + type empty; + config false; + description + "The presence of this attribute indicates that this TE node + is a pseudonode elected as a designated router."; + reference + "RFC 1195: Use of OSI IS-IS for Routing in TCP/IP and Dual + Environments + RFC 3630: Traffic Engineering (TE) Extensions to OSPF + Version 2"; + } + uses information-source-per-node-attributes; + list information-source-entry { + key "information-source information-source-instance"; + config false; + description + "A list of information sources learned, including the source + that is used."; + uses information-source-per-node-attributes; + uses te-node-connectivity-matrices; + uses te-node-info-attributes; + } + } + // te-node-state-derived + + grouping te-node-tunnel-termination-point-config { + description + "Termination capability of a TTP on a TE node."; + uses te-node-tunnel-termination-point-config-attributes; + container local-link-connectivities { + description + "Contains an LLCL for a TTP on a TE node."; + leaf number-of-entries { + type uint16; + description + "The number of LLCL entries. + If this number is specified in the configuration request, + the number is the requested number of entries, which may + not all be listed in the list; + if this number is reported in the state data, + the number is the current number of operational entries."; + } + uses te-types:label-set-info; + uses connectivity-matrix-entry-path-attributes; + } + } + // te-node-tunnel-termination-point-config + + grouping te-node-tunnel-termination-point-config-attributes { + description + "Configuration attributes of a TTP on a TE node."; + leaf admin-status { + type te-types:te-admin-status; + description + "The administrative state of the TTP."; + } + leaf name { + type string; + description + "A descriptive name for the TTP."; + } + leaf switching-capability { + type identityref { + base te-types:switching-capabilities; + } + description + "Switching capability for this interface."; + } + leaf encoding { + type identityref { + base te-types:lsp-encoding-types; + } + description + "Encoding supported by this interface."; + } + leaf-list inter-layer-lock-id { + type uint32; + description + "Inter-layer lock ID, used for path computation in a TE + topology covering multiple layers or multiple regions."; + reference + "RFC 5212: Requirements for GMPLS-Based Multi-Region and + Multi-Layer Networks (MRN/MLN) + RFC 6001: Generalized MPLS (GMPLS) Protocol Extensions + for Multi-Layer and Multi-Region Networks (MLN/MRN)"; + } + leaf protection-type { + type identityref { + base te-types:lsp-protection-type; + } + description + "The protection type that this TTP is capable of."; + } + container client-layer-adaptation { + description + "Contains capability information to support a client-layer + adaptation in a multi-layer topology."; + list switching-capability { + key "switching-capability encoding"; + description + "List of supported switching capabilities."; + reference + "RFC 4202: Routing Extensions in Support of + Generalized Multi-Protocol Label Switching (GMPLS) + RFC 6001: Generalized MPLS (GMPLS) Protocol Extensions + for Multi-Layer and Multi-Region Networks (MLN/MRN)"; + leaf switching-capability { + type identityref { + base te-types:switching-capabilities; + } + description + "Switching capability for the client-layer adaptation."; + } + leaf encoding { + type identityref { + base te-types:lsp-encoding-types; + } + description + "Encoding supported by the client-layer adaptation."; + } + uses te-types:te-bandwidth; + } + } + } + // te-node-tunnel-termination-point-config-attributes + + grouping te-node-tunnel-termination-point-llc-list { + description + "LLCL of a TTP on a TE node."; + list local-link-connectivity { + key "link-tp-ref"; + description + "The termination capabilities between the TTP and the LTP. + This capability information can be used to compute + the tunnel path. + The Interface Adjustment Capability Descriptors (IACDs) + (defined in RFC 6001) on each LTP can be derived from + this list."; + reference + "RFC 6001: Generalized MPLS (GMPLS) Protocol Extensions + for Multi-Layer and Multi-Region Networks (MLN/MRN)"; + leaf link-tp-ref { + type leafref { + path "../../../../../nt:termination-point/nt:tp-id"; + } + description + "LTP."; + } + uses te-types:label-set-info; + uses connectivity-matrix-entry-path-attributes; + } + } + // te-node-tunnel-termination-point-llc-list + + grouping te-path-element { + description + "A group of attributes defining an element in a TE path, + such as a TE node, TE link, TE atomic resource, or label."; + uses te-types:explicit-route-hop; + } + // te-path-element + + grouping te-termination-point-augment { + description + "Augmentation for a TE termination point."; + leaf te-tp-id { + type te-types:te-tp-id; + description + "An identifier that uniquely identifies a TE termination + point."; + } + container te { + must '../te-tp-id'; + presence "TE support"; + description + "Indicates TE support."; + uses te-termination-point-config; + leaf oper-status { + type te-types:te-oper-status; + config false; + description + "The current operational state of the LTP."; + } + uses geolocation-container; + } + } + // te-termination-point-augment + + grouping te-termination-point-config { + description + "TE termination point configuration grouping."; + leaf admin-status { + type te-types:te-admin-status; + description + "The administrative state of the LTP."; + } + leaf name { + type string; + description + "A descriptive name for the LTP."; + } + uses interface-switching-capability-list; + leaf inter-domain-plug-id { + type binary; + description + "A network-wide unique number that identifies on the + network a connection that supports a given inter-domain + TE link. This is a more flexible alternative to specifying + 'remote-te-node-id' and 'remote-te-link-tp-id' on a TE link + when the provider either does not know 'remote-te-node-id' + and 'remote-te-link-tp-id' or needs to give the client the + flexibility to mix and match multiple topologies."; + } + leaf-list inter-layer-lock-id { + type uint32; + description + "Inter-layer lock ID, used for path computation in a TE + topology covering multiple layers or multiple regions."; + reference + "RFC 5212: Requirements for GMPLS-Based Multi-Region and + Multi-Layer Networks (MRN/MLN) + RFC 6001: Generalized MPLS (GMPLS) Protocol Extensions + for Multi-Layer and Multi-Region Networks (MLN/MRN)"; + } + } + // te-termination-point-config + + grouping te-topologies-augment { + description + "Augmentation for TE topologies."; + container te { + presence "TE support"; + description + "Indicates TE support."; + container templates { + description + "Configuration parameters for templates used for a TE + topology."; + list node-template { + if-feature "template"; + key "name"; + leaf name { + type te-types:te-template-name; + description + "The name to identify a TE node template."; + } + description + "The list of TE node templates used to define sharable + and reusable TE node attributes."; + uses template-attributes; + uses te-node-config-attributes-template; + } + // node-template + list link-template { + if-feature "template"; + key "name"; + leaf name { + type te-types:te-template-name; + description + "The name to identify a TE link template."; + } + description + "The list of TE link templates used to define sharable + and reusable TE link attributes."; + uses template-attributes; + uses te-link-config-attributes; + } + // link-template + } + // templates + } + // te + } + // te-topologies-augment + + grouping te-topology-augment { + description + "Augmentation for a TE topology."; + uses te-types:te-topology-identifier; + container te { + must '../te-topology-identifier/provider-id' + + ' and ../te-topology-identifier/client-id' + + ' and ../te-topology-identifier/topology-id'; + presence "TE support"; + description + "Indicates TE support."; + uses te-topology-config; + uses geolocation-container; + } + } + // te-topology-augment + + grouping te-topology-config { + description + "TE topology configuration grouping."; + leaf name { + type string; + description + "Name of the TE topology. This attribute is optional and can + be specified by the operator to describe the TE topology, + which can be useful when 'network-id' (RFC 8345) is not + descriptive and not modifiable because of being generated + by the system."; + reference + "RFC 8345: A YANG Data Model for Network Topologies"; + } + leaf preference { + type uint8 { + range "1..255"; + } + description + "Specifies a preference for this topology. A lower number + indicates a higher preference."; + } + leaf optimization-criterion { + type identityref { + base te-types:objective-function-type; + } + description + "Optimization criterion applied to this topology."; + reference + "RFC 3272: Overview and Principles of Internet Traffic + Engineering"; + } + list nsrlg { + if-feature "nsrlg"; + key "id"; + description + "List of NSRLGs (Non-Shared Risk Link Groups)."; + reference + "RFC 4872: RSVP-TE Extensions in Support of End-to-End + Generalized Multi-Protocol Label Switching (GMPLS) + Recovery"; + leaf id { + type uint32; + description + "Identifies the NSRLG entry."; + } + leaf disjointness { + type te-types:te-path-disjointness; + description + "The type of resource disjointness."; + } + } + // nsrlg + } + // te-topology-config + + grouping template-attributes { + description + "Common attributes for all templates."; + leaf priority { + type uint16; + description + "The preference value for resolving conflicts between + different templates. When two or more templates specify + values for one configuration attribute, the value from the + template with the highest priority is used. + A lower number indicates a higher priority. The highest + priority is 0."; + } + leaf reference-change-policy { + type enumeration { + enum no-action { + description + "When an attribute changes in this template, the + configuration node referring to this template does + not take any action."; + } + enum not-allowed { + description + "When any configuration object has a reference to this + template, changing this template is not allowed."; + } + enum cascade { + description + "When an attribute changes in this template, the + configuration object referring to this template applies + the new attribute value to the corresponding + configuration."; + } + } + description + "This attribute specifies the action taken for a + configuration node that has a reference to this template."; + } + } + // template-attributes + + /* + * Data nodes + */ + + augment "/nw:networks/nw:network/nw:network-types" { + description + "Introduces a new network type for a TE topology."; + container te-topology { + presence "Indicates a TE topology"; + description + "Its presence identifies the TE topology type."; + } + } + + augment "/nw:networks" { + description + "Augmentation parameters for TE topologies."; + uses te-topologies-augment; + } + + augment "/nw:networks/nw:network" { + when 'nw:network-types/tet:te-topology' { + description + "Augmentation parameters apply only for networks with a + TE topology type."; + } + description + "Configuration parameters for a TE topology."; + uses te-topology-augment; + } + + augment "/nw:networks/nw:network/nw:node" { + when '../nw:network-types/tet:te-topology' { + description + "Augmentation parameters apply only for networks with a + TE topology type."; + } + description + "Configuration parameters for TE at the node level."; + leaf te-node-id { + type te-types:te-node-id; + description + "The identifier of a node in the TE topology. + A node is specific to a topology to which it belongs."; + } + container te { + must '../te-node-id' { + description + "'te-node-id' is mandatory."; + } + must 'count(../nw:supporting-node)<=1' { + description + "For a node in a TE topology, there cannot be more + than one supporting node. If multiple nodes are + abstracted, the 'underlay-topology' field is used."; + } + presence "TE support"; + description + "Indicates TE support."; + uses te-node-augment; + } + } + + augment "/nw:networks/nw:network/nt:link" { + when '../nw:network-types/tet:te-topology' { + description + "Augmentation parameters apply only for networks with a + TE topology type."; + } + description + "Configuration parameters for TE at the link level."; + container te { + must 'count(../nt:supporting-link)<=1' { + description + "For a link in a TE topology, there cannot be more + than one supporting link. If one or more link paths are + abstracted, the underlay is used."; + } + presence "TE support"; + description + "Indicates TE support."; + uses te-link-augment; + } + } + + augment "/nw:networks/nw:network/nw:node/" + + "nt:termination-point" { + when '../../nw:network-types/tet:te-topology' { + description + "Augmentation parameters apply only for networks with a + TE topology type."; + } + description + "Configuration parameters for TE at the termination point + level."; + uses te-termination-point-augment; + } + + augment "/nw:networks/nw:network/nt:link/te/bundle-stack-level/" + + "bundle/bundled-links/bundled-link" { + when '../../../../nw:network-types/tet:te-topology' { + description + "Augmentation parameters apply only for networks with a + TE topology type."; + } + description + "Augmentation for a TE bundled link."; + leaf src-tp-ref { + type leafref { + path "../../../../../nw:node[nw:node-id = " + + "current()/../../../../nt:source/" + + "nt:source-node]/" + + "nt:termination-point/nt:tp-id"; + require-instance true; + } + description + "Reference to another TE termination point on the + same source node."; + } + leaf des-tp-ref { + type leafref { + path "../../../../../nw:node[nw:node-id = " + + "current()/../../../../nt:destination/" + + "nt:dest-node]/" + + "nt:termination-point/nt:tp-id"; + require-instance true; + } + description + "Reference to another TE termination point on the + same destination node."; + } + } + + augment "/nw:networks/nw:network/nw:node/te/" + + "information-source-entry/connectivity-matrices/" + + "connectivity-matrix" { + when '../../../../../nw:network-types/tet:te-topology' { + description + "Augmentation parameters apply only for networks with a + TE topology type."; + } + description + "Augmentation for the TE node connectivity matrix."; + uses te-node-connectivity-matrix-attributes; + } + + augment "/nw:networks/nw:network/nw:node/te/te-node-attributes/" + + "connectivity-matrices/connectivity-matrix" { + when '../../../../../nw:network-types/tet:te-topology' { + description + "Augmentation parameters apply only for networks with a + TE topology type."; + } + description + "Augmentation for the TE node connectivity matrix."; + uses te-node-connectivity-matrix-attributes; + } + + augment "/nw:networks/nw:network/nw:node/te/" + + "tunnel-termination-point/local-link-connectivities" { + when '../../../../nw:network-types/tet:te-topology' { + description + "Augmentation parameters apply only for networks with a + TE topology type."; + } + description + "Augmentation for TE node TTP LLCs (Local Link + Connectivities)."; + uses te-node-tunnel-termination-point-llc-list; + } +} diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/yang/ietf-te-types@2020-06-10.yang b/src/nbi/service/rest_server/nbi_plugins/ietf_network/yang/ietf-te-types@2020-06-10.yang new file mode 100644 index 0000000000000000000000000000000000000000..6fc0544dede2128f3e91f8cf5a39caa8cc49ab6e --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/yang/ietf-te-types@2020-06-10.yang @@ -0,0 +1,3379 @@ +module ietf-te-types { + yang-version 1.1; + namespace "urn:ietf:params:xml:ns:yang:ietf-te-types"; + prefix te-types; + + import ietf-inet-types { + prefix inet; + reference + "RFC 6991: Common YANG Data Types"; + } + import ietf-yang-types { + prefix yang; + reference + "RFC 6991: Common YANG Data Types"; + } + import ietf-routing-types { + prefix rt-types; + reference + "RFC 8294: Common YANG Data Types for the Routing Area"; + } + + organization + "IETF Traffic Engineering Architecture and Signaling (TEAS) + Working Group"; + contact + "WG Web: + WG List: + + Editor: Tarek Saad + + + Editor: Rakesh Gandhi + + + Editor: Vishnu Pavan Beeram + + + Editor: Xufeng Liu + + + Editor: Igor Bryskin + "; + description + "This YANG module contains a collection of generally useful + YANG data type definitions specific to TE. The model fully + conforms to the Network Management Datastore Architecture + (NMDA). + + The key words 'MUST', 'MUST NOT', 'REQUIRED', 'SHALL', 'SHALL + NOT', 'SHOULD', 'SHOULD NOT', 'RECOMMENDED', 'NOT RECOMMENDED', + 'MAY', and 'OPTIONAL' in this document are to be interpreted as + described in BCP 14 (RFC 2119) (RFC 8174) when, and only when, + they appear in all capitals, as shown here. + + Copyright (c) 2020 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 + (https://trustee.ietf.org/license-info). + + This version of this YANG module is part of RFC 8776; see the + RFC itself for full legal notices."; + + revision 2020-06-10 { + description + "Latest revision of TE types."; + reference + "RFC 8776: Common YANG Data Types for Traffic Engineering"; + } + + /** + * Typedefs + */ + + typedef admin-group { + type yang:hex-string { + /* 01:02:03:04 */ + length "1..11"; + } + description + "Administrative group / resource class / color representation + in 'hex-string' type. + The most significant byte in the hex-string is the farthest + to the left in the byte sequence. Leading zero bytes in the + configured value may be omitted for brevity."; + reference + "RFC 3630: Traffic Engineering (TE) Extensions to OSPF + Version 2 + RFC 5305: IS-IS Extensions for Traffic Engineering + RFC 7308: Extended Administrative Groups in MPLS Traffic + Engineering (MPLS-TE)"; + } + + typedef admin-groups { + type union { + type admin-group; + type extended-admin-group; + } + description + "Derived types for TE administrative groups."; + } + + typedef extended-admin-group { + type yang:hex-string; + description + "Extended administrative group / resource class / color + representation in 'hex-string' type. + The most significant byte in the hex-string is the farthest + to the left in the byte sequence. Leading zero bytes in the + configured value may be omitted for brevity."; + reference + "RFC 7308: Extended Administrative Groups in MPLS Traffic + Engineering (MPLS-TE)"; + } + + typedef path-attribute-flags { + type union { + type identityref { + base session-attributes-flags; + } + type identityref { + base lsp-attributes-flags; + } + } + description + "Path attributes flags type."; + } + + typedef performance-metrics-normality { + type enumeration { + enum unknown { + value 0; + description + "Unknown."; + } + enum normal { + value 1; + description + "Normal. Indicates that the anomalous bit is not set."; + } + enum abnormal { + value 2; + description + "Abnormal. Indicates that the anomalous bit is set."; + } + } + description + "Indicates whether a performance metric is normal (anomalous + bit not set), abnormal (anomalous bit set), or unknown."; + reference + "RFC 7471: OSPF Traffic Engineering (TE) Metric Extensions + RFC 7823: Performance-Based Path Selection for Explicitly + Routed Label Switched Paths (LSPs) Using TE Metric + Extensions + RFC 8570: IS-IS Traffic Engineering (TE) Metric Extensions"; + } + + typedef srlg { + type uint32; + description + "SRLG type."; + reference + "RFC 4203: OSPF Extensions in Support of Generalized + Multi-Protocol Label Switching (GMPLS) + RFC 5307: IS-IS Extensions in Support of Generalized + Multi-Protocol Label Switching (GMPLS)"; + } + + typedef te-common-status { + type enumeration { + enum up { + description + "Enabled."; + } + enum down { + description + "Disabled."; + } + enum testing { + description + "In some test mode."; + } + enum preparing-maintenance { + description + "The resource is disabled in the control plane to prepare + for a graceful shutdown for maintenance purposes."; + reference + "RFC 5817: Graceful Shutdown in MPLS and Generalized MPLS + Traffic Engineering Networks"; + } + enum maintenance { + description + "The resource is disabled in the data plane for maintenance + purposes."; + } + enum unknown { + description + "Status is unknown."; + } + } + description + "Defines a type representing the common states of a TE + resource."; + } + + typedef te-bandwidth { + type string { + pattern '0[xX](0((\.0?)?[pP](\+)?0?|(\.0?))|' + + '1(\.([\da-fA-F]{0,5}[02468aAcCeE]?)?)?' + + '[pP](\+)?(12[0-7]|' + + '1[01]\d|0?\d?\d)?)|0[xX][\da-fA-F]{1,8}|\d+' + + '(,(0[xX](0((\.0?)?[pP](\+)?0?|(\.0?))|' + + '1(\.([\da-fA-F]{0,5}[02468aAcCeE]?)?)?' + + '[pP](\+)?(12[0-7]|' + + '1[01]\d|0?\d?\d)?)|0[xX][\da-fA-F]{1,8}|\d+))*'; + } + description + "This is the generic bandwidth type. It is a string containing + a list of numbers separated by commas, where each of these + numbers can be non-negative decimal, hex integer, or + hex float: + + (dec | hex | float)[*(','(dec | hex | float))] + + For the packet-switching type, the string encoding follows + the type 'bandwidth-ieee-float32' as defined in RFC 8294 + (e.g., 0x1p10), where the units are in bytes per second. + + For the Optical Transport Network (OTN) switching type, + a list of integers can be used, such as '0,2,3,1', indicating + two ODU0s and one ODU3. ('ODU' stands for 'Optical Data + Unit'.) For Dense Wavelength Division Multiplexing (DWDM), + a list of pairs of slot numbers and widths can be used, + such as '0,2,3,3', indicating a frequency slot 0 with + slot width 2 and a frequency slot 3 with slot width 3. + Canonically, the string is represented as all lowercase and in + hex, where the prefix '0x' precedes the hex number."; + reference + "RFC 8294: Common YANG Data Types for the Routing Area + ITU-T Recommendation G.709: Interfaces for the + optical transport network"; + } + + typedef te-ds-class { + type uint8 { + range "0..7"; + } + description + "The Differentiated Services Class-Type of traffic."; + reference + "RFC 4124: Protocol Extensions for Support of Diffserv-aware + MPLS Traffic Engineering, Section 4.3.1"; + } + + typedef te-global-id { + type uint32; + description + "An identifier to uniquely identify an operator, which can be + either a provider or a client. + The definition of this type is taken from RFCs 6370 and 5003. + This attribute type is used solely to provide a globally + unique context for TE topologies."; + reference + "RFC 5003: Attachment Individual Identifier (AII) Types for + Aggregation + RFC 6370: MPLS Transport Profile (MPLS-TP) Identifiers"; + } + + typedef te-hop-type { + type enumeration { + enum loose { + description + "A loose hop in an explicit path."; + } + enum strict { + description + "A strict hop in an explicit path."; + } + } + description + "Enumerated type for specifying loose or strict paths."; + reference + "RFC 3209: RSVP-TE: Extensions to RSVP for LSP Tunnels, + Section 4.3.3"; + } + + typedef te-link-access-type { + type enumeration { + enum point-to-point { + description + "The link is point-to-point."; + } + enum multi-access { + description + "The link is multi-access, including broadcast and NBMA."; + } + } + description + "Defines a type representing the access type of a TE link."; + reference + "RFC 3630: Traffic Engineering (TE) Extensions to OSPF + Version 2"; + } + + typedef te-label-direction { + type enumeration { + enum forward { + description + "Label allocated for the forward LSP direction."; + } + enum reverse { + description + "Label allocated for the reverse LSP direction."; + } + } + description + "Enumerated type for specifying the forward or reverse + label."; + } + + typedef te-link-direction { + type enumeration { + enum incoming { + description + "The explicit route represents an incoming link on + a node."; + } + enum outgoing { + description + "The explicit route represents an outgoing link on + a node."; + } + } + description + "Enumerated type for specifying the direction of a link on + a node."; + } + + typedef te-metric { + type uint32; + description + "TE metric."; + reference + "RFC 3785: Use of Interior Gateway Protocol (IGP) Metric as a + second MPLS Traffic Engineering (TE) Metric"; + } + + typedef te-node-id { + type yang:dotted-quad; + description + "A type representing the identifier for a node in a TE + topology. + The identifier is represented as 4 octets in dotted-quad + notation. + This attribute MAY be mapped to the Router Address TLV + described in Section 2.4.1 of RFC 3630, the TE Router ID + described in Section 3 of RFC 6827, the Traffic Engineering + Router ID TLV described in Section 4.3 of RFC 5305, or the + TE Router ID TLV described in Section 3.2.1 of RFC 6119. + The reachability of such a TE node MAY be achieved by a + mechanism such as that described in Section 6.2 of RFC 6827."; + reference + "RFC 3630: Traffic Engineering (TE) Extensions to OSPF + Version 2, Section 2.4.1 + RFC 5305: IS-IS Extensions for Traffic Engineering, + Section 4.3 + RFC 6119: IPv6 Traffic Engineering in IS-IS, Section 3.2.1 + RFC 6827: Automatically Switched Optical Network (ASON) + Routing for OSPFv2 Protocols, Section 3"; + } + + typedef te-oper-status { + type te-common-status; + description + "Defines a type representing the operational status of + a TE resource."; + } + + typedef te-admin-status { + type te-common-status; + description + "Defines a type representing the administrative status of + a TE resource."; + } + + typedef te-path-disjointness { + type bits { + bit node { + position 0; + description + "Node disjoint."; + } + bit link { + position 1; + description + "Link disjoint."; + } + bit srlg { + position 2; + description + "SRLG (Shared Risk Link Group) disjoint."; + } + } + description + "Type of the resource disjointness for a TE tunnel path."; + reference + "RFC 4872: RSVP-TE Extensions in Support of End-to-End + Generalized Multi-Protocol Label Switching (GMPLS) Recovery"; + } + + typedef te-recovery-status { + type enumeration { + enum normal { + description + "Both the recovery span and the working span are fully + allocated and active, data traffic is being + transported over (or selected from) the working + span, and no trigger events are reported."; + } + enum recovery-started { + description + "The recovery action has been started but not completed."; + } + enum recovery-succeeded { + description + "The recovery action has succeeded. The working span has + reported a failure/degrade condition, and the user traffic + is being transported (or selected) on the recovery span."; + } + enum recovery-failed { + description + "The recovery action has failed."; + } + enum reversion-started { + description + "The reversion has started."; + } + enum reversion-succeeded { + description + "The reversion action has succeeded."; + } + enum reversion-failed { + description + "The reversion has failed."; + } + enum recovery-unavailable { + description + "The recovery is unavailable, as a result of either an + operator's lockout command or a failure condition + detected on the recovery span."; + } + enum recovery-admin { + description + "The operator has issued a command to switch the user + traffic to the recovery span."; + } + enum wait-to-restore { + description + "The recovery domain is recovering from a failure/degrade + condition on the working span that is being controlled by + the Wait-to-Restore (WTR) timer."; + } + } + description + "Defines the status of a recovery action."; + reference + "RFC 4427: Recovery (Protection and Restoration) Terminology + for Generalized Multi-Protocol Label Switching (GMPLS) + RFC 6378: MPLS Transport Profile (MPLS-TP) Linear Protection"; + } + + typedef te-template-name { + type string { + pattern '/?([a-zA-Z0-9\-_.]+)(/[a-zA-Z0-9\-_.]+)*'; + } + description + "A type for the name of a TE node template or TE link + template."; + } + + typedef te-topology-event-type { + type enumeration { + enum add { + value 0; + description + "A TE node or TE link has been added."; + } + enum remove { + value 1; + description + "A TE node or TE link has been removed."; + } + enum update { + value 2; + description + "A TE node or TE link has been updated."; + } + } + description + "TE event type for notifications."; + } + + typedef te-topology-id { + type union { + type string { + length "0"; + // empty string + } + type string { + pattern '([a-zA-Z0-9\-_.]+:)*' + + '/?([a-zA-Z0-9\-_.]+)(/[a-zA-Z0-9\-_.]+)*'; + } + } + description + "An identifier for a topology. + It is optional to have one or more prefixes at the beginning, + separated by colons. The prefixes can be 'network-types' as + defined in the 'ietf-network' module in RFC 8345, to help the + user better understand the topology before further inquiry + is made."; + reference + "RFC 8345: A YANG Data Model for Network Topologies"; + } + + typedef te-tp-id { + type union { + type uint32; + // Unnumbered + type inet:ip-address; + // IPv4 or IPv6 address + } + description + "An identifier for a TE link endpoint on a node. + This attribute is mapped to a local or remote link identifier + as defined in RFCs 3630 and 5305."; + reference + "RFC 3630: Traffic Engineering (TE) Extensions to OSPF + Version 2 + RFC 5305: IS-IS Extensions for Traffic Engineering"; + } + + /* TE features */ + + feature p2mp-te { + description + "Indicates support for Point-to-Multipoint TE (P2MP-TE)."; + reference + "RFC 4875: Extensions to Resource Reservation Protocol - + Traffic Engineering (RSVP-TE) for Point-to-Multipoint TE + Label Switched Paths (LSPs)"; + } + + feature frr-te { + description + "Indicates support for TE Fast Reroute (FRR)."; + reference + "RFC 4090: Fast Reroute Extensions to RSVP-TE for LSP Tunnels"; + } + + feature extended-admin-groups { + description + "Indicates support for TE link extended administrative + groups."; + reference + "RFC 7308: Extended Administrative Groups in MPLS Traffic + Engineering (MPLS-TE)"; + } + + feature named-path-affinities { + description + "Indicates support for named path affinities."; + } + + feature named-extended-admin-groups { + description + "Indicates support for named extended administrative groups."; + } + + feature named-srlg-groups { + description + "Indicates support for named SRLG groups."; + } + + feature named-path-constraints { + description + "Indicates support for named path constraints."; + } + + feature path-optimization-metric { + description + "Indicates support for path optimization metrics."; + } + + feature path-optimization-objective-function { + description + "Indicates support for path optimization objective functions."; + } + + /* + * Identities + */ + + identity session-attributes-flags { + description + "Base identity for the RSVP-TE session attributes flags."; + } + + identity local-protection-desired { + base session-attributes-flags; + description + "Local protection is desired."; + reference + "RFC 3209: RSVP-TE: Extensions to RSVP for LSP Tunnels, + Section 4.7.1"; + } + + identity se-style-desired { + base session-attributes-flags; + description + "Shared explicit style, to allow the LSP to be established + and share resources with the old LSP."; + reference + "RFC 3209: RSVP-TE: Extensions to RSVP for LSP Tunnels"; + } + + identity local-recording-desired { + base session-attributes-flags; + description + "Label recording is desired."; + reference + "RFC 3209: RSVP-TE: Extensions to RSVP for LSP Tunnels, + Section 4.7.1"; + } + + identity bandwidth-protection-desired { + base session-attributes-flags; + description + "Requests FRR bandwidth protection on LSRs, if present."; + reference + "RFC 4090: Fast Reroute Extensions to RSVP-TE for LSP Tunnels"; + } + + identity node-protection-desired { + base session-attributes-flags; + description + "Requests FRR node protection on LSRs, if present."; + reference + "RFC 4090: Fast Reroute Extensions to RSVP-TE for LSP Tunnels"; + } + + identity path-reevaluation-request { + base session-attributes-flags; + description + "This flag indicates that a path re-evaluation (of the + current path in use) is requested. Note that this does + not trigger any LSP reroutes but instead just signals a + request to evaluate whether a preferable path exists."; + reference + "RFC 4736: Reoptimization of Multiprotocol Label Switching + (MPLS) Traffic Engineering (TE) Loosely Routed Label Switched + Path (LSP)"; + } + + identity soft-preemption-desired { + base session-attributes-flags; + description + "Soft preemption of LSP resources is desired."; + reference + "RFC 5712: MPLS Traffic Engineering Soft Preemption"; + } + + identity lsp-attributes-flags { + description + "Base identity for LSP attributes flags."; + } + + identity end-to-end-rerouting-desired { + base lsp-attributes-flags; + description + "Indicates end-to-end rerouting behavior for an LSP + undergoing establishment. This MAY also be used to + specify the behavior of end-to-end LSP recovery for + established LSPs."; + reference + "RFC 4920: Crankback Signaling Extensions for MPLS and GMPLS + RSVP-TE + RFC 5420: Encoding of Attributes for MPLS LSP Establishment + Using Resource Reservation Protocol Traffic Engineering + (RSVP-TE) + RFC 7570: Label Switched Path (LSP) Attribute in the Explicit + Route Object (ERO)"; + } + + identity boundary-rerouting-desired { + base lsp-attributes-flags; + description + "Indicates boundary rerouting behavior for an LSP undergoing + establishment. This MAY also be used to specify + segment-based LSP recovery through nested crankback for + established LSPs. The boundary Area Border Router (ABR) / + Autonomous System Border Router (ASBR) can decide to forward + the PathErr message upstream to either an upstream boundary + ABR/ASBR or the ingress LSR. Alternatively, it can try to + select another egress boundary LSR."; + reference + "RFC 4920: Crankback Signaling Extensions for MPLS and GMPLS + RSVP-TE + RFC 5420: Encoding of Attributes for MPLS LSP Establishment + Using Resource Reservation Protocol Traffic Engineering + (RSVP-TE) + RFC 7570: Label Switched Path (LSP) Attribute in the Explicit + Route Object (ERO)"; + } + + identity segment-based-rerouting-desired { + base lsp-attributes-flags; + description + "Indicates segment-based rerouting behavior for an LSP + undergoing establishment. This MAY also be used to specify + segment-based LSP recovery for established LSPs."; + reference + "RFC 4920: Crankback Signaling Extensions for MPLS and GMPLS + RSVP-TE + RFC 5420: Encoding of Attributes for MPLS LSP Establishment + Using Resource Reservation Protocol Traffic Engineering + (RSVP-TE) + RFC 7570: Label Switched Path (LSP) Attribute in the Explicit + Route Object (ERO)"; + } + + identity lsp-integrity-required { + base lsp-attributes-flags; + description + "Indicates that LSP integrity is required."; + reference + "RFC 4875: Extensions to Resource Reservation Protocol - + Traffic Engineering (RSVP-TE) for Point-to-Multipoint TE + Label Switched Paths (LSPs) + RFC 7570: Label Switched Path (LSP) Attribute in the Explicit + Route Object (ERO)"; + } + + identity contiguous-lsp-desired { + base lsp-attributes-flags; + description + "Indicates that a contiguous LSP is desired."; + reference + "RFC 5151: Inter-Domain MPLS and GMPLS Traffic Engineering -- + Resource Reservation Protocol-Traffic Engineering (RSVP-TE) + Extensions + RFC 7570: Label Switched Path (LSP) Attribute in the Explicit + Route Object (ERO)"; + } + + identity lsp-stitching-desired { + base lsp-attributes-flags; + description + "Indicates that LSP stitching is desired."; + reference + "RFC 5150: Label Switched Path Stitching with Generalized + Multiprotocol Label Switching Traffic Engineering (GMPLS TE) + RFC 7570: Label Switched Path (LSP) Attribute in the Explicit + Route Object (ERO)"; + } + + identity pre-planned-lsp-flag { + base lsp-attributes-flags; + description + "Indicates that the LSP MUST be provisioned in the + control plane only."; + reference + "RFC 6001: Generalized MPLS (GMPLS) Protocol Extensions for + Multi-Layer and Multi-Region Networks (MLN/MRN) + RFC 7570: Label Switched Path (LSP) Attribute in the Explicit + Route Object (ERO)"; + } + + identity non-php-behavior-flag { + base lsp-attributes-flags; + description + "Indicates that non-PHP (non-Penultimate Hop Popping) behavior + for the LSP is desired."; + reference + "RFC 6511: Non-Penultimate Hop Popping Behavior and Out-of-Band + Mapping for RSVP-TE Label Switched Paths + RFC 7570: Label Switched Path (LSP) Attribute in the Explicit + Route Object (ERO)"; + } + + identity oob-mapping-flag { + base lsp-attributes-flags; + description + "Indicates that signaling of the egress binding information is + out of band (e.g., via the Border Gateway Protocol (BGP))."; + reference + "RFC 6511: Non-Penultimate Hop Popping Behavior and Out-of-Band + Mapping for RSVP-TE Label Switched Paths + RFC 7570: Label Switched Path (LSP) Attribute in the Explicit + Route Object (ERO)"; + } + + identity entropy-label-capability { + base lsp-attributes-flags; + description + "Indicates entropy label capability."; + reference + "RFC 6790: The Use of Entropy Labels in MPLS Forwarding + RFC 7570: Label Switched Path (LSP) Attribute in the Explicit + Route Object (ERO)"; + } + + identity oam-mep-entity-desired { + base lsp-attributes-flags; + description + "OAM Maintenance Entity Group End Point (MEP) entities + desired."; + reference + "RFC 7260: GMPLS RSVP-TE Extensions for Operations, + Administration, and Maintenance (OAM) Configuration"; + } + + identity oam-mip-entity-desired { + base lsp-attributes-flags; + description + "OAM Maintenance Entity Group Intermediate Points (MIP) + entities desired."; + reference + "RFC 7260: GMPLS RSVP-TE Extensions for Operations, + Administration, and Maintenance (OAM) Configuration"; + } + + identity srlg-collection-desired { + base lsp-attributes-flags; + description + "SRLG collection desired."; + reference + "RFC 7570: Label Switched Path (LSP) Attribute in the Explicit + Route Object (ERO) + RFC 8001: RSVP-TE Extensions for Collecting Shared Risk + Link Group (SRLG) Information"; + } + + identity loopback-desired { + base lsp-attributes-flags; + description + "This flag indicates that a particular node on the LSP is + required to enter loopback mode. This can also be + used to specify the loopback state of the node."; + reference + "RFC 7571: GMPLS RSVP-TE Extensions for Lock Instruct and + Loopback"; + } + + identity p2mp-te-tree-eval-request { + base lsp-attributes-flags; + description + "P2MP-TE tree re-evaluation request."; + reference + "RFC 8149: RSVP Extensions for Reoptimization of Loosely Routed + Point-to-Multipoint Traffic Engineering Label Switched Paths + (LSPs)"; + } + + identity rtm-set-desired { + base lsp-attributes-flags; + description + "Residence Time Measurement (RTM) attribute flag requested."; + reference + "RFC 8169: Residence Time Measurement in MPLS Networks"; + } + + identity link-protection-type { + description + "Base identity for the link protection type."; + } + + identity link-protection-unprotected { + base link-protection-type; + description + "Unprotected link type."; + reference + "RFC 4872: RSVP-TE Extensions in Support of End-to-End + Generalized Multi-Protocol Label Switching (GMPLS) Recovery"; + } + + identity link-protection-extra-traffic { + base link-protection-type; + description + "Extra-Traffic protected link type."; + reference + "RFC 4427: Recovery (Protection and Restoration) Terminology + for Generalized Multi-Protocol Label Switching (GMPLS)"; + } + + identity link-protection-shared { + base link-protection-type; + description + "Shared protected link type."; + reference + "RFC 4872: RSVP-TE Extensions in Support of End-to-End + Generalized Multi-Protocol Label Switching (GMPLS) Recovery"; + } + + identity link-protection-1-for-1 { + base link-protection-type; + description + "One-for-one (1:1) protected link type."; + reference + "RFC 4872: RSVP-TE Extensions in Support of End-to-End + Generalized Multi-Protocol Label Switching (GMPLS) Recovery"; + } + + identity link-protection-1-plus-1 { + base link-protection-type; + description + "One-plus-one (1+1) protected link type."; + reference + "RFC 4872: RSVP-TE Extensions in Support of End-to-End + Generalized Multi-Protocol Label Switching (GMPLS) Recovery"; + } + + identity link-protection-enhanced { + base link-protection-type; + description + "A compound link protection type derived from the underlay + TE tunnel protection configuration supporting the TE link."; + } + + identity association-type { + description + "Base identity for the tunnel association."; + } + + identity association-type-recovery { + base association-type; + description + "Association type for recovery, used to associate LSPs of the + same tunnel for recovery."; + reference + "RFC 4872: RSVP-TE Extensions in Support of End-to-End + Generalized Multi-Protocol Label Switching (GMPLS) Recovery + RFC 6780: RSVP ASSOCIATION Object Extensions"; + } + + identity association-type-resource-sharing { + base association-type; + description + "Association type for resource sharing, used to enable + resource sharing during make-before-break."; + reference + "RFC 4873: GMPLS Segment Recovery + RFC 6780: RSVP ASSOCIATION Object Extensions"; + } + + identity association-type-double-sided-bidir { + base association-type; + description + "Association type for double-sided bidirectional LSPs, + used to associate two LSPs of two tunnels that are + independently configured on either endpoint."; + reference + "RFC 7551: RSVP-TE Extensions for Associated Bidirectional + Label Switched Paths (LSPs)"; + } + + identity association-type-single-sided-bidir { + base association-type; + description + "Association type for single-sided bidirectional LSPs, + used to associate two LSPs of two tunnels, where one + tunnel is configured on one side/endpoint and the other + tunnel is dynamically created on the other endpoint."; + reference + "RFC 6780: RSVP ASSOCIATION Object Extensions + RFC 7551: RSVP-TE Extensions for Associated Bidirectional + Label Switched Paths (LSPs)"; + } + + identity objective-function-type { + description + "Base objective function type."; + } + + identity of-minimize-cost-path { + base objective-function-type; + description + "Objective function for minimizing path cost."; + reference + "RFC 5541: Encoding of Objective Functions in the Path + Computation Element Communication Protocol (PCEP)"; + } + + identity of-minimize-load-path { + base objective-function-type; + description + "Objective function for minimizing the load on one or more + paths."; + reference + "RFC 5541: Encoding of Objective Functions in the Path + Computation Element Communication Protocol (PCEP)"; + } + + identity of-maximize-residual-bandwidth { + base objective-function-type; + description + "Objective function for maximizing residual bandwidth."; + reference + "RFC 5541: Encoding of Objective Functions in the Path + Computation Element Communication Protocol (PCEP)"; + } + + identity of-minimize-agg-bandwidth-consumption { + base objective-function-type; + description + "Objective function for minimizing aggregate bandwidth + consumption."; + reference + "RFC 5541: Encoding of Objective Functions in the Path + Computation Element Communication Protocol (PCEP)"; + } + + identity of-minimize-load-most-loaded-link { + base objective-function-type; + description + "Objective function for minimizing the load on the link that + is carrying the highest load."; + reference + "RFC 5541: Encoding of Objective Functions in the Path + Computation Element Communication Protocol (PCEP)"; + } + + identity of-minimize-cost-path-set { + base objective-function-type; + description + "Objective function for minimizing the cost on a path set."; + reference + "RFC 5541: Encoding of Objective Functions in the Path + Computation Element Communication Protocol (PCEP)"; + } + + identity path-computation-method { + description + "Base identity for supported path computation mechanisms."; + } + + identity path-locally-computed { + base path-computation-method; + description + "Indicates a constrained-path LSP in which the + path is computed by the local LER."; + reference + "RFC 3272: Overview and Principles of Internet Traffic + Engineering, Section 5.4"; + } + + identity path-externally-queried { + base path-computation-method; + description + "Constrained-path LSP in which the path is obtained by + querying an external source, such as a PCE server. + In the case that an LSP is defined to be externally queried, + it may also have associated explicit definitions (provided + to the external source to aid computation). The path that is + returned by the external source may require further local + computation on the device."; + reference + "RFC 3272: Overview and Principles of Internet Traffic + Engineering + RFC 4657: Path Computation Element (PCE) Communication + Protocol Generic Requirements"; + } + + identity path-explicitly-defined { + base path-computation-method; + description + "Constrained-path LSP in which the path is + explicitly specified as a collection of strict and/or loose + hops."; + reference + "RFC 3209: RSVP-TE: Extensions to RSVP for LSP Tunnels + RFC 3272: Overview and Principles of Internet Traffic + Engineering"; + } + + identity lsp-metric-type { + description + "Base identity for the LSP metric specification types."; + } + + identity lsp-metric-relative { + base lsp-metric-type; + description + "The metric specified for the LSPs to which this identity + refers is specified as a value relative to the IGP metric + cost to the LSP's tail end."; + reference + "RFC 4657: Path Computation Element (PCE) Communication + Protocol Generic Requirements"; + } + + identity lsp-metric-absolute { + base lsp-metric-type; + description + "The metric specified for the LSPs to which this identity + refers is specified as an absolute value."; + reference + "RFC 4657: Path Computation Element (PCE) Communication + Protocol Generic Requirements"; + } + + identity lsp-metric-inherited { + base lsp-metric-type; + description + "The metric for the LSPs to which this identity refers is + not specified explicitly; rather, it is directly inherited + from the IGP cost."; + reference + "RFC 4657: Path Computation Element (PCE) Communication + Protocol Generic Requirements"; + } + + identity te-tunnel-type { + description + "Base identity from which specific tunnel types are derived."; + } + + identity te-tunnel-p2p { + base te-tunnel-type; + description + "TE Point-to-Point (P2P) tunnel type."; + reference + "RFC 3209: RSVP-TE: Extensions to RSVP for LSP Tunnels"; + } + + identity te-tunnel-p2mp { + base te-tunnel-type; + description + "TE P2MP tunnel type."; + reference + "RFC 4875: Extensions to Resource Reservation Protocol - + Traffic Engineering (RSVP-TE) for Point-to-Multipoint TE + Label Switched Paths (LSPs)"; + } + + identity tunnel-action-type { + description + "Base identity from which specific tunnel action types + are derived."; + } + + identity tunnel-action-resetup { + base tunnel-action-type; + description + "TE tunnel action that tears down the tunnel's current LSP + (if any) and attempts to re-establish a new LSP."; + } + + identity tunnel-action-reoptimize { + base tunnel-action-type; + description + "TE tunnel action that reoptimizes the placement of the + tunnel LSP(s)."; + } + + identity tunnel-action-switchpath { + base tunnel-action-type; + description + "TE tunnel action that switches the tunnel's LSP to use the + specified path."; + } + + identity te-action-result { + description + "Base identity from which specific TE action results + are derived."; + } + + identity te-action-success { + base te-action-result; + description + "TE action was successful."; + } + + identity te-action-fail { + base te-action-result; + description + "TE action failed."; + } + + identity tunnel-action-inprogress { + base te-action-result; + description + "TE action is in progress."; + } + + identity tunnel-admin-state-type { + description + "Base identity for TE tunnel administrative states."; + } + + identity tunnel-admin-state-up { + base tunnel-admin-state-type; + description + "Tunnel's administrative state is up."; + } + + identity tunnel-admin-state-down { + base tunnel-admin-state-type; + description + "Tunnel's administrative state is down."; + } + + identity tunnel-state-type { + description + "Base identity for TE tunnel states."; + } + + identity tunnel-state-up { + base tunnel-state-type; + description + "Tunnel's state is up."; + } + + identity tunnel-state-down { + base tunnel-state-type; + description + "Tunnel's state is down."; + } + + identity lsp-state-type { + description + "Base identity for TE LSP states."; + } + + identity lsp-path-computing { + base lsp-state-type; + description + "State path computation is in progress."; + } + + identity lsp-path-computation-ok { + base lsp-state-type; + description + "State path computation was successful."; + } + + identity lsp-path-computation-failed { + base lsp-state-type; + description + "State path computation failed."; + } + + identity lsp-state-setting-up { + base lsp-state-type; + description + "State is being set up."; + } + + identity lsp-state-setup-ok { + base lsp-state-type; + description + "State setup was successful."; + } + + identity lsp-state-setup-failed { + base lsp-state-type; + description + "State setup failed."; + } + + identity lsp-state-up { + base lsp-state-type; + description + "State is up."; + } + + identity lsp-state-tearing-down { + base lsp-state-type; + description + "State is being torn down."; + } + + identity lsp-state-down { + base lsp-state-type; + description + "State is down."; + } + + identity path-invalidation-action-type { + description + "Base identity for TE path invalidation action types."; + } + + identity path-invalidation-action-drop { + base path-invalidation-action-type; + description + "Upon invalidation of the TE tunnel path, the tunnel remains + valid, but any packet mapped over the tunnel is dropped."; + reference + "RFC 3209: RSVP-TE: Extensions to RSVP for LSP Tunnels, + Section 2.5"; + } + + identity path-invalidation-action-teardown { + base path-invalidation-action-type; + description + "TE path invalidation action teardown."; + reference + "RFC 3209: RSVP-TE: Extensions to RSVP for LSP Tunnels, + Section 2.5"; + } + + identity lsp-restoration-type { + description + "Base identity from which LSP restoration types are derived."; + } + + identity lsp-restoration-restore-any { + base lsp-restoration-type; + description + "Any LSP affected by a failure is restored."; + } + + identity lsp-restoration-restore-all { + base lsp-restoration-type; + description + "Affected LSPs are restored after all LSPs of the tunnel are + broken."; + } + + identity restoration-scheme-type { + description + "Base identity for LSP restoration schemes."; + } + + identity restoration-scheme-preconfigured { + base restoration-scheme-type; + description + "Restoration LSP is preconfigured prior to the failure."; + reference + "RFC 4427: Recovery (Protection and Restoration) Terminology + for Generalized Multi-Protocol Label Switching (GMPLS)"; + } + + identity restoration-scheme-precomputed { + base restoration-scheme-type; + description + "Restoration LSP is precomputed prior to the failure."; + reference + "RFC 4427: Recovery (Protection and Restoration) Terminology + for Generalized Multi-Protocol Label Switching (GMPLS)"; + } + + identity restoration-scheme-presignaled { + base restoration-scheme-type; + description + "Restoration LSP is presignaled prior to the failure."; + reference + "RFC 4427: Recovery (Protection and Restoration) Terminology + for Generalized Multi-Protocol Label Switching (GMPLS)"; + } + + identity lsp-protection-type { + description + "Base identity from which LSP protection types are derived."; + reference + "RFC 4872: RSVP-TE Extensions in Support of End-to-End + Generalized Multi-Protocol Label Switching (GMPLS) Recovery"; + } + + identity lsp-protection-unprotected { + base lsp-protection-type; + description + "'Unprotected' LSP protection type."; + reference + "RFC 4872: RSVP-TE Extensions in Support of End-to-End + Generalized Multi-Protocol Label Switching (GMPLS) Recovery"; + } + + identity lsp-protection-reroute-extra { + base lsp-protection-type; + description + "'(Full) Rerouting' LSP protection type."; + reference + "RFC 4872: RSVP-TE Extensions in Support of End-to-End + Generalized Multi-Protocol Label Switching (GMPLS) Recovery"; + } + + identity lsp-protection-reroute { + base lsp-protection-type; + description + "'Rerouting without Extra-Traffic' LSP protection type."; + reference + "RFC 4872: RSVP-TE Extensions in Support of End-to-End + Generalized Multi-Protocol Label Switching (GMPLS) Recovery"; + } + + identity lsp-protection-1-for-n { + base lsp-protection-type; + description + "'1:N Protection with Extra-Traffic' LSP protection type."; + reference + "RFC 4872: RSVP-TE Extensions in Support of End-to-End + Generalized Multi-Protocol Label Switching (GMPLS) Recovery"; + } + + identity lsp-protection-1-for-1 { + base lsp-protection-type; + description + "LSP protection '1:1 Protection Type'."; + reference + "RFC 4872: RSVP-TE Extensions in Support of End-to-End + Generalized Multi-Protocol Label Switching (GMPLS) Recovery"; + } + + identity lsp-protection-unidir-1-plus-1 { + base lsp-protection-type; + description + "'1+1 Unidirectional Protection' LSP protection type."; + reference + "RFC 4872: RSVP-TE Extensions in Support of End-to-End + Generalized Multi-Protocol Label Switching (GMPLS) Recovery"; + } + + identity lsp-protection-bidir-1-plus-1 { + base lsp-protection-type; + description + "'1+1 Bidirectional Protection' LSP protection type."; + reference + "RFC 4872: RSVP-TE Extensions in Support of End-to-End + Generalized Multi-Protocol Label Switching (GMPLS) Recovery"; + } + + identity lsp-protection-extra-traffic { + base lsp-protection-type; + description + "Extra-Traffic LSP protection type."; + reference + "RFC 4427: Recovery (Protection and Restoration) Terminology + for Generalized Multi-Protocol Label Switching (GMPLS)"; + } + + identity lsp-protection-state { + description + "Base identity of protection states for reporting purposes."; + } + + identity normal { + base lsp-protection-state; + description + "Normal state."; + } + + identity signal-fail-of-protection { + base lsp-protection-state; + description + "The protection transport entity has a signal fail condition + that is of higher priority than the forced switchover + command."; + reference + "RFC 4427: Recovery (Protection and Restoration) Terminology + for Generalized Multi-Protocol Label Switching (GMPLS)"; + } + + identity lockout-of-protection { + base lsp-protection-state; + description + "A Loss of Protection (LoP) command is active."; + reference + "RFC 4427: Recovery (Protection and Restoration) Terminology + for Generalized Multi-Protocol Label Switching (GMPLS)"; + } + + identity forced-switch { + base lsp-protection-state; + description + "A forced switchover command is active."; + reference + "RFC 4427: Recovery (Protection and Restoration) Terminology + for Generalized Multi-Protocol Label Switching (GMPLS)"; + } + + identity signal-fail { + base lsp-protection-state; + description + "There is a signal fail condition on either the working path + or the protection path."; + reference + "RFC 4427: Recovery (Protection and Restoration) Terminology + for Generalized Multi-Protocol Label Switching (GMPLS)"; + } + + identity signal-degrade { + base lsp-protection-state; + description + "There is a signal degrade condition on either the working + path or the protection path."; + reference + "RFC 4427: Recovery (Protection and Restoration) Terminology + for Generalized Multi-Protocol Label Switching (GMPLS)"; + } + + identity manual-switch { + base lsp-protection-state; + description + "A manual switchover command is active."; + reference + "RFC 4427: Recovery (Protection and Restoration) Terminology + for Generalized Multi-Protocol Label Switching (GMPLS)"; + } + + identity wait-to-restore { + base lsp-protection-state; + description + "A WTR timer is running."; + reference + "RFC 4427: Recovery (Protection and Restoration) Terminology + for Generalized Multi-Protocol Label Switching (GMPLS)"; + } + + identity do-not-revert { + base lsp-protection-state; + description + "A Do Not Revert (DNR) condition is active because of + non-revertive behavior."; + reference + "RFC 4427: Recovery (Protection and Restoration) Terminology + for Generalized Multi-Protocol Label Switching (GMPLS)"; + } + + identity failure-of-protocol { + base lsp-protection-state; + description + "LSP protection is not working because of a protocol failure + condition."; + reference + "RFC 4427: Recovery (Protection and Restoration) Terminology + for Generalized Multi-Protocol Label Switching (GMPLS)"; + } + + identity protection-external-commands { + description + "Base identity from which protection-related external commands + used for troubleshooting purposes are derived."; + } + + identity action-freeze { + base protection-external-commands; + description + "A temporary configuration action initiated by an operator + command that prevents any switchover action from being taken + and, as such, freezes the current state."; + reference + "RFC 4427: Recovery (Protection and Restoration) Terminology + for Generalized Multi-Protocol Label Switching (GMPLS)"; + } + + identity clear-freeze { + base protection-external-commands; + description + "An action that clears the active freeze state."; + reference + "RFC 4427: Recovery (Protection and Restoration) Terminology + for Generalized Multi-Protocol Label Switching (GMPLS)"; + } + + identity action-lockout-of-normal { + base protection-external-commands; + description + "A temporary configuration action initiated by an operator + command to ensure that the normal traffic is not allowed + to use the protection transport entity."; + reference + "RFC 4427: Recovery (Protection and Restoration) Terminology + for Generalized Multi-Protocol Label Switching (GMPLS)"; + } + + identity clear-lockout-of-normal { + base protection-external-commands; + description + "An action that clears the active lockout of the + normal state."; + reference + "RFC 4427: Recovery (Protection and Restoration) Terminology + for Generalized Multi-Protocol Label Switching (GMPLS)"; + } + + identity action-lockout-of-protection { + base protection-external-commands; + description + "A temporary configuration action initiated by an operator + command to ensure that the protection transport entity is + temporarily not available to transport a traffic signal + (either normal or Extra-Traffic)."; + reference + "RFC 4427: Recovery (Protection and Restoration) Terminology + for Generalized Multi-Protocol Label Switching (GMPLS)"; + } + + identity action-forced-switch { + base protection-external-commands; + description + "A switchover action initiated by an operator command to switch + the Extra-Traffic signal, the normal traffic signal, or the + null signal to the protection transport entity, unless a + switchover command of equal or higher priority is in effect."; + reference + "RFC 4427: Recovery (Protection and Restoration) Terminology + for Generalized Multi-Protocol Label Switching (GMPLS)"; + } + + identity action-manual-switch { + base protection-external-commands; + description + "A switchover action initiated by an operator command to switch + the Extra-Traffic signal, the normal traffic signal, or + the null signal to the protection transport entity, unless + a fault condition exists on other transport entities or a + switchover command of equal or higher priority is in effect."; + reference + "RFC 4427: Recovery (Protection and Restoration) Terminology + for Generalized Multi-Protocol Label Switching (GMPLS)"; + } + + identity action-exercise { + base protection-external-commands; + description + "An action that starts testing whether or not APS communication + is operating correctly. It is of lower priority than any + other state or command."; + reference + "RFC 4427: Recovery (Protection and Restoration) Terminology + for Generalized Multi-Protocol Label Switching (GMPLS)"; + } + + identity clear { + base protection-external-commands; + description + "An action that clears the active near-end lockout of a + protection, forced switchover, manual switchover, WTR state, + or exercise command."; + reference + "RFC 4427: Recovery (Protection and Restoration) Terminology + for Generalized Multi-Protocol Label Switching (GMPLS)"; + } + + identity switching-capabilities { + description + "Base identity for interface switching capabilities."; + reference + "RFC 3471: Generalized Multi-Protocol Label Switching (GMPLS) + Signaling Functional Description"; + } + + identity switching-psc1 { + base switching-capabilities; + description + "Packet-Switch Capable-1 (PSC-1)."; + reference + "RFC 3471: Generalized Multi-Protocol Label Switching (GMPLS) + Signaling Functional Description"; + } + + identity switching-evpl { + base switching-capabilities; + description + "Ethernet Virtual Private Line (EVPL)."; + reference + "RFC 6004: Generalized MPLS (GMPLS) Support for Metro Ethernet + Forum and G.8011 Ethernet Service Switching"; + } + + identity switching-l2sc { + base switching-capabilities; + description + "Layer-2 Switch Capable (L2SC)."; + reference + "RFC 3471: Generalized Multi-Protocol Label Switching (GMPLS) + Signaling Functional Description"; + } + + identity switching-tdm { + base switching-capabilities; + description + "Time-Division-Multiplex Capable (TDM)."; + reference + "RFC 3471: Generalized Multi-Protocol Label Switching (GMPLS) + Signaling Functional Description"; + } + + identity switching-otn { + base switching-capabilities; + description + "OTN-TDM capable."; + reference + "RFC 7138: Traffic Engineering Extensions to OSPF for GMPLS + Control of Evolving G.709 Optical Transport Networks"; + } + + identity switching-dcsc { + base switching-capabilities; + description + "Data Channel Switching Capable (DCSC)."; + reference + "RFC 6002: Generalized MPLS (GMPLS) Data Channel + Switching Capable (DCSC) and Channel Set Label Extensions"; + } + + identity switching-lsc { + base switching-capabilities; + description + "Lambda-Switch Capable (LSC)."; + reference + "RFC 3471: Generalized Multi-Protocol Label Switching (GMPLS) + Signaling Functional Description"; + } + + identity switching-fsc { + base switching-capabilities; + description + "Fiber-Switch Capable (FSC)."; + reference + "RFC 3471: Generalized Multi-Protocol Label Switching (GMPLS) + Signaling Functional Description"; + } + + identity lsp-encoding-types { + description + "Base identity for encoding types."; + reference + "RFC 3471: Generalized Multi-Protocol Label Switching (GMPLS) + Signaling Functional Description"; + } + + identity lsp-encoding-packet { + base lsp-encoding-types; + description + "Packet LSP encoding."; + reference + "RFC 3471: Generalized Multi-Protocol Label Switching (GMPLS) + Signaling Functional Description"; + } + + identity lsp-encoding-ethernet { + base lsp-encoding-types; + description + "Ethernet LSP encoding."; + reference + "RFC 3471: Generalized Multi-Protocol Label Switching (GMPLS) + Signaling Functional Description"; + } + + identity lsp-encoding-pdh { + base lsp-encoding-types; + description + "ANSI/ETSI PDH LSP encoding."; + reference + "RFC 3471: Generalized Multi-Protocol Label Switching (GMPLS) + Signaling Functional Description"; + } + + identity lsp-encoding-sdh { + base lsp-encoding-types; + description + "SDH ITU-T G.707 / SONET ANSI T1.105 LSP encoding."; + reference + "RFC 3471: Generalized Multi-Protocol Label Switching (GMPLS) + Signaling Functional Description"; + } + + identity lsp-encoding-digital-wrapper { + base lsp-encoding-types; + description + "Digital Wrapper LSP encoding."; + reference + "RFC 3471: Generalized Multi-Protocol Label Switching (GMPLS) + Signaling Functional Description"; + } + + identity lsp-encoding-lambda { + base lsp-encoding-types; + description + "Lambda (photonic) LSP encoding."; + reference + "RFC 3471: Generalized Multi-Protocol Label Switching (GMPLS) + Signaling Functional Description"; + } + + identity lsp-encoding-fiber { + base lsp-encoding-types; + description + "Fiber LSP encoding."; + reference + "RFC 3471: Generalized Multi-Protocol Label Switching (GMPLS) + Signaling Functional Description"; + } + + identity lsp-encoding-fiber-channel { + base lsp-encoding-types; + description + "FiberChannel LSP encoding."; + reference + "RFC 3471: Generalized Multi-Protocol Label Switching (GMPLS) + Signaling Functional Description"; + } + + identity lsp-encoding-oduk { + base lsp-encoding-types; + description + "G.709 ODUk (Digital Path) LSP encoding."; + reference + "RFC 4328: Generalized Multi-Protocol Label Switching (GMPLS) + Signaling Extensions for G.709 Optical Transport Networks + Control"; + } + + identity lsp-encoding-optical-channel { + base lsp-encoding-types; + description + "G.709 Optical Channel LSP encoding."; + reference + "RFC 4328: Generalized Multi-Protocol Label Switching (GMPLS) + Signaling Extensions for G.709 Optical Transport Networks + Control"; + } + + identity lsp-encoding-line { + base lsp-encoding-types; + description + "Line (e.g., 8B/10B) LSP encoding."; + reference + "RFC 6004: Generalized MPLS (GMPLS) Support for Metro + Ethernet Forum and G.8011 Ethernet Service Switching"; + } + + identity path-signaling-type { + description + "Base identity from which specific LSP path setup types + are derived."; + } + + identity path-setup-static { + base path-signaling-type; + description + "Static LSP provisioning path setup."; + } + + identity path-setup-rsvp { + base path-signaling-type; + description + "RSVP-TE signaling path setup."; + reference + "RFC 3209: RSVP-TE: Extensions to RSVP for LSP Tunnels"; + } + + identity path-setup-sr { + base path-signaling-type; + description + "Segment-routing path setup."; + } + + identity path-scope-type { + description + "Base identity from which specific path scope types are + derived."; + } + + identity path-scope-segment { + base path-scope-type; + description + "Path scope segment."; + reference + "RFC 4873: GMPLS Segment Recovery"; + } + + identity path-scope-end-to-end { + base path-scope-type; + description + "Path scope end to end."; + reference + "RFC 4873: GMPLS Segment Recovery"; + } + + identity route-usage-type { + description + "Base identity for route usage."; + } + + identity route-include-object { + base route-usage-type; + description + "'Include route' object."; + } + + identity route-exclude-object { + base route-usage-type; + description + "'Exclude route' object."; + reference + "RFC 4874: Exclude Routes - Extension to Resource ReserVation + Protocol-Traffic Engineering (RSVP-TE)"; + } + + identity route-exclude-srlg { + base route-usage-type; + description + "Excludes SRLGs."; + reference + "RFC 4874: Exclude Routes - Extension to Resource ReserVation + Protocol-Traffic Engineering (RSVP-TE)"; + } + + identity path-metric-type { + description + "Base identity for the path metric type."; + } + + identity path-metric-te { + base path-metric-type; + description + "TE path metric."; + reference + "RFC 3785: Use of Interior Gateway Protocol (IGP) Metric as a + second MPLS Traffic Engineering (TE) Metric"; + } + + identity path-metric-igp { + base path-metric-type; + description + "IGP path metric."; + reference + "RFC 3785: Use of Interior Gateway Protocol (IGP) Metric as a + second MPLS Traffic Engineering (TE) Metric"; + } + + identity path-metric-hop { + base path-metric-type; + description + "Hop path metric."; + } + + identity path-metric-delay-average { + base path-metric-type; + description + "Average unidirectional link delay."; + reference + "RFC 7471: OSPF Traffic Engineering (TE) Metric Extensions"; + } + + identity path-metric-delay-minimum { + base path-metric-type; + description + "Minimum unidirectional link delay."; + reference + "RFC 7471: OSPF Traffic Engineering (TE) Metric Extensions"; + } + + identity path-metric-residual-bandwidth { + base path-metric-type; + description + "Unidirectional Residual Bandwidth, which is defined to be + Maximum Bandwidth (RFC 3630) minus the bandwidth currently + allocated to LSPs."; + reference + "RFC 3630: Traffic Engineering (TE) Extensions to OSPF + Version 2 + RFC 7471: OSPF Traffic Engineering (TE) Metric Extensions"; + } + + identity path-metric-optimize-includes { + base path-metric-type; + description + "A metric that optimizes the number of included resources + specified in a set."; + } + + identity path-metric-optimize-excludes { + base path-metric-type; + description + "A metric that optimizes to a maximum the number of excluded + resources specified in a set."; + } + + identity path-tiebreaker-type { + description + "Base identity for the path tiebreaker type."; + } + + identity path-tiebreaker-minfill { + base path-tiebreaker-type; + description + "Min-Fill LSP path placement."; + } + + identity path-tiebreaker-maxfill { + base path-tiebreaker-type; + description + "Max-Fill LSP path placement."; + } + + identity path-tiebreaker-random { + base path-tiebreaker-type; + description + "Random LSP path placement."; + } + + identity resource-affinities-type { + description + "Base identity for resource class affinities."; + reference + "RFC 2702: Requirements for Traffic Engineering Over MPLS"; + } + + identity resource-aff-include-all { + base resource-affinities-type; + description + "The set of attribute filters associated with a + tunnel, all of which must be present for a link + to be acceptable."; + reference + "RFC 2702: Requirements for Traffic Engineering Over MPLS + RFC 3209: RSVP-TE: Extensions to RSVP for LSP Tunnels"; + } + + identity resource-aff-include-any { + base resource-affinities-type; + description + "The set of attribute filters associated with a + tunnel, any of which must be present for a link + to be acceptable."; + reference + "RFC 2702: Requirements for Traffic Engineering Over MPLS + RFC 3209: RSVP-TE: Extensions to RSVP for LSP Tunnels"; + } + + identity resource-aff-exclude-any { + base resource-affinities-type; + description + "The set of attribute filters associated with a + tunnel, any of which renders a link unacceptable."; + reference + "RFC 2702: Requirements for Traffic Engineering Over MPLS + RFC 3209: RSVP-TE: Extensions to RSVP for LSP Tunnels"; + } + + identity te-optimization-criterion { + description + "Base identity for the TE optimization criteria."; + reference + "RFC 3272: Overview and Principles of Internet Traffic + Engineering"; + } + + identity not-optimized { + base te-optimization-criterion; + description + "Optimization is not applied."; + } + + identity cost { + base te-optimization-criterion; + description + "Optimized on cost."; + reference + "RFC 5541: Encoding of Objective Functions in the Path + Computation Element Communication Protocol (PCEP)"; + } + + identity delay { + base te-optimization-criterion; + description + "Optimized on delay."; + reference + "RFC 5541: Encoding of Objective Functions in the Path + Computation Element Communication Protocol (PCEP)"; + } + + identity path-computation-srlg-type { + description + "Base identity for SRLG path computation."; + } + + identity srlg-ignore { + base path-computation-srlg-type; + description + "Ignores SRLGs in the path computation."; + } + + identity srlg-strict { + base path-computation-srlg-type; + description + "Includes a strict SRLG check in the path computation."; + } + + identity srlg-preferred { + base path-computation-srlg-type; + description + "Includes a preferred SRLG check in the path computation."; + } + + identity srlg-weighted { + base path-computation-srlg-type; + description + "Includes a weighted SRLG check in the path computation."; + } + + /** + * TE bandwidth groupings + **/ + + grouping te-bandwidth { + description + "This grouping defines the generic TE bandwidth. + For some known data-plane technologies, specific modeling + structures are specified. The string-encoded 'te-bandwidth' + type is used for unspecified technologies. + The modeling structure can be augmented later for other + technologies."; + container te-bandwidth { + description + "Container that specifies TE bandwidth. The choices + can be augmented for specific data-plane technologies."; + choice technology { + default "generic"; + description + "Data-plane technology type."; + case generic { + leaf generic { + type te-bandwidth; + description + "Bandwidth specified in a generic format."; + } + } + } + } + } + + /** + * TE label groupings + **/ + + grouping te-label { + description + "This grouping defines the generic TE label. + The modeling structure can be augmented for each technology. + For unspecified technologies, 'rt-types:generalized-label' + is used."; + container te-label { + description + "Container that specifies the TE label. The choices can + be augmented for specific data-plane technologies."; + choice technology { + default "generic"; + description + "Data-plane technology type."; + case generic { + leaf generic { + type rt-types:generalized-label; + description + "TE label specified in a generic format."; + } + } + } + leaf direction { + type te-label-direction; + default "forward"; + description + "Label direction."; + } + } + } + + grouping te-topology-identifier { + description + "Augmentation for a TE topology."; + container te-topology-identifier { + description + "TE topology identifier container."; + leaf provider-id { + type te-global-id; + default "0"; + description + "An identifier to uniquely identify a provider. + If omitted, it assumes that the topology provider ID + value = 0 (the default)."; + } + leaf client-id { + type te-global-id; + default "0"; + description + "An identifier to uniquely identify a client. + If omitted, it assumes that the topology client ID + value = 0 (the default)."; + } + leaf topology-id { + type te-topology-id; + default ""; + description + "When the datastore contains several topologies, + 'topology-id' distinguishes between them. If omitted, + the default (empty) string for this leaf is assumed."; + } + } + } + + /** + * TE performance metrics groupings + **/ + + grouping performance-metrics-one-way-delay-loss { + description + "Performance Metrics (PM) information in real time that can + be applicable to links or connections. PM defined in this + grouping are applicable to generic TE PM as well as packet TE + PM."; + reference + "RFC 7471: OSPF Traffic Engineering (TE) Metric Extensions + RFC 7823: Performance-Based Path Selection for Explicitly + Routed Label Switched Paths (LSPs) Using TE Metric + Extensions + RFC 8570: IS-IS Traffic Engineering (TE) Metric Extensions"; + leaf one-way-delay { + type uint32 { + range "0..16777215"; + } + description + "One-way delay or latency in microseconds."; + } + leaf one-way-delay-normality { + type te-types:performance-metrics-normality; + description + "One-way delay normality."; + } + } + + grouping performance-metrics-two-way-delay-loss { + description + "PM information in real time that can be applicable to links or + connections. PM defined in this grouping are applicable to + generic TE PM as well as packet TE PM."; + reference + "RFC 7471: OSPF Traffic Engineering (TE) Metric Extensions + RFC 7823: Performance-Based Path Selection for Explicitly + Routed Label Switched Paths (LSPs) Using TE Metric + Extensions + RFC 8570: IS-IS Traffic Engineering (TE) Metric Extensions"; + leaf two-way-delay { + type uint32 { + range "0..16777215"; + } + description + "Two-way delay or latency in microseconds."; + } + leaf two-way-delay-normality { + type te-types:performance-metrics-normality; + description + "Two-way delay normality."; + } + } + + grouping performance-metrics-one-way-bandwidth { + description + "PM information in real time that can be applicable to links. + PM defined in this grouping are applicable to generic TE PM + as well as packet TE PM."; + reference + "RFC 7471: OSPF Traffic Engineering (TE) Metric Extensions + RFC 7823: Performance-Based Path Selection for Explicitly + Routed Label Switched Paths (LSPs) Using TE Metric + Extensions + RFC 8570: IS-IS Traffic Engineering (TE) Metric Extensions"; + leaf one-way-residual-bandwidth { + type rt-types:bandwidth-ieee-float32; + units "bytes per second"; + default "0x0p0"; + description + "Residual bandwidth that subtracts tunnel reservations from + Maximum Bandwidth (or link capacity) (RFC 3630) and + provides an aggregated remainder across QoS classes."; + reference + "RFC 3630: Traffic Engineering (TE) Extensions to OSPF + Version 2"; + } + leaf one-way-residual-bandwidth-normality { + type te-types:performance-metrics-normality; + default "normal"; + description + "Residual bandwidth normality."; + } + leaf one-way-available-bandwidth { + type rt-types:bandwidth-ieee-float32; + units "bytes per second"; + default "0x0p0"; + description + "Available bandwidth that is defined to be residual + bandwidth minus the measured bandwidth used for the + actual forwarding of non-RSVP-TE LSP packets. For a + bundled link, available bandwidth is defined to be the + sum of the component link available bandwidths."; + } + leaf one-way-available-bandwidth-normality { + type te-types:performance-metrics-normality; + default "normal"; + description + "Available bandwidth normality."; + } + leaf one-way-utilized-bandwidth { + type rt-types:bandwidth-ieee-float32; + units "bytes per second"; + default "0x0p0"; + description + "Bandwidth utilization that represents the actual + utilization of the link (i.e., as measured in the router). + For a bundled link, bandwidth utilization is defined to + be the sum of the component link bandwidth utilizations."; + } + leaf one-way-utilized-bandwidth-normality { + type te-types:performance-metrics-normality; + default "normal"; + description + "Bandwidth utilization normality."; + } + } + + grouping one-way-performance-metrics { + description + "One-way PM throttle grouping."; + leaf one-way-delay { + type uint32 { + range "0..16777215"; + } + default "0"; + description + "One-way delay or latency in microseconds."; + } + leaf one-way-residual-bandwidth { + type rt-types:bandwidth-ieee-float32; + units "bytes per second"; + default "0x0p0"; + description + "Residual bandwidth that subtracts tunnel reservations from + Maximum Bandwidth (or link capacity) (RFC 3630) and + provides an aggregated remainder across QoS classes."; + reference + "RFC 3630: Traffic Engineering (TE) Extensions to OSPF + Version 2"; + } + leaf one-way-available-bandwidth { + type rt-types:bandwidth-ieee-float32; + units "bytes per second"; + default "0x0p0"; + description + "Available bandwidth that is defined to be residual + bandwidth minus the measured bandwidth used for the + actual forwarding of non-RSVP-TE LSP packets. For a + bundled link, available bandwidth is defined to be the + sum of the component link available bandwidths."; + } + leaf one-way-utilized-bandwidth { + type rt-types:bandwidth-ieee-float32; + units "bytes per second"; + default "0x0p0"; + description + "Bandwidth utilization that represents the actual + utilization of the link (i.e., as measured in the router). + For a bundled link, bandwidth utilization is defined to + be the sum of the component link bandwidth utilizations."; + } + } + + grouping two-way-performance-metrics { + description + "Two-way PM throttle grouping."; + leaf two-way-delay { + type uint32 { + range "0..16777215"; + } + default "0"; + description + "Two-way delay or latency in microseconds."; + } + } + + grouping performance-metrics-thresholds { + description + "Grouping for configurable thresholds for measured + attributes."; + uses one-way-performance-metrics; + uses two-way-performance-metrics; + } + + grouping performance-metrics-attributes { + description + "Contains PM attributes."; + container performance-metrics-one-way { + description + "One-way link performance information in real time."; + reference + "RFC 7471: OSPF Traffic Engineering (TE) Metric Extensions + RFC 7823: Performance-Based Path Selection for Explicitly + Routed Label Switched Paths (LSPs) Using TE Metric + Extensions + RFC 8570: IS-IS Traffic Engineering (TE) Metric Extensions"; + uses performance-metrics-one-way-delay-loss; + uses performance-metrics-one-way-bandwidth; + } + container performance-metrics-two-way { + description + "Two-way link performance information in real time."; + reference + "RFC 6374: Packet Loss and Delay Measurement for MPLS + Networks"; + uses performance-metrics-two-way-delay-loss; + } + } + + grouping performance-metrics-throttle-container { + description + "Controls PM throttling."; + container throttle { + must 'suppression-interval >= measure-interval' { + error-message "'suppression-interval' cannot be less than " + + "'measure-interval'."; + description + "Constraint on 'suppression-interval' and + 'measure-interval'."; + } + description + "Link performance information in real time."; + reference + "RFC 7471: OSPF Traffic Engineering (TE) Metric Extensions + RFC 7823: Performance-Based Path Selection for Explicitly + Routed Label Switched Paths (LSPs) Using TE Metric + Extensions + RFC 8570: IS-IS Traffic Engineering (TE) Metric Extensions"; + leaf one-way-delay-offset { + type uint32 { + range "0..16777215"; + } + default "0"; + description + "Offset value to be added to the measured delay value."; + } + leaf measure-interval { + type uint32; + default "30"; + description + "Interval, in seconds, to measure the extended metric + values."; + } + leaf advertisement-interval { + type uint32; + default "0"; + description + "Interval, in seconds, to advertise the extended metric + values."; + } + leaf suppression-interval { + type uint32 { + range "1..max"; + } + default "120"; + description + "Interval, in seconds, to suppress advertisement of the + extended metric values."; + reference + "RFC 8570: IS-IS Traffic Engineering (TE) Metric + Extensions, Section 6"; + } + container threshold-out { + uses performance-metrics-thresholds; + description + "If the measured parameter falls outside an upper bound + for all but the minimum-delay metric (or a lower bound + for the minimum-delay metric only) and the advertised + value is not already outside that bound, an 'anomalous' + announcement (anomalous bit set) will be triggered."; + } + container threshold-in { + uses performance-metrics-thresholds; + description + "If the measured parameter falls inside an upper bound + for all but the minimum-delay metric (or a lower bound + for the minimum-delay metric only) and the advertised + value is not already inside that bound, a 'normal' + announcement (anomalous bit cleared) will be triggered."; + } + container threshold-accelerated-advertisement { + description + "When the difference between the last advertised value and + the current measured value exceeds this threshold, an + 'anomalous' announcement (anomalous bit set) will be + triggered."; + uses performance-metrics-thresholds; + } + } + } + + /** + * TE tunnel generic groupings + **/ + + grouping explicit-route-hop { + description + "The explicit route entry grouping."; + choice type { + description + "The explicit route entry type."; + case numbered-node-hop { + container numbered-node-hop { + leaf node-id { + type te-node-id; + mandatory true; + description + "The identifier of a node in the TE topology."; + } + leaf hop-type { + type te-hop-type; + default "strict"; + description + "Strict or loose hop."; + } + description + "Numbered node route hop."; + reference + "RFC 3209: RSVP-TE: Extensions to RSVP for LSP Tunnels, + Section 4.3, EXPLICIT_ROUTE in RSVP-TE + RFC 3477: Signalling Unnumbered Links in Resource + ReSerVation Protocol - Traffic Engineering (RSVP-TE)"; + } + } + case numbered-link-hop { + container numbered-link-hop { + leaf link-tp-id { + type te-tp-id; + mandatory true; + description + "TE Link Termination Point (LTP) identifier."; + } + leaf hop-type { + type te-hop-type; + default "strict"; + description + "Strict or loose hop."; + } + leaf direction { + type te-link-direction; + default "outgoing"; + description + "Link route object direction."; + } + description + "Numbered link explicit route hop."; + reference + "RFC 3209: RSVP-TE: Extensions to RSVP for LSP Tunnels, + Section 4.3, EXPLICIT_ROUTE in RSVP-TE + RFC 3477: Signalling Unnumbered Links in Resource + ReSerVation Protocol - Traffic Engineering (RSVP-TE)"; + } + } + case unnumbered-link-hop { + container unnumbered-link-hop { + leaf link-tp-id { + type te-tp-id; + mandatory true; + description + "TE LTP identifier. The combination of the TE link ID + and the TE node ID is used to identify an unnumbered + TE link."; + } + leaf node-id { + type te-node-id; + mandatory true; + description + "The identifier of a node in the TE topology."; + } + leaf hop-type { + type te-hop-type; + default "strict"; + description + "Strict or loose hop."; + } + leaf direction { + type te-link-direction; + default "outgoing"; + description + "Link route object direction."; + } + description + "Unnumbered link explicit route hop."; + reference + "RFC 3209: RSVP-TE: Extensions to RSVP for LSP Tunnels, + Section 4.3, EXPLICIT_ROUTE in RSVP-TE + RFC 3477: Signalling Unnumbered Links in Resource + ReSerVation Protocol - Traffic Engineering (RSVP-TE)"; + } + } + case as-number { + container as-number-hop { + leaf as-number { + type inet:as-number; + mandatory true; + description + "The Autonomous System (AS) number."; + } + leaf hop-type { + type te-hop-type; + default "strict"; + description + "Strict or loose hop."; + } + description + "AS explicit route hop."; + } + } + case label { + container label-hop { + description + "Label hop type."; + uses te-label; + } + description + "The label explicit route hop type."; + } + } + } + + grouping record-route-state { + description + "The Record Route grouping."; + leaf index { + type uint32; + description + "Record Route hop index. The index is used to + identify an entry in the list. The order of entries + is defined by the user without relying on key values."; + } + choice type { + description + "The Record Route entry type."; + case numbered-node-hop { + container numbered-node-hop { + description + "Numbered node route hop container."; + leaf node-id { + type te-node-id; + mandatory true; + description + "The identifier of a node in the TE topology."; + } + leaf-list flags { + type path-attribute-flags; + description + "Path attributes flags."; + reference + "RFC 3209: RSVP-TE: Extensions to RSVP for LSP Tunnels + RFC 4090: Fast Reroute Extensions to RSVP-TE for LSP + Tunnels + RFC 4561: Definition of a Record Route Object (RRO) + Node-Id Sub-Object"; + } + } + description + "Numbered node route hop."; + } + case numbered-link-hop { + container numbered-link-hop { + description + "Numbered link route hop container."; + leaf link-tp-id { + type te-tp-id; + mandatory true; + description + "Numbered TE LTP identifier."; + } + leaf-list flags { + type path-attribute-flags; + description + "Path attributes flags."; + reference + "RFC 3209: RSVP-TE: Extensions to RSVP for LSP Tunnels + RFC 4090: Fast Reroute Extensions to RSVP-TE for LSP + Tunnels + RFC 4561: Definition of a Record Route Object (RRO) + Node-Id Sub-Object"; + } + } + description + "Numbered link route hop."; + } + case unnumbered-link-hop { + container unnumbered-link-hop { + leaf link-tp-id { + type te-tp-id; + mandatory true; + description + "TE LTP identifier. The combination of the TE link ID + and the TE node ID is used to identify an unnumbered + TE link."; + } + leaf node-id { + type te-node-id; + description + "The identifier of a node in the TE topology."; + } + leaf-list flags { + type path-attribute-flags; + description + "Path attributes flags."; + reference + "RFC 3209: RSVP-TE: Extensions to RSVP for LSP Tunnels + RFC 4090: Fast Reroute Extensions to RSVP-TE for LSP + Tunnels + RFC 4561: Definition of a Record Route Object (RRO) + Node-Id Sub-Object"; + } + description + "Unnumbered link Record Route hop."; + reference + "RFC 3477: Signalling Unnumbered Links in Resource + ReSerVation Protocol - Traffic Engineering (RSVP-TE)"; + } + description + "Unnumbered link route hop."; + } + case label { + container label-hop { + description + "Label route hop type."; + uses te-label; + leaf-list flags { + type path-attribute-flags; + description + "Path attributes flags."; + reference + "RFC 3209: RSVP-TE: Extensions to RSVP for LSP Tunnels + RFC 4090: Fast Reroute Extensions to RSVP-TE for LSP + Tunnels + RFC 4561: Definition of a Record Route Object (RRO) + Node-Id Sub-Object"; + } + } + description + "The label Record Route entry types."; + } + } + } + + grouping label-restriction-info { + description + "Label set item information."; + leaf restriction { + type enumeration { + enum inclusive { + description + "The label or label range is inclusive."; + } + enum exclusive { + description + "The label or label range is exclusive."; + } + } + default "inclusive"; + description + "Indicates whether the list item is inclusive or exclusive."; + } + leaf index { + type uint32; + description + "The index of the label restriction list entry."; + } + container label-start { + must "(not(../label-end/te-label/direction) and" + + " not(te-label/direction))" + + " or " + + "(../label-end/te-label/direction = te-label/direction)" + + " or " + + "(not(te-label/direction) and" + + " (../label-end/te-label/direction = 'forward'))" + + " or " + + "(not(../label-end/te-label/direction) and" + + " (te-label/direction = 'forward'))" { + error-message "'label-start' and 'label-end' must have the " + + "same direction."; + } + description + "This is the starting label if a label range is specified. + This is the label value if a single label is specified, + in which case the 'label-end' attribute is not set."; + uses te-label; + } + container label-end { + must "(not(../label-start/te-label/direction) and" + + " not(te-label/direction))" + + " or " + + "(../label-start/te-label/direction = te-label/direction)" + + " or " + + "(not(te-label/direction) and" + + " (../label-start/te-label/direction = 'forward'))" + + " or " + + "(not(../label-start/te-label/direction) and" + + " (te-label/direction = 'forward'))" { + error-message "'label-start' and 'label-end' must have the " + + "same direction."; + } + description + "This is the ending label if a label range is specified. + This attribute is not set if a single label is specified."; + uses te-label; + } + container label-step { + description + "The step increment between labels in the label range. + The label start/end values will have to be consistent + with the sign of label step. For example, + 'label-start' < 'label-end' enforces 'label-step' > 0 + 'label-start' > 'label-end' enforces 'label-step' < 0."; + choice technology { + default "generic"; + description + "Data-plane technology type."; + case generic { + leaf generic { + type int32; + default "1"; + description + "Label range step."; + } + } + } + } + leaf range-bitmap { + type yang:hex-string; + description + "When there are gaps between 'label-start' and 'label-end', + this attribute is used to specify the positions + of the used labels. This is represented in big endian as + 'hex-string'. + The most significant byte in the hex-string is the farthest + to the left in the byte sequence. Leading zero bytes in the + configured value may be omitted for brevity. + Each bit position in the 'range-bitmap' 'hex-string' maps + to a label in the range derived from 'label-start'. + + For example, assuming that 'label-start' = 16000 and + 'range-bitmap' = 0x01000001, then: + + - bit position (0) is set, and the corresponding mapped + label from the range is 16000 + (0 * 'label-step') or + 16000 for default 'label-step' = 1. + - bit position (24) is set, and the corresponding mapped + label from the range is 16000 + (24 * 'label-step') or + 16024 for default 'label-step' = 1."; + } + } + + grouping label-set-info { + description + "Grouping for the list of label restrictions specifying what + labels may or may not be used."; + container label-restrictions { + description + "The label restrictions container."; + list label-restriction { + key "index"; + description + "The absence of the label restrictions container implies + that all labels are acceptable; otherwise, only restricted + labels are available."; + reference + "RFC 7579: General Network Element Constraint Encoding + for GMPLS-Controlled Networks"; + uses label-restriction-info; + } + } + } + + grouping optimization-metric-entry { + description + "Optimization metrics configuration grouping."; + leaf metric-type { + type identityref { + base path-metric-type; + } + description + "Identifies the 'metric-type' that the path computation + process uses for optimization."; + } + leaf weight { + type uint8; + default "1"; + description + "TE path metric normalization weight."; + } + container explicit-route-exclude-objects { + when "../metric-type = " + + "'te-types:path-metric-optimize-excludes'"; + description + "Container for the 'exclude route' object list."; + uses path-route-exclude-objects; + } + container explicit-route-include-objects { + when "../metric-type = " + + "'te-types:path-metric-optimize-includes'"; + description + "Container for the 'include route' object list."; + uses path-route-include-objects; + } + } + + grouping common-constraints { + description + "Common constraints grouping that can be set on + a constraint set or directly on the tunnel."; + uses te-bandwidth { + description + "A requested bandwidth to use for path computation."; + } + leaf link-protection { + type identityref { + base link-protection-type; + } + default "te-types:link-protection-unprotected"; + description + "Link protection type required for the links included + in the computed path."; + reference + "RFC 4202: Routing Extensions in Support of + Generalized Multi-Protocol Label Switching (GMPLS)"; + } + leaf setup-priority { + type uint8 { + range "0..7"; + } + default "7"; + description + "TE LSP requested setup priority."; + reference + "RFC 3209: RSVP-TE: Extensions to RSVP for LSP Tunnels"; + } + leaf hold-priority { + type uint8 { + range "0..7"; + } + default "7"; + description + "TE LSP requested hold priority."; + reference + "RFC 3209: RSVP-TE: Extensions to RSVP for LSP Tunnels"; + } + leaf signaling-type { + type identityref { + base path-signaling-type; + } + default "te-types:path-setup-rsvp"; + description + "TE tunnel path signaling type."; + } + } + + grouping tunnel-constraints { + description + "Tunnel constraints grouping that can be set on + a constraint set or directly on the tunnel."; + uses te-topology-identifier; + uses common-constraints; + } + + grouping path-constraints-route-objects { + description + "List of route entries to be included or excluded when + performing the path computation."; + container explicit-route-objects-always { + description + "Container for the 'exclude route' object list."; + list route-object-exclude-always { + key "index"; + ordered-by user; + description + "List of route objects to always exclude from the path + computation."; + leaf index { + type uint32; + description + "Explicit Route Object index. The index is used to + identify an entry in the list. The order of entries + is defined by the user without relying on key values."; + } + uses explicit-route-hop; + } + list route-object-include-exclude { + key "index"; + ordered-by user; + description + "List of route objects to include or exclude in the path + computation."; + leaf explicit-route-usage { + type identityref { + base route-usage-type; + } + default "te-types:route-include-object"; + description + "Indicates whether to include or exclude the + route object. The default is to include it."; + } + leaf index { + type uint32; + description + "Route object include-exclude index. The index is used + to identify an entry in the list. The order of entries + is defined by the user without relying on key values."; + } + uses explicit-route-hop { + augment "type" { + case srlg { + container srlg { + description + "SRLG container."; + leaf srlg { + type uint32; + description + "SRLG value."; + } + } + description + "An SRLG value to be included or excluded."; + } + description + "Augmentation for a generic explicit route for SRLG + exclusion."; + } + } + } + } + } + + grouping path-route-include-objects { + description + "List of route objects to be included when performing + the path computation."; + list route-object-include-object { + key "index"; + ordered-by user; + description + "List of Explicit Route Objects to be included in the + path computation."; + leaf index { + type uint32; + description + "Route object entry index. The index is used to + identify an entry in the list. The order of entries + is defined by the user without relying on key values."; + } + uses explicit-route-hop; + } + } + + grouping path-route-exclude-objects { + description + "List of route objects to be excluded when performing + the path computation."; + list route-object-exclude-object { + key "index"; + ordered-by user; + description + "List of Explicit Route Objects to be excluded in the + path computation."; + leaf index { + type uint32; + description + "Route object entry index. The index is used to + identify an entry in the list. The order of entries + is defined by the user without relying on key values."; + } + uses explicit-route-hop { + augment "type" { + case srlg { + container srlg { + description + "SRLG container."; + leaf srlg { + type uint32; + description + "SRLG value."; + } + } + description + "An SRLG value to be included or excluded."; + } + description + "Augmentation for a generic explicit route for SRLG + exclusion."; + } + } + } + } + + grouping generic-path-metric-bounds { + description + "TE path metric bounds grouping."; + container path-metric-bounds { + description + "TE path metric bounds container."; + list path-metric-bound { + key "metric-type"; + description + "List of TE path metric bounds."; + leaf metric-type { + type identityref { + base path-metric-type; + } + description + "Identifies an entry in the list of 'metric-type' items + bound for the TE path."; + } + leaf upper-bound { + type uint64; + default "0"; + description + "Upper bound on the end-to-end TE path metric. A zero + indicates an unbounded upper limit for the specific + 'metric-type'."; + } + } + } + } + + grouping generic-path-optimization { + description + "TE generic path optimization grouping."; + container optimizations { + description + "The objective function container that includes + attributes to impose when computing a TE path."; + choice algorithm { + description + "Optimizations algorithm."; + case metric { + if-feature "path-optimization-metric"; + /* Optimize by metric */ + list optimization-metric { + key "metric-type"; + description + "TE path metric type."; + uses optimization-metric-entry; + } + /* Tiebreakers */ + container tiebreakers { + description + "Container for the list of tiebreakers."; + list tiebreaker { + key "tiebreaker-type"; + description + "The list of tiebreaker criteria to apply on an + equally favored set of paths, in order to pick + the best."; + leaf tiebreaker-type { + type identityref { + base path-metric-type; + } + description + "Identifies an entry in the list of tiebreakers."; + } + } + } + } + case objective-function { + if-feature "path-optimization-objective-function"; + /* Objective functions */ + container objective-function { + description + "The objective function container that includes + attributes to impose when computing a TE path."; + leaf objective-function-type { + type identityref { + base objective-function-type; + } + default "te-types:of-minimize-cost-path"; + description + "Objective function entry."; + } + } + } + } + } + } + + grouping generic-path-affinities { + description + "Path affinities grouping."; + container path-affinities-values { + description + "Path affinities represented as values."; + list path-affinities-value { + key "usage"; + description + "List of named affinity constraints."; + leaf usage { + type identityref { + base resource-affinities-type; + } + description + "Identifies an entry in the list of value affinity + constraints."; + } + leaf value { + type admin-groups; + default ""; + description + "The affinity value. The default is empty."; + } + } + } + container path-affinity-names { + description + "Path affinities represented as names."; + list path-affinity-name { + key "usage"; + description + "List of named affinity constraints."; + leaf usage { + type identityref { + base resource-affinities-type; + } + description + "Identifies an entry in the list of named affinity + constraints."; + } + list affinity-name { + key "name"; + leaf name { + type string; + description + "Identifies a named affinity entry."; + } + description + "List of named affinities."; + } + } + } + } + + grouping generic-path-srlgs { + description + "Path SRLG grouping."; + container path-srlgs-lists { + description + "Path SRLG properties container."; + list path-srlgs-list { + key "usage"; + description + "List of SRLG values to be included or excluded."; + leaf usage { + type identityref { + base route-usage-type; + } + description + "Identifies an entry in a list of SRLGs to either + include or exclude."; + } + leaf-list values { + type srlg; + description + "List of SRLG values."; + } + } + } + container path-srlgs-names { + description + "Container for the list of named SRLGs."; + list path-srlgs-name { + key "usage"; + description + "List of named SRLGs to be included or excluded."; + leaf usage { + type identityref { + base route-usage-type; + } + description + "Identifies an entry in a list of named SRLGs to either + include or exclude."; + } + leaf-list names { + type string; + description + "List of named SRLGs."; + } + } + } + } + + grouping generic-path-disjointness { + description + "Path disjointness grouping."; + leaf disjointness { + type te-path-disjointness; + description + "The type of resource disjointness. + When configured for a primary path, the disjointness level + applies to all secondary LSPs. When configured for a + secondary path, the disjointness level overrides the level + configured for the primary path."; + } + } + + grouping common-path-constraints-attributes { + description + "Common path constraints configuration grouping."; + uses common-constraints; + uses generic-path-metric-bounds; + uses generic-path-affinities; + uses generic-path-srlgs; + } + + grouping generic-path-constraints { + description + "Global named path constraints configuration grouping."; + container path-constraints { + description + "TE named path constraints container."; + uses common-path-constraints-attributes; + uses generic-path-disjointness; + } + } + + grouping generic-path-properties { + description + "TE generic path properties grouping."; + container path-properties { + config false; + description + "The TE path properties."; + list path-metric { + key "metric-type"; + description + "TE path metric type."; + leaf metric-type { + type identityref { + base path-metric-type; + } + description + "TE path metric type."; + } + leaf accumulative-value { + type uint64; + description + "TE path metric accumulative value."; + } + } + uses generic-path-affinities; + uses generic-path-srlgs; + container path-route-objects { + description + "Container for the list of route objects either returned by + the computation engine or actually used by an LSP."; + list path-route-object { + key "index"; + ordered-by user; + description + "List of route objects either returned by the computation + engine or actually used by an LSP."; + leaf index { + type uint32; + description + "Route object entry index. The index is used to + identify an entry in the list. The order of entries + is defined by the user without relying on key + values."; + } + uses explicit-route-hop; + } + } + } + } +} diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/yang/ietf-trans-client-service@2023-10-23.yang b/src/nbi/service/rest_server/nbi_plugins/ietf_network/yang/ietf-trans-client-service@2023-10-23.yang new file mode 100644 index 0000000000000000000000000000000000000000..f0157bcc82e70d1da523074974e8db061d06c32a --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/yang/ietf-trans-client-service@2023-10-23.yang @@ -0,0 +1,325 @@ + module ietf-trans-client-service { + /* TODO: FIXME */ + yang-version 1.1; + + namespace "urn:ietf:params:xml:ns:yang:ietf-trans-client-service"; + prefix "clntsvc"; + + import ietf-network { + prefix "nw"; + reference "RFC8345 - A YANG Data Model for Network Topologies"; + } + + import ietf-network-topology { + prefix "nt"; + reference "RFC8345 - A YANG Data Model for Network Topologies"; + } + + import ietf-te-types { + prefix "te-types"; + reference "RFC 8776 - Traffic Engineering Common YANG Types"; + } + + import ietf-layer1-types { + prefix "layer1-types"; + reference "RFC ZZZZ - A YANG Data Model for Layer 1 Types"; + } + + import ietf-yang-types { + prefix "yang"; + reference "RFC 6991 - Common YANG Data Types"; + } + + import ietf-trans-client-svc-types { + prefix "clntsvc-types"; + reference "RFC XXXX - A YANG Data Model for + Transport Network Client Signals"; + } + + organization + "Internet Engineering Task Force (IETF) CCAMP WG"; + contact + " + ID-draft editor: + Haomian Zheng (zhenghaomian@huawei.com); + Aihua Guo (aihuaguo.ietf@gmail.com); + Italo Busi (italo.busi@huawei.com); + Anton Snitser (antons@sedonasys.com); + Francesco Lazzeri (francesco.lazzeri@ericsson.com); + Yunbin Xu (xuyunbin@caict.ac.cn); + Yang Zhao (zhaoyangyjy@chinamobile.com); + Xufeng Liu (Xufeng_Liu@jabil.com); + Giuseppe Fioccola (giuseppe.fioccola@huawei.com); + Chaode Yu (yuchaode@huawei.com); + "; + + description + "This module defines a YANG data model for describing + transport network client services. The model fully conforms + to the Network Management Datastore Architecture (NMDA). + + Copyright (c) 2021 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 + (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 2023-10-23 { + description + "version -04 as a WG document"; + reference + "draft-ietf-ccamp-client-signal-yang"; + } + + /* + * Groupings + */ + grouping client-svc-access-parameters { + description + "Transport network client signals access parameters"; + + leaf access-node-id { + type te-types:te-node-id; + description + "The identifier of the access node in the TE topology."; + } + + leaf access-node-uri { + type nw:node-id; + description + "The identifier of the access node in the network."; + } + + leaf access-ltp-id { + type te-types:te-tp-id; + description + "The TE link termination point identifier in TE topology, used + together with access-node-id to identify the access LTP."; + } + + leaf access-ltp-uri { + type nt:tp-id; + description + "The link termination point identifier in network topology, + used together with access-node-uri to identify the access LTP"; + } + + leaf client-signal { + type identityref { + base layer1-types:client-signal; + } + description + "Identify the client signal type associated with this port"; + } + + } + + grouping pm-state-grouping { + leaf latency { + description "latency value of the E2E client signal service"; + type uint32; + units microsecond; + } + } + + grouping error-info-grouping { + leaf error-code { + description "error code"; + type uint16; + } + + leaf error-description { + description "detail message of error"; + type string; + } + + leaf error-timestamp { + description "the date and time error is happened"; + type yang:date-and-time; + } + } + + grouping alarm-shreshold-grouping { + leaf latency-threshold { + description "a threshold for the E2E client signal service's + latency. Once the latency value exceed this threshold, an alarm + should be triggered."; + type uint32; + units microsecond; + } + } + + grouping client-svc-tunnel-parameters { + description + "Transport network client signals tunnel parameters"; + + leaf tunnel-name { + type string; + description + "TE tunnel instance name."; + } + } + + grouping client-svc-instance-config { + description + "Configuration parameters for client services."; + leaf client-svc-name { + type string; + description + "Identifier of the p2p transport network client signals."; + } + + leaf client-svc-title { + type string; + description + "Name of the p2p transport network client signals."; + } + + leaf user-label { + type string; + description + "Alias of the p2p transport network client signals."; + } + + leaf client-svc-descr { + type string; + description + "Description of the transport network client signals."; + } + + leaf client-svc-customer { + type string; + description + "Customer of the transport network client signals."; + } + + container resilience { + description "Place holder for resilience functionalities"; + } + + uses te-types:te-topology-identifier; + + leaf admin-status { + type identityref { + base te-types:tunnel-admin-state-type; + } + default te-types:tunnel-admin-state-up; + description "Client signals administrative state."; + } + + container src-access-ports { + description + "Source access port of a client signal."; + uses client-svc-access-parameters; + } + container dst-access-ports { + description + "Destination access port of a client signal."; + uses client-svc-access-parameters; + } + + container pm-state { + config false; + description "PM data of E2E client signal"; + uses pm-state-grouping; + } + + container error-info { + config false; + description "error messages of configuration"; + uses error-info-grouping; + } + + container alarm-shreshold { + description "threshold configuration for the E2E client signal"; + uses alarm-shreshold-grouping; + } + + leaf direction { + type identityref { + base clntsvc-types:direction; + } + description "Uni-dir or Bi-dir for the client signal."; + } + + list svc-tunnels { + key tunnel-name; + description + "List of the TE Tunnels supporting the client signal."; + uses client-svc-tunnel-parameters; + } + } + + grouping client-svc-instance-state { + description + "State parameters for client services."; + leaf operational-state { + type identityref { + base te-types:tunnel-state-type; + } + config false; + description "Client signal operational state."; + } + leaf provisioning-state { + type identityref { + base te-types:lsp-state-type; + } + config false; + description "Client signal provisioning state."; + } + leaf creation-time { + type yang:date-and-time; + config false; + description "The time of the client signal be created."; + } + leaf last-updated-time { + type yang:date-and-time; + config false; + description "The time of the client signal's latest update."; + } + leaf created-by { + type string; + config false; + description + "The client signal is created by whom, + can be a system or staff ID."; + } + leaf last-updated-by { + type string; + config false; + description + "The client signal is last updated by whom, + can be a system or staff ID."; + } + leaf owned-by { + type string; + config false; + description + "The client signal is owned by whom, + can be a system ID."; + } + } + + /* + * Data nodes + */ + + container client-svc { + description + "Transport client services."; + + list client-svc-instances { + key client-svc-name; + description + "The list of p2p transport client service instances"; + + uses client-svc-instance-config; + uses client-svc-instance-state; + } + } + } diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/yang/ietf-trans-client-svc-types@2023-10-23.yang b/src/nbi/service/rest_server/nbi_plugins/ietf_network/yang/ietf-trans-client-svc-types@2023-10-23.yang new file mode 100644 index 0000000000000000000000000000000000000000..60db5633af691c53678870dc5f087b911726f2c6 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/yang/ietf-trans-client-svc-types@2023-10-23.yang @@ -0,0 +1,63 @@ + module ietf-trans-client-svc-types { + namespace "urn:ietf:params:xml:ns:yang:ietf-trans-client-svc-types"; + prefix "clntsvc-types"; + + organization + "Internet Engineering Task Force (IETF) CCAMP WG"; + contact + " + ID-draft editor: + Haomian Zheng (zhenghaomian@huawei.com); + Aihua Guo (aihuaguo.ietf@gmail.com); + Italo Busi (italo.busi@huawei.com); + Anton Snitser (antons@sedonasys.com); + Francesco Lazzeri (francesco.lazzeri@ericsson.com); + Yunbin Xu (xuyunbin@caict.ac.cn); + Yang Zhao (zhaoyangyjy@chinamobile.com); + Xufeng Liu (Xufeng_Liu@jabil.com); + Giuseppe Fioccola (giuseppe.fioccola@huawei.com); + Chaode Yu (yuchaode@huawei.com); + "; + + description + "This module defines a YANG data model for describing + transport network client types. The model fully conforms + to the Network Management Datastore Architecture (NMDA). + + Copyright (c) 2019 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 + (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 2023-10-23 { + description + "version -01 as a WG document"; + reference + "draft-ietf-ccamp-client-signal-yang"; + } + + identity direction { + description + "Direction information of Client Signal."; + } + + identity bidirectional { + base direction; + description + "Client Signal is bi-directional."; + } + + identity unidirectional { + base direction; + description + "Client Signal is uni-directional."; + } + + } diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/yang/ietf-yang-types@2013-07-15.yang b/src/nbi/service/rest_server/nbi_plugins/ietf_network/yang/ietf-yang-types@2013-07-15.yang new file mode 100644 index 0000000000000000000000000000000000000000..956562a7b342055127961732d8bde4be21c80d7d --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/yang/ietf-yang-types@2013-07-15.yang @@ -0,0 +1,475 @@ + module ietf-yang-types { + + namespace "urn:ietf:params:xml:ns:yang:ietf-yang-types"; + prefix "yang"; + + organization + "IETF NETMOD (NETCONF Data Modeling Language) Working Group"; + + contact + "WG Web: + WG List: + + WG Chair: David Kessens + + + WG Chair: Juergen Schoenwaelder + + + Editor: Juergen Schoenwaelder + "; + + description + "This module contains a collection of generally useful derived + YANG data types. + + Copyright (c) 2013 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). + + This version of this YANG module is part of RFC 6991; see + the RFC itself for full legal notices."; + + revision 2013-07-15 { + description + "This revision adds the following new data types: + - yang-identifier + - hex-string + - uuid + - dotted-quad"; + reference + "RFC 6991: Common YANG Data Types"; + } + + revision 2010-09-24 { + description + "Initial revision."; + reference + "RFC 6021: Common YANG Data Types"; + } + + /*** collection of counter and gauge types ***/ + + typedef counter32 { + type uint32; + description + "The counter32 type represents a non-negative integer + that monotonically increases until it reaches a + maximum value of 2^32-1 (4294967295 decimal), when it + wraps around and starts increasing again from zero. + + Counters have no defined 'initial' value, and thus, a + single value of a counter has (in general) no information + content. Discontinuities in the monotonically increasing + value normally occur at re-initialization of the + management system, and at other times as specified in the + description of a schema node using this type. If such + other times can occur, for example, the creation of + a schema node of type counter32 at times other than + re-initialization, then a corresponding schema node + should be defined, with an appropriate type, to indicate + the last discontinuity. + + The counter32 type should not be used for configuration + schema nodes. A default statement SHOULD NOT be used in + combination with the type counter32. + + In the value set and its semantics, this type is equivalent + to the Counter32 type of the SMIv2."; + reference + "RFC 2578: Structure of Management Information Version 2 + (SMIv2)"; + } + + typedef zero-based-counter32 { + type yang:counter32; + default "0"; + description + "The zero-based-counter32 type represents a counter32 + that has the defined 'initial' value zero. + + A schema node of this type will be set to zero (0) on creation + and will thereafter increase monotonically until it reaches + a maximum value of 2^32-1 (4294967295 decimal), when it + wraps around and starts increasing again from zero. + + Provided that an application discovers a new schema node + of this type within the minimum time to wrap, it can use the + 'initial' value as a delta. It is important for a management + station to be aware of this minimum time and the actual time + between polls, and to discard data if the actual time is too + long or there is no defined minimum time. + + In the value set and its semantics, this type is equivalent + to the ZeroBasedCounter32 textual convention of the SMIv2."; + reference + "RFC 4502: Remote Network Monitoring Management Information + Base Version 2"; + } + + typedef counter64 { + type uint64; + description + "The counter64 type represents a non-negative integer + that monotonically increases until it reaches a + maximum value of 2^64-1 (18446744073709551615 decimal), + when it wraps around and starts increasing again from zero. + + Counters have no defined 'initial' value, and thus, a + single value of a counter has (in general) no information + content. Discontinuities in the monotonically increasing + value normally occur at re-initialization of the + management system, and at other times as specified in the + description of a schema node using this type. If such + other times can occur, for example, the creation of + a schema node of type counter64 at times other than + re-initialization, then a corresponding schema node + should be defined, with an appropriate type, to indicate + the last discontinuity. + + The counter64 type should not be used for configuration + schema nodes. A default statement SHOULD NOT be used in + combination with the type counter64. + + In the value set and its semantics, this type is equivalent + to the Counter64 type of the SMIv2."; + reference + "RFC 2578: Structure of Management Information Version 2 + (SMIv2)"; + } + + typedef zero-based-counter64 { + type yang:counter64; + default "0"; + description + "The zero-based-counter64 type represents a counter64 that + has the defined 'initial' value zero. + + A schema node of this type will be set to zero (0) on creation + and will thereafter increase monotonically until it reaches + a maximum value of 2^64-1 (18446744073709551615 decimal), + when it wraps around and starts increasing again from zero. + + Provided that an application discovers a new schema node + of this type within the minimum time to wrap, it can use the + 'initial' value as a delta. It is important for a management + station to be aware of this minimum time and the actual time + between polls, and to discard data if the actual time is too + long or there is no defined minimum time. + + In the value set and its semantics, this type is equivalent + to the ZeroBasedCounter64 textual convention of the SMIv2."; + reference + "RFC 2856: Textual Conventions for Additional High Capacity + Data Types"; + } + + typedef gauge32 { + type uint32; + description + "The gauge32 type represents a non-negative integer, which + may increase or decrease, but shall never exceed a maximum + value, nor fall below a minimum value. The maximum value + cannot be greater than 2^32-1 (4294967295 decimal), and + the minimum value cannot be smaller than 0. The value of + a gauge32 has its maximum value whenever the information + being modeled is greater than or equal to its maximum + value, and has its minimum value whenever the information + being modeled is smaller than or equal to its minimum value. + If the information being modeled subsequently decreases + below (increases above) the maximum (minimum) value, the + gauge32 also decreases (increases). + + In the value set and its semantics, this type is equivalent + to the Gauge32 type of the SMIv2."; + reference + "RFC 2578: Structure of Management Information Version 2 + (SMIv2)"; + } + + typedef gauge64 { + type uint64; + description + "The gauge64 type represents a non-negative integer, which + may increase or decrease, but shall never exceed a maximum + value, nor fall below a minimum value. The maximum value + cannot be greater than 2^64-1 (18446744073709551615), and + the minimum value cannot be smaller than 0. The value of + a gauge64 has its maximum value whenever the information + being modeled is greater than or equal to its maximum + value, and has its minimum value whenever the information + being modeled is smaller than or equal to its minimum value. + If the information being modeled subsequently decreases + below (increases above) the maximum (minimum) value, the + gauge64 also decreases (increases). + + In the value set and its semantics, this type is equivalent + to the CounterBasedGauge64 SMIv2 textual convention defined + in RFC 2856"; + reference + "RFC 2856: Textual Conventions for Additional High Capacity + Data Types"; + } + + /*** collection of identifier-related types ***/ + + typedef object-identifier { + type string { + pattern '(([0-1](\.[1-3]?[0-9]))|(2\.(0|([1-9]\d*))))' + + '(\.(0|([1-9]\d*)))*'; + } + description + "The object-identifier type represents administratively + assigned names in a registration-hierarchical-name tree. + + Values of this type are denoted as a sequence of numerical + non-negative sub-identifier values. Each sub-identifier + value MUST NOT exceed 2^32-1 (4294967295). Sub-identifiers + are separated by single dots and without any intermediate + whitespace. + + The ASN.1 standard restricts the value space of the first + sub-identifier to 0, 1, or 2. Furthermore, the value space + of the second sub-identifier is restricted to the range + 0 to 39 if the first sub-identifier is 0 or 1. Finally, + the ASN.1 standard requires that an object identifier + has always at least two sub-identifiers. The pattern + captures these restrictions. + + Although the number of sub-identifiers is not limited, + module designers should realize that there may be + implementations that stick with the SMIv2 limit of 128 + sub-identifiers. + + This type is a superset of the SMIv2 OBJECT IDENTIFIER type + since it is not restricted to 128 sub-identifiers. Hence, + this type SHOULD NOT be used to represent the SMIv2 OBJECT + IDENTIFIER type; the object-identifier-128 type SHOULD be + used instead."; + reference + "ISO9834-1: Information technology -- Open Systems + Interconnection -- Procedures for the operation of OSI + Registration Authorities: General procedures and top + arcs of the ASN.1 Object Identifier tree"; + } + + typedef object-identifier-128 { + type object-identifier { + pattern '\d*(\.\d*){1,127}'; + } + description + "This type represents object-identifiers restricted to 128 + sub-identifiers. + + In the value set and its semantics, this type is equivalent + to the OBJECT IDENTIFIER type of the SMIv2."; + reference + "RFC 2578: Structure of Management Information Version 2 + (SMIv2)"; + } + + typedef yang-identifier { + type string { + length "1..max"; + pattern '[a-zA-Z_][a-zA-Z0-9\-_.]*'; + pattern '.|..|[^xX].*|.[^mM].*|..[^lL].*'; + } + description + "A YANG identifier string as defined by the 'identifier' + rule in Section 12 of RFC 6020. An identifier must + start with an alphabetic character or an underscore + followed by an arbitrary sequence of alphabetic or + numeric characters, underscores, hyphens, or dots. + + A YANG identifier MUST NOT start with any possible + combination of the lowercase or uppercase character + sequence 'xml'."; + reference + "RFC 6020: YANG - A Data Modeling Language for the Network + Configuration Protocol (NETCONF)"; + } + + /*** collection of types related to date and time***/ + + typedef date-and-time { + type string { + pattern '\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\.\d+)?' + + '(Z|[\+\-]\d{2}:\d{2})'; + } + description + "The date-and-time type is a profile of the ISO 8601 + standard for representation of dates and times using the + Gregorian calendar. The profile is defined by the + date-time production in Section 5.6 of RFC 3339. + + The date-and-time type is compatible with the dateTime XML + schema type with the following notable exceptions: + + (a) The date-and-time type does not allow negative years. + + (b) The date-and-time time-offset -00:00 indicates an unknown + time zone (see RFC 3339) while -00:00 and +00:00 and Z + all represent the same time zone in dateTime. + + (c) The canonical format (see below) of data-and-time values + differs from the canonical format used by the dateTime XML + schema type, which requires all times to be in UTC using + the time-offset 'Z'. + + This type is not equivalent to the DateAndTime textual + convention of the SMIv2 since RFC 3339 uses a different + separator between full-date and full-time and provides + higher resolution of time-secfrac. + + The canonical format for date-and-time values with a known time + zone uses a numeric time zone offset that is calculated using + the device's configured known offset to UTC time. A change of + the device's offset to UTC time will cause date-and-time values + to change accordingly. Such changes might happen periodically + in case a server follows automatically daylight saving time + (DST) time zone offset changes. The canonical format for + date-and-time values with an unknown time zone (usually + referring to the notion of local time) uses the time-offset + -00:00."; + reference + "RFC 3339: Date and Time on the Internet: Timestamps + RFC 2579: Textual Conventions for SMIv2 + XSD-TYPES: XML Schema Part 2: Datatypes Second Edition"; + } + + typedef timeticks { + type uint32; + description + "The timeticks type represents a non-negative integer that + represents the time, modulo 2^32 (4294967296 decimal), in + hundredths of a second between two epochs. When a schema + node is defined that uses this type, the description of + the schema node identifies both of the reference epochs. + + In the value set and its semantics, this type is equivalent + to the TimeTicks type of the SMIv2."; + reference + "RFC 2578: Structure of Management Information Version 2 + (SMIv2)"; + } + + typedef timestamp { + type yang:timeticks; + description + "The timestamp type represents the value of an associated + timeticks schema node at which a specific occurrence + happened. The specific occurrence must be defined in the + description of any schema node defined using this type. When + the specific occurrence occurred prior to the last time the + associated timeticks attribute was zero, then the timestamp + value is zero. Note that this requires all timestamp values + to be reset to zero when the value of the associated timeticks + attribute reaches 497+ days and wraps around to zero. + + The associated timeticks schema node must be specified + in the description of any schema node using this type. + + In the value set and its semantics, this type is equivalent + to the TimeStamp textual convention of the SMIv2."; + reference + "RFC 2579: Textual Conventions for SMIv2"; + } + + /*** collection of generic address types ***/ + + typedef phys-address { + type string { + pattern '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'; + } + + description + "Represents media- or physical-level addresses represented + as a sequence octets, each octet represented by two hexadecimal + numbers. Octets are separated by colons. The canonical + representation uses lowercase characters. + + In the value set and its semantics, this type is equivalent + to the PhysAddress textual convention of the SMIv2."; + reference + "RFC 2579: Textual Conventions for SMIv2"; + } + + typedef mac-address { + type string { + pattern '[0-9a-fA-F]{2}(:[0-9a-fA-F]{2}){5}'; + } + description + "The mac-address type represents an IEEE 802 MAC address. + The canonical representation uses lowercase characters. + + In the value set and its semantics, this type is equivalent + to the MacAddress textual convention of the SMIv2."; + reference + "IEEE 802: IEEE Standard for Local and Metropolitan Area + Networks: Overview and Architecture + RFC 2579: Textual Conventions for SMIv2"; + } + + /*** collection of XML-specific types ***/ + + typedef xpath1.0 { + type string; + description + "This type represents an XPATH 1.0 expression. + + When a schema node is defined that uses this type, the + description of the schema node MUST specify the XPath + context in which the XPath expression is evaluated."; + reference + "XPATH: XML Path Language (XPath) Version 1.0"; + } + + /*** collection of string types ***/ + + typedef hex-string { + type string { + pattern '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'; + } + + description + "A hexadecimal string with octets represented as hex digits + separated by colons. The canonical representation uses + lowercase characters."; + } + + typedef uuid { + type string { + 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}'; + } + description + "A Universally Unique IDentifier in the string representation + defined in RFC 4122. The canonical representation uses + lowercase characters. + + The following is an example of a UUID in string representation: + f81d4fae-7dec-11d0-a765-00a0c91e6bf6 + "; + reference + "RFC 4122: A Universally Unique IDentifier (UUID) URN + Namespace"; + } + + typedef dotted-quad { + type string { + pattern + '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.){3}' + + '([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'; + } + description + "An unsigned 32-bit number expressed in the dotted-quad + notation, i.e., four octets written as decimal numbers + and separated with the '.' (full stop) character."; + } + } diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/NSS_Service.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/NSS_Service.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/NSS_Service.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/NSS_Service.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/NSS_Services.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/NSS_Services.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/NSS_Services.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/NSS_Services.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/__init__.py similarity index 91% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/__init__.py index c8aca124acfd15b2003b4272cf0b3103dbca3bdb..fdd2ac64ac22830515c19d8ebfb7d1868cee19fc 100644 --- a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/__init__.py +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/__init__.py @@ -16,11 +16,11 @@ # Ref: https://datatracker.ietf.org/doc/draft-ietf-teas-ietf-network-slice-nbi-yang/ from flask_restful import Resource -from compute.service.rest_server.RestServer import RestServer +from nbi.service.rest_server.RestServer import RestServer from .NSS_Services import NSS_Services from .NSS_Service import NSS_Service -URL_PREFIX = '/data/ietf-network-slice-service:ietf-nss' +URL_PREFIX = '/restconf/data/ietf-network-slice-service:ietf-nss' def _add_resource(rest_server : RestServer, resource : Resource, *urls, **kwargs): urls = [(URL_PREFIX + url) for url in urls] diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/nacm/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/nacm/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/nacm/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/nacm/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/nacm/groups/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/nacm/groups/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/nacm/groups/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/nacm/groups/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/nacm/groups/group/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/nacm/groups/group/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/nacm/groups/group/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/nacm/groups/group/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/nacm/rule_list/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/nacm/rule_list/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/nacm/rule_list/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/nacm/rule_list/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/nacm/rule_list/rule/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/nacm/rule_list/rule/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/nacm/rule_list/rule/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/nacm/rule_list/rule/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/nacm/rule_list/rule/rule_type/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/nacm/rule_list/rule/rule_type/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/nacm/rule_list/rule/rule_type/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/nacm/rule_list/rule/rule_type/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/nacm/rule_list/rule/rule_type/data_node/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/nacm/rule_list/rule/rule_type/data_node/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/nacm/rule_list/rule/rule_type/data_node/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/nacm/rule_list/rule/rule_type/data_node/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/nacm/rule_list/rule/rule_type/notification/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/nacm/rule_list/rule/rule_type/notification/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/nacm/rule_list/rule/rule_type/notification/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/nacm/rule_list/rule/rule_type/notification/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/nacm/rule_list/rule/rule_type/protocol_operation/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/nacm/rule_list/rule/rule_type/protocol_operation/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/nacm/rule_list/rule/rule_type/protocol_operation/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/nacm/rule_list/rule/rule_type/protocol_operation/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/connection_groups/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/connection_groups/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/connection_groups/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/connection_groups/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/connection_groups/connection_group/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/connection_groups/connection_group/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/connection_groups/connection_group/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/connection_groups/connection_group/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/connection_groups/connection_group/connection_group_monitoring/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/connection_groups/connection_group/connection_group_monitoring/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/connection_groups/connection_group/connection_group_monitoring/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/connection_groups/connection_group/connection_group_monitoring/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/connection_groups/connection_group/connectivity_construct/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/connection_groups/connection_group/connectivity_construct/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/connection_groups/connection_group/connectivity_construct/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/connection_groups/connection_group/connectivity_construct/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/connection_groups/connection_group/connectivity_construct/connectivity_construct_monitoring/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/connection_groups/connection_group/connectivity_construct/connectivity_construct_monitoring/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/connection_groups/connection_group/connectivity_construct/connectivity_construct_monitoring/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/connection_groups/connection_group/connectivity_construct/connectivity_construct_monitoring/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/connection_groups/connection_group/connectivity_construct/connectivity_construct_type/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/connection_groups/connection_group/connectivity_construct/connectivity_construct_type/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/connection_groups/connection_group/connectivity_construct/connectivity_construct_type/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/connection_groups/connection_group/connectivity_construct/connectivity_construct_type/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/connection_groups/connection_group/connectivity_construct/connectivity_construct_type/a2a/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/connection_groups/connection_group/connectivity_construct/connectivity_construct_type/a2a/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/connection_groups/connection_group/connectivity_construct/connectivity_construct_type/a2a/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/connection_groups/connection_group/connectivity_construct/connectivity_construct_type/a2a/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/connection_groups/connection_group/connectivity_construct/connectivity_construct_type/a2a/a2a_sdp/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/connection_groups/connection_group/connectivity_construct/connectivity_construct_type/a2a/a2a_sdp/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/connection_groups/connection_group/connectivity_construct/connectivity_construct_type/a2a/a2a_sdp/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/connection_groups/connection_group/connectivity_construct/connectivity_construct_type/a2a/a2a_sdp/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/connection_groups/connection_group/connectivity_construct/connectivity_construct_type/a2a/a2a_sdp/slo_sle_policy/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/connection_groups/connection_group/connectivity_construct/connectivity_construct_type/a2a/a2a_sdp/slo_sle_policy/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/connection_groups/connection_group/connectivity_construct/connectivity_construct_type/a2a/a2a_sdp/slo_sle_policy/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/connection_groups/connection_group/connectivity_construct/connectivity_construct_type/a2a/a2a_sdp/slo_sle_policy/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/connection_groups/connection_group/connectivity_construct/connectivity_construct_type/a2a/a2a_sdp/slo_sle_policy/custom/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/connection_groups/connection_group/connectivity_construct/connectivity_construct_type/a2a/a2a_sdp/slo_sle_policy/custom/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/connection_groups/connection_group/connectivity_construct/connectivity_construct_type/a2a/a2a_sdp/slo_sle_policy/custom/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/connection_groups/connection_group/connectivity_construct/connectivity_construct_type/a2a/a2a_sdp/slo_sle_policy/custom/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/connection_groups/connection_group/connectivity_construct/connectivity_construct_type/a2a/a2a_sdp/slo_sle_policy/custom/service_slo_sle_policy/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/connection_groups/connection_group/connectivity_construct/connectivity_construct_type/a2a/a2a_sdp/slo_sle_policy/custom/service_slo_sle_policy/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/connection_groups/connection_group/connectivity_construct/connectivity_construct_type/a2a/a2a_sdp/slo_sle_policy/custom/service_slo_sle_policy/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/connection_groups/connection_group/connectivity_construct/connectivity_construct_type/a2a/a2a_sdp/slo_sle_policy/custom/service_slo_sle_policy/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/connection_groups/connection_group/connectivity_construct/connectivity_construct_type/a2a/a2a_sdp/slo_sle_policy/custom/service_slo_sle_policy/metric_bounds/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/connection_groups/connection_group/connectivity_construct/connectivity_construct_type/a2a/a2a_sdp/slo_sle_policy/custom/service_slo_sle_policy/metric_bounds/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/connection_groups/connection_group/connectivity_construct/connectivity_construct_type/a2a/a2a_sdp/slo_sle_policy/custom/service_slo_sle_policy/metric_bounds/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/connection_groups/connection_group/connectivity_construct/connectivity_construct_type/a2a/a2a_sdp/slo_sle_policy/custom/service_slo_sle_policy/metric_bounds/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/connection_groups/connection_group/connectivity_construct/connectivity_construct_type/a2a/a2a_sdp/slo_sle_policy/custom/service_slo_sle_policy/metric_bounds/metric_bound/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/connection_groups/connection_group/connectivity_construct/connectivity_construct_type/a2a/a2a_sdp/slo_sle_policy/custom/service_slo_sle_policy/metric_bounds/metric_bound/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/connection_groups/connection_group/connectivity_construct/connectivity_construct_type/a2a/a2a_sdp/slo_sle_policy/custom/service_slo_sle_policy/metric_bounds/metric_bound/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/connection_groups/connection_group/connectivity_construct/connectivity_construct_type/a2a/a2a_sdp/slo_sle_policy/custom/service_slo_sle_policy/metric_bounds/metric_bound/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/connection_groups/connection_group/connectivity_construct/connectivity_construct_type/a2a/a2a_sdp/slo_sle_policy/custom/service_slo_sle_policy/steering_constraints/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/connection_groups/connection_group/connectivity_construct/connectivity_construct_type/a2a/a2a_sdp/slo_sle_policy/custom/service_slo_sle_policy/steering_constraints/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/connection_groups/connection_group/connectivity_construct/connectivity_construct_type/a2a/a2a_sdp/slo_sle_policy/custom/service_slo_sle_policy/steering_constraints/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/connection_groups/connection_group/connectivity_construct/connectivity_construct_type/a2a/a2a_sdp/slo_sle_policy/custom/service_slo_sle_policy/steering_constraints/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/connection_groups/connection_group/connectivity_construct/connectivity_construct_type/a2a/a2a_sdp/slo_sle_policy/custom/service_slo_sle_policy/steering_constraints/path_constraints/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/connection_groups/connection_group/connectivity_construct/connectivity_construct_type/a2a/a2a_sdp/slo_sle_policy/custom/service_slo_sle_policy/steering_constraints/path_constraints/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/connection_groups/connection_group/connectivity_construct/connectivity_construct_type/a2a/a2a_sdp/slo_sle_policy/custom/service_slo_sle_policy/steering_constraints/path_constraints/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/connection_groups/connection_group/connectivity_construct/connectivity_construct_type/a2a/a2a_sdp/slo_sle_policy/custom/service_slo_sle_policy/steering_constraints/path_constraints/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/connection_groups/connection_group/connectivity_construct/connectivity_construct_type/a2a/a2a_sdp/slo_sle_policy/custom/service_slo_sle_policy/steering_constraints/service_function/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/connection_groups/connection_group/connectivity_construct/connectivity_construct_type/a2a/a2a_sdp/slo_sle_policy/custom/service_slo_sle_policy/steering_constraints/service_function/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/connection_groups/connection_group/connectivity_construct/connectivity_construct_type/a2a/a2a_sdp/slo_sle_policy/custom/service_slo_sle_policy/steering_constraints/service_function/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/connection_groups/connection_group/connectivity_construct/connectivity_construct_type/a2a/a2a_sdp/slo_sle_policy/custom/service_slo_sle_policy/steering_constraints/service_function/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/connection_groups/connection_group/connectivity_construct/connectivity_construct_type/a2a/a2a_sdp/slo_sle_policy/standard/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/connection_groups/connection_group/connectivity_construct/connectivity_construct_type/a2a/a2a_sdp/slo_sle_policy/standard/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/connection_groups/connection_group/connectivity_construct/connectivity_construct_type/a2a/a2a_sdp/slo_sle_policy/standard/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/connection_groups/connection_group/connectivity_construct/connectivity_construct_type/a2a/a2a_sdp/slo_sle_policy/standard/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/connection_groups/connection_group/connectivity_construct/connectivity_construct_type/p2mp/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/connection_groups/connection_group/connectivity_construct/connectivity_construct_type/p2mp/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/connection_groups/connection_group/connectivity_construct/connectivity_construct_type/p2mp/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/connection_groups/connection_group/connectivity_construct/connectivity_construct_type/p2mp/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/connection_groups/connection_group/connectivity_construct/connectivity_construct_type/p2p/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/connection_groups/connection_group/connectivity_construct/connectivity_construct_type/p2p/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/connection_groups/connection_group/connectivity_construct/connectivity_construct_type/p2p/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/connection_groups/connection_group/connectivity_construct/connectivity_construct_type/p2p/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/connection_groups/connection_group/connectivity_construct/slo_sle_policy/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/connection_groups/connection_group/connectivity_construct/slo_sle_policy/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/connection_groups/connection_group/connectivity_construct/slo_sle_policy/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/connection_groups/connection_group/connectivity_construct/slo_sle_policy/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/connection_groups/connection_group/connectivity_construct/slo_sle_policy/custom/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/connection_groups/connection_group/connectivity_construct/slo_sle_policy/custom/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/connection_groups/connection_group/connectivity_construct/slo_sle_policy/custom/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/connection_groups/connection_group/connectivity_construct/slo_sle_policy/custom/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/connection_groups/connection_group/connectivity_construct/slo_sle_policy/custom/service_slo_sle_policy/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/connection_groups/connection_group/connectivity_construct/slo_sle_policy/custom/service_slo_sle_policy/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/connection_groups/connection_group/connectivity_construct/slo_sle_policy/custom/service_slo_sle_policy/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/connection_groups/connection_group/connectivity_construct/slo_sle_policy/custom/service_slo_sle_policy/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/connection_groups/connection_group/connectivity_construct/slo_sle_policy/custom/service_slo_sle_policy/metric_bounds/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/connection_groups/connection_group/connectivity_construct/slo_sle_policy/custom/service_slo_sle_policy/metric_bounds/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/connection_groups/connection_group/connectivity_construct/slo_sle_policy/custom/service_slo_sle_policy/metric_bounds/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/connection_groups/connection_group/connectivity_construct/slo_sle_policy/custom/service_slo_sle_policy/metric_bounds/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/connection_groups/connection_group/connectivity_construct/slo_sle_policy/custom/service_slo_sle_policy/metric_bounds/metric_bound/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/connection_groups/connection_group/connectivity_construct/slo_sle_policy/custom/service_slo_sle_policy/metric_bounds/metric_bound/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/connection_groups/connection_group/connectivity_construct/slo_sle_policy/custom/service_slo_sle_policy/metric_bounds/metric_bound/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/connection_groups/connection_group/connectivity_construct/slo_sle_policy/custom/service_slo_sle_policy/metric_bounds/metric_bound/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/connection_groups/connection_group/connectivity_construct/slo_sle_policy/custom/service_slo_sle_policy/steering_constraints/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/connection_groups/connection_group/connectivity_construct/slo_sle_policy/custom/service_slo_sle_policy/steering_constraints/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/connection_groups/connection_group/connectivity_construct/slo_sle_policy/custom/service_slo_sle_policy/steering_constraints/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/connection_groups/connection_group/connectivity_construct/slo_sle_policy/custom/service_slo_sle_policy/steering_constraints/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/connection_groups/connection_group/connectivity_construct/slo_sle_policy/custom/service_slo_sle_policy/steering_constraints/path_constraints/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/connection_groups/connection_group/connectivity_construct/slo_sle_policy/custom/service_slo_sle_policy/steering_constraints/path_constraints/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/connection_groups/connection_group/connectivity_construct/slo_sle_policy/custom/service_slo_sle_policy/steering_constraints/path_constraints/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/connection_groups/connection_group/connectivity_construct/slo_sle_policy/custom/service_slo_sle_policy/steering_constraints/path_constraints/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/connection_groups/connection_group/connectivity_construct/slo_sle_policy/custom/service_slo_sle_policy/steering_constraints/service_function/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/connection_groups/connection_group/connectivity_construct/slo_sle_policy/custom/service_slo_sle_policy/steering_constraints/service_function/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/connection_groups/connection_group/connectivity_construct/slo_sle_policy/custom/service_slo_sle_policy/steering_constraints/service_function/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/connection_groups/connection_group/connectivity_construct/slo_sle_policy/custom/service_slo_sle_policy/steering_constraints/service_function/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/connection_groups/connection_group/connectivity_construct/slo_sle_policy/standard/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/connection_groups/connection_group/connectivity_construct/slo_sle_policy/standard/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/connection_groups/connection_group/connectivity_construct/slo_sle_policy/standard/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/connection_groups/connection_group/connectivity_construct/slo_sle_policy/standard/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/connection_groups/connection_group/slo_sle_policy/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/connection_groups/connection_group/slo_sle_policy/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/connection_groups/connection_group/slo_sle_policy/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/connection_groups/connection_group/slo_sle_policy/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/connection_groups/connection_group/slo_sle_policy/custom/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/connection_groups/connection_group/slo_sle_policy/custom/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/connection_groups/connection_group/slo_sle_policy/custom/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/connection_groups/connection_group/slo_sle_policy/custom/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/connection_groups/connection_group/slo_sle_policy/custom/service_slo_sle_policy/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/connection_groups/connection_group/slo_sle_policy/custom/service_slo_sle_policy/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/connection_groups/connection_group/slo_sle_policy/custom/service_slo_sle_policy/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/connection_groups/connection_group/slo_sle_policy/custom/service_slo_sle_policy/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/connection_groups/connection_group/slo_sle_policy/custom/service_slo_sle_policy/metric_bounds/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/connection_groups/connection_group/slo_sle_policy/custom/service_slo_sle_policy/metric_bounds/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/connection_groups/connection_group/slo_sle_policy/custom/service_slo_sle_policy/metric_bounds/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/connection_groups/connection_group/slo_sle_policy/custom/service_slo_sle_policy/metric_bounds/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/connection_groups/connection_group/slo_sle_policy/custom/service_slo_sle_policy/metric_bounds/metric_bound/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/connection_groups/connection_group/slo_sle_policy/custom/service_slo_sle_policy/metric_bounds/metric_bound/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/connection_groups/connection_group/slo_sle_policy/custom/service_slo_sle_policy/metric_bounds/metric_bound/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/connection_groups/connection_group/slo_sle_policy/custom/service_slo_sle_policy/metric_bounds/metric_bound/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/connection_groups/connection_group/slo_sle_policy/custom/service_slo_sle_policy/steering_constraints/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/connection_groups/connection_group/slo_sle_policy/custom/service_slo_sle_policy/steering_constraints/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/connection_groups/connection_group/slo_sle_policy/custom/service_slo_sle_policy/steering_constraints/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/connection_groups/connection_group/slo_sle_policy/custom/service_slo_sle_policy/steering_constraints/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/connection_groups/connection_group/slo_sle_policy/custom/service_slo_sle_policy/steering_constraints/path_constraints/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/connection_groups/connection_group/slo_sle_policy/custom/service_slo_sle_policy/steering_constraints/path_constraints/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/connection_groups/connection_group/slo_sle_policy/custom/service_slo_sle_policy/steering_constraints/path_constraints/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/connection_groups/connection_group/slo_sle_policy/custom/service_slo_sle_policy/steering_constraints/path_constraints/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/connection_groups/connection_group/slo_sle_policy/custom/service_slo_sle_policy/steering_constraints/service_function/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/connection_groups/connection_group/slo_sle_policy/custom/service_slo_sle_policy/steering_constraints/service_function/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/connection_groups/connection_group/slo_sle_policy/custom/service_slo_sle_policy/steering_constraints/service_function/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/connection_groups/connection_group/slo_sle_policy/custom/service_slo_sle_policy/steering_constraints/service_function/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/connection_groups/connection_group/slo_sle_policy/standard/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/connection_groups/connection_group/slo_sle_policy/standard/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/connection_groups/connection_group/slo_sle_policy/standard/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/connection_groups/connection_group/slo_sle_policy/standard/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/sdps/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/sdps/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/sdps/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/sdps/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/sdps/sdp/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/sdps/sdp/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/sdps/sdp/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/sdps/sdp/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/sdps/sdp/attachment_circuits/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/sdps/sdp/attachment_circuits/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/sdps/sdp/attachment_circuits/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/sdps/sdp/attachment_circuits/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/sdps/sdp/attachment_circuits/attachment_circuit/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/sdps/sdp/attachment_circuits/attachment_circuit/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/sdps/sdp/attachment_circuits/attachment_circuit/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/sdps/sdp/attachment_circuits/attachment_circuit/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/sdps/sdp/attachment_circuits/attachment_circuit/ac_tags/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/sdps/sdp/attachment_circuits/attachment_circuit/ac_tags/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/sdps/sdp/attachment_circuits/attachment_circuit/ac_tags/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/sdps/sdp/attachment_circuits/attachment_circuit/ac_tags/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/sdps/sdp/attachment_circuits/attachment_circuit/ac_tags/ac_tag_opaque/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/sdps/sdp/attachment_circuits/attachment_circuit/ac_tags/ac_tag_opaque/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/sdps/sdp/attachment_circuits/attachment_circuit/ac_tags/ac_tag_opaque/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/sdps/sdp/attachment_circuits/attachment_circuit/ac_tags/ac_tag_opaque/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/sdps/sdp/attachment_circuits/attachment_circuit/ac_tags/ac_tags/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/sdps/sdp/attachment_circuits/attachment_circuit/ac_tags/ac_tags/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/sdps/sdp/attachment_circuits/attachment_circuit/ac_tags/ac_tags/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/sdps/sdp/attachment_circuits/attachment_circuit/ac_tags/ac_tags/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/sdps/sdp/attachment_circuits/attachment_circuit/incoming_qos_policy/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/sdps/sdp/attachment_circuits/attachment_circuit/incoming_qos_policy/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/sdps/sdp/attachment_circuits/attachment_circuit/incoming_qos_policy/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/sdps/sdp/attachment_circuits/attachment_circuit/incoming_qos_policy/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/sdps/sdp/attachment_circuits/attachment_circuit/incoming_qos_policy/rate_limits/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/sdps/sdp/attachment_circuits/attachment_circuit/incoming_qos_policy/rate_limits/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/sdps/sdp/attachment_circuits/attachment_circuit/incoming_qos_policy/rate_limits/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/sdps/sdp/attachment_circuits/attachment_circuit/incoming_qos_policy/rate_limits/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/sdps/sdp/attachment_circuits/attachment_circuit/outgoing_qos_policy/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/sdps/sdp/attachment_circuits/attachment_circuit/outgoing_qos_policy/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/sdps/sdp/attachment_circuits/attachment_circuit/outgoing_qos_policy/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/sdps/sdp/attachment_circuits/attachment_circuit/outgoing_qos_policy/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/sdps/sdp/attachment_circuits/attachment_circuit/outgoing_qos_policy/rate_limits/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/sdps/sdp/attachment_circuits/attachment_circuit/outgoing_qos_policy/rate_limits/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/sdps/sdp/attachment_circuits/attachment_circuit/outgoing_qos_policy/rate_limits/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/sdps/sdp/attachment_circuits/attachment_circuit/outgoing_qos_policy/rate_limits/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/sdps/sdp/attachment_circuits/attachment_circuit/sdp_peering/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/sdps/sdp/attachment_circuits/attachment_circuit/sdp_peering/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/sdps/sdp/attachment_circuits/attachment_circuit/sdp_peering/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/sdps/sdp/attachment_circuits/attachment_circuit/sdp_peering/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/sdps/sdp/attachment_circuits/attachment_circuit/sdp_peering/opaque/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/sdps/sdp/attachment_circuits/attachment_circuit/sdp_peering/opaque/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/sdps/sdp/attachment_circuits/attachment_circuit/sdp_peering/opaque/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/sdps/sdp/attachment_circuits/attachment_circuit/sdp_peering/opaque/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/sdps/sdp/attachment_circuits/attachment_circuit/sdp_peering/protocol/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/sdps/sdp/attachment_circuits/attachment_circuit/sdp_peering/protocol/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/sdps/sdp/attachment_circuits/attachment_circuit/sdp_peering/protocol/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/sdps/sdp/attachment_circuits/attachment_circuit/sdp_peering/protocol/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/sdps/sdp/attachment_circuits/attachment_circuit/sdp_peering/protocol/attribute/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/sdps/sdp/attachment_circuits/attachment_circuit/sdp_peering/protocol/attribute/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/sdps/sdp/attachment_circuits/attachment_circuit/sdp_peering/protocol/attribute/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/sdps/sdp/attachment_circuits/attachment_circuit/sdp_peering/protocol/attribute/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/sdps/sdp/incoming_qos_policy/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/sdps/sdp/incoming_qos_policy/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/sdps/sdp/incoming_qos_policy/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/sdps/sdp/incoming_qos_policy/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/sdps/sdp/incoming_qos_policy/rate_limits/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/sdps/sdp/incoming_qos_policy/rate_limits/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/sdps/sdp/incoming_qos_policy/rate_limits/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/sdps/sdp/incoming_qos_policy/rate_limits/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/sdps/sdp/location/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/sdps/sdp/location/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/sdps/sdp/location/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/sdps/sdp/location/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/sdps/sdp/outgoing_qos_policy/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/sdps/sdp/outgoing_qos_policy/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/sdps/sdp/outgoing_qos_policy/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/sdps/sdp/outgoing_qos_policy/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/sdps/sdp/outgoing_qos_policy/rate_limits/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/sdps/sdp/outgoing_qos_policy/rate_limits/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/sdps/sdp/outgoing_qos_policy/rate_limits/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/sdps/sdp/outgoing_qos_policy/rate_limits/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/sdps/sdp/sdp_monitoring/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/sdps/sdp/sdp_monitoring/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/sdps/sdp/sdp_monitoring/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/sdps/sdp/sdp_monitoring/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/sdps/sdp/sdp_peering/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/sdps/sdp/sdp_peering/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/sdps/sdp/sdp_peering/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/sdps/sdp/sdp_peering/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/sdps/sdp/sdp_peering/opaque/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/sdps/sdp/sdp_peering/opaque/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/sdps/sdp/sdp_peering/opaque/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/sdps/sdp/sdp_peering/opaque/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/sdps/sdp/sdp_peering/protocol/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/sdps/sdp/sdp_peering/protocol/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/sdps/sdp/sdp_peering/protocol/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/sdps/sdp/sdp_peering/protocol/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/sdps/sdp/sdp_peering/protocol/attribute/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/sdps/sdp/sdp_peering/protocol/attribute/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/sdps/sdp/sdp_peering/protocol/attribute/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/sdps/sdp/sdp_peering/protocol/attribute/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/sdps/sdp/service_match_criteria/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/sdps/sdp/service_match_criteria/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/sdps/sdp/service_match_criteria/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/sdps/sdp/service_match_criteria/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/sdps/sdp/service_match_criteria/match_criterion/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/sdps/sdp/service_match_criteria/match_criterion/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/sdps/sdp/service_match_criteria/match_criterion/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/sdps/sdp/service_match_criteria/match_criterion/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/sdps/sdp/status/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/sdps/sdp/status/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/sdps/sdp/status/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/sdps/sdp/status/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/sdps/sdp/status/admin_status/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/sdps/sdp/status/admin_status/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/sdps/sdp/status/admin_status/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/sdps/sdp/status/admin_status/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/sdps/sdp/status/oper_status/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/sdps/sdp/status/oper_status/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/sdps/sdp/status/oper_status/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/sdps/sdp/status/oper_status/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/service_tags/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/service_tags/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/service_tags/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/service_tags/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/service_tags/tag_opaque/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/service_tags/tag_opaque/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/service_tags/tag_opaque/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/service_tags/tag_opaque/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/service_tags/tag_type/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/service_tags/tag_type/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/service_tags/tag_type/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/service_tags/tag_type/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/slo_sle_policy/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/slo_sle_policy/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/slo_sle_policy/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/slo_sle_policy/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/slo_sle_policy/custom/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/slo_sle_policy/custom/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/slo_sle_policy/custom/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/slo_sle_policy/custom/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/slo_sle_policy/custom/service_slo_sle_policy/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/slo_sle_policy/custom/service_slo_sle_policy/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/slo_sle_policy/custom/service_slo_sle_policy/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/slo_sle_policy/custom/service_slo_sle_policy/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/slo_sle_policy/custom/service_slo_sle_policy/metric_bounds/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/slo_sle_policy/custom/service_slo_sle_policy/metric_bounds/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/slo_sle_policy/custom/service_slo_sle_policy/metric_bounds/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/slo_sle_policy/custom/service_slo_sle_policy/metric_bounds/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/slo_sle_policy/custom/service_slo_sle_policy/metric_bounds/metric_bound/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/slo_sle_policy/custom/service_slo_sle_policy/metric_bounds/metric_bound/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/slo_sle_policy/custom/service_slo_sle_policy/metric_bounds/metric_bound/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/slo_sle_policy/custom/service_slo_sle_policy/metric_bounds/metric_bound/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/slo_sle_policy/custom/service_slo_sle_policy/steering_constraints/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/slo_sle_policy/custom/service_slo_sle_policy/steering_constraints/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/slo_sle_policy/custom/service_slo_sle_policy/steering_constraints/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/slo_sle_policy/custom/service_slo_sle_policy/steering_constraints/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/slo_sle_policy/custom/service_slo_sle_policy/steering_constraints/path_constraints/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/slo_sle_policy/custom/service_slo_sle_policy/steering_constraints/path_constraints/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/slo_sle_policy/custom/service_slo_sle_policy/steering_constraints/path_constraints/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/slo_sle_policy/custom/service_slo_sle_policy/steering_constraints/path_constraints/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/slo_sle_policy/custom/service_slo_sle_policy/steering_constraints/service_function/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/slo_sle_policy/custom/service_slo_sle_policy/steering_constraints/service_function/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/slo_sle_policy/custom/service_slo_sle_policy/steering_constraints/service_function/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/slo_sle_policy/custom/service_slo_sle_policy/steering_constraints/service_function/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/slo_sle_policy/standard/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/slo_sle_policy/standard/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/slo_sle_policy/standard/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/slo_sle_policy/standard/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/status/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/status/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/status/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/status/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/status/admin_status/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/status/admin_status/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/status/admin_status/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/status/admin_status/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/status/oper_status/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/status/oper_status/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/status/oper_status/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/status/oper_status/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/te_topology_identifier/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/te_topology_identifier/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/te_topology_identifier/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slice_service/te_topology_identifier/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slo_sle_templates/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slo_sle_templates/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slo_sle_templates/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slo_sle_templates/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slo_sle_templates/slo_sle_template/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slo_sle_templates/slo_sle_template/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slo_sle_templates/slo_sle_template/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slo_sle_templates/slo_sle_template/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slo_sle_templates/slo_sle_template/service_slo_sle_policy/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slo_sle_templates/slo_sle_template/service_slo_sle_policy/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slo_sle_templates/slo_sle_template/service_slo_sle_policy/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slo_sle_templates/slo_sle_template/service_slo_sle_policy/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slo_sle_templates/slo_sle_template/service_slo_sle_policy/metric_bounds/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slo_sle_templates/slo_sle_template/service_slo_sle_policy/metric_bounds/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slo_sle_templates/slo_sle_template/service_slo_sle_policy/metric_bounds/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slo_sle_templates/slo_sle_template/service_slo_sle_policy/metric_bounds/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slo_sle_templates/slo_sle_template/service_slo_sle_policy/metric_bounds/metric_bound/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slo_sle_templates/slo_sle_template/service_slo_sle_policy/metric_bounds/metric_bound/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slo_sle_templates/slo_sle_template/service_slo_sle_policy/metric_bounds/metric_bound/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slo_sle_templates/slo_sle_template/service_slo_sle_policy/metric_bounds/metric_bound/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slo_sle_templates/slo_sle_template/service_slo_sle_policy/steering_constraints/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slo_sle_templates/slo_sle_template/service_slo_sle_policy/steering_constraints/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slo_sle_templates/slo_sle_template/service_slo_sle_policy/steering_constraints/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slo_sle_templates/slo_sle_template/service_slo_sle_policy/steering_constraints/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slo_sle_templates/slo_sle_template/service_slo_sle_policy/steering_constraints/path_constraints/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slo_sle_templates/slo_sle_template/service_slo_sle_policy/steering_constraints/path_constraints/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slo_sle_templates/slo_sle_template/service_slo_sle_policy/steering_constraints/path_constraints/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slo_sle_templates/slo_sle_template/service_slo_sle_policy/steering_constraints/path_constraints/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slo_sle_templates/slo_sle_template/service_slo_sle_policy/steering_constraints/service_function/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slo_sle_templates/slo_sle_template/service_slo_sle_policy/steering_constraints/service_function/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slo_sle_templates/slo_sle_template/service_slo_sle_policy/steering_constraints/service_function/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/network_slice_services/slo_sle_templates/slo_sle_template/service_slo_sle_policy/steering_constraints/service_function/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/destination/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/destination/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/destination/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/destination/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/source/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/source/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/source/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/source/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/supporting_link/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/supporting_link/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/supporting_link/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/supporting_link/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/bundle_stack_level/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/bundle_stack_level/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/bundle_stack_level/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/bundle_stack_level/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/bundle_stack_level/bundle/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/bundle_stack_level/bundle/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/bundle_stack_level/bundle/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/bundle_stack_level/bundle/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/bundle_stack_level/bundle/bundled_links/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/bundle_stack_level/bundle/bundled_links/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/bundle_stack_level/bundle/bundled_links/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/bundle_stack_level/bundle/bundled_links/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/bundle_stack_level/bundle/bundled_links/bundled_link/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/bundle_stack_level/bundle/bundled_links/bundled_link/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/bundle_stack_level/bundle/bundled_links/bundled_link/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/bundle_stack_level/bundle/bundled_links/bundled_link/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/bundle_stack_level/component/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/bundle_stack_level/component/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/bundle_stack_level/component/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/bundle_stack_level/component/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/bundle_stack_level/component/component_links/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/bundle_stack_level/component/component_links/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/bundle_stack_level/component/component_links/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/bundle_stack_level/component/component_links/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/bundle_stack_level/component/component_links/component_link/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/bundle_stack_level/component/component_links/component_link/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/bundle_stack_level/component/component_links/component_link/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/bundle_stack_level/component/component_links/component_link/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/information_source_entry/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/information_source_entry/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/information_source_entry/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/information_source_entry/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/information_source_entry/information_source_state/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/information_source_entry/information_source_state/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/information_source_entry/information_source_state/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/information_source_entry/information_source_state/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/information_source_entry/information_source_state/topology/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/information_source_entry/information_source_state/topology/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/information_source_entry/information_source_state/topology/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/information_source_entry/information_source_state/topology/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/information_source_entry/interface_switching_capability/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/information_source_entry/interface_switching_capability/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/information_source_entry/interface_switching_capability/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/information_source_entry/interface_switching_capability/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/information_source_entry/interface_switching_capability/max_lsp_bandwidth/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/information_source_entry/interface_switching_capability/max_lsp_bandwidth/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/information_source_entry/interface_switching_capability/max_lsp_bandwidth/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/information_source_entry/interface_switching_capability/max_lsp_bandwidth/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/information_source_entry/interface_switching_capability/max_lsp_bandwidth/te_bandwidth/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/information_source_entry/interface_switching_capability/max_lsp_bandwidth/te_bandwidth/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/information_source_entry/interface_switching_capability/max_lsp_bandwidth/te_bandwidth/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/information_source_entry/interface_switching_capability/max_lsp_bandwidth/te_bandwidth/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/information_source_entry/interface_switching_capability/max_lsp_bandwidth/te_bandwidth/technology/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/information_source_entry/interface_switching_capability/max_lsp_bandwidth/te_bandwidth/technology/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/information_source_entry/interface_switching_capability/max_lsp_bandwidth/te_bandwidth/technology/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/information_source_entry/interface_switching_capability/max_lsp_bandwidth/te_bandwidth/technology/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/information_source_entry/interface_switching_capability/max_lsp_bandwidth/te_bandwidth/technology/generic/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/information_source_entry/interface_switching_capability/max_lsp_bandwidth/te_bandwidth/technology/generic/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/information_source_entry/interface_switching_capability/max_lsp_bandwidth/te_bandwidth/technology/generic/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/information_source_entry/interface_switching_capability/max_lsp_bandwidth/te_bandwidth/technology/generic/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/information_source_entry/label_restrictions/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/information_source_entry/label_restrictions/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/information_source_entry/label_restrictions/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/information_source_entry/label_restrictions/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/information_source_entry/label_restrictions/label_restriction/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/information_source_entry/label_restrictions/label_restriction/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/information_source_entry/label_restrictions/label_restriction/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/information_source_entry/label_restrictions/label_restriction/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/information_source_entry/label_restrictions/label_restriction/label_end/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/information_source_entry/label_restrictions/label_restriction/label_end/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/information_source_entry/label_restrictions/label_restriction/label_end/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/information_source_entry/label_restrictions/label_restriction/label_end/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/information_source_entry/label_restrictions/label_restriction/label_end/te_label/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/information_source_entry/label_restrictions/label_restriction/label_end/te_label/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/information_source_entry/label_restrictions/label_restriction/label_end/te_label/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/information_source_entry/label_restrictions/label_restriction/label_end/te_label/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/information_source_entry/label_restrictions/label_restriction/label_end/te_label/technology/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/information_source_entry/label_restrictions/label_restriction/label_end/te_label/technology/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/information_source_entry/label_restrictions/label_restriction/label_end/te_label/technology/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/information_source_entry/label_restrictions/label_restriction/label_end/te_label/technology/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/information_source_entry/label_restrictions/label_restriction/label_end/te_label/technology/generic/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/information_source_entry/label_restrictions/label_restriction/label_end/te_label/technology/generic/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/information_source_entry/label_restrictions/label_restriction/label_end/te_label/technology/generic/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/information_source_entry/label_restrictions/label_restriction/label_end/te_label/technology/generic/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/information_source_entry/label_restrictions/label_restriction/label_start/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/information_source_entry/label_restrictions/label_restriction/label_start/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/information_source_entry/label_restrictions/label_restriction/label_start/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/information_source_entry/label_restrictions/label_restriction/label_start/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/information_source_entry/label_restrictions/label_restriction/label_start/te_label/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/information_source_entry/label_restrictions/label_restriction/label_start/te_label/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/information_source_entry/label_restrictions/label_restriction/label_start/te_label/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/information_source_entry/label_restrictions/label_restriction/label_start/te_label/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/information_source_entry/label_restrictions/label_restriction/label_start/te_label/technology/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/information_source_entry/label_restrictions/label_restriction/label_start/te_label/technology/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/information_source_entry/label_restrictions/label_restriction/label_start/te_label/technology/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/information_source_entry/label_restrictions/label_restriction/label_start/te_label/technology/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/information_source_entry/label_restrictions/label_restriction/label_start/te_label/technology/generic/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/information_source_entry/label_restrictions/label_restriction/label_start/te_label/technology/generic/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/information_source_entry/label_restrictions/label_restriction/label_start/te_label/technology/generic/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/information_source_entry/label_restrictions/label_restriction/label_start/te_label/technology/generic/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/information_source_entry/label_restrictions/label_restriction/label_step/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/information_source_entry/label_restrictions/label_restriction/label_step/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/information_source_entry/label_restrictions/label_restriction/label_step/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/information_source_entry/label_restrictions/label_restriction/label_step/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/information_source_entry/label_restrictions/label_restriction/label_step/technology/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/information_source_entry/label_restrictions/label_restriction/label_step/technology/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/information_source_entry/label_restrictions/label_restriction/label_step/technology/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/information_source_entry/label_restrictions/label_restriction/label_step/technology/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/information_source_entry/label_restrictions/label_restriction/label_step/technology/generic/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/information_source_entry/label_restrictions/label_restriction/label_step/technology/generic/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/information_source_entry/label_restrictions/label_restriction/label_step/technology/generic/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/information_source_entry/label_restrictions/label_restriction/label_step/technology/generic/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/information_source_entry/max_link_bandwidth/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/information_source_entry/max_link_bandwidth/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/information_source_entry/max_link_bandwidth/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/information_source_entry/max_link_bandwidth/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/information_source_entry/max_link_bandwidth/te_bandwidth/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/information_source_entry/max_link_bandwidth/te_bandwidth/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/information_source_entry/max_link_bandwidth/te_bandwidth/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/information_source_entry/max_link_bandwidth/te_bandwidth/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/information_source_entry/max_link_bandwidth/te_bandwidth/technology/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/information_source_entry/max_link_bandwidth/te_bandwidth/technology/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/information_source_entry/max_link_bandwidth/te_bandwidth/technology/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/information_source_entry/max_link_bandwidth/te_bandwidth/technology/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/information_source_entry/max_link_bandwidth/te_bandwidth/technology/generic/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/information_source_entry/max_link_bandwidth/te_bandwidth/technology/generic/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/information_source_entry/max_link_bandwidth/te_bandwidth/technology/generic/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/information_source_entry/max_link_bandwidth/te_bandwidth/technology/generic/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/information_source_entry/max_resv_link_bandwidth/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/information_source_entry/max_resv_link_bandwidth/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/information_source_entry/max_resv_link_bandwidth/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/information_source_entry/max_resv_link_bandwidth/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/information_source_entry/max_resv_link_bandwidth/te_bandwidth/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/information_source_entry/max_resv_link_bandwidth/te_bandwidth/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/information_source_entry/max_resv_link_bandwidth/te_bandwidth/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/information_source_entry/max_resv_link_bandwidth/te_bandwidth/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/information_source_entry/max_resv_link_bandwidth/te_bandwidth/technology/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/information_source_entry/max_resv_link_bandwidth/te_bandwidth/technology/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/information_source_entry/max_resv_link_bandwidth/te_bandwidth/technology/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/information_source_entry/max_resv_link_bandwidth/te_bandwidth/technology/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/information_source_entry/max_resv_link_bandwidth/te_bandwidth/technology/generic/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/information_source_entry/max_resv_link_bandwidth/te_bandwidth/technology/generic/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/information_source_entry/max_resv_link_bandwidth/te_bandwidth/technology/generic/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/information_source_entry/max_resv_link_bandwidth/te_bandwidth/technology/generic/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/information_source_entry/te_nsrlgs/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/information_source_entry/te_nsrlgs/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/information_source_entry/te_nsrlgs/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/information_source_entry/te_nsrlgs/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/information_source_entry/te_srlgs/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/information_source_entry/te_srlgs/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/information_source_entry/te_srlgs/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/information_source_entry/te_srlgs/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/information_source_entry/unreserved_bandwidth/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/information_source_entry/unreserved_bandwidth/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/information_source_entry/unreserved_bandwidth/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/information_source_entry/unreserved_bandwidth/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/information_source_entry/unreserved_bandwidth/te_bandwidth/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/information_source_entry/unreserved_bandwidth/te_bandwidth/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/information_source_entry/unreserved_bandwidth/te_bandwidth/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/information_source_entry/unreserved_bandwidth/te_bandwidth/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/information_source_entry/unreserved_bandwidth/te_bandwidth/technology/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/information_source_entry/unreserved_bandwidth/te_bandwidth/technology/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/information_source_entry/unreserved_bandwidth/te_bandwidth/technology/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/information_source_entry/unreserved_bandwidth/te_bandwidth/technology/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/information_source_entry/unreserved_bandwidth/te_bandwidth/technology/generic/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/information_source_entry/unreserved_bandwidth/te_bandwidth/technology/generic/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/information_source_entry/unreserved_bandwidth/te_bandwidth/technology/generic/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/information_source_entry/unreserved_bandwidth/te_bandwidth/technology/generic/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/information_source_state/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/information_source_state/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/information_source_state/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/information_source_state/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/information_source_state/topology/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/information_source_state/topology/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/information_source_state/topology/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/information_source_state/topology/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/recovery/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/recovery/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/recovery/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/recovery/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/statistics/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/statistics/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/statistics/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/statistics/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/external_domain/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/external_domain/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/external_domain/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/external_domain/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/interface_switching_capability/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/interface_switching_capability/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/interface_switching_capability/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/interface_switching_capability/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/interface_switching_capability/max_lsp_bandwidth/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/interface_switching_capability/max_lsp_bandwidth/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/interface_switching_capability/max_lsp_bandwidth/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/interface_switching_capability/max_lsp_bandwidth/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/interface_switching_capability/max_lsp_bandwidth/te_bandwidth/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/interface_switching_capability/max_lsp_bandwidth/te_bandwidth/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/interface_switching_capability/max_lsp_bandwidth/te_bandwidth/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/interface_switching_capability/max_lsp_bandwidth/te_bandwidth/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/interface_switching_capability/max_lsp_bandwidth/te_bandwidth/technology/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/interface_switching_capability/max_lsp_bandwidth/te_bandwidth/technology/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/interface_switching_capability/max_lsp_bandwidth/te_bandwidth/technology/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/interface_switching_capability/max_lsp_bandwidth/te_bandwidth/technology/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/interface_switching_capability/max_lsp_bandwidth/te_bandwidth/technology/generic/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/interface_switching_capability/max_lsp_bandwidth/te_bandwidth/technology/generic/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/interface_switching_capability/max_lsp_bandwidth/te_bandwidth/technology/generic/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/interface_switching_capability/max_lsp_bandwidth/te_bandwidth/technology/generic/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/label_restrictions/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/label_restrictions/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/label_restrictions/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/label_restrictions/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/label_restrictions/label_restriction/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/label_restrictions/label_restriction/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/label_restrictions/label_restriction/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/label_restrictions/label_restriction/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/label_restrictions/label_restriction/label_end/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/label_restrictions/label_restriction/label_end/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/label_restrictions/label_restriction/label_end/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/label_restrictions/label_restriction/label_end/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/label_restrictions/label_restriction/label_end/te_label/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/label_restrictions/label_restriction/label_end/te_label/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/label_restrictions/label_restriction/label_end/te_label/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/label_restrictions/label_restriction/label_end/te_label/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/label_restrictions/label_restriction/label_end/te_label/technology/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/label_restrictions/label_restriction/label_end/te_label/technology/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/label_restrictions/label_restriction/label_end/te_label/technology/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/label_restrictions/label_restriction/label_end/te_label/technology/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/label_restrictions/label_restriction/label_end/te_label/technology/generic/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/label_restrictions/label_restriction/label_end/te_label/technology/generic/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/label_restrictions/label_restriction/label_end/te_label/technology/generic/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/label_restrictions/label_restriction/label_end/te_label/technology/generic/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/label_restrictions/label_restriction/label_start/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/label_restrictions/label_restriction/label_start/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/label_restrictions/label_restriction/label_start/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/label_restrictions/label_restriction/label_start/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/label_restrictions/label_restriction/label_start/te_label/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/label_restrictions/label_restriction/label_start/te_label/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/label_restrictions/label_restriction/label_start/te_label/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/label_restrictions/label_restriction/label_start/te_label/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/label_restrictions/label_restriction/label_start/te_label/technology/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/label_restrictions/label_restriction/label_start/te_label/technology/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/label_restrictions/label_restriction/label_start/te_label/technology/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/label_restrictions/label_restriction/label_start/te_label/technology/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/label_restrictions/label_restriction/label_start/te_label/technology/generic/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/label_restrictions/label_restriction/label_start/te_label/technology/generic/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/label_restrictions/label_restriction/label_start/te_label/technology/generic/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/label_restrictions/label_restriction/label_start/te_label/technology/generic/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/label_restrictions/label_restriction/label_step/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/label_restrictions/label_restriction/label_step/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/label_restrictions/label_restriction/label_step/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/label_restrictions/label_restriction/label_step/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/label_restrictions/label_restriction/label_step/technology/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/label_restrictions/label_restriction/label_step/technology/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/label_restrictions/label_restriction/label_step/technology/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/label_restrictions/label_restriction/label_step/technology/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/label_restrictions/label_restriction/label_step/technology/generic/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/label_restrictions/label_restriction/label_step/technology/generic/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/label_restrictions/label_restriction/label_step/technology/generic/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/label_restrictions/label_restriction/label_step/technology/generic/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/max_link_bandwidth/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/max_link_bandwidth/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/max_link_bandwidth/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/max_link_bandwidth/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/max_link_bandwidth/te_bandwidth/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/max_link_bandwidth/te_bandwidth/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/max_link_bandwidth/te_bandwidth/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/max_link_bandwidth/te_bandwidth/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/max_link_bandwidth/te_bandwidth/technology/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/max_link_bandwidth/te_bandwidth/technology/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/max_link_bandwidth/te_bandwidth/technology/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/max_link_bandwidth/te_bandwidth/technology/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/max_link_bandwidth/te_bandwidth/technology/generic/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/max_link_bandwidth/te_bandwidth/technology/generic/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/max_link_bandwidth/te_bandwidth/technology/generic/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/max_link_bandwidth/te_bandwidth/technology/generic/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/max_resv_link_bandwidth/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/max_resv_link_bandwidth/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/max_resv_link_bandwidth/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/max_resv_link_bandwidth/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/max_resv_link_bandwidth/te_bandwidth/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/max_resv_link_bandwidth/te_bandwidth/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/max_resv_link_bandwidth/te_bandwidth/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/max_resv_link_bandwidth/te_bandwidth/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/max_resv_link_bandwidth/te_bandwidth/technology/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/max_resv_link_bandwidth/te_bandwidth/technology/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/max_resv_link_bandwidth/te_bandwidth/technology/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/max_resv_link_bandwidth/te_bandwidth/technology/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/max_resv_link_bandwidth/te_bandwidth/technology/generic/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/max_resv_link_bandwidth/te_bandwidth/technology/generic/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/max_resv_link_bandwidth/te_bandwidth/technology/generic/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/max_resv_link_bandwidth/te_bandwidth/technology/generic/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/te_nsrlgs/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/te_nsrlgs/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/te_nsrlgs/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/te_nsrlgs/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/te_srlgs/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/te_srlgs/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/te_srlgs/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/te_srlgs/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/underlay/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/underlay/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/underlay/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/underlay/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/underlay/backup_path/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/underlay/backup_path/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/underlay/backup_path/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/underlay/backup_path/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/underlay/backup_path/path_element/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/underlay/backup_path/path_element/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/underlay/backup_path/path_element/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/underlay/backup_path/path_element/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/underlay/backup_path/path_element/type/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/underlay/backup_path/path_element/type/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/underlay/backup_path/path_element/type/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/underlay/backup_path/path_element/type/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/underlay/backup_path/path_element/type/as_number/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/underlay/backup_path/path_element/type/as_number/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/underlay/backup_path/path_element/type/as_number/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/underlay/backup_path/path_element/type/as_number/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/underlay/backup_path/path_element/type/as_number/as_number_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/underlay/backup_path/path_element/type/as_number/as_number_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/underlay/backup_path/path_element/type/as_number/as_number_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/underlay/backup_path/path_element/type/as_number/as_number_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/underlay/backup_path/path_element/type/label/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/underlay/backup_path/path_element/type/label/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/underlay/backup_path/path_element/type/label/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/underlay/backup_path/path_element/type/label/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/underlay/backup_path/path_element/type/label/label_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/underlay/backup_path/path_element/type/label/label_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/underlay/backup_path/path_element/type/label/label_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/underlay/backup_path/path_element/type/label/label_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/underlay/backup_path/path_element/type/label/label_hop/te_label/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/underlay/backup_path/path_element/type/label/label_hop/te_label/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/underlay/backup_path/path_element/type/label/label_hop/te_label/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/underlay/backup_path/path_element/type/label/label_hop/te_label/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/underlay/backup_path/path_element/type/label/label_hop/te_label/technology/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/underlay/backup_path/path_element/type/label/label_hop/te_label/technology/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/underlay/backup_path/path_element/type/label/label_hop/te_label/technology/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/underlay/backup_path/path_element/type/label/label_hop/te_label/technology/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/underlay/backup_path/path_element/type/label/label_hop/te_label/technology/generic/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/underlay/backup_path/path_element/type/label/label_hop/te_label/technology/generic/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/underlay/backup_path/path_element/type/label/label_hop/te_label/technology/generic/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/underlay/backup_path/path_element/type/label/label_hop/te_label/technology/generic/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/underlay/backup_path/path_element/type/numbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/underlay/backup_path/path_element/type/numbered_link_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/underlay/backup_path/path_element/type/numbered_link_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/underlay/backup_path/path_element/type/numbered_link_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/underlay/backup_path/path_element/type/numbered_link_hop/numbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/underlay/backup_path/path_element/type/numbered_link_hop/numbered_link_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/underlay/backup_path/path_element/type/numbered_link_hop/numbered_link_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/underlay/backup_path/path_element/type/numbered_link_hop/numbered_link_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/underlay/backup_path/path_element/type/numbered_node_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/underlay/backup_path/path_element/type/numbered_node_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/underlay/backup_path/path_element/type/numbered_node_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/underlay/backup_path/path_element/type/numbered_node_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/underlay/backup_path/path_element/type/numbered_node_hop/numbered_node_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/underlay/backup_path/path_element/type/numbered_node_hop/numbered_node_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/underlay/backup_path/path_element/type/numbered_node_hop/numbered_node_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/underlay/backup_path/path_element/type/numbered_node_hop/numbered_node_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/underlay/backup_path/path_element/type/unnumbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/underlay/backup_path/path_element/type/unnumbered_link_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/underlay/backup_path/path_element/type/unnumbered_link_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/underlay/backup_path/path_element/type/unnumbered_link_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/underlay/backup_path/path_element/type/unnumbered_link_hop/unnumbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/underlay/backup_path/path_element/type/unnumbered_link_hop/unnumbered_link_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/underlay/backup_path/path_element/type/unnumbered_link_hop/unnumbered_link_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/underlay/backup_path/path_element/type/unnumbered_link_hop/unnumbered_link_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/underlay/primary_path/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/underlay/primary_path/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/underlay/primary_path/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/underlay/primary_path/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/underlay/primary_path/path_element/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/underlay/primary_path/path_element/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/underlay/primary_path/path_element/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/underlay/primary_path/path_element/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/underlay/primary_path/path_element/type/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/underlay/primary_path/path_element/type/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/underlay/primary_path/path_element/type/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/underlay/primary_path/path_element/type/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/underlay/primary_path/path_element/type/as_number/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/underlay/primary_path/path_element/type/as_number/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/underlay/primary_path/path_element/type/as_number/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/underlay/primary_path/path_element/type/as_number/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/underlay/primary_path/path_element/type/as_number/as_number_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/underlay/primary_path/path_element/type/as_number/as_number_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/underlay/primary_path/path_element/type/as_number/as_number_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/underlay/primary_path/path_element/type/as_number/as_number_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/underlay/primary_path/path_element/type/label/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/underlay/primary_path/path_element/type/label/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/underlay/primary_path/path_element/type/label/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/underlay/primary_path/path_element/type/label/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/underlay/primary_path/path_element/type/label/label_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/underlay/primary_path/path_element/type/label/label_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/underlay/primary_path/path_element/type/label/label_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/underlay/primary_path/path_element/type/label/label_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/underlay/primary_path/path_element/type/label/label_hop/te_label/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/underlay/primary_path/path_element/type/label/label_hop/te_label/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/underlay/primary_path/path_element/type/label/label_hop/te_label/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/underlay/primary_path/path_element/type/label/label_hop/te_label/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/underlay/primary_path/path_element/type/label/label_hop/te_label/technology/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/underlay/primary_path/path_element/type/label/label_hop/te_label/technology/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/underlay/primary_path/path_element/type/label/label_hop/te_label/technology/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/underlay/primary_path/path_element/type/label/label_hop/te_label/technology/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/underlay/primary_path/path_element/type/label/label_hop/te_label/technology/generic/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/underlay/primary_path/path_element/type/label/label_hop/te_label/technology/generic/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/underlay/primary_path/path_element/type/label/label_hop/te_label/technology/generic/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/underlay/primary_path/path_element/type/label/label_hop/te_label/technology/generic/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/underlay/primary_path/path_element/type/numbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/underlay/primary_path/path_element/type/numbered_link_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/underlay/primary_path/path_element/type/numbered_link_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/underlay/primary_path/path_element/type/numbered_link_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/underlay/primary_path/path_element/type/numbered_link_hop/numbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/underlay/primary_path/path_element/type/numbered_link_hop/numbered_link_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/underlay/primary_path/path_element/type/numbered_link_hop/numbered_link_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/underlay/primary_path/path_element/type/numbered_link_hop/numbered_link_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/underlay/primary_path/path_element/type/numbered_node_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/underlay/primary_path/path_element/type/numbered_node_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/underlay/primary_path/path_element/type/numbered_node_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/underlay/primary_path/path_element/type/numbered_node_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/underlay/primary_path/path_element/type/numbered_node_hop/numbered_node_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/underlay/primary_path/path_element/type/numbered_node_hop/numbered_node_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/underlay/primary_path/path_element/type/numbered_node_hop/numbered_node_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/underlay/primary_path/path_element/type/numbered_node_hop/numbered_node_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/underlay/primary_path/path_element/type/unnumbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/underlay/primary_path/path_element/type/unnumbered_link_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/underlay/primary_path/path_element/type/unnumbered_link_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/underlay/primary_path/path_element/type/unnumbered_link_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/underlay/primary_path/path_element/type/unnumbered_link_hop/unnumbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/underlay/primary_path/path_element/type/unnumbered_link_hop/unnumbered_link_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/underlay/primary_path/path_element/type/unnumbered_link_hop/unnumbered_link_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/underlay/primary_path/path_element/type/unnumbered_link_hop/unnumbered_link_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/underlay/tunnel_termination_points/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/underlay/tunnel_termination_points/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/underlay/tunnel_termination_points/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/underlay/tunnel_termination_points/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/underlay/tunnels/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/underlay/tunnels/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/underlay/tunnels/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/underlay/tunnels/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/underlay/tunnels/tunnel/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/underlay/tunnels/tunnel/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/underlay/tunnels/tunnel/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/underlay/tunnels/tunnel/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/unreserved_bandwidth/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/unreserved_bandwidth/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/unreserved_bandwidth/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/unreserved_bandwidth/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/unreserved_bandwidth/te_bandwidth/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/unreserved_bandwidth/te_bandwidth/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/unreserved_bandwidth/te_bandwidth/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/unreserved_bandwidth/te_bandwidth/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/unreserved_bandwidth/te_bandwidth/technology/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/unreserved_bandwidth/te_bandwidth/technology/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/unreserved_bandwidth/te_bandwidth/technology/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/unreserved_bandwidth/te_bandwidth/technology/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/unreserved_bandwidth/te_bandwidth/technology/generic/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/unreserved_bandwidth/te_bandwidth/technology/generic/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/unreserved_bandwidth/te_bandwidth/technology/generic/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/te_link_attributes/unreserved_bandwidth/te_bandwidth/technology/generic/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/underlay/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/underlay/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/underlay/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/link/te/underlay/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/network_types/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/network_types/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/network_types/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/network_types/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/network_types/te_topology/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/network_types/te_topology/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/network_types/te_topology/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/network_types/te_topology/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/supporting_node/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/supporting_node/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/supporting_node/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/supporting_node/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/geolocation/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/geolocation/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/geolocation/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/geolocation/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from/label_restrictions/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from/label_restrictions/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from/label_restrictions/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from/label_restrictions/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/label_end/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/label_end/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/label_end/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/label_end/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/label_end/te_label/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/label_end/te_label/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/label_end/te_label/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/label_end/te_label/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/label_end/te_label/technology/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/label_end/te_label/technology/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/label_end/te_label/technology/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/label_end/te_label/technology/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/label_end/te_label/technology/generic/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/label_end/te_label/technology/generic/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/label_end/te_label/technology/generic/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/label_end/te_label/technology/generic/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/label_start/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/label_start/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/label_start/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/label_start/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/label_start/te_label/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/label_start/te_label/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/label_start/te_label/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/label_start/te_label/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/label_start/te_label/technology/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/label_start/te_label/technology/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/label_start/te_label/technology/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/label_start/te_label/technology/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/label_start/te_label/technology/generic/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/label_start/te_label/technology/generic/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/label_start/te_label/technology/generic/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/label_start/te_label/technology/generic/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/label_step/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/label_step/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/label_step/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/label_step/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/label_step/technology/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/label_step/technology/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/label_step/technology/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/label_step/technology/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/label_step/technology/generic/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/label_step/technology/generic/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/label_step/technology/generic/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/label_step/technology/generic/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/algorithm/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/algorithm/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/algorithm/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/algorithm/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/as_number/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/as_number/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/as_number/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/as_number/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/as_number/as_number_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/as_number/as_number_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/as_number/as_number_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/as_number/as_number_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/label/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/label/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/label/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/label/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/label/label_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/label/label_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/label/label_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/label/label_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/label/label_hop/te_label/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/label/label_hop/te_label/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/label/label_hop/te_label/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/label/label_hop/te_label/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/label/label_hop/te_label/technology/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/label/label_hop/te_label/technology/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/label/label_hop/te_label/technology/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/label/label_hop/te_label/technology/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/label/label_hop/te_label/technology/generic/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/label/label_hop/te_label/technology/generic/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/label/label_hop/te_label/technology/generic/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/label/label_hop/te_label/technology/generic/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/numbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/numbered_link_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/numbered_link_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/numbered_link_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/numbered_link_hop/numbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/numbered_link_hop/numbered_link_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/numbered_link_hop/numbered_link_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/numbered_link_hop/numbered_link_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/numbered_node_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/numbered_node_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/numbered_node_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/numbered_node_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/numbered_node_hop/numbered_node_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/numbered_node_hop/numbered_node_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/numbered_node_hop/numbered_node_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/numbered_node_hop/numbered_node_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/srlg/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/srlg/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/srlg/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/srlg/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/srlg/srlg/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/srlg/srlg/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/srlg/srlg/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/srlg/srlg/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/unnumbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/unnumbered_link_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/unnumbered_link_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/unnumbered_link_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/unnumbered_link_hop/unnumbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/unnumbered_link_hop/unnumbered_link_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/unnumbered_link_hop/unnumbered_link_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/unnumbered_link_hop/unnumbered_link_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/as_number/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/as_number/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/as_number/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/as_number/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/as_number/as_number_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/as_number/as_number_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/as_number/as_number_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/as_number/as_number_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/label/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/label/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/label/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/label/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/label/label_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/label/label_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/label/label_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/label/label_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/label/label_hop/te_label/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/label/label_hop/te_label/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/label/label_hop/te_label/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/label/label_hop/te_label/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/label/label_hop/te_label/technology/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/label/label_hop/te_label/technology/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/label/label_hop/te_label/technology/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/label/label_hop/te_label/technology/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/label/label_hop/te_label/technology/generic/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/label/label_hop/te_label/technology/generic/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/label/label_hop/te_label/technology/generic/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/label/label_hop/te_label/technology/generic/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/numbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/numbered_link_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/numbered_link_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/numbered_link_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/numbered_link_hop/numbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/numbered_link_hop/numbered_link_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/numbered_link_hop/numbered_link_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/numbered_link_hop/numbered_link_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/numbered_node_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/numbered_node_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/numbered_node_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/numbered_node_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/numbered_node_hop/numbered_node_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/numbered_node_hop/numbered_node_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/numbered_node_hop/numbered_node_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/numbered_node_hop/numbered_node_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/unnumbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/unnumbered_link_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/unnumbered_link_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/unnumbered_link_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/unnumbered_link_hop/unnumbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/unnumbered_link_hop/unnumbered_link_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/unnumbered_link_hop/unnumbered_link_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/unnumbered_link_hop/unnumbered_link_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/tiebreakers/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/tiebreakers/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/tiebreakers/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/tiebreakers/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/tiebreakers/tiebreaker/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/tiebreakers/tiebreaker/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/tiebreakers/tiebreaker/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/tiebreakers/tiebreaker/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/algorithm/objective_function/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/algorithm/objective_function/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/algorithm/objective_function/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/algorithm/objective_function/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/algorithm/objective_function/objective_function/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/algorithm/objective_function/objective_function/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/algorithm/objective_function/objective_function/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/algorithm/objective_function/objective_function/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/path_affinities_values/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/path_affinities_values/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/path_affinities_values/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/path_affinities_values/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/path_affinities_values/path_affinities_value/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/path_affinities_values/path_affinities_value/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/path_affinities_values/path_affinities_value/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/path_affinities_values/path_affinities_value/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/path_affinity_names/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/path_affinity_names/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/path_affinity_names/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/path_affinity_names/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/path_affinity_names/path_affinity_name/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/path_affinity_names/path_affinity_name/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/path_affinity_names/path_affinity_name/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/path_affinity_names/path_affinity_name/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/path_affinity_names/path_affinity_name/affinity_name/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/path_affinity_names/path_affinity_name/affinity_name/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/path_affinity_names/path_affinity_name/affinity_name/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/path_affinity_names/path_affinity_name/affinity_name/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/path_metric_bounds/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/path_metric_bounds/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/path_metric_bounds/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/path_metric_bounds/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/path_metric_bounds/path_metric_bound/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/path_metric_bounds/path_metric_bound/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/path_metric_bounds/path_metric_bound/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/path_metric_bounds/path_metric_bound/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/path_srlgs_lists/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/path_srlgs_lists/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/path_srlgs_lists/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/path_srlgs_lists/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/path_srlgs_lists/path_srlgs_list/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/path_srlgs_lists/path_srlgs_list/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/path_srlgs_lists/path_srlgs_list/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/path_srlgs_lists/path_srlgs_list/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/path_srlgs_names/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/path_srlgs_names/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/path_srlgs_names/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/path_srlgs_names/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/path_srlgs_names/path_srlgs_name/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/path_srlgs_names/path_srlgs_name/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/path_srlgs_names/path_srlgs_name/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/path_srlgs_names/path_srlgs_name/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/te_bandwidth/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/te_bandwidth/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/te_bandwidth/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/te_bandwidth/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/te_bandwidth/technology/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/te_bandwidth/technology/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/te_bandwidth/technology/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/te_bandwidth/technology/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/te_bandwidth/technology/generic/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/te_bandwidth/technology/generic/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/te_bandwidth/technology/generic/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/te_bandwidth/technology/generic/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_affinities_values/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_affinities_values/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_affinities_values/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_affinities_values/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_affinities_values/path_affinities_value/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_affinities_values/path_affinities_value/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_affinities_values/path_affinities_value/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_affinities_values/path_affinities_value/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_affinity_names/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_affinity_names/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_affinity_names/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_affinity_names/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_affinity_names/path_affinity_name/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_affinity_names/path_affinity_name/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_affinity_names/path_affinity_name/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_affinity_names/path_affinity_name/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_affinity_names/path_affinity_name/affinity_name/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_affinity_names/path_affinity_name/affinity_name/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_affinity_names/path_affinity_name/affinity_name/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_affinity_names/path_affinity_name/affinity_name/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_metric/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_metric/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_metric/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_metric/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/type/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/type/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/type/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/type/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/type/as_number/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/type/as_number/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/type/as_number/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/type/as_number/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/type/as_number/as_number_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/type/as_number/as_number_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/type/as_number/as_number_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/type/as_number/as_number_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/type/label/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/type/label/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/type/label/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/type/label/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/type/label/label_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/type/label/label_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/type/label/label_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/type/label/label_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/type/label/label_hop/te_label/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/type/label/label_hop/te_label/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/type/label/label_hop/te_label/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/type/label/label_hop/te_label/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/type/label/label_hop/te_label/technology/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/type/label/label_hop/te_label/technology/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/type/label/label_hop/te_label/technology/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/type/label/label_hop/te_label/technology/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/type/label/label_hop/te_label/technology/generic/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/type/label/label_hop/te_label/technology/generic/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/type/label/label_hop/te_label/technology/generic/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/type/label/label_hop/te_label/technology/generic/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/type/numbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/type/numbered_link_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/type/numbered_link_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/type/numbered_link_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/type/numbered_link_hop/numbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/type/numbered_link_hop/numbered_link_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/type/numbered_link_hop/numbered_link_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/type/numbered_link_hop/numbered_link_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/type/numbered_node_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/type/numbered_node_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/type/numbered_node_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/type/numbered_node_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/type/numbered_node_hop/numbered_node_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/type/numbered_node_hop/numbered_node_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/type/numbered_node_hop/numbered_node_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/type/numbered_node_hop/numbered_node_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/type/unnumbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/type/unnumbered_link_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/type/unnumbered_link_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/type/unnumbered_link_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/type/unnumbered_link_hop/unnumbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/type/unnumbered_link_hop/unnumbered_link_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/type/unnumbered_link_hop/unnumbered_link_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/type/unnumbered_link_hop/unnumbered_link_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_srlgs_lists/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_srlgs_lists/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_srlgs_lists/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_srlgs_lists/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_srlgs_lists/path_srlgs_list/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_srlgs_lists/path_srlgs_list/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_srlgs_lists/path_srlgs_list/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_srlgs_lists/path_srlgs_list/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_srlgs_names/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_srlgs_names/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_srlgs_names/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_srlgs_names/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_srlgs_names/path_srlgs_name/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_srlgs_names/path_srlgs_name/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_srlgs_names/path_srlgs_name/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_srlgs_names/path_srlgs_name/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_end/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_end/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_end/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_end/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_end/te_label/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_end/te_label/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_end/te_label/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_end/te_label/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_end/te_label/technology/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_end/te_label/technology/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_end/te_label/technology/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_end/te_label/technology/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_end/te_label/technology/generic/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_end/te_label/technology/generic/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_end/te_label/technology/generic/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_end/te_label/technology/generic/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_start/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_start/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_start/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_start/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_start/te_label/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_start/te_label/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_start/te_label/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_start/te_label/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_start/te_label/technology/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_start/te_label/technology/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_start/te_label/technology/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_start/te_label/technology/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_start/te_label/technology/generic/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_start/te_label/technology/generic/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_start/te_label/technology/generic/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_start/te_label/technology/generic/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_step/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_step/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_step/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_step/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_step/technology/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_step/technology/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_step/technology/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_step/technology/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_step/technology/generic/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_step/technology/generic/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_step/technology/generic/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_step/technology/generic/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/backup_path/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/backup_path/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/backup_path/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/backup_path/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/type/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/type/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/type/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/type/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/type/as_number/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/type/as_number/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/type/as_number/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/type/as_number/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/type/as_number/as_number_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/type/as_number/as_number_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/type/as_number/as_number_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/type/as_number/as_number_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/type/label/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/type/label/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/type/label/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/type/label/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/type/label/label_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/type/label/label_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/type/label/label_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/type/label/label_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/type/label/label_hop/te_label/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/type/label/label_hop/te_label/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/type/label/label_hop/te_label/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/type/label/label_hop/te_label/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/type/label/label_hop/te_label/technology/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/type/label/label_hop/te_label/technology/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/type/label/label_hop/te_label/technology/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/type/label/label_hop/te_label/technology/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/type/label/label_hop/te_label/technology/generic/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/type/label/label_hop/te_label/technology/generic/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/type/label/label_hop/te_label/technology/generic/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/type/label/label_hop/te_label/technology/generic/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/type/numbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/type/numbered_link_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/type/numbered_link_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/type/numbered_link_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/type/numbered_link_hop/numbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/type/numbered_link_hop/numbered_link_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/type/numbered_link_hop/numbered_link_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/type/numbered_link_hop/numbered_link_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/type/numbered_node_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/type/numbered_node_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/type/numbered_node_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/type/numbered_node_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/type/numbered_node_hop/numbered_node_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/type/numbered_node_hop/numbered_node_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/type/numbered_node_hop/numbered_node_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/type/numbered_node_hop/numbered_node_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/type/unnumbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/type/unnumbered_link_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/type/unnumbered_link_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/type/unnumbered_link_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/type/unnumbered_link_hop/unnumbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/type/unnumbered_link_hop/unnumbered_link_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/type/unnumbered_link_hop/unnumbered_link_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/type/unnumbered_link_hop/unnumbered_link_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/primary_path/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/primary_path/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/primary_path/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/primary_path/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/type/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/type/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/type/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/type/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/type/as_number/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/type/as_number/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/type/as_number/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/type/as_number/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/type/as_number/as_number_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/type/as_number/as_number_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/type/as_number/as_number_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/type/as_number/as_number_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/type/label/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/type/label/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/type/label/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/type/label/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/type/label/label_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/type/label/label_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/type/label/label_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/type/label/label_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/type/label/label_hop/te_label/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/type/label/label_hop/te_label/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/type/label/label_hop/te_label/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/type/label/label_hop/te_label/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/type/label/label_hop/te_label/technology/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/type/label/label_hop/te_label/technology/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/type/label/label_hop/te_label/technology/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/type/label/label_hop/te_label/technology/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/type/label/label_hop/te_label/technology/generic/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/type/label/label_hop/te_label/technology/generic/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/type/label/label_hop/te_label/technology/generic/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/type/label/label_hop/te_label/technology/generic/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/type/numbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/type/numbered_link_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/type/numbered_link_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/type/numbered_link_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/type/numbered_link_hop/numbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/type/numbered_link_hop/numbered_link_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/type/numbered_link_hop/numbered_link_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/type/numbered_link_hop/numbered_link_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/type/numbered_node_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/type/numbered_node_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/type/numbered_node_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/type/numbered_node_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/type/numbered_node_hop/numbered_node_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/type/numbered_node_hop/numbered_node_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/type/numbered_node_hop/numbered_node_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/type/numbered_node_hop/numbered_node_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/type/unnumbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/type/unnumbered_link_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/type/unnumbered_link_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/type/unnumbered_link_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/type/unnumbered_link_hop/unnumbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/type/unnumbered_link_hop/unnumbered_link_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/type/unnumbered_link_hop/unnumbered_link_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/type/unnumbered_link_hop/unnumbered_link_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/tunnel_termination_points/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/tunnel_termination_points/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/tunnel_termination_points/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/tunnel_termination_points/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/tunnels/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/tunnels/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/tunnels/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/tunnels/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/tunnels/tunnel/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/tunnels/tunnel/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/tunnels/tunnel/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/tunnels/tunnel/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/label_restriction/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/label_restriction/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/label_restriction/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/label_restriction/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/label_restriction/label_end/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/label_restriction/label_end/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/label_restriction/label_end/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/label_restriction/label_end/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/label_restriction/label_end/te_label/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/label_restriction/label_end/te_label/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/label_restriction/label_end/te_label/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/label_restriction/label_end/te_label/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/label_restriction/label_end/te_label/technology/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/label_restriction/label_end/te_label/technology/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/label_restriction/label_end/te_label/technology/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/label_restriction/label_end/te_label/technology/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/label_restriction/label_end/te_label/technology/generic/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/label_restriction/label_end/te_label/technology/generic/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/label_restriction/label_end/te_label/technology/generic/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/label_restriction/label_end/te_label/technology/generic/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/label_restriction/label_start/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/label_restriction/label_start/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/label_restriction/label_start/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/label_restriction/label_start/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/label_restriction/label_start/te_label/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/label_restriction/label_start/te_label/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/label_restriction/label_start/te_label/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/label_restriction/label_start/te_label/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/label_restriction/label_start/te_label/technology/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/label_restriction/label_start/te_label/technology/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/label_restriction/label_start/te_label/technology/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/label_restriction/label_start/te_label/technology/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/label_restriction/label_start/te_label/technology/generic/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/label_restriction/label_start/te_label/technology/generic/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/label_restriction/label_start/te_label/technology/generic/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/label_restriction/label_start/te_label/technology/generic/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/label_restriction/label_step/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/label_restriction/label_step/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/label_restriction/label_step/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/label_restriction/label_step/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/label_restriction/label_step/technology/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/label_restriction/label_step/technology/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/label_restriction/label_step/technology/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/label_restriction/label_step/technology/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/label_restriction/label_step/technology/generic/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/label_restriction/label_step/technology/generic/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/label_restriction/label_step/technology/generic/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/label_restriction/label_step/technology/generic/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/algorithm/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/algorithm/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/algorithm/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/algorithm/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/algorithm/metric/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/algorithm/metric/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/algorithm/metric/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/algorithm/metric/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/as_number/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/as_number/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/as_number/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/as_number/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/as_number/as_number_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/as_number/as_number_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/as_number/as_number_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/as_number/as_number_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/label/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/label/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/label/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/label/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/label/label_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/label/label_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/label/label_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/label/label_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/label/label_hop/te_label/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/label/label_hop/te_label/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/label/label_hop/te_label/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/label/label_hop/te_label/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/label/label_hop/te_label/technology/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/label/label_hop/te_label/technology/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/label/label_hop/te_label/technology/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/label/label_hop/te_label/technology/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/label/label_hop/te_label/technology/generic/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/label/label_hop/te_label/technology/generic/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/label/label_hop/te_label/technology/generic/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/label/label_hop/te_label/technology/generic/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/numbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/numbered_link_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/numbered_link_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/numbered_link_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/numbered_link_hop/numbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/numbered_link_hop/numbered_link_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/numbered_link_hop/numbered_link_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/numbered_link_hop/numbered_link_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/numbered_node_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/numbered_node_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/numbered_node_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/numbered_node_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/numbered_node_hop/numbered_node_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/numbered_node_hop/numbered_node_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/numbered_node_hop/numbered_node_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/numbered_node_hop/numbered_node_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/srlg/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/srlg/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/srlg/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/srlg/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/srlg/srlg/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/srlg/srlg/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/srlg/srlg/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/srlg/srlg/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/unnumbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/unnumbered_link_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/unnumbered_link_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/unnumbered_link_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/unnumbered_link_hop/unnumbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/unnumbered_link_hop/unnumbered_link_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/unnumbered_link_hop/unnumbered_link_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/unnumbered_link_hop/unnumbered_link_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/as_number/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/as_number/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/as_number/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/as_number/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/as_number/as_number_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/as_number/as_number_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/as_number/as_number_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/as_number/as_number_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/label/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/label/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/label/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/label/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/label/label_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/label/label_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/label/label_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/label/label_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/label/label_hop/te_label/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/label/label_hop/te_label/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/label/label_hop/te_label/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/label/label_hop/te_label/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/label/label_hop/te_label/technology/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/label/label_hop/te_label/technology/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/label/label_hop/te_label/technology/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/label/label_hop/te_label/technology/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/label/label_hop/te_label/technology/generic/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/label/label_hop/te_label/technology/generic/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/label/label_hop/te_label/technology/generic/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/label/label_hop/te_label/technology/generic/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/numbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/numbered_link_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/numbered_link_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/numbered_link_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/numbered_link_hop/numbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/numbered_link_hop/numbered_link_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/numbered_link_hop/numbered_link_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/numbered_link_hop/numbered_link_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/numbered_node_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/numbered_node_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/numbered_node_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/numbered_node_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/numbered_node_hop/numbered_node_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/numbered_node_hop/numbered_node_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/numbered_node_hop/numbered_node_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/numbered_node_hop/numbered_node_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/unnumbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/unnumbered_link_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/unnumbered_link_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/unnumbered_link_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/unnumbered_link_hop/unnumbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/unnumbered_link_hop/unnumbered_link_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/unnumbered_link_hop/unnumbered_link_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/unnumbered_link_hop/unnumbered_link_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/algorithm/metric/tiebreakers/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/algorithm/metric/tiebreakers/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/algorithm/metric/tiebreakers/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/algorithm/metric/tiebreakers/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/algorithm/metric/tiebreakers/tiebreaker/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/algorithm/metric/tiebreakers/tiebreaker/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/algorithm/metric/tiebreakers/tiebreaker/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/algorithm/metric/tiebreakers/tiebreaker/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/algorithm/objective_function/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/algorithm/objective_function/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/algorithm/objective_function/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/algorithm/objective_function/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/algorithm/objective_function/objective_function/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/algorithm/objective_function/objective_function/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/algorithm/objective_function/objective_function/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/algorithm/objective_function/objective_function/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/path_affinities_values/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/path_affinities_values/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/path_affinities_values/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/path_affinities_values/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/path_affinities_values/path_affinities_value/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/path_affinities_values/path_affinities_value/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/path_affinities_values/path_affinities_value/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/path_affinities_values/path_affinities_value/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/path_affinity_names/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/path_affinity_names/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/path_affinity_names/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/path_affinity_names/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/path_affinity_names/path_affinity_name/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/path_affinity_names/path_affinity_name/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/path_affinity_names/path_affinity_name/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/path_affinity_names/path_affinity_name/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/path_affinity_names/path_affinity_name/affinity_name/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/path_affinity_names/path_affinity_name/affinity_name/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/path_affinity_names/path_affinity_name/affinity_name/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/path_affinity_names/path_affinity_name/affinity_name/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/path_metric_bounds/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/path_metric_bounds/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/path_metric_bounds/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/path_metric_bounds/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/path_metric_bounds/path_metric_bound/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/path_metric_bounds/path_metric_bound/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/path_metric_bounds/path_metric_bound/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/path_metric_bounds/path_metric_bound/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/path_srlgs_lists/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/path_srlgs_lists/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/path_srlgs_lists/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/path_srlgs_lists/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/path_srlgs_lists/path_srlgs_list/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/path_srlgs_lists/path_srlgs_list/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/path_srlgs_lists/path_srlgs_list/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/path_srlgs_lists/path_srlgs_list/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/path_srlgs_names/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/path_srlgs_names/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/path_srlgs_names/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/path_srlgs_names/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/path_srlgs_names/path_srlgs_name/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/path_srlgs_names/path_srlgs_name/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/path_srlgs_names/path_srlgs_name/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/path_srlgs_names/path_srlgs_name/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/te_bandwidth/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/te_bandwidth/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/te_bandwidth/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/te_bandwidth/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/te_bandwidth/technology/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/te_bandwidth/technology/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/te_bandwidth/technology/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/te_bandwidth/technology/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/te_bandwidth/technology/generic/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/te_bandwidth/technology/generic/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/te_bandwidth/technology/generic/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/te_bandwidth/technology/generic/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_affinities_values/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_affinities_values/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_affinities_values/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_affinities_values/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_affinities_values/path_affinities_value/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_affinities_values/path_affinities_value/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_affinities_values/path_affinities_value/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_affinities_values/path_affinities_value/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_affinity_names/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_affinity_names/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_affinity_names/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_affinity_names/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_affinity_names/path_affinity_name/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_affinity_names/path_affinity_name/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_affinity_names/path_affinity_name/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_affinity_names/path_affinity_name/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_affinity_names/path_affinity_name/affinity_name/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_affinity_names/path_affinity_name/affinity_name/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_affinity_names/path_affinity_name/affinity_name/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_affinity_names/path_affinity_name/affinity_name/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_metric/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_metric/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_metric/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_metric/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_route_objects/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_route_objects/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_route_objects/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_route_objects/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_route_objects/path_route_object/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_route_objects/path_route_object/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_route_objects/path_route_object/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_route_objects/path_route_object/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_route_objects/path_route_object/type/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_route_objects/path_route_object/type/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_route_objects/path_route_object/type/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_route_objects/path_route_object/type/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_route_objects/path_route_object/type/as_number/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_route_objects/path_route_object/type/as_number/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_route_objects/path_route_object/type/as_number/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_route_objects/path_route_object/type/as_number/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_route_objects/path_route_object/type/as_number/as_number_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_route_objects/path_route_object/type/as_number/as_number_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_route_objects/path_route_object/type/as_number/as_number_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_route_objects/path_route_object/type/as_number/as_number_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_route_objects/path_route_object/type/label/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_route_objects/path_route_object/type/label/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_route_objects/path_route_object/type/label/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_route_objects/path_route_object/type/label/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_route_objects/path_route_object/type/label/label_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_route_objects/path_route_object/type/label/label_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_route_objects/path_route_object/type/label/label_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_route_objects/path_route_object/type/label/label_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_route_objects/path_route_object/type/label/label_hop/te_label/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_route_objects/path_route_object/type/label/label_hop/te_label/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_route_objects/path_route_object/type/label/label_hop/te_label/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_route_objects/path_route_object/type/label/label_hop/te_label/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_route_objects/path_route_object/type/label/label_hop/te_label/technology/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_route_objects/path_route_object/type/label/label_hop/te_label/technology/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_route_objects/path_route_object/type/label/label_hop/te_label/technology/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_route_objects/path_route_object/type/label/label_hop/te_label/technology/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_route_objects/path_route_object/type/label/label_hop/te_label/technology/generic/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_route_objects/path_route_object/type/label/label_hop/te_label/technology/generic/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_route_objects/path_route_object/type/label/label_hop/te_label/technology/generic/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_route_objects/path_route_object/type/label/label_hop/te_label/technology/generic/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_route_objects/path_route_object/type/numbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_route_objects/path_route_object/type/numbered_link_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_route_objects/path_route_object/type/numbered_link_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_route_objects/path_route_object/type/numbered_link_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_route_objects/path_route_object/type/numbered_link_hop/numbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_route_objects/path_route_object/type/numbered_link_hop/numbered_link_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_route_objects/path_route_object/type/numbered_link_hop/numbered_link_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_route_objects/path_route_object/type/numbered_link_hop/numbered_link_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_route_objects/path_route_object/type/numbered_node_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_route_objects/path_route_object/type/numbered_node_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_route_objects/path_route_object/type/numbered_node_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_route_objects/path_route_object/type/numbered_node_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_route_objects/path_route_object/type/numbered_node_hop/numbered_node_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_route_objects/path_route_object/type/numbered_node_hop/numbered_node_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_route_objects/path_route_object/type/numbered_node_hop/numbered_node_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_route_objects/path_route_object/type/numbered_node_hop/numbered_node_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_route_objects/path_route_object/type/unnumbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_route_objects/path_route_object/type/unnumbered_link_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_route_objects/path_route_object/type/unnumbered_link_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_route_objects/path_route_object/type/unnumbered_link_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_route_objects/path_route_object/type/unnumbered_link_hop/unnumbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_route_objects/path_route_object/type/unnumbered_link_hop/unnumbered_link_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_route_objects/path_route_object/type/unnumbered_link_hop/unnumbered_link_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_route_objects/path_route_object/type/unnumbered_link_hop/unnumbered_link_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_srlgs_lists/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_srlgs_lists/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_srlgs_lists/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_srlgs_lists/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_srlgs_lists/path_srlgs_list/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_srlgs_lists/path_srlgs_list/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_srlgs_lists/path_srlgs_list/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_srlgs_lists/path_srlgs_list/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_srlgs_names/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_srlgs_names/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_srlgs_names/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_srlgs_names/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_srlgs_names/path_srlgs_name/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_srlgs_names/path_srlgs_name/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_srlgs_names/path_srlgs_name/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_srlgs_names/path_srlgs_name/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/backup_path/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/backup_path/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/backup_path/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/backup_path/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/backup_path/path_element/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/backup_path/path_element/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/backup_path/path_element/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/backup_path/path_element/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/backup_path/path_element/type/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/backup_path/path_element/type/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/backup_path/path_element/type/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/backup_path/path_element/type/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/backup_path/path_element/type/as_number/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/backup_path/path_element/type/as_number/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/backup_path/path_element/type/as_number/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/backup_path/path_element/type/as_number/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/backup_path/path_element/type/as_number/as_number_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/backup_path/path_element/type/as_number/as_number_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/backup_path/path_element/type/as_number/as_number_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/backup_path/path_element/type/as_number/as_number_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/backup_path/path_element/type/label/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/backup_path/path_element/type/label/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/backup_path/path_element/type/label/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/backup_path/path_element/type/label/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/backup_path/path_element/type/label/label_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/backup_path/path_element/type/label/label_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/backup_path/path_element/type/label/label_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/backup_path/path_element/type/label/label_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/backup_path/path_element/type/label/label_hop/te_label/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/backup_path/path_element/type/label/label_hop/te_label/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/backup_path/path_element/type/label/label_hop/te_label/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/backup_path/path_element/type/label/label_hop/te_label/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/backup_path/path_element/type/label/label_hop/te_label/technology/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/backup_path/path_element/type/label/label_hop/te_label/technology/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/backup_path/path_element/type/label/label_hop/te_label/technology/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/backup_path/path_element/type/label/label_hop/te_label/technology/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/backup_path/path_element/type/label/label_hop/te_label/technology/generic/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/backup_path/path_element/type/label/label_hop/te_label/technology/generic/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/backup_path/path_element/type/label/label_hop/te_label/technology/generic/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/backup_path/path_element/type/label/label_hop/te_label/technology/generic/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/backup_path/path_element/type/numbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/backup_path/path_element/type/numbered_link_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/backup_path/path_element/type/numbered_link_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/backup_path/path_element/type/numbered_link_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/backup_path/path_element/type/numbered_link_hop/numbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/backup_path/path_element/type/numbered_link_hop/numbered_link_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/backup_path/path_element/type/numbered_link_hop/numbered_link_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/backup_path/path_element/type/numbered_link_hop/numbered_link_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/backup_path/path_element/type/numbered_node_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/backup_path/path_element/type/numbered_node_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/backup_path/path_element/type/numbered_node_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/backup_path/path_element/type/numbered_node_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/backup_path/path_element/type/numbered_node_hop/numbered_node_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/backup_path/path_element/type/numbered_node_hop/numbered_node_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/backup_path/path_element/type/numbered_node_hop/numbered_node_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/backup_path/path_element/type/numbered_node_hop/numbered_node_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/backup_path/path_element/type/unnumbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/backup_path/path_element/type/unnumbered_link_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/backup_path/path_element/type/unnumbered_link_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/backup_path/path_element/type/unnumbered_link_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/backup_path/path_element/type/unnumbered_link_hop/unnumbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/backup_path/path_element/type/unnumbered_link_hop/unnumbered_link_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/backup_path/path_element/type/unnumbered_link_hop/unnumbered_link_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/backup_path/path_element/type/unnumbered_link_hop/unnumbered_link_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/primary_path/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/primary_path/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/primary_path/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/primary_path/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/primary_path/path_element/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/primary_path/path_element/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/primary_path/path_element/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/primary_path/path_element/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/primary_path/path_element/type/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/primary_path/path_element/type/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/primary_path/path_element/type/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/primary_path/path_element/type/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/primary_path/path_element/type/as_number/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/primary_path/path_element/type/as_number/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/primary_path/path_element/type/as_number/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/primary_path/path_element/type/as_number/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/primary_path/path_element/type/as_number/as_number_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/primary_path/path_element/type/as_number/as_number_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/primary_path/path_element/type/as_number/as_number_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/primary_path/path_element/type/as_number/as_number_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/primary_path/path_element/type/label/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/primary_path/path_element/type/label/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/primary_path/path_element/type/label/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/primary_path/path_element/type/label/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/primary_path/path_element/type/label/label_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/primary_path/path_element/type/label/label_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/primary_path/path_element/type/label/label_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/primary_path/path_element/type/label/label_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/primary_path/path_element/type/label/label_hop/te_label/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/primary_path/path_element/type/label/label_hop/te_label/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/primary_path/path_element/type/label/label_hop/te_label/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/primary_path/path_element/type/label/label_hop/te_label/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/primary_path/path_element/type/label/label_hop/te_label/technology/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/primary_path/path_element/type/label/label_hop/te_label/technology/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/primary_path/path_element/type/label/label_hop/te_label/technology/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/primary_path/path_element/type/label/label_hop/te_label/technology/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/primary_path/path_element/type/label/label_hop/te_label/technology/generic/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/primary_path/path_element/type/label/label_hop/te_label/technology/generic/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/primary_path/path_element/type/label/label_hop/te_label/technology/generic/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/primary_path/path_element/type/label/label_hop/te_label/technology/generic/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/primary_path/path_element/type/numbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/primary_path/path_element/type/numbered_link_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/primary_path/path_element/type/numbered_link_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/primary_path/path_element/type/numbered_link_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/primary_path/path_element/type/numbered_link_hop/numbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/primary_path/path_element/type/numbered_link_hop/numbered_link_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/primary_path/path_element/type/numbered_link_hop/numbered_link_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/primary_path/path_element/type/numbered_link_hop/numbered_link_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/primary_path/path_element/type/numbered_node_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/primary_path/path_element/type/numbered_node_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/primary_path/path_element/type/numbered_node_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/primary_path/path_element/type/numbered_node_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/primary_path/path_element/type/numbered_node_hop/numbered_node_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/primary_path/path_element/type/numbered_node_hop/numbered_node_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/primary_path/path_element/type/numbered_node_hop/numbered_node_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/primary_path/path_element/type/numbered_node_hop/numbered_node_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/primary_path/path_element/type/unnumbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/primary_path/path_element/type/unnumbered_link_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/primary_path/path_element/type/unnumbered_link_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/primary_path/path_element/type/unnumbered_link_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/primary_path/path_element/type/unnumbered_link_hop/unnumbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/primary_path/path_element/type/unnumbered_link_hop/unnumbered_link_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/primary_path/path_element/type/unnumbered_link_hop/unnumbered_link_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/primary_path/path_element/type/unnumbered_link_hop/unnumbered_link_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/tunnel_termination_points/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/tunnel_termination_points/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/tunnel_termination_points/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/tunnel_termination_points/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/tunnels/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/tunnels/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/tunnels/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/tunnels/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/tunnels/tunnel/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/tunnels/tunnel/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/tunnels/tunnel/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/tunnels/tunnel/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/information_source_state/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/information_source_state/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/information_source_state/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/information_source_state/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/information_source_state/topology/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/information_source_state/topology/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/information_source_state/topology/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/information_source_state/topology/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/underlay_topology/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/underlay_topology/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/underlay_topology/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_entry/underlay_topology/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_state/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_state/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_state/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_state/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_state/topology/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_state/topology/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_state/topology/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/information_source_state/topology/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/statistics/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/statistics/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/statistics/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/statistics/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/statistics/connectivity_matrix_entry/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/statistics/connectivity_matrix_entry/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/statistics/connectivity_matrix_entry/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/statistics/connectivity_matrix_entry/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/statistics/node/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/statistics/node/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/statistics/node/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/statistics/node/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from/label_restrictions/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from/label_restrictions/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from/label_restrictions/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from/label_restrictions/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/label_end/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/label_end/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/label_end/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/label_end/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/label_end/te_label/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/label_end/te_label/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/label_end/te_label/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/label_end/te_label/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/label_end/te_label/technology/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/label_end/te_label/technology/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/label_end/te_label/technology/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/label_end/te_label/technology/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/label_end/te_label/technology/generic/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/label_end/te_label/technology/generic/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/label_end/te_label/technology/generic/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/label_end/te_label/technology/generic/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/label_start/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/label_start/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/label_start/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/label_start/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/label_start/te_label/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/label_start/te_label/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/label_start/te_label/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/label_start/te_label/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/label_start/te_label/technology/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/label_start/te_label/technology/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/label_start/te_label/technology/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/label_start/te_label/technology/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/label_start/te_label/technology/generic/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/label_start/te_label/technology/generic/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/label_start/te_label/technology/generic/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/label_start/te_label/technology/generic/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/label_step/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/label_step/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/label_step/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/label_step/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/label_step/technology/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/label_step/technology/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/label_step/technology/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/label_step/technology/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/label_step/technology/generic/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/label_step/technology/generic/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/label_step/technology/generic/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/label_step/technology/generic/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/algorithm/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/algorithm/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/algorithm/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/algorithm/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/as_number/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/as_number/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/as_number/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/as_number/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/as_number/as_number_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/as_number/as_number_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/as_number/as_number_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/as_number/as_number_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/label/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/label/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/label/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/label/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/label/label_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/label/label_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/label/label_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/label/label_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/label/label_hop/te_label/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/label/label_hop/te_label/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/label/label_hop/te_label/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/label/label_hop/te_label/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/label/label_hop/te_label/technology/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/label/label_hop/te_label/technology/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/label/label_hop/te_label/technology/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/label/label_hop/te_label/technology/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/label/label_hop/te_label/technology/generic/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/label/label_hop/te_label/technology/generic/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/label/label_hop/te_label/technology/generic/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/label/label_hop/te_label/technology/generic/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/numbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/numbered_link_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/numbered_link_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/numbered_link_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/numbered_link_hop/numbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/numbered_link_hop/numbered_link_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/numbered_link_hop/numbered_link_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/numbered_link_hop/numbered_link_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/numbered_node_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/numbered_node_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/numbered_node_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/numbered_node_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/numbered_node_hop/numbered_node_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/numbered_node_hop/numbered_node_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/numbered_node_hop/numbered_node_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/numbered_node_hop/numbered_node_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/srlg/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/srlg/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/srlg/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/srlg/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/srlg/srlg/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/srlg/srlg/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/srlg/srlg/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/srlg/srlg/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/unnumbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/unnumbered_link_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/unnumbered_link_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/unnumbered_link_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/unnumbered_link_hop/unnumbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/unnumbered_link_hop/unnumbered_link_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/unnumbered_link_hop/unnumbered_link_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/unnumbered_link_hop/unnumbered_link_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/as_number/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/as_number/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/as_number/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/as_number/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/as_number/as_number_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/as_number/as_number_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/as_number/as_number_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/as_number/as_number_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/label/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/label/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/label/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/label/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/label/label_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/label/label_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/label/label_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/label/label_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/label/label_hop/te_label/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/label/label_hop/te_label/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/label/label_hop/te_label/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/label/label_hop/te_label/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/label/label_hop/te_label/technology/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/label/label_hop/te_label/technology/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/label/label_hop/te_label/technology/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/label/label_hop/te_label/technology/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/label/label_hop/te_label/technology/generic/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/label/label_hop/te_label/technology/generic/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/label/label_hop/te_label/technology/generic/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/label/label_hop/te_label/technology/generic/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/numbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/numbered_link_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/numbered_link_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/numbered_link_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/numbered_link_hop/numbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/numbered_link_hop/numbered_link_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/numbered_link_hop/numbered_link_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/numbered_link_hop/numbered_link_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/numbered_node_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/numbered_node_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/numbered_node_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/numbered_node_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/numbered_node_hop/numbered_node_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/numbered_node_hop/numbered_node_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/numbered_node_hop/numbered_node_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/numbered_node_hop/numbered_node_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/unnumbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/unnumbered_link_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/unnumbered_link_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/unnumbered_link_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/unnumbered_link_hop/unnumbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/unnumbered_link_hop/unnumbered_link_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/unnumbered_link_hop/unnumbered_link_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/unnumbered_link_hop/unnumbered_link_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/tiebreakers/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/tiebreakers/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/tiebreakers/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/tiebreakers/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/tiebreakers/tiebreaker/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/tiebreakers/tiebreaker/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/tiebreakers/tiebreaker/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/algorithm/metric/tiebreakers/tiebreaker/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/algorithm/objective_function/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/algorithm/objective_function/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/algorithm/objective_function/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/algorithm/objective_function/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/algorithm/objective_function/objective_function/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/algorithm/objective_function/objective_function/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/algorithm/objective_function/objective_function/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/algorithm/objective_function/objective_function/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/path_affinities_values/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/path_affinities_values/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/path_affinities_values/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/path_affinities_values/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/path_affinities_values/path_affinities_value/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/path_affinities_values/path_affinities_value/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/path_affinities_values/path_affinities_value/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/path_affinities_values/path_affinities_value/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/path_affinity_names/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/path_affinity_names/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/path_affinity_names/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/path_affinity_names/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/path_affinity_names/path_affinity_name/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/path_affinity_names/path_affinity_name/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/path_affinity_names/path_affinity_name/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/path_affinity_names/path_affinity_name/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/path_affinity_names/path_affinity_name/affinity_name/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/path_affinity_names/path_affinity_name/affinity_name/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/path_affinity_names/path_affinity_name/affinity_name/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/path_affinity_names/path_affinity_name/affinity_name/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/path_metric_bounds/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/path_metric_bounds/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/path_metric_bounds/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/path_metric_bounds/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/path_metric_bounds/path_metric_bound/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/path_metric_bounds/path_metric_bound/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/path_metric_bounds/path_metric_bound/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/path_metric_bounds/path_metric_bound/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/path_srlgs_lists/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/path_srlgs_lists/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/path_srlgs_lists/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/path_srlgs_lists/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/path_srlgs_lists/path_srlgs_list/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/path_srlgs_lists/path_srlgs_list/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/path_srlgs_lists/path_srlgs_list/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/path_srlgs_lists/path_srlgs_list/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/path_srlgs_names/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/path_srlgs_names/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/path_srlgs_names/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/path_srlgs_names/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/path_srlgs_names/path_srlgs_name/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/path_srlgs_names/path_srlgs_name/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/path_srlgs_names/path_srlgs_name/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/path_srlgs_names/path_srlgs_name/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/te_bandwidth/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/te_bandwidth/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/te_bandwidth/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/te_bandwidth/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/te_bandwidth/technology/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/te_bandwidth/technology/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/te_bandwidth/technology/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/te_bandwidth/technology/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/te_bandwidth/technology/generic/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/te_bandwidth/technology/generic/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/te_bandwidth/technology/generic/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/te_bandwidth/technology/generic/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_affinities_values/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_affinities_values/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_affinities_values/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_affinities_values/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_affinities_values/path_affinities_value/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_affinities_values/path_affinities_value/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_affinities_values/path_affinities_value/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_affinities_values/path_affinities_value/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_affinity_names/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_affinity_names/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_affinity_names/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_affinity_names/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_affinity_names/path_affinity_name/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_affinity_names/path_affinity_name/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_affinity_names/path_affinity_name/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_affinity_names/path_affinity_name/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_affinity_names/path_affinity_name/affinity_name/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_affinity_names/path_affinity_name/affinity_name/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_affinity_names/path_affinity_name/affinity_name/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_affinity_names/path_affinity_name/affinity_name/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_metric/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_metric/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_metric/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_metric/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/type/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/type/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/type/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/type/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/type/as_number/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/type/as_number/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/type/as_number/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/type/as_number/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/type/as_number/as_number_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/type/as_number/as_number_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/type/as_number/as_number_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/type/as_number/as_number_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/type/label/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/type/label/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/type/label/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/type/label/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/type/label/label_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/type/label/label_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/type/label/label_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/type/label/label_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/type/label/label_hop/te_label/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/type/label/label_hop/te_label/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/type/label/label_hop/te_label/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/type/label/label_hop/te_label/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/type/label/label_hop/te_label/technology/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/type/label/label_hop/te_label/technology/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/type/label/label_hop/te_label/technology/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/type/label/label_hop/te_label/technology/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/type/label/label_hop/te_label/technology/generic/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/type/label/label_hop/te_label/technology/generic/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/type/label/label_hop/te_label/technology/generic/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/type/label/label_hop/te_label/technology/generic/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/type/numbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/type/numbered_link_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/type/numbered_link_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/type/numbered_link_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/type/numbered_link_hop/numbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/type/numbered_link_hop/numbered_link_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/type/numbered_link_hop/numbered_link_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/type/numbered_link_hop/numbered_link_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/type/numbered_node_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/type/numbered_node_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/type/numbered_node_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/type/numbered_node_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/type/numbered_node_hop/numbered_node_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/type/numbered_node_hop/numbered_node_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/type/numbered_node_hop/numbered_node_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/type/numbered_node_hop/numbered_node_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/type/unnumbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/type/unnumbered_link_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/type/unnumbered_link_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/type/unnumbered_link_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/type/unnumbered_link_hop/unnumbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/type/unnumbered_link_hop/unnumbered_link_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/type/unnumbered_link_hop/unnumbered_link_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/type/unnumbered_link_hop/unnumbered_link_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_srlgs_lists/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_srlgs_lists/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_srlgs_lists/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_srlgs_lists/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_srlgs_lists/path_srlgs_list/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_srlgs_lists/path_srlgs_list/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_srlgs_lists/path_srlgs_list/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_srlgs_lists/path_srlgs_list/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_srlgs_names/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_srlgs_names/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_srlgs_names/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_srlgs_names/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_srlgs_names/path_srlgs_name/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_srlgs_names/path_srlgs_name/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_srlgs_names/path_srlgs_name/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_srlgs_names/path_srlgs_name/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_end/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_end/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_end/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_end/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_end/te_label/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_end/te_label/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_end/te_label/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_end/te_label/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_end/te_label/technology/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_end/te_label/technology/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_end/te_label/technology/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_end/te_label/technology/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_end/te_label/technology/generic/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_end/te_label/technology/generic/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_end/te_label/technology/generic/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_end/te_label/technology/generic/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_start/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_start/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_start/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_start/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_start/te_label/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_start/te_label/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_start/te_label/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_start/te_label/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_start/te_label/technology/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_start/te_label/technology/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_start/te_label/technology/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_start/te_label/technology/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_start/te_label/technology/generic/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_start/te_label/technology/generic/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_start/te_label/technology/generic/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_start/te_label/technology/generic/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_step/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_step/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_step/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_step/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_step/technology/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_step/technology/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_step/technology/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_step/technology/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_step/technology/generic/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_step/technology/generic/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_step/technology/generic/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_step/technology/generic/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/backup_path/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/backup_path/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/backup_path/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/backup_path/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/type/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/type/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/type/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/type/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/type/as_number/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/type/as_number/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/type/as_number/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/type/as_number/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/type/as_number/as_number_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/type/as_number/as_number_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/type/as_number/as_number_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/type/as_number/as_number_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/type/label/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/type/label/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/type/label/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/type/label/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/type/label/label_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/type/label/label_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/type/label/label_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/type/label/label_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/type/label/label_hop/te_label/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/type/label/label_hop/te_label/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/type/label/label_hop/te_label/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/type/label/label_hop/te_label/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/type/label/label_hop/te_label/technology/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/type/label/label_hop/te_label/technology/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/type/label/label_hop/te_label/technology/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/type/label/label_hop/te_label/technology/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/type/label/label_hop/te_label/technology/generic/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/type/label/label_hop/te_label/technology/generic/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/type/label/label_hop/te_label/technology/generic/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/type/label/label_hop/te_label/technology/generic/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/type/numbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/type/numbered_link_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/type/numbered_link_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/type/numbered_link_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/type/numbered_link_hop/numbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/type/numbered_link_hop/numbered_link_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/type/numbered_link_hop/numbered_link_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/type/numbered_link_hop/numbered_link_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/type/numbered_node_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/type/numbered_node_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/type/numbered_node_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/type/numbered_node_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/type/numbered_node_hop/numbered_node_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/type/numbered_node_hop/numbered_node_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/type/numbered_node_hop/numbered_node_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/type/numbered_node_hop/numbered_node_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/type/unnumbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/type/unnumbered_link_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/type/unnumbered_link_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/type/unnumbered_link_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/type/unnumbered_link_hop/unnumbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/type/unnumbered_link_hop/unnumbered_link_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/type/unnumbered_link_hop/unnumbered_link_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/type/unnumbered_link_hop/unnumbered_link_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/primary_path/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/primary_path/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/primary_path/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/primary_path/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/type/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/type/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/type/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/type/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/type/as_number/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/type/as_number/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/type/as_number/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/type/as_number/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/type/as_number/as_number_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/type/as_number/as_number_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/type/as_number/as_number_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/type/as_number/as_number_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/type/label/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/type/label/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/type/label/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/type/label/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/type/label/label_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/type/label/label_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/type/label/label_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/type/label/label_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/type/label/label_hop/te_label/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/type/label/label_hop/te_label/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/type/label/label_hop/te_label/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/type/label/label_hop/te_label/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/type/label/label_hop/te_label/technology/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/type/label/label_hop/te_label/technology/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/type/label/label_hop/te_label/technology/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/type/label/label_hop/te_label/technology/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/type/label/label_hop/te_label/technology/generic/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/type/label/label_hop/te_label/technology/generic/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/type/label/label_hop/te_label/technology/generic/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/type/label/label_hop/te_label/technology/generic/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/type/numbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/type/numbered_link_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/type/numbered_link_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/type/numbered_link_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/type/numbered_link_hop/numbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/type/numbered_link_hop/numbered_link_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/type/numbered_link_hop/numbered_link_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/type/numbered_link_hop/numbered_link_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/type/numbered_node_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/type/numbered_node_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/type/numbered_node_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/type/numbered_node_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/type/numbered_node_hop/numbered_node_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/type/numbered_node_hop/numbered_node_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/type/numbered_node_hop/numbered_node_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/type/numbered_node_hop/numbered_node_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/type/unnumbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/type/unnumbered_link_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/type/unnumbered_link_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/type/unnumbered_link_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/type/unnumbered_link_hop/unnumbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/type/unnumbered_link_hop/unnumbered_link_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/type/unnumbered_link_hop/unnumbered_link_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/type/unnumbered_link_hop/unnumbered_link_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/tunnel_termination_points/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/tunnel_termination_points/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/tunnel_termination_points/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/tunnel_termination_points/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/tunnels/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/tunnels/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/tunnels/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/tunnels/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/tunnels/tunnel/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/tunnels/tunnel/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/tunnels/tunnel/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/tunnels/tunnel/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/label_restriction/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/label_restriction/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/label_restriction/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/label_restriction/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/label_restriction/label_end/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/label_restriction/label_end/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/label_restriction/label_end/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/label_restriction/label_end/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/label_restriction/label_end/te_label/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/label_restriction/label_end/te_label/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/label_restriction/label_end/te_label/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/label_restriction/label_end/te_label/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/label_restriction/label_end/te_label/technology/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/label_restriction/label_end/te_label/technology/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/label_restriction/label_end/te_label/technology/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/label_restriction/label_end/te_label/technology/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/label_restriction/label_end/te_label/technology/generic/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/label_restriction/label_end/te_label/technology/generic/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/label_restriction/label_end/te_label/technology/generic/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/label_restriction/label_end/te_label/technology/generic/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/label_restriction/label_start/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/label_restriction/label_start/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/label_restriction/label_start/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/label_restriction/label_start/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/label_restriction/label_start/te_label/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/label_restriction/label_start/te_label/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/label_restriction/label_start/te_label/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/label_restriction/label_start/te_label/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/label_restriction/label_start/te_label/technology/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/label_restriction/label_start/te_label/technology/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/label_restriction/label_start/te_label/technology/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/label_restriction/label_start/te_label/technology/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/label_restriction/label_start/te_label/technology/generic/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/label_restriction/label_start/te_label/technology/generic/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/label_restriction/label_start/te_label/technology/generic/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/label_restriction/label_start/te_label/technology/generic/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/label_restriction/label_step/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/label_restriction/label_step/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/label_restriction/label_step/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/label_restriction/label_step/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/label_restriction/label_step/technology/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/label_restriction/label_step/technology/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/label_restriction/label_step/technology/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/label_restriction/label_step/technology/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/label_restriction/label_step/technology/generic/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/label_restriction/label_step/technology/generic/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/label_restriction/label_step/technology/generic/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/label_restriction/label_step/technology/generic/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/algorithm/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/algorithm/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/algorithm/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/algorithm/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/algorithm/metric/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/algorithm/metric/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/algorithm/metric/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/algorithm/metric/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/as_number/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/as_number/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/as_number/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/as_number/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/as_number/as_number_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/as_number/as_number_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/as_number/as_number_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/as_number/as_number_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/label/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/label/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/label/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/label/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/label/label_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/label/label_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/label/label_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/label/label_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/label/label_hop/te_label/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/label/label_hop/te_label/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/label/label_hop/te_label/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/label/label_hop/te_label/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/label/label_hop/te_label/technology/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/label/label_hop/te_label/technology/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/label/label_hop/te_label/technology/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/label/label_hop/te_label/technology/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/label/label_hop/te_label/technology/generic/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/label/label_hop/te_label/technology/generic/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/label/label_hop/te_label/technology/generic/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/label/label_hop/te_label/technology/generic/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/numbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/numbered_link_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/numbered_link_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/numbered_link_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/numbered_link_hop/numbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/numbered_link_hop/numbered_link_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/numbered_link_hop/numbered_link_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/numbered_link_hop/numbered_link_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/numbered_node_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/numbered_node_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/numbered_node_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/numbered_node_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/numbered_node_hop/numbered_node_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/numbered_node_hop/numbered_node_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/numbered_node_hop/numbered_node_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/numbered_node_hop/numbered_node_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/srlg/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/srlg/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/srlg/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/srlg/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/srlg/srlg/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/srlg/srlg/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/srlg/srlg/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/srlg/srlg/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/unnumbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/unnumbered_link_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/unnumbered_link_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/unnumbered_link_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/unnumbered_link_hop/unnumbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/unnumbered_link_hop/unnumbered_link_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/unnumbered_link_hop/unnumbered_link_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/unnumbered_link_hop/unnumbered_link_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/as_number/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/as_number/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/as_number/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/as_number/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/as_number/as_number_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/as_number/as_number_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/as_number/as_number_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/as_number/as_number_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/label/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/label/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/label/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/label/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/label/label_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/label/label_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/label/label_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/label/label_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/label/label_hop/te_label/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/label/label_hop/te_label/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/label/label_hop/te_label/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/label/label_hop/te_label/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/label/label_hop/te_label/technology/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/label/label_hop/te_label/technology/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/label/label_hop/te_label/technology/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/label/label_hop/te_label/technology/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/label/label_hop/te_label/technology/generic/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/label/label_hop/te_label/technology/generic/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/label/label_hop/te_label/technology/generic/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/label/label_hop/te_label/technology/generic/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/numbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/numbered_link_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/numbered_link_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/numbered_link_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/numbered_link_hop/numbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/numbered_link_hop/numbered_link_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/numbered_link_hop/numbered_link_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/numbered_link_hop/numbered_link_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/numbered_node_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/numbered_node_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/numbered_node_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/numbered_node_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/numbered_node_hop/numbered_node_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/numbered_node_hop/numbered_node_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/numbered_node_hop/numbered_node_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/numbered_node_hop/numbered_node_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/unnumbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/unnumbered_link_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/unnumbered_link_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/unnumbered_link_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/unnumbered_link_hop/unnumbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/unnumbered_link_hop/unnumbered_link_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/unnumbered_link_hop/unnumbered_link_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/unnumbered_link_hop/unnumbered_link_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/algorithm/metric/tiebreakers/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/algorithm/metric/tiebreakers/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/algorithm/metric/tiebreakers/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/algorithm/metric/tiebreakers/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/algorithm/metric/tiebreakers/tiebreaker/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/algorithm/metric/tiebreakers/tiebreaker/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/algorithm/metric/tiebreakers/tiebreaker/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/algorithm/metric/tiebreakers/tiebreaker/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/algorithm/objective_function/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/algorithm/objective_function/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/algorithm/objective_function/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/algorithm/objective_function/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/algorithm/objective_function/objective_function/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/algorithm/objective_function/objective_function/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/algorithm/objective_function/objective_function/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/algorithm/objective_function/objective_function/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/path_affinities_values/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/path_affinities_values/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/path_affinities_values/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/path_affinities_values/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/path_affinities_values/path_affinities_value/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/path_affinities_values/path_affinities_value/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/path_affinities_values/path_affinities_value/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/path_affinities_values/path_affinities_value/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/path_affinity_names/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/path_affinity_names/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/path_affinity_names/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/path_affinity_names/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/path_affinity_names/path_affinity_name/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/path_affinity_names/path_affinity_name/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/path_affinity_names/path_affinity_name/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/path_affinity_names/path_affinity_name/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/path_affinity_names/path_affinity_name/affinity_name/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/path_affinity_names/path_affinity_name/affinity_name/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/path_affinity_names/path_affinity_name/affinity_name/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/path_affinity_names/path_affinity_name/affinity_name/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/path_metric_bounds/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/path_metric_bounds/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/path_metric_bounds/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/path_metric_bounds/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/path_metric_bounds/path_metric_bound/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/path_metric_bounds/path_metric_bound/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/path_metric_bounds/path_metric_bound/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/path_metric_bounds/path_metric_bound/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/path_srlgs_lists/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/path_srlgs_lists/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/path_srlgs_lists/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/path_srlgs_lists/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/path_srlgs_lists/path_srlgs_list/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/path_srlgs_lists/path_srlgs_list/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/path_srlgs_lists/path_srlgs_list/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/path_srlgs_lists/path_srlgs_list/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/path_srlgs_names/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/path_srlgs_names/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/path_srlgs_names/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/path_srlgs_names/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/path_srlgs_names/path_srlgs_name/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/path_srlgs_names/path_srlgs_name/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/path_srlgs_names/path_srlgs_name/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/path_srlgs_names/path_srlgs_name/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/te_bandwidth/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/te_bandwidth/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/te_bandwidth/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/te_bandwidth/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/te_bandwidth/technology/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/te_bandwidth/technology/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/te_bandwidth/technology/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/te_bandwidth/technology/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/te_bandwidth/technology/generic/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/te_bandwidth/technology/generic/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/te_bandwidth/technology/generic/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/te_bandwidth/technology/generic/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_affinities_values/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_affinities_values/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_affinities_values/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_affinities_values/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_affinities_values/path_affinities_value/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_affinities_values/path_affinities_value/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_affinities_values/path_affinities_value/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_affinities_values/path_affinities_value/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_affinity_names/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_affinity_names/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_affinity_names/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_affinity_names/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_affinity_names/path_affinity_name/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_affinity_names/path_affinity_name/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_affinity_names/path_affinity_name/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_affinity_names/path_affinity_name/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_affinity_names/path_affinity_name/affinity_name/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_affinity_names/path_affinity_name/affinity_name/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_affinity_names/path_affinity_name/affinity_name/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_affinity_names/path_affinity_name/affinity_name/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_metric/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_metric/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_metric/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_metric/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_route_objects/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_route_objects/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_route_objects/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_route_objects/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_route_objects/path_route_object/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_route_objects/path_route_object/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_route_objects/path_route_object/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_route_objects/path_route_object/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_route_objects/path_route_object/type/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_route_objects/path_route_object/type/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_route_objects/path_route_object/type/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_route_objects/path_route_object/type/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_route_objects/path_route_object/type/as_number/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_route_objects/path_route_object/type/as_number/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_route_objects/path_route_object/type/as_number/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_route_objects/path_route_object/type/as_number/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_route_objects/path_route_object/type/as_number/as_number_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_route_objects/path_route_object/type/as_number/as_number_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_route_objects/path_route_object/type/as_number/as_number_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_route_objects/path_route_object/type/as_number/as_number_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_route_objects/path_route_object/type/label/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_route_objects/path_route_object/type/label/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_route_objects/path_route_object/type/label/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_route_objects/path_route_object/type/label/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_route_objects/path_route_object/type/label/label_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_route_objects/path_route_object/type/label/label_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_route_objects/path_route_object/type/label/label_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_route_objects/path_route_object/type/label/label_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_route_objects/path_route_object/type/label/label_hop/te_label/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_route_objects/path_route_object/type/label/label_hop/te_label/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_route_objects/path_route_object/type/label/label_hop/te_label/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_route_objects/path_route_object/type/label/label_hop/te_label/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_route_objects/path_route_object/type/label/label_hop/te_label/technology/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_route_objects/path_route_object/type/label/label_hop/te_label/technology/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_route_objects/path_route_object/type/label/label_hop/te_label/technology/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_route_objects/path_route_object/type/label/label_hop/te_label/technology/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_route_objects/path_route_object/type/label/label_hop/te_label/technology/generic/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_route_objects/path_route_object/type/label/label_hop/te_label/technology/generic/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_route_objects/path_route_object/type/label/label_hop/te_label/technology/generic/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_route_objects/path_route_object/type/label/label_hop/te_label/technology/generic/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_route_objects/path_route_object/type/numbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_route_objects/path_route_object/type/numbered_link_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_route_objects/path_route_object/type/numbered_link_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_route_objects/path_route_object/type/numbered_link_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_route_objects/path_route_object/type/numbered_link_hop/numbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_route_objects/path_route_object/type/numbered_link_hop/numbered_link_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_route_objects/path_route_object/type/numbered_link_hop/numbered_link_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_route_objects/path_route_object/type/numbered_link_hop/numbered_link_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_route_objects/path_route_object/type/numbered_node_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_route_objects/path_route_object/type/numbered_node_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_route_objects/path_route_object/type/numbered_node_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_route_objects/path_route_object/type/numbered_node_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_route_objects/path_route_object/type/numbered_node_hop/numbered_node_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_route_objects/path_route_object/type/numbered_node_hop/numbered_node_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_route_objects/path_route_object/type/numbered_node_hop/numbered_node_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_route_objects/path_route_object/type/numbered_node_hop/numbered_node_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_route_objects/path_route_object/type/unnumbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_route_objects/path_route_object/type/unnumbered_link_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_route_objects/path_route_object/type/unnumbered_link_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_route_objects/path_route_object/type/unnumbered_link_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_route_objects/path_route_object/type/unnumbered_link_hop/unnumbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_route_objects/path_route_object/type/unnumbered_link_hop/unnumbered_link_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_route_objects/path_route_object/type/unnumbered_link_hop/unnumbered_link_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_route_objects/path_route_object/type/unnumbered_link_hop/unnumbered_link_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_srlgs_lists/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_srlgs_lists/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_srlgs_lists/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_srlgs_lists/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_srlgs_lists/path_srlgs_list/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_srlgs_lists/path_srlgs_list/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_srlgs_lists/path_srlgs_list/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_srlgs_lists/path_srlgs_list/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_srlgs_names/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_srlgs_names/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_srlgs_names/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_srlgs_names/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_srlgs_names/path_srlgs_name/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_srlgs_names/path_srlgs_name/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_srlgs_names/path_srlgs_name/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_srlgs_names/path_srlgs_name/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/backup_path/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/backup_path/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/backup_path/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/backup_path/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/backup_path/path_element/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/backup_path/path_element/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/backup_path/path_element/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/backup_path/path_element/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/backup_path/path_element/type/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/backup_path/path_element/type/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/backup_path/path_element/type/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/backup_path/path_element/type/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/backup_path/path_element/type/as_number/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/backup_path/path_element/type/as_number/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/backup_path/path_element/type/as_number/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/backup_path/path_element/type/as_number/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/backup_path/path_element/type/as_number/as_number_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/backup_path/path_element/type/as_number/as_number_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/backup_path/path_element/type/as_number/as_number_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/backup_path/path_element/type/as_number/as_number_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/backup_path/path_element/type/label/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/backup_path/path_element/type/label/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/backup_path/path_element/type/label/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/backup_path/path_element/type/label/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/backup_path/path_element/type/label/label_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/backup_path/path_element/type/label/label_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/backup_path/path_element/type/label/label_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/backup_path/path_element/type/label/label_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/backup_path/path_element/type/label/label_hop/te_label/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/backup_path/path_element/type/label/label_hop/te_label/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/backup_path/path_element/type/label/label_hop/te_label/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/backup_path/path_element/type/label/label_hop/te_label/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/backup_path/path_element/type/label/label_hop/te_label/technology/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/backup_path/path_element/type/label/label_hop/te_label/technology/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/backup_path/path_element/type/label/label_hop/te_label/technology/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/backup_path/path_element/type/label/label_hop/te_label/technology/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/backup_path/path_element/type/label/label_hop/te_label/technology/generic/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/backup_path/path_element/type/label/label_hop/te_label/technology/generic/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/backup_path/path_element/type/label/label_hop/te_label/technology/generic/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/backup_path/path_element/type/label/label_hop/te_label/technology/generic/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/backup_path/path_element/type/numbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/backup_path/path_element/type/numbered_link_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/backup_path/path_element/type/numbered_link_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/backup_path/path_element/type/numbered_link_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/backup_path/path_element/type/numbered_link_hop/numbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/backup_path/path_element/type/numbered_link_hop/numbered_link_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/backup_path/path_element/type/numbered_link_hop/numbered_link_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/backup_path/path_element/type/numbered_link_hop/numbered_link_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/backup_path/path_element/type/numbered_node_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/backup_path/path_element/type/numbered_node_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/backup_path/path_element/type/numbered_node_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/backup_path/path_element/type/numbered_node_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/backup_path/path_element/type/numbered_node_hop/numbered_node_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/backup_path/path_element/type/numbered_node_hop/numbered_node_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/backup_path/path_element/type/numbered_node_hop/numbered_node_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/backup_path/path_element/type/numbered_node_hop/numbered_node_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/backup_path/path_element/type/unnumbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/backup_path/path_element/type/unnumbered_link_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/backup_path/path_element/type/unnumbered_link_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/backup_path/path_element/type/unnumbered_link_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/backup_path/path_element/type/unnumbered_link_hop/unnumbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/backup_path/path_element/type/unnumbered_link_hop/unnumbered_link_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/backup_path/path_element/type/unnumbered_link_hop/unnumbered_link_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/backup_path/path_element/type/unnumbered_link_hop/unnumbered_link_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/primary_path/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/primary_path/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/primary_path/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/primary_path/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/primary_path/path_element/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/primary_path/path_element/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/primary_path/path_element/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/primary_path/path_element/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/primary_path/path_element/type/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/primary_path/path_element/type/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/primary_path/path_element/type/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/primary_path/path_element/type/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/primary_path/path_element/type/as_number/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/primary_path/path_element/type/as_number/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/primary_path/path_element/type/as_number/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/primary_path/path_element/type/as_number/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/primary_path/path_element/type/as_number/as_number_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/primary_path/path_element/type/as_number/as_number_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/primary_path/path_element/type/as_number/as_number_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/primary_path/path_element/type/as_number/as_number_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/primary_path/path_element/type/label/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/primary_path/path_element/type/label/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/primary_path/path_element/type/label/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/primary_path/path_element/type/label/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/primary_path/path_element/type/label/label_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/primary_path/path_element/type/label/label_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/primary_path/path_element/type/label/label_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/primary_path/path_element/type/label/label_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/primary_path/path_element/type/label/label_hop/te_label/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/primary_path/path_element/type/label/label_hop/te_label/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/primary_path/path_element/type/label/label_hop/te_label/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/primary_path/path_element/type/label/label_hop/te_label/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/primary_path/path_element/type/label/label_hop/te_label/technology/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/primary_path/path_element/type/label/label_hop/te_label/technology/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/primary_path/path_element/type/label/label_hop/te_label/technology/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/primary_path/path_element/type/label/label_hop/te_label/technology/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/primary_path/path_element/type/label/label_hop/te_label/technology/generic/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/primary_path/path_element/type/label/label_hop/te_label/technology/generic/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/primary_path/path_element/type/label/label_hop/te_label/technology/generic/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/primary_path/path_element/type/label/label_hop/te_label/technology/generic/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/primary_path/path_element/type/numbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/primary_path/path_element/type/numbered_link_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/primary_path/path_element/type/numbered_link_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/primary_path/path_element/type/numbered_link_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/primary_path/path_element/type/numbered_link_hop/numbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/primary_path/path_element/type/numbered_link_hop/numbered_link_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/primary_path/path_element/type/numbered_link_hop/numbered_link_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/primary_path/path_element/type/numbered_link_hop/numbered_link_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/primary_path/path_element/type/numbered_node_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/primary_path/path_element/type/numbered_node_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/primary_path/path_element/type/numbered_node_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/primary_path/path_element/type/numbered_node_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/primary_path/path_element/type/numbered_node_hop/numbered_node_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/primary_path/path_element/type/numbered_node_hop/numbered_node_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/primary_path/path_element/type/numbered_node_hop/numbered_node_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/primary_path/path_element/type/numbered_node_hop/numbered_node_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/primary_path/path_element/type/unnumbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/primary_path/path_element/type/unnumbered_link_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/primary_path/path_element/type/unnumbered_link_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/primary_path/path_element/type/unnumbered_link_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/primary_path/path_element/type/unnumbered_link_hop/unnumbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/primary_path/path_element/type/unnumbered_link_hop/unnumbered_link_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/primary_path/path_element/type/unnumbered_link_hop/unnumbered_link_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/primary_path/path_element/type/unnumbered_link_hop/unnumbered_link_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/tunnel_termination_points/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/tunnel_termination_points/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/tunnel_termination_points/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/tunnel_termination_points/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/tunnels/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/tunnels/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/tunnels/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/tunnels/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/tunnels/tunnel/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/tunnels/tunnel/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/tunnels/tunnel/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/tunnels/tunnel/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/underlay_topology/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/underlay_topology/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/underlay_topology/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/te_node_attributes/underlay_topology/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/client_layer_adaptation/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/client_layer_adaptation/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/client_layer_adaptation/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/client_layer_adaptation/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/client_layer_adaptation/switching_capability/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/client_layer_adaptation/switching_capability/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/client_layer_adaptation/switching_capability/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/client_layer_adaptation/switching_capability/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/client_layer_adaptation/switching_capability/te_bandwidth/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/client_layer_adaptation/switching_capability/te_bandwidth/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/client_layer_adaptation/switching_capability/te_bandwidth/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/client_layer_adaptation/switching_capability/te_bandwidth/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/client_layer_adaptation/switching_capability/te_bandwidth/technology/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/client_layer_adaptation/switching_capability/te_bandwidth/technology/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/client_layer_adaptation/switching_capability/te_bandwidth/technology/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/client_layer_adaptation/switching_capability/te_bandwidth/technology/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/client_layer_adaptation/switching_capability/te_bandwidth/technology/generic/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/client_layer_adaptation/switching_capability/te_bandwidth/technology/generic/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/client_layer_adaptation/switching_capability/te_bandwidth/technology/generic/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/client_layer_adaptation/switching_capability/te_bandwidth/technology/generic/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/geolocation/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/geolocation/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/geolocation/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/geolocation/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/label_restriction/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/label_restriction/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/label_restriction/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/label_restriction/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/label_restriction/label_end/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/label_restriction/label_end/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/label_restriction/label_end/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/label_restriction/label_end/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/label_restriction/label_end/te_label/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/label_restriction/label_end/te_label/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/label_restriction/label_end/te_label/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/label_restriction/label_end/te_label/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/label_restriction/label_end/te_label/technology/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/label_restriction/label_end/te_label/technology/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/label_restriction/label_end/te_label/technology/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/label_restriction/label_end/te_label/technology/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/label_restriction/label_end/te_label/technology/generic/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/label_restriction/label_end/te_label/technology/generic/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/label_restriction/label_end/te_label/technology/generic/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/label_restriction/label_end/te_label/technology/generic/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/label_restriction/label_start/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/label_restriction/label_start/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/label_restriction/label_start/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/label_restriction/label_start/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/label_restriction/label_start/te_label/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/label_restriction/label_start/te_label/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/label_restriction/label_start/te_label/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/label_restriction/label_start/te_label/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/label_restriction/label_start/te_label/technology/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/label_restriction/label_start/te_label/technology/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/label_restriction/label_start/te_label/technology/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/label_restriction/label_start/te_label/technology/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/label_restriction/label_start/te_label/technology/generic/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/label_restriction/label_start/te_label/technology/generic/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/label_restriction/label_start/te_label/technology/generic/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/label_restriction/label_start/te_label/technology/generic/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/label_restriction/label_step/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/label_restriction/label_step/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/label_restriction/label_step/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/label_restriction/label_step/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/label_restriction/label_step/technology/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/label_restriction/label_step/technology/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/label_restriction/label_step/technology/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/label_restriction/label_step/technology/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/label_restriction/label_step/technology/generic/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/label_restriction/label_step/technology/generic/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/label_restriction/label_step/technology/generic/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/label_restriction/label_step/technology/generic/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/label_restriction/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/label_restriction/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/label_restriction/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/label_restriction/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/label_restriction/label_end/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/label_restriction/label_end/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/label_restriction/label_end/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/label_restriction/label_end/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/label_restriction/label_end/te_label/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/label_restriction/label_end/te_label/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/label_restriction/label_end/te_label/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/label_restriction/label_end/te_label/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/label_restriction/label_end/te_label/technology/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/label_restriction/label_end/te_label/technology/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/label_restriction/label_end/te_label/technology/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/label_restriction/label_end/te_label/technology/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/label_restriction/label_end/te_label/technology/generic/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/label_restriction/label_end/te_label/technology/generic/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/label_restriction/label_end/te_label/technology/generic/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/label_restriction/label_end/te_label/technology/generic/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/label_restriction/label_start/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/label_restriction/label_start/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/label_restriction/label_start/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/label_restriction/label_start/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/label_restriction/label_start/te_label/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/label_restriction/label_start/te_label/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/label_restriction/label_start/te_label/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/label_restriction/label_start/te_label/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/label_restriction/label_start/te_label/technology/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/label_restriction/label_start/te_label/technology/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/label_restriction/label_start/te_label/technology/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/label_restriction/label_start/te_label/technology/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/label_restriction/label_start/te_label/technology/generic/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/label_restriction/label_start/te_label/technology/generic/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/label_restriction/label_start/te_label/technology/generic/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/label_restriction/label_start/te_label/technology/generic/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/label_restriction/label_step/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/label_restriction/label_step/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/label_restriction/label_step/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/label_restriction/label_step/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/label_restriction/label_step/technology/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/label_restriction/label_step/technology/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/label_restriction/label_step/technology/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/label_restriction/label_step/technology/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/label_restriction/label_step/technology/generic/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/label_restriction/label_step/technology/generic/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/label_restriction/label_step/technology/generic/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/label_restriction/label_step/technology/generic/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/algorithm/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/algorithm/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/algorithm/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/algorithm/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/algorithm/metric/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/algorithm/metric/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/algorithm/metric/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/algorithm/metric/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/algorithm/metric/optimization_metric/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/algorithm/metric/optimization_metric/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/algorithm/metric/optimization_metric/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/algorithm/metric/optimization_metric/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/as_number/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/as_number/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/as_number/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/as_number/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/as_number/as_number_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/as_number/as_number_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/as_number/as_number_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/as_number/as_number_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/label/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/label/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/label/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/label/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/label/label_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/label/label_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/label/label_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/label/label_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/label/label_hop/te_label/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/label/label_hop/te_label/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/label/label_hop/te_label/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/label/label_hop/te_label/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/label/label_hop/te_label/technology/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/label/label_hop/te_label/technology/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/label/label_hop/te_label/technology/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/label/label_hop/te_label/technology/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/label/label_hop/te_label/technology/generic/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/label/label_hop/te_label/technology/generic/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/label/label_hop/te_label/technology/generic/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/label/label_hop/te_label/technology/generic/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/numbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/numbered_link_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/numbered_link_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/numbered_link_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/numbered_link_hop/numbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/numbered_link_hop/numbered_link_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/numbered_link_hop/numbered_link_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/numbered_link_hop/numbered_link_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/numbered_node_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/numbered_node_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/numbered_node_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/numbered_node_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/numbered_node_hop/numbered_node_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/numbered_node_hop/numbered_node_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/numbered_node_hop/numbered_node_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/numbered_node_hop/numbered_node_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/srlg/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/srlg/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/srlg/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/srlg/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/srlg/srlg/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/srlg/srlg/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/srlg/srlg/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/srlg/srlg/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/unnumbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/unnumbered_link_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/unnumbered_link_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/unnumbered_link_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/unnumbered_link_hop/unnumbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/unnumbered_link_hop/unnumbered_link_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/unnumbered_link_hop/unnumbered_link_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/unnumbered_link_hop/unnumbered_link_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/as_number/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/as_number/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/as_number/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/as_number/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/as_number/as_number_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/as_number/as_number_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/as_number/as_number_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/as_number/as_number_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/label/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/label/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/label/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/label/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/label/label_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/label/label_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/label/label_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/label/label_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/label/label_hop/te_label/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/label/label_hop/te_label/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/label/label_hop/te_label/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/label/label_hop/te_label/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/label/label_hop/te_label/technology/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/label/label_hop/te_label/technology/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/label/label_hop/te_label/technology/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/label/label_hop/te_label/technology/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/label/label_hop/te_label/technology/generic/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/label/label_hop/te_label/technology/generic/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/label/label_hop/te_label/technology/generic/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/label/label_hop/te_label/technology/generic/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/numbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/numbered_link_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/numbered_link_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/numbered_link_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/numbered_link_hop/numbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/numbered_link_hop/numbered_link_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/numbered_link_hop/numbered_link_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/numbered_link_hop/numbered_link_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/numbered_node_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/numbered_node_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/numbered_node_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/numbered_node_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/numbered_node_hop/numbered_node_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/numbered_node_hop/numbered_node_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/numbered_node_hop/numbered_node_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/numbered_node_hop/numbered_node_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/unnumbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/unnumbered_link_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/unnumbered_link_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/unnumbered_link_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/unnumbered_link_hop/unnumbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/unnumbered_link_hop/unnumbered_link_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/unnumbered_link_hop/unnumbered_link_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/unnumbered_link_hop/unnumbered_link_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/algorithm/metric/tiebreakers/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/algorithm/metric/tiebreakers/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/algorithm/metric/tiebreakers/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/algorithm/metric/tiebreakers/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/algorithm/metric/tiebreakers/tiebreaker/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/algorithm/metric/tiebreakers/tiebreaker/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/algorithm/metric/tiebreakers/tiebreaker/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/algorithm/metric/tiebreakers/tiebreaker/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/algorithm/objective_function/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/algorithm/objective_function/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/algorithm/objective_function/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/algorithm/objective_function/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/algorithm/objective_function/objective_function/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/algorithm/objective_function/objective_function/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/algorithm/objective_function/objective_function/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/algorithm/objective_function/objective_function/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/path_affinities_values/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/path_affinities_values/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/path_affinities_values/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/path_affinities_values/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/path_affinities_values/path_affinities_value/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/path_affinities_values/path_affinities_value/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/path_affinities_values/path_affinities_value/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/path_affinities_values/path_affinities_value/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/path_affinity_names/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/path_affinity_names/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/path_affinity_names/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/path_affinity_names/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/path_affinity_names/path_affinity_name/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/path_affinity_names/path_affinity_name/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/path_affinity_names/path_affinity_name/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/path_affinity_names/path_affinity_name/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/path_affinity_names/path_affinity_name/affinity_name/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/path_affinity_names/path_affinity_name/affinity_name/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/path_affinity_names/path_affinity_name/affinity_name/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/path_affinity_names/path_affinity_name/affinity_name/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/path_metric_bounds/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/path_metric_bounds/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/path_metric_bounds/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/path_metric_bounds/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/path_metric_bounds/path_metric_bound/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/path_metric_bounds/path_metric_bound/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/path_metric_bounds/path_metric_bound/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/path_metric_bounds/path_metric_bound/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/path_srlgs_lists/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/path_srlgs_lists/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/path_srlgs_lists/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/path_srlgs_lists/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/path_srlgs_lists/path_srlgs_list/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/path_srlgs_lists/path_srlgs_list/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/path_srlgs_lists/path_srlgs_list/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/path_srlgs_lists/path_srlgs_list/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/path_srlgs_names/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/path_srlgs_names/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/path_srlgs_names/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/path_srlgs_names/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/path_srlgs_names/path_srlgs_name/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/path_srlgs_names/path_srlgs_name/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/path_srlgs_names/path_srlgs_name/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/path_srlgs_names/path_srlgs_name/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/te_bandwidth/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/te_bandwidth/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/te_bandwidth/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/te_bandwidth/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/te_bandwidth/technology/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/te_bandwidth/technology/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/te_bandwidth/technology/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/te_bandwidth/technology/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/te_bandwidth/technology/generic/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/te_bandwidth/technology/generic/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/te_bandwidth/technology/generic/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/te_bandwidth/technology/generic/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_affinities_values/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_affinities_values/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_affinities_values/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_affinities_values/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_affinities_values/path_affinities_value/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_affinities_values/path_affinities_value/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_affinities_values/path_affinities_value/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_affinities_values/path_affinities_value/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_affinity_names/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_affinity_names/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_affinity_names/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_affinity_names/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_affinity_names/path_affinity_name/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_affinity_names/path_affinity_name/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_affinity_names/path_affinity_name/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_affinity_names/path_affinity_name/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_affinity_names/path_affinity_name/affinity_name/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_affinity_names/path_affinity_name/affinity_name/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_affinity_names/path_affinity_name/affinity_name/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_affinity_names/path_affinity_name/affinity_name/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_metric/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_metric/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_metric/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_metric/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_route_objects/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_route_objects/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_route_objects/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_route_objects/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_route_objects/path_route_object/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_route_objects/path_route_object/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_route_objects/path_route_object/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_route_objects/path_route_object/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_route_objects/path_route_object/type/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_route_objects/path_route_object/type/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_route_objects/path_route_object/type/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_route_objects/path_route_object/type/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_route_objects/path_route_object/type/as_number/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_route_objects/path_route_object/type/as_number/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_route_objects/path_route_object/type/as_number/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_route_objects/path_route_object/type/as_number/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_route_objects/path_route_object/type/as_number/as_number_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_route_objects/path_route_object/type/as_number/as_number_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_route_objects/path_route_object/type/as_number/as_number_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_route_objects/path_route_object/type/as_number/as_number_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_route_objects/path_route_object/type/label/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_route_objects/path_route_object/type/label/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_route_objects/path_route_object/type/label/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_route_objects/path_route_object/type/label/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_route_objects/path_route_object/type/label/label_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_route_objects/path_route_object/type/label/label_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_route_objects/path_route_object/type/label/label_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_route_objects/path_route_object/type/label/label_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_route_objects/path_route_object/type/label/label_hop/te_label/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_route_objects/path_route_object/type/label/label_hop/te_label/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_route_objects/path_route_object/type/label/label_hop/te_label/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_route_objects/path_route_object/type/label/label_hop/te_label/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_route_objects/path_route_object/type/label/label_hop/te_label/technology/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_route_objects/path_route_object/type/label/label_hop/te_label/technology/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_route_objects/path_route_object/type/label/label_hop/te_label/technology/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_route_objects/path_route_object/type/label/label_hop/te_label/technology/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_route_objects/path_route_object/type/label/label_hop/te_label/technology/generic/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_route_objects/path_route_object/type/label/label_hop/te_label/technology/generic/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_route_objects/path_route_object/type/label/label_hop/te_label/technology/generic/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_route_objects/path_route_object/type/label/label_hop/te_label/technology/generic/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_route_objects/path_route_object/type/numbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_route_objects/path_route_object/type/numbered_link_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_route_objects/path_route_object/type/numbered_link_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_route_objects/path_route_object/type/numbered_link_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_route_objects/path_route_object/type/numbered_link_hop/numbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_route_objects/path_route_object/type/numbered_link_hop/numbered_link_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_route_objects/path_route_object/type/numbered_link_hop/numbered_link_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_route_objects/path_route_object/type/numbered_link_hop/numbered_link_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_route_objects/path_route_object/type/numbered_node_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_route_objects/path_route_object/type/numbered_node_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_route_objects/path_route_object/type/numbered_node_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_route_objects/path_route_object/type/numbered_node_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_route_objects/path_route_object/type/numbered_node_hop/numbered_node_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_route_objects/path_route_object/type/numbered_node_hop/numbered_node_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_route_objects/path_route_object/type/numbered_node_hop/numbered_node_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_route_objects/path_route_object/type/numbered_node_hop/numbered_node_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_route_objects/path_route_object/type/unnumbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_route_objects/path_route_object/type/unnumbered_link_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_route_objects/path_route_object/type/unnumbered_link_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_route_objects/path_route_object/type/unnumbered_link_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_route_objects/path_route_object/type/unnumbered_link_hop/unnumbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_route_objects/path_route_object/type/unnumbered_link_hop/unnumbered_link_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_route_objects/path_route_object/type/unnumbered_link_hop/unnumbered_link_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_route_objects/path_route_object/type/unnumbered_link_hop/unnumbered_link_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_srlgs_lists/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_srlgs_lists/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_srlgs_lists/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_srlgs_lists/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_srlgs_lists/path_srlgs_list/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_srlgs_lists/path_srlgs_list/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_srlgs_lists/path_srlgs_list/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_srlgs_lists/path_srlgs_list/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_srlgs_names/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_srlgs_names/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_srlgs_names/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_srlgs_names/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_srlgs_names/path_srlgs_name/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_srlgs_names/path_srlgs_name/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_srlgs_names/path_srlgs_name/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_srlgs_names/path_srlgs_name/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/backup_path/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/backup_path/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/backup_path/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/backup_path/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/backup_path/path_element/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/backup_path/path_element/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/backup_path/path_element/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/backup_path/path_element/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/backup_path/path_element/type/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/backup_path/path_element/type/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/backup_path/path_element/type/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/backup_path/path_element/type/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/backup_path/path_element/type/as_number/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/backup_path/path_element/type/as_number/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/backup_path/path_element/type/as_number/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/backup_path/path_element/type/as_number/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/backup_path/path_element/type/as_number/as_number_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/backup_path/path_element/type/as_number/as_number_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/backup_path/path_element/type/as_number/as_number_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/backup_path/path_element/type/as_number/as_number_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/backup_path/path_element/type/label/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/backup_path/path_element/type/label/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/backup_path/path_element/type/label/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/backup_path/path_element/type/label/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/backup_path/path_element/type/label/label_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/backup_path/path_element/type/label/label_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/backup_path/path_element/type/label/label_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/backup_path/path_element/type/label/label_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/backup_path/path_element/type/label/label_hop/te_label/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/backup_path/path_element/type/label/label_hop/te_label/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/backup_path/path_element/type/label/label_hop/te_label/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/backup_path/path_element/type/label/label_hop/te_label/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/backup_path/path_element/type/label/label_hop/te_label/technology/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/backup_path/path_element/type/label/label_hop/te_label/technology/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/backup_path/path_element/type/label/label_hop/te_label/technology/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/backup_path/path_element/type/label/label_hop/te_label/technology/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/backup_path/path_element/type/label/label_hop/te_label/technology/generic/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/backup_path/path_element/type/label/label_hop/te_label/technology/generic/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/backup_path/path_element/type/label/label_hop/te_label/technology/generic/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/backup_path/path_element/type/label/label_hop/te_label/technology/generic/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/backup_path/path_element/type/numbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/backup_path/path_element/type/numbered_link_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/backup_path/path_element/type/numbered_link_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/backup_path/path_element/type/numbered_link_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/backup_path/path_element/type/numbered_link_hop/numbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/backup_path/path_element/type/numbered_link_hop/numbered_link_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/backup_path/path_element/type/numbered_link_hop/numbered_link_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/backup_path/path_element/type/numbered_link_hop/numbered_link_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/backup_path/path_element/type/numbered_node_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/backup_path/path_element/type/numbered_node_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/backup_path/path_element/type/numbered_node_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/backup_path/path_element/type/numbered_node_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/backup_path/path_element/type/numbered_node_hop/numbered_node_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/backup_path/path_element/type/numbered_node_hop/numbered_node_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/backup_path/path_element/type/numbered_node_hop/numbered_node_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/backup_path/path_element/type/numbered_node_hop/numbered_node_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/backup_path/path_element/type/unnumbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/backup_path/path_element/type/unnumbered_link_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/backup_path/path_element/type/unnumbered_link_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/backup_path/path_element/type/unnumbered_link_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/backup_path/path_element/type/unnumbered_link_hop/unnumbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/backup_path/path_element/type/unnumbered_link_hop/unnumbered_link_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/backup_path/path_element/type/unnumbered_link_hop/unnumbered_link_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/backup_path/path_element/type/unnumbered_link_hop/unnumbered_link_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/primary_path/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/primary_path/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/primary_path/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/primary_path/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/primary_path/path_element/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/primary_path/path_element/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/primary_path/path_element/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/primary_path/path_element/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/primary_path/path_element/type/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/primary_path/path_element/type/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/primary_path/path_element/type/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/primary_path/path_element/type/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/primary_path/path_element/type/as_number/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/primary_path/path_element/type/as_number/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/primary_path/path_element/type/as_number/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/primary_path/path_element/type/as_number/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/primary_path/path_element/type/as_number/as_number_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/primary_path/path_element/type/as_number/as_number_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/primary_path/path_element/type/as_number/as_number_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/primary_path/path_element/type/as_number/as_number_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/primary_path/path_element/type/label/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/primary_path/path_element/type/label/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/primary_path/path_element/type/label/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/primary_path/path_element/type/label/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/primary_path/path_element/type/label/label_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/primary_path/path_element/type/label/label_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/primary_path/path_element/type/label/label_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/primary_path/path_element/type/label/label_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/primary_path/path_element/type/label/label_hop/te_label/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/primary_path/path_element/type/label/label_hop/te_label/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/primary_path/path_element/type/label/label_hop/te_label/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/primary_path/path_element/type/label/label_hop/te_label/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/primary_path/path_element/type/label/label_hop/te_label/technology/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/primary_path/path_element/type/label/label_hop/te_label/technology/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/primary_path/path_element/type/label/label_hop/te_label/technology/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/primary_path/path_element/type/label/label_hop/te_label/technology/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/primary_path/path_element/type/label/label_hop/te_label/technology/generic/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/primary_path/path_element/type/label/label_hop/te_label/technology/generic/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/primary_path/path_element/type/label/label_hop/te_label/technology/generic/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/primary_path/path_element/type/label/label_hop/te_label/technology/generic/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/primary_path/path_element/type/numbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/primary_path/path_element/type/numbered_link_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/primary_path/path_element/type/numbered_link_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/primary_path/path_element/type/numbered_link_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/primary_path/path_element/type/numbered_link_hop/numbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/primary_path/path_element/type/numbered_link_hop/numbered_link_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/primary_path/path_element/type/numbered_link_hop/numbered_link_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/primary_path/path_element/type/numbered_link_hop/numbered_link_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/primary_path/path_element/type/numbered_node_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/primary_path/path_element/type/numbered_node_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/primary_path/path_element/type/numbered_node_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/primary_path/path_element/type/numbered_node_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/primary_path/path_element/type/numbered_node_hop/numbered_node_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/primary_path/path_element/type/numbered_node_hop/numbered_node_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/primary_path/path_element/type/numbered_node_hop/numbered_node_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/primary_path/path_element/type/numbered_node_hop/numbered_node_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/primary_path/path_element/type/unnumbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/primary_path/path_element/type/unnumbered_link_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/primary_path/path_element/type/unnumbered_link_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/primary_path/path_element/type/unnumbered_link_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/primary_path/path_element/type/unnumbered_link_hop/unnumbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/primary_path/path_element/type/unnumbered_link_hop/unnumbered_link_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/primary_path/path_element/type/unnumbered_link_hop/unnumbered_link_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/primary_path/path_element/type/unnumbered_link_hop/unnumbered_link_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/tunnel_termination_points/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/tunnel_termination_points/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/tunnel_termination_points/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/tunnel_termination_points/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/tunnels/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/tunnels/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/tunnels/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/tunnels/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/tunnels/tunnel/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/tunnels/tunnel/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/tunnels/tunnel/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/tunnels/tunnel/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/algorithm/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/algorithm/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/algorithm/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/algorithm/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/algorithm/metric/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/algorithm/metric/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/algorithm/metric/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/algorithm/metric/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/algorithm/metric/optimization_metric/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/algorithm/metric/optimization_metric/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/algorithm/metric/optimization_metric/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/algorithm/metric/optimization_metric/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/as_number/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/as_number/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/as_number/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/as_number/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/as_number/as_number_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/as_number/as_number_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/as_number/as_number_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/as_number/as_number_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/label/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/label/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/label/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/label/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/label/label_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/label/label_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/label/label_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/label/label_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/label/label_hop/te_label/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/label/label_hop/te_label/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/label/label_hop/te_label/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/label/label_hop/te_label/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/label/label_hop/te_label/technology/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/label/label_hop/te_label/technology/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/label/label_hop/te_label/technology/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/label/label_hop/te_label/technology/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/label/label_hop/te_label/technology/generic/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/label/label_hop/te_label/technology/generic/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/label/label_hop/te_label/technology/generic/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/label/label_hop/te_label/technology/generic/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/numbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/numbered_link_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/numbered_link_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/numbered_link_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/numbered_link_hop/numbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/numbered_link_hop/numbered_link_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/numbered_link_hop/numbered_link_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/numbered_link_hop/numbered_link_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/numbered_node_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/numbered_node_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/numbered_node_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/numbered_node_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/numbered_node_hop/numbered_node_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/numbered_node_hop/numbered_node_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/numbered_node_hop/numbered_node_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/numbered_node_hop/numbered_node_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/srlg/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/srlg/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/srlg/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/srlg/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/srlg/srlg/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/srlg/srlg/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/srlg/srlg/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/srlg/srlg/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/unnumbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/unnumbered_link_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/unnumbered_link_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/unnumbered_link_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/unnumbered_link_hop/unnumbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/unnumbered_link_hop/unnumbered_link_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/unnumbered_link_hop/unnumbered_link_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/algorithm/metric/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/type/unnumbered_link_hop/unnumbered_link_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/as_number/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/as_number/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/as_number/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/as_number/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/as_number/as_number_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/as_number/as_number_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/as_number/as_number_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/as_number/as_number_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/label/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/label/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/label/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/label/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/label/label_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/label/label_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/label/label_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/label/label_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/label/label_hop/te_label/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/label/label_hop/te_label/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/label/label_hop/te_label/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/label/label_hop/te_label/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/label/label_hop/te_label/technology/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/label/label_hop/te_label/technology/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/label/label_hop/te_label/technology/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/label/label_hop/te_label/technology/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/label/label_hop/te_label/technology/generic/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/label/label_hop/te_label/technology/generic/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/label/label_hop/te_label/technology/generic/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/label/label_hop/te_label/technology/generic/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/numbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/numbered_link_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/numbered_link_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/numbered_link_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/numbered_link_hop/numbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/numbered_link_hop/numbered_link_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/numbered_link_hop/numbered_link_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/numbered_link_hop/numbered_link_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/numbered_node_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/numbered_node_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/numbered_node_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/numbered_node_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/numbered_node_hop/numbered_node_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/numbered_node_hop/numbered_node_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/numbered_node_hop/numbered_node_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/numbered_node_hop/numbered_node_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/unnumbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/unnumbered_link_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/unnumbered_link_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/unnumbered_link_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/unnumbered_link_hop/unnumbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/unnumbered_link_hop/unnumbered_link_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/unnumbered_link_hop/unnumbered_link_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/algorithm/metric/optimization_metric/explicit_route_include_objects/route_object_include_object/type/unnumbered_link_hop/unnumbered_link_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/algorithm/metric/tiebreakers/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/algorithm/metric/tiebreakers/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/algorithm/metric/tiebreakers/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/algorithm/metric/tiebreakers/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/algorithm/metric/tiebreakers/tiebreaker/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/algorithm/metric/tiebreakers/tiebreaker/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/algorithm/metric/tiebreakers/tiebreaker/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/algorithm/metric/tiebreakers/tiebreaker/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/algorithm/objective_function/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/algorithm/objective_function/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/algorithm/objective_function/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/algorithm/objective_function/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/algorithm/objective_function/objective_function/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/algorithm/objective_function/objective_function/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/algorithm/objective_function/objective_function/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/algorithm/objective_function/objective_function/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/path_affinities_values/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/path_affinities_values/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/path_affinities_values/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/path_affinities_values/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/path_affinities_values/path_affinities_value/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/path_affinities_values/path_affinities_value/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/path_affinities_values/path_affinities_value/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/path_affinities_values/path_affinities_value/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/path_affinity_names/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/path_affinity_names/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/path_affinity_names/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/path_affinity_names/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/path_affinity_names/path_affinity_name/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/path_affinity_names/path_affinity_name/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/path_affinity_names/path_affinity_name/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/path_affinity_names/path_affinity_name/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/path_affinity_names/path_affinity_name/affinity_name/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/path_affinity_names/path_affinity_name/affinity_name/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/path_affinity_names/path_affinity_name/affinity_name/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/path_affinity_names/path_affinity_name/affinity_name/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/path_metric_bounds/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/path_metric_bounds/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/path_metric_bounds/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/path_metric_bounds/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/path_metric_bounds/path_metric_bound/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/path_metric_bounds/path_metric_bound/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/path_metric_bounds/path_metric_bound/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/path_metric_bounds/path_metric_bound/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/path_srlgs_lists/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/path_srlgs_lists/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/path_srlgs_lists/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/path_srlgs_lists/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/path_srlgs_lists/path_srlgs_list/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/path_srlgs_lists/path_srlgs_list/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/path_srlgs_lists/path_srlgs_list/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/path_srlgs_lists/path_srlgs_list/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/path_srlgs_names/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/path_srlgs_names/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/path_srlgs_names/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/path_srlgs_names/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/path_srlgs_names/path_srlgs_name/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/path_srlgs_names/path_srlgs_name/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/path_srlgs_names/path_srlgs_name/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/path_srlgs_names/path_srlgs_name/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/te_bandwidth/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/te_bandwidth/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/te_bandwidth/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/te_bandwidth/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/te_bandwidth/technology/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/te_bandwidth/technology/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/te_bandwidth/technology/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/te_bandwidth/technology/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/te_bandwidth/technology/generic/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/te_bandwidth/technology/generic/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/te_bandwidth/technology/generic/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/te_bandwidth/technology/generic/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_affinities_values/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_affinities_values/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_affinities_values/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_affinities_values/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_affinities_values/path_affinities_value/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_affinities_values/path_affinities_value/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_affinities_values/path_affinities_value/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_affinities_values/path_affinities_value/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_affinity_names/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_affinity_names/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_affinity_names/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_affinity_names/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_affinity_names/path_affinity_name/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_affinity_names/path_affinity_name/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_affinity_names/path_affinity_name/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_affinity_names/path_affinity_name/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_affinity_names/path_affinity_name/affinity_name/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_affinity_names/path_affinity_name/affinity_name/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_affinity_names/path_affinity_name/affinity_name/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_affinity_names/path_affinity_name/affinity_name/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_metric/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_metric/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_metric/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_metric/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_route_objects/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_route_objects/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_route_objects/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_route_objects/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_route_objects/path_route_object/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_route_objects/path_route_object/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_route_objects/path_route_object/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_route_objects/path_route_object/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_route_objects/path_route_object/type/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_route_objects/path_route_object/type/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_route_objects/path_route_object/type/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_route_objects/path_route_object/type/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_route_objects/path_route_object/type/as_number/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_route_objects/path_route_object/type/as_number/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_route_objects/path_route_object/type/as_number/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_route_objects/path_route_object/type/as_number/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_route_objects/path_route_object/type/as_number/as_number_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_route_objects/path_route_object/type/as_number/as_number_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_route_objects/path_route_object/type/as_number/as_number_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_route_objects/path_route_object/type/as_number/as_number_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_route_objects/path_route_object/type/label/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_route_objects/path_route_object/type/label/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_route_objects/path_route_object/type/label/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_route_objects/path_route_object/type/label/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_route_objects/path_route_object/type/label/label_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_route_objects/path_route_object/type/label/label_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_route_objects/path_route_object/type/label/label_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_route_objects/path_route_object/type/label/label_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_route_objects/path_route_object/type/label/label_hop/te_label/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_route_objects/path_route_object/type/label/label_hop/te_label/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_route_objects/path_route_object/type/label/label_hop/te_label/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_route_objects/path_route_object/type/label/label_hop/te_label/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_route_objects/path_route_object/type/label/label_hop/te_label/technology/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_route_objects/path_route_object/type/label/label_hop/te_label/technology/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_route_objects/path_route_object/type/label/label_hop/te_label/technology/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_route_objects/path_route_object/type/label/label_hop/te_label/technology/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_route_objects/path_route_object/type/label/label_hop/te_label/technology/generic/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_route_objects/path_route_object/type/label/label_hop/te_label/technology/generic/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_route_objects/path_route_object/type/label/label_hop/te_label/technology/generic/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_route_objects/path_route_object/type/label/label_hop/te_label/technology/generic/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_route_objects/path_route_object/type/numbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_route_objects/path_route_object/type/numbered_link_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_route_objects/path_route_object/type/numbered_link_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_route_objects/path_route_object/type/numbered_link_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_route_objects/path_route_object/type/numbered_link_hop/numbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_route_objects/path_route_object/type/numbered_link_hop/numbered_link_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_route_objects/path_route_object/type/numbered_link_hop/numbered_link_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_route_objects/path_route_object/type/numbered_link_hop/numbered_link_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_route_objects/path_route_object/type/numbered_node_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_route_objects/path_route_object/type/numbered_node_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_route_objects/path_route_object/type/numbered_node_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_route_objects/path_route_object/type/numbered_node_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_route_objects/path_route_object/type/numbered_node_hop/numbered_node_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_route_objects/path_route_object/type/numbered_node_hop/numbered_node_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_route_objects/path_route_object/type/numbered_node_hop/numbered_node_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_route_objects/path_route_object/type/numbered_node_hop/numbered_node_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_route_objects/path_route_object/type/unnumbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_route_objects/path_route_object/type/unnumbered_link_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_route_objects/path_route_object/type/unnumbered_link_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_route_objects/path_route_object/type/unnumbered_link_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_route_objects/path_route_object/type/unnumbered_link_hop/unnumbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_route_objects/path_route_object/type/unnumbered_link_hop/unnumbered_link_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_route_objects/path_route_object/type/unnumbered_link_hop/unnumbered_link_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_route_objects/path_route_object/type/unnumbered_link_hop/unnumbered_link_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_srlgs_lists/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_srlgs_lists/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_srlgs_lists/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_srlgs_lists/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_srlgs_lists/path_srlgs_list/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_srlgs_lists/path_srlgs_list/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_srlgs_lists/path_srlgs_list/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_srlgs_lists/path_srlgs_list/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_srlgs_names/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_srlgs_names/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_srlgs_names/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_srlgs_names/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_srlgs_names/path_srlgs_name/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_srlgs_names/path_srlgs_name/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_srlgs_names/path_srlgs_name/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_srlgs_names/path_srlgs_name/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/backup_path/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/backup_path/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/backup_path/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/backup_path/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/backup_path/path_element/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/backup_path/path_element/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/backup_path/path_element/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/backup_path/path_element/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/backup_path/path_element/type/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/backup_path/path_element/type/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/backup_path/path_element/type/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/backup_path/path_element/type/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/backup_path/path_element/type/as_number/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/backup_path/path_element/type/as_number/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/backup_path/path_element/type/as_number/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/backup_path/path_element/type/as_number/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/backup_path/path_element/type/as_number/as_number_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/backup_path/path_element/type/as_number/as_number_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/backup_path/path_element/type/as_number/as_number_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/backup_path/path_element/type/as_number/as_number_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/backup_path/path_element/type/label/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/backup_path/path_element/type/label/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/backup_path/path_element/type/label/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/backup_path/path_element/type/label/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/backup_path/path_element/type/label/label_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/backup_path/path_element/type/label/label_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/backup_path/path_element/type/label/label_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/backup_path/path_element/type/label/label_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/backup_path/path_element/type/label/label_hop/te_label/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/backup_path/path_element/type/label/label_hop/te_label/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/backup_path/path_element/type/label/label_hop/te_label/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/backup_path/path_element/type/label/label_hop/te_label/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/backup_path/path_element/type/label/label_hop/te_label/technology/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/backup_path/path_element/type/label/label_hop/te_label/technology/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/backup_path/path_element/type/label/label_hop/te_label/technology/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/backup_path/path_element/type/label/label_hop/te_label/technology/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/backup_path/path_element/type/label/label_hop/te_label/technology/generic/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/backup_path/path_element/type/label/label_hop/te_label/technology/generic/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/backup_path/path_element/type/label/label_hop/te_label/technology/generic/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/backup_path/path_element/type/label/label_hop/te_label/technology/generic/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/backup_path/path_element/type/numbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/backup_path/path_element/type/numbered_link_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/backup_path/path_element/type/numbered_link_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/backup_path/path_element/type/numbered_link_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/backup_path/path_element/type/numbered_link_hop/numbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/backup_path/path_element/type/numbered_link_hop/numbered_link_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/backup_path/path_element/type/numbered_link_hop/numbered_link_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/backup_path/path_element/type/numbered_link_hop/numbered_link_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/backup_path/path_element/type/numbered_node_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/backup_path/path_element/type/numbered_node_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/backup_path/path_element/type/numbered_node_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/backup_path/path_element/type/numbered_node_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/backup_path/path_element/type/numbered_node_hop/numbered_node_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/backup_path/path_element/type/numbered_node_hop/numbered_node_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/backup_path/path_element/type/numbered_node_hop/numbered_node_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/backup_path/path_element/type/numbered_node_hop/numbered_node_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/backup_path/path_element/type/unnumbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/backup_path/path_element/type/unnumbered_link_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/backup_path/path_element/type/unnumbered_link_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/backup_path/path_element/type/unnumbered_link_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/backup_path/path_element/type/unnumbered_link_hop/unnumbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/backup_path/path_element/type/unnumbered_link_hop/unnumbered_link_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/backup_path/path_element/type/unnumbered_link_hop/unnumbered_link_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/backup_path/path_element/type/unnumbered_link_hop/unnumbered_link_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/primary_path/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/primary_path/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/primary_path/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/primary_path/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/primary_path/path_element/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/primary_path/path_element/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/primary_path/path_element/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/primary_path/path_element/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/primary_path/path_element/type/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/primary_path/path_element/type/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/primary_path/path_element/type/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/primary_path/path_element/type/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/primary_path/path_element/type/as_number/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/primary_path/path_element/type/as_number/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/primary_path/path_element/type/as_number/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/primary_path/path_element/type/as_number/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/primary_path/path_element/type/as_number/as_number_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/primary_path/path_element/type/as_number/as_number_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/primary_path/path_element/type/as_number/as_number_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/primary_path/path_element/type/as_number/as_number_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/primary_path/path_element/type/label/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/primary_path/path_element/type/label/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/primary_path/path_element/type/label/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/primary_path/path_element/type/label/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/primary_path/path_element/type/label/label_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/primary_path/path_element/type/label/label_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/primary_path/path_element/type/label/label_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/primary_path/path_element/type/label/label_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/primary_path/path_element/type/label/label_hop/te_label/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/primary_path/path_element/type/label/label_hop/te_label/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/primary_path/path_element/type/label/label_hop/te_label/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/primary_path/path_element/type/label/label_hop/te_label/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/primary_path/path_element/type/label/label_hop/te_label/technology/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/primary_path/path_element/type/label/label_hop/te_label/technology/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/primary_path/path_element/type/label/label_hop/te_label/technology/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/primary_path/path_element/type/label/label_hop/te_label/technology/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/primary_path/path_element/type/label/label_hop/te_label/technology/generic/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/primary_path/path_element/type/label/label_hop/te_label/technology/generic/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/primary_path/path_element/type/label/label_hop/te_label/technology/generic/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/primary_path/path_element/type/label/label_hop/te_label/technology/generic/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/primary_path/path_element/type/numbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/primary_path/path_element/type/numbered_link_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/primary_path/path_element/type/numbered_link_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/primary_path/path_element/type/numbered_link_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/primary_path/path_element/type/numbered_link_hop/numbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/primary_path/path_element/type/numbered_link_hop/numbered_link_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/primary_path/path_element/type/numbered_link_hop/numbered_link_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/primary_path/path_element/type/numbered_link_hop/numbered_link_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/primary_path/path_element/type/numbered_node_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/primary_path/path_element/type/numbered_node_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/primary_path/path_element/type/numbered_node_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/primary_path/path_element/type/numbered_node_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/primary_path/path_element/type/numbered_node_hop/numbered_node_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/primary_path/path_element/type/numbered_node_hop/numbered_node_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/primary_path/path_element/type/numbered_node_hop/numbered_node_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/primary_path/path_element/type/numbered_node_hop/numbered_node_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/primary_path/path_element/type/unnumbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/primary_path/path_element/type/unnumbered_link_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/primary_path/path_element/type/unnumbered_link_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/primary_path/path_element/type/unnumbered_link_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/primary_path/path_element/type/unnumbered_link_hop/unnumbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/primary_path/path_element/type/unnumbered_link_hop/unnumbered_link_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/primary_path/path_element/type/unnumbered_link_hop/unnumbered_link_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/primary_path/path_element/type/unnumbered_link_hop/unnumbered_link_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/tunnel_termination_points/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/tunnel_termination_points/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/tunnel_termination_points/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/tunnel_termination_points/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/tunnels/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/tunnels/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/tunnels/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/tunnels/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/tunnels/tunnel/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/tunnels/tunnel/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/tunnels/tunnel/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/tunnels/tunnel/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/statistics/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/statistics/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/statistics/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/statistics/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/statistics/local_link_connectivity/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/statistics/local_link_connectivity/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/statistics/local_link_connectivity/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/statistics/local_link_connectivity/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/statistics/tunnel_termination_point/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/statistics/tunnel_termination_point/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/statistics/tunnel_termination_point/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/statistics/tunnel_termination_point/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/supporting_tunnel_termination_point/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/supporting_tunnel_termination_point/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/supporting_tunnel_termination_point/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/te/tunnel_termination_point/supporting_tunnel_termination_point/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/termination_point/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/termination_point/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/termination_point/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/termination_point/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/termination_point/supporting_termination_point/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/termination_point/supporting_termination_point/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/termination_point/supporting_termination_point/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/termination_point/supporting_termination_point/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/termination_point/te/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/termination_point/te/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/termination_point/te/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/termination_point/te/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/termination_point/te/geolocation/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/termination_point/te/geolocation/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/termination_point/te/geolocation/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/termination_point/te/geolocation/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/termination_point/te/interface_switching_capability/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/termination_point/te/interface_switching_capability/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/termination_point/te/interface_switching_capability/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/termination_point/te/interface_switching_capability/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/termination_point/te/interface_switching_capability/max_lsp_bandwidth/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/termination_point/te/interface_switching_capability/max_lsp_bandwidth/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/termination_point/te/interface_switching_capability/max_lsp_bandwidth/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/termination_point/te/interface_switching_capability/max_lsp_bandwidth/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/termination_point/te/interface_switching_capability/max_lsp_bandwidth/te_bandwidth/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/termination_point/te/interface_switching_capability/max_lsp_bandwidth/te_bandwidth/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/termination_point/te/interface_switching_capability/max_lsp_bandwidth/te_bandwidth/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/termination_point/te/interface_switching_capability/max_lsp_bandwidth/te_bandwidth/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/termination_point/te/interface_switching_capability/max_lsp_bandwidth/te_bandwidth/technology/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/termination_point/te/interface_switching_capability/max_lsp_bandwidth/te_bandwidth/technology/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/termination_point/te/interface_switching_capability/max_lsp_bandwidth/te_bandwidth/technology/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/termination_point/te/interface_switching_capability/max_lsp_bandwidth/te_bandwidth/technology/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/termination_point/te/interface_switching_capability/max_lsp_bandwidth/te_bandwidth/technology/generic/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/termination_point/te/interface_switching_capability/max_lsp_bandwidth/te_bandwidth/technology/generic/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/termination_point/te/interface_switching_capability/max_lsp_bandwidth/te_bandwidth/technology/generic/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/node/termination_point/te/interface_switching_capability/max_lsp_bandwidth/te_bandwidth/technology/generic/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/supporting_network/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/supporting_network/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/supporting_network/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/supporting_network/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/te/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/te/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/te/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/te/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/te/geolocation/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/te/geolocation/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/te/geolocation/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/te/geolocation/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/te/nsrlg/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/te/nsrlg/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/te/nsrlg/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/te/nsrlg/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/te_topology_identifier/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/te_topology_identifier/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/te_topology_identifier/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/network/te_topology_identifier/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/external_domain/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/external_domain/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/external_domain/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/external_domain/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/interface_switching_capability/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/interface_switching_capability/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/interface_switching_capability/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/interface_switching_capability/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/interface_switching_capability/max_lsp_bandwidth/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/interface_switching_capability/max_lsp_bandwidth/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/interface_switching_capability/max_lsp_bandwidth/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/interface_switching_capability/max_lsp_bandwidth/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/interface_switching_capability/max_lsp_bandwidth/te_bandwidth/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/interface_switching_capability/max_lsp_bandwidth/te_bandwidth/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/interface_switching_capability/max_lsp_bandwidth/te_bandwidth/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/interface_switching_capability/max_lsp_bandwidth/te_bandwidth/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/interface_switching_capability/max_lsp_bandwidth/te_bandwidth/technology/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/interface_switching_capability/max_lsp_bandwidth/te_bandwidth/technology/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/interface_switching_capability/max_lsp_bandwidth/te_bandwidth/technology/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/interface_switching_capability/max_lsp_bandwidth/te_bandwidth/technology/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/interface_switching_capability/max_lsp_bandwidth/te_bandwidth/technology/generic/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/interface_switching_capability/max_lsp_bandwidth/te_bandwidth/technology/generic/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/interface_switching_capability/max_lsp_bandwidth/te_bandwidth/technology/generic/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/interface_switching_capability/max_lsp_bandwidth/te_bandwidth/technology/generic/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/label_restrictions/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/label_restrictions/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/label_restrictions/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/label_restrictions/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/label_restrictions/label_restriction/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/label_restrictions/label_restriction/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/label_restrictions/label_restriction/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/label_restrictions/label_restriction/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/label_restrictions/label_restriction/label_end/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/label_restrictions/label_restriction/label_end/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/label_restrictions/label_restriction/label_end/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/label_restrictions/label_restriction/label_end/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/label_restrictions/label_restriction/label_end/te_label/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/label_restrictions/label_restriction/label_end/te_label/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/label_restrictions/label_restriction/label_end/te_label/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/label_restrictions/label_restriction/label_end/te_label/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/label_restrictions/label_restriction/label_end/te_label/technology/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/label_restrictions/label_restriction/label_end/te_label/technology/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/label_restrictions/label_restriction/label_end/te_label/technology/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/label_restrictions/label_restriction/label_end/te_label/technology/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/label_restrictions/label_restriction/label_end/te_label/technology/generic/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/label_restrictions/label_restriction/label_end/te_label/technology/generic/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/label_restrictions/label_restriction/label_end/te_label/technology/generic/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/label_restrictions/label_restriction/label_end/te_label/technology/generic/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/label_restrictions/label_restriction/label_start/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/label_restrictions/label_restriction/label_start/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/label_restrictions/label_restriction/label_start/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/label_restrictions/label_restriction/label_start/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/label_restrictions/label_restriction/label_start/te_label/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/label_restrictions/label_restriction/label_start/te_label/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/label_restrictions/label_restriction/label_start/te_label/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/label_restrictions/label_restriction/label_start/te_label/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/label_restrictions/label_restriction/label_start/te_label/technology/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/label_restrictions/label_restriction/label_start/te_label/technology/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/label_restrictions/label_restriction/label_start/te_label/technology/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/label_restrictions/label_restriction/label_start/te_label/technology/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/label_restrictions/label_restriction/label_start/te_label/technology/generic/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/label_restrictions/label_restriction/label_start/te_label/technology/generic/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/label_restrictions/label_restriction/label_start/te_label/technology/generic/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/label_restrictions/label_restriction/label_start/te_label/technology/generic/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/label_restrictions/label_restriction/label_step/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/label_restrictions/label_restriction/label_step/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/label_restrictions/label_restriction/label_step/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/label_restrictions/label_restriction/label_step/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/label_restrictions/label_restriction/label_step/technology/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/label_restrictions/label_restriction/label_step/technology/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/label_restrictions/label_restriction/label_step/technology/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/label_restrictions/label_restriction/label_step/technology/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/label_restrictions/label_restriction/label_step/technology/generic/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/label_restrictions/label_restriction/label_step/technology/generic/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/label_restrictions/label_restriction/label_step/technology/generic/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/label_restrictions/label_restriction/label_step/technology/generic/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/max_link_bandwidth/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/max_link_bandwidth/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/max_link_bandwidth/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/max_link_bandwidth/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/max_link_bandwidth/te_bandwidth/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/max_link_bandwidth/te_bandwidth/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/max_link_bandwidth/te_bandwidth/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/max_link_bandwidth/te_bandwidth/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/max_link_bandwidth/te_bandwidth/technology/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/max_link_bandwidth/te_bandwidth/technology/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/max_link_bandwidth/te_bandwidth/technology/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/max_link_bandwidth/te_bandwidth/technology/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/max_link_bandwidth/te_bandwidth/technology/generic/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/max_link_bandwidth/te_bandwidth/technology/generic/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/max_link_bandwidth/te_bandwidth/technology/generic/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/max_link_bandwidth/te_bandwidth/technology/generic/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/max_resv_link_bandwidth/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/max_resv_link_bandwidth/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/max_resv_link_bandwidth/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/max_resv_link_bandwidth/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/max_resv_link_bandwidth/te_bandwidth/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/max_resv_link_bandwidth/te_bandwidth/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/max_resv_link_bandwidth/te_bandwidth/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/max_resv_link_bandwidth/te_bandwidth/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/max_resv_link_bandwidth/te_bandwidth/technology/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/max_resv_link_bandwidth/te_bandwidth/technology/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/max_resv_link_bandwidth/te_bandwidth/technology/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/max_resv_link_bandwidth/te_bandwidth/technology/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/max_resv_link_bandwidth/te_bandwidth/technology/generic/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/max_resv_link_bandwidth/te_bandwidth/technology/generic/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/max_resv_link_bandwidth/te_bandwidth/technology/generic/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/max_resv_link_bandwidth/te_bandwidth/technology/generic/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/te_nsrlgs/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/te_nsrlgs/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/te_nsrlgs/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/te_nsrlgs/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/te_srlgs/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/te_srlgs/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/te_srlgs/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/te_srlgs/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/underlay/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/underlay/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/underlay/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/underlay/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/underlay/backup_path/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/underlay/backup_path/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/underlay/backup_path/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/underlay/backup_path/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/underlay/backup_path/path_element/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/underlay/backup_path/path_element/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/underlay/backup_path/path_element/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/underlay/backup_path/path_element/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/underlay/backup_path/path_element/type/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/underlay/backup_path/path_element/type/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/underlay/backup_path/path_element/type/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/underlay/backup_path/path_element/type/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/underlay/backup_path/path_element/type/as_number/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/underlay/backup_path/path_element/type/as_number/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/underlay/backup_path/path_element/type/as_number/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/underlay/backup_path/path_element/type/as_number/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/underlay/backup_path/path_element/type/as_number/as_number_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/underlay/backup_path/path_element/type/as_number/as_number_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/underlay/backup_path/path_element/type/as_number/as_number_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/underlay/backup_path/path_element/type/as_number/as_number_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/underlay/backup_path/path_element/type/label/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/underlay/backup_path/path_element/type/label/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/underlay/backup_path/path_element/type/label/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/underlay/backup_path/path_element/type/label/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/underlay/backup_path/path_element/type/label/label_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/underlay/backup_path/path_element/type/label/label_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/underlay/backup_path/path_element/type/label/label_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/underlay/backup_path/path_element/type/label/label_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/underlay/backup_path/path_element/type/label/label_hop/te_label/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/underlay/backup_path/path_element/type/label/label_hop/te_label/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/underlay/backup_path/path_element/type/label/label_hop/te_label/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/underlay/backup_path/path_element/type/label/label_hop/te_label/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/underlay/backup_path/path_element/type/label/label_hop/te_label/technology/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/underlay/backup_path/path_element/type/label/label_hop/te_label/technology/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/underlay/backup_path/path_element/type/label/label_hop/te_label/technology/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/underlay/backup_path/path_element/type/label/label_hop/te_label/technology/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/underlay/backup_path/path_element/type/label/label_hop/te_label/technology/generic/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/underlay/backup_path/path_element/type/label/label_hop/te_label/technology/generic/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/underlay/backup_path/path_element/type/label/label_hop/te_label/technology/generic/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/underlay/backup_path/path_element/type/label/label_hop/te_label/technology/generic/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/underlay/backup_path/path_element/type/numbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/underlay/backup_path/path_element/type/numbered_link_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/underlay/backup_path/path_element/type/numbered_link_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/underlay/backup_path/path_element/type/numbered_link_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/underlay/backup_path/path_element/type/numbered_link_hop/numbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/underlay/backup_path/path_element/type/numbered_link_hop/numbered_link_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/underlay/backup_path/path_element/type/numbered_link_hop/numbered_link_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/underlay/backup_path/path_element/type/numbered_link_hop/numbered_link_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/underlay/backup_path/path_element/type/numbered_node_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/underlay/backup_path/path_element/type/numbered_node_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/underlay/backup_path/path_element/type/numbered_node_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/underlay/backup_path/path_element/type/numbered_node_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/underlay/backup_path/path_element/type/numbered_node_hop/numbered_node_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/underlay/backup_path/path_element/type/numbered_node_hop/numbered_node_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/underlay/backup_path/path_element/type/numbered_node_hop/numbered_node_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/underlay/backup_path/path_element/type/numbered_node_hop/numbered_node_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/underlay/backup_path/path_element/type/unnumbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/underlay/backup_path/path_element/type/unnumbered_link_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/underlay/backup_path/path_element/type/unnumbered_link_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/underlay/backup_path/path_element/type/unnumbered_link_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/underlay/backup_path/path_element/type/unnumbered_link_hop/unnumbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/underlay/backup_path/path_element/type/unnumbered_link_hop/unnumbered_link_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/underlay/backup_path/path_element/type/unnumbered_link_hop/unnumbered_link_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/underlay/backup_path/path_element/type/unnumbered_link_hop/unnumbered_link_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/underlay/primary_path/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/underlay/primary_path/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/underlay/primary_path/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/underlay/primary_path/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/underlay/primary_path/path_element/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/underlay/primary_path/path_element/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/underlay/primary_path/path_element/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/underlay/primary_path/path_element/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/underlay/primary_path/path_element/type/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/underlay/primary_path/path_element/type/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/underlay/primary_path/path_element/type/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/underlay/primary_path/path_element/type/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/underlay/primary_path/path_element/type/as_number/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/underlay/primary_path/path_element/type/as_number/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/underlay/primary_path/path_element/type/as_number/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/underlay/primary_path/path_element/type/as_number/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/underlay/primary_path/path_element/type/as_number/as_number_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/underlay/primary_path/path_element/type/as_number/as_number_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/underlay/primary_path/path_element/type/as_number/as_number_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/underlay/primary_path/path_element/type/as_number/as_number_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/underlay/primary_path/path_element/type/label/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/underlay/primary_path/path_element/type/label/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/underlay/primary_path/path_element/type/label/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/underlay/primary_path/path_element/type/label/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/underlay/primary_path/path_element/type/label/label_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/underlay/primary_path/path_element/type/label/label_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/underlay/primary_path/path_element/type/label/label_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/underlay/primary_path/path_element/type/label/label_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/underlay/primary_path/path_element/type/label/label_hop/te_label/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/underlay/primary_path/path_element/type/label/label_hop/te_label/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/underlay/primary_path/path_element/type/label/label_hop/te_label/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/underlay/primary_path/path_element/type/label/label_hop/te_label/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/underlay/primary_path/path_element/type/label/label_hop/te_label/technology/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/underlay/primary_path/path_element/type/label/label_hop/te_label/technology/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/underlay/primary_path/path_element/type/label/label_hop/te_label/technology/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/underlay/primary_path/path_element/type/label/label_hop/te_label/technology/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/underlay/primary_path/path_element/type/label/label_hop/te_label/technology/generic/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/underlay/primary_path/path_element/type/label/label_hop/te_label/technology/generic/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/underlay/primary_path/path_element/type/label/label_hop/te_label/technology/generic/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/underlay/primary_path/path_element/type/label/label_hop/te_label/technology/generic/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/underlay/primary_path/path_element/type/numbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/underlay/primary_path/path_element/type/numbered_link_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/underlay/primary_path/path_element/type/numbered_link_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/underlay/primary_path/path_element/type/numbered_link_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/underlay/primary_path/path_element/type/numbered_link_hop/numbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/underlay/primary_path/path_element/type/numbered_link_hop/numbered_link_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/underlay/primary_path/path_element/type/numbered_link_hop/numbered_link_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/underlay/primary_path/path_element/type/numbered_link_hop/numbered_link_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/underlay/primary_path/path_element/type/numbered_node_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/underlay/primary_path/path_element/type/numbered_node_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/underlay/primary_path/path_element/type/numbered_node_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/underlay/primary_path/path_element/type/numbered_node_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/underlay/primary_path/path_element/type/numbered_node_hop/numbered_node_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/underlay/primary_path/path_element/type/numbered_node_hop/numbered_node_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/underlay/primary_path/path_element/type/numbered_node_hop/numbered_node_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/underlay/primary_path/path_element/type/numbered_node_hop/numbered_node_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/underlay/primary_path/path_element/type/unnumbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/underlay/primary_path/path_element/type/unnumbered_link_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/underlay/primary_path/path_element/type/unnumbered_link_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/underlay/primary_path/path_element/type/unnumbered_link_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/underlay/primary_path/path_element/type/unnumbered_link_hop/unnumbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/underlay/primary_path/path_element/type/unnumbered_link_hop/unnumbered_link_hop/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/underlay/primary_path/path_element/type/unnumbered_link_hop/unnumbered_link_hop/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/underlay/primary_path/path_element/type/unnumbered_link_hop/unnumbered_link_hop/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/underlay/tunnel_termination_points/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/underlay/tunnel_termination_points/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/underlay/tunnel_termination_points/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/underlay/tunnel_termination_points/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/underlay/tunnels/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/underlay/tunnels/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/underlay/tunnels/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/underlay/tunnels/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/underlay/tunnels/tunnel/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/underlay/tunnels/tunnel/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/underlay/tunnels/tunnel/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/underlay/tunnels/tunnel/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/unreserved_bandwidth/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/unreserved_bandwidth/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/unreserved_bandwidth/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/unreserved_bandwidth/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/unreserved_bandwidth/te_bandwidth/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/unreserved_bandwidth/te_bandwidth/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/unreserved_bandwidth/te_bandwidth/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/unreserved_bandwidth/te_bandwidth/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/unreserved_bandwidth/te_bandwidth/technology/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/unreserved_bandwidth/te_bandwidth/technology/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/unreserved_bandwidth/te_bandwidth/technology/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/unreserved_bandwidth/te_bandwidth/technology/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/unreserved_bandwidth/te_bandwidth/technology/generic/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/unreserved_bandwidth/te_bandwidth/technology/generic/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/unreserved_bandwidth/te_bandwidth/technology/generic/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/link_template/te_link_attributes/unreserved_bandwidth/te_bandwidth/technology/generic/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/node_template/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/node_template/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/node_template/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/node_template/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/node_template/te_node_attributes/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/node_template/te_node_attributes/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/node_template/te_node_attributes/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/node_template/te_node_attributes/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/node_template/te_node_attributes/underlay_topology/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/node_template/te_node_attributes/underlay_topology/__init__.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/node_template/te_node_attributes/underlay_topology/__init__.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/networks/te/templates/node_template/te_node_attributes/underlay_topology/__init__.py diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/ietf-network-slice-service.txt b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/ietf-network-slice-service.txt similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/ietf-network-slice-service.txt rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/ietf-network-slice-service.txt diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_network_slice/ofc23_batch_slices.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/ofc23_batch_slices.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/ietf_network_slice/ofc23_batch_slices.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network_slice/ofc23_batch_slices.py diff --git a/src/compute/service/rest_server/nbi_plugins/tools/Authentication.py b/src/nbi/service/rest_server/nbi_plugins/tools/Authentication.py similarity index 95% rename from src/compute/service/rest_server/nbi_plugins/tools/Authentication.py rename to src/nbi/service/rest_server/nbi_plugins/tools/Authentication.py index 4577f4f0ffba31071c1045f22c9a6eb37e6eed39..0afc4f3475e3b3812dd7a666a1d09cafb2b6d6a9 100644 --- a/src/compute/service/rest_server/nbi_plugins/tools/Authentication.py +++ b/src/nbi/service/rest_server/nbi_plugins/tools/Authentication.py @@ -14,7 +14,7 @@ from flask_httpauth import HTTPBasicAuth from werkzeug.security import check_password_hash -from compute.Config import RESTAPI_USERS +from nbi.Config import RESTAPI_USERS HTTP_AUTH = HTTPBasicAuth() diff --git a/src/compute/service/rest_server/nbi_plugins/tools/HttpStatusCodes.py b/src/nbi/service/rest_server/nbi_plugins/tools/HttpStatusCodes.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/tools/HttpStatusCodes.py rename to src/nbi/service/rest_server/nbi_plugins/tools/HttpStatusCodes.py diff --git a/src/compute/service/rest_server/nbi_plugins/tools/Validator.py b/src/nbi/service/rest_server/nbi_plugins/tools/Validator.py similarity index 100% rename from src/compute/service/rest_server/nbi_plugins/tools/Validator.py rename to src/nbi/service/rest_server/nbi_plugins/tools/Validator.py diff --git a/src/nbi/service/rest_server/nbi_plugins/tools/__init__.py b/src/nbi/service/rest_server/nbi_plugins/tools/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..1549d9811aa5d1c193a44ad45d0d7773236c0612 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/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/compute/tests/Constants.py b/src/nbi/tests/Constants.py similarity index 98% rename from src/compute/tests/Constants.py rename to src/nbi/tests/Constants.py index d177a219a7478fded505e0fe4a43580e5aa55dc6..d46ce2cf703c0be97e2d5fae1dced91bd6be5b10 100644 --- a/src/compute/tests/Constants.py +++ b/src/nbi/tests/Constants.py @@ -12,8 +12,8 @@ # See the License for the specific language governing permissions and # limitations under the License. -WIM_USERNAME = 'admin' -WIM_PASSWORD = 'admin' +USERNAME = 'admin' +PASSWORD = 'admin' # Ref: https://osm.etsi.org/wikipub/index.php/WIM WIM_MAPPING = [ diff --git a/src/compute/tests/MockService_Dependencies.py b/src/nbi/tests/MockService_Dependencies.py similarity index 98% rename from src/compute/tests/MockService_Dependencies.py rename to src/nbi/tests/MockService_Dependencies.py index b009e6a85d9265558e9eba2e5147f2bb6403b6de..24006386e06f8ebbac3f6a174400a3e99c1db4c3 100644 --- a/src/compute/tests/MockService_Dependencies.py +++ b/src/nbi/tests/MockService_Dependencies.py @@ -31,7 +31,7 @@ SERVICE_SERVICE = ServiceNameEnum.SERVICE SERVICE_SLICE = ServiceNameEnum.SLICE class MockService_Dependencies(GenericGrpcService): - # Mock Service implementing Context, Service and Slice to simplify unitary tests of Compute + # Mock Service implementing Context, Service and Slice to simplify unitary tests of NBI def __init__(self, bind_port: Union[str, int]) -> None: super().__init__(bind_port, LOCAL_HOST, enable_health_servicer=False, cls_name='MockService') diff --git a/src/nbi/tests/PrepareTestScenario.py b/src/nbi/tests/PrepareTestScenario.py new file mode 100644 index 0000000000000000000000000000000000000000..461245e09190ffe9795bc3bfcb4d21b516cc3071 --- /dev/null +++ b/src/nbi/tests/PrepareTestScenario.py @@ -0,0 +1,169 @@ +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT 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 enum, logging, os, pytest, requests, time +from typing import Any, Dict, List, Optional, Set, Union +from common.Constants import ServiceNameEnum +from common.Settings import ( + ENVVAR_SUFIX_SERVICE_HOST, ENVVAR_SUFIX_SERVICE_PORT_HTTP, + get_env_var_name, get_service_baseurl_http, get_service_port_http +) +from context.client.ContextClient import ContextClient +from nbi.service.rest_server.RestServer import RestServer +from nbi.service.rest_server.nbi_plugins.debug_api import register_debug_api +from nbi.service.rest_server.nbi_plugins.etsi_bwm import register_etsi_bwm_api +from nbi.service.rest_server.nbi_plugins.ietf_l2vpn import register_ietf_l2vpn +from nbi.service.rest_server.nbi_plugins.ietf_l3vpn import register_ietf_l3vpn +from nbi.service.rest_server.nbi_plugins.ietf_network import register_ietf_network +from nbi.tests.MockService_Dependencies import MockService_Dependencies +from service.client.ServiceClient import ServiceClient +from slice.client.SliceClient import SliceClient +from tests.tools.mock_osm.MockOSM import MockOSM +from .Constants import USERNAME, PASSWORD, WIM_MAPPING + +LOCAL_HOST = '127.0.0.1' +MOCKSERVICE_PORT = 10000 +NBI_SERVICE_PORT = MOCKSERVICE_PORT + get_service_port_http(ServiceNameEnum.NBI) # avoid privileged ports +os.environ[get_env_var_name(ServiceNameEnum.NBI, ENVVAR_SUFIX_SERVICE_HOST )] = str(LOCAL_HOST) +os.environ[get_env_var_name(ServiceNameEnum.NBI, ENVVAR_SUFIX_SERVICE_PORT_HTTP)] = str(NBI_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 nbi_service_rest(mock_service : MockService_Dependencies): # pylint: disable=redefined-outer-name, unused-argument + _rest_server = RestServer() + register_debug_api(_rest_server) + register_etsi_bwm_api(_rest_server) + register_ietf_l2vpn(_rest_server) + register_ietf_l3vpn(_rest_server) + register_ietf_network(_rest_server) + _rest_server.start() + time.sleep(1) # bring time for the server to start + yield _rest_server + _rest_server.shutdown() + _rest_server.join() + +@pytest.fixture(scope='session') +def osm_wim(nbi_service_rest : RestServer): # pylint: disable=redefined-outer-name, unused-argument + wim_url = 'http://{:s}:{:d}'.format(LOCAL_HOST, NBI_SERVICE_PORT) + return MockOSM(wim_url, WIM_MAPPING, USERNAME, PASSWORD) + +@pytest.fixture(scope='session') +def context_client(mock_service : MockService_Dependencies): # pylint: disable=redefined-outer-name, unused-argument + _client = ContextClient() + yield _client + _client.close() + +@pytest.fixture(scope='session') +def service_client(mock_service : MockService_Dependencies): # pylint: disable=redefined-outer-name, unused-argument + _client = ServiceClient() + yield _client + _client.close() + +@pytest.fixture(scope='session') +def slice_client(mock_service : MockService_Dependencies): # pylint: disable=redefined-outer-name, unused-argument + _client = SliceClient() + yield _client + _client.close() + +class RestRequestMethod(enum.Enum): + GET = 'get' + POST = 'post' + PUT = 'put' + PATCH = 'patch' + DELETE = 'delete' + +EXPECTED_STATUS_CODES : Set[int] = { + requests.codes['OK' ], + requests.codes['CREATED' ], + requests.codes['ACCEPTED' ], + requests.codes['NO_CONTENT'], +} + +def do_rest_request( + method : RestRequestMethod, url : str, body : Optional[Any] = None, timeout : int = 10, + allow_redirects : bool = True, expected_status_codes : Set[int] = EXPECTED_STATUS_CODES, + logger : Optional[logging.Logger] = None +) -> Optional[Union[Dict, List]]: + base_url = get_service_baseurl_http(ServiceNameEnum.NBI) or '' + request_url = 'http://{:s}:{:s}@{:s}:{:d}{:s}{:s}'.format( + USERNAME, PASSWORD, LOCAL_HOST, NBI_SERVICE_PORT, str(base_url), url + ) + if logger is not None: + msg = 'Request: {:s} {:s}'.format(str(method.value).upper(), str(request_url)) + if body is not None: msg += ' body={:s}'.format(str(body)) + logger.warning(msg) + reply = requests.request(method.value, request_url, timeout=timeout, json=body, allow_redirects=allow_redirects) + if logger is not None: + logger.warning('Reply: {:s}'.format(str(reply.text))) + assert reply.status_code in expected_status_codes, 'Reply failed with status code {:d}'.format(reply.status_code) + + if reply.content and len(reply.content) > 0: return reply.json() + return None + +def do_rest_get_request( + url : str, body : Optional[Any] = None, timeout : int = 10, + allow_redirects : bool = True, expected_status_codes : Set[int] = EXPECTED_STATUS_CODES, + logger : Optional[logging.Logger] = None +) -> Optional[Union[Dict, List]]: + return do_rest_request( + RestRequestMethod.GET, url, body=body, timeout=timeout, allow_redirects=allow_redirects, + expected_status_codes=expected_status_codes, logger=logger + ) + +def do_rest_post_request( + url : str, body : Optional[Any] = None, timeout : int = 10, + allow_redirects : bool = True, expected_status_codes : Set[int] = EXPECTED_STATUS_CODES, + logger : Optional[logging.Logger] = None +) -> Optional[Union[Dict, List]]: + return do_rest_request( + RestRequestMethod.POST, url, body=body, timeout=timeout, allow_redirects=allow_redirects, + expected_status_codes=expected_status_codes, logger=logger + ) + +def do_rest_put_request( + url : str, body : Optional[Any] = None, timeout : int = 10, + allow_redirects : bool = True, expected_status_codes : Set[int] = EXPECTED_STATUS_CODES, + logger : Optional[logging.Logger] = None +) -> Optional[Union[Dict, List]]: + return do_rest_request( + RestRequestMethod.PUT, url, body=body, timeout=timeout, allow_redirects=allow_redirects, + expected_status_codes=expected_status_codes, logger=logger + ) + +def do_rest_patch_request( + url : str, body : Optional[Any] = None, timeout : int = 10, + allow_redirects : bool = True, expected_status_codes : Set[int] = EXPECTED_STATUS_CODES, + logger : Optional[logging.Logger] = None +) -> Optional[Union[Dict, List]]: + return do_rest_request( + RestRequestMethod.PATCH, url, body=body, timeout=timeout, allow_redirects=allow_redirects, + expected_status_codes=expected_status_codes, logger=logger + ) + +def do_rest_delete_request( + url : str, body : Optional[Any] = None, timeout : int = 10, + allow_redirects : bool = True, expected_status_codes : Set[int] = EXPECTED_STATUS_CODES, + logger : Optional[logging.Logger] = None +) -> Optional[Union[Dict, List]]: + return do_rest_request( + RestRequestMethod.DELETE, url, body=body, timeout=timeout, allow_redirects=allow_redirects, + expected_status_codes=expected_status_codes, logger=logger + ) diff --git a/src/nbi/tests/__init__.py b/src/nbi/tests/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..1549d9811aa5d1c193a44ad45d0d7773236c0612 --- /dev/null +++ b/src/nbi/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/nbi/tests/data/ietf_l3vpn_req_svc1.json b/src/nbi/tests/data/ietf_l3vpn_req_svc1.json new file mode 100644 index 0000000000000000000000000000000000000000..66e253cb5b99d3b758bba04e1dfa8799e1b13c08 --- /dev/null +++ b/src/nbi/tests/data/ietf_l3vpn_req_svc1.json @@ -0,0 +1,231 @@ +{ + "ietf-l3vpn-svc:l3vpn-svc": { + "vpn-services": { + "vpn-service": [ + { + "vpn-id": "vpn1" + } + ] + }, + "sites": { + "site": [ + { + "site-id": "site_OLT", + "management": { + "type": "ietf-l3vpn-svc:provider-managed" + }, + "locations": { + "location": [ + { + "location-id": "OLT" + } + ] + }, + "devices": { + "device": [ + { + "device-id": "128.32.33.5", + "location": "OLT" + } + ] + }, + "routing-protocols": { + "routing-protocol": [ + { + "type": "ietf-l3vpn-svc:static", + "static": { + "cascaded-lan-prefixes": { + "ipv4-lan-prefixes": [ + { + "lan": "128.32.10.1/24", + "lan-tag": "vlan21", + "next-hop": "128.32.33.5" + }, + { + "lan": "128.32.20.1/24", + "lan-tag": "vlan21", + "next-hop": "128.32.33.5" + } + ] + } + } + } + ] + }, + "site-network-accesses": { + "site-network-access": [ + { + "site-network-access-id": "500", + "site-network-access-type": "ietf-l3vpn-svc:multipoint", + "device-reference": "128.32.33.5", + "vpn-attachment": { + "vpn-id": "vpn1", + "site-role": "ietf-l3vpn-svc:spoke-role" + }, + "ip-connection": { + "ipv4": { + "address-allocation-type": "ietf-l3vpn-svc:static-address", + "addresses": { + "provider-address": "128.32.33.254", + "customer-address": "128.32.33.2", + "prefix-length": 24 + } + } + }, + "routing-protocols": { + "routing-protocol": [ + { + "type": "ietf-l3vpn-svc:static", + "static": { + "cascaded-lan-prefixes": { + "ipv4-lan-prefixes": [ + { + "lan": "172.1.101.1/24", + "lan-tag": "vlan21", + "next-hop": "10.0.10.1" + } + ] + } + } + } + ] + }, + "service": { + "svc-mtu": 1500, + "svc-input-bandwidth": 1000000000, + "svc-output-bandwidth": 1000000000, + "qos": { + "qos-profile": { + "classes": { + "class": [ + { + "class-id": "qos-realtime", + "direction": "ietf-l3vpn-svc:both", + "latency": { + "latency-boundary": 10 + }, + "bandwidth": { + "guaranteed-bw-percent": 100 + } + } + ] + } + } + } + } + } + ] + } + }, + { + "site-id": "site_POP", + "management": { + "type": "ietf-l3vpn-svc:provider-managed" + }, + "locations": { + "location": [ + { + "location-id": "POP" + } + ] + }, + "devices": { + "device": [ + { + "device-id": "172.10.33.5", + "location": "POP" + } + ] + }, + "routing-protocols": { + "routing-protocol": [ + { + "type": "ietf-l3vpn-svc:static", + "static": { + "cascaded-lan-prefixes": { + "ipv4-lan-prefixes": [ + { + "lan": "172.1.101.1/24", + "lan-tag": "vlan101", + "next-hop": "172.10.33.5" + } + ] + } + } + } + ] + }, + "site-network-accesses": { + "site-network-access": [ + { + "site-network-access-id": "500", + "site-network-access-type": "ietf-l3vpn-svc:multipoint", + "device-reference": "172.10.33.5", + "vpn-attachment": { + "vpn-id": "vpn1", + "site-role": "ietf-l3vpn-svc:hub-role" + }, + "ip-connection": { + "ipv4": { + "address-allocation-type": "ietf-l3vpn-svc:static-address", + "addresses": { + "provider-address": "172.10.33.254", + "customer-address": "172.10.33.2", + "prefix-length": 24 + } + } + }, + "routing-protocols": { + "routing-protocol": [ + { + "type": "ietf-l3vpn-svc:static", + "static": { + "cascaded-lan-prefixes": { + "ipv4-lan-prefixes": [ + { + "lan": "128.32.10.1/24", + "lan-tag": "vlan101", + "next-hop": "10.0.30.1" + }, + { + "lan": "128.32.20.1/24", + "lan-tag": "vlan101", + "next-hop": "10.0.30.1" + } + ] + } + } + } + ] + }, + "service": { + "svc-mtu": 1500, + "svc-input-bandwidth": 1000000000, + "svc-output-bandwidth": 1000000000, + "qos": { + "qos-profile": { + "classes": { + "class": [ + { + "class-id": "qos-realtime", + "direction": "ietf-l3vpn-svc:both", + "latency": { + "latency-boundary": 10 + }, + "bandwidth": { + "guaranteed-bw-percent": 100 + } + } + ] + } + } + } + } + } + ] + } + } + ] + } + } +} \ No newline at end of file diff --git a/src/nbi/tests/data/ietf_l3vpn_req_svc2.json b/src/nbi/tests/data/ietf_l3vpn_req_svc2.json new file mode 100644 index 0000000000000000000000000000000000000000..2d2ea2c22e2bb490027b8033bb4fb94a39b35049 --- /dev/null +++ b/src/nbi/tests/data/ietf_l3vpn_req_svc2.json @@ -0,0 +1,231 @@ +{ + "ietf-l3vpn-svc:l3vpn-svc": { + "vpn-services": { + "vpn-service": [ + { + "vpn-id": "vpn2" + } + ] + }, + "sites": { + "site": [ + { + "site-id": "site_OLT", + "management": { + "type": "ietf-l3vpn-svc:provider-managed" + }, + "locations": { + "location": [ + { + "location-id": "OLT" + } + ] + }, + "devices": { + "device": [ + { + "device-id": "128.32.33.5", + "location": "OLT" + } + ] + }, + "routing-protocols": { + "routing-protocol": [ + { + "type": "ietf-l3vpn-svc:static", + "static": { + "cascaded-lan-prefixes": { + "ipv4-lan-prefixes": [ + { + "lan": "128.32.10.1/24", + "lan-tag": "vlan31", + "next-hop": "128.32.33.5" + }, + { + "lan": "128.32.20.1/24", + "lan-tag": "vlan31", + "next-hop": "128.32.33.5" + } + ] + } + } + } + ] + }, + "site-network-accesses": { + "site-network-access": [ + { + "site-network-access-id": "500", + "site-network-access-type": "ietf-l3vpn-svc:multipoint", + "device-reference": "128.32.33.5", + "vpn-attachment": { + "vpn-id": "vpn2", + "site-role": "ietf-l3vpn-svc:spoke-role" + }, + "ip-connection": { + "ipv4": { + "address-allocation-type": "ietf-l3vpn-svc:static-address", + "addresses": { + "provider-address": "128.32.33.254", + "customer-address": "128.32.33.2", + "prefix-length": 24 + } + } + }, + "routing-protocols": { + "routing-protocol": [ + { + "type": "ietf-l3vpn-svc:static", + "static": { + "cascaded-lan-prefixes": { + "ipv4-lan-prefixes": [ + { + "lan": "172.1.101.1/24", + "lan-tag": "vlan31", + "next-hop": "10.0.10.1" + } + ] + } + } + } + ] + }, + "service": { + "svc-mtu": 1500, + "svc-input-bandwidth": 1000000000, + "svc-output-bandwidth": 1000000000, + "qos": { + "qos-profile": { + "classes": { + "class": [ + { + "class-id": "qos-realtime", + "direction": "ietf-l3vpn-svc:both", + "latency": { + "latency-boundary": 10 + }, + "bandwidth": { + "guaranteed-bw-percent": 100 + } + } + ] + } + } + } + } + } + ] + } + }, + { + "site-id": "site_POP", + "management": { + "type": "ietf-l3vpn-svc:provider-managed" + }, + "locations": { + "location": [ + { + "location-id": "POP" + } + ] + }, + "devices": { + "device": [ + { + "device-id": "172.10.33.5", + "location": "POP" + } + ] + }, + "routing-protocols": { + "routing-protocol": [ + { + "type": "ietf-l3vpn-svc:static", + "static": { + "cascaded-lan-prefixes": { + "ipv4-lan-prefixes": [ + { + "lan": "172.1.101.1/24", + "lan-tag": "vlan201", + "next-hop": "172.10.33.1" + } + ] + } + } + } + ] + }, + "site-network-accesses": { + "site-network-access": [ + { + "site-network-access-id": "500", + "site-network-access-type": "ietf-l3vpn-svc:multipoint", + "device-reference": "172.10.33.5", + "vpn-attachment": { + "vpn-id": "vpn2", + "site-role": "ietf-l3vpn-svc:hub-role" + }, + "ip-connection": { + "ipv4": { + "address-allocation-type": "ietf-l3vpn-svc:static-address", + "addresses": { + "provider-address": "172.10.33.254", + "customer-address": "172.10.33.2", + "prefix-length": 24 + } + } + }, + "routing-protocols": { + "routing-protocol": [ + { + "type": "ietf-l3vpn-svc:static", + "static": { + "cascaded-lan-prefixes": { + "ipv4-lan-prefixes": [ + { + "lan": "128.32.10.1/24", + "lan-tag": "vlan201", + "next-hop": "10.0.30.1" + }, + { + "lan": "128.32.20.1/24", + "lan-tag": "vlan201", + "next-hop": "10.0.30.1" + } + ] + } + } + } + ] + }, + "service": { + "svc-mtu": 1500, + "svc-input-bandwidth": 1000000000, + "svc-output-bandwidth": 1000000000, + "qos": { + "qos-profile": { + "classes": { + "class": [ + { + "class-id": "qos-realtime", + "direction": "ietf-l3vpn-svc:both", + "latency": { + "latency-boundary": 10 + }, + "bandwidth": { + "guaranteed-bw-percent": 100 + } + } + ] + } + } + } + } + } + ] + } + } + ] + } + } +} \ No newline at end of file diff --git a/src/nbi/tests/data/test-ietf-network.json b/src/nbi/tests/data/test-ietf-network.json new file mode 100644 index 0000000000000000000000000000000000000000..7643ef53a18e0aca583189bdefe097a10c2e502d --- /dev/null +++ b/src/nbi/tests/data/test-ietf-network.json @@ -0,0 +1,1962 @@ +{ + "ietf-network:networks": { + "network": [ + { + "network-id": "providerId-10-clientId-0-topologyId-1", + "ietf-te-topology:te": { + "name": "Huawei-Network" + }, + "ietf-te-topology:te-topology-identifier": { + "provider-id": 10, + "client-id": 0, + "topology-id": "1" + }, + "network-types": { + "ietf-te-topology:te-topology": { + "ietf-otn-topology:otn-topology": {} + } + }, + "node": [ + { + "node-id": "10.0.10.1", + "ietf-te-topology:te-node-id": "10.0.10.1", + "ietf-network-topology:termination-point": [ + { + "tp-id": "501", + "ietf-te-topology:te-tp-id": 501, + "ietf-te-topology:te": { + "name": "1-1-1-1-1", + "admin-status": "up", + "oper-status": "up", + "ietf-otn-topology:client-svc": { + "client-facing": false + }, + "interface-switching-capability": [ + { + "encoding": "ietf-te-types:lsp-encoding-oduk", + "switching-capability": "ietf-te-types:switching-otn", + "max-lsp-bandwidth": [ + { + "priority": 7, + "te-bandwidth": { + "ietf-otn-topology:otn": { + "odu-type": "ietf-layer1-types:ODU4" + } + } + } + ] + } + ] + } + }, + { + "tp-id": "500", + "ietf-te-topology:te-tp-id": 500, + "ietf-te-topology:te": { + "name": "1-1-1-1-1", + "admin-status": "up", + "oper-status": "up", + "ietf-otn-topology:client-svc": { + "client-facing": false + }, + "interface-switching-capability": [ + { + "encoding": "ietf-te-types:lsp-encoding-oduk", + "switching-capability": "ietf-te-types:switching-otn", + "max-lsp-bandwidth": [ + { + "priority": 7, + "te-bandwidth": { + "ietf-otn-topology:otn": { + "odu-type": "ietf-layer1-types:ODU4" + } + } + } + ] + } + ] + } + } + ], + "ietf-te-topology:te": { + "oper-status": "up", + "te-node-attributes": { + "admin-status": "up", + "name": "OA" + }, + "tunnel-termination-point": [ + { + "tunnel-tp-id": "NTAx", + "admin-status": "up", + "oper-status": "up", + "encoding": "ietf-te-types:lsp-encoding-oduk", + "name": "1-1-1-1-1", + "protection-type": "ietf-te-types:lsp-protection-unprotected", + "switching-capability": "ietf-te-types:switching-otn", + "local-link-connectivities": { + "local-link-connectivity": [ + { + "is-allowed": true, + "link-tp-ref": "501" + } + ] + } + }, + { + "tunnel-tp-id": "NTAw", + "admin-status": "up", + "oper-status": "up", + "encoding": "ietf-te-types:lsp-encoding-oduk", + "name": "1-1-1-1-1", + "protection-type": "ietf-te-types:lsp-protection-unprotected", + "switching-capability": "ietf-te-types:switching-otn", + "local-link-connectivities": { + "local-link-connectivity": [ + { + "is-allowed": true, + "link-tp-ref": "500" + } + ] + } + } + ] + } + }, + { + "node-id": "10.0.20.1", + "ietf-te-topology:te-node-id": "10.0.20.1", + "ietf-network-topology:termination-point": [ + { + "tp-id": "501", + "ietf-te-topology:te-tp-id": 501, + "ietf-te-topology:te": { + "name": "1-1-1-1-1", + "admin-status": "up", + "oper-status": "up", + "ietf-otn-topology:client-svc": { + "client-facing": false + }, + "interface-switching-capability": [ + { + "encoding": "ietf-te-types:lsp-encoding-oduk", + "switching-capability": "ietf-te-types:switching-otn", + "max-lsp-bandwidth": [ + { + "priority": 7, + "te-bandwidth": { + "ietf-otn-topology:otn": { + "odu-type": "ietf-layer1-types:ODU4" + } + } + } + ] + } + ] + } + }, + { + "tp-id": "500", + "ietf-te-topology:te-tp-id": 500, + "ietf-te-topology:te": { + "name": "1-1-1-1-1", + "admin-status": "up", + "oper-status": "up", + "ietf-otn-topology:client-svc": { + "client-facing": false + }, + "interface-switching-capability": [ + { + "encoding": "ietf-te-types:lsp-encoding-oduk", + "switching-capability": "ietf-te-types:switching-otn", + "max-lsp-bandwidth": [ + { + "priority": 7, + "te-bandwidth": { + "ietf-otn-topology:otn": { + "odu-type": "ietf-layer1-types:ODU4" + } + } + } + ] + } + ] + } + } + ], + "ietf-te-topology:te": { + "oper-status": "up", + "te-node-attributes": { + "admin-status": "up", + "name": "P" + }, + "tunnel-termination-point": [ + { + "tunnel-tp-id": "NTAx", + "admin-status": "up", + "oper-status": "up", + "encoding": "ietf-te-types:lsp-encoding-oduk", + "name": "1-1-1-1-1", + "protection-type": "ietf-te-types:lsp-protection-unprotected", + "switching-capability": "ietf-te-types:switching-otn", + "local-link-connectivities": { + "local-link-connectivity": [ + { + "is-allowed": true, + "link-tp-ref": "501" + } + ] + } + }, + { + "tunnel-tp-id": "NTAw", + "admin-status": "up", + "oper-status": "up", + "encoding": "ietf-te-types:lsp-encoding-oduk", + "name": "1-1-1-1-1", + "protection-type": "ietf-te-types:lsp-protection-unprotected", + "switching-capability": "ietf-te-types:switching-otn", + "local-link-connectivities": { + "local-link-connectivity": [ + { + "is-allowed": true, + "link-tp-ref": "500" + } + ] + } + } + ] + } + }, + { + "node-id": "10.0.40.1", + "ietf-te-topology:te-node-id": "10.0.40.1", + "ietf-network-topology:termination-point": [ + { + "tp-id": "500", + "ietf-te-topology:te-tp-id": 500, + "ietf-te-topology:te": { + "name": "1-1-1-1-1", + "admin-status": "up", + "oper-status": "up", + "ietf-otn-topology:client-svc": { + "client-facing": false + }, + "interface-switching-capability": [ + { + "encoding": "ietf-te-types:lsp-encoding-oduk", + "switching-capability": "ietf-te-types:switching-otn", + "max-lsp-bandwidth": [ + { + "priority": 7, + "te-bandwidth": { + "ietf-otn-topology:otn": { + "odu-type": "ietf-layer1-types:ODU4" + } + } + } + ] + } + ] + } + }, + { + "tp-id": "501", + "ietf-te-topology:te-tp-id": 501, + "ietf-te-topology:te": { + "name": "1-1-1-1-1", + "admin-status": "up", + "oper-status": "up", + "ietf-otn-topology:client-svc": { + "client-facing": false + }, + "interface-switching-capability": [ + { + "encoding": "ietf-te-types:lsp-encoding-oduk", + "switching-capability": "ietf-te-types:switching-otn", + "max-lsp-bandwidth": [ + { + "priority": 7, + "te-bandwidth": { + "ietf-otn-topology:otn": { + "odu-type": "ietf-layer1-types:ODU4" + } + } + } + ] + } + ] + } + } + ], + "ietf-te-topology:te": { + "oper-status": "up", + "te-node-attributes": { + "admin-status": "up", + "name": "P" + }, + "tunnel-termination-point": [ + { + "tunnel-tp-id": "NTAw", + "admin-status": "up", + "oper-status": "up", + "encoding": "ietf-te-types:lsp-encoding-oduk", + "name": "1-1-1-1-1", + "protection-type": "ietf-te-types:lsp-protection-unprotected", + "switching-capability": "ietf-te-types:switching-otn", + "local-link-connectivities": { + "local-link-connectivity": [ + { + "is-allowed": true, + "link-tp-ref": "500" + } + ] + } + }, + { + "tunnel-tp-id": "NTAx", + "admin-status": "up", + "oper-status": "up", + "encoding": "ietf-te-types:lsp-encoding-oduk", + "name": "1-1-1-1-1", + "protection-type": "ietf-te-types:lsp-protection-unprotected", + "switching-capability": "ietf-te-types:switching-otn", + "local-link-connectivities": { + "local-link-connectivity": [ + { + "is-allowed": true, + "link-tp-ref": "501" + } + ] + } + } + ] + } + }, + { + "node-id": "10.0.30.1", + "ietf-te-topology:te-node-id": "10.0.30.1", + "ietf-network-topology:termination-point": [ + { + "tp-id": "500", + "ietf-te-topology:te-tp-id": 500, + "ietf-te-topology:te": { + "name": "1-1-1-1-1", + "admin-status": "up", + "oper-status": "up", + "ietf-otn-topology:client-svc": { + "client-facing": false + }, + "interface-switching-capability": [ + { + "encoding": "ietf-te-types:lsp-encoding-oduk", + "switching-capability": "ietf-te-types:switching-otn", + "max-lsp-bandwidth": [ + { + "priority": 7, + "te-bandwidth": { + "ietf-otn-topology:otn": { + "odu-type": "ietf-layer1-types:ODU4" + } + } + } + ] + } + ] + } + }, + { + "tp-id": "501", + "ietf-te-topology:te-tp-id": 501, + "ietf-te-topology:te": { + "name": "1-1-1-1-1", + "admin-status": "up", + "oper-status": "up", + "ietf-otn-topology:client-svc": { + "client-facing": false + }, + "interface-switching-capability": [ + { + "encoding": "ietf-te-types:lsp-encoding-oduk", + "switching-capability": "ietf-te-types:switching-otn", + "max-lsp-bandwidth": [ + { + "priority": 7, + "te-bandwidth": { + "ietf-otn-topology:otn": { + "odu-type": "ietf-layer1-types:ODU4" + } + } + } + ] + } + ] + } + } + ], + "ietf-te-topology:te": { + "oper-status": "up", + "te-node-attributes": { + "admin-status": "up", + "name": "OE" + }, + "tunnel-termination-point": [ + { + "tunnel-tp-id": "NTAw", + "admin-status": "up", + "oper-status": "up", + "encoding": "ietf-te-types:lsp-encoding-oduk", + "name": "1-1-1-1-1", + "protection-type": "ietf-te-types:lsp-protection-unprotected", + "switching-capability": "ietf-te-types:switching-otn", + "local-link-connectivities": { + "local-link-connectivity": [ + { + "is-allowed": true, + "link-tp-ref": "500" + } + ] + } + }, + { + "tunnel-tp-id": "NTAx", + "admin-status": "up", + "oper-status": "up", + "encoding": "ietf-te-types:lsp-encoding-oduk", + "name": "1-1-1-1-1", + "protection-type": "ietf-te-types:lsp-protection-unprotected", + "switching-capability": "ietf-te-types:switching-otn", + "local-link-connectivities": { + "local-link-connectivity": [ + { + "is-allowed": true, + "link-tp-ref": "501" + } + ] + } + } + ] + } + } + ], + "ietf-network-topology:link": [ + { + "link-id": "10.0.10.1-501", + "source": { + "source-node": "10.0.10.1", + "source-tp": "501" + }, + "destination": { + "dest-node": "10.0.20.1", + "dest-tp": "501" + }, + "ietf-te-topology:te": { + "oper-status": "up", + "te-link-attributes": { + "access-type": "point-to-point", + "admin-status": "up", + "name": "10.0.10.1-501", + "te-delay-metric": 1, + "max-link-bandwidth": { + "te-bandwidth": { + "ietf-otn-topology:otn": { + "odulist": [ + { + "odu-type": "ietf-layer1-types:ODU0", + "ts-number": 80 + } + ] + } + } + }, + "unreserved-bandwidth": [ + { + "priority": 7, + "te-bandwidth": { + "ietf-otn-topology:otn": { + "odulist": [ + { + "ts-number": 80, + "odu-type": "ietf-layer1-types:ODU0" + } + ] + } + } + } + ] + } + } + }, + { + "link-id": "10.0.10.1-500", + "source": { + "source-node": "10.0.10.1", + "source-tp": "500" + }, + "destination": { + "dest-node": "10.0.40.1", + "dest-tp": "500" + }, + "ietf-te-topology:te": { + "oper-status": "up", + "te-link-attributes": { + "access-type": "point-to-point", + "admin-status": "up", + "name": "10.0.10.1-500", + "te-delay-metric": 1, + "max-link-bandwidth": { + "te-bandwidth": { + "ietf-otn-topology:otn": { + "odulist": [ + { + "odu-type": "ietf-layer1-types:ODU0", + "ts-number": 80 + } + ] + } + } + }, + "unreserved-bandwidth": [ + { + "priority": 7, + "te-bandwidth": { + "ietf-otn-topology:otn": { + "odulist": [ + { + "ts-number": 80, + "odu-type": "ietf-layer1-types:ODU0" + } + ] + } + } + } + ] + } + } + }, + { + "link-id": "10.0.20.1-501", + "source": { + "source-node": "10.0.20.1", + "source-tp": "501" + }, + "destination": { + "dest-node": "10.0.10.1", + "dest-tp": "501" + }, + "ietf-te-topology:te": { + "oper-status": "up", + "te-link-attributes": { + "access-type": "point-to-point", + "admin-status": "up", + "name": "10.0.20.1-501", + "te-delay-metric": 1, + "max-link-bandwidth": { + "te-bandwidth": { + "ietf-otn-topology:otn": { + "odulist": [ + { + "odu-type": "ietf-layer1-types:ODU0", + "ts-number": 80 + } + ] + } + } + }, + "unreserved-bandwidth": [ + { + "priority": 7, + "te-bandwidth": { + "ietf-otn-topology:otn": { + "odulist": [ + { + "ts-number": 80, + "odu-type": "ietf-layer1-types:ODU0" + } + ] + } + } + } + ] + } + } + }, + { + "link-id": "10.0.20.1-500", + "source": { + "source-node": "10.0.20.1", + "source-tp": "500" + }, + "destination": { + "dest-node": "10.0.30.1", + "dest-tp": "500" + }, + "ietf-te-topology:te": { + "oper-status": "up", + "te-link-attributes": { + "access-type": "point-to-point", + "admin-status": "up", + "name": "10.0.20.1-500", + "te-delay-metric": 1, + "max-link-bandwidth": { + "te-bandwidth": { + "ietf-otn-topology:otn": { + "odulist": [ + { + "odu-type": "ietf-layer1-types:ODU0", + "ts-number": 80 + } + ] + } + } + }, + "unreserved-bandwidth": [ + { + "priority": 7, + "te-bandwidth": { + "ietf-otn-topology:otn": { + "odulist": [ + { + "ts-number": 80, + "odu-type": "ietf-layer1-types:ODU0" + } + ] + } + } + } + ] + } + } + }, + { + "link-id": "10.0.40.1-500", + "source": { + "source-node": "10.0.40.1", + "source-tp": "500" + }, + "destination": { + "dest-node": "10.0.10.1", + "dest-tp": "500" + }, + "ietf-te-topology:te": { + "oper-status": "up", + "te-link-attributes": { + "access-type": "point-to-point", + "admin-status": "up", + "name": "10.0.40.1-500", + "te-delay-metric": 1, + "max-link-bandwidth": { + "te-bandwidth": { + "ietf-otn-topology:otn": { + "odulist": [ + { + "odu-type": "ietf-layer1-types:ODU0", + "ts-number": 80 + } + ] + } + } + }, + "unreserved-bandwidth": [ + { + "priority": 7, + "te-bandwidth": { + "ietf-otn-topology:otn": { + "odulist": [ + { + "ts-number": 80, + "odu-type": "ietf-layer1-types:ODU0" + } + ] + } + } + } + ] + } + } + }, + { + "link-id": "10.0.40.1-501", + "source": { + "source-node": "10.0.40.1", + "source-tp": "501" + }, + "destination": { + "dest-node": "10.0.30.1", + "dest-tp": "501" + }, + "ietf-te-topology:te": { + "oper-status": "up", + "te-link-attributes": { + "access-type": "point-to-point", + "admin-status": "up", + "name": "10.0.40.1-501", + "te-delay-metric": 1, + "max-link-bandwidth": { + "te-bandwidth": { + "ietf-otn-topology:otn": { + "odulist": [ + { + "odu-type": "ietf-layer1-types:ODU0", + "ts-number": 80 + } + ] + } + } + }, + "unreserved-bandwidth": [ + { + "priority": 7, + "te-bandwidth": { + "ietf-otn-topology:otn": { + "odulist": [ + { + "ts-number": 80, + "odu-type": "ietf-layer1-types:ODU0" + } + ] + } + } + } + ] + } + } + }, + { + "link-id": "10.0.30.1-500", + "source": { + "source-node": "10.0.30.1", + "source-tp": "500" + }, + "destination": { + "dest-node": "10.0.20.1", + "dest-tp": "500" + }, + "ietf-te-topology:te": { + "oper-status": "up", + "te-link-attributes": { + "access-type": "point-to-point", + "admin-status": "up", + "name": "10.0.30.1-500", + "te-delay-metric": 1, + "max-link-bandwidth": { + "te-bandwidth": { + "ietf-otn-topology:otn": { + "odulist": [ + { + "odu-type": "ietf-layer1-types:ODU0", + "ts-number": 80 + } + ] + } + } + }, + "unreserved-bandwidth": [ + { + "priority": 7, + "te-bandwidth": { + "ietf-otn-topology:otn": { + "odulist": [ + { + "ts-number": 80, + "odu-type": "ietf-layer1-types:ODU0" + } + ] + } + } + } + ] + } + } + }, + { + "link-id": "10.0.30.1-501", + "source": { + "source-node": "10.0.30.1", + "source-tp": "501" + }, + "destination": { + "dest-node": "10.0.40.1", + "dest-tp": "501" + }, + "ietf-te-topology:te": { + "oper-status": "up", + "te-link-attributes": { + "access-type": "point-to-point", + "admin-status": "up", + "name": "10.0.30.1-501", + "te-delay-metric": 1, + "max-link-bandwidth": { + "te-bandwidth": { + "ietf-otn-topology:otn": { + "odulist": [ + { + "odu-type": "ietf-layer1-types:ODU0", + "ts-number": 80 + } + ] + } + } + }, + "unreserved-bandwidth": [ + { + "priority": 7, + "te-bandwidth": { + "ietf-otn-topology:otn": { + "odulist": [ + { + "ts-number": 80, + "odu-type": "ietf-layer1-types:ODU0" + } + ] + } + } + } + ] + } + } + } + ] + }, + { + "network-id": "providerId-10-clientId-0-topologyId-2", + "ietf-te-topology:te": { + "name": "Huawei-Network" + }, + "ietf-te-topology:te-topology-identifier": { + "provider-id": 10, + "client-id": 0, + "topology-id": "2" + }, + "network-types": { + "ietf-te-topology:te-topology": { + "ietf-eth-te-topology:eth-tran-topology": {} + } + }, + "node": [ + { + "node-id": "10.0.10.1", + "ietf-te-topology:te-node-id": "10.0.10.1", + "ietf-network-topology:termination-point": [ + { + "tp-id": "200", + "ietf-te-topology:te-tp-id": "128.32.33.254", + "ietf-eth-te-topology:eth-svc": { + "client-facing": true, + "supported-classification": { + "port-classification": true, + "vlan-classification": { + "outer-tag": { + "supported-tag-types": [ + "ietf-eth-tran-types:classify-c-vlan", + "ietf-eth-tran-types:classify-s-vlan" + ], + "vlan-bundling": false, + "vlan-range": "1-4094" + } + } + } + }, + "ietf-te-topology:te": { + "name": "endpoint:111", + "admin-status": "up", + "oper-status": "up", + "interface-switching-capability": [ + { + "encoding": "ietf-te-types:lsp-encoding-ethernet", + "switching-capability": "ietf-te-types:switching-l2sc", + "max-lsp-bandwidth": [ + { + "priority": 7, + "te-bandwidth": { + "ietf-eth-te-topology:eth-bandwidth": 10000000 + } + } + ] + } + ] + } + }, + { + "tp-id": "501", + "ietf-te-topology:te-tp-id": 501, + "ietf-eth-te-topology:eth-svc": { + "client-facing": false, + "supported-classification": { + "port-classification": true, + "vlan-classification": { + "outer-tag": { + "supported-tag-types": [ + "ietf-eth-tran-types:classify-c-vlan", + "ietf-eth-tran-types:classify-s-vlan" + ], + "vlan-bundling": false, + "vlan-range": "1-4094" + } + } + } + }, + "ietf-te-topology:te": { + "name": "endpoint:111", + "admin-status": "up", + "oper-status": "up", + "interface-switching-capability": [ + { + "encoding": "ietf-te-types:lsp-encoding-ethernet", + "switching-capability": "ietf-te-types:switching-l2sc", + "max-lsp-bandwidth": [ + { + "priority": 7, + "te-bandwidth": { + "ietf-eth-te-topology:eth-bandwidth": 10000000 + } + } + ] + } + ] + } + }, + { + "tp-id": "500", + "ietf-te-topology:te-tp-id": 500, + "ietf-eth-te-topology:eth-svc": { + "client-facing": false, + "supported-classification": { + "port-classification": true, + "vlan-classification": { + "outer-tag": { + "supported-tag-types": [ + "ietf-eth-tran-types:classify-c-vlan", + "ietf-eth-tran-types:classify-s-vlan" + ], + "vlan-bundling": false, + "vlan-range": "1-4094" + } + } + } + }, + "ietf-te-topology:te": { + "name": "endpoint:111", + "admin-status": "up", + "oper-status": "up", + "interface-switching-capability": [ + { + "encoding": "ietf-te-types:lsp-encoding-ethernet", + "switching-capability": "ietf-te-types:switching-l2sc", + "max-lsp-bandwidth": [ + { + "priority": 7, + "te-bandwidth": { + "ietf-eth-te-topology:eth-bandwidth": 10000000 + } + } + ] + } + ] + } + } + ], + "ietf-te-topology:te": { + "oper-status": "up", + "te-node-attributes": { + "admin-status": "up", + "name": "OA" + } + } + }, + { + "node-id": "10.0.20.1", + "ietf-te-topology:te-node-id": "10.0.20.1", + "ietf-network-topology:termination-point": [ + { + "tp-id": "501", + "ietf-te-topology:te-tp-id": 501, + "ietf-eth-te-topology:eth-svc": { + "client-facing": false, + "supported-classification": { + "port-classification": true, + "vlan-classification": { + "outer-tag": { + "supported-tag-types": [ + "ietf-eth-tran-types:classify-c-vlan", + "ietf-eth-tran-types:classify-s-vlan" + ], + "vlan-bundling": false, + "vlan-range": "1-4094" + } + } + } + }, + "ietf-te-topology:te": { + "name": "endpoint:111", + "admin-status": "up", + "oper-status": "up", + "interface-switching-capability": [ + { + "encoding": "ietf-te-types:lsp-encoding-ethernet", + "switching-capability": "ietf-te-types:switching-l2sc", + "max-lsp-bandwidth": [ + { + "priority": 7, + "te-bandwidth": { + "ietf-eth-te-topology:eth-bandwidth": 10000000 + } + } + ] + } + ] + } + }, + { + "tp-id": "500", + "ietf-te-topology:te-tp-id": 500, + "ietf-eth-te-topology:eth-svc": { + "client-facing": false, + "supported-classification": { + "port-classification": true, + "vlan-classification": { + "outer-tag": { + "supported-tag-types": [ + "ietf-eth-tran-types:classify-c-vlan", + "ietf-eth-tran-types:classify-s-vlan" + ], + "vlan-bundling": false, + "vlan-range": "1-4094" + } + } + } + }, + "ietf-te-topology:te": { + "name": "endpoint:111", + "admin-status": "up", + "oper-status": "up", + "interface-switching-capability": [ + { + "encoding": "ietf-te-types:lsp-encoding-ethernet", + "switching-capability": "ietf-te-types:switching-l2sc", + "max-lsp-bandwidth": [ + { + "priority": 7, + "te-bandwidth": { + "ietf-eth-te-topology:eth-bandwidth": 10000000 + } + } + ] + } + ] + } + } + ], + "ietf-te-topology:te": { + "oper-status": "up", + "te-node-attributes": { + "admin-status": "up", + "name": "P" + } + } + }, + { + "node-id": "10.0.40.1", + "ietf-te-topology:te-node-id": "10.0.40.1", + "ietf-network-topology:termination-point": [ + { + "tp-id": "501", + "ietf-te-topology:te-tp-id": 501, + "ietf-eth-te-topology:eth-svc": { + "client-facing": false, + "supported-classification": { + "port-classification": true, + "vlan-classification": { + "outer-tag": { + "supported-tag-types": [ + "ietf-eth-tran-types:classify-c-vlan", + "ietf-eth-tran-types:classify-s-vlan" + ], + "vlan-bundling": false, + "vlan-range": "1-4094" + } + } + } + }, + "ietf-te-topology:te": { + "name": "endpoint:111", + "admin-status": "up", + "oper-status": "up", + "interface-switching-capability": [ + { + "encoding": "ietf-te-types:lsp-encoding-ethernet", + "switching-capability": "ietf-te-types:switching-l2sc", + "max-lsp-bandwidth": [ + { + "priority": 7, + "te-bandwidth": { + "ietf-eth-te-topology:eth-bandwidth": 10000000 + } + } + ] + } + ] + } + }, + { + "tp-id": "500", + "ietf-te-topology:te-tp-id": 500, + "ietf-eth-te-topology:eth-svc": { + "client-facing": false, + "supported-classification": { + "port-classification": true, + "vlan-classification": { + "outer-tag": { + "supported-tag-types": [ + "ietf-eth-tran-types:classify-c-vlan", + "ietf-eth-tran-types:classify-s-vlan" + ], + "vlan-bundling": false, + "vlan-range": "1-4094" + } + } + } + }, + "ietf-te-topology:te": { + "name": "endpoint:111", + "admin-status": "up", + "oper-status": "up", + "interface-switching-capability": [ + { + "encoding": "ietf-te-types:lsp-encoding-ethernet", + "switching-capability": "ietf-te-types:switching-l2sc", + "max-lsp-bandwidth": [ + { + "priority": 7, + "te-bandwidth": { + "ietf-eth-te-topology:eth-bandwidth": 10000000 + } + } + ] + } + ] + } + } + ], + "ietf-te-topology:te": { + "oper-status": "up", + "te-node-attributes": { + "admin-status": "up", + "name": "P" + } + } + }, + { + "node-id": "10.0.30.1", + "ietf-te-topology:te-node-id": "10.0.30.1", + "ietf-network-topology:termination-point": [ + { + "tp-id": "200", + "ietf-te-topology:te-tp-id": "172.10.33.254", + "ietf-eth-te-topology:eth-svc": { + "client-facing": true, + "supported-classification": { + "port-classification": true, + "vlan-classification": { + "outer-tag": { + "supported-tag-types": [ + "ietf-eth-tran-types:classify-c-vlan", + "ietf-eth-tran-types:classify-s-vlan" + ], + "vlan-bundling": false, + "vlan-range": "1-4094" + } + } + } + }, + "ietf-te-topology:te": { + "name": "endpoint:111", + "admin-status": "up", + "oper-status": "up", + "interface-switching-capability": [ + { + "encoding": "ietf-te-types:lsp-encoding-ethernet", + "switching-capability": "ietf-te-types:switching-l2sc", + "max-lsp-bandwidth": [ + { + "priority": 7, + "te-bandwidth": { + "ietf-eth-te-topology:eth-bandwidth": 10000000 + } + } + ] + } + ] + } + }, + { + "tp-id": "501", + "ietf-te-topology:te-tp-id": 501, + "ietf-eth-te-topology:eth-svc": { + "client-facing": false, + "supported-classification": { + "port-classification": true, + "vlan-classification": { + "outer-tag": { + "supported-tag-types": [ + "ietf-eth-tran-types:classify-c-vlan", + "ietf-eth-tran-types:classify-s-vlan" + ], + "vlan-bundling": false, + "vlan-range": "1-4094" + } + } + } + }, + "ietf-te-topology:te": { + "name": "endpoint:111", + "admin-status": "up", + "oper-status": "up", + "interface-switching-capability": [ + { + "encoding": "ietf-te-types:lsp-encoding-ethernet", + "switching-capability": "ietf-te-types:switching-l2sc", + "max-lsp-bandwidth": [ + { + "priority": 7, + "te-bandwidth": { + "ietf-eth-te-topology:eth-bandwidth": 10000000 + } + } + ] + } + ] + } + }, + { + "tp-id": "500", + "ietf-te-topology:te-tp-id": 500, + "ietf-eth-te-topology:eth-svc": { + "client-facing": false, + "supported-classification": { + "port-classification": true, + "vlan-classification": { + "outer-tag": { + "supported-tag-types": [ + "ietf-eth-tran-types:classify-c-vlan", + "ietf-eth-tran-types:classify-s-vlan" + ], + "vlan-bundling": false, + "vlan-range": "1-4094" + } + } + } + }, + "ietf-te-topology:te": { + "name": "endpoint:111", + "admin-status": "up", + "oper-status": "up", + "interface-switching-capability": [ + { + "encoding": "ietf-te-types:lsp-encoding-ethernet", + "switching-capability": "ietf-te-types:switching-l2sc", + "max-lsp-bandwidth": [ + { + "priority": 7, + "te-bandwidth": { + "ietf-eth-te-topology:eth-bandwidth": 10000000 + } + } + ] + } + ] + } + } + ], + "ietf-te-topology:te": { + "oper-status": "up", + "te-node-attributes": { + "admin-status": "up", + "name": "OE" + } + } + }, + { + "node-id": "128.32.33.5", + "ietf-te-topology:te-node-id": "128.32.33.5", + "ietf-network-topology:termination-point": [ + { + "tp-id": "500", + "ietf-te-topology:te-tp-id": "128.32.33.2", + "ietf-eth-te-topology:eth-svc": { + "client-facing": false, + "supported-classification": { + "port-classification": true, + "vlan-classification": { + "outer-tag": { + "supported-tag-types": [ + "ietf-eth-tran-types:classify-c-vlan", + "ietf-eth-tran-types:classify-s-vlan" + ], + "vlan-bundling": false, + "vlan-range": "1-4094" + } + } + } + }, + "ietf-te-topology:te": { + "name": "endpoint:111", + "admin-status": "up", + "oper-status": "up", + "interface-switching-capability": [ + { + "encoding": "ietf-te-types:lsp-encoding-ethernet", + "switching-capability": "ietf-te-types:switching-l2sc", + "max-lsp-bandwidth": [ + { + "priority": 7, + "te-bandwidth": { + "ietf-eth-te-topology:eth-bandwidth": 10000000 + } + } + ] + } + ] + } + }, + { + "tp-id": "200", + "ietf-te-topology:te-tp-id": 200, + "ietf-eth-te-topology:eth-svc": { + "client-facing": true, + "supported-classification": { + "port-classification": true, + "vlan-classification": { + "outer-tag": { + "supported-tag-types": [ + "ietf-eth-tran-types:classify-c-vlan", + "ietf-eth-tran-types:classify-s-vlan" + ], + "vlan-bundling": false, + "vlan-range": "1-4094" + } + } + } + } + }, + { + "tp-id": "201", + "ietf-te-topology:te-tp-id": 201, + "ietf-eth-te-topology:eth-svc": { + "client-facing": true, + "supported-classification": { + "port-classification": true, + "vlan-classification": { + "outer-tag": { + "supported-tag-types": [ + "ietf-eth-tran-types:classify-c-vlan", + "ietf-eth-tran-types:classify-s-vlan" + ], + "vlan-bundling": false, + "vlan-range": "1-4094" + } + } + } + } + } + ], + "ietf-te-topology:te": { + "oper-status": "up", + "te-node-attributes": { + "admin-status": "up", + "name": "OLT", + "connectivity-matrices": { + "label-restrictions": { + "label-restriction": [ + { + "index": 0, + "label-start": { + "te-label": { + "ietf-eth-te-topology:vlanid": 21 + } + }, + "label-end": { + "te-label": { + "ietf-eth-te-topology:vlanid": 21 + } + } + }, + { + "index": 1, + "label-start": { + "te-label": { + "ietf-eth-te-topology:vlanid": 31 + } + }, + "label-end": { + "te-label": { + "ietf-eth-te-topology:vlanid": 31 + } + } + } + ] + } + } + } + } + }, + { + "node-id": "128.32.10.1", + "ietf-te-topology:te-node-id": "128.32.10.1", + "ietf-network-topology:termination-point": [ + { + "tp-id": "500", + "ietf-te-topology:te-tp-id": 500, + "ietf-eth-te-topology:eth-svc": { + "client-facing": false, + "supported-classification": { + "port-classification": true, + "vlan-classification": { + "outer-tag": { + "supported-tag-types": [ + "ietf-eth-tran-types:classify-c-vlan", + "ietf-eth-tran-types:classify-s-vlan" + ], + "vlan-bundling": false, + "vlan-range": "1-4094" + } + } + } + } + }, + { + "tp-id": "200", + "ietf-te-topology:te-tp-id": 200, + "ietf-eth-te-topology:eth-svc": { + "client-facing": true, + "supported-classification": { + "port-classification": true, + "vlan-classification": { + "outer-tag": { + "supported-tag-types": [ + "ietf-eth-tran-types:classify-c-vlan", + "ietf-eth-tran-types:classify-s-vlan" + ], + "vlan-bundling": false, + "vlan-range": "1-4094" + } + } + } + } + } + ], + "ietf-te-topology:te": { + "oper-status": "up", + "te-node-attributes": { + "admin-status": "up", + "name": "ONT1" + } + } + }, + { + "node-id": "128.32.20.1", + "ietf-te-topology:te-node-id": "128.32.20.1", + "ietf-network-topology:termination-point": [ + { + "tp-id": "500", + "ietf-te-topology:te-tp-id": 500, + "ietf-eth-te-topology:eth-svc": { + "client-facing": false, + "supported-classification": { + "port-classification": true, + "vlan-classification": { + "outer-tag": { + "supported-tag-types": [ + "ietf-eth-tran-types:classify-c-vlan", + "ietf-eth-tran-types:classify-s-vlan" + ], + "vlan-bundling": false, + "vlan-range": "1-4094" + } + } + } + } + }, + { + "tp-id": "200", + "ietf-te-topology:te-tp-id": 200, + "ietf-eth-te-topology:eth-svc": { + "client-facing": true, + "supported-classification": { + "port-classification": true, + "vlan-classification": { + "outer-tag": { + "supported-tag-types": [ + "ietf-eth-tran-types:classify-c-vlan", + "ietf-eth-tran-types:classify-s-vlan" + ], + "vlan-bundling": false, + "vlan-range": "1-4094" + } + } + } + } + } + ], + "ietf-te-topology:te": { + "oper-status": "up", + "te-node-attributes": { + "admin-status": "up", + "name": "ONT2" + } + } + } + ], + "ietf-network-topology:link": [ + { + "link-id": "10.0.10.1-200", + "source": { + "source-node": "10.0.10.1", + "source-tp": "200" + }, + "destination": { + "dest-node": "128.32.33.5", + "dest-tp": "500" + }, + "ietf-te-topology:te": { + "oper-status": "up", + "te-link-attributes": { + "access-type": "point-to-point", + "admin-status": "up", + "name": "10.0.10.1-200", + "max-link-bandwidth": { + "te-bandwidth": { + "ietf-eth-te-topology:eth-bandwidth": 10000000 + } + }, + "unreserved-bandwidth": [ + { + "priority": 7, + "te-bandwidth": { + "ietf-eth-te-topology:eth-bandwidth": 10000000 + } + } + ] + } + } + }, + { + "link-id": "128.32.33.5-500", + "source": { + "source-node": "128.32.33.5", + "source-tp": "500" + }, + "destination": { + "dest-node": "10.0.10.1", + "dest-tp": "200" + }, + "ietf-te-topology:te": { + "oper-status": "up", + "te-link-attributes": { + "access-type": "point-to-point", + "admin-status": "up", + "name": "128.32.33.5-500", + "max-link-bandwidth": { + "te-bandwidth": { + "ietf-eth-te-topology:eth-bandwidth": 10000000 + } + }, + "unreserved-bandwidth": [ + { + "priority": 7, + "te-bandwidth": { + "ietf-eth-te-topology:eth-bandwidth": 10000000 + } + } + ] + } + } + }, + { + "link-id": "10.0.10.1-501", + "source": { + "source-node": "10.0.10.1", + "source-tp": "501" + }, + "destination": { + "dest-node": "10.0.20.1", + "dest-tp": "501" + }, + "ietf-te-topology:te": { + "oper-status": "up", + "te-link-attributes": { + "access-type": "point-to-point", + "admin-status": "up", + "name": "10.0.10.1-501", + "max-link-bandwidth": { + "te-bandwidth": { + "ietf-eth-te-topology:eth-bandwidth": 10000000 + } + }, + "unreserved-bandwidth": [ + { + "priority": 7, + "te-bandwidth": { + "ietf-eth-te-topology:eth-bandwidth": 10000000 + } + } + ] + } + } + }, + { + "link-id": "10.0.10.1-500", + "source": { + "source-node": "10.0.10.1", + "source-tp": "500" + }, + "destination": { + "dest-node": "10.0.40.1", + "dest-tp": "500" + }, + "ietf-te-topology:te": { + "oper-status": "up", + "te-link-attributes": { + "access-type": "point-to-point", + "admin-status": "up", + "name": "10.0.10.1-500", + "max-link-bandwidth": { + "te-bandwidth": { + "ietf-eth-te-topology:eth-bandwidth": 10000000 + } + }, + "unreserved-bandwidth": [ + { + "priority": 7, + "te-bandwidth": { + "ietf-eth-te-topology:eth-bandwidth": 10000000 + } + } + ] + } + } + }, + { + "link-id": "10.0.20.1-501", + "source": { + "source-node": "10.0.20.1", + "source-tp": "501" + }, + "destination": { + "dest-node": "10.0.10.1", + "dest-tp": "501" + }, + "ietf-te-topology:te": { + "oper-status": "up", + "te-link-attributes": { + "access-type": "point-to-point", + "admin-status": "up", + "name": "10.0.20.1-501", + "max-link-bandwidth": { + "te-bandwidth": { + "ietf-eth-te-topology:eth-bandwidth": 10000000 + } + }, + "unreserved-bandwidth": [ + { + "priority": 7, + "te-bandwidth": { + "ietf-eth-te-topology:eth-bandwidth": 10000000 + } + } + ] + } + } + }, + { + "link-id": "10.0.20.1-500", + "source": { + "source-node": "10.0.20.1", + "source-tp": "500" + }, + "destination": { + "dest-node": "10.0.30.1", + "dest-tp": "500" + }, + "ietf-te-topology:te": { + "oper-status": "up", + "te-link-attributes": { + "access-type": "point-to-point", + "admin-status": "up", + "name": "10.0.20.1-500", + "max-link-bandwidth": { + "te-bandwidth": { + "ietf-eth-te-topology:eth-bandwidth": 10000000 + } + }, + "unreserved-bandwidth": [ + { + "priority": 7, + "te-bandwidth": { + "ietf-eth-te-topology:eth-bandwidth": 10000000 + } + } + ] + } + } + }, + { + "link-id": "10.0.40.1-501", + "source": { + "source-node": "10.0.40.1", + "source-tp": "501" + }, + "destination": { + "dest-node": "10.0.30.1", + "dest-tp": "501" + }, + "ietf-te-topology:te": { + "oper-status": "up", + "te-link-attributes": { + "access-type": "point-to-point", + "admin-status": "up", + "name": "10.0.40.1-501", + "max-link-bandwidth": { + "te-bandwidth": { + "ietf-eth-te-topology:eth-bandwidth": 10000000 + } + }, + "unreserved-bandwidth": [ + { + "priority": 7, + "te-bandwidth": { + "ietf-eth-te-topology:eth-bandwidth": 10000000 + } + } + ] + } + } + }, + { + "link-id": "10.0.40.1-500", + "source": { + "source-node": "10.0.40.1", + "source-tp": "500" + }, + "destination": { + "dest-node": "10.0.10.1", + "dest-tp": "500" + }, + "ietf-te-topology:te": { + "oper-status": "up", + "te-link-attributes": { + "access-type": "point-to-point", + "admin-status": "up", + "name": "10.0.40.1-500", + "max-link-bandwidth": { + "te-bandwidth": { + "ietf-eth-te-topology:eth-bandwidth": 10000000 + } + }, + "unreserved-bandwidth": [ + { + "priority": 7, + "te-bandwidth": { + "ietf-eth-te-topology:eth-bandwidth": 10000000 + } + } + ] + } + } + }, + { + "link-id": "10.0.30.1-501", + "source": { + "source-node": "10.0.30.1", + "source-tp": "501" + }, + "destination": { + "dest-node": "10.0.40.1", + "dest-tp": "501" + }, + "ietf-te-topology:te": { + "oper-status": "up", + "te-link-attributes": { + "access-type": "point-to-point", + "admin-status": "up", + "name": "10.0.30.1-501", + "max-link-bandwidth": { + "te-bandwidth": { + "ietf-eth-te-topology:eth-bandwidth": 10000000 + } + }, + "unreserved-bandwidth": [ + { + "priority": 7, + "te-bandwidth": { + "ietf-eth-te-topology:eth-bandwidth": 10000000 + } + } + ] + } + } + }, + { + "link-id": "10.0.30.1-500", + "source": { + "source-node": "10.0.30.1", + "source-tp": "500" + }, + "destination": { + "dest-node": "10.0.20.1", + "dest-tp": "500" + }, + "ietf-te-topology:te": { + "oper-status": "up", + "te-link-attributes": { + "access-type": "point-to-point", + "admin-status": "up", + "name": "10.0.30.1-500", + "max-link-bandwidth": { + "te-bandwidth": { + "ietf-eth-te-topology:eth-bandwidth": 10000000 + } + }, + "unreserved-bandwidth": [ + { + "priority": 7, + "te-bandwidth": { + "ietf-eth-te-topology:eth-bandwidth": 10000000 + } + } + ] + } + } + }, + { + "link-id": "128.32.33.5-200", + "source": { + "source-node": "128.32.33.5", + "source-tp": "200" + }, + "destination": { + "dest-node": "128.32.10.1", + "dest-tp": "500" + }, + "ietf-te-topology:te": { + "oper-status": "up", + "te-link-attributes": { + "access-type": "point-to-point", + "admin-status": "up", + "name": "128.32.33.5-200", + "max-link-bandwidth": { + "te-bandwidth": { + "ietf-eth-te-topology:eth-bandwidth": 10000000 + } + }, + "unreserved-bandwidth": [ + { + "priority": 7, + "te-bandwidth": { + "ietf-eth-te-topology:eth-bandwidth": 10000000 + } + } + ] + } + } + }, + { + "link-id": "128.32.10.1-500", + "source": { + "source-node": "128.32.10.1", + "source-tp": "500" + }, + "destination": { + "dest-node": "128.32.33.5", + "dest-tp": "200" + }, + "ietf-te-topology:te": { + "oper-status": "up", + "te-link-attributes": { + "access-type": "point-to-point", + "admin-status": "up", + "name": "128.32.10.1-500", + "max-link-bandwidth": { + "te-bandwidth": { + "ietf-eth-te-topology:eth-bandwidth": 10000000 + } + }, + "unreserved-bandwidth": [ + { + "priority": 7, + "te-bandwidth": { + "ietf-eth-te-topology:eth-bandwidth": 10000000 + } + } + ] + } + } + }, + { + "link-id": "128.32.33.5-201", + "source": { + "source-node": "128.32.33.5", + "source-tp": "201" + }, + "destination": { + "dest-node": "128.32.20.1", + "dest-tp": "500" + }, + "ietf-te-topology:te": { + "oper-status": "up", + "te-link-attributes": { + "access-type": "point-to-point", + "admin-status": "up", + "name": "128.32.33.5-201", + "max-link-bandwidth": { + "te-bandwidth": { + "ietf-eth-te-topology:eth-bandwidth": 10000000 + } + }, + "unreserved-bandwidth": [ + { + "priority": 7, + "te-bandwidth": { + "ietf-eth-te-topology:eth-bandwidth": 10000000 + } + } + ] + } + } + }, + { + "link-id": "128.32.20.1-500", + "source": { + "source-node": "128.32.20.1", + "source-tp": "500" + }, + "destination": { + "dest-node": "128.32.33.5", + "dest-tp": "201" + }, + "ietf-te-topology:te": { + "oper-status": "up", + "te-link-attributes": { + "access-type": "point-to-point", + "admin-status": "up", + "name": "128.32.20.1-500", + "max-link-bandwidth": { + "te-bandwidth": { + "ietf-eth-te-topology:eth-bandwidth": 10000000 + } + }, + "unreserved-bandwidth": [ + { + "priority": 7, + "te-bandwidth": { + "ietf-eth-te-topology:eth-bandwidth": 10000000 + } + } + ] + } + } + } + ] + } + ] + } +} \ No newline at end of file diff --git a/src/nbi/tests/data/topology-7router-emu-dummy.json b/src/nbi/tests/data/topology-7router-emu-dummy.json new file mode 100644 index 0000000000000000000000000000000000000000..3bb62262652d0eaab411ac71824af3d167b031dd --- /dev/null +++ b/src/nbi/tests/data/topology-7router-emu-dummy.json @@ -0,0 +1,157 @@ +{ + "dummy_mode": true, + "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": "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": [ + {"uuid": "1/1", "type": "copper"}, {"uuid": "1/2", "type": "copper"}, {"uuid": "1/3", "type": "copper"}, + {"uuid": "1/4", "type": "copper"}, {"uuid": "1/5", "type": "copper"}, {"uuid": "1/6", "type": "copper"}, + {"uuid": "2/1", "type": "copper"}, {"uuid": "2/2", "type": "copper"}, {"uuid": "2/3", "type": "copper"} + ]}}} + ]}}, + {"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": [ + {"uuid": "1/1", "type": "copper"}, {"uuid": "1/2", "type": "copper"}, {"uuid": "1/3", "type": "copper"}, + {"uuid": "1/4", "type": "copper"}, {"uuid": "1/5", "type": "copper"}, {"uuid": "1/6", "type": "copper"}, + {"uuid": "2/1", "type": "copper"}, {"uuid": "2/2", "type": "copper"}, {"uuid": "2/3", "type": "copper"} + ]}}} + ]}}, + {"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": [ + {"uuid": "1/1", "type": "copper"}, {"uuid": "1/2", "type": "copper"}, {"uuid": "1/3", "type": "copper"}, + {"uuid": "1/4", "type": "copper"}, {"uuid": "1/5", "type": "copper"}, {"uuid": "1/6", "type": "copper"}, + {"uuid": "2/1", "type": "copper"}, {"uuid": "2/2", "type": "copper"}, {"uuid": "2/3", "type": "copper"} + ]}}} + ]}}, + {"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": [ + {"uuid": "1/1", "type": "copper"}, {"uuid": "1/2", "type": "copper"}, {"uuid": "1/3", "type": "copper"}, + {"uuid": "1/4", "type": "copper"}, {"uuid": "1/5", "type": "copper"}, {"uuid": "1/6", "type": "copper"}, + {"uuid": "2/1", "type": "copper"}, {"uuid": "2/2", "type": "copper"}, {"uuid": "2/3", "type": "copper"} + ]}}} + ]}}, + {"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": [ + {"uuid": "1/1", "type": "copper"}, {"uuid": "1/2", "type": "copper"}, {"uuid": "1/3", "type": "copper"}, + {"uuid": "1/4", "type": "copper"}, {"uuid": "1/5", "type": "copper"}, {"uuid": "1/6", "type": "copper"}, + {"uuid": "2/1", "type": "copper"}, {"uuid": "2/2", "type": "copper"}, {"uuid": "2/3", "type": "copper"} + ]}}} + ]}}, + {"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": [ + {"uuid": "1/1", "type": "copper"}, {"uuid": "1/2", "type": "copper"}, {"uuid": "1/3", "type": "copper"}, + {"uuid": "1/4", "type": "copper"}, {"uuid": "1/5", "type": "copper"}, {"uuid": "1/6", "type": "copper"}, + {"uuid": "2/1", "type": "copper"}, {"uuid": "2/2", "type": "copper"}, {"uuid": "2/3", "type": "copper"} + ]}}} + ]}}, + {"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": [ + {"uuid": "1/1", "type": "copper"}, {"uuid": "1/2", "type": "copper"}, + {"uuid": "1/3", "type": "copper"}, {"uuid": "2/1", "type": "copper"}, + {"uuid": "2/2", "type": "copper"}, {"uuid": "2/3", "type": "copper"}, + {"uuid": "2/4", "type": "copper"}, {"uuid": "2/5", "type": "copper"}, + {"uuid": "2/6", "type": "copper"} + ]}}} + ]}} + ], + "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": "R1==R6"}}, "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "R1"}}, "endpoint_uuid": {"uuid": "2/2"}}, + {"device_id": {"device_uuid": {"uuid": "R6"}}, "endpoint_uuid": {"uuid": "2/1"}} + ]}, + {"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": "R2==R1"}}, "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "R2"}}, "endpoint_uuid": {"uuid": "2/2"}}, + {"device_id": {"device_uuid": {"uuid": "R1"}}, "endpoint_uuid": {"uuid": "2/1"}} + ]}, + {"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==R2"}}, "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "R3"}}, "endpoint_uuid": {"uuid": "2/2"}}, + {"device_id": {"device_uuid": {"uuid": "R2"}}, "endpoint_uuid": {"uuid": "2/1"}} + ]}, + {"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": "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": "R4==R3"}}, "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "R4"}}, "endpoint_uuid": {"uuid": "2/2"}}, + {"device_id": {"device_uuid": {"uuid": "R3"}}, "endpoint_uuid": {"uuid": "2/1"}} + ]}, + {"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==R4"}}, "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "R5"}}, "endpoint_uuid": {"uuid": "2/2"}}, + {"device_id": {"device_uuid": {"uuid": "R4"}}, "endpoint_uuid": {"uuid": "2/1"}} + ]}, + {"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": "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"}} + ]}, + {"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": "R6==R5"}}, "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "R6"}}, "endpoint_uuid": {"uuid": "2/2"}}, + {"device_id": {"device_uuid": {"uuid": "R5"}}, "endpoint_uuid": {"uuid": "2/1"}} + ]}, + {"link_id": {"link_uuid": {"uuid": "R7==R1"}}, "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "R7"}}, "endpoint_uuid": {"uuid": "2/1"}}, + {"device_id": {"device_uuid": {"uuid": "R1"}}, "endpoint_uuid": {"uuid": "2/3"}} + ]}, + {"link_id": {"link_uuid": {"uuid": "R7==R3"}}, "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "R7"}}, "endpoint_uuid": {"uuid": "2/3"}}, + {"device_id": {"device_uuid": {"uuid": "R3"}}, "endpoint_uuid": {"uuid": "2/3"}} + ]}, + {"link_id": {"link_uuid": {"uuid": "R7==R5"}}, "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "R7"}}, "endpoint_uuid": {"uuid": "2/5"}}, + {"device_id": {"device_uuid": {"uuid": "R5"}}, "endpoint_uuid": {"uuid": "2/3"}} + ]} + ] +} diff --git a/src/nbi/tests/data/topology-7router-emu.json b/src/nbi/tests/data/topology-7router-emu.json new file mode 100644 index 0000000000000000000000000000000000000000..4174f4fb460c6ff31ff56a45122d9a589f265f80 --- /dev/null +++ b/src/nbi/tests/data/topology-7router-emu.json @@ -0,0 +1,156 @@ +{ + "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": "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": [ + {"uuid": "1/1", "type": "copper"}, {"uuid": "1/2", "type": "copper"}, {"uuid": "1/3", "type": "copper"}, + {"uuid": "1/4", "type": "copper"}, {"uuid": "1/5", "type": "copper"}, {"uuid": "1/6", "type": "copper"}, + {"uuid": "2/1", "type": "copper"}, {"uuid": "2/2", "type": "copper"}, {"uuid": "2/3", "type": "copper"} + ]}}} + ]}}, + {"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": [ + {"uuid": "1/1", "type": "copper"}, {"uuid": "1/2", "type": "copper"}, {"uuid": "1/3", "type": "copper"}, + {"uuid": "1/4", "type": "copper"}, {"uuid": "1/5", "type": "copper"}, {"uuid": "1/6", "type": "copper"}, + {"uuid": "2/1", "type": "copper"}, {"uuid": "2/2", "type": "copper"}, {"uuid": "2/3", "type": "copper"} + ]}}} + ]}}, + {"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": [ + {"uuid": "1/1", "type": "copper"}, {"uuid": "1/2", "type": "copper"}, {"uuid": "1/3", "type": "copper"}, + {"uuid": "1/4", "type": "copper"}, {"uuid": "1/5", "type": "copper"}, {"uuid": "1/6", "type": "copper"}, + {"uuid": "2/1", "type": "copper"}, {"uuid": "2/2", "type": "copper"}, {"uuid": "2/3", "type": "copper"} + ]}}} + ]}}, + {"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": [ + {"uuid": "1/1", "type": "copper"}, {"uuid": "1/2", "type": "copper"}, {"uuid": "1/3", "type": "copper"}, + {"uuid": "1/4", "type": "copper"}, {"uuid": "1/5", "type": "copper"}, {"uuid": "1/6", "type": "copper"}, + {"uuid": "2/1", "type": "copper"}, {"uuid": "2/2", "type": "copper"}, {"uuid": "2/3", "type": "copper"} + ]}}} + ]}}, + {"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": [ + {"uuid": "1/1", "type": "copper"}, {"uuid": "1/2", "type": "copper"}, {"uuid": "1/3", "type": "copper"}, + {"uuid": "1/4", "type": "copper"}, {"uuid": "1/5", "type": "copper"}, {"uuid": "1/6", "type": "copper"}, + {"uuid": "2/1", "type": "copper"}, {"uuid": "2/2", "type": "copper"}, {"uuid": "2/3", "type": "copper"} + ]}}} + ]}}, + {"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": [ + {"uuid": "1/1", "type": "copper"}, {"uuid": "1/2", "type": "copper"}, {"uuid": "1/3", "type": "copper"}, + {"uuid": "1/4", "type": "copper"}, {"uuid": "1/5", "type": "copper"}, {"uuid": "1/6", "type": "copper"}, + {"uuid": "2/1", "type": "copper"}, {"uuid": "2/2", "type": "copper"}, {"uuid": "2/3", "type": "copper"} + ]}}} + ]}}, + {"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": [ + {"uuid": "1/1", "type": "copper"}, {"uuid": "1/2", "type": "copper"}, + {"uuid": "1/3", "type": "copper"}, {"uuid": "2/1", "type": "copper"}, + {"uuid": "2/2", "type": "copper"}, {"uuid": "2/3", "type": "copper"}, + {"uuid": "2/4", "type": "copper"}, {"uuid": "2/5", "type": "copper"}, + {"uuid": "2/6", "type": "copper"} + ]}}} + ]}} + ], + "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": "R1==R6"}}, "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "R1"}}, "endpoint_uuid": {"uuid": "2/2"}}, + {"device_id": {"device_uuid": {"uuid": "R6"}}, "endpoint_uuid": {"uuid": "2/1"}} + ]}, + {"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": "R2==R1"}}, "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "R2"}}, "endpoint_uuid": {"uuid": "2/2"}}, + {"device_id": {"device_uuid": {"uuid": "R1"}}, "endpoint_uuid": {"uuid": "2/1"}} + ]}, + {"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==R2"}}, "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "R3"}}, "endpoint_uuid": {"uuid": "2/2"}}, + {"device_id": {"device_uuid": {"uuid": "R2"}}, "endpoint_uuid": {"uuid": "2/1"}} + ]}, + {"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": "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": "R4==R3"}}, "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "R4"}}, "endpoint_uuid": {"uuid": "2/2"}}, + {"device_id": {"device_uuid": {"uuid": "R3"}}, "endpoint_uuid": {"uuid": "2/1"}} + ]}, + {"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==R4"}}, "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "R5"}}, "endpoint_uuid": {"uuid": "2/2"}}, + {"device_id": {"device_uuid": {"uuid": "R4"}}, "endpoint_uuid": {"uuid": "2/1"}} + ]}, + {"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": "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"}} + ]}, + {"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": "R6==R5"}}, "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "R6"}}, "endpoint_uuid": {"uuid": "2/2"}}, + {"device_id": {"device_uuid": {"uuid": "R5"}}, "endpoint_uuid": {"uuid": "2/1"}} + ]}, + {"link_id": {"link_uuid": {"uuid": "R7==R1"}}, "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "R7"}}, "endpoint_uuid": {"uuid": "2/1"}}, + {"device_id": {"device_uuid": {"uuid": "R1"}}, "endpoint_uuid": {"uuid": "2/3"}} + ]}, + {"link_id": {"link_uuid": {"uuid": "R7==R3"}}, "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "R7"}}, "endpoint_uuid": {"uuid": "2/3"}}, + {"device_id": {"device_uuid": {"uuid": "R3"}}, "endpoint_uuid": {"uuid": "2/3"}} + ]}, + {"link_id": {"link_uuid": {"uuid": "R7==R5"}}, "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "R7"}}, "endpoint_uuid": {"uuid": "2/5"}}, + {"device_id": {"device_uuid": {"uuid": "R5"}}, "endpoint_uuid": {"uuid": "2/3"}} + ]} + ] +} diff --git a/src/nbi/tests/data/topology-dummy.json b/src/nbi/tests/data/topology-dummy.json new file mode 100644 index 0000000000000000000000000000000000000000..f066051eedf4e2c09b6987ec781c9c17ea4afd82 --- /dev/null +++ b/src/nbi/tests/data/topology-dummy.json @@ -0,0 +1,3134 @@ +{ + "contexts": [ + { + "context_id": { + "context_uuid": { + "uuid": "admin" + } + }, + "name": "admin", + "service_ids": [], + "slice_ids": [], + "topology_ids": [ + { + "context_id": { + "context_uuid": { + "uuid": "admin" + } + }, + "topology_uuid": { + "uuid": "admin" + } + } + ] + } + ], + "devices": [ + { + "components": [], + "controller_id": {}, + "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": [ + { + "name": "mgmt", + "type": "mgmt", + "uuid": "mgmt" + }, + { + "name": "200", + "type": "copper", + "uuid": "200" + }, + { + "name": "500", + "type": "optical", + "uuid": "500" + }, + { + "name": "501", + "type": "optical", + "uuid": "501" + } + ] + } + } + }, + { + "action": 1, + "custom": { + "resource_key": "/endpoints/endpoint[mgmt]", + "resource_value": { + "name": "mgmt", + "type": "mgmt", + "uuid": "mgmt" + } + } + }, + { + "action": 1, + "custom": { + "resource_key": "/endpoints/endpoint[200]", + "resource_value": { + "name": "200", + "type": "copper", + "uuid": "200" + } + } + }, + { + "action": 1, + "custom": { + "resource_key": "/endpoints/endpoint[500]", + "resource_value": { + "name": "500", + "type": "optical", + "uuid": "500" + } + } + }, + { + "action": 1, + "custom": { + "resource_key": "/endpoints/endpoint[501]", + "resource_value": { + "name": "501", + "type": "optical", + "uuid": "501" + } + } + } + ] + }, + "device_drivers": [ + 0 + ], + "device_endpoints": [ + { + "endpoint_id": { + "device_id": { + "device_uuid": { + "uuid": "0392c251-b5d3-526b-8f3b-a3d4137829fa" + } + }, + "endpoint_uuid": { + "uuid": "161ad889-3839-5dfb-a4a9-95a1de8c3ad5" + }, + "topology_id": { + "context_id": { + "context_uuid": { + "uuid": "admin" + } + }, + "topology_uuid": { + "uuid": "admin" + } + } + }, + "endpoint_location": {}, + "endpoint_type": "optical", + "kpi_sample_types": [], + "name": "500" + }, + { + "endpoint_id": { + "device_id": { + "device_uuid": { + "uuid": "0392c251-b5d3-526b-8f3b-a3d4137829fa" + } + }, + "endpoint_uuid": { + "uuid": "1e35cf03-d55d-5648-9cb6-fca37bfbf23a" + }, + "topology_id": { + "context_id": { + "context_uuid": { + "uuid": "admin" + } + }, + "topology_uuid": { + "uuid": "admin" + } + } + }, + "endpoint_location": {}, + "endpoint_type": "copper", + "kpi_sample_types": [], + "name": "200" + }, + { + "endpoint_id": { + "device_id": { + "device_uuid": { + "uuid": "0392c251-b5d3-526b-8f3b-a3d4137829fa" + } + }, + "endpoint_uuid": { + "uuid": "859813e0-24c1-518e-ba77-44a4f392e321" + }, + "topology_id": { + "context_id": { + "context_uuid": { + "uuid": "admin" + } + }, + "topology_uuid": { + "uuid": "admin" + } + } + }, + "endpoint_location": {}, + "endpoint_type": "optical", + "kpi_sample_types": [], + "name": "501" + }, + { + "endpoint_id": { + "device_id": { + "device_uuid": { + "uuid": "0392c251-b5d3-526b-8f3b-a3d4137829fa" + } + }, + "endpoint_uuid": { + "uuid": "b72983bd-57d8-5cf8-8ec7-da9084382d7a" + }, + "topology_id": { + "context_id": { + "context_uuid": { + "uuid": "admin" + } + }, + "topology_uuid": { + "uuid": "admin" + } + } + }, + "endpoint_location": {}, + "endpoint_type": "mgmt", + "kpi_sample_types": [], + "name": "mgmt" + } + ], + "device_id": { + "device_uuid": { + "uuid": "0392c251-b5d3-526b-8f3b-a3d4137829fa" + } + }, + "device_operational_status": 2, + "device_type": "emu-packet-router", + "name": "10.0.30.1" + }, + { + "components": [], + "controller_id": {}, + "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": [ + { + "name": "200", + "type": "copper", + "uuid": "200" + }, + { + "name": "500", + "type": "copper", + "uuid": "500" + } + ] + } + } + }, + { + "action": 1, + "custom": { + "resource_key": "/endpoints/endpoint[200]", + "resource_value": { + "name": "200", + "type": "copper", + "uuid": "200" + } + } + }, + { + "action": 1, + "custom": { + "resource_key": "/endpoints/endpoint[500]", + "resource_value": { + "name": "500", + "type": "copper", + "uuid": "500" + } + } + } + ] + }, + "device_drivers": [ + 0 + ], + "device_endpoints": [ + { + "endpoint_id": { + "device_id": { + "device_uuid": { + "uuid": "118295c8-318a-52ec-a394-529fc4b70f2f" + } + }, + "endpoint_uuid": { + "uuid": "207ef8a3-18fd-5a63-ac24-4a1cc6af3e92" + }, + "topology_id": { + "context_id": { + "context_uuid": { + "uuid": "admin" + } + }, + "topology_uuid": { + "uuid": "admin" + } + } + }, + "endpoint_location": {}, + "endpoint_type": "copper", + "kpi_sample_types": [], + "name": "200" + }, + { + "endpoint_id": { + "device_id": { + "device_uuid": { + "uuid": "118295c8-318a-52ec-a394-529fc4b70f2f" + } + }, + "endpoint_uuid": { + "uuid": "6fad7bc2-4ce5-5794-8bf0-ddd06cde20a6" + }, + "topology_id": { + "context_id": { + "context_uuid": { + "uuid": "admin" + } + }, + "topology_uuid": { + "uuid": "admin" + } + } + }, + "endpoint_location": {}, + "endpoint_type": "copper", + "kpi_sample_types": [], + "name": "500" + } + ], + "device_id": { + "device_uuid": { + "uuid": "118295c8-318a-52ec-a394-529fc4b70f2f" + } + }, + "device_operational_status": 2, + "device_type": "emu-packet-router", + "name": "128.32.10.1" + }, + { + "components": [], + "controller_id": {}, + "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": [ + { + "name": "200", + "type": "copper", + "uuid": "200" + }, + { + "name": "201", + "type": "copper", + "uuid": "201" + }, + { + "name": "500", + "type": "copper", + "uuid": "500" + } + ] + } + } + }, + { + "action": 1, + "custom": { + "resource_key": "/endpoints/endpoint[200]", + "resource_value": { + "name": "200", + "type": "copper", + "uuid": "200" + } + } + }, + { + "action": 1, + "custom": { + "resource_key": "/endpoints/endpoint[201]", + "resource_value": { + "name": "201", + "type": "copper", + "uuid": "201" + } + } + }, + { + "action": 1, + "custom": { + "resource_key": "/endpoints/endpoint[500]", + "resource_value": { + "name": "500", + "type": "copper", + "uuid": "500" + } + } + } + ] + }, + "device_drivers": [ + 0 + ], + "device_endpoints": [ + { + "endpoint_id": { + "device_id": { + "device_uuid": { + "uuid": "4c367472-545c-544d-935d-829f0a0e1c72" + } + }, + "endpoint_uuid": { + "uuid": "227b6bb2-dacf-5b3d-84e9-c1d0c107bcd8" + }, + "topology_id": { + "context_id": { + "context_uuid": { + "uuid": "admin" + } + }, + "topology_uuid": { + "uuid": "admin" + } + } + }, + "endpoint_location": {}, + "endpoint_type": "copper", + "kpi_sample_types": [], + "name": "201" + }, + { + "endpoint_id": { + "device_id": { + "device_uuid": { + "uuid": "4c367472-545c-544d-935d-829f0a0e1c72" + } + }, + "endpoint_uuid": { + "uuid": "3d0c36bb-80dc-5bab-8a7d-c47cce8d474f" + }, + "topology_id": { + "context_id": { + "context_uuid": { + "uuid": "admin" + } + }, + "topology_uuid": { + "uuid": "admin" + } + } + }, + "endpoint_location": {}, + "endpoint_type": "copper", + "kpi_sample_types": [], + "name": "500" + }, + { + "endpoint_id": { + "device_id": { + "device_uuid": { + "uuid": "4c367472-545c-544d-935d-829f0a0e1c72" + } + }, + "endpoint_uuid": { + "uuid": "d8528b70-9215-59ed-851d-b9590ab0c94b" + }, + "topology_id": { + "context_id": { + "context_uuid": { + "uuid": "admin" + } + }, + "topology_uuid": { + "uuid": "admin" + } + } + }, + "endpoint_location": {}, + "endpoint_type": "copper", + "kpi_sample_types": [], + "name": "200" + } + ], + "device_id": { + "device_uuid": { + "uuid": "4c367472-545c-544d-935d-829f0a0e1c72" + } + }, + "device_operational_status": 2, + "device_type": "emu-datacenter", + "name": "172.10.33.5" + }, + { + "components": [], + "controller_id": {}, + "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": [ + { + "name": "mgmt", + "type": "mgmt", + "uuid": "mgmt" + }, + { + "name": "500", + "type": "optical", + "uuid": "500" + }, + { + "name": "501", + "type": "optical", + "uuid": "501" + } + ] + } + } + }, + { + "action": 1, + "custom": { + "resource_key": "/endpoints/endpoint[mgmt]", + "resource_value": { + "name": "mgmt", + "type": "mgmt", + "uuid": "mgmt" + } + } + }, + { + "action": 1, + "custom": { + "resource_key": "/endpoints/endpoint[500]", + "resource_value": { + "name": "500", + "type": "optical", + "uuid": "500" + } + } + }, + { + "action": 1, + "custom": { + "resource_key": "/endpoints/endpoint[501]", + "resource_value": { + "name": "501", + "type": "optical", + "uuid": "501" + } + } + } + ] + }, + "device_drivers": [ + 0 + ], + "device_endpoints": [ + { + "endpoint_id": { + "device_id": { + "device_uuid": { + "uuid": "4f2234d0-a9b8-5a86-b1dd-9139d86e3925" + } + }, + "endpoint_uuid": { + "uuid": "75e62edc-a0f9-53f9-821b-023045db1551" + }, + "topology_id": { + "context_id": { + "context_uuid": { + "uuid": "admin" + } + }, + "topology_uuid": { + "uuid": "admin" + } + } + }, + "endpoint_location": {}, + "endpoint_type": "optical", + "kpi_sample_types": [], + "name": "501" + }, + { + "endpoint_id": { + "device_id": { + "device_uuid": { + "uuid": "4f2234d0-a9b8-5a86-b1dd-9139d86e3925" + } + }, + "endpoint_uuid": { + "uuid": "b5efeee2-5062-5d8f-ae06-f901fed7a7d7" + }, + "topology_id": { + "context_id": { + "context_uuid": { + "uuid": "admin" + } + }, + "topology_uuid": { + "uuid": "admin" + } + } + }, + "endpoint_location": {}, + "endpoint_type": "optical", + "kpi_sample_types": [], + "name": "500" + }, + { + "endpoint_id": { + "device_id": { + "device_uuid": { + "uuid": "4f2234d0-a9b8-5a86-b1dd-9139d86e3925" + } + }, + "endpoint_uuid": { + "uuid": "ede34dea-6b51-5787-88d2-553fe548f540" + }, + "topology_id": { + "context_id": { + "context_uuid": { + "uuid": "admin" + } + }, + "topology_uuid": { + "uuid": "admin" + } + } + }, + "endpoint_location": {}, + "endpoint_type": "mgmt", + "kpi_sample_types": [], + "name": "mgmt" + } + ], + "device_id": { + "device_uuid": { + "uuid": "4f2234d0-a9b8-5a86-b1dd-9139d86e3925" + } + }, + "device_operational_status": 2, + "device_type": "emu-packet-router", + "name": "10.0.40.1" + }, + { + "components": [], + "controller_id": {}, + "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": [ + { + "name": "200", + "type": "copper", + "uuid": "200" + }, + { + "name": "201", + "type": "copper", + "uuid": "201" + }, + { + "name": "500", + "type": "copper", + "uuid": "500" + } + ] + } + } + }, + { + "action": 1, + "custom": { + "resource_key": "/endpoints/endpoint[200]", + "resource_value": { + "name": "200", + "type": "copper", + "uuid": "200" + } + } + }, + { + "action": 1, + "custom": { + "resource_key": "/endpoints/endpoint[201]", + "resource_value": { + "name": "201", + "type": "copper", + "uuid": "201" + } + } + }, + { + "action": 1, + "custom": { + "resource_key": "/endpoints/endpoint[500]", + "resource_value": { + "name": "500", + "type": "copper", + "uuid": "500" + } + } + } + ] + }, + "device_drivers": [ + 0 + ], + "device_endpoints": [ + { + "endpoint_id": { + "device_id": { + "device_uuid": { + "uuid": "97d846b3-d0ba-5b4d-b12e-a9365eda205c" + } + }, + "endpoint_uuid": { + "uuid": "387f7f12-3168-5c75-801e-f06c8afdbf88" + }, + "topology_id": { + "context_id": { + "context_uuid": { + "uuid": "admin" + } + }, + "topology_uuid": { + "uuid": "admin" + } + } + }, + "endpoint_location": {}, + "endpoint_type": "copper", + "kpi_sample_types": [], + "name": "201" + }, + { + "endpoint_id": { + "device_id": { + "device_uuid": { + "uuid": "97d846b3-d0ba-5b4d-b12e-a9365eda205c" + } + }, + "endpoint_uuid": { + "uuid": "9095f6af-6381-54fa-9a0e-b1ef5720d163" + }, + "topology_id": { + "context_id": { + "context_uuid": { + "uuid": "admin" + } + }, + "topology_uuid": { + "uuid": "admin" + } + } + }, + "endpoint_location": {}, + "endpoint_type": "copper", + "kpi_sample_types": [], + "name": "500" + }, + { + "endpoint_id": { + "device_id": { + "device_uuid": { + "uuid": "97d846b3-d0ba-5b4d-b12e-a9365eda205c" + } + }, + "endpoint_uuid": { + "uuid": "c6435612-3aca-590f-89ba-e606f54df474" + }, + "topology_id": { + "context_id": { + "context_uuid": { + "uuid": "admin" + } + }, + "topology_uuid": { + "uuid": "admin" + } + } + }, + "endpoint_location": {}, + "endpoint_type": "copper", + "kpi_sample_types": [], + "name": "200" + } + ], + "device_id": { + "device_uuid": { + "uuid": "97d846b3-d0ba-5b4d-b12e-a9365eda205c" + } + }, + "device_operational_status": 2, + "device_type": "emu-optical-transponder", + "name": "128.32.33.5" + }, + { + "components": [], + "controller_id": {}, + "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": [ + { + "name": "mgmt", + "type": "mgmt", + "uuid": "mgmt" + }, + { + "name": "200", + "type": "copper", + "uuid": "200" + }, + { + "name": "500", + "type": "optical", + "uuid": "500" + }, + { + "name": "501", + "type": "optical", + "uuid": "501" + } + ] + } + } + }, + { + "action": 1, + "custom": { + "resource_key": "/endpoints/endpoint[mgmt]", + "resource_value": { + "name": "mgmt", + "type": "mgmt", + "uuid": "mgmt" + } + } + }, + { + "action": 1, + "custom": { + "resource_key": "/endpoints/endpoint[200]", + "resource_value": { + "name": "200", + "type": "copper", + "uuid": "200" + } + } + }, + { + "action": 1, + "custom": { + "resource_key": "/endpoints/endpoint[500]", + "resource_value": { + "name": "500", + "type": "optical", + "uuid": "500" + } + } + }, + { + "action": 1, + "custom": { + "resource_key": "/endpoints/endpoint[501]", + "resource_value": { + "name": "501", + "type": "optical", + "uuid": "501" + } + } + } + ] + }, + "device_drivers": [ + 0 + ], + "device_endpoints": [ + { + "endpoint_id": { + "device_id": { + "device_uuid": { + "uuid": "bf749ed2-fcc4-5bfc-9116-4ea18b722069" + } + }, + "endpoint_uuid": { + "uuid": "59e1e30f-ea65-5e04-8a91-760a648a02c6" + }, + "topology_id": { + "context_id": { + "context_uuid": { + "uuid": "admin" + } + }, + "topology_uuid": { + "uuid": "admin" + } + } + }, + "endpoint_location": {}, + "endpoint_type": "mgmt", + "kpi_sample_types": [], + "name": "mgmt" + }, + { + "endpoint_id": { + "device_id": { + "device_uuid": { + "uuid": "bf749ed2-fcc4-5bfc-9116-4ea18b722069" + } + }, + "endpoint_uuid": { + "uuid": "70cbb732-8149-59ee-939b-011828e4292b" + }, + "topology_id": { + "context_id": { + "context_uuid": { + "uuid": "admin" + } + }, + "topology_uuid": { + "uuid": "admin" + } + } + }, + "endpoint_location": {}, + "endpoint_type": "copper", + "kpi_sample_types": [], + "name": "200" + }, + { + "endpoint_id": { + "device_id": { + "device_uuid": { + "uuid": "bf749ed2-fcc4-5bfc-9116-4ea18b722069" + } + }, + "endpoint_uuid": { + "uuid": "a2579e11-2e86-5e53-a235-3dd6ba92bb9a" + }, + "topology_id": { + "context_id": { + "context_uuid": { + "uuid": "admin" + } + }, + "topology_uuid": { + "uuid": "admin" + } + } + }, + "endpoint_location": {}, + "endpoint_type": "optical", + "kpi_sample_types": [], + "name": "500" + }, + { + "endpoint_id": { + "device_id": { + "device_uuid": { + "uuid": "bf749ed2-fcc4-5bfc-9116-4ea18b722069" + } + }, + "endpoint_uuid": { + "uuid": "ad2e136d-a981-5c9a-8427-07352ac03351" + }, + "topology_id": { + "context_id": { + "context_uuid": { + "uuid": "admin" + } + }, + "topology_uuid": { + "uuid": "admin" + } + } + }, + "endpoint_location": {}, + "endpoint_type": "optical", + "kpi_sample_types": [], + "name": "501" + } + ], + "device_id": { + "device_uuid": { + "uuid": "bf749ed2-fcc4-5bfc-9116-4ea18b722069" + } + }, + "device_operational_status": 2, + "device_type": "emu-packet-router", + "name": "10.0.10.1" + }, + { + "components": [], + "controller_id": {}, + "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": [ + { + "name": "mgmt", + "type": "mgmt", + "uuid": "mgmt" + }, + { + "name": "500", + "type": "optical", + "uuid": "500" + }, + { + "name": "501", + "type": "optical", + "uuid": "501" + } + ] + } + } + }, + { + "action": 1, + "custom": { + "resource_key": "/endpoints/endpoint[mgmt]", + "resource_value": { + "name": "mgmt", + "type": "mgmt", + "uuid": "mgmt" + } + } + }, + { + "action": 1, + "custom": { + "resource_key": "/endpoints/endpoint[500]", + "resource_value": { + "name": "500", + "type": "optical", + "uuid": "500" + } + } + }, + { + "action": 1, + "custom": { + "resource_key": "/endpoints/endpoint[501]", + "resource_value": { + "name": "501", + "type": "optical", + "uuid": "501" + } + } + } + ] + }, + "device_drivers": [ + 0 + ], + "device_endpoints": [ + { + "endpoint_id": { + "device_id": { + "device_uuid": { + "uuid": "cf9c4a78-f019-5023-aa0f-4fdba909473b" + } + }, + "endpoint_uuid": { + "uuid": "23c04144-5ad3-5419-8b96-cf4eb329ca96" + }, + "topology_id": { + "context_id": { + "context_uuid": { + "uuid": "admin" + } + }, + "topology_uuid": { + "uuid": "admin" + } + } + }, + "endpoint_location": {}, + "endpoint_type": "optical", + "kpi_sample_types": [], + "name": "501" + }, + { + "endpoint_id": { + "device_id": { + "device_uuid": { + "uuid": "cf9c4a78-f019-5023-aa0f-4fdba909473b" + } + }, + "endpoint_uuid": { + "uuid": "356378dd-952b-5032-912d-37fc21284b4c" + }, + "topology_id": { + "context_id": { + "context_uuid": { + "uuid": "admin" + } + }, + "topology_uuid": { + "uuid": "admin" + } + } + }, + "endpoint_location": {}, + "endpoint_type": "optical", + "kpi_sample_types": [], + "name": "500" + }, + { + "endpoint_id": { + "device_id": { + "device_uuid": { + "uuid": "cf9c4a78-f019-5023-aa0f-4fdba909473b" + } + }, + "endpoint_uuid": { + "uuid": "da826790-a4b0-5317-b30b-e1370918a644" + }, + "topology_id": { + "context_id": { + "context_uuid": { + "uuid": "admin" + } + }, + "topology_uuid": { + "uuid": "admin" + } + } + }, + "endpoint_location": {}, + "endpoint_type": "mgmt", + "kpi_sample_types": [], + "name": "mgmt" + } + ], + "device_id": { + "device_uuid": { + "uuid": "cf9c4a78-f019-5023-aa0f-4fdba909473b" + } + }, + "device_operational_status": 2, + "device_type": "emu-packet-router", + "name": "10.0.20.1" + }, + { + "components": [], + "controller_id": {}, + "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": [ + { + "name": "eth1", + "type": "copper", + "uuid": "eth1" + } + ] + } + } + }, + { + "action": 1, + "custom": { + "resource_key": "/endpoints/endpoint[eth1]", + "resource_value": { + "name": "eth1", + "type": "copper", + "uuid": "eth1" + } + } + } + ] + }, + "device_drivers": [ + 0 + ], + "device_endpoints": [ + { + "endpoint_id": { + "device_id": { + "device_uuid": { + "uuid": "df4be2f2-a4a2-587d-b3ed-61a53cae3aa6" + } + }, + "endpoint_uuid": { + "uuid": "0701f406-633f-53e7-a44d-c93384745df8" + }, + "topology_id": { + "context_id": { + "context_uuid": { + "uuid": "admin" + } + }, + "topology_uuid": { + "uuid": "admin" + } + } + }, + "endpoint_location": {}, + "endpoint_type": "copper", + "kpi_sample_types": [], + "name": "eth1" + } + ], + "device_id": { + "device_uuid": { + "uuid": "df4be2f2-a4a2-587d-b3ed-61a53cae3aa6" + } + }, + "device_operational_status": 2, + "device_type": "emu-client", + "name": "128.32.20.5" + }, + { + "components": [], + "controller_id": {}, + "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": [ + { + "name": "200", + "type": "copper", + "uuid": "200" + }, + { + "name": "500", + "type": "copper", + "uuid": "500" + } + ] + } + } + }, + { + "action": 1, + "custom": { + "resource_key": "/endpoints/endpoint[200]", + "resource_value": { + "name": "200", + "type": "copper", + "uuid": "200" + } + } + }, + { + "action": 1, + "custom": { + "resource_key": "/endpoints/endpoint[500]", + "resource_value": { + "name": "500", + "type": "copper", + "uuid": "500" + } + } + } + ] + }, + "device_drivers": [ + 0 + ], + "device_endpoints": [ + { + "endpoint_id": { + "device_id": { + "device_uuid": { + "uuid": "e15007fb-aae4-50d6-b686-b6dc4ae504e2" + } + }, + "endpoint_uuid": { + "uuid": "852a3fd3-3f55-5e31-865d-c52984efb186" + }, + "topology_id": { + "context_id": { + "context_uuid": { + "uuid": "admin" + } + }, + "topology_uuid": { + "uuid": "admin" + } + } + }, + "endpoint_location": {}, + "endpoint_type": "copper", + "kpi_sample_types": [], + "name": "500" + }, + { + "endpoint_id": { + "device_id": { + "device_uuid": { + "uuid": "e15007fb-aae4-50d6-b686-b6dc4ae504e2" + } + }, + "endpoint_uuid": { + "uuid": "bbbec9f8-618a-591a-bc3e-c188ee31008e" + }, + "topology_id": { + "context_id": { + "context_uuid": { + "uuid": "admin" + } + }, + "topology_uuid": { + "uuid": "admin" + } + } + }, + "endpoint_location": {}, + "endpoint_type": "copper", + "kpi_sample_types": [], + "name": "200" + } + ], + "device_id": { + "device_uuid": { + "uuid": "e15007fb-aae4-50d6-b686-b6dc4ae504e2" + } + }, + "device_operational_status": 2, + "device_type": "emu-packet-router", + "name": "128.32.20.1" + }, + { + "components": [], + "controller_id": {}, + "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": [ + { + "name": "eth1", + "type": "copper", + "uuid": "eth1" + } + ] + } + } + }, + { + "action": 1, + "custom": { + "resource_key": "/endpoints/endpoint[eth1]", + "resource_value": { + "name": "eth1", + "type": "copper", + "uuid": "eth1" + } + } + } + ] + }, + "device_drivers": [ + 0 + ], + "device_endpoints": [ + { + "endpoint_id": { + "device_id": { + "device_uuid": { + "uuid": "f3840f4a-6ea2-551a-8afd-0f3faa8ac1e6" + } + }, + "endpoint_uuid": { + "uuid": "16d56d61-63cd-5704-9d2a-5515e633b64b" + }, + "topology_id": { + "context_id": { + "context_uuid": { + "uuid": "admin" + } + }, + "topology_uuid": { + "uuid": "admin" + } + } + }, + "endpoint_location": {}, + "endpoint_type": "copper", + "kpi_sample_types": [], + "name": "eth1" + } + ], + "device_id": { + "device_uuid": { + "uuid": "f3840f4a-6ea2-551a-8afd-0f3faa8ac1e6" + } + }, + "device_operational_status": 2, + "device_type": "emu-client", + "name": "128.32.10.5" + }, + { + "components": [], + "controller_id": {}, + "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": [ + { + "name": "mgmt", + "type": "mgmt", + "uuid": "mgmt" + } + ] + } + } + }, + { + "action": 1, + "custom": { + "resource_key": "/endpoints/endpoint[mgmt]", + "resource_value": { + "name": "mgmt", + "type": "mgmt", + "uuid": "mgmt" + } + } + } + ] + }, + "device_drivers": [ + 0 + ], + "device_endpoints": [ + { + "endpoint_id": { + "device_id": { + "device_uuid": { + "uuid": "fe0dc2e8-b9ce-555f-8f28-a1a4468fabde" + } + }, + "endpoint_uuid": { + "uuid": "086906ec-fd3b-55e1-b9bb-5a9e5bb5daff" + }, + "topology_id": { + "context_id": { + "context_uuid": { + "uuid": "admin" + } + }, + "topology_uuid": { + "uuid": "admin" + } + } + }, + "endpoint_location": {}, + "endpoint_type": "mgmt", + "kpi_sample_types": [], + "name": "mgmt" + } + ], + "device_id": { + "device_uuid": { + "uuid": "fe0dc2e8-b9ce-555f-8f28-a1a4468fabde" + } + }, + "device_operational_status": 2, + "device_type": "emu-open-line-system", + "name": "nce-t" + } + ], + "dummy_mode": true, + "links": [ + { + "attributes": { + "total_capacity_gbps": 10.0, + "used_capacity_gbps": 0.0 + }, + "link_endpoint_ids": [ + { + "device_id": { + "device_uuid": { + "uuid": "bf749ed2-fcc4-5bfc-9116-4ea18b722069" + } + }, + "endpoint_uuid": { + "uuid": "70cbb732-8149-59ee-939b-011828e4292b" + }, + "topology_id": { + "context_id": { + "context_uuid": { + "uuid": "admin" + } + }, + "topology_uuid": { + "uuid": "admin" + } + } + }, + { + "device_id": { + "device_uuid": { + "uuid": "97d846b3-d0ba-5b4d-b12e-a9365eda205c" + } + }, + "endpoint_uuid": { + "uuid": "9095f6af-6381-54fa-9a0e-b1ef5720d163" + }, + "topology_id": { + "context_id": { + "context_uuid": { + "uuid": "admin" + } + }, + "topology_uuid": { + "uuid": "admin" + } + } + } + ], + "link_id": { + "link_uuid": { + "uuid": "0b3d5943-c2bf-595f-a805-dc29c2be2f52" + } + }, + "name": "10.0.10.1-200" + }, + { + "attributes": { + "total_capacity_gbps": 10.0, + "used_capacity_gbps": 0.0 + }, + "link_endpoint_ids": [ + { + "device_id": { + "device_uuid": { + "uuid": "4f2234d0-a9b8-5a86-b1dd-9139d86e3925" + } + }, + "endpoint_uuid": { + "uuid": "b5efeee2-5062-5d8f-ae06-f901fed7a7d7" + }, + "topology_id": { + "context_id": { + "context_uuid": { + "uuid": "admin" + } + }, + "topology_uuid": { + "uuid": "admin" + } + } + }, + { + "device_id": { + "device_uuid": { + "uuid": "bf749ed2-fcc4-5bfc-9116-4ea18b722069" + } + }, + "endpoint_uuid": { + "uuid": "a2579e11-2e86-5e53-a235-3dd6ba92bb9a" + }, + "topology_id": { + "context_id": { + "context_uuid": { + "uuid": "admin" + } + }, + "topology_uuid": { + "uuid": "admin" + } + } + } + ], + "link_id": { + "link_uuid": { + "uuid": "1490e70f-472c-5e4c-8280-21c48ed03477" + } + }, + "name": "10.0.40.1-500" + }, + { + "attributes": { + "total_capacity_gbps": 10.0, + "used_capacity_gbps": 0.0 + }, + "link_endpoint_ids": [ + { + "device_id": { + "device_uuid": { + "uuid": "118295c8-318a-52ec-a394-529fc4b70f2f" + } + }, + "endpoint_uuid": { + "uuid": "6fad7bc2-4ce5-5794-8bf0-ddd06cde20a6" + }, + "topology_id": { + "context_id": { + "context_uuid": { + "uuid": "admin" + } + }, + "topology_uuid": { + "uuid": "admin" + } + } + }, + { + "device_id": { + "device_uuid": { + "uuid": "97d846b3-d0ba-5b4d-b12e-a9365eda205c" + } + }, + "endpoint_uuid": { + "uuid": "c6435612-3aca-590f-89ba-e606f54df474" + }, + "topology_id": { + "context_id": { + "context_uuid": { + "uuid": "admin" + } + }, + "topology_uuid": { + "uuid": "admin" + } + } + } + ], + "link_id": { + "link_uuid": { + "uuid": "18ba8eb2-342b-5a73-aeae-7288ea9bb28b" + } + }, + "name": "128.32.10.1-500" + }, + { + "attributes": { + "total_capacity_gbps": 10.0, + "used_capacity_gbps": 0.0 + }, + "link_endpoint_ids": [ + { + "device_id": { + "device_uuid": { + "uuid": "118295c8-318a-52ec-a394-529fc4b70f2f" + } + }, + "endpoint_uuid": { + "uuid": "207ef8a3-18fd-5a63-ac24-4a1cc6af3e92" + }, + "topology_id": { + "context_id": { + "context_uuid": { + "uuid": "admin" + } + }, + "topology_uuid": { + "uuid": "admin" + } + } + }, + { + "device_id": { + "device_uuid": { + "uuid": "f3840f4a-6ea2-551a-8afd-0f3faa8ac1e6" + } + }, + "endpoint_uuid": { + "uuid": "16d56d61-63cd-5704-9d2a-5515e633b64b" + }, + "topology_id": { + "context_id": { + "context_uuid": { + "uuid": "admin" + } + }, + "topology_uuid": { + "uuid": "admin" + } + } + } + ], + "link_id": { + "link_uuid": { + "uuid": "1901b0dc-1b5e-5fdf-b9ac-9168787464c1" + } + }, + "name": "128.32.10.1-200" + }, + { + "attributes": { + "total_capacity_gbps": 10.0, + "used_capacity_gbps": 0.0 + }, + "link_endpoint_ids": [ + { + "device_id": { + "device_uuid": { + "uuid": "97d846b3-d0ba-5b4d-b12e-a9365eda205c" + } + }, + "endpoint_uuid": { + "uuid": "9095f6af-6381-54fa-9a0e-b1ef5720d163" + }, + "topology_id": { + "context_id": { + "context_uuid": { + "uuid": "admin" + } + }, + "topology_uuid": { + "uuid": "admin" + } + } + }, + { + "device_id": { + "device_uuid": { + "uuid": "bf749ed2-fcc4-5bfc-9116-4ea18b722069" + } + }, + "endpoint_uuid": { + "uuid": "70cbb732-8149-59ee-939b-011828e4292b" + }, + "topology_id": { + "context_id": { + "context_uuid": { + "uuid": "admin" + } + }, + "topology_uuid": { + "uuid": "admin" + } + } + } + ], + "link_id": { + "link_uuid": { + "uuid": "1afdae8b-a281-53aa-99c2-205afb8f4ee7" + } + }, + "name": "128.32.33.5-500" + }, + { + "attributes": { + "total_capacity_gbps": 10.0, + "used_capacity_gbps": 0.0 + }, + "link_endpoint_ids": [ + { + "device_id": { + "device_uuid": { + "uuid": "cf9c4a78-f019-5023-aa0f-4fdba909473b" + } + }, + "endpoint_uuid": { + "uuid": "356378dd-952b-5032-912d-37fc21284b4c" + }, + "topology_id": { + "context_id": { + "context_uuid": { + "uuid": "admin" + } + }, + "topology_uuid": { + "uuid": "admin" + } + } + }, + { + "device_id": { + "device_uuid": { + "uuid": "0392c251-b5d3-526b-8f3b-a3d4137829fa" + } + }, + "endpoint_uuid": { + "uuid": "161ad889-3839-5dfb-a4a9-95a1de8c3ad5" + }, + "topology_id": { + "context_id": { + "context_uuid": { + "uuid": "admin" + } + }, + "topology_uuid": { + "uuid": "admin" + } + } + } + ], + "link_id": { + "link_uuid": { + "uuid": "30ca0f8f-b150-57f2-ae5e-8a6844944783" + } + }, + "name": "10.0.20.1-500" + }, + { + "attributes": { + "total_capacity_gbps": 10.0, + "used_capacity_gbps": 0.0 + }, + "link_endpoint_ids": [ + { + "device_id": { + "device_uuid": { + "uuid": "cf9c4a78-f019-5023-aa0f-4fdba909473b" + } + }, + "endpoint_uuid": { + "uuid": "23c04144-5ad3-5419-8b96-cf4eb329ca96" + }, + "topology_id": { + "context_id": { + "context_uuid": { + "uuid": "admin" + } + }, + "topology_uuid": { + "uuid": "admin" + } + } + }, + { + "device_id": { + "device_uuid": { + "uuid": "bf749ed2-fcc4-5bfc-9116-4ea18b722069" + } + }, + "endpoint_uuid": { + "uuid": "ad2e136d-a981-5c9a-8427-07352ac03351" + }, + "topology_id": { + "context_id": { + "context_uuid": { + "uuid": "admin" + } + }, + "topology_uuid": { + "uuid": "admin" + } + } + } + ], + "link_id": { + "link_uuid": { + "uuid": "34c9c6c3-0dcf-54e5-ba67-da33eb2d3c1a" + } + }, + "name": "10.0.20.1-501" + }, + { + "attributes": { + "total_capacity_gbps": 10.0, + "used_capacity_gbps": 0.0 + }, + "link_endpoint_ids": [ + { + "device_id": { + "device_uuid": { + "uuid": "0392c251-b5d3-526b-8f3b-a3d4137829fa" + } + }, + "endpoint_uuid": { + "uuid": "161ad889-3839-5dfb-a4a9-95a1de8c3ad5" + }, + "topology_id": { + "context_id": { + "context_uuid": { + "uuid": "admin" + } + }, + "topology_uuid": { + "uuid": "admin" + } + } + }, + { + "device_id": { + "device_uuid": { + "uuid": "cf9c4a78-f019-5023-aa0f-4fdba909473b" + } + }, + "endpoint_uuid": { + "uuid": "356378dd-952b-5032-912d-37fc21284b4c" + }, + "topology_id": { + "context_id": { + "context_uuid": { + "uuid": "admin" + } + }, + "topology_uuid": { + "uuid": "admin" + } + } + } + ], + "link_id": { + "link_uuid": { + "uuid": "35801e61-45f3-564e-ad5c-09baf4aae906" + } + }, + "name": "10.0.30.1-500" + }, + { + "attributes": { + "total_capacity_gbps": 10.0, + "used_capacity_gbps": 0.0 + }, + "link_endpoint_ids": [ + { + "device_id": { + "device_uuid": { + "uuid": "4c367472-545c-544d-935d-829f0a0e1c72" + } + }, + "endpoint_uuid": { + "uuid": "3d0c36bb-80dc-5bab-8a7d-c47cce8d474f" + }, + "topology_id": { + "context_id": { + "context_uuid": { + "uuid": "admin" + } + }, + "topology_uuid": { + "uuid": "admin" + } + } + }, + { + "device_id": { + "device_uuid": { + "uuid": "0392c251-b5d3-526b-8f3b-a3d4137829fa" + } + }, + "endpoint_uuid": { + "uuid": "1e35cf03-d55d-5648-9cb6-fca37bfbf23a" + }, + "topology_id": { + "context_id": { + "context_uuid": { + "uuid": "admin" + } + }, + "topology_uuid": { + "uuid": "admin" + } + } + } + ], + "link_id": { + "link_uuid": { + "uuid": "36643dba-e8fa-5fb7-952d-dff313db957b" + } + }, + "name": "172.10.33.5-500" + }, + { + "link_endpoint_ids": [ + { + "device_id": { + "device_uuid": { + "uuid": "fe0dc2e8-b9ce-555f-8f28-a1a4468fabde" + } + }, + "endpoint_uuid": { + "uuid": "086906ec-fd3b-55e1-b9bb-5a9e5bb5daff" + }, + "topology_id": { + "context_id": { + "context_uuid": { + "uuid": "admin" + } + }, + "topology_uuid": { + "uuid": "admin" + } + } + }, + { + "device_id": { + "device_uuid": { + "uuid": "4f2234d0-a9b8-5a86-b1dd-9139d86e3925" + } + }, + "endpoint_uuid": { + "uuid": "ede34dea-6b51-5787-88d2-553fe548f540" + }, + "topology_id": { + "context_id": { + "context_uuid": { + "uuid": "admin" + } + }, + "topology_uuid": { + "uuid": "admin" + } + } + } + ], + "link_id": { + "link_uuid": { + "uuid": "36856920-3387-5384-b1b1-dbc9e54da226" + } + }, + "name": "nce-t/mgmt==10.0.40.1/mgmt" + }, + { + "link_endpoint_ids": [ + { + "device_id": { + "device_uuid": { + "uuid": "fe0dc2e8-b9ce-555f-8f28-a1a4468fabde" + } + }, + "endpoint_uuid": { + "uuid": "086906ec-fd3b-55e1-b9bb-5a9e5bb5daff" + }, + "topology_id": { + "context_id": { + "context_uuid": { + "uuid": "admin" + } + }, + "topology_uuid": { + "uuid": "admin" + } + } + }, + { + "device_id": { + "device_uuid": { + "uuid": "0392c251-b5d3-526b-8f3b-a3d4137829fa" + } + }, + "endpoint_uuid": { + "uuid": "b72983bd-57d8-5cf8-8ec7-da9084382d7a" + }, + "topology_id": { + "context_id": { + "context_uuid": { + "uuid": "admin" + } + }, + "topology_uuid": { + "uuid": "admin" + } + } + } + ], + "link_id": { + "link_uuid": { + "uuid": "46ba12f9-dd17-5f2a-9558-e4611515a6b9" + } + }, + "name": "nce-t/mgmt==10.0.30.1/mgmt" + }, + { + "attributes": { + "total_capacity_gbps": 10.0, + "used_capacity_gbps": 0.0 + }, + "link_endpoint_ids": [ + { + "device_id": { + "device_uuid": { + "uuid": "0392c251-b5d3-526b-8f3b-a3d4137829fa" + } + }, + "endpoint_uuid": { + "uuid": "859813e0-24c1-518e-ba77-44a4f392e321" + }, + "topology_id": { + "context_id": { + "context_uuid": { + "uuid": "admin" + } + }, + "topology_uuid": { + "uuid": "admin" + } + } + }, + { + "device_id": { + "device_uuid": { + "uuid": "4f2234d0-a9b8-5a86-b1dd-9139d86e3925" + } + }, + "endpoint_uuid": { + "uuid": "75e62edc-a0f9-53f9-821b-023045db1551" + }, + "topology_id": { + "context_id": { + "context_uuid": { + "uuid": "admin" + } + }, + "topology_uuid": { + "uuid": "admin" + } + } + } + ], + "link_id": { + "link_uuid": { + "uuid": "4dfe28dd-ac28-53d5-b330-1707e350d772" + } + }, + "name": "10.0.30.1-501" + }, + { + "attributes": { + "total_capacity_gbps": 10.0, + "used_capacity_gbps": 0.0 + }, + "link_endpoint_ids": [ + { + "device_id": { + "device_uuid": { + "uuid": "e15007fb-aae4-50d6-b686-b6dc4ae504e2" + } + }, + "endpoint_uuid": { + "uuid": "852a3fd3-3f55-5e31-865d-c52984efb186" + }, + "topology_id": { + "context_id": { + "context_uuid": { + "uuid": "admin" + } + }, + "topology_uuid": { + "uuid": "admin" + } + } + }, + { + "device_id": { + "device_uuid": { + "uuid": "97d846b3-d0ba-5b4d-b12e-a9365eda205c" + } + }, + "endpoint_uuid": { + "uuid": "387f7f12-3168-5c75-801e-f06c8afdbf88" + }, + "topology_id": { + "context_id": { + "context_uuid": { + "uuid": "admin" + } + }, + "topology_uuid": { + "uuid": "admin" + } + } + } + ], + "link_id": { + "link_uuid": { + "uuid": "644ab377-572c-53a4-8ab5-f5cf45591d88" + } + }, + "name": "128.32.20.1-500" + }, + { + "attributes": { + "total_capacity_gbps": 10.0, + "used_capacity_gbps": 0.0 + }, + "link_endpoint_ids": [ + { + "device_id": { + "device_uuid": { + "uuid": "97d846b3-d0ba-5b4d-b12e-a9365eda205c" + } + }, + "endpoint_uuid": { + "uuid": "c6435612-3aca-590f-89ba-e606f54df474" + }, + "topology_id": { + "context_id": { + "context_uuid": { + "uuid": "admin" + } + }, + "topology_uuid": { + "uuid": "admin" + } + } + }, + { + "device_id": { + "device_uuid": { + "uuid": "118295c8-318a-52ec-a394-529fc4b70f2f" + } + }, + "endpoint_uuid": { + "uuid": "6fad7bc2-4ce5-5794-8bf0-ddd06cde20a6" + }, + "topology_id": { + "context_id": { + "context_uuid": { + "uuid": "admin" + } + }, + "topology_uuid": { + "uuid": "admin" + } + } + } + ], + "link_id": { + "link_uuid": { + "uuid": "661ac531-4309-58cc-b70e-2a79492c2488" + } + }, + "name": "128.32.33.5-200" + }, + { + "attributes": { + "total_capacity_gbps": 10.0, + "used_capacity_gbps": 0.0 + }, + "link_endpoint_ids": [ + { + "device_id": { + "device_uuid": { + "uuid": "97d846b3-d0ba-5b4d-b12e-a9365eda205c" + } + }, + "endpoint_uuid": { + "uuid": "387f7f12-3168-5c75-801e-f06c8afdbf88" + }, + "topology_id": { + "context_id": { + "context_uuid": { + "uuid": "admin" + } + }, + "topology_uuid": { + "uuid": "admin" + } + } + }, + { + "device_id": { + "device_uuid": { + "uuid": "e15007fb-aae4-50d6-b686-b6dc4ae504e2" + } + }, + "endpoint_uuid": { + "uuid": "852a3fd3-3f55-5e31-865d-c52984efb186" + }, + "topology_id": { + "context_id": { + "context_uuid": { + "uuid": "admin" + } + }, + "topology_uuid": { + "uuid": "admin" + } + } + } + ], + "link_id": { + "link_uuid": { + "uuid": "6a236e01-853c-51d0-8915-2d09b45923b0" + } + }, + "name": "128.32.33.5-201" + }, + { + "link_endpoint_ids": [ + { + "device_id": { + "device_uuid": { + "uuid": "fe0dc2e8-b9ce-555f-8f28-a1a4468fabde" + } + }, + "endpoint_uuid": { + "uuid": "086906ec-fd3b-55e1-b9bb-5a9e5bb5daff" + }, + "topology_id": { + "context_id": { + "context_uuid": { + "uuid": "admin" + } + }, + "topology_uuid": { + "uuid": "admin" + } + } + }, + { + "device_id": { + "device_uuid": { + "uuid": "cf9c4a78-f019-5023-aa0f-4fdba909473b" + } + }, + "endpoint_uuid": { + "uuid": "da826790-a4b0-5317-b30b-e1370918a644" + }, + "topology_id": { + "context_id": { + "context_uuid": { + "uuid": "admin" + } + }, + "topology_uuid": { + "uuid": "admin" + } + } + } + ], + "link_id": { + "link_uuid": { + "uuid": "6c802ae7-59d1-55e7-9498-146c465bcab5" + } + }, + "name": "nce-t/mgmt==10.0.20.1/mgmt" + }, + { + "attributes": { + "total_capacity_gbps": 10.0, + "used_capacity_gbps": 0.0 + }, + "link_endpoint_ids": [ + { + "device_id": { + "device_uuid": { + "uuid": "e15007fb-aae4-50d6-b686-b6dc4ae504e2" + } + }, + "endpoint_uuid": { + "uuid": "bbbec9f8-618a-591a-bc3e-c188ee31008e" + }, + "topology_id": { + "context_id": { + "context_uuid": { + "uuid": "admin" + } + }, + "topology_uuid": { + "uuid": "admin" + } + } + }, + { + "device_id": { + "device_uuid": { + "uuid": "df4be2f2-a4a2-587d-b3ed-61a53cae3aa6" + } + }, + "endpoint_uuid": { + "uuid": "0701f406-633f-53e7-a44d-c93384745df8" + }, + "topology_id": { + "context_id": { + "context_uuid": { + "uuid": "admin" + } + }, + "topology_uuid": { + "uuid": "admin" + } + } + } + ], + "link_id": { + "link_uuid": { + "uuid": "6fa77ad9-e4d7-5830-bf84-ab206eff613a" + } + }, + "name": "128.32.20.1-200" + }, + { + "attributes": { + "total_capacity_gbps": 10.0, + "used_capacity_gbps": 0.0 + }, + "link_endpoint_ids": [ + { + "device_id": { + "device_uuid": { + "uuid": "0392c251-b5d3-526b-8f3b-a3d4137829fa" + } + }, + "endpoint_uuid": { + "uuid": "1e35cf03-d55d-5648-9cb6-fca37bfbf23a" + }, + "topology_id": { + "context_id": { + "context_uuid": { + "uuid": "admin" + } + }, + "topology_uuid": { + "uuid": "admin" + } + } + }, + { + "device_id": { + "device_uuid": { + "uuid": "4c367472-545c-544d-935d-829f0a0e1c72" + } + }, + "endpoint_uuid": { + "uuid": "3d0c36bb-80dc-5bab-8a7d-c47cce8d474f" + }, + "topology_id": { + "context_id": { + "context_uuid": { + "uuid": "admin" + } + }, + "topology_uuid": { + "uuid": "admin" + } + } + } + ], + "link_id": { + "link_uuid": { + "uuid": "808b54e8-3d5a-5e03-a42e-d6c2a57cf6f3" + } + }, + "name": "10.0.30.1-200" + }, + { + "link_endpoint_ids": [ + { + "device_id": { + "device_uuid": { + "uuid": "fe0dc2e8-b9ce-555f-8f28-a1a4468fabde" + } + }, + "endpoint_uuid": { + "uuid": "086906ec-fd3b-55e1-b9bb-5a9e5bb5daff" + }, + "topology_id": { + "context_id": { + "context_uuid": { + "uuid": "admin" + } + }, + "topology_uuid": { + "uuid": "admin" + } + } + }, + { + "device_id": { + "device_uuid": { + "uuid": "bf749ed2-fcc4-5bfc-9116-4ea18b722069" + } + }, + "endpoint_uuid": { + "uuid": "59e1e30f-ea65-5e04-8a91-760a648a02c6" + }, + "topology_id": { + "context_id": { + "context_uuid": { + "uuid": "admin" + } + }, + "topology_uuid": { + "uuid": "admin" + } + } + } + ], + "link_id": { + "link_uuid": { + "uuid": "85a18715-3ce0-57f9-8025-5634fe622a06" + } + }, + "name": "nce-t/mgmt==10.0.10.1/mgmt" + }, + { + "attributes": { + "total_capacity_gbps": 10.0, + "used_capacity_gbps": 0.0 + }, + "link_endpoint_ids": [ + { + "device_id": { + "device_uuid": { + "uuid": "4f2234d0-a9b8-5a86-b1dd-9139d86e3925" + } + }, + "endpoint_uuid": { + "uuid": "75e62edc-a0f9-53f9-821b-023045db1551" + }, + "topology_id": { + "context_id": { + "context_uuid": { + "uuid": "admin" + } + }, + "topology_uuid": { + "uuid": "admin" + } + } + }, + { + "device_id": { + "device_uuid": { + "uuid": "0392c251-b5d3-526b-8f3b-a3d4137829fa" + } + }, + "endpoint_uuid": { + "uuid": "859813e0-24c1-518e-ba77-44a4f392e321" + }, + "topology_id": { + "context_id": { + "context_uuid": { + "uuid": "admin" + } + }, + "topology_uuid": { + "uuid": "admin" + } + } + } + ], + "link_id": { + "link_uuid": { + "uuid": "8e8d1a2b-beae-5624-8826-9235bd73a3a8" + } + }, + "name": "10.0.40.1-501" + }, + { + "attributes": { + "total_capacity_gbps": 10.0, + "used_capacity_gbps": 0.0 + }, + "link_endpoint_ids": [ + { + "device_id": { + "device_uuid": { + "uuid": "bf749ed2-fcc4-5bfc-9116-4ea18b722069" + } + }, + "endpoint_uuid": { + "uuid": "a2579e11-2e86-5e53-a235-3dd6ba92bb9a" + }, + "topology_id": { + "context_id": { + "context_uuid": { + "uuid": "admin" + } + }, + "topology_uuid": { + "uuid": "admin" + } + } + }, + { + "device_id": { + "device_uuid": { + "uuid": "4f2234d0-a9b8-5a86-b1dd-9139d86e3925" + } + }, + "endpoint_uuid": { + "uuid": "b5efeee2-5062-5d8f-ae06-f901fed7a7d7" + }, + "topology_id": { + "context_id": { + "context_uuid": { + "uuid": "admin" + } + }, + "topology_uuid": { + "uuid": "admin" + } + } + } + ], + "link_id": { + "link_uuid": { + "uuid": "e9c5b57e-de50-509c-9f5a-0107ff233703" + } + }, + "name": "10.0.10.1-500" + }, + { + "attributes": { + "total_capacity_gbps": 10.0, + "used_capacity_gbps": 0.0 + }, + "link_endpoint_ids": [ + { + "device_id": { + "device_uuid": { + "uuid": "df4be2f2-a4a2-587d-b3ed-61a53cae3aa6" + } + }, + "endpoint_uuid": { + "uuid": "0701f406-633f-53e7-a44d-c93384745df8" + }, + "topology_id": { + "context_id": { + "context_uuid": { + "uuid": "admin" + } + }, + "topology_uuid": { + "uuid": "admin" + } + } + }, + { + "device_id": { + "device_uuid": { + "uuid": "e15007fb-aae4-50d6-b686-b6dc4ae504e2" + } + }, + "endpoint_uuid": { + "uuid": "bbbec9f8-618a-591a-bc3e-c188ee31008e" + }, + "topology_id": { + "context_id": { + "context_uuid": { + "uuid": "admin" + } + }, + "topology_uuid": { + "uuid": "admin" + } + } + } + ], + "link_id": { + "link_uuid": { + "uuid": "effca6e0-acf3-5c02-ba9a-d82c17a3f006" + } + }, + "name": "128.32.20.5-eth1" + }, + { + "attributes": { + "total_capacity_gbps": 10.0, + "used_capacity_gbps": 0.0 + }, + "link_endpoint_ids": [ + { + "device_id": { + "device_uuid": { + "uuid": "bf749ed2-fcc4-5bfc-9116-4ea18b722069" + } + }, + "endpoint_uuid": { + "uuid": "ad2e136d-a981-5c9a-8427-07352ac03351" + }, + "topology_id": { + "context_id": { + "context_uuid": { + "uuid": "admin" + } + }, + "topology_uuid": { + "uuid": "admin" + } + } + }, + { + "device_id": { + "device_uuid": { + "uuid": "cf9c4a78-f019-5023-aa0f-4fdba909473b" + } + }, + "endpoint_uuid": { + "uuid": "23c04144-5ad3-5419-8b96-cf4eb329ca96" + }, + "topology_id": { + "context_id": { + "context_uuid": { + "uuid": "admin" + } + }, + "topology_uuid": { + "uuid": "admin" + } + } + } + ], + "link_id": { + "link_uuid": { + "uuid": "f45b4432-4ae2-5719-b4e8-a5e8baa1ccd2" + } + }, + "name": "10.0.10.1-501" + }, + { + "attributes": { + "total_capacity_gbps": 10.0, + "used_capacity_gbps": 0.0 + }, + "link_endpoint_ids": [ + { + "device_id": { + "device_uuid": { + "uuid": "f3840f4a-6ea2-551a-8afd-0f3faa8ac1e6" + } + }, + "endpoint_uuid": { + "uuid": "16d56d61-63cd-5704-9d2a-5515e633b64b" + }, + "topology_id": { + "context_id": { + "context_uuid": { + "uuid": "admin" + } + }, + "topology_uuid": { + "uuid": "admin" + } + } + }, + { + "device_id": { + "device_uuid": { + "uuid": "118295c8-318a-52ec-a394-529fc4b70f2f" + } + }, + "endpoint_uuid": { + "uuid": "207ef8a3-18fd-5a63-ac24-4a1cc6af3e92" + }, + "topology_id": { + "context_id": { + "context_uuid": { + "uuid": "admin" + } + }, + "topology_uuid": { + "uuid": "admin" + } + } + } + ], + "link_id": { + "link_uuid": { + "uuid": "fd005f34-39f5-550e-b2c0-c6e6f8c16325" + } + }, + "name": "128.32.10.5-eth1" + } + ], + "topologies": [ + { + "device_ids": [ + { + "device_uuid": { + "uuid": "0392c251-b5d3-526b-8f3b-a3d4137829fa" + } + }, + { + "device_uuid": { + "uuid": "118295c8-318a-52ec-a394-529fc4b70f2f" + } + }, + { + "device_uuid": { + "uuid": "4c367472-545c-544d-935d-829f0a0e1c72" + } + }, + { + "device_uuid": { + "uuid": "4f2234d0-a9b8-5a86-b1dd-9139d86e3925" + } + }, + { + "device_uuid": { + "uuid": "97d846b3-d0ba-5b4d-b12e-a9365eda205c" + } + }, + { + "device_uuid": { + "uuid": "bf749ed2-fcc4-5bfc-9116-4ea18b722069" + } + }, + { + "device_uuid": { + "uuid": "cf9c4a78-f019-5023-aa0f-4fdba909473b" + } + }, + { + "device_uuid": { + "uuid": "df4be2f2-a4a2-587d-b3ed-61a53cae3aa6" + } + }, + { + "device_uuid": { + "uuid": "e15007fb-aae4-50d6-b686-b6dc4ae504e2" + } + }, + { + "device_uuid": { + "uuid": "f3840f4a-6ea2-551a-8afd-0f3faa8ac1e6" + } + }, + { + "device_uuid": { + "uuid": "fe0dc2e8-b9ce-555f-8f28-a1a4468fabde" + } + } + ], + "link_ids": [ + { + "link_uuid": { + "uuid": "0b3d5943-c2bf-595f-a805-dc29c2be2f52" + } + }, + { + "link_uuid": { + "uuid": "1490e70f-472c-5e4c-8280-21c48ed03477" + } + }, + { + "link_uuid": { + "uuid": "18ba8eb2-342b-5a73-aeae-7288ea9bb28b" + } + }, + { + "link_uuid": { + "uuid": "1901b0dc-1b5e-5fdf-b9ac-9168787464c1" + } + }, + { + "link_uuid": { + "uuid": "1afdae8b-a281-53aa-99c2-205afb8f4ee7" + } + }, + { + "link_uuid": { + "uuid": "30ca0f8f-b150-57f2-ae5e-8a6844944783" + } + }, + { + "link_uuid": { + "uuid": "34c9c6c3-0dcf-54e5-ba67-da33eb2d3c1a" + } + }, + { + "link_uuid": { + "uuid": "35801e61-45f3-564e-ad5c-09baf4aae906" + } + }, + { + "link_uuid": { + "uuid": "36643dba-e8fa-5fb7-952d-dff313db957b" + } + }, + { + "link_uuid": { + "uuid": "36856920-3387-5384-b1b1-dbc9e54da226" + } + }, + { + "link_uuid": { + "uuid": "46ba12f9-dd17-5f2a-9558-e4611515a6b9" + } + }, + { + "link_uuid": { + "uuid": "4dfe28dd-ac28-53d5-b330-1707e350d772" + } + }, + { + "link_uuid": { + "uuid": "644ab377-572c-53a4-8ab5-f5cf45591d88" + } + }, + { + "link_uuid": { + "uuid": "661ac531-4309-58cc-b70e-2a79492c2488" + } + }, + { + "link_uuid": { + "uuid": "6a236e01-853c-51d0-8915-2d09b45923b0" + } + }, + { + "link_uuid": { + "uuid": "6c802ae7-59d1-55e7-9498-146c465bcab5" + } + }, + { + "link_uuid": { + "uuid": "6fa77ad9-e4d7-5830-bf84-ab206eff613a" + } + }, + { + "link_uuid": { + "uuid": "808b54e8-3d5a-5e03-a42e-d6c2a57cf6f3" + } + }, + { + "link_uuid": { + "uuid": "85a18715-3ce0-57f9-8025-5634fe622a06" + } + }, + { + "link_uuid": { + "uuid": "8e8d1a2b-beae-5624-8826-9235bd73a3a8" + } + }, + { + "link_uuid": { + "uuid": "e9c5b57e-de50-509c-9f5a-0107ff233703" + } + }, + { + "link_uuid": { + "uuid": "effca6e0-acf3-5c02-ba9a-d82c17a3f006" + } + }, + { + "link_uuid": { + "uuid": "f45b4432-4ae2-5719-b4e8-a5e8baa1ccd2" + } + }, + { + "link_uuid": { + "uuid": "fd005f34-39f5-550e-b2c0-c6e6f8c16325" + } + } + ], + "name": "admin", + "topology_id": { + "context_id": { + "context_uuid": { + "uuid": "admin" + } + }, + "topology_uuid": { + "uuid": "admin" + } + } + } + ] +} \ No newline at end of file diff --git a/src/nbi/tests/data/topology-real.json b/src/nbi/tests/data/topology-real.json new file mode 100644 index 0000000000000000000000000000000000000000..bb158d920ecbd0bf3e9998f4bd856a349c9e91c7 --- /dev/null +++ b/src/nbi/tests/data/topology-real.json @@ -0,0 +1,259 @@ +{ + "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": "nce-t"}}, "name": "nce-t", "device_type": "emu-open-line-system", + "device_operational_status": 1, "device_drivers": [0], "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": "mgmt", "name": "mgmt", "type": "mgmt"} + ]}}} + ]}}, + + {"device_id": {"device_uuid": {"uuid": "10.0.10.1"}}, "name": "10.0.10.1", "device_type": "emu-packet-router", + "controller_id": {"device_uuid": {"uuid": "nce-t"}}, + "device_operational_status": 1, "device_drivers": [0], "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": "mgmt", "name": "mgmt", "type": "mgmt" }, + {"uuid": "200", "name": "200", "type": "copper" }, + {"uuid": "500", "name": "500", "type": "optical"}, + {"uuid": "501", "name": "501", "type": "optical"} + ]}}} + ]}}, + + {"device_id": {"device_uuid": {"uuid": "10.0.20.1"}}, "name": "10.0.20.1", "device_type": "emu-packet-router", + "controller_id": {"device_uuid": {"uuid": "nce-t"}}, + "device_operational_status": 1, "device_drivers": [0], "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": "mgmt", "name": "mgmt", "type": "mgmt" }, + {"uuid": "500", "name": "500", "type": "optical"}, + {"uuid": "501", "name": "501", "type": "optical"} + ]}}} + ]}}, + + {"device_id": {"device_uuid": {"uuid": "10.0.30.1"}}, "name": "10.0.30.1", "device_type": "emu-packet-router", + "controller_id": {"device_uuid": {"uuid": "nce-t"}}, + "device_operational_status": 1, "device_drivers": [0], "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": "mgmt", "name": "mgmt", "type": "mgmt" }, + {"uuid": "200", "name": "200", "type": "copper" }, + {"uuid": "500", "name": "500", "type": "optical"}, + {"uuid": "501", "name": "501", "type": "optical"} + ]}}} + ]}}, + + {"device_id": {"device_uuid": {"uuid": "10.0.40.1"}}, "name": "10.0.40.1", "device_type": "emu-packet-router", + "controller_id": {"device_uuid": {"uuid": "nce-t"}}, + "device_operational_status": 1, "device_drivers": [0], "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": "mgmt", "name": "mgmt", "type": "mgmt" }, + {"uuid": "500", "name": "500", "type": "optical"}, + {"uuid": "501", "name": "501", "type": "optical"} + ]}}} + ]}}, + + {"device_id": {"device_uuid": {"uuid": "128.32.10.5"}}, "name": "128.32.10.5", "device_type": "emu-client", + "device_operational_status": 1, "device_drivers": [0], "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": "eth1", "name": "eth1", "type": "copper"} + ]}}} + ]}}, + + {"device_id": {"device_uuid": {"uuid": "128.32.10.1"}}, "name": "128.32.10.1", "device_type": "emu-packet-router", + "device_operational_status": 1, "device_drivers": [0], "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": "200", "name": "200", "type": "copper"}, + {"uuid": "500", "name": "500", "type": "copper"} + ]}}} + ]}}, + + {"device_id": {"device_uuid": {"uuid": "128.32.20.5"}}, "name": "128.32.20.5", "device_type": "emu-client", + "device_operational_status": 1, "device_drivers": [0], "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": "eth1", "name": "eth1", "type": "copper"} + ]}}} + ]}}, + + {"device_id": {"device_uuid": {"uuid": "128.32.20.1"}}, "name": "128.32.20.1", "device_type": "emu-packet-router", + "device_operational_status": 1, "device_drivers": [0], "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": "200", "name": "200", "type": "copper"}, + {"uuid": "500", "name": "500", "type": "copper"} + ]}}} + ]}}, + + {"device_id": {"device_uuid": {"uuid": "128.32.33.5"}}, "name": "128.32.33.5", "device_type": "emu-optical-transponder", + "device_operational_status": 1, "device_drivers": [0], "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": "200", "name": "200", "type": "copper"}, + {"uuid": "201", "name": "201", "type": "copper"}, + {"uuid": "500", "name": "500", "type": "copper"} + ]}}} + ]}}, + + {"device_id": {"device_uuid": {"uuid": "172.10.33.5"}}, "name": "172.10.33.5", "device_type": "emu-datacenter", + "device_operational_status": 1, "device_drivers": [0], "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": "200", "name": "200", "type": "copper"}, + {"uuid": "201", "name": "201", "type": "copper"}, + {"uuid": "500", "name": "500", "type": "copper"} + ]}}} + ]}} + ], + + "links": [ + {"link_id": {"link_uuid": {"uuid": "nce-t/mgmt==10.0.10.1/mgmt"}}, "name": "nce-t/mgmt==10.0.10.1/mgmt", "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "nce-t" }}, "endpoint_uuid": {"uuid": "mgmt"}}, + {"device_id": {"device_uuid": {"uuid": "10.0.10.1"}}, "endpoint_uuid": {"uuid": "mgmt"}} + ]}, + {"link_id": {"link_uuid": {"uuid": "nce-t/mgmt==10.0.20.1/mgmt"}}, "name": "nce-t/mgmt==10.0.20.1/mgmt", "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "nce-t" }}, "endpoint_uuid": {"uuid": "mgmt"}}, + {"device_id": {"device_uuid": {"uuid": "10.0.20.1"}}, "endpoint_uuid": {"uuid": "mgmt"}} + ]}, + {"link_id": {"link_uuid": {"uuid": "nce-t/mgmt==10.0.30.1/mgmt"}}, "name": "nce-t/mgmt==10.0.30.1/mgmt", "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "nce-t" }}, "endpoint_uuid": {"uuid": "mgmt"}}, + {"device_id": {"device_uuid": {"uuid": "10.0.30.1"}}, "endpoint_uuid": {"uuid": "mgmt"}} + ]}, + {"link_id": {"link_uuid": {"uuid": "nce-t/mgmt==10.0.40.1/mgmt"}}, "name": "nce-t/mgmt==10.0.40.1/mgmt", "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "nce-t" }}, "endpoint_uuid": {"uuid": "mgmt"}}, + {"device_id": {"device_uuid": {"uuid": "10.0.40.1"}}, "endpoint_uuid": {"uuid": "mgmt"}} + ]}, + + {"link_id": {"link_uuid": {"uuid": "10.0.10.1-501"}}, "name": "10.0.10.1-501", + "attributes": {"total_capacity_gbps": 10, "used_capacity_gbps": 0}, "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "10.0.10.1"}}, "endpoint_uuid": {"uuid": "501"}}, + {"device_id": {"device_uuid": {"uuid": "10.0.20.1"}}, "endpoint_uuid": {"uuid": "501"}} + ]}, + {"link_id": {"link_uuid": {"uuid": "10.0.20.1-501"}}, "name": "10.0.20.1-501", + "attributes": {"total_capacity_gbps": 10, "used_capacity_gbps": 0}, "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "10.0.20.1"}}, "endpoint_uuid": {"uuid": "501"}}, + {"device_id": {"device_uuid": {"uuid": "10.0.10.1"}}, "endpoint_uuid": {"uuid": "501"}} + ]}, + + {"link_id": {"link_uuid": {"uuid": "10.0.10.1-500"}}, "name": "10.0.10.1-500", + "attributes": {"total_capacity_gbps": 10, "used_capacity_gbps": 0}, "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "10.0.10.1"}}, "endpoint_uuid": {"uuid": "500"}}, + {"device_id": {"device_uuid": {"uuid": "10.0.40.1"}}, "endpoint_uuid": {"uuid": "500"}} + ]}, + {"link_id": {"link_uuid": {"uuid": "10.0.40.1-500"}}, "name": "10.0.40.1-500", + "attributes": {"total_capacity_gbps": 10, "used_capacity_gbps": 0}, "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "10.0.40.1"}}, "endpoint_uuid": {"uuid": "500"}}, + {"device_id": {"device_uuid": {"uuid": "10.0.10.1"}}, "endpoint_uuid": {"uuid": "500"}} + ]}, + + {"link_id": {"link_uuid": {"uuid": "10.0.20.1-500"}}, "name": "10.0.20.1-500", + "attributes": {"total_capacity_gbps": 10, "used_capacity_gbps": 0}, "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "10.0.20.1"}}, "endpoint_uuid": {"uuid": "500"}}, + {"device_id": {"device_uuid": {"uuid": "10.0.30.1"}}, "endpoint_uuid": {"uuid": "500"}} + ]}, + {"link_id": {"link_uuid": {"uuid": "10.0.30.1-500"}}, "name": "10.0.30.1-500", + "attributes": {"total_capacity_gbps": 10, "used_capacity_gbps": 0}, "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "10.0.30.1"}}, "endpoint_uuid": {"uuid": "500"}}, + {"device_id": {"device_uuid": {"uuid": "10.0.20.1"}}, "endpoint_uuid": {"uuid": "500"}} + ]}, + + {"link_id": {"link_uuid": {"uuid": "10.0.40.1-501"}}, "name": "10.0.40.1-501", + "attributes": {"total_capacity_gbps": 10, "used_capacity_gbps": 0}, "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "10.0.40.1"}}, "endpoint_uuid": {"uuid": "501"}}, + {"device_id": {"device_uuid": {"uuid": "10.0.30.1"}}, "endpoint_uuid": {"uuid": "501"}} + ]}, + {"link_id": {"link_uuid": {"uuid": "10.0.30.1-501"}}, "name": "10.0.30.1-501", + "attributes": {"total_capacity_gbps": 10, "used_capacity_gbps": 0}, "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "10.0.30.1"}}, "endpoint_uuid": {"uuid": "501"}}, + {"device_id": {"device_uuid": {"uuid": "10.0.40.1"}}, "endpoint_uuid": {"uuid": "501"}} + ]}, + + {"link_id": {"link_uuid": {"uuid": "128.32.10.5-eth1"}}, "name": "128.32.10.5-eth1", + "attributes": {"total_capacity_gbps": 10, "used_capacity_gbps": 0}, "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "128.32.10.5"}}, "endpoint_uuid": {"uuid": "eth1"}}, + {"device_id": {"device_uuid": {"uuid": "128.32.10.1"}}, "endpoint_uuid": {"uuid": "200" }} + ]}, + {"link_id": {"link_uuid": {"uuid": "128.32.10.1-200"}}, "name": "128.32.10.1-200", + "attributes": {"total_capacity_gbps": 10, "used_capacity_gbps": 0}, "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "128.32.10.1"}}, "endpoint_uuid": {"uuid": "200" }}, + {"device_id": {"device_uuid": {"uuid": "128.32.10.5"}}, "endpoint_uuid": {"uuid": "eth1"}} + ]}, + + {"link_id": {"link_uuid": {"uuid": "128.32.10.1-500"}}, "name": "128.32.10.1-500", + "attributes": {"total_capacity_gbps": 10, "used_capacity_gbps": 0}, "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "128.32.10.1"}}, "endpoint_uuid": {"uuid": "500"}}, + {"device_id": {"device_uuid": {"uuid": "128.32.33.5"}}, "endpoint_uuid": {"uuid": "200"}} + ]}, + {"link_id": {"link_uuid": {"uuid": "128.32.33.5-200"}}, "name": "128.32.33.5-200", + "attributes": {"total_capacity_gbps": 10, "used_capacity_gbps": 0}, "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "128.32.33.5"}}, "endpoint_uuid": {"uuid": "200"}}, + {"device_id": {"device_uuid": {"uuid": "128.32.10.1"}}, "endpoint_uuid": {"uuid": "500"}} + ]}, + + {"link_id": {"link_uuid": {"uuid": "128.32.20.5-eth1"}}, "name": "128.32.20.5-eth1", + "attributes": {"total_capacity_gbps": 10, "used_capacity_gbps": 0}, "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "128.32.20.5"}}, "endpoint_uuid": {"uuid": "eth1"}}, + {"device_id": {"device_uuid": {"uuid": "128.32.20.1"}}, "endpoint_uuid": {"uuid": "200" }} + ]}, + {"link_id": {"link_uuid": {"uuid": "128.32.20.1-200"}}, "name": "128.32.20.1-200", + "attributes": {"total_capacity_gbps": 10, "used_capacity_gbps": 0}, "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "128.32.20.1"}}, "endpoint_uuid": {"uuid": "200" }}, + {"device_id": {"device_uuid": {"uuid": "128.32.20.5"}}, "endpoint_uuid": {"uuid": "eth1"}} + ]}, + + {"link_id": {"link_uuid": {"uuid": "128.32.20.1-500"}}, "name": "128.32.20.1-500", + "attributes": {"total_capacity_gbps": 10, "used_capacity_gbps": 0}, "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "128.32.20.1"}}, "endpoint_uuid": {"uuid": "500"}}, + {"device_id": {"device_uuid": {"uuid": "128.32.33.5"}}, "endpoint_uuid": {"uuid": "201"}} + ]}, + {"link_id": {"link_uuid": {"uuid": "128.32.33.5-201"}}, "name": "128.32.33.5-201", + "attributes": {"total_capacity_gbps": 10, "used_capacity_gbps": 0}, "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "128.32.33.5"}}, "endpoint_uuid": {"uuid": "201"}}, + {"device_id": {"device_uuid": {"uuid": "128.32.20.1"}}, "endpoint_uuid": {"uuid": "500"}} + ]}, + + {"link_id": {"link_uuid": {"uuid": "128.32.33.5-500"}}, "name": "128.32.33.5-500", + "attributes": {"total_capacity_gbps": 10, "used_capacity_gbps": 0}, "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "128.32.33.5"}}, "endpoint_uuid": {"uuid": "500"}}, + {"device_id": {"device_uuid": {"uuid": "10.0.10.1"}}, "endpoint_uuid": {"uuid": "200"}} + ]}, + {"link_id": {"link_uuid": {"uuid": "10.0.10.1-200"}}, "name": "10.0.10.1-200", + "attributes": {"total_capacity_gbps": 10, "used_capacity_gbps": 0}, "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "10.0.10.1"}}, "endpoint_uuid": {"uuid": "200"}}, + {"device_id": {"device_uuid": {"uuid": "128.32.33.5"}}, "endpoint_uuid": {"uuid": "500"}} + ]}, + + {"link_id": {"link_uuid": {"uuid": "172.10.33.5-500"}}, "name": "172.10.33.5-500", + "attributes": {"total_capacity_gbps": 10, "used_capacity_gbps": 0}, "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "172.10.33.5"}}, "endpoint_uuid": {"uuid": "500"}}, + {"device_id": {"device_uuid": {"uuid": "10.0.30.1"}}, "endpoint_uuid": {"uuid": "200"}} + ]}, + {"link_id": {"link_uuid": {"uuid": "10.0.30.1-200"}}, "name": "10.0.30.1-200", + "attributes": {"total_capacity_gbps": 10, "used_capacity_gbps": 0}, "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "10.0.30.1"}}, "endpoint_uuid": {"uuid": "200"}}, + {"device_id": {"device_uuid": {"uuid": "172.10.33.5"}}, "endpoint_uuid": {"uuid": "500"}} + ]} + ] +} diff --git a/src/compute/tests/test_debug_api.py b/src/nbi/tests/test_debug_api.py similarity index 79% rename from src/compute/tests/test_debug_api.py rename to src/nbi/tests/test_debug_api.py index 06ad8cedc5d70fb58051cbf5b81150b812856054..e284992618a96388371b69b7b0c2a8c4fcaaba70 100644 --- a/src/compute/tests/test_debug_api.py +++ b/src/nbi/tests/test_debug_api.py @@ -12,27 +12,29 @@ # See the License for the specific language governing permissions and # limitations under the License. -import logging, os, pytest, requests, time, urllib -from typing import Tuple +import logging, os, pytest, time, urllib from common.Constants import DEFAULT_CONTEXT_NAME, DEFAULT_TOPOLOGY_NAME, ServiceNameEnum from common.proto.context_pb2 import Connection, Context, Device, Link, Service, Slice, Topology from common.proto.policy_pb2 import PolicyRuleIdList, PolicyRuleId, PolicyRuleList, PolicyRule from common.Settings import ( ENVVAR_SUFIX_SERVICE_HOST, ENVVAR_SUFIX_SERVICE_PORT_GRPC, ENVVAR_SUFIX_SERVICE_PORT_HTTP, get_env_var_name, - get_service_baseurl_http, get_service_port_grpc, get_service_port_http) + get_service_port_grpc, get_service_port_http +) from common.type_checkers.Assertions import ( validate_connection, validate_connection_ids, validate_connections, validate_context, validate_context_ids, validate_contexts, validate_device, validate_device_ids, validate_devices, validate_link, validate_link_ids, validate_links, validate_service, validate_service_ids, validate_services, validate_topologies, validate_topology, validate_topology_ids) from context.client.ContextClient import ContextClient +from nbi.tests.PrepareTestScenario import do_rest_get_request from .MockService_Dependencies import MockService_Dependencies from .Objects import ( CONNECTION_R1_R3, CONNECTION_R1_R3_ID, CONNECTION_R1_R3_UUID, CONTEXT, CONTEXT_ID, DEVICE_R1, DEVICE_R1_ID, DEVICE_R1_UUID, DEVICE_R2, DEVICE_R2_ID, DEVICE_R2_UUID, DEVICE_R3, DEVICE_R3_ID, DEVICE_R3_UUID, LINK_R1_R2, LINK_R1_R2_ID, LINK_R1_R2_UUID, SERVICE_R1_R2, SERVICE_R1_R2_ID, SERVICE_R1_R2_UUID, SERVICE_R1_R3, SERVICE_R1_R3_ID, SERVICE_R1_R3_UUID, SERVICE_R2_R3, SERVICE_R2_R3_ID, SERVICE_R2_R3_UUID, SLICE_R1_R3, TOPOLOGY, - TOPOLOGY_ID, POLICY_RULE, POLICY_RULE_ID, POLICY_RULE_UUID) + TOPOLOGY_ID, POLICY_RULE, POLICY_RULE_ID, POLICY_RULE_UUID +) @pytest.fixture(scope='session') @@ -100,129 +102,119 @@ def test_populate_database(): client.SetSlice(Slice(**SLICE_R1_R3)) client.SetConnection(Connection(**CONNECTION_R1_R3)) -def do_rest_request(url : str): - base_url = get_service_baseurl_http(ServiceNameEnum.CONTEXT) - request_url = 'http://{:s}:{:s}{:s}{:s}'.format(str(LOCAL_HOST), str(HTTP_PORT), str(base_url), url) - LOGGER.warning('Request: GET {:s}'.format(str(request_url))) - reply = requests.get(request_url) - LOGGER.warning('Reply: {:s}'.format(str(reply.text))) - assert reply.status_code == 200, 'Reply failed with code {}'.format(reply.status_code) - return reply.json() - - def test_rest_get_context_ids(context_service_rest : RestServer): # pylint: disable=redefined-outer-name - reply = do_rest_request('/context_ids') + reply = do_rest_get_request('/context_ids') validate_context_ids(reply) def test_rest_get_contexts(context_service_rest : RestServer): # pylint: disable=redefined-outer-name - reply = do_rest_request('/contexts') + reply = do_rest_get_request('/contexts') validate_contexts(reply) def test_rest_get_context(context_service_rest : RestServer): # pylint: disable=redefined-outer-name context_uuid = urllib.parse.quote(DEFAULT_CONTEXT_NAME) - reply = do_rest_request('/context/{:s}'.format(context_uuid)) + reply = do_rest_get_request('/context/{:s}'.format(context_uuid)) validate_context(reply) def test_rest_get_topology_ids(context_service_rest : RestServer): # pylint: disable=redefined-outer-name context_uuid = urllib.parse.quote(DEFAULT_CONTEXT_NAME) - reply = do_rest_request('/context/{:s}/topology_ids'.format(context_uuid)) + reply = do_rest_get_request('/context/{:s}/topology_ids'.format(context_uuid)) validate_topology_ids(reply) def test_rest_get_topologies(context_service_rest : RestServer): # pylint: disable=redefined-outer-name context_uuid = urllib.parse.quote(DEFAULT_CONTEXT_NAME) - reply = do_rest_request('/context/{:s}/topologies'.format(context_uuid)) + reply = do_rest_get_request('/context/{:s}/topologies'.format(context_uuid)) validate_topologies(reply) def test_rest_get_topology(context_service_rest : RestServer): # pylint: disable=redefined-outer-name context_uuid = urllib.parse.quote(DEFAULT_CONTEXT_NAME) topology_uuid = urllib.parse.quote(DEFAULT_TOPOLOGY_NAME) - reply = do_rest_request('/context/{:s}/topology/{:s}'.format(context_uuid, topology_uuid)) + reply = do_rest_get_request('/context/{:s}/topology/{:s}'.format(context_uuid, topology_uuid)) validate_topology(reply, num_devices=3, num_links=3) def test_rest_get_service_ids(context_service_rest : RestServer): # pylint: disable=redefined-outer-name context_uuid = urllib.parse.quote(DEFAULT_CONTEXT_NAME) - reply = do_rest_request('/context/{:s}/service_ids'.format(context_uuid)) + reply = do_rest_get_request('/context/{:s}/service_ids'.format(context_uuid)) validate_service_ids(reply) def test_rest_get_services(context_service_rest : RestServer): # pylint: disable=redefined-outer-name context_uuid = urllib.parse.quote(DEFAULT_CONTEXT_NAME) - reply = do_rest_request('/context/{:s}/services'.format(context_uuid)) + reply = do_rest_get_request('/context/{:s}/services'.format(context_uuid)) validate_services(reply) def test_rest_get_service(context_service_rest : RestServer): # pylint: disable=redefined-outer-name context_uuid = urllib.parse.quote(DEFAULT_CONTEXT_NAME) service_uuid = urllib.parse.quote(SERVICE_R1_R2_UUID, safe='') - reply = do_rest_request('/context/{:s}/service/{:s}'.format(context_uuid, service_uuid)) + reply = do_rest_get_request('/context/{:s}/service/{:s}'.format(context_uuid, service_uuid)) validate_service(reply) def test_rest_get_slice_ids(context_service_rest : RestServer): # pylint: disable=redefined-outer-name context_uuid = urllib.parse.quote(DEFAULT_CONTEXT_NAME) - reply = do_rest_request('/context/{:s}/slice_ids'.format(context_uuid)) + reply = do_rest_get_request('/context/{:s}/slice_ids'.format(context_uuid)) #validate_slice_ids(reply) def test_rest_get_slices(context_service_rest : RestServer): # pylint: disable=redefined-outer-name context_uuid = urllib.parse.quote(DEFAULT_CONTEXT_NAME) - reply = do_rest_request('/context/{:s}/slices'.format(context_uuid)) + reply = do_rest_get_request('/context/{:s}/slices'.format(context_uuid)) #validate_slices(reply) def test_rest_get_slice(context_service_rest : RestServer): # pylint: disable=redefined-outer-name context_uuid = urllib.parse.quote(DEFAULT_CONTEXT_NAME) slice_uuid = urllib.parse.quote(SLICE_R1_R3_UUID, safe='') - reply = do_rest_request('/context/{:s}/slice/{:s}'.format(context_uuid, slice_uuid)) + reply = do_rest_get_request('/context/{:s}/slice/{:s}'.format(context_uuid, slice_uuid)) #validate_slice(reply) def test_rest_get_device_ids(context_service_rest : RestServer): # pylint: disable=redefined-outer-name - reply = do_rest_request('/device_ids') + reply = do_rest_get_request('/device_ids') validate_device_ids(reply) def test_rest_get_devices(context_service_rest : RestServer): # pylint: disable=redefined-outer-name - reply = do_rest_request('/devices') + reply = do_rest_get_request('/devices') validate_devices(reply) def test_rest_get_device(context_service_rest : RestServer): # pylint: disable=redefined-outer-name device_uuid = urllib.parse.quote(DEVICE_R1_UUID, safe='') - reply = do_rest_request('/device/{:s}'.format(device_uuid)) + reply = do_rest_get_request('/device/{:s}'.format(device_uuid)) validate_device(reply) def test_rest_get_link_ids(context_service_rest : RestServer): # pylint: disable=redefined-outer-name - reply = do_rest_request('/link_ids') + reply = do_rest_get_request('/link_ids') validate_link_ids(reply) def test_rest_get_links(context_service_rest : RestServer): # pylint: disable=redefined-outer-name - reply = do_rest_request('/links') + reply = do_rest_get_request('/links') validate_links(reply) def test_rest_get_link(context_service_rest : RestServer): # pylint: disable=redefined-outer-name link_uuid = urllib.parse.quote(LINK_R1_R2_UUID, safe='') - reply = do_rest_request('/link/{:s}'.format(link_uuid)) + reply = do_rest_get_request('/link/{:s}'.format(link_uuid)) validate_link(reply) def test_rest_get_connection_ids(context_service_rest : RestServer): # pylint: disable=redefined-outer-name context_uuid = urllib.parse.quote(DEFAULT_CONTEXT_NAME) service_uuid = urllib.parse.quote(SERVICE_R1_R3_UUID, safe='') - reply = do_rest_request('/context/{:s}/service/{:s}/connection_ids'.format(context_uuid, service_uuid)) + reply = do_rest_get_request('/context/{:s}/service/{:s}/connection_ids'.format(context_uuid, service_uuid)) validate_connection_ids(reply) def test_rest_get_connections(context_service_rest : RestServer): # pylint: disable=redefined-outer-name context_uuid = urllib.parse.quote(DEFAULT_CONTEXT_NAME) service_uuid = urllib.parse.quote(SERVICE_R1_R3_UUID, safe='') - reply = do_rest_request('/context/{:s}/service/{:s}/connections'.format(context_uuid, service_uuid)) + reply = do_rest_get_request('/context/{:s}/service/{:s}/connections'.format(context_uuid, service_uuid)) validate_connections(reply) def test_rest_get_connection(context_service_rest : RestServer): # pylint: disable=redefined-outer-name connection_uuid = urllib.parse.quote(CONNECTION_R1_R3_UUID, safe='') - reply = do_rest_request('/connection/{:s}'.format(connection_uuid)) + reply = do_rest_get_request('/connection/{:s}'.format(connection_uuid)) validate_connection(reply) def test_rest_get_policyrule_ids(context_service_rest : RestServer): # pylint: disable=redefined-outer-name - reply = do_rest_request('/policyrule_ids') + reply = do_rest_get_request('/policyrule_ids') #validate_policyrule_ids(reply) def test_rest_get_policyrules(context_service_rest : RestServer): # pylint: disable=redefined-outer-name - reply = do_rest_request('/policyrules') + reply = do_rest_get_request('/policyrules') #validate_policyrules(reply) def test_rest_get_policyrule(context_service_rest : RestServer): # pylint: disable=redefined-outer-name policyrule_uuid = urllib.parse.quote(POLICYRULE_UUID, safe='') - reply = do_rest_request('/policyrule/{:s}'.format(policyrule_uuid)) + reply = do_rest_get_request('/policyrule/{:s}'.format(policyrule_uuid)) #validate_policyrule(reply) diff --git a/src/nbi/tests/test_etsi_bwm.py b/src/nbi/tests/test_etsi_bwm.py new file mode 100644 index 0000000000000000000000000000000000000000..8925897a720a6afa981e9ea0cd9c0d9a5261c5cd --- /dev/null +++ b/src/nbi/tests/test_etsi_bwm.py @@ -0,0 +1,240 @@ +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT 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 deepdiff, json, logging, pytest +from typing import Dict +from common.Constants import DEFAULT_CONTEXT_NAME, DEFAULT_TOPOLOGY_NAME +from common.proto.context_pb2 import ContextId, TopologyId +from common.tools.descriptor.Loader import DescriptorLoader, check_descriptor_load_results, validate_empty_scenario +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 nbi.service.rest_server import RestServer +from .PrepareTestScenario import ( # pylint: disable=unused-import + # be careful, order of symbols is important here! + do_rest_delete_request, do_rest_get_request, do_rest_patch_request, do_rest_post_request, do_rest_put_request, + mock_service, nbi_service_rest, context_client +) + +LOGGER = logging.getLogger(__name__) +LOGGER.setLevel(logging.DEBUG) + +DESCRIPTOR_FILE = 'nbi/tests/data/topology-dummy.json' + +JSON_ADMIN_CONTEXT_ID = json_context_id(DEFAULT_CONTEXT_NAME) +ADMIN_CONTEXT_ID = ContextId(**JSON_ADMIN_CONTEXT_ID) +ADMIN_TOPOLOGY_ID = TopologyId(**json_topology_id(DEFAULT_TOPOLOGY_NAME, context_id=JSON_ADMIN_CONTEXT_ID)) +BASE_URL = '/restconf/bwm/v1' + +@pytest.fixture(scope='session') +def storage() -> Dict: + yield dict() + +#def compare_dicts(dict1, dict2): +# # Function to recursively sort dictionaries +# def recursively_sort(d): +# if isinstance(d, dict): +# return {k: recursively_sort(v) for k, v in sorted(d.items())} +# if isinstance(d, list): +# return [recursively_sort(item) for item in d] +# return d +# +# # Sort dictionaries to ignore the order of fields +# sorted_dict1 = recursively_sort(dict1) +# sorted_dict2 = recursively_sort(dict2) +# +# if sorted_dict1 != sorted_dict2: +# LOGGER.error(sorted_dict1) +# LOGGER.error(sorted_dict2) +# +# return sorted_dict1 != sorted_dict2 + +def check_timestamps(bwm_service): + assert 'timeStamp' in bwm_service + assert 'seconds' in bwm_service['timeStamp'] + assert 'nanoseconds' in bwm_service['timeStamp'] + +def test_prepare_environment(context_client : ContextClient) -> None: # pylint: disable=redefined-outer-name + validate_empty_scenario(context_client) + descriptor_loader = DescriptorLoader(descriptors_file=DESCRIPTOR_FILE, context_client=context_client) + results = descriptor_loader.process() + check_descriptor_load_results(results, descriptor_loader) + descriptor_loader.validate() + + # Verify the scenario has no services/slices + response = context_client.GetContext(ADMIN_CONTEXT_ID) + assert len(response.topology_ids) == 1 + assert len(response.service_ids ) == 0 + assert len(response.slice_ids ) == 0 + +def test_get_allocations_empty(nbi_service_rest : RestServer, storage : Dict): # pylint: disable=redefined-outer-name, unused-argument + URL = BASE_URL + '/bw_allocations' + retrieved_data = do_rest_get_request(URL, logger=LOGGER, expected_status_codes={200}) + LOGGER.debug('retrieved_data={:s}'.format(json.dumps(retrieved_data, sort_keys=True))) + assert len(retrieved_data) == 0 + +def test_allocation(nbi_service_rest : RestServer, storage : Dict): # pylint: disable=redefined-outer-name, unused-argument + URL = BASE_URL + '/bw_allocations' + data = { + "appInsId" : "service_uuid_01", + "allocationDirection" : "00", + "fixedAllocation" : "123000.0", + "fixedBWPriority" : "SEE_DESCRIPTION", + "requestType" : 0, + "sessionFilter" : [{ + "sourceIp" : "192.168.1.2", + "sourcePort" : ["a"], + "protocol" : "string", + "dstAddress" : "192.168.3.2", + "dstPort" : ["b"], + }] + } + retrieved_data = do_rest_post_request(URL, body=data, logger=LOGGER, expected_status_codes={200}) + LOGGER.debug('retrieved_data={:s}'.format(json.dumps(retrieved_data, sort_keys=True))) + storage['service_uuid_01'] = 'service_uuid_01' + + +def test_get_allocations(nbi_service_rest : RestServer, storage : Dict): # pylint: disable=redefined-outer-name, unused-argument + assert 'service_uuid_01' in storage + URL = BASE_URL + '/bw_allocations' + retrieved_data = do_rest_get_request(URL, logger=LOGGER, expected_status_codes={200}) + LOGGER.debug('retrieved_data={:s}'.format(json.dumps(retrieved_data, sort_keys=True))) + assert len(retrieved_data) == 1 + good_result = [ + { + "appInsId" : "service_uuid_01", + "fixedAllocation" : "123000.0", + "allocationDirection" : "00", + "fixedBWPriority" : "SEE_DESCRIPTION", + "requestType" : "0", + "sessionFilter" : [{ + "sourceIp" : "192.168.1.2", + "sourcePort" : ["a"], + "protocol" : "string", + "dstAddress" : "192.168.3.2", + "dstPort" : ["b"], + }], + } + ] + check_timestamps(retrieved_data[0]) + del retrieved_data[0]['timeStamp'] + diff_data = deepdiff.DeepDiff(good_result, retrieved_data) + LOGGER.error('Differences:\n{:s}'.format(str(diff_data.pretty()))) + assert len(diff_data) == 0 + + +def test_get_allocation(nbi_service_rest : RestServer, storage : Dict): # pylint: disable=redefined-outer-name, unused-argument + assert 'service_uuid_01' in storage + URL = BASE_URL + '/bw_allocations/service_uuid_01' + retrieved_data = do_rest_get_request(URL, logger=LOGGER, expected_status_codes={200}) + LOGGER.debug('retrieved_data={:s}'.format(json.dumps(retrieved_data, sort_keys=True))) + good_result = { + "appInsId" : "service_uuid_01", + "fixedAllocation" : "123000.0", + "allocationDirection": "00", + "fixedBWPriority" : "SEE_DESCRIPTION", + "requestType" : "0", + "sessionFilter" : [{ + "sourceIp" : "192.168.1.2", + "sourcePort" : ["a"], + "protocol" : "string", + "dstAddress" : "192.168.3.2", + "dstPort" : ["b"], + }] + } + check_timestamps(retrieved_data) + del retrieved_data['timeStamp'] + diff_data = deepdiff.DeepDiff(good_result, retrieved_data) + LOGGER.error('Differences:\n{:s}'.format(str(diff_data.pretty()))) + assert len(diff_data) == 0 + + +def test_put_allocation(nbi_service_rest : RestServer, storage : Dict): # pylint: disable=redefined-outer-name, unused-argument + assert 'service_uuid_01' in storage + URL = BASE_URL + '/bw_allocations/service_uuid_01' + changed_allocation = { + "appInsId" : "service_uuid_01", + "fixedAllocation" : "200.0", + "allocationDirection": "00", + "fixedBWPriority" : "NOPRIORITY", + "requestType" : "0", + "sessionFilter" : [{ + "sourceIp" : "192.168.1.2", + "sourcePort" : ["a"], + "protocol" : "string", + "dstAddress" : "192.168.3.2", + "dstPort" : ["b"], + }] + } + retrieved_data = do_rest_put_request(URL, body=json.dumps(changed_allocation), logger=LOGGER, expected_status_codes={200}) + check_timestamps(retrieved_data) + del retrieved_data['timeStamp'] + diff_data = deepdiff.DeepDiff(changed_allocation, retrieved_data) + LOGGER.error('Differences:\n{:s}'.format(str(diff_data.pretty()))) + assert len(diff_data) == 0 + + +def test_patch_allocation(nbi_service_rest : RestServer, storage : Dict): # pylint: disable=redefined-outer-name, unused-argument + assert 'service_uuid_01' in storage + URL = BASE_URL + '/bw_allocations/service_uuid_01' + difference = { + "fixedBWPriority":"FULLPRIORITY", + } + changed_allocation = { + "appInsId" : "service_uuid_01", + "fixedAllocation" : "200.0", + "allocationDirection": "00", + "fixedBWPriority" : "FULLPRIORITY", + "requestType" : "0", + "sessionFilter" : [{ + "sourceIp" : "192.168.1.2", + "sourcePort" : ["a"], + "protocol" : "string", + "dstAddress" : "192.168.3.2", + "dstPort" : ["b"], + }] + } + retrieved_data = do_rest_patch_request(URL, body=difference, logger=LOGGER, expected_status_codes={200}) + check_timestamps(retrieved_data) + del retrieved_data['timeStamp'] + diff_data = deepdiff.DeepDiff(changed_allocation, retrieved_data) + LOGGER.error('Differences:\n{:s}'.format(str(diff_data.pretty()))) + assert len(diff_data) == 0 + + +def test_delete_allocation(nbi_service_rest : RestServer, storage : Dict): # pylint: disable=redefined-outer-name, unused-argument + assert 'service_uuid_01' in storage + URL = BASE_URL + '/bw_allocations/service_uuid_01' + do_rest_delete_request(URL, logger=LOGGER, expected_status_codes={200}) + + +def test_get_allocations_empty_final(nbi_service_rest : RestServer, storage : Dict): # pylint: disable=redefined-outer-name, unused-argument + URL = BASE_URL + '/bw_allocations' + retrieved_data = do_rest_get_request(URL, logger=LOGGER, expected_status_codes={200}) + LOGGER.debug('retrieved_data={:s}'.format(json.dumps(retrieved_data, sort_keys=True))) + assert len(retrieved_data) == 0 + + +def test_cleanup_environment(context_client : ContextClient) -> None: # pylint: disable=redefined-outer-name + # Verify the scenario has no services/slices + response = context_client.GetContext(ADMIN_CONTEXT_ID) + assert len(response.topology_ids) == 1 + assert len(response.service_ids ) == 0 + assert len(response.slice_ids ) == 0 + + # Load descriptors and validate the base scenario + descriptor_loader = DescriptorLoader(descriptors_file=DESCRIPTOR_FILE, context_client=context_client) + descriptor_loader.validate() + descriptor_loader.unload() + validate_empty_scenario(context_client) diff --git a/src/nbi/tests/test_ietf_l2vpn.py b/src/nbi/tests/test_ietf_l2vpn.py new file mode 100644 index 0000000000000000000000000000000000000000..22171ce7090cd69cdbb7736973327e26e6e817f4 --- /dev/null +++ b/src/nbi/tests/test_ietf_l2vpn.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 +from common.tools.descriptor.Loader import DescriptorLoader, check_descriptor_load_results, validate_empty_scenario +from common.tools.object_factory.Context import json_context_id +from context.client.ContextClient import ContextClient +from tests.tools.mock_osm.MockOSM import MockOSM +from .Constants import SERVICE_CONNECTION_POINTS_1, SERVICE_CONNECTION_POINTS_2, SERVICE_TYPE +from .PrepareTestScenario import ( # pylint: disable=unused-import + # be careful, order of symbols is important here! + mock_service, nbi_service_rest, osm_wim, context_client +) + +LOGGER = logging.getLogger(__name__) +LOGGER.setLevel(logging.DEBUG) + +DESCRIPTOR_FILE = 'nbi/tests/data/topology-7router-emu-dummy.json' + +JSON_ADMIN_CONTEXT_ID = json_context_id(DEFAULT_CONTEXT_NAME) +ADMIN_CONTEXT_ID = ContextId(**JSON_ADMIN_CONTEXT_ID) + +def test_prepare_environment(context_client : ContextClient) -> None: # pylint: disable=redefined-outer-name + validate_empty_scenario(context_client) + descriptor_loader = DescriptorLoader(descriptors_file=DESCRIPTOR_FILE, context_client=context_client) + results = descriptor_loader.process() + check_descriptor_load_results(results, descriptor_loader) + descriptor_loader.validate() + + # Verify the scenario has no services/slices + response = context_client.GetContext(ADMIN_CONTEXT_ID) + assert len(response.topology_ids) == 1 + assert len(response.service_ids ) == 0 + assert len(response.slice_ids ) == 0 + +def test_create_service(osm_wim : MockOSM): # pylint: disable=redefined-outer-name + osm_wim.create_connectivity_service(SERVICE_TYPE, SERVICE_CONNECTION_POINTS_1) + +def test_get_service_status(osm_wim : MockOSM): # pylint: disable=redefined-outer-name + service_uuid = list(osm_wim.conn_info.keys())[0] # this test adds a single service + osm_wim.get_connectivity_service_status(service_uuid) + +def test_edit_service(osm_wim : MockOSM): # pylint: disable=redefined-outer-name + service_uuid = list(osm_wim.conn_info.keys())[0] # this test adds a single service + osm_wim.edit_connectivity_service(service_uuid, SERVICE_CONNECTION_POINTS_2) + +def test_delete_service(osm_wim : MockOSM): # pylint: disable=redefined-outer-name + service_uuid = list(osm_wim.conn_info.keys())[0] # this test adds a single service + osm_wim.delete_connectivity_service(service_uuid) + +def test_cleanup_environment(context_client : ContextClient) -> None: # pylint: disable=redefined-outer-name + # Verify the scenario has no services/slices + response = context_client.GetContext(ADMIN_CONTEXT_ID) + assert len(response.topology_ids) == 1 + assert len(response.service_ids ) == 0 + assert len(response.slice_ids ) == 0 + + # Load descriptors and validate the base scenario + descriptor_loader = DescriptorLoader(descriptors_file=DESCRIPTOR_FILE, context_client=context_client) + descriptor_loader.validate() + descriptor_loader.unload() + validate_empty_scenario(context_client) diff --git a/src/nbi/tests/test_ietf_l3vpn.py b/src/nbi/tests/test_ietf_l3vpn.py new file mode 100644 index 0000000000000000000000000000000000000000..17f3c3e93c627c41ddc344e55b3478d13077efb3 --- /dev/null +++ b/src/nbi/tests/test_ietf_l3vpn.py @@ -0,0 +1,113 @@ +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT 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, pytest +from typing import Dict +from common.Constants import DEFAULT_CONTEXT_NAME +from common.proto.context_pb2 import ContextId +from common.tools.descriptor.Loader import ( + DescriptorLoader, check_descriptor_load_results, validate_empty_scenario +) +from common.tools.object_factory.Context import json_context_id +from context.client.ContextClient import ContextClient +from nbi.service.rest_server import RestServer +from .PrepareTestScenario import ( # pylint: disable=unused-import + # be careful, order of symbols is important here! + do_rest_delete_request, do_rest_get_request, do_rest_post_request, + mock_service, nbi_service_rest, osm_wim, context_client +) + +LOGGER = logging.getLogger(__name__) +LOGGER.setLevel(logging.DEBUG) + +DESCRIPTOR_FILE = 'nbi/tests/data/topology-dummy.json' +SVC1_DATA_FILE = 'nbi/tests/data/ietf_l3vpn_req_svc1.json' +SVC2_DATA_FILE = 'nbi/tests/data/ietf_l3vpn_req_svc2.json' + +JSON_ADMIN_CONTEXT_ID = json_context_id(DEFAULT_CONTEXT_NAME) +ADMIN_CONTEXT_ID = ContextId(**JSON_ADMIN_CONTEXT_ID) + +@pytest.fixture(scope='session') +def storage() -> Dict: + yield dict() + +def test_prepare_environment(context_client : ContextClient) -> None: # pylint: disable=redefined-outer-name + validate_empty_scenario(context_client) + descriptor_loader = DescriptorLoader(descriptors_file=DESCRIPTOR_FILE, context_client=context_client) + results = descriptor_loader.process() + check_descriptor_load_results(results, descriptor_loader) + descriptor_loader.validate() + + # Verify the scenario has no services/slices + response = context_client.GetContext(ADMIN_CONTEXT_ID) + assert len(response.topology_ids) == 1 + assert len(response.service_ids ) == 0 + assert len(response.slice_ids ) == 0 + +# pylint: disable=redefined-outer-name, unused-argument +def test_create_svc1(nbi_service_rest : RestServer, storage : Dict): + with open(SVC1_DATA_FILE, 'r', encoding='UTF-8') as f: + svc1_data = json.load(f) + URL = '/restconf/data/ietf-l3vpn-svc:l3vpn-svc/vpn-services' + do_rest_post_request(URL, body=svc1_data, logger=LOGGER, expected_status_codes={201}) + storage['svc1-uuid'] = svc1_data['ietf-l3vpn-svc:l3vpn-svc']['vpn-services']['vpn-service'][0]['vpn-id'] + +# pylint: disable=redefined-outer-name, unused-argument +def test_create_svc2(nbi_service_rest : RestServer, storage : Dict): + with open(SVC2_DATA_FILE, 'r', encoding='UTF-8') as f: + svc2_data = json.load(f) + URL = '/restconf/data/ietf-l3vpn-svc:l3vpn-svc/vpn-services' + do_rest_post_request(URL, body=svc2_data, logger=LOGGER, expected_status_codes={201}) + storage['svc2-uuid'] = svc2_data['ietf-l3vpn-svc:l3vpn-svc']['vpn-services']['vpn-service'][0]['vpn-id'] + +# pylint: disable=redefined-outer-name, unused-argument +def test_get_state_svc1(nbi_service_rest : RestServer, storage : Dict): + assert 'svc1-uuid' in storage + service_uuid = storage['svc1-uuid'] + URL = '/restconf/data/ietf-l3vpn-svc:l3vpn-svc/vpn-services/vpn-service={:s}/'.format(service_uuid) + do_rest_get_request(URL, logger=LOGGER, expected_status_codes={200}) + +# pylint: disable=redefined-outer-name, unused-argument +def test_get_state_svc2(nbi_service_rest : RestServer, storage : Dict): + assert 'svc2-uuid' in storage + service_uuid = storage['svc2-uuid'] + URL = '/restconf/data/ietf-l3vpn-svc:l3vpn-svc/vpn-services/vpn-service={:s}/'.format(service_uuid) + do_rest_get_request(URL, logger=LOGGER, expected_status_codes={200}) + +# pylint: disable=redefined-outer-name, unused-argument +def test_delete_svc1(nbi_service_rest : RestServer, storage : Dict): + assert 'svc1-uuid' in storage + service_uuid = storage['svc1-uuid'] + URL = '/restconf/data/ietf-l3vpn-svc:l3vpn-svc/vpn-services/vpn-service={:s}/'.format(service_uuid) + do_rest_delete_request(URL, logger=LOGGER, expected_status_codes={204}) + +# pylint: disable=redefined-outer-name, unused-argument +def test_delete_svc2(nbi_service_rest : RestServer, storage : Dict): + assert 'svc2-uuid' in storage + service_uuid = storage['svc2-uuid'] + URL = '/restconf/data/ietf-l3vpn-svc:l3vpn-svc/vpn-services/vpn-service={:s}/'.format(service_uuid) + do_rest_delete_request(URL, logger=LOGGER, expected_status_codes={204}) + +def test_cleanup_environment(context_client : ContextClient) -> None: # pylint: disable=redefined-outer-name + # Verify the scenario has no services/slices + response = context_client.GetContext(ADMIN_CONTEXT_ID) + assert len(response.topology_ids) == 1 + assert len(response.service_ids ) == 0 + assert len(response.slice_ids ) == 0 + + # Load descriptors and validate the base scenario + descriptor_loader = DescriptorLoader(descriptors_file=DESCRIPTOR_FILE, context_client=context_client) + descriptor_loader.validate() + descriptor_loader.unload() + validate_empty_scenario(context_client) diff --git a/src/nbi/tests/test_ietf_network.py b/src/nbi/tests/test_ietf_network.py new file mode 100644 index 0000000000000000000000000000000000000000..fb39a91922ca0d76f950c5e0c8c98847547b7ac9 --- /dev/null +++ b/src/nbi/tests/test_ietf_network.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 deepdiff, json, logging, operator +from typing import Dict +from common.Constants import DEFAULT_CONTEXT_NAME +from common.proto.context_pb2 import ContextId +from common.tools.descriptor.Loader import DescriptorLoader, check_descriptor_load_results, validate_empty_scenario +from common.tools.object_factory.Context import json_context_id +from context.client.ContextClient import ContextClient +from nbi.service.rest_server import RestServer +from .PrepareTestScenario import ( # pylint: disable=unused-import + # be careful, order of symbols is important here! + do_rest_get_request, mock_service, nbi_service_rest, osm_wim, context_client +) + +LOGGER = logging.getLogger(__name__) +LOGGER.setLevel(logging.DEBUG) + +DESCRIPTOR_FILE = 'nbi/tests/data/topology-dummy.json' +TARGET_DATA_FILE = 'nbi/tests/data/test-ietf-network.json' + +JSON_ADMIN_CONTEXT_ID = json_context_id(DEFAULT_CONTEXT_NAME) +ADMIN_CONTEXT_ID = ContextId(**JSON_ADMIN_CONTEXT_ID) + +def test_prepare_environment(context_client : ContextClient) -> None: # pylint: disable=redefined-outer-name + validate_empty_scenario(context_client) + descriptor_loader = DescriptorLoader(descriptors_file=DESCRIPTOR_FILE, context_client=context_client) + results = descriptor_loader.process() + check_descriptor_load_results(results, descriptor_loader) + descriptor_loader.validate() + + # Verify the scenario has no services/slices + response = context_client.GetContext(ADMIN_CONTEXT_ID) + assert len(response.topology_ids) == 1 + assert len(response.service_ids ) == 0 + assert len(response.slice_ids ) == 0 + +def sort_data(data : Dict) -> None: + if 'ietf-network:networks' not in data: return + if 'network' not in data['ietf-network:networks']: return + data['ietf-network:networks']['network'] = sorted( + data['ietf-network:networks']['network'], + key=operator.itemgetter('network-id') + ) + for network in data['ietf-network:networks']['network']: + if 'node' in network: + network['node'] = sorted( + network['node'], + key=operator.itemgetter('node-id') + ) + + for node in network['node']: + if 'ietf-network-topology:termination-point' in node: + node['ietf-network-topology:termination-point'] = sorted( + node['ietf-network-topology:termination-point'], + key=operator.itemgetter('tp-id') + ) + + if 'ietf-network-topology:link' in network: + network['ietf-network-topology:link'] = sorted( + network['ietf-network-topology:link'], + key=operator.itemgetter('link-id') + ) + +def test_rest_get_networks(nbi_service_rest : RestServer): # pylint: disable=redefined-outer-name, unused-argument + with open(TARGET_DATA_FILE, 'r', encoding='UTF-8') as f: + target_data = json.load(f) + URL = '/restconf/data/ietf-network:networks' + retrieved_data = do_rest_get_request(URL, logger=LOGGER, expected_status_codes={200}) + sort_data(retrieved_data) + sort_data(target_data) + diff_data = deepdiff.DeepDiff(target_data, retrieved_data) + LOGGER.error('Differences:\n{:s}'.format(str(diff_data.pretty()))) + assert len(diff_data) == 0 + +def test_cleanup_environment(context_client : ContextClient) -> None: # pylint: disable=redefined-outer-name + # Verify the scenario has no services/slices + response = context_client.GetContext(ADMIN_CONTEXT_ID) + assert len(response.topology_ids) == 1 + assert len(response.service_ids ) == 0 + assert len(response.slice_ids ) == 0 + + # Load descriptors and validate the base scenario + descriptor_loader = DescriptorLoader(descriptors_file=DESCRIPTOR_FILE, context_client=context_client) + descriptor_loader.validate() + descriptor_loader.unload() + validate_empty_scenario(context_client) diff --git a/src/compute/tests/test_slice.py b/src/nbi/tests/test_slice.py similarity index 97% rename from src/compute/tests/test_slice.py rename to src/nbi/tests/test_slice.py index 61f286eb74a876fa02546fc2bf1dcd8f092e718a..129d8087fd4c56d4bb758830e47e9ac3216c252b 100644 --- a/src/compute/tests/test_slice.py +++ b/src/nbi/tests/test_slice.py @@ -14,7 +14,7 @@ import json, random, uuid from typing import Dict, Tuple -from compute.service.rest_server.nbi_plugins.ietf_network_slice.bindings.network_slice_services import ( +from nbi.service.rest_server.nbi_plugins.ietf_network_slice.bindings.network_slice_services import ( NetworkSliceServices ) diff --git a/src/opticalattackdetector/Dockerfile b/src/opticalattackdetector/Dockerfile index fd903a616395617fbbe312b5fca8303966fc6053..2b55ae7b00607729bba4c8f0e1f76b10c7170b11 100644 --- a/src/opticalattackdetector/Dockerfile +++ b/src/opticalattackdetector/Dockerfile @@ -16,7 +16,7 @@ FROM python:3.9-slim # Install dependencies RUN apt-get --yes --quiet --quiet update && \ - apt-get --yes --quiet --quiet install wget g++ && \ + apt-get --yes --quiet --quiet install wget g++ git && \ rm -rf /var/lib/apt/lists/* # Set Python to show logs as they occur diff --git a/src/opticalattackmanager/Dockerfile b/src/opticalattackmanager/Dockerfile index 9920d6cefbb4ffc87558ae562cfb4fcee365930f..38637861ae5fa72e4baf0abaa58929136890db63 100644 --- a/src/opticalattackmanager/Dockerfile +++ b/src/opticalattackmanager/Dockerfile @@ -16,7 +16,7 @@ FROM python:3.9-slim # Install dependencies RUN apt-get --yes --quiet --quiet update && \ - apt-get --yes --quiet --quiet install wget g++ && \ + apt-get --yes --quiet --quiet install wget g++ git && \ rm -rf /var/lib/apt/lists/* # Set Python to show logs as they occur diff --git a/src/opticalattackmitigator/Dockerfile b/src/opticalattackmitigator/Dockerfile index e364cbee121c38570c8158946486ec38dcd8b12d..278990306a7ac410eb5d7442537919e410fa957d 100644 --- a/src/opticalattackmitigator/Dockerfile +++ b/src/opticalattackmitigator/Dockerfile @@ -16,7 +16,7 @@ FROM python:3.9-slim # Install dependencies RUN apt-get --yes --quiet --quiet update && \ - apt-get --yes --quiet --quiet install wget g++ && \ + apt-get --yes --quiet --quiet install wget g++ git && \ rm -rf /var/lib/apt/lists/* # Set Python to show logs as they occur diff --git a/src/pathcomp/.gitlab-ci.yml b/src/pathcomp/.gitlab-ci.yml index 20ec4e728837b87e061b2ecffa4b7549c658258f..05113d0feab441543d6567f3eb3ab1cacac3a971 100644 --- a/src/pathcomp/.gitlab-ci.yml +++ b/src/pathcomp/.gitlab-ci.yml @@ -60,6 +60,7 @@ unit_test pathcomp-backend: - 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 + - docker container prune -f script: - docker pull "$CI_REGISTRY_IMAGE/${IMAGE_NAME}-backend:$IMAGE_TAG" - docker ps -a @@ -106,6 +107,7 @@ unit_test pathcomp-frontend: - 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 + - docker container prune -f script: - docker pull "$CI_REGISTRY_IMAGE/${IMAGE_NAME}-frontend:$IMAGE_TAG" - docker pull "$CI_REGISTRY_IMAGE/${IMAGE_NAME}-backend:$IMAGE_TAG" @@ -131,7 +133,7 @@ unit_test pathcomp-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" + "coverage run -m pytest --log-level=INFO --verbose --junitxml=/opt/results/${IMAGE_NAME}-frontend_report.xml $IMAGE_NAME/frontend/tests/test_unitary.py $IMAGE_NAME/frontend/tests/test_unitary_pathcomp_forecaster.py" - 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: diff --git a/src/pathcomp/frontend/Config.py b/src/pathcomp/frontend/Config.py index 714eb7278074ac860caa76dc3ed8b4a40ae9f192..61aa31a8316a67cdba4b214fc0a1ff4b3843b003 100644 --- a/src/pathcomp/frontend/Config.py +++ b/src/pathcomp/frontend/Config.py @@ -13,6 +13,7 @@ # limitations under the License. import os +from common.Settings import get_setting DEFAULT_PATHCOMP_BACKEND_SCHEME = 'http' DEFAULT_PATHCOMP_BACKEND_HOST = '127.0.0.1' @@ -37,3 +38,13 @@ 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) + + +SETTING_NAME_ENABLE_FORECASTER = 'ENABLE_FORECASTER' +TRUE_VALUES = {'Y', 'YES', 'TRUE', 'T', 'E', 'ENABLE', 'ENABLED'} + +def is_forecaster_enabled() -> bool: + is_enabled = get_setting(SETTING_NAME_ENABLE_FORECASTER, default=None) + if is_enabled is None: return False + str_is_enabled = str(is_enabled).upper() + return str_is_enabled in TRUE_VALUES diff --git a/src/pathcomp/frontend/Dockerfile b/src/pathcomp/frontend/Dockerfile index 9384b3e19edd5e82b0efcb9706c41105a31321e3..955844cf4d80b39fc0913c9c523fd1267ca0fb1d 100644 --- a/src/pathcomp/frontend/Dockerfile +++ b/src/pathcomp/frontend/Dockerfile @@ -16,7 +16,7 @@ FROM python:3.9-slim # Install dependencies RUN apt-get --yes --quiet --quiet update && \ - apt-get --yes --quiet --quiet install wget g++ && \ + apt-get --yes --quiet --quiet install wget g++ git && \ rm -rf /var/lib/apt/lists/* # Set Python to show logs as they occur @@ -66,6 +66,9 @@ COPY src/context/__init__.py context/__init__.py COPY src/context/client/. context/client/ COPY src/device/__init__.py device/__init__.py COPY src/device/client/. device/client/ +COPY src/forecaster/. forecaster/ +COPY src/monitoring/__init__.py monitoring/__init__.py +COPY src/monitoring/client/. monitoring/client/ COPY src/service/__init__.py service/__init__.py COPY src/service/client/. service/client/ COPY src/slice/__init__.py slice/__init__.py diff --git a/src/pathcomp/frontend/requirements.in b/src/pathcomp/frontend/requirements.in index d99d4cd02b1a9fa39633b35d998b228b3b9e9fc7..c96d7425c5d2e32d43559b8b138de8200db40eac 100644 --- a/src/pathcomp/frontend/requirements.in +++ b/src/pathcomp/frontend/requirements.in @@ -13,4 +13,6 @@ # limitations under the License. +pandas==1.5.* requests==2.27.1 +scikit-learn==1.1.* diff --git a/src/pathcomp/frontend/service/PathCompServiceServicerImpl.py b/src/pathcomp/frontend/service/PathCompServiceServicerImpl.py index 784a09e32c2dbb6f6cfcbbbe51048e49ad9a7005..5d3d352d7ddf0638b3d9a3894eb1f9ac3f91c4fb 100644 --- a/src/pathcomp/frontend/service/PathCompServiceServicerImpl.py +++ b/src/pathcomp/frontend/service/PathCompServiceServicerImpl.py @@ -13,18 +13,20 @@ # limitations under the License. import grpc, logging, threading -from common.Constants import DEFAULT_CONTEXT_NAME, DEFAULT_TOPOLOGY_NAME, INTERDOMAIN_TOPOLOGY_NAME +#from common.Constants import DEFAULT_CONTEXT_NAME, DEFAULT_TOPOLOGY_NAME, INTERDOMAIN_TOPOLOGY_NAME from common.method_wrappers.Decorator import MetricsPool, safe_and_metered_rpc_method -from common.proto.context_pb2 import ContextId, Empty, TopologyId +#from common.proto.context_pb2 import ContextId, Empty, TopologyId 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.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 common.tools.object_factory.Topology import json_topology_id -from context.client.ContextClient import ContextClient +from pathcomp.frontend.Config import is_forecaster_enabled +#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 pathcomp.frontend.service.TopologyTools import get_pathcomp_topology_details from pathcomp.frontend.service.algorithms.Factory import get_algorithm LOGGER = logging.getLogger(__name__) @@ -43,9 +45,7 @@ class PathCompServiceServicerImpl(PathCompServiceServicer): 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() - - context_id = json_context_id(DEFAULT_CONTEXT_NAME) + #context_client = ContextClient() # TODO: improve definition of topologies; for interdomain the current topology design might be not convenient #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) @@ -56,10 +56,11 @@ class PathCompServiceServicerImpl(PathCompServiceServicer): # # TODO: add contexts, topologies, and membership of devices/links in topologies # #devices = context_client.ListDevices(Empty()) # #links = context_client.ListLinks(Empty()) + # context_id = json_context_id(DEFAULT_CONTEXT_NAME) # topology_id = json_topology_id(DEFAULT_TOPOLOGY_NAME, context_id) - topology_id = json_topology_id(DEFAULT_TOPOLOGY_NAME, context_id) - topology_details = context_client.GetTopologyDetails(TopologyId(**topology_id)) + allow_forecasting = is_forecaster_enabled() + topology_details = get_pathcomp_topology_details(request, allow_forecasting=allow_forecasting) algorithm = get_algorithm(request) algorithm.add_devices(topology_details.devices) diff --git a/src/pathcomp/frontend/service/TopologyTools.py b/src/pathcomp/frontend/service/TopologyTools.py new file mode 100644 index 0000000000000000000000000000000000000000..778cd59acce1eeeeeb1b05bcc3a03f09a9a46a8e --- /dev/null +++ b/src/pathcomp/frontend/service/TopologyTools.py @@ -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. + +import logging, math +from typing import Dict, Optional +from common.Constants import DEFAULT_CONTEXT_NAME, DEFAULT_TOPOLOGY_NAME, ServiceNameEnum +from common.Settings import ENVVAR_SUFIX_SERVICE_HOST, ENVVAR_SUFIX_SERVICE_PORT_GRPC, find_environment_variables, get_env_var_name +from common.method_wrappers.ServiceExceptions import InvalidArgumentException +from common.proto.context_pb2 import Constraint_Schedule, Service, TopologyDetails +from common.proto.forecaster_pb2 import ForecastLinkCapacityReply, ForecastTopologyCapacityRequest +from common.proto.pathcomp_pb2 import PathCompRequest +from common.tools.context_queries.Topology import get_topology_details +from common.tools.grpc.Tools import grpc_message_to_json_string +from context.client.ContextClient import ContextClient +from forecaster.client.ForecasterClient import ForecasterClient + +LOGGER = logging.getLogger(__name__) + +def get_service_schedule(service : Service) -> Optional[Constraint_Schedule]: + for constraint in service.service_constraints: + if constraint.WhichOneof('constraint') != 'schedule': continue + return constraint.schedule + return None + +def get_pathcomp_topology_details(request : PathCompRequest, allow_forecasting : bool = False) -> TopologyDetails: + context_client = ContextClient() + topology_details = get_topology_details( + context_client, DEFAULT_TOPOLOGY_NAME, context_uuid=DEFAULT_CONTEXT_NAME, rw_copy=True + ) + + if len(request.services) == 0: + raise InvalidArgumentException('services', grpc_message_to_json_string(request), 'must not be empty') + + if not allow_forecasting: + LOGGER.warning('Forecaster is explicitly disabled') + return topology_details + + env_vars = find_environment_variables([ + get_env_var_name(ServiceNameEnum.FORECASTER, ENVVAR_SUFIX_SERVICE_HOST ), + get_env_var_name(ServiceNameEnum.FORECASTER, ENVVAR_SUFIX_SERVICE_PORT_GRPC), + ]) + if len(env_vars) != 2: + LOGGER.warning('Forecaster is not deployed') + return topology_details + + if len(request.services) > 1: + LOGGER.warning('Forecaster does not support multiple services') + return topology_details + + service = request.services[0] + service_schedule = get_service_schedule(service) + if service_schedule is None: + LOGGER.warning('Service provides no schedule constraint; forecast cannot be used') + return topology_details + + #start_timestamp = service_schedule.start_timestamp + duration_days = service_schedule.duration_days + if float(duration_days) <= 1.e-12: + LOGGER.warning('Service schedule constraint does not define a duration; forecast cannot be used') + return topology_details + + forecaster_client = ForecasterClient() + forecaster_client.connect() + + forecast_request = ForecastTopologyCapacityRequest( + topology_id=topology_details.topology_id, + forecast_window_seconds = duration_days * 24 * 60 * 60 + ) + + forecast_reply = forecaster_client.ForecastTopologyCapacity(forecast_request) + + forecasted_link_capacities : Dict[str, ForecastLinkCapacityReply] = { + link_capacity.link_id.link_uuid.uuid : link_capacity + for link_capacity in forecast_reply.link_capacities + } + + for link in topology_details.links: + link_uuid = link.link_id.link_uuid.uuid + forecasted_link_capacity = forecasted_link_capacities.get(link_uuid) + if forecasted_link_capacity is None: continue + link.attributes.used_capacity_gbps = forecasted_link_capacity.forecast_used_capacity_gbps + if link.attributes.total_capacity_gbps < link.attributes.used_capacity_gbps: + total_capacity_gbps = link.attributes.used_capacity_gbps + total_capacity_gbps = math.ceil(total_capacity_gbps / 100) * 100 # round up in steps of 100 + link.attributes.total_capacity_gbps = total_capacity_gbps + + return topology_details diff --git a/src/pathcomp/frontend/service/algorithms/tools/ComposeRequest.py b/src/pathcomp/frontend/service/algorithms/tools/ComposeRequest.py index e2c6dc13804703d89242b27156763ce887aa4884..02765901ec1084e32fde440ff531f035249fc750 100644 --- a/src/pathcomp/frontend/service/algorithms/tools/ComposeRequest.py +++ b/src/pathcomp/frontend/service/algorithms/tools/ComposeRequest.py @@ -118,9 +118,25 @@ def compose_link(grpc_link : Link) -> Dict: for link_endpoint_id in grpc_link.link_endpoint_ids ] + total_capacity_gbps, used_capacity_gbps = None, None + if grpc_link.HasField('attributes'): + attributes = grpc_link.attributes + # In proto3, HasField() does not work for scalar fields, using ListFields() instead. + attribute_names = set([field.name for field,_ in attributes.ListFields()]) + if 'total_capacity_gbps' in attribute_names: + total_capacity_gbps = attributes.total_capacity_gbps + if 'used_capacity_gbps' in attribute_names: + used_capacity_gbps = attributes.used_capacity_gbps + elif total_capacity_gbps is not None: + used_capacity_gbps = total_capacity_gbps + + if total_capacity_gbps is None: total_capacity_gbps = 100 + if used_capacity_gbps is None: used_capacity_gbps = 0 + available_capacity_gbps = total_capacity_gbps - used_capacity_gbps + forwarding_direction = LinkForwardingDirection.UNIDIRECTIONAL.value - total_potential_capacity = compose_capacity(200, CapacityUnit.MBPS.value) - available_capacity = compose_capacity(200, CapacityUnit.MBPS.value) + total_potential_capacity = compose_capacity(total_capacity_gbps, CapacityUnit.GBPS.value) + available_capacity = compose_capacity(available_capacity_gbps, CapacityUnit.GBPS.value) cost_characteristics = compose_cost_characteristics('linkcost', '1', '0') latency_characteristics = compose_latency_characteristics('1') diff --git a/src/pathcomp/frontend/tests/MockService_Dependencies.py b/src/pathcomp/frontend/tests/MockService_Dependencies.py index e903bc0e028c7ef97f21d7422f37255574547338..858db17a9e35e30ea93c965815b39a068c696b4b 100644 --- a/src/pathcomp/frontend/tests/MockService_Dependencies.py +++ b/src/pathcomp/frontend/tests/MockService_Dependencies.py @@ -17,12 +17,15 @@ 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_CONTEXT = ServiceNameEnum.CONTEXT +SERVICE_MONITORING = ServiceNameEnum.MONITORING class MockService_Dependencies(GenericGrpcService): # Mock Service implementing Context, Device, and Service to simplify unitary tests of PathComp @@ -35,6 +38,12 @@ class MockService_Dependencies(GenericGrpcService): self.context_servicer = MockServicerImpl_Context() add_ContextServiceServicer_to_server(self.context_servicer, self.server) + self.monitoring_servicer = MockServicerImpl_Monitoring() + 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/pathcomp/frontend/tests/PrepareTestScenario.py b/src/pathcomp/frontend/tests/PrepareTestScenario.py index 387f6aedef1a88559f974a0b792ac1499d42a3f7..8cc06349b3dc61fc62a6711d4cb72c09e39c9a64 100644 --- a/src/pathcomp/frontend/tests/PrepareTestScenario.py +++ b/src/pathcomp/frontend/tests/PrepareTestScenario.py @@ -17,16 +17,24 @@ 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 forecaster.client.ForecasterClient import ForecasterClient +from forecaster.service.ForecasterService import ForecasterService +from monitoring.client.MonitoringClient import MonitoringClient from pathcomp.frontend.client.PathCompClient import PathCompClient from pathcomp.frontend.service.PathCompService import PathCompService -from pathcomp.frontend.tests.MockService_Dependencies import MockService_Dependencies +from .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 +# avoid privileged ports +PATHCOMP_SERVICE_PORT = MOCKSERVICE_PORT + int(get_service_port_grpc(ServiceNameEnum.PATHCOMP)) 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) +FORECASTER_SERVICE_PORT = MOCKSERVICE_PORT + int(get_service_port_grpc(ServiceNameEnum.FORECASTER)) +os.environ[get_env_var_name(ServiceNameEnum.FORECASTER, ENVVAR_SUFIX_SERVICE_HOST )] = str(LOCAL_HOST) +os.environ[get_env_var_name(ServiceNameEnum.FORECASTER, ENVVAR_SUFIX_SERVICE_PORT_GRPC)] = str(FORECASTER_SERVICE_PORT) + @pytest.fixture(scope='session') def mock_service(): _service = MockService_Dependencies(MOCKSERVICE_PORT) @@ -42,8 +50,33 @@ def context_client(mock_service : MockService_Dependencies): # pylint: disable=r _client.close() @pytest.fixture(scope='session') -def pathcomp_service(context_client : ContextClient): # pylint: disable=redefined-outer-name +def monitoring_client(mock_service : MockService_Dependencies): # pylint: disable=redefined-outer-name + _client = MonitoringClient() + yield _client + _client.close() +@pytest.fixture(scope='session') +def forecaster_service( + context_client : ContextClient, # pylint: disable=redefined-outer-name + monitoring_client : MonitoringClient, # pylint: disable=redefined-outer-name +): + _service = ForecasterService() + _service.start() + yield _service + _service.stop() + +@pytest.fixture(scope='session') +def forecaster_client(forecaster_service : ForecasterService): # pylint: disable=redefined-outer-name + _client = ForecasterClient() + yield _client + _client.close() + +@pytest.fixture(scope='session') +def pathcomp_service( + context_client : ContextClient, # pylint: disable=redefined-outer-name + monitoring_client : MonitoringClient, # pylint: disable=redefined-outer-name + forecaster_client : ForecasterClient, # pylint: disable=redefined-outer-name +): _service = PathCompService() _service.start() yield _service diff --git a/src/pathcomp/frontend/tests/test_unitary.py b/src/pathcomp/frontend/tests/test_unitary.py index f4e3cbf0f60285b960625a677854c4b7ab4decb9..4d5b3549ba52e3ef448a05c6d137f2a75531f3ea 100644 --- a/src/pathcomp/frontend/tests/test_unitary.py +++ b/src/pathcomp/frontend/tests/test_unitary.py @@ -56,7 +56,8 @@ os.environ['PATHCOMP_BACKEND_PORT'] = os.environ.get('PATHCOMP_BACKEND_PORT', ba from .PrepareTestScenario import ( # pylint: disable=unused-import # be careful, order of symbols is important here! - mock_service, pathcomp_service, context_client, pathcomp_client) + mock_service, context_client, monitoring_client, + forecaster_service, forecaster_client, pathcomp_service, pathcomp_client) LOGGER = logging.getLogger(__name__) LOGGER.setLevel(logging.DEBUG) diff --git a/src/pathcomp/frontend/tests/test_unitary_pathcomp_forecaster.py b/src/pathcomp/frontend/tests/test_unitary_pathcomp_forecaster.py new file mode 100644 index 0000000000000000000000000000000000000000..d6d39d3177f1a3d2275a6b48d68478c0a37e9d6a --- /dev/null +++ b/src/pathcomp/frontend/tests/test_unitary_pathcomp_forecaster.py @@ -0,0 +1,198 @@ +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT 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, pandas, pytest +from typing import Dict, Tuple +from common.Constants import DEFAULT_CONTEXT_NAME, DEFAULT_TOPOLOGY_NAME +from common.proto.context_pb2 import ContextId, TopologyId +from common.proto.kpi_sample_types_pb2 import KpiSampleType +from common.proto.monitoring_pb2 import KpiDescriptor +from common.proto.pathcomp_pb2 import PathCompRequest +from common.tools.descriptor.Loader import DescriptorLoader, check_descriptor_load_results, validate_empty_scenario +from common.tools.object_factory.Context import json_context_id +from common.tools.object_factory.Topology import json_topology_id +from common.tools.grpc.Tools import grpc_message_to_json +from common.tools.object_factory.Constraint import ( + json_constraint_schedule, json_constraint_sla_capacity, json_constraint_sla_latency) +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.EndPoint import json_endpoint_id +from common.tools.object_factory.Service import get_service_uuid, json_service_l3nm_planned +from common.tools.timestamp.Converters import timestamp_utcnow_to_float +from context.client.ContextClient import ContextClient +from forecaster.tests.Tools import compose_descriptors, read_csv +from monitoring.client.MonitoringClient import MonitoringClient +from pathcomp.frontend.client.PathCompClient import PathCompClient +from .MockService_Dependencies import MockService_Dependencies + +# 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, context_client, monitoring_client, + forecaster_service, forecaster_client, pathcomp_service, pathcomp_client) + +LOGGER = logging.getLogger(__name__) +LOGGER.setLevel(logging.DEBUG) +logging.getLogger('common.tests.InMemoryObjectDatabase').setLevel(logging.INFO) +logging.getLogger('common.tests.InMemoryTimeSeriesDatabase').setLevel(logging.INFO) +logging.getLogger('common.tests.MockServicerImpl_Context').setLevel(logging.INFO) +logging.getLogger('common.tests.MockServicerImpl_Monitoring').setLevel(logging.INFO) +logging.getLogger('context.client.ContextClient').setLevel(logging.INFO) +logging.getLogger('monitoring.client.MonitoringClient').setLevel(logging.INFO) + +JSON_ADMIN_CONTEXT_ID = json_context_id(DEFAULT_CONTEXT_NAME) +ADMIN_CONTEXT_ID = ContextId(**JSON_ADMIN_CONTEXT_ID) +ADMIN_TOPOLOGY_ID = TopologyId(**json_topology_id(DEFAULT_TOPOLOGY_NAME, context_id=JSON_ADMIN_CONTEXT_ID)) + +CSV_DATA_FILE = 'forecaster/tests/data/dataset.csv' +#DESC_DATS_FILE = 'forecaster/tests/data/descriptor.json' + +@pytest.fixture(scope='session') +def scenario() -> Tuple[pandas.DataFrame, Dict]: + df = read_csv(CSV_DATA_FILE) + descriptors = compose_descriptors(df, num_client_endpoints=5) + #with open(DESC_DATS_FILE, 'w', encoding='UTF-8') as f: + # f.write(json.dumps(descriptors)) + yield df, descriptors + +def test_prepare_environment( + context_client : ContextClient, # pylint: disable=redefined-outer-name + monitoring_client : MonitoringClient, # pylint: disable=redefined-outer-name + mock_service : MockService_Dependencies, # pylint: disable=redefined-outer-name + scenario : Tuple[pandas.DataFrame, Dict] # pylint: disable=redefined-outer-name +) -> None: + df, descriptors = scenario + + validate_empty_scenario(context_client) + descriptor_loader = DescriptorLoader(descriptors=descriptors, context_client=context_client) + results = descriptor_loader.process() + check_descriptor_load_results(results, descriptor_loader) + descriptor_loader.validate() + + # Verify the scenario has no services/slices + response = context_client.GetContext(ADMIN_CONTEXT_ID) + assert len(response.service_ids) == 0 + assert len(response.slice_ids) == 0 + + for link in descriptors['links']: + link_uuid = link['link_id']['link_uuid']['uuid'] + kpi_descriptor = KpiDescriptor() + kpi_descriptor.kpi_id.kpi_id.uuid = link_uuid # pylint: disable=no-member + kpi_descriptor.kpi_description = 'Used Capacity in Link: {:s}'.format(link_uuid) + kpi_descriptor.kpi_sample_type = KpiSampleType.KPISAMPLETYPE_LINK_USED_CAPACITY_GBPS + kpi_descriptor.link_id.link_uuid.uuid = link_uuid # pylint: disable=no-member + monitoring_client.SetKpi(kpi_descriptor) + + mock_service.monitoring_servicer.ts_db._data = df.rename(columns={ + 'link_id': 'kpi_uuid', + 'used_capacity_gbps': 'value' + }) + +def test_request_service_shortestpath_forecast( + pathcomp_client : PathCompClient, # pylint: disable=redefined-outer-name +) -> None: + + start_timestamp = timestamp_utcnow_to_float() + duration_days = 1.5 + + endpoint_id_a = json_endpoint_id(json_device_id('pt1.pt'), 'client:1') + endpoint_id_z = json_endpoint_id(json_device_id('gr1.gr'), 'client:3') + context_uuid = DEFAULT_CONTEXT_NAME + service_uuid = get_service_uuid(endpoint_id_a, endpoint_id_z) + request_service = json_service_l3nm_planned( + service_uuid, + context_uuid=context_uuid, + endpoint_ids=[endpoint_id_a, endpoint_id_z], + constraints=[ + json_constraint_sla_capacity(25.0), + json_constraint_sla_latency(20.0), + json_constraint_schedule(start_timestamp, duration_days), + ] + ) + + pathcomp_request = PathCompRequest(services=[request_service]) + 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(reply_services) >= 1 + 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 requested service has a reply + # It permits having other services not requested (i.e., sub-services) + context_service_uuid = '{:s}/{:s}'.format(context_uuid, service_uuid) + assert context_service_uuid in reply_service_ids + + 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 requested service has a connection associated + # It permits having other connections not requested (i.e., connections for sub-services) + assert context_service_uuid in reply_connection_service_ids + + # 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 + scenario : Tuple[pandas.DataFrame, Dict] # pylint: disable=redefined-outer-name +) -> None: + _, descriptors = scenario + + # Verify the scenario has no services/slices + response = context_client.GetContext(ADMIN_CONTEXT_ID) + assert len(response.service_ids) == 0 + assert len(response.slice_ids) == 0 + + # Load descriptors and validate the base scenario + descriptor_loader = DescriptorLoader(descriptors=descriptors, context_client=context_client) + descriptor_loader.validate() + descriptor_loader.unload() + validate_empty_scenario(context_client) diff --git a/src/pathcomp/misc/my_deploy-tests.sh b/src/pathcomp/misc/my_deploy-tests.sh index 66564e9a07a6a9ea8eb7cc6ba545c551f614a526..a22cc1822287216dd79f88d6076687d868f45276 100755 --- a/src/pathcomp/misc/my_deploy-tests.sh +++ b/src/pathcomp/misc/my_deploy-tests.sh @@ -17,7 +17,7 @@ export TFS_REGISTRY_IMAGE="http://localhost:32000/tfs/" # Set the list of components, separated by comas, you want to build images for, and deploy. # Supported components are: -# context device automation policy service compute monitoring webui +# context device ztp policy service nbi monitoring webui # interdomain slice pathcomp dlt # dbscanserving opticalattackmitigator opticalcentralizedattackdetector # l3_attackmitigator l3_centralizedattackdetector l3_distributedattackdetector diff --git a/src/policy/pom.xml b/src/policy/pom.xml index 267006311f82c11bce4db29f2d114f30c1832f88..ce873a2d8a1078ea00bf47230f4eca17b20f4442 100644 --- a/src/policy/pom.xml +++ b/src/policy/pom.xml @@ -19,7 +19,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - eu.teraflow + org.etsi.tfs policy 0.1.0 TeraFlow Policy Component diff --git a/src/policy/src/main/java/eu/teraflow/policy/PolicyGateway.java b/src/policy/src/main/java/org/etsi/tfs/policy/PolicyGateway.java similarity index 96% rename from src/policy/src/main/java/eu/teraflow/policy/PolicyGateway.java rename to src/policy/src/main/java/org/etsi/tfs/policy/PolicyGateway.java index c5570af74136ea4b8afc465f10fcb7d269db41a0..2dd059ac898ef50ef9ed2859d55d60962e723f42 100644 --- a/src/policy/src/main/java/eu/teraflow/policy/PolicyGateway.java +++ b/src/policy/src/main/java/org/etsi/tfs/policy/PolicyGateway.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package eu.teraflow.policy; +package org.etsi.tfs.policy; import policy.PolicyService; diff --git a/src/policy/src/main/java/eu/teraflow/policy/PolicyGatewayImpl.java b/src/policy/src/main/java/org/etsi/tfs/policy/PolicyGatewayImpl.java similarity index 99% rename from src/policy/src/main/java/eu/teraflow/policy/PolicyGatewayImpl.java rename to src/policy/src/main/java/org/etsi/tfs/policy/PolicyGatewayImpl.java index 30e888d9fab1aae535dca345c7c56e28218bd2c2..c7bb58e5244f5b969bc468aaf1c6c3a4d27c3cb3 100644 --- a/src/policy/src/main/java/eu/teraflow/policy/PolicyGatewayImpl.java +++ b/src/policy/src/main/java/org/etsi/tfs/policy/PolicyGatewayImpl.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package eu.teraflow.policy; +package org.etsi.tfs.policy; import context.ContextOuterClass.ServiceId; import io.quarkus.grpc.GrpcService; diff --git a/src/policy/src/main/java/eu/teraflow/policy/PolicyRuleConditionFieldsGetter.java b/src/policy/src/main/java/org/etsi/tfs/policy/PolicyRuleConditionFieldsGetter.java similarity index 89% rename from src/policy/src/main/java/eu/teraflow/policy/PolicyRuleConditionFieldsGetter.java rename to src/policy/src/main/java/org/etsi/tfs/policy/PolicyRuleConditionFieldsGetter.java index 89330354ef0fae7ce0b4834e9f57640b3e8dc027..8a863abaa71388e7fb52a00327489fc4625a6744 100644 --- a/src/policy/src/main/java/eu/teraflow/policy/PolicyRuleConditionFieldsGetter.java +++ b/src/policy/src/main/java/org/etsi/tfs/policy/PolicyRuleConditionFieldsGetter.java @@ -14,14 +14,14 @@ * limitations under the License. */ -package eu.teraflow.policy; +package org.etsi.tfs.policy; -import eu.teraflow.policy.model.NumericalOperator; -import eu.teraflow.policy.model.PolicyRuleCondition; -import eu.teraflow.policy.monitoring.model.KpiValue; import java.util.List; import java.util.stream.Collectors; import javax.inject.Singleton; +import org.etsi.tfs.policy.model.NumericalOperator; +import org.etsi.tfs.policy.model.PolicyRuleCondition; +import org.etsi.tfs.policy.monitoring.model.KpiValue; @Singleton public class PolicyRuleConditionFieldsGetter { diff --git a/src/policy/src/main/java/eu/teraflow/policy/PolicyRuleConditionValidator.java b/src/policy/src/main/java/org/etsi/tfs/policy/PolicyRuleConditionValidator.java similarity index 93% rename from src/policy/src/main/java/eu/teraflow/policy/PolicyRuleConditionValidator.java rename to src/policy/src/main/java/org/etsi/tfs/policy/PolicyRuleConditionValidator.java index a1556ffbd715e0065681dcfa6001dd041ff89ef0..3e40cdb6cf2bfad989c1f0a36db41f09d7aef32b 100644 --- a/src/policy/src/main/java/eu/teraflow/policy/PolicyRuleConditionValidator.java +++ b/src/policy/src/main/java/org/etsi/tfs/policy/PolicyRuleConditionValidator.java @@ -14,19 +14,19 @@ * limitations under the License. */ -package eu.teraflow.policy; - -import eu.teraflow.policy.context.ContextService; -import eu.teraflow.policy.context.model.Device; -import eu.teraflow.policy.context.model.EndPointId; -import eu.teraflow.policy.context.model.Service; -import eu.teraflow.policy.context.model.ServiceId; -import eu.teraflow.policy.model.PolicyRuleService; +package org.etsi.tfs.policy; + import io.smallrye.mutiny.Uni; import java.util.ArrayList; import java.util.List; import javax.enterprise.context.ApplicationScoped; import javax.inject.Inject; +import org.etsi.tfs.policy.context.ContextService; +import org.etsi.tfs.policy.context.model.Device; +import org.etsi.tfs.policy.context.model.EndPointId; +import org.etsi.tfs.policy.context.model.Service; +import org.etsi.tfs.policy.context.model.ServiceId; +import org.etsi.tfs.policy.model.PolicyRuleService; import org.jboss.logging.Logger; @ApplicationScoped diff --git a/src/policy/src/main/java/eu/teraflow/policy/PolicyService.java b/src/policy/src/main/java/org/etsi/tfs/policy/PolicyService.java similarity index 85% rename from src/policy/src/main/java/eu/teraflow/policy/PolicyService.java rename to src/policy/src/main/java/org/etsi/tfs/policy/PolicyService.java index 556e350322de1df29c38cbc852106b4845e25095..c0521c1925fbd2ff5e5762b9802b3f7f43c33788 100644 --- a/src/policy/src/main/java/eu/teraflow/policy/PolicyService.java +++ b/src/policy/src/main/java/org/etsi/tfs/policy/PolicyService.java @@ -14,12 +14,12 @@ * limitations under the License. */ -package eu.teraflow.policy; +package org.etsi.tfs.policy; -import eu.teraflow.policy.model.PolicyRuleDevice; -import eu.teraflow.policy.model.PolicyRuleService; -import eu.teraflow.policy.model.PolicyRuleState; import io.smallrye.mutiny.Uni; +import org.etsi.tfs.policy.model.PolicyRuleDevice; +import org.etsi.tfs.policy.model.PolicyRuleService; +import org.etsi.tfs.policy.model.PolicyRuleState; public interface PolicyService { diff --git a/src/policy/src/main/java/eu/teraflow/policy/PolicyServiceImpl.java b/src/policy/src/main/java/org/etsi/tfs/policy/PolicyServiceImpl.java similarity index 85% rename from src/policy/src/main/java/eu/teraflow/policy/PolicyServiceImpl.java rename to src/policy/src/main/java/org/etsi/tfs/policy/PolicyServiceImpl.java index 8462e0b9d7ec875004cea0a1b2836dc92d3b6f15..b5f1d85eb4d55668e16c0bdf32212e6ef559b8c9 100644 --- a/src/policy/src/main/java/eu/teraflow/policy/PolicyServiceImpl.java +++ b/src/policy/src/main/java/org/etsi/tfs/policy/PolicyServiceImpl.java @@ -14,40 +14,12 @@ * limitations under the License. */ -package eu.teraflow.policy; - -import eu.teraflow.policy.context.ContextService; -import eu.teraflow.policy.context.model.ConfigActionEnum; -import eu.teraflow.policy.context.model.ConfigRule; -import eu.teraflow.policy.context.model.ConfigRuleCustom; -import eu.teraflow.policy.context.model.ConfigRuleTypeCustom; -import eu.teraflow.policy.context.model.Constraint; -import eu.teraflow.policy.context.model.ConstraintCustom; -import eu.teraflow.policy.context.model.ConstraintTypeCustom; -import eu.teraflow.policy.context.model.ServiceConfig; -import eu.teraflow.policy.device.DeviceService; -import eu.teraflow.policy.model.BooleanOperator; -import eu.teraflow.policy.model.PolicyRule; -import eu.teraflow.policy.model.PolicyRuleAction; -import eu.teraflow.policy.model.PolicyRuleActionConfig; -import eu.teraflow.policy.model.PolicyRuleActionEnum; -import eu.teraflow.policy.model.PolicyRuleBasic; -import eu.teraflow.policy.model.PolicyRuleCondition; -import eu.teraflow.policy.model.PolicyRuleDevice; -import eu.teraflow.policy.model.PolicyRuleService; -import eu.teraflow.policy.model.PolicyRuleState; -import eu.teraflow.policy.model.PolicyRuleStateEnum; -import eu.teraflow.policy.model.PolicyRuleTypeDevice; -import eu.teraflow.policy.model.PolicyRuleTypeService; -import eu.teraflow.policy.monitoring.MonitoringService; -import eu.teraflow.policy.monitoring.model.AlarmDescriptor; -import eu.teraflow.policy.monitoring.model.AlarmResponse; -import eu.teraflow.policy.monitoring.model.AlarmSubscription; -import eu.teraflow.policy.monitoring.model.KpiValueRange; -import eu.teraflow.policy.service.ServiceService; +package org.etsi.tfs.policy; + import io.smallrye.mutiny.Multi; import io.smallrye.mutiny.Uni; import io.smallrye.mutiny.groups.UniJoin; +import io.smallrye.mutiny.subscription.Cancellable; import java.time.Instant; import java.util.ArrayList; import java.util.Arrays; @@ -57,6 +29,35 @@ import java.util.Random; import java.util.concurrent.ConcurrentHashMap; import javax.enterprise.context.ApplicationScoped; import javax.inject.Inject; +import org.etsi.tfs.policy.context.ContextService; +import org.etsi.tfs.policy.context.model.ConfigActionEnum; +import org.etsi.tfs.policy.context.model.ConfigRule; +import org.etsi.tfs.policy.context.model.ConfigRuleCustom; +import org.etsi.tfs.policy.context.model.ConfigRuleTypeCustom; +import org.etsi.tfs.policy.context.model.Constraint; +import org.etsi.tfs.policy.context.model.ConstraintCustom; +import org.etsi.tfs.policy.context.model.ConstraintTypeCustom; +import org.etsi.tfs.policy.context.model.ServiceConfig; +import org.etsi.tfs.policy.device.DeviceService; +import org.etsi.tfs.policy.model.BooleanOperator; +import org.etsi.tfs.policy.model.PolicyRule; +import org.etsi.tfs.policy.model.PolicyRuleAction; +import org.etsi.tfs.policy.model.PolicyRuleActionConfig; +import org.etsi.tfs.policy.model.PolicyRuleActionEnum; +import org.etsi.tfs.policy.model.PolicyRuleBasic; +import org.etsi.tfs.policy.model.PolicyRuleCondition; +import org.etsi.tfs.policy.model.PolicyRuleDevice; +import org.etsi.tfs.policy.model.PolicyRuleService; +import org.etsi.tfs.policy.model.PolicyRuleState; +import org.etsi.tfs.policy.model.PolicyRuleStateEnum; +import org.etsi.tfs.policy.model.PolicyRuleTypeDevice; +import org.etsi.tfs.policy.model.PolicyRuleTypeService; +import org.etsi.tfs.policy.monitoring.MonitoringService; +import org.etsi.tfs.policy.monitoring.model.AlarmDescriptor; +import org.etsi.tfs.policy.monitoring.model.AlarmResponse; +import org.etsi.tfs.policy.monitoring.model.AlarmSubscription; +import org.etsi.tfs.policy.monitoring.model.KpiValueRange; +import org.etsi.tfs.policy.service.ServiceService; import org.jboss.logging.Logger; @ApplicationScoped @@ -118,6 +119,7 @@ public class PolicyServiceImpl implements PolicyService { new ConcurrentHashMap<>(); private ConcurrentHashMap alarmPolicyRuleDeviceMap = new ConcurrentHashMap<>(); + private ConcurrentHashMap subscriptionList = new ConcurrentHashMap<>(); @Inject public PolicyServiceImpl( @@ -196,48 +198,58 @@ public class PolicyServiceImpl implements PolicyService { "Invalid PolicyRuleConditions in PolicyRule with ID: %s", policyRuleBasic.getPolicyRuleId())); return policyRuleState; + } else { + contextService + .setPolicyRule(policyRule) + .subscribe() + .with( + policyId -> { + setPolicyRuleServiceToContext( + policyRuleService, VALIDATED_POLICYRULE_STATE); + noAlarms = 0; + + // Create an alarmIds list that contains the promised ids returned from + // setKpiAlarm + List> alarmIds = new ArrayList>(); + for (AlarmDescriptor alarmDescriptor : alarmDescriptorList) { + LOGGER.infof("alarmDescriptor:"); + LOGGER.infof(alarmDescriptor.toString()); + alarmIds.add(monitoringService.setKpiAlarm(alarmDescriptor)); + } + // Transform the alarmIds into promised alarms returned from the + // getAlarmResponseStream + List> alarmResponseStreamList = new ArrayList<>(); + for (Uni alarmId : alarmIds) { + alarmResponseStreamList.add( + alarmId + .onItem() + .transformToMulti( + id -> { + alarmPolicyRuleServiceMap.put(id, policyRuleService); + + // TODO: Create infinite subscription + var alarmSubscription = + new AlarmSubscription(id, 259200, 5000); + return monitoringService.getAlarmResponseStream( + alarmSubscription); + })); + } + + // Merge the promised alarms into one stream (Multi Object) + final var multi = + Multi.createBy().merging().streams(alarmResponseStreamList); + setPolicyRuleServiceToContext( + policyRuleService, PROVISIONED_POLICYRULE_STATE); + + subscriptionList.put(policyId, monitorAlarmResponseForService(multi)); + + // TODO: Resubscribe to the stream, if it has ended + + // TODO: Redesign evaluation of action + // evaluateAction(policyRule, alarmDescriptorList, multi); + }); + return VALIDATED_POLICYRULE_STATE; } - contextService.setPolicyRule(policyRule).subscribe().with(x -> {}); - setPolicyRuleServiceToContext(policyRuleService, VALIDATED_POLICYRULE_STATE); - noAlarms = 0; - - // Create an alarmIds list that contains the promised ids returned from setKpiAlarm - List> alarmIds = new ArrayList>(); - for (AlarmDescriptor alarmDescriptor : alarmDescriptorList) { - LOGGER.infof("alarmDescriptor:"); - LOGGER.infof(alarmDescriptor.toString()); - alarmIds.add(monitoringService.setKpiAlarm(alarmDescriptor)); - } - - // Transform the alarmIds into promised alarms returned from the - // getAlarmResponseStream - List> alarmResponseStreamList = new ArrayList<>(); - for (Uni alarmId : alarmIds) { - alarmResponseStreamList.add( - alarmId - .onItem() - .transformToMulti( - id -> { - alarmPolicyRuleServiceMap.put(id, policyRuleService); - - // TODO: Create infinite subscription - var alarmSubscription = new AlarmSubscription(id, 259200, 5000); - return monitoringService.getAlarmResponseStream(alarmSubscription); - })); - } - - // Merge the promised alarms into one stream (Multi Object) - final var multi = Multi.createBy().merging().streams(alarmResponseStreamList); - setPolicyRuleServiceToContext(policyRuleService, PROVISIONED_POLICYRULE_STATE); - - monitorAlarmResponseForService(multi); - - // TODO: Resubscribe to the stream, if it has ended - - // TODO: Redesign evaluation of action - // evaluateAction(policyRule, alarmDescriptorList, multi); - - return VALIDATED_POLICYRULE_STATE; }); } @@ -428,6 +440,7 @@ public class PolicyServiceImpl implements PolicyService { .transform( policyRule -> { var policyRuleBasic = policyRule.getPolicyRuleType().getPolicyRuleBasic(); + String policyId = policyRuleBasic.getPolicyRuleId(); policyRule .getPolicyRuleType() @@ -443,6 +456,9 @@ public class PolicyServiceImpl implements PolicyService { "DeletePolicy with id: " + VALID_MESSAGE, policyRuleBasic.getPolicyRuleId())); + contextService.removePolicyRule(policyId).subscribe().with(x -> {}); + subscriptionList.get(policyId).cancel(); + return policyRuleBasic.getPolicyRuleState(); }); } @@ -485,8 +501,8 @@ public class PolicyServiceImpl implements PolicyService { return alarmDescriptorList; } - private void monitorAlarmResponseForService(Multi multi) { - multi + private Cancellable monitorAlarmResponseForService(Multi multi) { + return multi .subscribe() .with( alarmResponse -> { @@ -725,7 +741,7 @@ public class PolicyServiceImpl implements PolicyService { // TODO: Temp fix for AlarmDescriptor object AlarmDescriptor alarmDescriptor = new AlarmDescriptor( - "alarmId-" + gen(), + "", "alarmDescription", "alarmName-" + gen(), policyRuleCondition.getKpiId(), @@ -770,12 +786,7 @@ public class PolicyServiceImpl implements PolicyService { final var kpiValueRange = convertPolicyRuleConditionToKpiValueRange(policyRuleCondition); return new AlarmDescriptor( - "alarmId-" + gen(), - "alarmDescription", - "alarmName-" + gen(), - kpiId, - kpiValueRange, - getTimeStamp()); + "", "alarmDescription", "alarmName-" + gen(), kpiId, kpiValueRange, getTimeStamp()); } private AlarmDescriptor createAlarmDescriptorWithRange( @@ -800,7 +811,7 @@ public class PolicyServiceImpl implements PolicyService { } return new AlarmDescriptor( - "alarmId-" + gen(), + "", "alarmDescription", "alarmName-" + gen(), kpiId, @@ -899,7 +910,7 @@ public class PolicyServiceImpl implements PolicyService { final var policyRuleTypeService = new PolicyRuleTypeService(policyRuleService); final var policyRule = new PolicyRule(policyRuleTypeService); - contextService.setPolicyRule(policyRule); + contextService.setPolicyRule(policyRule).subscribe().with(x -> {}); } private void setPolicyRuleDeviceToContext( @@ -912,6 +923,6 @@ public class PolicyServiceImpl implements PolicyService { final var policyRuleTypeService = new PolicyRuleTypeDevice(policyRuleDevice); final var policyRule = new PolicyRule(policyRuleTypeService); - contextService.setPolicyRule(policyRule); + contextService.setPolicyRule(policyRule).subscribe().with(x -> {}); } } diff --git a/src/policy/src/main/java/eu/teraflow/policy/Serializer.java b/src/policy/src/main/java/org/etsi/tfs/policy/Serializer.java similarity index 95% rename from src/policy/src/main/java/eu/teraflow/policy/Serializer.java rename to src/policy/src/main/java/org/etsi/tfs/policy/Serializer.java index 5a95f0e6edd200251a27b1e3571b719ebd102e1b..b7de8ff99fe820ad80a555c97a42accfe21b1d7b 100644 --- a/src/policy/src/main/java/eu/teraflow/policy/Serializer.java +++ b/src/policy/src/main/java/org/etsi/tfs/policy/Serializer.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package eu.teraflow.policy; +package org.etsi.tfs.policy; import acl.Acl; import context.ContextOuterClass; @@ -25,73 +25,6 @@ import context.ContextOuterClass.DeviceId; import context.ContextOuterClass.DeviceOperationalStatusEnum; import context.ContextOuterClass.Location.LocationCase; import context.ContextOuterClass.Uuid; -import eu.teraflow.policy.acl.AclAction; -import eu.teraflow.policy.acl.AclEntry; -import eu.teraflow.policy.acl.AclForwardActionEnum; -import eu.teraflow.policy.acl.AclLogActionEnum; -import eu.teraflow.policy.acl.AclMatch; -import eu.teraflow.policy.acl.AclRuleSet; -import eu.teraflow.policy.acl.AclRuleTypeEnum; -import eu.teraflow.policy.context.model.ConfigActionEnum; -import eu.teraflow.policy.context.model.ConfigRule; -import eu.teraflow.policy.context.model.ConfigRuleAcl; -import eu.teraflow.policy.context.model.ConfigRuleCustom; -import eu.teraflow.policy.context.model.ConfigRuleTypeAcl; -import eu.teraflow.policy.context.model.ConfigRuleTypeCustom; -import eu.teraflow.policy.context.model.Constraint; -import eu.teraflow.policy.context.model.ConstraintCustom; -import eu.teraflow.policy.context.model.ConstraintEndPointLocation; -import eu.teraflow.policy.context.model.ConstraintSchedule; -import eu.teraflow.policy.context.model.ConstraintSlaAvailability; -import eu.teraflow.policy.context.model.ConstraintSlaCapacity; -import eu.teraflow.policy.context.model.ConstraintSlaIsolationLevel; -import eu.teraflow.policy.context.model.ConstraintSlaLatency; -import eu.teraflow.policy.context.model.ConstraintTypeCustom; -import eu.teraflow.policy.context.model.ConstraintTypeEndPointLocation; -import eu.teraflow.policy.context.model.ConstraintTypeSchedule; -import eu.teraflow.policy.context.model.ConstraintTypeSlaAvailability; -import eu.teraflow.policy.context.model.ConstraintTypeSlaCapacity; -import eu.teraflow.policy.context.model.ConstraintTypeSlaIsolationLevel; -import eu.teraflow.policy.context.model.ConstraintTypeSlaLatency; -import eu.teraflow.policy.context.model.Device; -import eu.teraflow.policy.context.model.DeviceConfig; -import eu.teraflow.policy.context.model.DeviceDriverEnum; -import eu.teraflow.policy.context.model.DeviceOperationalStatus; -import eu.teraflow.policy.context.model.Empty; -import eu.teraflow.policy.context.model.EndPoint; -import eu.teraflow.policy.context.model.EndPointId; -import eu.teraflow.policy.context.model.Event; -import eu.teraflow.policy.context.model.EventTypeEnum; -import eu.teraflow.policy.context.model.GpsPosition; -import eu.teraflow.policy.context.model.IsolationLevelEnum; -import eu.teraflow.policy.context.model.Location; -import eu.teraflow.policy.context.model.LocationTypeGpsPosition; -import eu.teraflow.policy.context.model.LocationTypeRegion; -import eu.teraflow.policy.context.model.Service; -import eu.teraflow.policy.context.model.ServiceConfig; -import eu.teraflow.policy.context.model.ServiceId; -import eu.teraflow.policy.context.model.ServiceStatus; -import eu.teraflow.policy.context.model.ServiceStatusEnum; -import eu.teraflow.policy.context.model.ServiceTypeEnum; -import eu.teraflow.policy.context.model.SliceId; -import eu.teraflow.policy.context.model.TopologyId; -import eu.teraflow.policy.kpi_sample_types.model.KpiSampleType; -import eu.teraflow.policy.model.*; -import eu.teraflow.policy.monitoring.model.AlarmDescriptor; -import eu.teraflow.policy.monitoring.model.AlarmResponse; -import eu.teraflow.policy.monitoring.model.AlarmSubscription; -import eu.teraflow.policy.monitoring.model.BooleanKpiValue; -import eu.teraflow.policy.monitoring.model.FloatKpiValue; -import eu.teraflow.policy.monitoring.model.IntegerKpiValue; -import eu.teraflow.policy.monitoring.model.Kpi; -import eu.teraflow.policy.monitoring.model.KpiDescriptor; -import eu.teraflow.policy.monitoring.model.KpiValue; -import eu.teraflow.policy.monitoring.model.KpiValueRange; -import eu.teraflow.policy.monitoring.model.LongKpiValue; -import eu.teraflow.policy.monitoring.model.MonitorKpiRequest; -import eu.teraflow.policy.monitoring.model.StringKpiValue; -import eu.teraflow.policy.monitoring.model.SubsDescriptor; -import eu.teraflow.policy.monitoring.model.SubsResponse; import java.util.ArrayList; import java.util.List; import java.util.stream.Collectors; @@ -101,6 +34,73 @@ import monitoring.Monitoring; import monitoring.Monitoring.AlarmID; import monitoring.Monitoring.KpiId; import monitoring.Monitoring.SubscriptionID; +import org.etsi.tfs.policy.acl.AclAction; +import org.etsi.tfs.policy.acl.AclEntry; +import org.etsi.tfs.policy.acl.AclForwardActionEnum; +import org.etsi.tfs.policy.acl.AclLogActionEnum; +import org.etsi.tfs.policy.acl.AclMatch; +import org.etsi.tfs.policy.acl.AclRuleSet; +import org.etsi.tfs.policy.acl.AclRuleTypeEnum; +import org.etsi.tfs.policy.context.model.ConfigActionEnum; +import org.etsi.tfs.policy.context.model.ConfigRule; +import org.etsi.tfs.policy.context.model.ConfigRuleAcl; +import org.etsi.tfs.policy.context.model.ConfigRuleCustom; +import org.etsi.tfs.policy.context.model.ConfigRuleTypeAcl; +import org.etsi.tfs.policy.context.model.ConfigRuleTypeCustom; +import org.etsi.tfs.policy.context.model.Constraint; +import org.etsi.tfs.policy.context.model.ConstraintCustom; +import org.etsi.tfs.policy.context.model.ConstraintEndPointLocation; +import org.etsi.tfs.policy.context.model.ConstraintSchedule; +import org.etsi.tfs.policy.context.model.ConstraintSlaAvailability; +import org.etsi.tfs.policy.context.model.ConstraintSlaCapacity; +import org.etsi.tfs.policy.context.model.ConstraintSlaIsolationLevel; +import org.etsi.tfs.policy.context.model.ConstraintSlaLatency; +import org.etsi.tfs.policy.context.model.ConstraintTypeCustom; +import org.etsi.tfs.policy.context.model.ConstraintTypeEndPointLocation; +import org.etsi.tfs.policy.context.model.ConstraintTypeSchedule; +import org.etsi.tfs.policy.context.model.ConstraintTypeSlaAvailability; +import org.etsi.tfs.policy.context.model.ConstraintTypeSlaCapacity; +import org.etsi.tfs.policy.context.model.ConstraintTypeSlaIsolationLevel; +import org.etsi.tfs.policy.context.model.ConstraintTypeSlaLatency; +import org.etsi.tfs.policy.context.model.Device; +import org.etsi.tfs.policy.context.model.DeviceConfig; +import org.etsi.tfs.policy.context.model.DeviceDriverEnum; +import org.etsi.tfs.policy.context.model.DeviceOperationalStatus; +import org.etsi.tfs.policy.context.model.Empty; +import org.etsi.tfs.policy.context.model.EndPoint; +import org.etsi.tfs.policy.context.model.EndPointId; +import org.etsi.tfs.policy.context.model.Event; +import org.etsi.tfs.policy.context.model.EventTypeEnum; +import org.etsi.tfs.policy.context.model.GpsPosition; +import org.etsi.tfs.policy.context.model.IsolationLevelEnum; +import org.etsi.tfs.policy.context.model.Location; +import org.etsi.tfs.policy.context.model.LocationTypeGpsPosition; +import org.etsi.tfs.policy.context.model.LocationTypeRegion; +import org.etsi.tfs.policy.context.model.Service; +import org.etsi.tfs.policy.context.model.ServiceConfig; +import org.etsi.tfs.policy.context.model.ServiceId; +import org.etsi.tfs.policy.context.model.ServiceStatus; +import org.etsi.tfs.policy.context.model.ServiceStatusEnum; +import org.etsi.tfs.policy.context.model.ServiceTypeEnum; +import org.etsi.tfs.policy.context.model.SliceId; +import org.etsi.tfs.policy.context.model.TopologyId; +import org.etsi.tfs.policy.kpi_sample_types.model.KpiSampleType; +import org.etsi.tfs.policy.model.*; +import org.etsi.tfs.policy.monitoring.model.AlarmDescriptor; +import org.etsi.tfs.policy.monitoring.model.AlarmResponse; +import org.etsi.tfs.policy.monitoring.model.AlarmSubscription; +import org.etsi.tfs.policy.monitoring.model.BooleanKpiValue; +import org.etsi.tfs.policy.monitoring.model.FloatKpiValue; +import org.etsi.tfs.policy.monitoring.model.IntegerKpiValue; +import org.etsi.tfs.policy.monitoring.model.Kpi; +import org.etsi.tfs.policy.monitoring.model.KpiDescriptor; +import org.etsi.tfs.policy.monitoring.model.KpiValue; +import org.etsi.tfs.policy.monitoring.model.KpiValueRange; +import org.etsi.tfs.policy.monitoring.model.LongKpiValue; +import org.etsi.tfs.policy.monitoring.model.MonitorKpiRequest; +import org.etsi.tfs.policy.monitoring.model.StringKpiValue; +import org.etsi.tfs.policy.monitoring.model.SubsDescriptor; +import org.etsi.tfs.policy.monitoring.model.SubsResponse; import policy.Policy; import policy.Policy.PolicyRuleId; import policy.PolicyAction; @@ -1295,6 +1295,10 @@ public class Serializer { return KpiSampleTypes.KpiSampleType.KPISAMPLETYPE_BYTES_TRANSMITTED; case BYTES_RECEIVED: return KpiSampleTypes.KpiSampleType.KPISAMPLETYPE_BYTES_RECEIVED; + case LINK_TOTAL_CAPACITY_GBPS: + return KpiSampleTypes.KpiSampleType.KPISAMPLETYPE_LINK_TOTAL_CAPACITY_GBPS; + case LINK_USED_CAPACITY_GBPS: + return KpiSampleTypes.KpiSampleType.KPISAMPLETYPE_LINK_USED_CAPACITY_GBPS; case UNKNOWN: return KpiSampleTypes.KpiSampleType.KPISAMPLETYPE_UNKNOWN; default: @@ -1312,6 +1316,10 @@ public class Serializer { return KpiSampleType.BYTES_TRANSMITTED; case KPISAMPLETYPE_BYTES_RECEIVED: return KpiSampleType.BYTES_RECEIVED; + case KPISAMPLETYPE_LINK_TOTAL_CAPACITY_GBPS: + return KpiSampleType.LINK_TOTAL_CAPACITY_GBPS; + case KPISAMPLETYPE_LINK_USED_CAPACITY_GBPS: + return KpiSampleType.LINK_USED_CAPACITY_GBPS; case KPISAMPLETYPE_UNKNOWN: default: return KpiSampleType.UNKNOWN; @@ -2270,8 +2278,8 @@ public class Serializer { return ContextOuterClass.DeviceDriverEnum.DEVICEDRIVER_P4; case IETF_NETWORK_TOPOLOGY: return ContextOuterClass.DeviceDriverEnum.DEVICEDRIVER_IETF_NETWORK_TOPOLOGY; - case ONF_TR_352: - return ContextOuterClass.DeviceDriverEnum.DEVICEDRIVER_ONF_TR_352; + case ONF_TR_532: + return ContextOuterClass.DeviceDriverEnum.DEVICEDRIVER_ONF_TR_532; case XR: return ContextOuterClass.DeviceDriverEnum.DEVICEDRIVER_XR; case IETF_L2VPN: @@ -2293,8 +2301,8 @@ public class Serializer { return DeviceDriverEnum.P4; case DEVICEDRIVER_IETF_NETWORK_TOPOLOGY: return DeviceDriverEnum.IETF_NETWORK_TOPOLOGY; - case DEVICEDRIVER_ONF_TR_352: - return DeviceDriverEnum.ONF_TR_352; + case DEVICEDRIVER_ONF_TR_532: + return DeviceDriverEnum.ONF_TR_532; case DEVICEDRIVER_XR: return DeviceDriverEnum.XR; case DEVICEDRIVER_IETF_L2VPN: diff --git a/src/policy/src/main/java/eu/teraflow/policy/SimpleLivenessCheck.java b/src/policy/src/main/java/org/etsi/tfs/policy/SimpleLivenessCheck.java similarity index 97% rename from src/policy/src/main/java/eu/teraflow/policy/SimpleLivenessCheck.java rename to src/policy/src/main/java/org/etsi/tfs/policy/SimpleLivenessCheck.java index ec0859cb73fca89ec8c0b0d2651f5752baa8c590..b03d92076d04cf4d0c4a8985a4439b78fbf51cc4 100644 --- a/src/policy/src/main/java/eu/teraflow/policy/SimpleLivenessCheck.java +++ b/src/policy/src/main/java/org/etsi/tfs/policy/SimpleLivenessCheck.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package eu.teraflow.policy; +package org.etsi.tfs.policy; import javax.enterprise.context.ApplicationScoped; import org.eclipse.microprofile.health.HealthCheck; diff --git a/src/policy/src/main/java/eu/teraflow/policy/SimpleReadinessCheck.java b/src/policy/src/main/java/org/etsi/tfs/policy/SimpleReadinessCheck.java similarity index 97% rename from src/policy/src/main/java/eu/teraflow/policy/SimpleReadinessCheck.java rename to src/policy/src/main/java/org/etsi/tfs/policy/SimpleReadinessCheck.java index 7bbfd38c3f8abff20daaf5633de79237db54b9c6..93728b48c8e66fdd93659f11be3d79f96572cd40 100644 --- a/src/policy/src/main/java/eu/teraflow/policy/SimpleReadinessCheck.java +++ b/src/policy/src/main/java/org/etsi/tfs/policy/SimpleReadinessCheck.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package eu.teraflow.policy; +package org.etsi.tfs.policy; import javax.enterprise.context.ApplicationScoped; import org.eclipse.microprofile.health.HealthCheck; diff --git a/src/automation/src/main/java/eu/teraflow/automation/acl/AclAction.java b/src/policy/src/main/java/org/etsi/tfs/policy/acl/AclAction.java similarity index 97% rename from src/automation/src/main/java/eu/teraflow/automation/acl/AclAction.java rename to src/policy/src/main/java/org/etsi/tfs/policy/acl/AclAction.java index 29109f15bbb288697b837f69d85cf5d365c83319..e2328b184f8a50e2bb9c992962f1029e940e53e0 100644 --- a/src/automation/src/main/java/eu/teraflow/automation/acl/AclAction.java +++ b/src/policy/src/main/java/org/etsi/tfs/policy/acl/AclAction.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package eu.teraflow.automation.acl; +package org.etsi.tfs.policy.acl; public class AclAction { diff --git a/src/automation/src/main/java/eu/teraflow/automation/acl/AclEntry.java b/src/policy/src/main/java/org/etsi/tfs/policy/acl/AclEntry.java similarity index 97% rename from src/automation/src/main/java/eu/teraflow/automation/acl/AclEntry.java rename to src/policy/src/main/java/org/etsi/tfs/policy/acl/AclEntry.java index 6cecdd553d811587e9126bf323ce8019b57fc071..69d44e858c4541edd4f81976b6a1c78810c12c51 100644 --- a/src/automation/src/main/java/eu/teraflow/automation/acl/AclEntry.java +++ b/src/policy/src/main/java/org/etsi/tfs/policy/acl/AclEntry.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package eu.teraflow.automation.acl; +package org.etsi.tfs.policy.acl; public class AclEntry { diff --git a/src/automation/src/main/java/eu/teraflow/automation/acl/AclForwardActionEnum.java b/src/policy/src/main/java/org/etsi/tfs/policy/acl/AclForwardActionEnum.java similarity index 95% rename from src/automation/src/main/java/eu/teraflow/automation/acl/AclForwardActionEnum.java rename to src/policy/src/main/java/org/etsi/tfs/policy/acl/AclForwardActionEnum.java index e136a52fe259d67df2a5f9ee2c70a4e15f9d6034..667982d7ba49859292204b18899e9af5046a10bf 100644 --- a/src/automation/src/main/java/eu/teraflow/automation/acl/AclForwardActionEnum.java +++ b/src/policy/src/main/java/org/etsi/tfs/policy/acl/AclForwardActionEnum.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package eu.teraflow.automation.acl; +package org.etsi.tfs.policy.acl; public enum AclForwardActionEnum { UNDEFINED, diff --git a/src/automation/src/main/java/eu/teraflow/automation/acl/AclLogActionEnum.java b/src/policy/src/main/java/org/etsi/tfs/policy/acl/AclLogActionEnum.java similarity index 95% rename from src/automation/src/main/java/eu/teraflow/automation/acl/AclLogActionEnum.java rename to src/policy/src/main/java/org/etsi/tfs/policy/acl/AclLogActionEnum.java index 1baf1c4a94a8fd806f5b05548fa0cd9fe4eaf3c5..cd10e94216a7a44880efd76e24e135f32156487e 100644 --- a/src/automation/src/main/java/eu/teraflow/automation/acl/AclLogActionEnum.java +++ b/src/policy/src/main/java/org/etsi/tfs/policy/acl/AclLogActionEnum.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package eu.teraflow.automation.acl; +package org.etsi.tfs.policy.acl; public enum AclLogActionEnum { UNDEFINED, diff --git a/src/automation/src/main/java/eu/teraflow/automation/acl/AclMatch.java b/src/policy/src/main/java/org/etsi/tfs/policy/acl/AclMatch.java similarity index 98% rename from src/automation/src/main/java/eu/teraflow/automation/acl/AclMatch.java rename to src/policy/src/main/java/org/etsi/tfs/policy/acl/AclMatch.java index fa9eecf9f46493587c7b5573cbaca71f2865da09..e9464fce7522be4f913db6cc66e8c815b4c6ae7a 100644 --- a/src/automation/src/main/java/eu/teraflow/automation/acl/AclMatch.java +++ b/src/policy/src/main/java/org/etsi/tfs/policy/acl/AclMatch.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package eu.teraflow.automation.acl; +package org.etsi.tfs.policy.acl; public class AclMatch { diff --git a/src/automation/src/main/java/eu/teraflow/automation/acl/AclRuleSet.java b/src/policy/src/main/java/org/etsi/tfs/policy/acl/AclRuleSet.java similarity index 96% rename from src/automation/src/main/java/eu/teraflow/automation/acl/AclRuleSet.java rename to src/policy/src/main/java/org/etsi/tfs/policy/acl/AclRuleSet.java index 9cf3a08f0d2fac9eb3033accbaa31ad14dc93598..aa645725cef23502461e2b8a85afde4fb6d839b5 100644 --- a/src/automation/src/main/java/eu/teraflow/automation/acl/AclRuleSet.java +++ b/src/policy/src/main/java/org/etsi/tfs/policy/acl/AclRuleSet.java @@ -14,10 +14,10 @@ * limitations under the License. */ -package eu.teraflow.automation.acl; +package org.etsi.tfs.policy.acl; -import eu.teraflow.automation.common.Util; import java.util.List; +import org.etsi.tfs.policy.common.Util; public class AclRuleSet { diff --git a/src/automation/src/main/java/eu/teraflow/automation/acl/AclRuleTypeEnum.java b/src/policy/src/main/java/org/etsi/tfs/policy/acl/AclRuleTypeEnum.java similarity index 95% rename from src/automation/src/main/java/eu/teraflow/automation/acl/AclRuleTypeEnum.java rename to src/policy/src/main/java/org/etsi/tfs/policy/acl/AclRuleTypeEnum.java index f573721470e00dcba844961d65e4c79f83be4ffc..a0dba786e78cd55f207624b37a1fdd8e21640bc7 100644 --- a/src/automation/src/main/java/eu/teraflow/automation/acl/AclRuleTypeEnum.java +++ b/src/policy/src/main/java/org/etsi/tfs/policy/acl/AclRuleTypeEnum.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package eu.teraflow.automation.acl; +package org.etsi.tfs.policy.acl; public enum AclRuleTypeEnum { UNDEFINED, diff --git a/src/policy/src/main/java/eu/teraflow/policy/common/Util.java b/src/policy/src/main/java/org/etsi/tfs/policy/common/Util.java similarity index 96% rename from src/policy/src/main/java/eu/teraflow/policy/common/Util.java rename to src/policy/src/main/java/org/etsi/tfs/policy/common/Util.java index 889f44feef9df2eb66c5f3dfccb4198837fb037f..f15f7dddc51be915b24bbc9ed3e9b7d20a1e67bb 100644 --- a/src/policy/src/main/java/eu/teraflow/policy/common/Util.java +++ b/src/policy/src/main/java/org/etsi/tfs/policy/common/Util.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package eu.teraflow.policy.common; +package org.etsi.tfs.policy.common; import java.util.List; import java.util.stream.Collectors; diff --git a/src/policy/src/main/java/eu/teraflow/policy/context/ContextGateway.java b/src/policy/src/main/java/org/etsi/tfs/policy/context/ContextGateway.java similarity index 79% rename from src/policy/src/main/java/eu/teraflow/policy/context/ContextGateway.java rename to src/policy/src/main/java/org/etsi/tfs/policy/context/ContextGateway.java index de2d327721636bbfdbbdd46ac3a6a5853bf44025..42c82baa40a5b700a0f25852718ea05ae273f40b 100644 --- a/src/policy/src/main/java/eu/teraflow/policy/context/ContextGateway.java +++ b/src/policy/src/main/java/org/etsi/tfs/policy/context/ContextGateway.java @@ -14,14 +14,14 @@ * limitations under the License. */ -package eu.teraflow.policy.context; +package org.etsi.tfs.policy.context; -import eu.teraflow.policy.context.model.Device; -import eu.teraflow.policy.context.model.Empty; -import eu.teraflow.policy.context.model.Service; -import eu.teraflow.policy.context.model.ServiceId; -import eu.teraflow.policy.model.PolicyRule; import io.smallrye.mutiny.Uni; +import org.etsi.tfs.policy.context.model.Device; +import org.etsi.tfs.policy.context.model.Empty; +import org.etsi.tfs.policy.context.model.Service; +import org.etsi.tfs.policy.context.model.ServiceId; +import org.etsi.tfs.policy.model.PolicyRule; public interface ContextGateway { diff --git a/src/policy/src/main/java/eu/teraflow/policy/context/ContextGatewayImpl.java b/src/policy/src/main/java/org/etsi/tfs/policy/context/ContextGatewayImpl.java similarity index 91% rename from src/policy/src/main/java/eu/teraflow/policy/context/ContextGatewayImpl.java rename to src/policy/src/main/java/org/etsi/tfs/policy/context/ContextGatewayImpl.java index 3b4754c8a61d2a8809af7ec0b60c5e55557cf05b..7a5c6345563ec58862ce86a1233151706db6d16e 100644 --- a/src/policy/src/main/java/eu/teraflow/policy/context/ContextGatewayImpl.java +++ b/src/policy/src/main/java/org/etsi/tfs/policy/context/ContextGatewayImpl.java @@ -14,20 +14,20 @@ * limitations under the License. */ -package eu.teraflow.policy.context; +package org.etsi.tfs.policy.context; import context.MutinyContextServiceGrpc.MutinyContextServiceStub; import context_policy.MutinyContextPolicyServiceGrpc.MutinyContextPolicyServiceStub; -import eu.teraflow.policy.Serializer; -import eu.teraflow.policy.context.model.Device; -import eu.teraflow.policy.context.model.Empty; -import eu.teraflow.policy.context.model.Service; -import eu.teraflow.policy.context.model.ServiceId; -import eu.teraflow.policy.model.PolicyRule; import io.quarkus.grpc.GrpcClient; import io.smallrye.mutiny.Uni; import javax.enterprise.context.ApplicationScoped; import javax.inject.Inject; +import org.etsi.tfs.policy.Serializer; +import org.etsi.tfs.policy.context.model.Device; +import org.etsi.tfs.policy.context.model.Empty; +import org.etsi.tfs.policy.context.model.Service; +import org.etsi.tfs.policy.context.model.ServiceId; +import org.etsi.tfs.policy.model.PolicyRule; @ApplicationScoped public class ContextGatewayImpl implements ContextGateway { diff --git a/src/policy/src/main/java/eu/teraflow/policy/context/ContextService.java b/src/policy/src/main/java/org/etsi/tfs/policy/context/ContextService.java similarity index 78% rename from src/policy/src/main/java/eu/teraflow/policy/context/ContextService.java rename to src/policy/src/main/java/org/etsi/tfs/policy/context/ContextService.java index 20574e8af2a91563032f82393e4bccd65af2670e..a8a81ed313d9106fea018d32c53445a8bd27ece5 100644 --- a/src/policy/src/main/java/eu/teraflow/policy/context/ContextService.java +++ b/src/policy/src/main/java/org/etsi/tfs/policy/context/ContextService.java @@ -14,14 +14,14 @@ * limitations under the License. */ -package eu.teraflow.policy.context; +package org.etsi.tfs.policy.context; -import eu.teraflow.policy.context.model.Device; -import eu.teraflow.policy.context.model.Empty; -import eu.teraflow.policy.context.model.Service; -import eu.teraflow.policy.context.model.ServiceId; -import eu.teraflow.policy.model.PolicyRule; import io.smallrye.mutiny.Uni; +import org.etsi.tfs.policy.context.model.Device; +import org.etsi.tfs.policy.context.model.Empty; +import org.etsi.tfs.policy.context.model.Service; +import org.etsi.tfs.policy.context.model.ServiceId; +import org.etsi.tfs.policy.model.PolicyRule; public interface ContextService { diff --git a/src/policy/src/main/java/eu/teraflow/policy/context/ContextServiceImpl.java b/src/policy/src/main/java/org/etsi/tfs/policy/context/ContextServiceImpl.java similarity index 86% rename from src/policy/src/main/java/eu/teraflow/policy/context/ContextServiceImpl.java rename to src/policy/src/main/java/org/etsi/tfs/policy/context/ContextServiceImpl.java index 7e52ade3c6d3abb772414d715b1768d121f6c2e7..662ded654f36acbd6bf70fdc4a29f335fa246bf9 100644 --- a/src/policy/src/main/java/eu/teraflow/policy/context/ContextServiceImpl.java +++ b/src/policy/src/main/java/org/etsi/tfs/policy/context/ContextServiceImpl.java @@ -14,16 +14,16 @@ * limitations under the License. */ -package eu.teraflow.policy.context; +package org.etsi.tfs.policy.context; -import eu.teraflow.policy.context.model.Device; -import eu.teraflow.policy.context.model.Empty; -import eu.teraflow.policy.context.model.Service; -import eu.teraflow.policy.context.model.ServiceId; -import eu.teraflow.policy.model.PolicyRule; import io.smallrye.mutiny.Uni; import javax.enterprise.context.ApplicationScoped; import javax.inject.Inject; +import org.etsi.tfs.policy.context.model.Device; +import org.etsi.tfs.policy.context.model.Empty; +import org.etsi.tfs.policy.context.model.Service; +import org.etsi.tfs.policy.context.model.ServiceId; +import org.etsi.tfs.policy.model.PolicyRule; @ApplicationScoped public class ContextServiceImpl implements ContextService { diff --git a/src/automation/src/main/java/eu/teraflow/automation/context/model/ConfigActionEnum.java b/src/policy/src/main/java/org/etsi/tfs/policy/context/model/ConfigActionEnum.java similarity index 93% rename from src/automation/src/main/java/eu/teraflow/automation/context/model/ConfigActionEnum.java rename to src/policy/src/main/java/org/etsi/tfs/policy/context/model/ConfigActionEnum.java index 7ec48e8896374e3d8daa918da9b4646adb6f3e41..d726ccfad134aaaf52b333261cce687942700080 100644 --- a/src/automation/src/main/java/eu/teraflow/automation/context/model/ConfigActionEnum.java +++ b/src/policy/src/main/java/org/etsi/tfs/policy/context/model/ConfigActionEnum.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package eu.teraflow.automation.context.model; +package org.etsi.tfs.policy.context.model; public enum ConfigActionEnum { UNDEFINED, diff --git a/src/policy/src/main/java/eu/teraflow/policy/context/model/ConfigRule.java b/src/policy/src/main/java/org/etsi/tfs/policy/context/model/ConfigRule.java similarity index 96% rename from src/policy/src/main/java/eu/teraflow/policy/context/model/ConfigRule.java rename to src/policy/src/main/java/org/etsi/tfs/policy/context/model/ConfigRule.java index 60ffba56282f1d77ef376696721c5c07b51e72f5..72069456d999478fdfe94d19fc0652c4c6a046a0 100644 --- a/src/policy/src/main/java/eu/teraflow/policy/context/model/ConfigRule.java +++ b/src/policy/src/main/java/org/etsi/tfs/policy/context/model/ConfigRule.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package eu.teraflow.policy.context.model; +package org.etsi.tfs.policy.context.model; public class ConfigRule { diff --git a/src/automation/src/main/java/eu/teraflow/automation/context/model/ConfigRuleAcl.java b/src/policy/src/main/java/org/etsi/tfs/policy/context/model/ConfigRuleAcl.java similarity index 92% rename from src/automation/src/main/java/eu/teraflow/automation/context/model/ConfigRuleAcl.java rename to src/policy/src/main/java/org/etsi/tfs/policy/context/model/ConfigRuleAcl.java index 774427abdb230bd3c6a99250a99d986a21ce3cc3..0412783640883d2fa59be6fb75cd16529ad67d80 100644 --- a/src/automation/src/main/java/eu/teraflow/automation/context/model/ConfigRuleAcl.java +++ b/src/policy/src/main/java/org/etsi/tfs/policy/context/model/ConfigRuleAcl.java @@ -14,9 +14,9 @@ * limitations under the License. */ -package eu.teraflow.automation.context.model; +package org.etsi.tfs.policy.context.model; -import eu.teraflow.automation.acl.AclRuleSet; +import org.etsi.tfs.policy.acl.AclRuleSet; public class ConfigRuleAcl { diff --git a/src/policy/src/main/java/eu/teraflow/policy/context/model/ConfigRuleCustom.java b/src/policy/src/main/java/org/etsi/tfs/policy/context/model/ConfigRuleCustom.java similarity index 96% rename from src/policy/src/main/java/eu/teraflow/policy/context/model/ConfigRuleCustom.java rename to src/policy/src/main/java/org/etsi/tfs/policy/context/model/ConfigRuleCustom.java index c8e64f192011e0e3343197f06f02a68a7b24db5a..de726e9a212586e2308dabf3a4591820f44fb580 100644 --- a/src/policy/src/main/java/eu/teraflow/policy/context/model/ConfigRuleCustom.java +++ b/src/policy/src/main/java/org/etsi/tfs/policy/context/model/ConfigRuleCustom.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package eu.teraflow.policy.context.model; +package org.etsi.tfs.policy.context.model; public class ConfigRuleCustom { diff --git a/src/automation/src/main/java/eu/teraflow/automation/context/model/ConfigRuleType.java b/src/policy/src/main/java/org/etsi/tfs/policy/context/model/ConfigRuleType.java similarity index 93% rename from src/automation/src/main/java/eu/teraflow/automation/context/model/ConfigRuleType.java rename to src/policy/src/main/java/org/etsi/tfs/policy/context/model/ConfigRuleType.java index 2554709251e70ba18ae4362e7aa44933510e587f..4106c8e16b0e40c0cd8c73f4663fc4b3c77a95de 100644 --- a/src/automation/src/main/java/eu/teraflow/automation/context/model/ConfigRuleType.java +++ b/src/policy/src/main/java/org/etsi/tfs/policy/context/model/ConfigRuleType.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package eu.teraflow.automation.context.model; +package org.etsi.tfs.policy.context.model; public interface ConfigRuleType { diff --git a/src/policy/src/main/java/eu/teraflow/policy/context/model/ConfigRuleTypeAcl.java b/src/policy/src/main/java/org/etsi/tfs/policy/context/model/ConfigRuleTypeAcl.java similarity index 96% rename from src/policy/src/main/java/eu/teraflow/policy/context/model/ConfigRuleTypeAcl.java rename to src/policy/src/main/java/org/etsi/tfs/policy/context/model/ConfigRuleTypeAcl.java index 35c63468d97847686115af53e92595115bf2fdb7..3f2ec9cfb77af6149379dc7b5ab1ab169b73b729 100644 --- a/src/policy/src/main/java/eu/teraflow/policy/context/model/ConfigRuleTypeAcl.java +++ b/src/policy/src/main/java/org/etsi/tfs/policy/context/model/ConfigRuleTypeAcl.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package eu.teraflow.policy.context.model; +package org.etsi.tfs.policy.context.model; public class ConfigRuleTypeAcl implements ConfigRuleType { diff --git a/src/policy/src/main/java/eu/teraflow/policy/context/model/ConfigRuleTypeCustom.java b/src/policy/src/main/java/org/etsi/tfs/policy/context/model/ConfigRuleTypeCustom.java similarity index 96% rename from src/policy/src/main/java/eu/teraflow/policy/context/model/ConfigRuleTypeCustom.java rename to src/policy/src/main/java/org/etsi/tfs/policy/context/model/ConfigRuleTypeCustom.java index 5d6ac12468cf286a9060fd22b8e0126f66ff2b51..021562e70d0b689232f00292110259629106168f 100644 --- a/src/policy/src/main/java/eu/teraflow/policy/context/model/ConfigRuleTypeCustom.java +++ b/src/policy/src/main/java/org/etsi/tfs/policy/context/model/ConfigRuleTypeCustom.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package eu.teraflow.policy.context.model; +package org.etsi.tfs.policy.context.model; public class ConfigRuleTypeCustom implements ConfigRuleType { diff --git a/src/policy/src/main/java/eu/teraflow/policy/context/model/Constraint.java b/src/policy/src/main/java/org/etsi/tfs/policy/context/model/Constraint.java similarity index 96% rename from src/policy/src/main/java/eu/teraflow/policy/context/model/Constraint.java rename to src/policy/src/main/java/org/etsi/tfs/policy/context/model/Constraint.java index 7403a94f40d143f79d52907d31a5373d877540cd..359c8f4717d994aa8f21cb4f8414a134bfd8e926 100644 --- a/src/policy/src/main/java/eu/teraflow/policy/context/model/Constraint.java +++ b/src/policy/src/main/java/org/etsi/tfs/policy/context/model/Constraint.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package eu.teraflow.policy.context.model; +package org.etsi.tfs.policy.context.model; public class Constraint { diff --git a/src/policy/src/main/java/eu/teraflow/policy/context/model/ConstraintCustom.java b/src/policy/src/main/java/org/etsi/tfs/policy/context/model/ConstraintCustom.java similarity index 96% rename from src/policy/src/main/java/eu/teraflow/policy/context/model/ConstraintCustom.java rename to src/policy/src/main/java/org/etsi/tfs/policy/context/model/ConstraintCustom.java index d5b196d3d60452214fcd672573d3e684eaa63646..43c907ddfab5e5b45c5a59a08d7e8b447a1d941e 100644 --- a/src/policy/src/main/java/eu/teraflow/policy/context/model/ConstraintCustom.java +++ b/src/policy/src/main/java/org/etsi/tfs/policy/context/model/ConstraintCustom.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package eu.teraflow.policy.context.model; +package org.etsi.tfs.policy.context.model; public class ConstraintCustom { diff --git a/src/policy/src/main/java/eu/teraflow/policy/context/model/ConstraintEndPointLocation.java b/src/policy/src/main/java/org/etsi/tfs/policy/context/model/ConstraintEndPointLocation.java similarity index 96% rename from src/policy/src/main/java/eu/teraflow/policy/context/model/ConstraintEndPointLocation.java rename to src/policy/src/main/java/org/etsi/tfs/policy/context/model/ConstraintEndPointLocation.java index 0852f2fe2a7b819d2a527554075f1d0e271bf544..79bbad2e0626aa8251dd0d062e532b6d27a90838 100644 --- a/src/policy/src/main/java/eu/teraflow/policy/context/model/ConstraintEndPointLocation.java +++ b/src/policy/src/main/java/org/etsi/tfs/policy/context/model/ConstraintEndPointLocation.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package eu.teraflow.policy.context.model; +package org.etsi.tfs.policy.context.model; public class ConstraintEndPointLocation { diff --git a/src/policy/src/main/java/eu/teraflow/policy/context/model/ConstraintSchedule.java b/src/policy/src/main/java/org/etsi/tfs/policy/context/model/ConstraintSchedule.java similarity index 96% rename from src/policy/src/main/java/eu/teraflow/policy/context/model/ConstraintSchedule.java rename to src/policy/src/main/java/org/etsi/tfs/policy/context/model/ConstraintSchedule.java index a450d2244a9e9b30608813df23e6dff3ad7b7e84..be31d0c23c7afae52252e8591efd1125b9722c59 100644 --- a/src/policy/src/main/java/eu/teraflow/policy/context/model/ConstraintSchedule.java +++ b/src/policy/src/main/java/org/etsi/tfs/policy/context/model/ConstraintSchedule.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package eu.teraflow.policy.context.model; +package org.etsi.tfs.policy.context.model; public class ConstraintSchedule { diff --git a/src/policy/src/main/java/eu/teraflow/policy/context/model/ConstraintSlaAvailability.java b/src/policy/src/main/java/org/etsi/tfs/policy/context/model/ConstraintSlaAvailability.java similarity index 96% rename from src/policy/src/main/java/eu/teraflow/policy/context/model/ConstraintSlaAvailability.java rename to src/policy/src/main/java/org/etsi/tfs/policy/context/model/ConstraintSlaAvailability.java index 9daf6e31a7ab8e149d7609db1fd19af591108792..af694eafa5a44bc25d774635cba6332f24dd4ccd 100644 --- a/src/policy/src/main/java/eu/teraflow/policy/context/model/ConstraintSlaAvailability.java +++ b/src/policy/src/main/java/org/etsi/tfs/policy/context/model/ConstraintSlaAvailability.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package eu.teraflow.policy.context.model; +package org.etsi.tfs.policy.context.model; public class ConstraintSlaAvailability { diff --git a/src/policy/src/main/java/eu/teraflow/policy/context/model/ConstraintSlaCapacity.java b/src/policy/src/main/java/org/etsi/tfs/policy/context/model/ConstraintSlaCapacity.java similarity index 96% rename from src/policy/src/main/java/eu/teraflow/policy/context/model/ConstraintSlaCapacity.java rename to src/policy/src/main/java/org/etsi/tfs/policy/context/model/ConstraintSlaCapacity.java index db3bc1cdd8512bf1f4fb80dfc57bd3b2940fddde..50f7225a0d9106c7b1f3784c7ce80c30740fae70 100644 --- a/src/policy/src/main/java/eu/teraflow/policy/context/model/ConstraintSlaCapacity.java +++ b/src/policy/src/main/java/org/etsi/tfs/policy/context/model/ConstraintSlaCapacity.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package eu.teraflow.policy.context.model; +package org.etsi.tfs.policy.context.model; public class ConstraintSlaCapacity { diff --git a/src/policy/src/main/java/eu/teraflow/policy/context/model/ConstraintSlaIsolationLevel.java b/src/policy/src/main/java/org/etsi/tfs/policy/context/model/ConstraintSlaIsolationLevel.java similarity index 93% rename from src/policy/src/main/java/eu/teraflow/policy/context/model/ConstraintSlaIsolationLevel.java rename to src/policy/src/main/java/org/etsi/tfs/policy/context/model/ConstraintSlaIsolationLevel.java index 7d873694213544e938f7767781772959dfd4bc7f..da85e2db84a49117b9613c370159ef16b6772df8 100644 --- a/src/policy/src/main/java/eu/teraflow/policy/context/model/ConstraintSlaIsolationLevel.java +++ b/src/policy/src/main/java/org/etsi/tfs/policy/context/model/ConstraintSlaIsolationLevel.java @@ -14,10 +14,10 @@ * limitations under the License. */ -package eu.teraflow.policy.context.model; +package org.etsi.tfs.policy.context.model; -import eu.teraflow.policy.common.Util; import java.util.List; +import org.etsi.tfs.policy.common.Util; public class ConstraintSlaIsolationLevel { diff --git a/src/policy/src/main/java/eu/teraflow/policy/context/model/ConstraintSlaLatency.java b/src/policy/src/main/java/org/etsi/tfs/policy/context/model/ConstraintSlaLatency.java similarity index 96% rename from src/policy/src/main/java/eu/teraflow/policy/context/model/ConstraintSlaLatency.java rename to src/policy/src/main/java/org/etsi/tfs/policy/context/model/ConstraintSlaLatency.java index ef28227bd904576f6f2609691bf02fe31db7c9f7..b99ead6d00d02e7d316bb927d69187330e4b9ac0 100644 --- a/src/policy/src/main/java/eu/teraflow/policy/context/model/ConstraintSlaLatency.java +++ b/src/policy/src/main/java/org/etsi/tfs/policy/context/model/ConstraintSlaLatency.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package eu.teraflow.policy.context.model; +package org.etsi.tfs.policy.context.model; public class ConstraintSlaLatency { diff --git a/src/policy/src/main/java/eu/teraflow/policy/context/model/ConstraintType.java b/src/policy/src/main/java/org/etsi/tfs/policy/context/model/ConstraintType.java similarity index 94% rename from src/policy/src/main/java/eu/teraflow/policy/context/model/ConstraintType.java rename to src/policy/src/main/java/org/etsi/tfs/policy/context/model/ConstraintType.java index 0202399adad25ffe3609e47d7dd375e7524fc1f4..51845ed8d77aa18f3a3eb5c6991b806ecc49d2c0 100644 --- a/src/policy/src/main/java/eu/teraflow/policy/context/model/ConstraintType.java +++ b/src/policy/src/main/java/org/etsi/tfs/policy/context/model/ConstraintType.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package eu.teraflow.policy.context.model; +package org.etsi.tfs.policy.context.model; public interface ConstraintType { diff --git a/src/policy/src/main/java/eu/teraflow/policy/context/model/ConstraintTypeCustom.java b/src/policy/src/main/java/org/etsi/tfs/policy/context/model/ConstraintTypeCustom.java similarity index 96% rename from src/policy/src/main/java/eu/teraflow/policy/context/model/ConstraintTypeCustom.java rename to src/policy/src/main/java/org/etsi/tfs/policy/context/model/ConstraintTypeCustom.java index 447a3edd3493fa71e57874f1b911abfd3a7b0220..1e85f4675ede1df9205ffb3b0092b127e56b11d6 100644 --- a/src/policy/src/main/java/eu/teraflow/policy/context/model/ConstraintTypeCustom.java +++ b/src/policy/src/main/java/org/etsi/tfs/policy/context/model/ConstraintTypeCustom.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package eu.teraflow.policy.context.model; +package org.etsi.tfs.policy.context.model; public class ConstraintTypeCustom implements ConstraintType { diff --git a/src/policy/src/main/java/eu/teraflow/policy/context/model/ConstraintTypeEndPointLocation.java b/src/policy/src/main/java/org/etsi/tfs/policy/context/model/ConstraintTypeEndPointLocation.java similarity index 96% rename from src/policy/src/main/java/eu/teraflow/policy/context/model/ConstraintTypeEndPointLocation.java rename to src/policy/src/main/java/org/etsi/tfs/policy/context/model/ConstraintTypeEndPointLocation.java index b35832b7d2a6c4d2e6487c0b16192b9ad02b0124..76375f4affdcdeb85291e55004c1362db30a9a45 100644 --- a/src/policy/src/main/java/eu/teraflow/policy/context/model/ConstraintTypeEndPointLocation.java +++ b/src/policy/src/main/java/org/etsi/tfs/policy/context/model/ConstraintTypeEndPointLocation.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package eu.teraflow.policy.context.model; +package org.etsi.tfs.policy.context.model; public class ConstraintTypeEndPointLocation implements ConstraintType { private final ConstraintEndPointLocation constraintEndPointLocation; diff --git a/src/policy/src/main/java/eu/teraflow/policy/context/model/ConstraintTypeSchedule.java b/src/policy/src/main/java/org/etsi/tfs/policy/context/model/ConstraintTypeSchedule.java similarity index 96% rename from src/policy/src/main/java/eu/teraflow/policy/context/model/ConstraintTypeSchedule.java rename to src/policy/src/main/java/org/etsi/tfs/policy/context/model/ConstraintTypeSchedule.java index 3120d376cfdcd12c6885534219cfee55855275b6..9bd355590aa2d3a6e47a30c63930ffb1eebe6462 100644 --- a/src/policy/src/main/java/eu/teraflow/policy/context/model/ConstraintTypeSchedule.java +++ b/src/policy/src/main/java/org/etsi/tfs/policy/context/model/ConstraintTypeSchedule.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package eu.teraflow.policy.context.model; +package org.etsi.tfs.policy.context.model; public class ConstraintTypeSchedule implements ConstraintType { private final ConstraintSchedule constraintSchedule; diff --git a/src/policy/src/main/java/eu/teraflow/policy/context/model/ConstraintTypeSlaAvailability.java b/src/policy/src/main/java/org/etsi/tfs/policy/context/model/ConstraintTypeSlaAvailability.java similarity index 96% rename from src/policy/src/main/java/eu/teraflow/policy/context/model/ConstraintTypeSlaAvailability.java rename to src/policy/src/main/java/org/etsi/tfs/policy/context/model/ConstraintTypeSlaAvailability.java index 1486c83be2522bc35dee7f88f0bdeada71cc36ed..00be6537d5632cf00cc92eff03aedf1d9396a1bf 100644 --- a/src/policy/src/main/java/eu/teraflow/policy/context/model/ConstraintTypeSlaAvailability.java +++ b/src/policy/src/main/java/org/etsi/tfs/policy/context/model/ConstraintTypeSlaAvailability.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package eu.teraflow.policy.context.model; +package org.etsi.tfs.policy.context.model; public class ConstraintTypeSlaAvailability implements ConstraintType { diff --git a/src/policy/src/main/java/eu/teraflow/policy/context/model/ConstraintTypeSlaCapacity.java b/src/policy/src/main/java/org/etsi/tfs/policy/context/model/ConstraintTypeSlaCapacity.java similarity index 96% rename from src/policy/src/main/java/eu/teraflow/policy/context/model/ConstraintTypeSlaCapacity.java rename to src/policy/src/main/java/org/etsi/tfs/policy/context/model/ConstraintTypeSlaCapacity.java index dd3fd7037fffa171159f0323288717db917d7989..5965dafa8e414a66b86c3ae166136a3f3966a43a 100644 --- a/src/policy/src/main/java/eu/teraflow/policy/context/model/ConstraintTypeSlaCapacity.java +++ b/src/policy/src/main/java/org/etsi/tfs/policy/context/model/ConstraintTypeSlaCapacity.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package eu.teraflow.policy.context.model; +package org.etsi.tfs.policy.context.model; public class ConstraintTypeSlaCapacity implements ConstraintType { diff --git a/src/policy/src/main/java/eu/teraflow/policy/context/model/ConstraintTypeSlaIsolationLevel.java b/src/policy/src/main/java/org/etsi/tfs/policy/context/model/ConstraintTypeSlaIsolationLevel.java similarity index 96% rename from src/policy/src/main/java/eu/teraflow/policy/context/model/ConstraintTypeSlaIsolationLevel.java rename to src/policy/src/main/java/org/etsi/tfs/policy/context/model/ConstraintTypeSlaIsolationLevel.java index 7cf05a416cdf5fe5acdc38a52e64ce2d38f1b7d5..bac00a37c046641edf34e185ee4eee90f115aa73 100644 --- a/src/policy/src/main/java/eu/teraflow/policy/context/model/ConstraintTypeSlaIsolationLevel.java +++ b/src/policy/src/main/java/org/etsi/tfs/policy/context/model/ConstraintTypeSlaIsolationLevel.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package eu.teraflow.policy.context.model; +package org.etsi.tfs.policy.context.model; public class ConstraintTypeSlaIsolationLevel implements ConstraintType { diff --git a/src/policy/src/main/java/eu/teraflow/policy/context/model/ConstraintTypeSlaLatency.java b/src/policy/src/main/java/org/etsi/tfs/policy/context/model/ConstraintTypeSlaLatency.java similarity index 96% rename from src/policy/src/main/java/eu/teraflow/policy/context/model/ConstraintTypeSlaLatency.java rename to src/policy/src/main/java/org/etsi/tfs/policy/context/model/ConstraintTypeSlaLatency.java index 20a285902a3364f2a7819e3970b915914ce32f19..0e970167b8a14044f6e62cfba630e3cc8739cb56 100644 --- a/src/policy/src/main/java/eu/teraflow/policy/context/model/ConstraintTypeSlaLatency.java +++ b/src/policy/src/main/java/org/etsi/tfs/policy/context/model/ConstraintTypeSlaLatency.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package eu.teraflow.policy.context.model; +package org.etsi.tfs.policy.context.model; public class ConstraintTypeSlaLatency implements ConstraintType { diff --git a/src/policy/src/main/java/eu/teraflow/policy/context/model/Device.java b/src/policy/src/main/java/org/etsi/tfs/policy/context/model/Device.java similarity index 97% rename from src/policy/src/main/java/eu/teraflow/policy/context/model/Device.java rename to src/policy/src/main/java/org/etsi/tfs/policy/context/model/Device.java index 06c6d4c5c233af579a4aa5db832c2871b96bdd4e..3cff3decd5f8666da16b2801ee5985fdba71c9a6 100644 --- a/src/policy/src/main/java/eu/teraflow/policy/context/model/Device.java +++ b/src/policy/src/main/java/org/etsi/tfs/policy/context/model/Device.java @@ -14,10 +14,10 @@ * limitations under the License. */ -package eu.teraflow.policy.context.model; +package org.etsi.tfs.policy.context.model; -import eu.teraflow.policy.common.Util; import java.util.List; +import org.etsi.tfs.policy.common.Util; public class Device { diff --git a/src/policy/src/main/java/eu/teraflow/policy/context/model/DeviceConfig.java b/src/policy/src/main/java/org/etsi/tfs/policy/context/model/DeviceConfig.java similarity index 92% rename from src/policy/src/main/java/eu/teraflow/policy/context/model/DeviceConfig.java rename to src/policy/src/main/java/org/etsi/tfs/policy/context/model/DeviceConfig.java index 815589b5572cd87a8bba18f77c46bf56c6fb9838..a6645cd934753f7cecba43efe46efbbc8c31c4a0 100644 --- a/src/policy/src/main/java/eu/teraflow/policy/context/model/DeviceConfig.java +++ b/src/policy/src/main/java/org/etsi/tfs/policy/context/model/DeviceConfig.java @@ -14,10 +14,10 @@ * limitations under the License. */ -package eu.teraflow.policy.context.model; +package org.etsi.tfs.policy.context.model; -import eu.teraflow.policy.common.Util; import java.util.List; +import org.etsi.tfs.policy.common.Util; public class DeviceConfig { diff --git a/src/automation/src/main/java/eu/teraflow/automation/context/model/DeviceDriverEnum.java b/src/policy/src/main/java/org/etsi/tfs/policy/context/model/DeviceDriverEnum.java similarity index 92% rename from src/automation/src/main/java/eu/teraflow/automation/context/model/DeviceDriverEnum.java rename to src/policy/src/main/java/org/etsi/tfs/policy/context/model/DeviceDriverEnum.java index 3a26937e79d0df2cfead305a10ccadf3c54eae89..63e96a4c61769fbb6a009acf208ef7b4c81200ad 100644 --- a/src/automation/src/main/java/eu/teraflow/automation/context/model/DeviceDriverEnum.java +++ b/src/policy/src/main/java/org/etsi/tfs/policy/context/model/DeviceDriverEnum.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package eu.teraflow.automation.context.model; +package org.etsi.tfs.policy.context.model; public enum DeviceDriverEnum { UNDEFINED, @@ -22,7 +22,7 @@ public enum DeviceDriverEnum { TRANSPORT_API, P4, IETF_NETWORK_TOPOLOGY, - ONF_TR_352, + ONF_TR_532, XR, IETF_L2VPN } diff --git a/src/automation/src/main/java/eu/teraflow/automation/context/model/DeviceOperationalStatus.java b/src/policy/src/main/java/org/etsi/tfs/policy/context/model/DeviceOperationalStatus.java similarity index 93% rename from src/automation/src/main/java/eu/teraflow/automation/context/model/DeviceOperationalStatus.java rename to src/policy/src/main/java/org/etsi/tfs/policy/context/model/DeviceOperationalStatus.java index 0a5afaf2455acf28fa5591feb6c23d5f3d33692c..d5d96064606a0d6145a1fbc994977a51715e3f73 100644 --- a/src/automation/src/main/java/eu/teraflow/automation/context/model/DeviceOperationalStatus.java +++ b/src/policy/src/main/java/org/etsi/tfs/policy/context/model/DeviceOperationalStatus.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package eu.teraflow.automation.context.model; +package org.etsi.tfs.policy.context.model; public enum DeviceOperationalStatus { UNDEFINED, diff --git a/src/automation/src/main/java/eu/teraflow/automation/context/model/Empty.java b/src/policy/src/main/java/org/etsi/tfs/policy/context/model/Empty.java similarity index 94% rename from src/automation/src/main/java/eu/teraflow/automation/context/model/Empty.java rename to src/policy/src/main/java/org/etsi/tfs/policy/context/model/Empty.java index e503665e4146d5966b75979b9b0133b41d65e421..b334a0af63fb441f182426ccea716f3f856bfeb3 100644 --- a/src/automation/src/main/java/eu/teraflow/automation/context/model/Empty.java +++ b/src/policy/src/main/java/org/etsi/tfs/policy/context/model/Empty.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package eu.teraflow.automation.context.model; +package org.etsi.tfs.policy.context.model; public class Empty { diff --git a/src/automation/src/main/java/eu/teraflow/automation/context/model/EndPoint.java b/src/policy/src/main/java/org/etsi/tfs/policy/context/model/EndPoint.java similarity index 95% rename from src/automation/src/main/java/eu/teraflow/automation/context/model/EndPoint.java rename to src/policy/src/main/java/org/etsi/tfs/policy/context/model/EndPoint.java index c91f1d9c56967ea3a7b31e66193c0d0dbb9541d3..ad1e847f9d0bcf83f3d592dc8a056d1bb419e566 100644 --- a/src/automation/src/main/java/eu/teraflow/automation/context/model/EndPoint.java +++ b/src/policy/src/main/java/org/etsi/tfs/policy/context/model/EndPoint.java @@ -14,11 +14,11 @@ * limitations under the License. */ -package eu.teraflow.automation.context.model; +package org.etsi.tfs.policy.context.model; -import eu.teraflow.automation.common.Util; -import eu.teraflow.automation.kpi_sample_types.model.KpiSampleType; import java.util.List; +import org.etsi.tfs.policy.common.Util; +import org.etsi.tfs.policy.kpi_sample_types.model.KpiSampleType; public class EndPoint { private final EndPointId endPointId; diff --git a/src/automation/src/main/java/eu/teraflow/automation/context/model/EndPointId.java b/src/policy/src/main/java/org/etsi/tfs/policy/context/model/EndPointId.java similarity index 96% rename from src/automation/src/main/java/eu/teraflow/automation/context/model/EndPointId.java rename to src/policy/src/main/java/org/etsi/tfs/policy/context/model/EndPointId.java index 516c8289246565a86e2a59fe80dbe4b1505c5463..6e626014c4c44c5cb09e9e383d23a411b2260109 100644 --- a/src/automation/src/main/java/eu/teraflow/automation/context/model/EndPointId.java +++ b/src/policy/src/main/java/org/etsi/tfs/policy/context/model/EndPointId.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package eu.teraflow.automation.context.model; +package org.etsi.tfs.policy.context.model; public class EndPointId { diff --git a/src/policy/src/main/java/eu/teraflow/policy/context/model/Event.java b/src/policy/src/main/java/org/etsi/tfs/policy/context/model/Event.java similarity index 96% rename from src/policy/src/main/java/eu/teraflow/policy/context/model/Event.java rename to src/policy/src/main/java/org/etsi/tfs/policy/context/model/Event.java index 05ba6451399598f958c2a055a4c938c6592627d1..49fcf3822f6aae1004902fb6c1800ff2cc349895 100644 --- a/src/policy/src/main/java/eu/teraflow/policy/context/model/Event.java +++ b/src/policy/src/main/java/org/etsi/tfs/policy/context/model/Event.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package eu.teraflow.policy.context.model; +package org.etsi.tfs.policy.context.model; public class Event { diff --git a/src/automation/src/main/java/eu/teraflow/automation/context/model/EventTypeEnum.java b/src/policy/src/main/java/org/etsi/tfs/policy/context/model/EventTypeEnum.java similarity index 93% rename from src/automation/src/main/java/eu/teraflow/automation/context/model/EventTypeEnum.java rename to src/policy/src/main/java/org/etsi/tfs/policy/context/model/EventTypeEnum.java index c20f9dfd59de812096a1b85e7dc908e5059eb246..e2e331f669d79dec23515fe9c46670074e2aab8b 100644 --- a/src/automation/src/main/java/eu/teraflow/automation/context/model/EventTypeEnum.java +++ b/src/policy/src/main/java/org/etsi/tfs/policy/context/model/EventTypeEnum.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package eu.teraflow.automation.context.model; +package org.etsi.tfs.policy.context.model; public enum EventTypeEnum { UNDEFINED, diff --git a/src/automation/src/main/java/eu/teraflow/automation/context/model/GpsPosition.java b/src/policy/src/main/java/org/etsi/tfs/policy/context/model/GpsPosition.java similarity index 96% rename from src/automation/src/main/java/eu/teraflow/automation/context/model/GpsPosition.java rename to src/policy/src/main/java/org/etsi/tfs/policy/context/model/GpsPosition.java index 38a111f89fc79e0d11f15eedf2a8ca5a0ba35e89..ef214f754779cc2eca09a9d0829ed7f84770ca83 100644 --- a/src/automation/src/main/java/eu/teraflow/automation/context/model/GpsPosition.java +++ b/src/policy/src/main/java/org/etsi/tfs/policy/context/model/GpsPosition.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package eu.teraflow.automation.context.model; +package org.etsi.tfs.policy.context.model; public class GpsPosition { diff --git a/src/policy/src/main/java/eu/teraflow/policy/context/model/IsolationLevelEnum.java b/src/policy/src/main/java/org/etsi/tfs/policy/context/model/IsolationLevelEnum.java similarity index 95% rename from src/policy/src/main/java/eu/teraflow/policy/context/model/IsolationLevelEnum.java rename to src/policy/src/main/java/org/etsi/tfs/policy/context/model/IsolationLevelEnum.java index 4b6e129d1c1899da43d5cf48f0e43d87a56abb83..d5f5884d9975347ffca78d8f5a93008331309f49 100644 --- a/src/policy/src/main/java/eu/teraflow/policy/context/model/IsolationLevelEnum.java +++ b/src/policy/src/main/java/org/etsi/tfs/policy/context/model/IsolationLevelEnum.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package eu.teraflow.policy.context.model; +package org.etsi.tfs.policy.context.model; public enum IsolationLevelEnum { NO_ISOLATION, diff --git a/src/automation/src/main/java/eu/teraflow/automation/context/model/Location.java b/src/policy/src/main/java/org/etsi/tfs/policy/context/model/Location.java similarity index 95% rename from src/automation/src/main/java/eu/teraflow/automation/context/model/Location.java rename to src/policy/src/main/java/org/etsi/tfs/policy/context/model/Location.java index a16715e13cbb2b70f3c729b03ec164f9f52142ce..01cdb7ac6d776f6f91f006695608c9ac825959c0 100644 --- a/src/automation/src/main/java/eu/teraflow/automation/context/model/Location.java +++ b/src/policy/src/main/java/org/etsi/tfs/policy/context/model/Location.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package eu.teraflow.automation.context.model; +package org.etsi.tfs.policy.context.model; public class Location { diff --git a/src/automation/src/main/java/eu/teraflow/automation/context/model/LocationType.java b/src/policy/src/main/java/org/etsi/tfs/policy/context/model/LocationType.java similarity index 93% rename from src/automation/src/main/java/eu/teraflow/automation/context/model/LocationType.java rename to src/policy/src/main/java/org/etsi/tfs/policy/context/model/LocationType.java index a50594a511005c67ee206f84f9c840324cb2bac6..35c1c11104d93b79aca49ad42bca19cb4be3c304 100644 --- a/src/automation/src/main/java/eu/teraflow/automation/context/model/LocationType.java +++ b/src/policy/src/main/java/org/etsi/tfs/policy/context/model/LocationType.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package eu.teraflow.automation.context.model; +package org.etsi.tfs.policy.context.model; public interface LocationType { diff --git a/src/policy/src/main/java/eu/teraflow/policy/context/model/LocationTypeGpsPosition.java b/src/policy/src/main/java/org/etsi/tfs/policy/context/model/LocationTypeGpsPosition.java similarity index 96% rename from src/policy/src/main/java/eu/teraflow/policy/context/model/LocationTypeGpsPosition.java rename to src/policy/src/main/java/org/etsi/tfs/policy/context/model/LocationTypeGpsPosition.java index f010024133fb12644a79eb1534f26e54874bd63b..6995b85565ea68649819475bbee2ce140cef8847 100644 --- a/src/policy/src/main/java/eu/teraflow/policy/context/model/LocationTypeGpsPosition.java +++ b/src/policy/src/main/java/org/etsi/tfs/policy/context/model/LocationTypeGpsPosition.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package eu.teraflow.policy.context.model; +package org.etsi.tfs.policy.context.model; public class LocationTypeGpsPosition implements LocationType { private final GpsPosition gpsPosition; diff --git a/src/automation/src/main/java/eu/teraflow/automation/context/model/LocationTypeRegion.java b/src/policy/src/main/java/org/etsi/tfs/policy/context/model/LocationTypeRegion.java similarity index 95% rename from src/automation/src/main/java/eu/teraflow/automation/context/model/LocationTypeRegion.java rename to src/policy/src/main/java/org/etsi/tfs/policy/context/model/LocationTypeRegion.java index 28b448ca3e8682f39a140e7d347e6dbe20f7db35..cd1ec621d1511fff75e8c03866ac6ca480838d43 100644 --- a/src/automation/src/main/java/eu/teraflow/automation/context/model/LocationTypeRegion.java +++ b/src/policy/src/main/java/org/etsi/tfs/policy/context/model/LocationTypeRegion.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package eu.teraflow.automation.context.model; +package org.etsi.tfs.policy.context.model; public class LocationTypeRegion implements LocationType { private final String region; diff --git a/src/policy/src/main/java/eu/teraflow/policy/context/model/Service.java b/src/policy/src/main/java/org/etsi/tfs/policy/context/model/Service.java similarity index 97% rename from src/policy/src/main/java/eu/teraflow/policy/context/model/Service.java rename to src/policy/src/main/java/org/etsi/tfs/policy/context/model/Service.java index e3456b32607ed49d465b40db826124a15c6f7a84..5d8a3897e57dc0d95f46768d37fffe956e683479 100644 --- a/src/policy/src/main/java/eu/teraflow/policy/context/model/Service.java +++ b/src/policy/src/main/java/org/etsi/tfs/policy/context/model/Service.java @@ -14,10 +14,10 @@ * limitations under the License. */ -package eu.teraflow.policy.context.model; +package org.etsi.tfs.policy.context.model; -import eu.teraflow.policy.common.Util; import java.util.List; +import org.etsi.tfs.policy.common.Util; public class Service { diff --git a/src/policy/src/main/java/eu/teraflow/policy/context/model/ServiceConfig.java b/src/policy/src/main/java/org/etsi/tfs/policy/context/model/ServiceConfig.java similarity index 92% rename from src/policy/src/main/java/eu/teraflow/policy/context/model/ServiceConfig.java rename to src/policy/src/main/java/org/etsi/tfs/policy/context/model/ServiceConfig.java index a99c949d1fd63c8ad31f8d0b14fe6f460ad43a17..9fff5f0e23decfdcbe9222fdda894266e06687fe 100644 --- a/src/policy/src/main/java/eu/teraflow/policy/context/model/ServiceConfig.java +++ b/src/policy/src/main/java/org/etsi/tfs/policy/context/model/ServiceConfig.java @@ -14,10 +14,10 @@ * limitations under the License. */ -package eu.teraflow.policy.context.model; +package org.etsi.tfs.policy.context.model; -import eu.teraflow.policy.common.Util; import java.util.List; +import org.etsi.tfs.policy.common.Util; public class ServiceConfig { diff --git a/src/policy/src/main/java/eu/teraflow/policy/context/model/ServiceId.java b/src/policy/src/main/java/org/etsi/tfs/policy/context/model/ServiceId.java similarity index 96% rename from src/policy/src/main/java/eu/teraflow/policy/context/model/ServiceId.java rename to src/policy/src/main/java/org/etsi/tfs/policy/context/model/ServiceId.java index 81763a9dec19881982a7ef0b14d9a8226eee2233..324cb8f140836af2c716d205ce7abdd1359fc45e 100644 --- a/src/policy/src/main/java/eu/teraflow/policy/context/model/ServiceId.java +++ b/src/policy/src/main/java/org/etsi/tfs/policy/context/model/ServiceId.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package eu.teraflow.policy.context.model; +package org.etsi.tfs.policy.context.model; public class ServiceId { diff --git a/src/policy/src/main/java/eu/teraflow/policy/context/model/ServiceStatus.java b/src/policy/src/main/java/org/etsi/tfs/policy/context/model/ServiceStatus.java similarity index 96% rename from src/policy/src/main/java/eu/teraflow/policy/context/model/ServiceStatus.java rename to src/policy/src/main/java/org/etsi/tfs/policy/context/model/ServiceStatus.java index 5fd6dfa26e70bf5e4ee710052e6bbb15aeb2136f..81c12e790e13fe5e119097ed502658571149e192 100644 --- a/src/policy/src/main/java/eu/teraflow/policy/context/model/ServiceStatus.java +++ b/src/policy/src/main/java/org/etsi/tfs/policy/context/model/ServiceStatus.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package eu.teraflow.policy.context.model; +package org.etsi.tfs.policy.context.model; public class ServiceStatus { diff --git a/src/policy/src/main/java/eu/teraflow/policy/context/model/ServiceStatusEnum.java b/src/policy/src/main/java/org/etsi/tfs/policy/context/model/ServiceStatusEnum.java similarity index 94% rename from src/policy/src/main/java/eu/teraflow/policy/context/model/ServiceStatusEnum.java rename to src/policy/src/main/java/org/etsi/tfs/policy/context/model/ServiceStatusEnum.java index 353b78eba1ad261d6c65561d1fe3e4f64a914420..a9c4ea0546300ddabb3ee42d5dabdd1a4ae2602a 100644 --- a/src/policy/src/main/java/eu/teraflow/policy/context/model/ServiceStatusEnum.java +++ b/src/policy/src/main/java/org/etsi/tfs/policy/context/model/ServiceStatusEnum.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package eu.teraflow.policy.context.model; +package org.etsi.tfs.policy.context.model; public enum ServiceStatusEnum { UNDEFINED, diff --git a/src/policy/src/main/java/eu/teraflow/policy/context/model/ServiceTypeEnum.java b/src/policy/src/main/java/org/etsi/tfs/policy/context/model/ServiceTypeEnum.java similarity index 94% rename from src/policy/src/main/java/eu/teraflow/policy/context/model/ServiceTypeEnum.java rename to src/policy/src/main/java/org/etsi/tfs/policy/context/model/ServiceTypeEnum.java index 45215ca00fc9c5f6be076519dc0cfc41b167b0f4..84730d25a6f12eb7646d228c240b6060597cef29 100644 --- a/src/policy/src/main/java/eu/teraflow/policy/context/model/ServiceTypeEnum.java +++ b/src/policy/src/main/java/org/etsi/tfs/policy/context/model/ServiceTypeEnum.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package eu.teraflow.policy.context.model; +package org.etsi.tfs.policy.context.model; public enum ServiceTypeEnum { UNKNOWN, diff --git a/src/policy/src/main/java/eu/teraflow/policy/context/model/SliceId.java b/src/policy/src/main/java/org/etsi/tfs/policy/context/model/SliceId.java similarity index 96% rename from src/policy/src/main/java/eu/teraflow/policy/context/model/SliceId.java rename to src/policy/src/main/java/org/etsi/tfs/policy/context/model/SliceId.java index ee1dc7d2fddc8d523c5dcd41a060c5b13a304ab6..ddd453bc3aa7f608d371cd85b80ee707cb336739 100644 --- a/src/policy/src/main/java/eu/teraflow/policy/context/model/SliceId.java +++ b/src/policy/src/main/java/org/etsi/tfs/policy/context/model/SliceId.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package eu.teraflow.policy.context.model; +package org.etsi.tfs.policy.context.model; public class SliceId { private final String contextId; diff --git a/src/automation/src/main/java/eu/teraflow/automation/context/model/TopologyId.java b/src/policy/src/main/java/org/etsi/tfs/policy/context/model/TopologyId.java similarity index 96% rename from src/automation/src/main/java/eu/teraflow/automation/context/model/TopologyId.java rename to src/policy/src/main/java/org/etsi/tfs/policy/context/model/TopologyId.java index 07e8daed7fce328b5ea31ab2f9f3cb17abbd9525..172286d33a44249e8393cfd1d40f99767143ccbd 100644 --- a/src/automation/src/main/java/eu/teraflow/automation/context/model/TopologyId.java +++ b/src/policy/src/main/java/org/etsi/tfs/policy/context/model/TopologyId.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package eu.teraflow.automation.context.model; +package org.etsi.tfs.policy.context.model; public class TopologyId { diff --git a/src/automation/src/main/java/eu/teraflow/automation/device/DeviceGateway.java b/src/policy/src/main/java/org/etsi/tfs/policy/device/DeviceGateway.java similarity index 81% rename from src/automation/src/main/java/eu/teraflow/automation/device/DeviceGateway.java rename to src/policy/src/main/java/org/etsi/tfs/policy/device/DeviceGateway.java index c25c96c97ca5bb31b0125b9df3210a181a2ea0fb..35e51e8d7a859f881c26c1d98995823e2b3727ac 100644 --- a/src/automation/src/main/java/eu/teraflow/automation/device/DeviceGateway.java +++ b/src/policy/src/main/java/org/etsi/tfs/policy/device/DeviceGateway.java @@ -14,12 +14,12 @@ * limitations under the License. */ -package eu.teraflow.automation.device; +package org.etsi.tfs.policy.device; -import eu.teraflow.automation.context.model.Device; -import eu.teraflow.automation.context.model.DeviceConfig; -import eu.teraflow.automation.context.model.Empty; import io.smallrye.mutiny.Uni; +import org.etsi.tfs.policy.context.model.Device; +import org.etsi.tfs.policy.context.model.DeviceConfig; +import org.etsi.tfs.policy.context.model.Empty; public interface DeviceGateway { Uni getInitialConfiguration(String deviceId); diff --git a/src/automation/src/main/java/eu/teraflow/automation/device/DeviceGatewayImpl.java b/src/policy/src/main/java/org/etsi/tfs/policy/device/DeviceGatewayImpl.java similarity index 89% rename from src/automation/src/main/java/eu/teraflow/automation/device/DeviceGatewayImpl.java rename to src/policy/src/main/java/org/etsi/tfs/policy/device/DeviceGatewayImpl.java index 5e3d63f86477c11dbc6bbaa314172912b9b31da3..7233e8c02340813f53fbf7621fbc3f0f8cb5bd8d 100644 --- a/src/automation/src/main/java/eu/teraflow/automation/device/DeviceGatewayImpl.java +++ b/src/policy/src/main/java/org/etsi/tfs/policy/device/DeviceGatewayImpl.java @@ -14,17 +14,17 @@ * limitations under the License. */ -package eu.teraflow.automation.device; +package org.etsi.tfs.policy.device; import device.DeviceService; -import eu.teraflow.automation.Serializer; -import eu.teraflow.automation.context.model.Device; -import eu.teraflow.automation.context.model.DeviceConfig; -import eu.teraflow.automation.context.model.Empty; import io.quarkus.grpc.GrpcClient; import io.smallrye.mutiny.Uni; import javax.enterprise.context.ApplicationScoped; import javax.inject.Inject; +import org.etsi.tfs.policy.Serializer; +import org.etsi.tfs.policy.context.model.Device; +import org.etsi.tfs.policy.context.model.DeviceConfig; +import org.etsi.tfs.policy.context.model.Empty; @ApplicationScoped public class DeviceGatewayImpl implements DeviceGateway { diff --git a/src/automation/src/main/java/eu/teraflow/automation/device/DeviceService.java b/src/policy/src/main/java/org/etsi/tfs/policy/device/DeviceService.java similarity index 81% rename from src/automation/src/main/java/eu/teraflow/automation/device/DeviceService.java rename to src/policy/src/main/java/org/etsi/tfs/policy/device/DeviceService.java index b41257d4a360f47f9a037a462726b31eba11f127..e6c8989459b97bd51f1f2ad0af477aa264d881f8 100644 --- a/src/automation/src/main/java/eu/teraflow/automation/device/DeviceService.java +++ b/src/policy/src/main/java/org/etsi/tfs/policy/device/DeviceService.java @@ -14,12 +14,12 @@ * limitations under the License. */ -package eu.teraflow.automation.device; +package org.etsi.tfs.policy.device; -import eu.teraflow.automation.context.model.Device; -import eu.teraflow.automation.context.model.DeviceConfig; -import eu.teraflow.automation.context.model.Empty; import io.smallrye.mutiny.Uni; +import org.etsi.tfs.policy.context.model.Device; +import org.etsi.tfs.policy.context.model.DeviceConfig; +import org.etsi.tfs.policy.context.model.Empty; public interface DeviceService { diff --git a/src/automation/src/main/java/eu/teraflow/automation/device/DeviceServiceImpl.java b/src/policy/src/main/java/org/etsi/tfs/policy/device/DeviceServiceImpl.java similarity index 87% rename from src/automation/src/main/java/eu/teraflow/automation/device/DeviceServiceImpl.java rename to src/policy/src/main/java/org/etsi/tfs/policy/device/DeviceServiceImpl.java index 97b142427988d08ff56025e29b6e7ec6c17cd7b7..ce6f82237b6b4ab00d016d3f669039a766fd53c6 100644 --- a/src/automation/src/main/java/eu/teraflow/automation/device/DeviceServiceImpl.java +++ b/src/policy/src/main/java/org/etsi/tfs/policy/device/DeviceServiceImpl.java @@ -14,14 +14,14 @@ * limitations under the License. */ -package eu.teraflow.automation.device; +package org.etsi.tfs.policy.device; -import eu.teraflow.automation.context.model.Device; -import eu.teraflow.automation.context.model.DeviceConfig; -import eu.teraflow.automation.context.model.Empty; import io.smallrye.mutiny.Uni; import javax.enterprise.context.ApplicationScoped; import javax.inject.Inject; +import org.etsi.tfs.policy.context.model.Device; +import org.etsi.tfs.policy.context.model.DeviceConfig; +import org.etsi.tfs.policy.context.model.Empty; @ApplicationScoped public class DeviceServiceImpl implements DeviceService { diff --git a/src/policy/src/main/java/eu/teraflow/policy/kpi_sample_types/model/KpiSampleType.java b/src/policy/src/main/java/org/etsi/tfs/policy/kpi_sample_types/model/KpiSampleType.java similarity index 85% rename from src/policy/src/main/java/eu/teraflow/policy/kpi_sample_types/model/KpiSampleType.java rename to src/policy/src/main/java/org/etsi/tfs/policy/kpi_sample_types/model/KpiSampleType.java index 38257967703bee1d49ae8b1fc7ef11906690b1aa..384d7e10f13cf5a05c9b0c1658d37c20eb0600ff 100644 --- a/src/policy/src/main/java/eu/teraflow/policy/kpi_sample_types/model/KpiSampleType.java +++ b/src/policy/src/main/java/org/etsi/tfs/policy/kpi_sample_types/model/KpiSampleType.java @@ -14,12 +14,14 @@ * limitations under the License. */ -package eu.teraflow.policy.kpi_sample_types.model; +package org.etsi.tfs.policy.kpi_sample_types.model; public enum KpiSampleType { UNKNOWN, PACKETS_TRANSMITTED, PACKETS_RECEIVED, BYTES_TRANSMITTED, - BYTES_RECEIVED + BYTES_RECEIVED, + LINK_TOTAL_CAPACITY_GBPS, + LINK_USED_CAPACITY_GBPS } diff --git a/src/policy/src/main/java/eu/teraflow/policy/model/BooleanOperator.java b/src/policy/src/main/java/org/etsi/tfs/policy/model/BooleanOperator.java similarity index 95% rename from src/policy/src/main/java/eu/teraflow/policy/model/BooleanOperator.java rename to src/policy/src/main/java/org/etsi/tfs/policy/model/BooleanOperator.java index 1c8208ebd2fc545b3cbdda090ee6a02658c8e55c..85133fc535ebfe4681e6452cc3872ae669b3776c 100644 --- a/src/policy/src/main/java/eu/teraflow/policy/model/BooleanOperator.java +++ b/src/policy/src/main/java/org/etsi/tfs/policy/model/BooleanOperator.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package eu.teraflow.policy.model; +package org.etsi.tfs.policy.model; public enum BooleanOperator { POLICYRULE_CONDITION_BOOLEAN_UNDEFINED, diff --git a/src/policy/src/main/java/eu/teraflow/policy/model/NumericalOperator.java b/src/policy/src/main/java/org/etsi/tfs/policy/model/NumericalOperator.java similarity index 96% rename from src/policy/src/main/java/eu/teraflow/policy/model/NumericalOperator.java rename to src/policy/src/main/java/org/etsi/tfs/policy/model/NumericalOperator.java index 3d59ac0a786ec4d5454711b739cc4337a8845450..bc66490ddd6a210779ff5da28ca1e480c53d5768 100644 --- a/src/policy/src/main/java/eu/teraflow/policy/model/NumericalOperator.java +++ b/src/policy/src/main/java/org/etsi/tfs/policy/model/NumericalOperator.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package eu.teraflow.policy.model; +package org.etsi.tfs.policy.model; public enum NumericalOperator { POLICY_RULE_CONDITION_NUMERICAL_UNDEFINED, diff --git a/src/policy/src/main/java/eu/teraflow/policy/model/PolicyRule.java b/src/policy/src/main/java/org/etsi/tfs/policy/model/PolicyRule.java similarity index 96% rename from src/policy/src/main/java/eu/teraflow/policy/model/PolicyRule.java rename to src/policy/src/main/java/org/etsi/tfs/policy/model/PolicyRule.java index 177bf85f69e00b793a4c4846f58677c0d619f536..b879dbd7b6a3dbfbaac5c0f785f9cd724d21c20f 100644 --- a/src/policy/src/main/java/eu/teraflow/policy/model/PolicyRule.java +++ b/src/policy/src/main/java/org/etsi/tfs/policy/model/PolicyRule.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package eu.teraflow.policy.model; +package org.etsi.tfs.policy.model; public class PolicyRule { diff --git a/src/policy/src/main/java/eu/teraflow/policy/model/PolicyRuleAction.java b/src/policy/src/main/java/org/etsi/tfs/policy/model/PolicyRuleAction.java similarity index 98% rename from src/policy/src/main/java/eu/teraflow/policy/model/PolicyRuleAction.java rename to src/policy/src/main/java/org/etsi/tfs/policy/model/PolicyRuleAction.java index 2c9bcae09826da7ec17f42f743515384f10cd886..f6b6d2e2fa88f581a93949378be89305a9c6ee22 100644 --- a/src/policy/src/main/java/eu/teraflow/policy/model/PolicyRuleAction.java +++ b/src/policy/src/main/java/org/etsi/tfs/policy/model/PolicyRuleAction.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package eu.teraflow.policy.model; +package org.etsi.tfs.policy.model; import java.util.List; import java.util.stream.Collectors; diff --git a/src/policy/src/main/java/eu/teraflow/policy/model/PolicyRuleActionConfig.java b/src/policy/src/main/java/org/etsi/tfs/policy/model/PolicyRuleActionConfig.java similarity index 97% rename from src/policy/src/main/java/eu/teraflow/policy/model/PolicyRuleActionConfig.java rename to src/policy/src/main/java/org/etsi/tfs/policy/model/PolicyRuleActionConfig.java index 871fd933a3143a94eea616eae00aedf63bbb8168..d815a3e9eb3a5af504d6e29daff33e7a657d30ad 100644 --- a/src/policy/src/main/java/eu/teraflow/policy/model/PolicyRuleActionConfig.java +++ b/src/policy/src/main/java/org/etsi/tfs/policy/model/PolicyRuleActionConfig.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package eu.teraflow.policy.model; +package org.etsi.tfs.policy.model; public class PolicyRuleActionConfig { diff --git a/src/policy/src/main/java/eu/teraflow/policy/model/PolicyRuleActionEnum.java b/src/policy/src/main/java/org/etsi/tfs/policy/model/PolicyRuleActionEnum.java similarity index 96% rename from src/policy/src/main/java/eu/teraflow/policy/model/PolicyRuleActionEnum.java rename to src/policy/src/main/java/org/etsi/tfs/policy/model/PolicyRuleActionEnum.java index 971dfbaf29bba86ce0043e2edc6bb1e21f181643..a29f4613391dd91b94e60688e3de3c57cc9c77fb 100644 --- a/src/policy/src/main/java/eu/teraflow/policy/model/PolicyRuleActionEnum.java +++ b/src/policy/src/main/java/org/etsi/tfs/policy/model/PolicyRuleActionEnum.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package eu.teraflow.policy.model; +package org.etsi.tfs.policy.model; public enum PolicyRuleActionEnum { POLICY_RULE_ACTION_NO_ACTION, diff --git a/src/policy/src/main/java/eu/teraflow/policy/model/PolicyRuleBasic.java b/src/policy/src/main/java/org/etsi/tfs/policy/model/PolicyRuleBasic.java similarity index 98% rename from src/policy/src/main/java/eu/teraflow/policy/model/PolicyRuleBasic.java rename to src/policy/src/main/java/org/etsi/tfs/policy/model/PolicyRuleBasic.java index 9b6c3282886a2373d8a60493add54422e11b4b07..ea00ea3fc2a2fc8492ef60a860df4e9baf220bfe 100644 --- a/src/policy/src/main/java/eu/teraflow/policy/model/PolicyRuleBasic.java +++ b/src/policy/src/main/java/org/etsi/tfs/policy/model/PolicyRuleBasic.java @@ -14,13 +14,13 @@ * limitations under the License. */ -package eu.teraflow.policy.model; +package org.etsi.tfs.policy.model; import static com.google.common.base.Preconditions.checkArgument; -import eu.teraflow.policy.common.Util; import java.util.ArrayList; import java.util.List; +import org.etsi.tfs.policy.common.Util; public class PolicyRuleBasic { diff --git a/src/policy/src/main/java/eu/teraflow/policy/model/PolicyRuleCondition.java b/src/policy/src/main/java/org/etsi/tfs/policy/model/PolicyRuleCondition.java similarity index 96% rename from src/policy/src/main/java/eu/teraflow/policy/model/PolicyRuleCondition.java rename to src/policy/src/main/java/org/etsi/tfs/policy/model/PolicyRuleCondition.java index 9b7de240deb8a75316501dac1765a7c5518e97ab..a293395af73cf00ed24b3b515acb1c37edd9e4e7 100644 --- a/src/policy/src/main/java/eu/teraflow/policy/model/PolicyRuleCondition.java +++ b/src/policy/src/main/java/org/etsi/tfs/policy/model/PolicyRuleCondition.java @@ -14,12 +14,12 @@ * limitations under the License. */ -package eu.teraflow.policy.model; +package org.etsi.tfs.policy.model; import static com.google.common.base.Preconditions.checkArgument; import static com.google.common.base.Preconditions.checkNotNull; -import eu.teraflow.policy.monitoring.model.KpiValue; +import org.etsi.tfs.policy.monitoring.model.KpiValue; public class PolicyRuleCondition { diff --git a/src/policy/src/main/java/eu/teraflow/policy/model/PolicyRuleDevice.java b/src/policy/src/main/java/org/etsi/tfs/policy/model/PolicyRuleDevice.java similarity index 96% rename from src/policy/src/main/java/eu/teraflow/policy/model/PolicyRuleDevice.java rename to src/policy/src/main/java/org/etsi/tfs/policy/model/PolicyRuleDevice.java index 516cc969024e509c95c9cc41576f5f962c882ef2..9c23692a13827e7701a3877a64fa4d625e25f877 100644 --- a/src/policy/src/main/java/eu/teraflow/policy/model/PolicyRuleDevice.java +++ b/src/policy/src/main/java/org/etsi/tfs/policy/model/PolicyRuleDevice.java @@ -14,13 +14,13 @@ * limitations under the License. */ -package eu.teraflow.policy.model; +package org.etsi.tfs.policy.model; import static com.google.common.base.Preconditions.checkArgument; -import eu.teraflow.policy.common.Util; import java.util.ArrayList; import java.util.List; +import org.etsi.tfs.policy.common.Util; public class PolicyRuleDevice { diff --git a/src/policy/src/main/java/eu/teraflow/policy/model/PolicyRuleService.java b/src/policy/src/main/java/org/etsi/tfs/policy/model/PolicyRuleService.java similarity index 95% rename from src/policy/src/main/java/eu/teraflow/policy/model/PolicyRuleService.java rename to src/policy/src/main/java/org/etsi/tfs/policy/model/PolicyRuleService.java index 9d362919aadb772f97199df394f851953b446619..1f507ebc944ceab6f8018b52c8d534f5b9795930 100644 --- a/src/policy/src/main/java/eu/teraflow/policy/model/PolicyRuleService.java +++ b/src/policy/src/main/java/org/etsi/tfs/policy/model/PolicyRuleService.java @@ -14,14 +14,14 @@ * limitations under the License. */ -package eu.teraflow.policy.model; +package org.etsi.tfs.policy.model; import static com.google.common.base.Preconditions.checkArgument; -import eu.teraflow.policy.common.Util; -import eu.teraflow.policy.context.model.ServiceId; import java.util.ArrayList; import java.util.List; +import org.etsi.tfs.policy.common.Util; +import org.etsi.tfs.policy.context.model.ServiceId; public class PolicyRuleService { diff --git a/src/policy/src/main/java/eu/teraflow/policy/model/PolicyRuleState.java b/src/policy/src/main/java/org/etsi/tfs/policy/model/PolicyRuleState.java similarity index 97% rename from src/policy/src/main/java/eu/teraflow/policy/model/PolicyRuleState.java rename to src/policy/src/main/java/org/etsi/tfs/policy/model/PolicyRuleState.java index 1102e4778fec00d3f65b4cb43408b25d1254fb17..3a2c5ba428e4a0115d013e4ebd89524fbd9cb9c8 100644 --- a/src/policy/src/main/java/eu/teraflow/policy/model/PolicyRuleState.java +++ b/src/policy/src/main/java/org/etsi/tfs/policy/model/PolicyRuleState.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package eu.teraflow.policy.model; +package org.etsi.tfs.policy.model; public class PolicyRuleState { diff --git a/src/policy/src/main/java/eu/teraflow/policy/model/PolicyRuleStateEnum.java b/src/policy/src/main/java/org/etsi/tfs/policy/model/PolicyRuleStateEnum.java similarity index 96% rename from src/policy/src/main/java/eu/teraflow/policy/model/PolicyRuleStateEnum.java rename to src/policy/src/main/java/org/etsi/tfs/policy/model/PolicyRuleStateEnum.java index 749ca389e1f2ced8037078dea429938257ee8082..4e53491499559d085af7fc0ee58b9cdcd21010e5 100644 --- a/src/policy/src/main/java/eu/teraflow/policy/model/PolicyRuleStateEnum.java +++ b/src/policy/src/main/java/org/etsi/tfs/policy/model/PolicyRuleStateEnum.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package eu.teraflow.policy.model; +package org.etsi.tfs.policy.model; public enum PolicyRuleStateEnum { POLICY_UNDEFINED, diff --git a/src/policy/src/main/java/eu/teraflow/policy/model/PolicyRuleType.java b/src/policy/src/main/java/org/etsi/tfs/policy/model/PolicyRuleType.java similarity index 95% rename from src/policy/src/main/java/eu/teraflow/policy/model/PolicyRuleType.java rename to src/policy/src/main/java/org/etsi/tfs/policy/model/PolicyRuleType.java index b3389f6a99bcbd4f7c8f5b77f863b15891bf8db2..b013e48efa22d58e0e43accb3fdda68803389606 100644 --- a/src/policy/src/main/java/eu/teraflow/policy/model/PolicyRuleType.java +++ b/src/policy/src/main/java/org/etsi/tfs/policy/model/PolicyRuleType.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package eu.teraflow.policy.model; +package org.etsi.tfs.policy.model; public interface PolicyRuleType { diff --git a/src/policy/src/main/java/eu/teraflow/policy/model/PolicyRuleTypeDevice.java b/src/policy/src/main/java/org/etsi/tfs/policy/model/PolicyRuleTypeDevice.java similarity index 97% rename from src/policy/src/main/java/eu/teraflow/policy/model/PolicyRuleTypeDevice.java rename to src/policy/src/main/java/org/etsi/tfs/policy/model/PolicyRuleTypeDevice.java index d262f254bbb4583256bfc18e8526a12bd1c048f1..34c4dc3f00ee306b97a50abf02ff5f5824669ef3 100644 --- a/src/policy/src/main/java/eu/teraflow/policy/model/PolicyRuleTypeDevice.java +++ b/src/policy/src/main/java/org/etsi/tfs/policy/model/PolicyRuleTypeDevice.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package eu.teraflow.policy.model; +package org.etsi.tfs.policy.model; public class PolicyRuleTypeDevice implements PolicyRuleType { diff --git a/src/policy/src/main/java/eu/teraflow/policy/model/PolicyRuleTypeService.java b/src/policy/src/main/java/org/etsi/tfs/policy/model/PolicyRuleTypeService.java similarity index 97% rename from src/policy/src/main/java/eu/teraflow/policy/model/PolicyRuleTypeService.java rename to src/policy/src/main/java/org/etsi/tfs/policy/model/PolicyRuleTypeService.java index 54978476f457581670184feaec679b59f07d45e2..88f83aa83799b3b4448407399e70953e99560bd6 100644 --- a/src/policy/src/main/java/eu/teraflow/policy/model/PolicyRuleTypeService.java +++ b/src/policy/src/main/java/org/etsi/tfs/policy/model/PolicyRuleTypeService.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package eu.teraflow.policy.model; +package org.etsi.tfs.policy.model; public class PolicyRuleTypeService implements PolicyRuleType { diff --git a/src/policy/src/main/java/eu/teraflow/policy/monitoring/MonitoringGateway.java b/src/policy/src/main/java/org/etsi/tfs/policy/monitoring/MonitoringGateway.java similarity index 72% rename from src/policy/src/main/java/eu/teraflow/policy/monitoring/MonitoringGateway.java rename to src/policy/src/main/java/org/etsi/tfs/policy/monitoring/MonitoringGateway.java index 89e9152c6b5402d56c22afcd01ddaac7c81c6dde..63174b88077ff1248e47dd46a373c09d07ddb8a7 100644 --- a/src/policy/src/main/java/eu/teraflow/policy/monitoring/MonitoringGateway.java +++ b/src/policy/src/main/java/org/etsi/tfs/policy/monitoring/MonitoringGateway.java @@ -14,18 +14,18 @@ * limitations under the License. */ -package eu.teraflow.policy.monitoring; - -import eu.teraflow.policy.context.model.Empty; -import eu.teraflow.policy.monitoring.model.AlarmDescriptor; -import eu.teraflow.policy.monitoring.model.AlarmResponse; -import eu.teraflow.policy.monitoring.model.AlarmSubscription; -import eu.teraflow.policy.monitoring.model.KpiDescriptor; -import eu.teraflow.policy.monitoring.model.MonitorKpiRequest; -import eu.teraflow.policy.monitoring.model.SubsDescriptor; -import eu.teraflow.policy.monitoring.model.SubsResponse; +package org.etsi.tfs.policy.monitoring; + import io.smallrye.mutiny.Multi; import io.smallrye.mutiny.Uni; +import org.etsi.tfs.policy.context.model.Empty; +import org.etsi.tfs.policy.monitoring.model.AlarmDescriptor; +import org.etsi.tfs.policy.monitoring.model.AlarmResponse; +import org.etsi.tfs.policy.monitoring.model.AlarmSubscription; +import org.etsi.tfs.policy.monitoring.model.KpiDescriptor; +import org.etsi.tfs.policy.monitoring.model.MonitorKpiRequest; +import org.etsi.tfs.policy.monitoring.model.SubsDescriptor; +import org.etsi.tfs.policy.monitoring.model.SubsResponse; public interface MonitoringGateway { diff --git a/src/policy/src/main/java/eu/teraflow/policy/monitoring/MonitoringGatewayImpl.java b/src/policy/src/main/java/org/etsi/tfs/policy/monitoring/MonitoringGatewayImpl.java similarity index 89% rename from src/policy/src/main/java/eu/teraflow/policy/monitoring/MonitoringGatewayImpl.java rename to src/policy/src/main/java/org/etsi/tfs/policy/monitoring/MonitoringGatewayImpl.java index cc6c97f32e746dcf898bcd6880b8ffd3708e3e34..3c16dff7e12532f3c33f1c2890befabfa679ebe9 100644 --- a/src/policy/src/main/java/eu/teraflow/policy/monitoring/MonitoringGatewayImpl.java +++ b/src/policy/src/main/java/org/etsi/tfs/policy/monitoring/MonitoringGatewayImpl.java @@ -14,23 +14,23 @@ * limitations under the License. */ -package eu.teraflow.policy.monitoring; - -import eu.teraflow.policy.Serializer; -import eu.teraflow.policy.context.model.Empty; -import eu.teraflow.policy.monitoring.model.AlarmDescriptor; -import eu.teraflow.policy.monitoring.model.AlarmResponse; -import eu.teraflow.policy.monitoring.model.AlarmSubscription; -import eu.teraflow.policy.monitoring.model.KpiDescriptor; -import eu.teraflow.policy.monitoring.model.MonitorKpiRequest; -import eu.teraflow.policy.monitoring.model.SubsDescriptor; -import eu.teraflow.policy.monitoring.model.SubsResponse; +package org.etsi.tfs.policy.monitoring; + import io.quarkus.grpc.GrpcClient; import io.smallrye.mutiny.Multi; import io.smallrye.mutiny.Uni; import javax.enterprise.context.ApplicationScoped; import javax.inject.Inject; import monitoring.MutinyMonitoringServiceGrpc.MutinyMonitoringServiceStub; +import org.etsi.tfs.policy.Serializer; +import org.etsi.tfs.policy.context.model.Empty; +import org.etsi.tfs.policy.monitoring.model.AlarmDescriptor; +import org.etsi.tfs.policy.monitoring.model.AlarmResponse; +import org.etsi.tfs.policy.monitoring.model.AlarmSubscription; +import org.etsi.tfs.policy.monitoring.model.KpiDescriptor; +import org.etsi.tfs.policy.monitoring.model.MonitorKpiRequest; +import org.etsi.tfs.policy.monitoring.model.SubsDescriptor; +import org.etsi.tfs.policy.monitoring.model.SubsResponse; @ApplicationScoped public class MonitoringGatewayImpl implements MonitoringGateway { diff --git a/src/policy/src/main/java/eu/teraflow/policy/monitoring/MonitoringService.java b/src/policy/src/main/java/org/etsi/tfs/policy/monitoring/MonitoringService.java similarity index 72% rename from src/policy/src/main/java/eu/teraflow/policy/monitoring/MonitoringService.java rename to src/policy/src/main/java/org/etsi/tfs/policy/monitoring/MonitoringService.java index 6010ec04a515dcfa9c84c7ce2363c9dea72640e1..5d8e289440a61542b6e76b8385201069dd54226e 100644 --- a/src/policy/src/main/java/eu/teraflow/policy/monitoring/MonitoringService.java +++ b/src/policy/src/main/java/org/etsi/tfs/policy/monitoring/MonitoringService.java @@ -14,18 +14,18 @@ * limitations under the License. */ -package eu.teraflow.policy.monitoring; - -import eu.teraflow.policy.context.model.Empty; -import eu.teraflow.policy.monitoring.model.AlarmDescriptor; -import eu.teraflow.policy.monitoring.model.AlarmResponse; -import eu.teraflow.policy.monitoring.model.AlarmSubscription; -import eu.teraflow.policy.monitoring.model.KpiDescriptor; -import eu.teraflow.policy.monitoring.model.MonitorKpiRequest; -import eu.teraflow.policy.monitoring.model.SubsDescriptor; -import eu.teraflow.policy.monitoring.model.SubsResponse; +package org.etsi.tfs.policy.monitoring; + import io.smallrye.mutiny.Multi; import io.smallrye.mutiny.Uni; +import org.etsi.tfs.policy.context.model.Empty; +import org.etsi.tfs.policy.monitoring.model.AlarmDescriptor; +import org.etsi.tfs.policy.monitoring.model.AlarmResponse; +import org.etsi.tfs.policy.monitoring.model.AlarmSubscription; +import org.etsi.tfs.policy.monitoring.model.KpiDescriptor; +import org.etsi.tfs.policy.monitoring.model.MonitorKpiRequest; +import org.etsi.tfs.policy.monitoring.model.SubsDescriptor; +import org.etsi.tfs.policy.monitoring.model.SubsResponse; public interface MonitoringService { diff --git a/src/policy/src/main/java/eu/teraflow/policy/monitoring/MonitoringServiceImpl.java b/src/policy/src/main/java/org/etsi/tfs/policy/monitoring/MonitoringServiceImpl.java similarity index 83% rename from src/policy/src/main/java/eu/teraflow/policy/monitoring/MonitoringServiceImpl.java rename to src/policy/src/main/java/org/etsi/tfs/policy/monitoring/MonitoringServiceImpl.java index a3f9f223bc1ef012263366af409214a427162c59..4da193b1dbb94e41c44031976968afd04a86e4fd 100644 --- a/src/policy/src/main/java/eu/teraflow/policy/monitoring/MonitoringServiceImpl.java +++ b/src/policy/src/main/java/org/etsi/tfs/policy/monitoring/MonitoringServiceImpl.java @@ -14,20 +14,20 @@ * limitations under the License. */ -package eu.teraflow.policy.monitoring; +package org.etsi.tfs.policy.monitoring; -import eu.teraflow.policy.context.model.Empty; -import eu.teraflow.policy.monitoring.model.AlarmDescriptor; -import eu.teraflow.policy.monitoring.model.AlarmResponse; -import eu.teraflow.policy.monitoring.model.AlarmSubscription; -import eu.teraflow.policy.monitoring.model.KpiDescriptor; -import eu.teraflow.policy.monitoring.model.MonitorKpiRequest; -import eu.teraflow.policy.monitoring.model.SubsDescriptor; -import eu.teraflow.policy.monitoring.model.SubsResponse; import io.smallrye.mutiny.Multi; import io.smallrye.mutiny.Uni; import javax.enterprise.context.ApplicationScoped; import javax.inject.Inject; +import org.etsi.tfs.policy.context.model.Empty; +import org.etsi.tfs.policy.monitoring.model.AlarmDescriptor; +import org.etsi.tfs.policy.monitoring.model.AlarmResponse; +import org.etsi.tfs.policy.monitoring.model.AlarmSubscription; +import org.etsi.tfs.policy.monitoring.model.KpiDescriptor; +import org.etsi.tfs.policy.monitoring.model.MonitorKpiRequest; +import org.etsi.tfs.policy.monitoring.model.SubsDescriptor; +import org.etsi.tfs.policy.monitoring.model.SubsResponse; @ApplicationScoped public class MonitoringServiceImpl implements MonitoringService { diff --git a/src/policy/src/main/java/eu/teraflow/policy/monitoring/model/AlarmDescriptor.java b/src/policy/src/main/java/org/etsi/tfs/policy/monitoring/model/AlarmDescriptor.java similarity index 97% rename from src/policy/src/main/java/eu/teraflow/policy/monitoring/model/AlarmDescriptor.java rename to src/policy/src/main/java/org/etsi/tfs/policy/monitoring/model/AlarmDescriptor.java index 090237f947743b200d0217a00a4b87c251587623..31e5eb72185af173871b81e4730aa432e2600e96 100644 --- a/src/policy/src/main/java/eu/teraflow/policy/monitoring/model/AlarmDescriptor.java +++ b/src/policy/src/main/java/org/etsi/tfs/policy/monitoring/model/AlarmDescriptor.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package eu.teraflow.policy.monitoring.model; +package org.etsi.tfs.policy.monitoring.model; public class AlarmDescriptor { private final String alarmId; diff --git a/src/policy/src/main/java/eu/teraflow/policy/monitoring/model/AlarmResponse.java b/src/policy/src/main/java/org/etsi/tfs/policy/monitoring/model/AlarmResponse.java similarity index 93% rename from src/policy/src/main/java/eu/teraflow/policy/monitoring/model/AlarmResponse.java rename to src/policy/src/main/java/org/etsi/tfs/policy/monitoring/model/AlarmResponse.java index a92ae4decfe54f9bce06db1dda53ccadea52946a..fb23ac53c3adcb8f2c3f69d831fce90b5d68560a 100644 --- a/src/policy/src/main/java/eu/teraflow/policy/monitoring/model/AlarmResponse.java +++ b/src/policy/src/main/java/org/etsi/tfs/policy/monitoring/model/AlarmResponse.java @@ -14,10 +14,10 @@ * limitations under the License. */ -package eu.teraflow.policy.monitoring.model; +package org.etsi.tfs.policy.monitoring.model; -import eu.teraflow.policy.common.Util; import java.util.List; +import org.etsi.tfs.policy.common.Util; public class AlarmResponse { diff --git a/src/policy/src/main/java/eu/teraflow/policy/monitoring/model/AlarmSubscription.java b/src/policy/src/main/java/org/etsi/tfs/policy/monitoring/model/AlarmSubscription.java similarity index 97% rename from src/policy/src/main/java/eu/teraflow/policy/monitoring/model/AlarmSubscription.java rename to src/policy/src/main/java/org/etsi/tfs/policy/monitoring/model/AlarmSubscription.java index 7b99c20456987b6c56a0af00821fb5ef33954ada..c2d42c13cfbed6ea476126243350165c0511a0f6 100644 --- a/src/policy/src/main/java/eu/teraflow/policy/monitoring/model/AlarmSubscription.java +++ b/src/policy/src/main/java/org/etsi/tfs/policy/monitoring/model/AlarmSubscription.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package eu.teraflow.policy.monitoring.model; +package org.etsi.tfs.policy.monitoring.model; public class AlarmSubscription { diff --git a/src/policy/src/main/java/eu/teraflow/policy/monitoring/model/BooleanKpiValue.java b/src/policy/src/main/java/org/etsi/tfs/policy/monitoring/model/BooleanKpiValue.java similarity index 95% rename from src/policy/src/main/java/eu/teraflow/policy/monitoring/model/BooleanKpiValue.java rename to src/policy/src/main/java/org/etsi/tfs/policy/monitoring/model/BooleanKpiValue.java index c93aeb520b6fe6ec68a3d745b5161450130045c2..b24901e6491c7043e0886f73cc5253624debafe6 100644 --- a/src/policy/src/main/java/eu/teraflow/policy/monitoring/model/BooleanKpiValue.java +++ b/src/policy/src/main/java/org/etsi/tfs/policy/monitoring/model/BooleanKpiValue.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package eu.teraflow.policy.monitoring.model; +package org.etsi.tfs.policy.monitoring.model; public class BooleanKpiValue implements KpiValue { diff --git a/src/policy/src/main/java/eu/teraflow/policy/monitoring/model/FloatKpiValue.java b/src/policy/src/main/java/org/etsi/tfs/policy/monitoring/model/FloatKpiValue.java similarity index 95% rename from src/policy/src/main/java/eu/teraflow/policy/monitoring/model/FloatKpiValue.java rename to src/policy/src/main/java/org/etsi/tfs/policy/monitoring/model/FloatKpiValue.java index 2e19b2b2be6dd4ec7dd25f52ad19c99227fa5ef4..7f723c3950270d09a2e093152ff489e69d672714 100644 --- a/src/policy/src/main/java/eu/teraflow/policy/monitoring/model/FloatKpiValue.java +++ b/src/policy/src/main/java/org/etsi/tfs/policy/monitoring/model/FloatKpiValue.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package eu.teraflow.policy.monitoring.model; +package org.etsi.tfs.policy.monitoring.model; public class FloatKpiValue implements KpiValue { diff --git a/src/policy/src/main/java/eu/teraflow/policy/monitoring/model/IntegerKpiValue.java b/src/policy/src/main/java/org/etsi/tfs/policy/monitoring/model/IntegerKpiValue.java similarity index 95% rename from src/policy/src/main/java/eu/teraflow/policy/monitoring/model/IntegerKpiValue.java rename to src/policy/src/main/java/org/etsi/tfs/policy/monitoring/model/IntegerKpiValue.java index cc3f92111d360271d3b85c152e6465d6e0a3bcc3..5c4a2b4d44ca80e8ffd963ed690710960d659d46 100644 --- a/src/policy/src/main/java/eu/teraflow/policy/monitoring/model/IntegerKpiValue.java +++ b/src/policy/src/main/java/org/etsi/tfs/policy/monitoring/model/IntegerKpiValue.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package eu.teraflow.policy.monitoring.model; +package org.etsi.tfs.policy.monitoring.model; public class IntegerKpiValue implements KpiValue { diff --git a/src/policy/src/main/java/eu/teraflow/policy/monitoring/model/Kpi.java b/src/policy/src/main/java/org/etsi/tfs/policy/monitoring/model/Kpi.java similarity index 96% rename from src/policy/src/main/java/eu/teraflow/policy/monitoring/model/Kpi.java rename to src/policy/src/main/java/org/etsi/tfs/policy/monitoring/model/Kpi.java index 92439d01f08b5f3ee55f15fe8c67ed484fa38306..d7b54a9599e66e2f124e0980a6974969e6d14e1e 100644 --- a/src/policy/src/main/java/eu/teraflow/policy/monitoring/model/Kpi.java +++ b/src/policy/src/main/java/org/etsi/tfs/policy/monitoring/model/Kpi.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package eu.teraflow.policy.monitoring.model; +package org.etsi.tfs.policy.monitoring.model; public class Kpi { diff --git a/src/policy/src/main/java/eu/teraflow/policy/monitoring/model/KpiDescriptor.java b/src/policy/src/main/java/org/etsi/tfs/policy/monitoring/model/KpiDescriptor.java similarity index 89% rename from src/policy/src/main/java/eu/teraflow/policy/monitoring/model/KpiDescriptor.java rename to src/policy/src/main/java/org/etsi/tfs/policy/monitoring/model/KpiDescriptor.java index 0f7aeca64c97958c5417083ae49f1003667f6693..6bd16922cbed3b8e4552befe73de2153c7ac14b2 100644 --- a/src/policy/src/main/java/eu/teraflow/policy/monitoring/model/KpiDescriptor.java +++ b/src/policy/src/main/java/org/etsi/tfs/policy/monitoring/model/KpiDescriptor.java @@ -14,12 +14,12 @@ * limitations under the License. */ -package eu.teraflow.policy.monitoring.model; +package org.etsi.tfs.policy.monitoring.model; -import eu.teraflow.policy.context.model.EndPointId; -import eu.teraflow.policy.context.model.ServiceId; -import eu.teraflow.policy.context.model.SliceId; -import eu.teraflow.policy.kpi_sample_types.model.KpiSampleType; +import org.etsi.tfs.policy.context.model.EndPointId; +import org.etsi.tfs.policy.context.model.ServiceId; +import org.etsi.tfs.policy.context.model.SliceId; +import org.etsi.tfs.policy.kpi_sample_types.model.KpiSampleType; public class KpiDescriptor { diff --git a/src/policy/src/main/java/eu/teraflow/policy/monitoring/model/KpiValue.java b/src/policy/src/main/java/org/etsi/tfs/policy/monitoring/model/KpiValue.java similarity index 93% rename from src/policy/src/main/java/eu/teraflow/policy/monitoring/model/KpiValue.java rename to src/policy/src/main/java/org/etsi/tfs/policy/monitoring/model/KpiValue.java index 0a4418d65bff29d5e0df0134ad15a409b7fd2d30..23e68416ad07232fe7492b2f5226f2eed56b587f 100644 --- a/src/policy/src/main/java/eu/teraflow/policy/monitoring/model/KpiValue.java +++ b/src/policy/src/main/java/org/etsi/tfs/policy/monitoring/model/KpiValue.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package eu.teraflow.policy.monitoring.model; +package org.etsi.tfs.policy.monitoring.model; public interface KpiValue { diff --git a/src/policy/src/main/java/eu/teraflow/policy/monitoring/model/KpiValueRange.java b/src/policy/src/main/java/org/etsi/tfs/policy/monitoring/model/KpiValueRange.java similarity index 98% rename from src/policy/src/main/java/eu/teraflow/policy/monitoring/model/KpiValueRange.java rename to src/policy/src/main/java/org/etsi/tfs/policy/monitoring/model/KpiValueRange.java index 6a0bba6c6a5af5fb53745768f01d1a0e5bf6c85d..8db7f05a518ccac940f6c9cd1ccc93b386fd8565 100644 --- a/src/policy/src/main/java/eu/teraflow/policy/monitoring/model/KpiValueRange.java +++ b/src/policy/src/main/java/org/etsi/tfs/policy/monitoring/model/KpiValueRange.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package eu.teraflow.policy.monitoring.model; +package org.etsi.tfs.policy.monitoring.model; public class KpiValueRange { diff --git a/src/policy/src/main/java/eu/teraflow/policy/monitoring/model/LongKpiValue.java b/src/policy/src/main/java/org/etsi/tfs/policy/monitoring/model/LongKpiValue.java similarity index 95% rename from src/policy/src/main/java/eu/teraflow/policy/monitoring/model/LongKpiValue.java rename to src/policy/src/main/java/org/etsi/tfs/policy/monitoring/model/LongKpiValue.java index c57e605ffdda7f45de06fec47813a522c06d7b93..e20d1d5d0829bebdd111b456ff2ed1561b795045 100644 --- a/src/policy/src/main/java/eu/teraflow/policy/monitoring/model/LongKpiValue.java +++ b/src/policy/src/main/java/org/etsi/tfs/policy/monitoring/model/LongKpiValue.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package eu.teraflow.policy.monitoring.model; +package org.etsi.tfs.policy.monitoring.model; public class LongKpiValue implements KpiValue { diff --git a/src/policy/src/main/java/eu/teraflow/policy/monitoring/model/MonitorKpiRequest.java b/src/policy/src/main/java/org/etsi/tfs/policy/monitoring/model/MonitorKpiRequest.java similarity index 96% rename from src/policy/src/main/java/eu/teraflow/policy/monitoring/model/MonitorKpiRequest.java rename to src/policy/src/main/java/org/etsi/tfs/policy/monitoring/model/MonitorKpiRequest.java index 30aaad2e8e1514d788c4493bf15eb887f4d02d9b..253c0e3ef9eff8b698fd29380c0153a5297ef3cf 100644 --- a/src/policy/src/main/java/eu/teraflow/policy/monitoring/model/MonitorKpiRequest.java +++ b/src/policy/src/main/java/org/etsi/tfs/policy/monitoring/model/MonitorKpiRequest.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package eu.teraflow.policy.monitoring.model; +package org.etsi.tfs.policy.monitoring.model; public class MonitorKpiRequest { private final String kpiId; diff --git a/src/policy/src/main/java/eu/teraflow/policy/monitoring/model/StringKpiValue.java b/src/policy/src/main/java/org/etsi/tfs/policy/monitoring/model/StringKpiValue.java similarity index 95% rename from src/policy/src/main/java/eu/teraflow/policy/monitoring/model/StringKpiValue.java rename to src/policy/src/main/java/org/etsi/tfs/policy/monitoring/model/StringKpiValue.java index 649d06ceeff84d2daf7ef5c9589c361873c23987..615cfb2e8566e423d482e1da1540f2f62ffade30 100644 --- a/src/policy/src/main/java/eu/teraflow/policy/monitoring/model/StringKpiValue.java +++ b/src/policy/src/main/java/org/etsi/tfs/policy/monitoring/model/StringKpiValue.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package eu.teraflow.policy.monitoring.model; +package org.etsi.tfs.policy.monitoring.model; public class StringKpiValue implements KpiValue { diff --git a/src/policy/src/main/java/eu/teraflow/policy/monitoring/model/SubsDescriptor.java b/src/policy/src/main/java/org/etsi/tfs/policy/monitoring/model/SubsDescriptor.java similarity index 98% rename from src/policy/src/main/java/eu/teraflow/policy/monitoring/model/SubsDescriptor.java rename to src/policy/src/main/java/org/etsi/tfs/policy/monitoring/model/SubsDescriptor.java index 96569bbc7fab5ef18b34ea78c5951949e804eafc..566f7d33b4d7b6dea711adc27128f4c5537a19bd 100644 --- a/src/policy/src/main/java/eu/teraflow/policy/monitoring/model/SubsDescriptor.java +++ b/src/policy/src/main/java/org/etsi/tfs/policy/monitoring/model/SubsDescriptor.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package eu.teraflow.policy.monitoring.model; +package org.etsi.tfs.policy.monitoring.model; public class SubsDescriptor { private final String subscriptionId; diff --git a/src/policy/src/main/java/eu/teraflow/policy/monitoring/model/SubsResponse.java b/src/policy/src/main/java/org/etsi/tfs/policy/monitoring/model/SubsResponse.java similarity index 93% rename from src/policy/src/main/java/eu/teraflow/policy/monitoring/model/SubsResponse.java rename to src/policy/src/main/java/org/etsi/tfs/policy/monitoring/model/SubsResponse.java index b4a2b16a6dd73bfa2e91b9fd2d501f814af9531f..bf51f5743a9487fda13e70ac8e6b37cc088f72f4 100644 --- a/src/policy/src/main/java/eu/teraflow/policy/monitoring/model/SubsResponse.java +++ b/src/policy/src/main/java/org/etsi/tfs/policy/monitoring/model/SubsResponse.java @@ -14,10 +14,10 @@ * limitations under the License. */ -package eu.teraflow.policy.monitoring.model; +package org.etsi.tfs.policy.monitoring.model; -import eu.teraflow.policy.common.Util; import java.util.List; +import org.etsi.tfs.policy.common.Util; public class SubsResponse { diff --git a/src/policy/src/main/java/eu/teraflow/policy/service/ServiceGateway.java b/src/policy/src/main/java/org/etsi/tfs/policy/service/ServiceGateway.java similarity index 81% rename from src/policy/src/main/java/eu/teraflow/policy/service/ServiceGateway.java rename to src/policy/src/main/java/org/etsi/tfs/policy/service/ServiceGateway.java index b8764efe312bae8b395beb3a22b1d2a57346b37d..15dbaf94c24ec2266d0b225c630ec2c0c44c5260 100644 --- a/src/policy/src/main/java/eu/teraflow/policy/service/ServiceGateway.java +++ b/src/policy/src/main/java/org/etsi/tfs/policy/service/ServiceGateway.java @@ -14,12 +14,12 @@ * limitations under the License. */ -package eu.teraflow.policy.service; +package org.etsi.tfs.policy.service; -import eu.teraflow.policy.context.model.Empty; -import eu.teraflow.policy.context.model.Service; -import eu.teraflow.policy.context.model.ServiceId; import io.smallrye.mutiny.Uni; +import org.etsi.tfs.policy.context.model.Empty; +import org.etsi.tfs.policy.context.model.Service; +import org.etsi.tfs.policy.context.model.ServiceId; public interface ServiceGateway { diff --git a/src/policy/src/main/java/eu/teraflow/policy/service/ServiceGatewayImpl.java b/src/policy/src/main/java/org/etsi/tfs/policy/service/ServiceGatewayImpl.java similarity index 91% rename from src/policy/src/main/java/eu/teraflow/policy/service/ServiceGatewayImpl.java rename to src/policy/src/main/java/org/etsi/tfs/policy/service/ServiceGatewayImpl.java index f8f38f7520f608b52f432e41b96e46448234a68e..7eccec7876e0f1cc037a9fa6edcf49f6ecfa0e02 100644 --- a/src/policy/src/main/java/eu/teraflow/policy/service/ServiceGatewayImpl.java +++ b/src/policy/src/main/java/org/etsi/tfs/policy/service/ServiceGatewayImpl.java @@ -14,16 +14,16 @@ * limitations under the License. */ -package eu.teraflow.policy.service; +package org.etsi.tfs.policy.service; -import eu.teraflow.policy.Serializer; -import eu.teraflow.policy.context.model.Empty; -import eu.teraflow.policy.context.model.Service; -import eu.teraflow.policy.context.model.ServiceId; import io.quarkus.grpc.GrpcClient; import io.smallrye.mutiny.Uni; import javax.enterprise.context.ApplicationScoped; import javax.inject.Inject; +import org.etsi.tfs.policy.Serializer; +import org.etsi.tfs.policy.context.model.Empty; +import org.etsi.tfs.policy.context.model.Service; +import org.etsi.tfs.policy.context.model.ServiceId; import org.jboss.logging.Logger; import service.MutinyServiceServiceGrpc.MutinyServiceServiceStub; diff --git a/src/policy/src/main/java/eu/teraflow/policy/service/ServiceService.java b/src/policy/src/main/java/org/etsi/tfs/policy/service/ServiceService.java similarity index 81% rename from src/policy/src/main/java/eu/teraflow/policy/service/ServiceService.java rename to src/policy/src/main/java/org/etsi/tfs/policy/service/ServiceService.java index aa4411ee9d79ea56c3d6f5b901f92b0125fe4b00..eadf77112b1326cf26994920ce3068afe13db665 100644 --- a/src/policy/src/main/java/eu/teraflow/policy/service/ServiceService.java +++ b/src/policy/src/main/java/org/etsi/tfs/policy/service/ServiceService.java @@ -14,12 +14,12 @@ * limitations under the License. */ -package eu.teraflow.policy.service; +package org.etsi.tfs.policy.service; -import eu.teraflow.policy.context.model.Empty; -import eu.teraflow.policy.context.model.Service; -import eu.teraflow.policy.context.model.ServiceId; import io.smallrye.mutiny.Uni; +import org.etsi.tfs.policy.context.model.Empty; +import org.etsi.tfs.policy.context.model.Service; +import org.etsi.tfs.policy.context.model.ServiceId; public interface ServiceService { diff --git a/src/policy/src/main/java/eu/teraflow/policy/service/ServiceServiceImpl.java b/src/policy/src/main/java/org/etsi/tfs/policy/service/ServiceServiceImpl.java similarity index 87% rename from src/policy/src/main/java/eu/teraflow/policy/service/ServiceServiceImpl.java rename to src/policy/src/main/java/org/etsi/tfs/policy/service/ServiceServiceImpl.java index 109bcba261d4464313d5b6f21ee2bdde76b17879..21935f4a3b088c821160e6a175e7880c2d0d1f97 100644 --- a/src/policy/src/main/java/eu/teraflow/policy/service/ServiceServiceImpl.java +++ b/src/policy/src/main/java/org/etsi/tfs/policy/service/ServiceServiceImpl.java @@ -14,14 +14,14 @@ * limitations under the License. */ -package eu.teraflow.policy.service; +package org.etsi.tfs.policy.service; -import eu.teraflow.policy.context.model.Empty; -import eu.teraflow.policy.context.model.Service; -import eu.teraflow.policy.context.model.ServiceId; import io.smallrye.mutiny.Uni; import javax.enterprise.context.ApplicationScoped; import javax.inject.Inject; +import org.etsi.tfs.policy.context.model.Empty; +import org.etsi.tfs.policy.context.model.Service; +import org.etsi.tfs.policy.context.model.ServiceId; @ApplicationScoped public class ServiceServiceImpl implements ServiceService { diff --git a/src/policy/src/main/resources/application.yml b/src/policy/src/main/resources/application.yml index 38a222d7934751e9eac28854300d55bd631a669c..27f2b51d0d110fd9580f7faa1fae4577e4d783d6 100644 --- a/src/policy/src/main/resources/application.yml +++ b/src/policy/src/main/resources/application.yml @@ -23,6 +23,9 @@ quarkus: context: host: ${quarkus.kubernetes.env.vars.context-service-host} port: 1010 + context_policy: + host: ${quarkus.kubernetes.env.vars.context-service-host} + port: 1010 monitoring: host: ${quarkus.kubernetes.env.vars.monitoring-service-host} port: 7070 diff --git a/src/automation/src/test/java/eu/teraflow/automation/ConfigRuleTypeTest.java b/src/policy/src/test/java/org/etsi/tfs/policy/ConfigRuleTypeTest.java similarity index 79% rename from src/automation/src/test/java/eu/teraflow/automation/ConfigRuleTypeTest.java rename to src/policy/src/test/java/org/etsi/tfs/policy/ConfigRuleTypeTest.java index 67d4b204499fd93324bba07895149dba890b77c1..5f36d6ac58c252f52cb6e5577a2cc3b5cd06a3c0 100644 --- a/src/automation/src/test/java/eu/teraflow/automation/ConfigRuleTypeTest.java +++ b/src/policy/src/test/java/org/etsi/tfs/policy/ConfigRuleTypeTest.java @@ -14,25 +14,25 @@ * limitations under the License. */ -package eu.teraflow.automation; +package org.etsi.tfs.policy; import static org.assertj.core.api.Assertions.assertThat; -import eu.teraflow.automation.acl.AclAction; -import eu.teraflow.automation.acl.AclEntry; -import eu.teraflow.automation.acl.AclForwardActionEnum; -import eu.teraflow.automation.acl.AclLogActionEnum; -import eu.teraflow.automation.acl.AclMatch; -import eu.teraflow.automation.acl.AclRuleSet; -import eu.teraflow.automation.acl.AclRuleTypeEnum; -import eu.teraflow.automation.context.model.ConfigRuleAcl; -import eu.teraflow.automation.context.model.ConfigRuleCustom; -import eu.teraflow.automation.context.model.ConfigRuleTypeAcl; -import eu.teraflow.automation.context.model.ConfigRuleTypeCustom; -import eu.teraflow.automation.context.model.EndPointId; -import eu.teraflow.automation.context.model.TopologyId; import io.quarkus.test.junit.QuarkusTest; import java.util.List; +import org.etsi.tfs.policy.acl.AclAction; +import org.etsi.tfs.policy.acl.AclEntry; +import org.etsi.tfs.policy.acl.AclForwardActionEnum; +import org.etsi.tfs.policy.acl.AclLogActionEnum; +import org.etsi.tfs.policy.acl.AclMatch; +import org.etsi.tfs.policy.acl.AclRuleSet; +import org.etsi.tfs.policy.acl.AclRuleTypeEnum; +import org.etsi.tfs.policy.context.model.ConfigRuleAcl; +import org.etsi.tfs.policy.context.model.ConfigRuleCustom; +import org.etsi.tfs.policy.context.model.ConfigRuleTypeAcl; +import org.etsi.tfs.policy.context.model.ConfigRuleTypeCustom; +import org.etsi.tfs.policy.context.model.EndPointId; +import org.etsi.tfs.policy.context.model.TopologyId; import org.junit.jupiter.api.Test; @QuarkusTest diff --git a/src/policy/src/test/java/eu/teraflow/policy/ConstraintTypeTest.java b/src/policy/src/test/java/org/etsi/tfs/policy/ConstraintTypeTest.java similarity index 79% rename from src/policy/src/test/java/eu/teraflow/policy/ConstraintTypeTest.java rename to src/policy/src/test/java/org/etsi/tfs/policy/ConstraintTypeTest.java index 9dc97b4a1269580a93e58f495d28c0f8d81c1c31..7517e4e2f87d234d7ee9ab182d9a3bad5ae396b6 100644 --- a/src/policy/src/test/java/eu/teraflow/policy/ConstraintTypeTest.java +++ b/src/policy/src/test/java/org/etsi/tfs/policy/ConstraintTypeTest.java @@ -14,31 +14,31 @@ * limitations under the License. */ -package eu.teraflow.policy; +package org.etsi.tfs.policy; import static org.assertj.core.api.Assertions.assertThat; -import eu.teraflow.policy.context.model.ConstraintCustom; -import eu.teraflow.policy.context.model.ConstraintEndPointLocation; -import eu.teraflow.policy.context.model.ConstraintSchedule; -import eu.teraflow.policy.context.model.ConstraintSlaAvailability; -import eu.teraflow.policy.context.model.ConstraintSlaCapacity; -import eu.teraflow.policy.context.model.ConstraintSlaIsolationLevel; -import eu.teraflow.policy.context.model.ConstraintSlaLatency; -import eu.teraflow.policy.context.model.ConstraintTypeCustom; -import eu.teraflow.policy.context.model.ConstraintTypeEndPointLocation; -import eu.teraflow.policy.context.model.ConstraintTypeSchedule; -import eu.teraflow.policy.context.model.ConstraintTypeSlaAvailability; -import eu.teraflow.policy.context.model.ConstraintTypeSlaCapacity; -import eu.teraflow.policy.context.model.ConstraintTypeSlaIsolationLevel; -import eu.teraflow.policy.context.model.ConstraintTypeSlaLatency; -import eu.teraflow.policy.context.model.EndPointId; -import eu.teraflow.policy.context.model.IsolationLevelEnum; -import eu.teraflow.policy.context.model.Location; -import eu.teraflow.policy.context.model.LocationTypeRegion; -import eu.teraflow.policy.context.model.TopologyId; import io.quarkus.test.junit.QuarkusTest; import java.util.List; +import org.etsi.tfs.policy.context.model.ConstraintCustom; +import org.etsi.tfs.policy.context.model.ConstraintEndPointLocation; +import org.etsi.tfs.policy.context.model.ConstraintSchedule; +import org.etsi.tfs.policy.context.model.ConstraintSlaAvailability; +import org.etsi.tfs.policy.context.model.ConstraintSlaCapacity; +import org.etsi.tfs.policy.context.model.ConstraintSlaIsolationLevel; +import org.etsi.tfs.policy.context.model.ConstraintSlaLatency; +import org.etsi.tfs.policy.context.model.ConstraintTypeCustom; +import org.etsi.tfs.policy.context.model.ConstraintTypeEndPointLocation; +import org.etsi.tfs.policy.context.model.ConstraintTypeSchedule; +import org.etsi.tfs.policy.context.model.ConstraintTypeSlaAvailability; +import org.etsi.tfs.policy.context.model.ConstraintTypeSlaCapacity; +import org.etsi.tfs.policy.context.model.ConstraintTypeSlaIsolationLevel; +import org.etsi.tfs.policy.context.model.ConstraintTypeSlaLatency; +import org.etsi.tfs.policy.context.model.EndPointId; +import org.etsi.tfs.policy.context.model.IsolationLevelEnum; +import org.etsi.tfs.policy.context.model.Location; +import org.etsi.tfs.policy.context.model.LocationTypeRegion; +import org.etsi.tfs.policy.context.model.TopologyId; import org.junit.jupiter.api.Test; @QuarkusTest diff --git a/src/automation/src/test/java/eu/teraflow/automation/EndPointCreationTest.java b/src/policy/src/test/java/org/etsi/tfs/policy/EndPointCreationTest.java similarity index 93% rename from src/automation/src/test/java/eu/teraflow/automation/EndPointCreationTest.java rename to src/policy/src/test/java/org/etsi/tfs/policy/EndPointCreationTest.java index 7f3d749d1aae851bf2cb446e1309384242b031d7..ad6061264bb0d909c3e0702754aed8213280abcd 100644 --- a/src/automation/src/test/java/eu/teraflow/automation/EndPointCreationTest.java +++ b/src/policy/src/test/java/org/etsi/tfs/policy/EndPointCreationTest.java @@ -14,19 +14,19 @@ * limitations under the License. */ -package eu.teraflow.automation; +package org.etsi.tfs.policy; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatExceptionOfType; -import eu.teraflow.automation.context.model.EndPoint; -import eu.teraflow.automation.context.model.EndPointId; -import eu.teraflow.automation.context.model.Location; -import eu.teraflow.automation.context.model.LocationTypeRegion; -import eu.teraflow.automation.context.model.TopologyId; -import eu.teraflow.automation.kpi_sample_types.model.KpiSampleType; import io.quarkus.test.junit.QuarkusTest; import java.util.List; +import org.etsi.tfs.policy.context.model.EndPoint; +import org.etsi.tfs.policy.context.model.EndPointId; +import org.etsi.tfs.policy.context.model.Location; +import org.etsi.tfs.policy.context.model.LocationTypeRegion; +import org.etsi.tfs.policy.context.model.TopologyId; +import org.etsi.tfs.policy.kpi_sample_types.model.KpiSampleType; import org.junit.jupiter.api.Test; @QuarkusTest diff --git a/src/automation/src/test/java/eu/teraflow/automation/LocationTypeTest.java b/src/policy/src/test/java/org/etsi/tfs/policy/LocationTypeTest.java similarity index 87% rename from src/automation/src/test/java/eu/teraflow/automation/LocationTypeTest.java rename to src/policy/src/test/java/org/etsi/tfs/policy/LocationTypeTest.java index 8cc2c06126f5cf0e92fd59680390719ff425f411..f42933115d0e121d39eb6eaeb833b7ff7826fcb5 100644 --- a/src/automation/src/test/java/eu/teraflow/automation/LocationTypeTest.java +++ b/src/policy/src/test/java/org/etsi/tfs/policy/LocationTypeTest.java @@ -14,14 +14,14 @@ * limitations under the License. */ -package eu.teraflow.automation; +package org.etsi.tfs.policy; import static org.assertj.core.api.Assertions.assertThat; -import eu.teraflow.automation.context.model.GpsPosition; -import eu.teraflow.automation.context.model.LocationTypeGpsPosition; -import eu.teraflow.automation.context.model.LocationTypeRegion; import io.quarkus.test.junit.QuarkusTest; +import org.etsi.tfs.policy.context.model.GpsPosition; +import org.etsi.tfs.policy.context.model.LocationTypeGpsPosition; +import org.etsi.tfs.policy.context.model.LocationTypeRegion; import org.junit.jupiter.api.Test; @QuarkusTest diff --git a/src/policy/src/test/java/eu/teraflow/policy/PolicyRuleBasicValidationTest.java b/src/policy/src/test/java/org/etsi/tfs/policy/PolicyRuleBasicValidationTest.java similarity index 96% rename from src/policy/src/test/java/eu/teraflow/policy/PolicyRuleBasicValidationTest.java rename to src/policy/src/test/java/org/etsi/tfs/policy/PolicyRuleBasicValidationTest.java index 6e0f220535a239be4b98c895fd70efa4d05758b0..7f969329345aab2f235daf920b9fa7c045bd89fd 100644 --- a/src/policy/src/test/java/eu/teraflow/policy/PolicyRuleBasicValidationTest.java +++ b/src/policy/src/test/java/org/etsi/tfs/policy/PolicyRuleBasicValidationTest.java @@ -14,26 +14,26 @@ * limitations under the License. */ -package eu.teraflow.policy; +package org.etsi.tfs.policy; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatExceptionOfType; -import eu.teraflow.policy.model.BooleanOperator; -import eu.teraflow.policy.model.NumericalOperator; -import eu.teraflow.policy.model.PolicyRuleAction; -import eu.teraflow.policy.model.PolicyRuleActionConfig; -import eu.teraflow.policy.model.PolicyRuleActionEnum; -import eu.teraflow.policy.model.PolicyRuleBasic; -import eu.teraflow.policy.model.PolicyRuleCondition; -import eu.teraflow.policy.model.PolicyRuleState; -import eu.teraflow.policy.model.PolicyRuleStateEnum; -import eu.teraflow.policy.monitoring.model.IntegerKpiValue; -import eu.teraflow.policy.monitoring.model.KpiValue; import io.quarkus.test.junit.QuarkusTest; import java.util.Collections; import java.util.List; import java.util.UUID; +import org.etsi.tfs.policy.model.BooleanOperator; +import org.etsi.tfs.policy.model.NumericalOperator; +import org.etsi.tfs.policy.model.PolicyRuleAction; +import org.etsi.tfs.policy.model.PolicyRuleActionConfig; +import org.etsi.tfs.policy.model.PolicyRuleActionEnum; +import org.etsi.tfs.policy.model.PolicyRuleBasic; +import org.etsi.tfs.policy.model.PolicyRuleCondition; +import org.etsi.tfs.policy.model.PolicyRuleState; +import org.etsi.tfs.policy.model.PolicyRuleStateEnum; +import org.etsi.tfs.policy.monitoring.model.IntegerKpiValue; +import org.etsi.tfs.policy.monitoring.model.KpiValue; import org.junit.jupiter.api.Test; // TODO: Revisit PolicyRuleBasicValidationTest cases after handling exceptions in PolicyRuleBasic diff --git a/src/policy/src/test/java/eu/teraflow/policy/PolicyRuleConditionValidationTest.java b/src/policy/src/test/java/org/etsi/tfs/policy/PolicyRuleConditionValidationTest.java similarity index 92% rename from src/policy/src/test/java/eu/teraflow/policy/PolicyRuleConditionValidationTest.java rename to src/policy/src/test/java/org/etsi/tfs/policy/PolicyRuleConditionValidationTest.java index fb7cb38abdaa383986215d9692129086332e1a48..d81149725664a91066a30248bda3fdf395b78d78 100644 --- a/src/policy/src/test/java/eu/teraflow/policy/PolicyRuleConditionValidationTest.java +++ b/src/policy/src/test/java/org/etsi/tfs/policy/PolicyRuleConditionValidationTest.java @@ -14,20 +14,20 @@ * limitations under the License. */ -package eu.teraflow.policy; +package org.etsi.tfs.policy; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatExceptionOfType; -import eu.teraflow.policy.model.NumericalOperator; -import eu.teraflow.policy.model.PolicyRuleCondition; -import eu.teraflow.policy.monitoring.model.BooleanKpiValue; -import eu.teraflow.policy.monitoring.model.FloatKpiValue; -import eu.teraflow.policy.monitoring.model.IntegerKpiValue; -import eu.teraflow.policy.monitoring.model.KpiValue; -import eu.teraflow.policy.monitoring.model.StringKpiValue; import io.quarkus.test.junit.QuarkusTest; import java.util.stream.Stream; +import org.etsi.tfs.policy.model.NumericalOperator; +import org.etsi.tfs.policy.model.PolicyRuleCondition; +import org.etsi.tfs.policy.monitoring.model.BooleanKpiValue; +import org.etsi.tfs.policy.monitoring.model.FloatKpiValue; +import org.etsi.tfs.policy.monitoring.model.IntegerKpiValue; +import org.etsi.tfs.policy.monitoring.model.KpiValue; +import org.etsi.tfs.policy.monitoring.model.StringKpiValue; import org.junit.jupiter.api.Test; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; diff --git a/src/policy/src/test/java/eu/teraflow/policy/PolicyRuleDeviceValidationTest.java b/src/policy/src/test/java/org/etsi/tfs/policy/PolicyRuleDeviceValidationTest.java similarity index 91% rename from src/policy/src/test/java/eu/teraflow/policy/PolicyRuleDeviceValidationTest.java rename to src/policy/src/test/java/org/etsi/tfs/policy/PolicyRuleDeviceValidationTest.java index aaaea41f8f292b409328e2e95e8797f9f250f47f..e0e23c8a8b40a4cf48139257f4df540369f5995e 100644 --- a/src/policy/src/test/java/eu/teraflow/policy/PolicyRuleDeviceValidationTest.java +++ b/src/policy/src/test/java/org/etsi/tfs/policy/PolicyRuleDeviceValidationTest.java @@ -14,25 +14,25 @@ * limitations under the License. */ -package eu.teraflow.policy; +package org.etsi.tfs.policy; import static org.assertj.core.api.Assertions.assertThat; -import eu.teraflow.policy.model.BooleanOperator; -import eu.teraflow.policy.model.NumericalOperator; -import eu.teraflow.policy.model.PolicyRuleAction; -import eu.teraflow.policy.model.PolicyRuleActionConfig; -import eu.teraflow.policy.model.PolicyRuleActionEnum; -import eu.teraflow.policy.model.PolicyRuleBasic; -import eu.teraflow.policy.model.PolicyRuleCondition; -import eu.teraflow.policy.model.PolicyRuleDevice; -import eu.teraflow.policy.model.PolicyRuleState; -import eu.teraflow.policy.model.PolicyRuleStateEnum; -import eu.teraflow.policy.monitoring.model.IntegerKpiValue; -import eu.teraflow.policy.monitoring.model.KpiValue; import io.quarkus.test.junit.QuarkusTest; import java.util.List; import java.util.UUID; +import org.etsi.tfs.policy.model.BooleanOperator; +import org.etsi.tfs.policy.model.NumericalOperator; +import org.etsi.tfs.policy.model.PolicyRuleAction; +import org.etsi.tfs.policy.model.PolicyRuleActionConfig; +import org.etsi.tfs.policy.model.PolicyRuleActionEnum; +import org.etsi.tfs.policy.model.PolicyRuleBasic; +import org.etsi.tfs.policy.model.PolicyRuleCondition; +import org.etsi.tfs.policy.model.PolicyRuleDevice; +import org.etsi.tfs.policy.model.PolicyRuleState; +import org.etsi.tfs.policy.model.PolicyRuleStateEnum; +import org.etsi.tfs.policy.monitoring.model.IntegerKpiValue; +import org.etsi.tfs.policy.monitoring.model.KpiValue; import org.junit.jupiter.api.Test; @QuarkusTest diff --git a/src/policy/src/test/java/eu/teraflow/policy/PolicyRuleServiceValidationTest.java b/src/policy/src/test/java/org/etsi/tfs/policy/PolicyRuleServiceValidationTest.java similarity index 88% rename from src/policy/src/test/java/eu/teraflow/policy/PolicyRuleServiceValidationTest.java rename to src/policy/src/test/java/org/etsi/tfs/policy/PolicyRuleServiceValidationTest.java index 95819965e77a4ba61d13ee240594e37c1eb4cd74..40094436c4d198450cecbdd512418d6b1df4b74e 100644 --- a/src/policy/src/test/java/eu/teraflow/policy/PolicyRuleServiceValidationTest.java +++ b/src/policy/src/test/java/org/etsi/tfs/policy/PolicyRuleServiceValidationTest.java @@ -14,46 +14,46 @@ * limitations under the License. */ -package eu.teraflow.policy; +package org.etsi.tfs.policy; import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.ArgumentMatchers.anyString; import static org.mockito.Mockito.when; -import eu.teraflow.policy.context.ContextService; -import eu.teraflow.policy.context.model.ConfigActionEnum; -import eu.teraflow.policy.context.model.ConfigRule; -import eu.teraflow.policy.context.model.ConfigRuleCustom; -import eu.teraflow.policy.context.model.ConfigRuleTypeCustom; -import eu.teraflow.policy.context.model.Device; -import eu.teraflow.policy.context.model.DeviceConfig; -import eu.teraflow.policy.context.model.DeviceDriverEnum; -import eu.teraflow.policy.context.model.DeviceOperationalStatus; -import eu.teraflow.policy.context.model.EndPoint.EndPointBuilder; -import eu.teraflow.policy.context.model.EndPointId; -import eu.teraflow.policy.context.model.Location; -import eu.teraflow.policy.context.model.LocationTypeRegion; -import eu.teraflow.policy.context.model.ServiceId; -import eu.teraflow.policy.context.model.TopologyId; -import eu.teraflow.policy.kpi_sample_types.model.KpiSampleType; -import eu.teraflow.policy.model.BooleanOperator; -import eu.teraflow.policy.model.NumericalOperator; -import eu.teraflow.policy.model.PolicyRuleAction; -import eu.teraflow.policy.model.PolicyRuleActionConfig; -import eu.teraflow.policy.model.PolicyRuleActionEnum; -import eu.teraflow.policy.model.PolicyRuleBasic; -import eu.teraflow.policy.model.PolicyRuleCondition; -import eu.teraflow.policy.model.PolicyRuleService; -import eu.teraflow.policy.model.PolicyRuleState; -import eu.teraflow.policy.model.PolicyRuleStateEnum; -import eu.teraflow.policy.monitoring.model.IntegerKpiValue; -import eu.teraflow.policy.monitoring.model.KpiValue; import io.quarkus.test.junit.QuarkusTest; import io.smallrye.mutiny.Uni; import java.util.Collections; import java.util.List; import java.util.UUID; import javax.inject.Inject; +import org.etsi.tfs.policy.context.ContextService; +import org.etsi.tfs.policy.context.model.ConfigActionEnum; +import org.etsi.tfs.policy.context.model.ConfigRule; +import org.etsi.tfs.policy.context.model.ConfigRuleCustom; +import org.etsi.tfs.policy.context.model.ConfigRuleTypeCustom; +import org.etsi.tfs.policy.context.model.Device; +import org.etsi.tfs.policy.context.model.DeviceConfig; +import org.etsi.tfs.policy.context.model.DeviceDriverEnum; +import org.etsi.tfs.policy.context.model.DeviceOperationalStatus; +import org.etsi.tfs.policy.context.model.EndPoint.EndPointBuilder; +import org.etsi.tfs.policy.context.model.EndPointId; +import org.etsi.tfs.policy.context.model.Location; +import org.etsi.tfs.policy.context.model.LocationTypeRegion; +import org.etsi.tfs.policy.context.model.ServiceId; +import org.etsi.tfs.policy.context.model.TopologyId; +import org.etsi.tfs.policy.kpi_sample_types.model.KpiSampleType; +import org.etsi.tfs.policy.model.BooleanOperator; +import org.etsi.tfs.policy.model.NumericalOperator; +import org.etsi.tfs.policy.model.PolicyRuleAction; +import org.etsi.tfs.policy.model.PolicyRuleActionConfig; +import org.etsi.tfs.policy.model.PolicyRuleActionEnum; +import org.etsi.tfs.policy.model.PolicyRuleBasic; +import org.etsi.tfs.policy.model.PolicyRuleCondition; +import org.etsi.tfs.policy.model.PolicyRuleService; +import org.etsi.tfs.policy.model.PolicyRuleState; +import org.etsi.tfs.policy.model.PolicyRuleStateEnum; +import org.etsi.tfs.policy.monitoring.model.IntegerKpiValue; +import org.etsi.tfs.policy.monitoring.model.KpiValue; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.mockito.Mockito; diff --git a/src/policy/src/test/java/eu/teraflow/policy/PolicyServiceTest.java b/src/policy/src/test/java/org/etsi/tfs/policy/PolicyServiceTest.java similarity index 96% rename from src/policy/src/test/java/eu/teraflow/policy/PolicyServiceTest.java rename to src/policy/src/test/java/org/etsi/tfs/policy/PolicyServiceTest.java index 2f5266c9591144fe4ab70bf38f7cc3943ef4cdd9..2d1a425a8d4166779d7e18e5deaecb9ff9ec49ca 100644 --- a/src/policy/src/test/java/eu/teraflow/policy/PolicyServiceTest.java +++ b/src/policy/src/test/java/org/etsi/tfs/policy/PolicyServiceTest.java @@ -14,14 +14,12 @@ * limitations under the License. */ -package eu.teraflow.policy; +package org.etsi.tfs.policy; import static org.assertj.core.api.Assertions.assertThat; import context.ContextOuterClass; import context.ContextOuterClass.Uuid; -import eu.teraflow.policy.monitoring.model.FloatKpiValue; -import eu.teraflow.policy.monitoring.model.IntegerKpiValue; import io.quarkus.grpc.GrpcClient; import io.quarkus.test.junit.QuarkusTest; import java.util.List; @@ -32,6 +30,8 @@ import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeoutException; import javax.inject.Inject; import monitoring.Monitoring.KpiId; +import org.etsi.tfs.policy.monitoring.model.FloatKpiValue; +import org.etsi.tfs.policy.monitoring.model.IntegerKpiValue; import org.jboss.logging.Logger; import org.junit.jupiter.api.Test; import policy.Policy; @@ -112,13 +112,13 @@ class PolicyServiceTest { final var expectedPolicyRuleConditions = List.of(firstExpectedPolicyRuleCondition, secondExpectedPolicyRuleCondition); - eu.teraflow.policy.model.PolicyRuleActionConfig policyRuleActionConfig_1 = - new eu.teraflow.policy.model.PolicyRuleActionConfig("paramater1", "parameter2"); + org.etsi.tfs.policy.model.PolicyRuleActionConfig policyRuleActionConfig_1 = + new org.etsi.tfs.policy.model.PolicyRuleActionConfig("paramater1", "parameter2"); final var serializedPolicyRuleActionConfigList_1 = serializer.serialize(policyRuleActionConfig_1); - eu.teraflow.policy.model.PolicyRuleActionConfig policyRuleActionConfig_2 = - new eu.teraflow.policy.model.PolicyRuleActionConfig("paramater3", "parameter4"); + org.etsi.tfs.policy.model.PolicyRuleActionConfig policyRuleActionConfig_2 = + new org.etsi.tfs.policy.model.PolicyRuleActionConfig("paramater3", "parameter4"); final var serializedPolicyRuleActionConfigList_2 = serializer.serialize(policyRuleActionConfig_2); diff --git a/src/policy/src/test/java/eu/teraflow/policy/SerializerTest.java b/src/policy/src/test/java/org/etsi/tfs/policy/SerializerTest.java similarity index 97% rename from src/policy/src/test/java/eu/teraflow/policy/SerializerTest.java rename to src/policy/src/test/java/org/etsi/tfs/policy/SerializerTest.java index 32055a1820365ffc0f048fa70e99df5f3369fd81..f29ae3697a8842c14dc28716e325adc85a5c45af 100644 --- a/src/policy/src/test/java/eu/teraflow/policy/SerializerTest.java +++ b/src/policy/src/test/java/org/etsi/tfs/policy/SerializerTest.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package eu.teraflow.policy; +package org.etsi.tfs.policy; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatExceptionOfType; @@ -25,79 +25,6 @@ import context.ContextOuterClass.ContextId; import context.ContextOuterClass.DeviceId; import context.ContextOuterClass.DeviceOperationalStatusEnum; import context.ContextOuterClass.Uuid; -import eu.teraflow.policy.acl.AclAction; -import eu.teraflow.policy.acl.AclEntry; -import eu.teraflow.policy.acl.AclForwardActionEnum; -import eu.teraflow.policy.acl.AclLogActionEnum; -import eu.teraflow.policy.acl.AclMatch; -import eu.teraflow.policy.acl.AclRuleSet; -import eu.teraflow.policy.acl.AclRuleTypeEnum; -import eu.teraflow.policy.context.model.ConfigActionEnum; -import eu.teraflow.policy.context.model.ConfigRule; -import eu.teraflow.policy.context.model.ConfigRuleAcl; -import eu.teraflow.policy.context.model.ConfigRuleCustom; -import eu.teraflow.policy.context.model.ConfigRuleTypeAcl; -import eu.teraflow.policy.context.model.ConfigRuleTypeCustom; -import eu.teraflow.policy.context.model.Constraint; -import eu.teraflow.policy.context.model.ConstraintCustom; -import eu.teraflow.policy.context.model.ConstraintEndPointLocation; -import eu.teraflow.policy.context.model.ConstraintSchedule; -import eu.teraflow.policy.context.model.ConstraintSlaAvailability; -import eu.teraflow.policy.context.model.ConstraintSlaCapacity; -import eu.teraflow.policy.context.model.ConstraintSlaIsolationLevel; -import eu.teraflow.policy.context.model.ConstraintSlaLatency; -import eu.teraflow.policy.context.model.ConstraintTypeCustom; -import eu.teraflow.policy.context.model.ConstraintTypeEndPointLocation; -import eu.teraflow.policy.context.model.ConstraintTypeSchedule; -import eu.teraflow.policy.context.model.ConstraintTypeSlaAvailability; -import eu.teraflow.policy.context.model.ConstraintTypeSlaCapacity; -import eu.teraflow.policy.context.model.ConstraintTypeSlaIsolationLevel; -import eu.teraflow.policy.context.model.ConstraintTypeSlaLatency; -import eu.teraflow.policy.context.model.Device; -import eu.teraflow.policy.context.model.DeviceConfig; -import eu.teraflow.policy.context.model.DeviceDriverEnum; -import eu.teraflow.policy.context.model.DeviceOperationalStatus; -import eu.teraflow.policy.context.model.Empty; -import eu.teraflow.policy.context.model.EndPoint.EndPointBuilder; -import eu.teraflow.policy.context.model.EndPointId; -import eu.teraflow.policy.context.model.Event; -import eu.teraflow.policy.context.model.EventTypeEnum; -import eu.teraflow.policy.context.model.GpsPosition; -import eu.teraflow.policy.context.model.IsolationLevelEnum; -import eu.teraflow.policy.context.model.Location; -import eu.teraflow.policy.context.model.LocationTypeGpsPosition; -import eu.teraflow.policy.context.model.LocationTypeRegion; -import eu.teraflow.policy.context.model.Service; -import eu.teraflow.policy.context.model.ServiceConfig; -import eu.teraflow.policy.context.model.ServiceId; -import eu.teraflow.policy.context.model.ServiceStatus; -import eu.teraflow.policy.context.model.ServiceStatusEnum; -import eu.teraflow.policy.context.model.ServiceTypeEnum; -import eu.teraflow.policy.context.model.SliceId; -import eu.teraflow.policy.context.model.TopologyId; -import eu.teraflow.policy.kpi_sample_types.model.KpiSampleType; -import eu.teraflow.policy.model.BooleanOperator; -import eu.teraflow.policy.model.NumericalOperator; -import eu.teraflow.policy.model.PolicyRuleAction; -import eu.teraflow.policy.model.PolicyRuleActionConfig; -import eu.teraflow.policy.model.PolicyRuleActionEnum; -import eu.teraflow.policy.model.PolicyRuleBasic; -import eu.teraflow.policy.model.PolicyRuleCondition; -import eu.teraflow.policy.model.PolicyRuleDevice; -import eu.teraflow.policy.model.PolicyRuleService; -import eu.teraflow.policy.model.PolicyRuleState; -import eu.teraflow.policy.model.PolicyRuleStateEnum; -import eu.teraflow.policy.monitoring.model.AlarmDescriptor; -import eu.teraflow.policy.monitoring.model.AlarmResponse; -import eu.teraflow.policy.monitoring.model.BooleanKpiValue; -import eu.teraflow.policy.monitoring.model.FloatKpiValue; -import eu.teraflow.policy.monitoring.model.IntegerKpiValue; -import eu.teraflow.policy.monitoring.model.Kpi; -import eu.teraflow.policy.monitoring.model.KpiDescriptor; -import eu.teraflow.policy.monitoring.model.KpiValue; -import eu.teraflow.policy.monitoring.model.KpiValueRange; -import eu.teraflow.policy.monitoring.model.StringKpiValue; -import eu.teraflow.policy.monitoring.model.SubsDescriptor; import io.quarkus.test.junit.QuarkusTest; import java.util.List; import java.util.stream.Collectors; @@ -107,6 +34,79 @@ import kpi_sample_types.KpiSampleTypes; import monitoring.Monitoring; import monitoring.Monitoring.AlarmID; import monitoring.Monitoring.KpiId; +import org.etsi.tfs.policy.acl.AclAction; +import org.etsi.tfs.policy.acl.AclEntry; +import org.etsi.tfs.policy.acl.AclForwardActionEnum; +import org.etsi.tfs.policy.acl.AclLogActionEnum; +import org.etsi.tfs.policy.acl.AclMatch; +import org.etsi.tfs.policy.acl.AclRuleSet; +import org.etsi.tfs.policy.acl.AclRuleTypeEnum; +import org.etsi.tfs.policy.context.model.ConfigActionEnum; +import org.etsi.tfs.policy.context.model.ConfigRule; +import org.etsi.tfs.policy.context.model.ConfigRuleAcl; +import org.etsi.tfs.policy.context.model.ConfigRuleCustom; +import org.etsi.tfs.policy.context.model.ConfigRuleTypeAcl; +import org.etsi.tfs.policy.context.model.ConfigRuleTypeCustom; +import org.etsi.tfs.policy.context.model.Constraint; +import org.etsi.tfs.policy.context.model.ConstraintCustom; +import org.etsi.tfs.policy.context.model.ConstraintEndPointLocation; +import org.etsi.tfs.policy.context.model.ConstraintSchedule; +import org.etsi.tfs.policy.context.model.ConstraintSlaAvailability; +import org.etsi.tfs.policy.context.model.ConstraintSlaCapacity; +import org.etsi.tfs.policy.context.model.ConstraintSlaIsolationLevel; +import org.etsi.tfs.policy.context.model.ConstraintSlaLatency; +import org.etsi.tfs.policy.context.model.ConstraintTypeCustom; +import org.etsi.tfs.policy.context.model.ConstraintTypeEndPointLocation; +import org.etsi.tfs.policy.context.model.ConstraintTypeSchedule; +import org.etsi.tfs.policy.context.model.ConstraintTypeSlaAvailability; +import org.etsi.tfs.policy.context.model.ConstraintTypeSlaCapacity; +import org.etsi.tfs.policy.context.model.ConstraintTypeSlaIsolationLevel; +import org.etsi.tfs.policy.context.model.ConstraintTypeSlaLatency; +import org.etsi.tfs.policy.context.model.Device; +import org.etsi.tfs.policy.context.model.DeviceConfig; +import org.etsi.tfs.policy.context.model.DeviceDriverEnum; +import org.etsi.tfs.policy.context.model.DeviceOperationalStatus; +import org.etsi.tfs.policy.context.model.Empty; +import org.etsi.tfs.policy.context.model.EndPoint.EndPointBuilder; +import org.etsi.tfs.policy.context.model.EndPointId; +import org.etsi.tfs.policy.context.model.Event; +import org.etsi.tfs.policy.context.model.EventTypeEnum; +import org.etsi.tfs.policy.context.model.GpsPosition; +import org.etsi.tfs.policy.context.model.IsolationLevelEnum; +import org.etsi.tfs.policy.context.model.Location; +import org.etsi.tfs.policy.context.model.LocationTypeGpsPosition; +import org.etsi.tfs.policy.context.model.LocationTypeRegion; +import org.etsi.tfs.policy.context.model.Service; +import org.etsi.tfs.policy.context.model.ServiceConfig; +import org.etsi.tfs.policy.context.model.ServiceId; +import org.etsi.tfs.policy.context.model.ServiceStatus; +import org.etsi.tfs.policy.context.model.ServiceStatusEnum; +import org.etsi.tfs.policy.context.model.ServiceTypeEnum; +import org.etsi.tfs.policy.context.model.SliceId; +import org.etsi.tfs.policy.context.model.TopologyId; +import org.etsi.tfs.policy.kpi_sample_types.model.KpiSampleType; +import org.etsi.tfs.policy.model.BooleanOperator; +import org.etsi.tfs.policy.model.NumericalOperator; +import org.etsi.tfs.policy.model.PolicyRuleAction; +import org.etsi.tfs.policy.model.PolicyRuleActionConfig; +import org.etsi.tfs.policy.model.PolicyRuleActionEnum; +import org.etsi.tfs.policy.model.PolicyRuleBasic; +import org.etsi.tfs.policy.model.PolicyRuleCondition; +import org.etsi.tfs.policy.model.PolicyRuleDevice; +import org.etsi.tfs.policy.model.PolicyRuleService; +import org.etsi.tfs.policy.model.PolicyRuleState; +import org.etsi.tfs.policy.model.PolicyRuleStateEnum; +import org.etsi.tfs.policy.monitoring.model.AlarmDescriptor; +import org.etsi.tfs.policy.monitoring.model.AlarmResponse; +import org.etsi.tfs.policy.monitoring.model.BooleanKpiValue; +import org.etsi.tfs.policy.monitoring.model.FloatKpiValue; +import org.etsi.tfs.policy.monitoring.model.IntegerKpiValue; +import org.etsi.tfs.policy.monitoring.model.Kpi; +import org.etsi.tfs.policy.monitoring.model.KpiDescriptor; +import org.etsi.tfs.policy.monitoring.model.KpiValue; +import org.etsi.tfs.policy.monitoring.model.KpiValueRange; +import org.etsi.tfs.policy.monitoring.model.StringKpiValue; +import org.etsi.tfs.policy.monitoring.model.SubsDescriptor; import org.junit.jupiter.api.Test; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; @@ -862,7 +862,7 @@ class SerializerTest { final var aclRuleSet = new AclRuleSet( "aclRuleName", - eu.teraflow.policy.acl.AclRuleTypeEnum.IPV4, + org.etsi.tfs.policy.acl.AclRuleTypeEnum.IPV4, "AclRuleDescription", "userId", List.of(aclEntry)); @@ -2218,6 +2218,12 @@ class SerializerTest { Arguments.of( KpiSampleType.BYTES_RECEIVED, KpiSampleTypes.KpiSampleType.KPISAMPLETYPE_BYTES_RECEIVED), + Arguments.of( + KpiSampleType.LINK_TOTAL_CAPACITY_GBPS, + KpiSampleTypes.KpiSampleType.KPISAMPLETYPE_LINK_TOTAL_CAPACITY_GBPS), + Arguments.of( + KpiSampleType.LINK_USED_CAPACITY_GBPS, + KpiSampleTypes.KpiSampleType.KPISAMPLETYPE_LINK_USED_CAPACITY_GBPS), Arguments.of(KpiSampleType.UNKNOWN, KpiSampleTypes.KpiSampleType.KPISAMPLETYPE_UNKNOWN)); } @@ -3602,8 +3608,8 @@ class SerializerTest { DeviceDriverEnum.IETF_NETWORK_TOPOLOGY, ContextOuterClass.DeviceDriverEnum.DEVICEDRIVER_IETF_NETWORK_TOPOLOGY), Arguments.of( - DeviceDriverEnum.ONF_TR_352, - ContextOuterClass.DeviceDriverEnum.DEVICEDRIVER_ONF_TR_352), + DeviceDriverEnum.ONF_TR_532, + ContextOuterClass.DeviceDriverEnum.DEVICEDRIVER_ONF_TR_532), Arguments.of(DeviceDriverEnum.XR, ContextOuterClass.DeviceDriverEnum.DEVICEDRIVER_XR), Arguments.of( DeviceDriverEnum.IETF_L2VPN, diff --git a/src/policy/target/generated-sources/grpc/context/ContextOuterClass.java b/src/policy/target/generated-sources/grpc/context/ContextOuterClass.java index a605e30de68ae66866a78d53863412937ceea890..a25798b884d9006f9c1b218c133634784f8bf392 100644 --- a/src/policy/target/generated-sources/grpc/context/ContextOuterClass.java +++ b/src/policy/target/generated-sources/grpc/context/ContextOuterClass.java @@ -170,9 +170,9 @@ public final class ContextOuterClass { */ DEVICEDRIVER_IETF_NETWORK_TOPOLOGY(4), /** - * DEVICEDRIVER_ONF_TR_352 = 5; + * DEVICEDRIVER_ONF_TR_532 = 5; */ - DEVICEDRIVER_ONF_TR_352(5), + DEVICEDRIVER_ONF_TR_532(5), /** * DEVICEDRIVER_XR = 6; */ @@ -213,9 +213,9 @@ public final class ContextOuterClass { */ public static final int DEVICEDRIVER_IETF_NETWORK_TOPOLOGY_VALUE = 4; /** - * DEVICEDRIVER_ONF_TR_352 = 5; + * DEVICEDRIVER_ONF_TR_532 = 5; */ - public static final int DEVICEDRIVER_ONF_TR_352_VALUE = 5; + public static final int DEVICEDRIVER_ONF_TR_532_VALUE = 5; /** * DEVICEDRIVER_XR = 6; */ @@ -259,7 +259,7 @@ public final class ContextOuterClass { case 2: return DEVICEDRIVER_TRANSPORT_API; case 3: return DEVICEDRIVER_P4; case 4: return DEVICEDRIVER_IETF_NETWORK_TOPOLOGY; - case 5: return DEVICEDRIVER_ONF_TR_352; + case 5: return DEVICEDRIVER_ONF_TR_532; case 6: return DEVICEDRIVER_XR; case 7: return DEVICEDRIVER_IETF_L2VPN; case 8: return DEVICEDRIVER_GNMI_OPENCONFIG; @@ -457,6 +457,10 @@ public final class ContextOuterClass { * SERVICETYPE_TAPI_CONNECTIVITY_SERVICE = 3; */ SERVICETYPE_TAPI_CONNECTIVITY_SERVICE(3), + /** + * SERVICETYPE_TE = 4; + */ + SERVICETYPE_TE(4), UNRECOGNIZED(-1), ; @@ -476,6 +480,10 @@ public final class ContextOuterClass { * SERVICETYPE_TAPI_CONNECTIVITY_SERVICE = 3; */ public static final int SERVICETYPE_TAPI_CONNECTIVITY_SERVICE_VALUE = 3; + /** + * SERVICETYPE_TE = 4; + */ + public static final int SERVICETYPE_TE_VALUE = 4; public final int getNumber() { @@ -506,6 +514,7 @@ public final class ContextOuterClass { case 1: return SERVICETYPE_L3NM; case 2: return SERVICETYPE_L2NM; case 3: return SERVICETYPE_TAPI_CONNECTIVITY_SERVICE; + case 4: return SERVICETYPE_TE; default: return null; } } @@ -15641,43 +15650,43 @@ public final class ContextOuterClass { * Used for inventory * * - * repeated .context.Component component = 8; + * repeated .context.Component components = 8; */ java.util.List - getComponentList(); + getComponentsList(); /** *
      * Used for inventory
      * 
* - * repeated .context.Component component = 8; + * repeated .context.Component components = 8; */ - context.ContextOuterClass.Component getComponent(int index); + context.ContextOuterClass.Component getComponents(int index); /** *
      * Used for inventory
      * 
* - * repeated .context.Component component = 8; + * repeated .context.Component components = 8; */ - int getComponentCount(); + int getComponentsCount(); /** *
      * Used for inventory
      * 
* - * repeated .context.Component component = 8; + * repeated .context.Component components = 8; */ java.util.List - getComponentOrBuilderList(); + getComponentsOrBuilderList(); /** *
      * Used for inventory
      * 
* - * repeated .context.Component component = 8; + * repeated .context.Component components = 8; */ - context.ContextOuterClass.ComponentOrBuilder getComponentOrBuilder( + context.ContextOuterClass.ComponentOrBuilder getComponentsOrBuilder( int index); /** @@ -15725,7 +15734,7 @@ public final class ContextOuterClass { deviceOperationalStatus_ = 0; deviceDrivers_ = java.util.Collections.emptyList(); deviceEndpoints_ = java.util.Collections.emptyList(); - component_ = java.util.Collections.emptyList(); + components_ = java.util.Collections.emptyList(); } @java.lang.Override @@ -15837,10 +15846,10 @@ public final class ContextOuterClass { } case 66: { if (!((mutable_bitField0_ & 0x00000004) != 0)) { - component_ = new java.util.ArrayList(); + components_ = new java.util.ArrayList(); mutable_bitField0_ |= 0x00000004; } - component_.add( + components_.add( input.readMessage(context.ContextOuterClass.Component.parser(), extensionRegistry)); break; } @@ -15879,7 +15888,7 @@ public final class ContextOuterClass { deviceEndpoints_ = java.util.Collections.unmodifiableList(deviceEndpoints_); } if (((mutable_bitField0_ & 0x00000004) != 0)) { - component_ = java.util.Collections.unmodifiableList(component_); + components_ = java.util.Collections.unmodifiableList(components_); } this.unknownFields = unknownFields.build(); makeExtensionsImmutable(); @@ -16143,64 +16152,64 @@ public final class ContextOuterClass { return deviceEndpoints_.get(index); } - public static final int COMPONENT_FIELD_NUMBER = 8; - private java.util.List component_; + public static final int COMPONENTS_FIELD_NUMBER = 8; + private java.util.List components_; /** *
      * Used for inventory
      * 
* - * repeated .context.Component component = 8; + * repeated .context.Component components = 8; */ @java.lang.Override - public java.util.List getComponentList() { - return component_; + public java.util.List getComponentsList() { + return components_; } /** *
      * Used for inventory
      * 
* - * repeated .context.Component component = 8; + * repeated .context.Component components = 8; */ @java.lang.Override public java.util.List - getComponentOrBuilderList() { - return component_; + getComponentsOrBuilderList() { + return components_; } /** *
      * Used for inventory
      * 
* - * repeated .context.Component component = 8; + * repeated .context.Component components = 8; */ @java.lang.Override - public int getComponentCount() { - return component_.size(); + public int getComponentsCount() { + return components_.size(); } /** *
      * Used for inventory
      * 
* - * repeated .context.Component component = 8; + * repeated .context.Component components = 8; */ @java.lang.Override - public context.ContextOuterClass.Component getComponent(int index) { - return component_.get(index); + public context.ContextOuterClass.Component getComponents(int index) { + return components_.get(index); } /** *
      * Used for inventory
      * 
* - * repeated .context.Component component = 8; + * repeated .context.Component components = 8; */ @java.lang.Override - public context.ContextOuterClass.ComponentOrBuilder getComponentOrBuilder( + public context.ContextOuterClass.ComponentOrBuilder getComponentsOrBuilder( int index) { - return component_.get(index); + return components_.get(index); } public static final int CONTROLLER_ID_FIELD_NUMBER = 9; @@ -16281,8 +16290,8 @@ public final class ContextOuterClass { for (int i = 0; i < deviceEndpoints_.size(); i++) { output.writeMessage(7, deviceEndpoints_.get(i)); } - for (int i = 0; i < component_.size(); i++) { - output.writeMessage(8, component_.get(i)); + for (int i = 0; i < components_.size(); i++) { + output.writeMessage(8, components_.get(i)); } if (controllerId_ != null) { output.writeMessage(9, getControllerId()); @@ -16330,9 +16339,9 @@ public final class ContextOuterClass { size += com.google.protobuf.CodedOutputStream .computeMessageSize(7, deviceEndpoints_.get(i)); } - for (int i = 0; i < component_.size(); i++) { + for (int i = 0; i < components_.size(); i++) { size += com.google.protobuf.CodedOutputStream - .computeMessageSize(8, component_.get(i)); + .computeMessageSize(8, components_.get(i)); } if (controllerId_ != null) { size += com.google.protobuf.CodedOutputStream @@ -16371,8 +16380,8 @@ public final class ContextOuterClass { if (!deviceDrivers_.equals(other.deviceDrivers_)) return false; if (!getDeviceEndpointsList() .equals(other.getDeviceEndpointsList())) return false; - if (!getComponentList() - .equals(other.getComponentList())) return false; + if (!getComponentsList() + .equals(other.getComponentsList())) return false; if (hasControllerId() != other.hasControllerId()) return false; if (hasControllerId()) { if (!getControllerId() @@ -16411,9 +16420,9 @@ public final class ContextOuterClass { hash = (37 * hash) + DEVICE_ENDPOINTS_FIELD_NUMBER; hash = (53 * hash) + getDeviceEndpointsList().hashCode(); } - if (getComponentCount() > 0) { - hash = (37 * hash) + COMPONENT_FIELD_NUMBER; - hash = (53 * hash) + getComponentList().hashCode(); + if (getComponentsCount() > 0) { + hash = (37 * hash) + COMPONENTS_FIELD_NUMBER; + hash = (53 * hash) + getComponentsList().hashCode(); } if (hasControllerId()) { hash = (37 * hash) + CONTROLLER_ID_FIELD_NUMBER; @@ -16548,7 +16557,7 @@ public final class ContextOuterClass { if (com.google.protobuf.GeneratedMessageV3 .alwaysUseFieldBuilders) { getDeviceEndpointsFieldBuilder(); - getComponentFieldBuilder(); + getComponentsFieldBuilder(); } } @java.lang.Override @@ -16580,11 +16589,11 @@ public final class ContextOuterClass { } else { deviceEndpointsBuilder_.clear(); } - if (componentBuilder_ == null) { - component_ = java.util.Collections.emptyList(); + if (componentsBuilder_ == null) { + components_ = java.util.Collections.emptyList(); bitField0_ = (bitField0_ & ~0x00000004); } else { - componentBuilder_.clear(); + componentsBuilder_.clear(); } if (controllerIdBuilder_ == null) { controllerId_ = null; @@ -16646,14 +16655,14 @@ public final class ContextOuterClass { } else { result.deviceEndpoints_ = deviceEndpointsBuilder_.build(); } - if (componentBuilder_ == null) { + if (componentsBuilder_ == null) { if (((bitField0_ & 0x00000004) != 0)) { - component_ = java.util.Collections.unmodifiableList(component_); + components_ = java.util.Collections.unmodifiableList(components_); bitField0_ = (bitField0_ & ~0x00000004); } - result.component_ = component_; + result.components_ = components_; } else { - result.component_ = componentBuilder_.build(); + result.components_ = componentsBuilder_.build(); } if (controllerIdBuilder_ == null) { result.controllerId_ = controllerId_; @@ -16761,29 +16770,29 @@ public final class ContextOuterClass { } } } - if (componentBuilder_ == null) { - if (!other.component_.isEmpty()) { - if (component_.isEmpty()) { - component_ = other.component_; + if (componentsBuilder_ == null) { + if (!other.components_.isEmpty()) { + if (components_.isEmpty()) { + components_ = other.components_; bitField0_ = (bitField0_ & ~0x00000004); } else { - ensureComponentIsMutable(); - component_.addAll(other.component_); + ensureComponentsIsMutable(); + components_.addAll(other.components_); } onChanged(); } } else { - if (!other.component_.isEmpty()) { - if (componentBuilder_.isEmpty()) { - componentBuilder_.dispose(); - componentBuilder_ = null; - component_ = other.component_; + if (!other.components_.isEmpty()) { + if (componentsBuilder_.isEmpty()) { + componentsBuilder_.dispose(); + componentsBuilder_ = null; + components_ = other.components_; bitField0_ = (bitField0_ & ~0x00000004); - componentBuilder_ = + componentsBuilder_ = com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getComponentFieldBuilder() : null; + getComponentsFieldBuilder() : null; } else { - componentBuilder_.addAllMessages(other.component_); + componentsBuilder_.addAllMessages(other.components_); } } } @@ -17644,30 +17653,30 @@ public final class ContextOuterClass { return deviceEndpointsBuilder_; } - private java.util.List component_ = + private java.util.List components_ = java.util.Collections.emptyList(); - private void ensureComponentIsMutable() { + private void ensureComponentsIsMutable() { if (!((bitField0_ & 0x00000004) != 0)) { - component_ = new java.util.ArrayList(component_); + components_ = new java.util.ArrayList(components_); bitField0_ |= 0x00000004; } } private com.google.protobuf.RepeatedFieldBuilderV3< - context.ContextOuterClass.Component, context.ContextOuterClass.Component.Builder, context.ContextOuterClass.ComponentOrBuilder> componentBuilder_; + context.ContextOuterClass.Component, context.ContextOuterClass.Component.Builder, context.ContextOuterClass.ComponentOrBuilder> componentsBuilder_; /** *
        * Used for inventory
        * 
* - * repeated .context.Component component = 8; + * repeated .context.Component components = 8; */ - public java.util.List getComponentList() { - if (componentBuilder_ == null) { - return java.util.Collections.unmodifiableList(component_); + public java.util.List getComponentsList() { + if (componentsBuilder_ == null) { + return java.util.Collections.unmodifiableList(components_); } else { - return componentBuilder_.getMessageList(); + return componentsBuilder_.getMessageList(); } } /** @@ -17675,13 +17684,13 @@ public final class ContextOuterClass { * Used for inventory * * - * repeated .context.Component component = 8; + * repeated .context.Component components = 8; */ - public int getComponentCount() { - if (componentBuilder_ == null) { - return component_.size(); + public int getComponentsCount() { + if (componentsBuilder_ == null) { + return components_.size(); } else { - return componentBuilder_.getCount(); + return componentsBuilder_.getCount(); } } /** @@ -17689,13 +17698,13 @@ public final class ContextOuterClass { * Used for inventory * * - * repeated .context.Component component = 8; + * repeated .context.Component components = 8; */ - public context.ContextOuterClass.Component getComponent(int index) { - if (componentBuilder_ == null) { - return component_.get(index); + public context.ContextOuterClass.Component getComponents(int index) { + if (componentsBuilder_ == null) { + return components_.get(index); } else { - return componentBuilder_.getMessage(index); + return componentsBuilder_.getMessage(index); } } /** @@ -17703,19 +17712,19 @@ public final class ContextOuterClass { * Used for inventory * * - * repeated .context.Component component = 8; + * repeated .context.Component components = 8; */ - public Builder setComponent( + public Builder setComponents( int index, context.ContextOuterClass.Component value) { - if (componentBuilder_ == null) { + if (componentsBuilder_ == null) { if (value == null) { throw new NullPointerException(); } - ensureComponentIsMutable(); - component_.set(index, value); + ensureComponentsIsMutable(); + components_.set(index, value); onChanged(); } else { - componentBuilder_.setMessage(index, value); + componentsBuilder_.setMessage(index, value); } return this; } @@ -17724,16 +17733,16 @@ public final class ContextOuterClass { * Used for inventory * * - * repeated .context.Component component = 8; + * repeated .context.Component components = 8; */ - public Builder setComponent( + public Builder setComponents( int index, context.ContextOuterClass.Component.Builder builderForValue) { - if (componentBuilder_ == null) { - ensureComponentIsMutable(); - component_.set(index, builderForValue.build()); + if (componentsBuilder_ == null) { + ensureComponentsIsMutable(); + components_.set(index, builderForValue.build()); onChanged(); } else { - componentBuilder_.setMessage(index, builderForValue.build()); + componentsBuilder_.setMessage(index, builderForValue.build()); } return this; } @@ -17742,18 +17751,18 @@ public final class ContextOuterClass { * Used for inventory * * - * repeated .context.Component component = 8; + * repeated .context.Component components = 8; */ - public Builder addComponent(context.ContextOuterClass.Component value) { - if (componentBuilder_ == null) { + public Builder addComponents(context.ContextOuterClass.Component value) { + if (componentsBuilder_ == null) { if (value == null) { throw new NullPointerException(); } - ensureComponentIsMutable(); - component_.add(value); + ensureComponentsIsMutable(); + components_.add(value); onChanged(); } else { - componentBuilder_.addMessage(value); + componentsBuilder_.addMessage(value); } return this; } @@ -17762,19 +17771,19 @@ public final class ContextOuterClass { * Used for inventory * * - * repeated .context.Component component = 8; + * repeated .context.Component components = 8; */ - public Builder addComponent( + public Builder addComponents( int index, context.ContextOuterClass.Component value) { - if (componentBuilder_ == null) { + if (componentsBuilder_ == null) { if (value == null) { throw new NullPointerException(); } - ensureComponentIsMutable(); - component_.add(index, value); + ensureComponentsIsMutable(); + components_.add(index, value); onChanged(); } else { - componentBuilder_.addMessage(index, value); + componentsBuilder_.addMessage(index, value); } return this; } @@ -17783,16 +17792,16 @@ public final class ContextOuterClass { * Used for inventory * * - * repeated .context.Component component = 8; + * repeated .context.Component components = 8; */ - public Builder addComponent( + public Builder addComponents( context.ContextOuterClass.Component.Builder builderForValue) { - if (componentBuilder_ == null) { - ensureComponentIsMutable(); - component_.add(builderForValue.build()); + if (componentsBuilder_ == null) { + ensureComponentsIsMutable(); + components_.add(builderForValue.build()); onChanged(); } else { - componentBuilder_.addMessage(builderForValue.build()); + componentsBuilder_.addMessage(builderForValue.build()); } return this; } @@ -17801,16 +17810,16 @@ public final class ContextOuterClass { * Used for inventory * * - * repeated .context.Component component = 8; + * repeated .context.Component components = 8; */ - public Builder addComponent( + public Builder addComponents( int index, context.ContextOuterClass.Component.Builder builderForValue) { - if (componentBuilder_ == null) { - ensureComponentIsMutable(); - component_.add(index, builderForValue.build()); + if (componentsBuilder_ == null) { + ensureComponentsIsMutable(); + components_.add(index, builderForValue.build()); onChanged(); } else { - componentBuilder_.addMessage(index, builderForValue.build()); + componentsBuilder_.addMessage(index, builderForValue.build()); } return this; } @@ -17819,17 +17828,17 @@ public final class ContextOuterClass { * Used for inventory * * - * repeated .context.Component component = 8; + * repeated .context.Component components = 8; */ - public Builder addAllComponent( + public Builder addAllComponents( java.lang.Iterable values) { - if (componentBuilder_ == null) { - ensureComponentIsMutable(); + if (componentsBuilder_ == null) { + ensureComponentsIsMutable(); com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, component_); + values, components_); onChanged(); } else { - componentBuilder_.addAllMessages(values); + componentsBuilder_.addAllMessages(values); } return this; } @@ -17838,15 +17847,15 @@ public final class ContextOuterClass { * Used for inventory * * - * repeated .context.Component component = 8; + * repeated .context.Component components = 8; */ - public Builder clearComponent() { - if (componentBuilder_ == null) { - component_ = java.util.Collections.emptyList(); + public Builder clearComponents() { + if (componentsBuilder_ == null) { + components_ = java.util.Collections.emptyList(); bitField0_ = (bitField0_ & ~0x00000004); onChanged(); } else { - componentBuilder_.clear(); + componentsBuilder_.clear(); } return this; } @@ -17855,15 +17864,15 @@ public final class ContextOuterClass { * Used for inventory * * - * repeated .context.Component component = 8; + * repeated .context.Component components = 8; */ - public Builder removeComponent(int index) { - if (componentBuilder_ == null) { - ensureComponentIsMutable(); - component_.remove(index); + public Builder removeComponents(int index) { + if (componentsBuilder_ == null) { + ensureComponentsIsMutable(); + components_.remove(index); onChanged(); } else { - componentBuilder_.remove(index); + componentsBuilder_.remove(index); } return this; } @@ -17872,24 +17881,24 @@ public final class ContextOuterClass { * Used for inventory * * - * repeated .context.Component component = 8; + * repeated .context.Component components = 8; */ - public context.ContextOuterClass.Component.Builder getComponentBuilder( + public context.ContextOuterClass.Component.Builder getComponentsBuilder( int index) { - return getComponentFieldBuilder().getBuilder(index); + return getComponentsFieldBuilder().getBuilder(index); } /** *
        * Used for inventory
        * 
* - * repeated .context.Component component = 8; + * repeated .context.Component components = 8; */ - public context.ContextOuterClass.ComponentOrBuilder getComponentOrBuilder( + public context.ContextOuterClass.ComponentOrBuilder getComponentsOrBuilder( int index) { - if (componentBuilder_ == null) { - return component_.get(index); } else { - return componentBuilder_.getMessageOrBuilder(index); + if (componentsBuilder_ == null) { + return components_.get(index); } else { + return componentsBuilder_.getMessageOrBuilder(index); } } /** @@ -17897,14 +17906,14 @@ public final class ContextOuterClass { * Used for inventory * * - * repeated .context.Component component = 8; + * repeated .context.Component components = 8; */ public java.util.List - getComponentOrBuilderList() { - if (componentBuilder_ != null) { - return componentBuilder_.getMessageOrBuilderList(); + getComponentsOrBuilderList() { + if (componentsBuilder_ != null) { + return componentsBuilder_.getMessageOrBuilderList(); } else { - return java.util.Collections.unmodifiableList(component_); + return java.util.Collections.unmodifiableList(components_); } } /** @@ -17912,10 +17921,10 @@ public final class ContextOuterClass { * Used for inventory * * - * repeated .context.Component component = 8; + * repeated .context.Component components = 8; */ - public context.ContextOuterClass.Component.Builder addComponentBuilder() { - return getComponentFieldBuilder().addBuilder( + public context.ContextOuterClass.Component.Builder addComponentsBuilder() { + return getComponentsFieldBuilder().addBuilder( context.ContextOuterClass.Component.getDefaultInstance()); } /** @@ -17923,11 +17932,11 @@ public final class ContextOuterClass { * Used for inventory * * - * repeated .context.Component component = 8; + * repeated .context.Component components = 8; */ - public context.ContextOuterClass.Component.Builder addComponentBuilder( + public context.ContextOuterClass.Component.Builder addComponentsBuilder( int index) { - return getComponentFieldBuilder().addBuilder( + return getComponentsFieldBuilder().addBuilder( index, context.ContextOuterClass.Component.getDefaultInstance()); } /** @@ -17935,25 +17944,25 @@ public final class ContextOuterClass { * Used for inventory * * - * repeated .context.Component component = 8; + * repeated .context.Component components = 8; */ public java.util.List - getComponentBuilderList() { - return getComponentFieldBuilder().getBuilderList(); + getComponentsBuilderList() { + return getComponentsFieldBuilder().getBuilderList(); } private com.google.protobuf.RepeatedFieldBuilderV3< context.ContextOuterClass.Component, context.ContextOuterClass.Component.Builder, context.ContextOuterClass.ComponentOrBuilder> - getComponentFieldBuilder() { - if (componentBuilder_ == null) { - componentBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + getComponentsFieldBuilder() { + if (componentsBuilder_ == null) { + componentsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< context.ContextOuterClass.Component, context.ContextOuterClass.Component.Builder, context.ContextOuterClass.ComponentOrBuilder>( - component_, + components_, ((bitField0_ & 0x00000004) != 0), getParentForChildren(), isClean()); - component_ = null; + components_ = null; } - return componentBuilder_; + return componentsBuilder_; } private context.ContextOuterClass.DeviceId controllerId_; @@ -18168,31 +18177,115 @@ public final class ContextOuterClass { com.google.protobuf.MessageOrBuilder { /** - * repeated string comp_string = 1; - * @return A list containing the compString. + * .context.Uuid component_uuid = 1; + * @return Whether the componentUuid field is set. */ - java.util.List - getCompStringList(); + boolean hasComponentUuid(); /** - * repeated string comp_string = 1; - * @return The count of compString. + * .context.Uuid component_uuid = 1; + * @return The componentUuid. */ - int getCompStringCount(); + context.ContextOuterClass.Uuid getComponentUuid(); /** - * repeated string comp_string = 1; - * @param index The index of the element to return. - * @return The compString at the given index. + * .context.Uuid component_uuid = 1; */ - java.lang.String getCompString(int index); + context.ContextOuterClass.UuidOrBuilder getComponentUuidOrBuilder(); + /** - * repeated string comp_string = 1; - * @param index The index of the value to return. - * @return The bytes of the compString at the given index. + * string name = 2; + * @return The name. + */ + java.lang.String getName(); + /** + * string name = 2; + * @return The bytes for name. + */ + com.google.protobuf.ByteString + getNameBytes(); + + /** + * string type = 3; + * @return The type. + */ + java.lang.String getType(); + /** + * string type = 3; + * @return The bytes for type. + */ + com.google.protobuf.ByteString + getTypeBytes(); + + /** + *
+     * dict[attr.name => json.dumps(attr.value)]
+     * 
+ * + * map<string, string> attributes = 4; + */ + int getAttributesCount(); + /** + *
+     * dict[attr.name => json.dumps(attr.value)]
+     * 
+ * + * map<string, string> attributes = 4; + */ + boolean containsAttributes( + java.lang.String key); + /** + * Use {@link #getAttributesMap()} instead. + */ + @java.lang.Deprecated + java.util.Map + getAttributes(); + /** + *
+     * dict[attr.name => json.dumps(attr.value)]
+     * 
+ * + * map<string, string> attributes = 4; + */ + java.util.Map + getAttributesMap(); + /** + *
+     * dict[attr.name => json.dumps(attr.value)]
+     * 
+ * + * map<string, string> attributes = 4; + */ + + java.lang.String getAttributesOrDefault( + java.lang.String key, + java.lang.String defaultValue); + /** + *
+     * dict[attr.name => json.dumps(attr.value)]
+     * 
+ * + * map<string, string> attributes = 4; + */ + + java.lang.String getAttributesOrThrow( + java.lang.String key); + + /** + * string parent = 5; + * @return The parent. + */ + java.lang.String getParent(); + /** + * string parent = 5; + * @return The bytes for parent. */ com.google.protobuf.ByteString - getCompStringBytes(int index); + getParentBytes(); } /** + *
+   *Defined previously to this section - Tested OK
+   * 
+ * * Protobuf type {@code context.Component} */ public static final class Component extends @@ -18205,7 +18298,9 @@ public final class ContextOuterClass { super(builder); } private Component() { - compString_ = com.google.protobuf.LazyStringArrayList.EMPTY; + name_ = ""; + type_ = ""; + parent_ = ""; } @java.lang.Override @@ -18240,12 +18335,47 @@ public final class ContextOuterClass { done = true; break; case 10: { + context.ContextOuterClass.Uuid.Builder subBuilder = null; + if (componentUuid_ != null) { + subBuilder = componentUuid_.toBuilder(); + } + componentUuid_ = input.readMessage(context.ContextOuterClass.Uuid.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(componentUuid_); + componentUuid_ = subBuilder.buildPartial(); + } + + break; + } + case 18: { java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + case 26: { + java.lang.String s = input.readStringRequireUtf8(); + + type_ = s; + break; + } + case 34: { if (!((mutable_bitField0_ & 0x00000001) != 0)) { - compString_ = new com.google.protobuf.LazyStringArrayList(); + attributes_ = com.google.protobuf.MapField.newMapField( + AttributesDefaultEntryHolder.defaultEntry); mutable_bitField0_ |= 0x00000001; } - compString_.add(s); + com.google.protobuf.MapEntry + attributes__ = input.readMessage( + AttributesDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); + attributes_.getMutableMap().put( + attributes__.getKey(), attributes__.getValue()); + break; + } + case 42: { + java.lang.String s = input.readStringRequireUtf8(); + + parent_ = s; break; } default: { @@ -18263,9 +18393,6 @@ public final class ContextOuterClass { throw new com.google.protobuf.InvalidProtocolBufferException( e).setUnfinishedMessage(this); } finally { - if (((mutable_bitField0_ & 0x00000001) != 0)) { - compString_ = compString_.getUnmodifiableView(); - } this.unknownFields = unknownFields.build(); makeExtensionsImmutable(); } @@ -18275,6 +18402,18 @@ public final class ContextOuterClass { return context.ContextOuterClass.internal_static_context_Component_descriptor; } + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapField internalGetMapField( + int number) { + switch (number) { + case 4: + return internalGetAttributes(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { @@ -18283,39 +18422,241 @@ public final class ContextOuterClass { context.ContextOuterClass.Component.class, context.ContextOuterClass.Component.Builder.class); } - public static final int COMP_STRING_FIELD_NUMBER = 1; - private com.google.protobuf.LazyStringList compString_; + public static final int COMPONENT_UUID_FIELD_NUMBER = 1; + private context.ContextOuterClass.Uuid componentUuid_; /** - * repeated string comp_string = 1; - * @return A list containing the compString. + * .context.Uuid component_uuid = 1; + * @return Whether the componentUuid field is set. */ - public com.google.protobuf.ProtocolStringList - getCompStringList() { - return compString_; + @java.lang.Override + public boolean hasComponentUuid() { + return componentUuid_ != null; } /** - * repeated string comp_string = 1; - * @return The count of compString. + * .context.Uuid component_uuid = 1; + * @return The componentUuid. */ - public int getCompStringCount() { - return compString_.size(); + @java.lang.Override + public context.ContextOuterClass.Uuid getComponentUuid() { + return componentUuid_ == null ? context.ContextOuterClass.Uuid.getDefaultInstance() : componentUuid_; } /** - * repeated string comp_string = 1; - * @param index The index of the element to return. - * @return The compString at the given index. + * .context.Uuid component_uuid = 1; + */ + @java.lang.Override + public context.ContextOuterClass.UuidOrBuilder getComponentUuidOrBuilder() { + return getComponentUuid(); + } + + public static final int NAME_FIELD_NUMBER = 2; + private volatile java.lang.Object name_; + /** + * string name = 2; + * @return The name. */ - public java.lang.String getCompString(int index) { - return compString_.get(index); + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } } /** - * repeated string comp_string = 1; - * @param index The index of the value to return. - * @return The bytes of the compString at the given index. + * string name = 2; + * @return The bytes for name. */ + @java.lang.Override public com.google.protobuf.ByteString - getCompStringBytes(int index) { - return compString_.getByteString(index); + getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int TYPE_FIELD_NUMBER = 3; + private volatile java.lang.Object type_; + /** + * string type = 3; + * @return The type. + */ + @java.lang.Override + public java.lang.String getType() { + java.lang.Object ref = type_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + type_ = s; + return s; + } + } + /** + * string type = 3; + * @return The bytes for type. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getTypeBytes() { + java.lang.Object ref = type_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + type_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ATTRIBUTES_FIELD_NUMBER = 4; + private static final class AttributesDefaultEntryHolder { + static final com.google.protobuf.MapEntry< + java.lang.String, java.lang.String> defaultEntry = + com.google.protobuf.MapEntry + .newDefaultInstance( + context.ContextOuterClass.internal_static_context_Component_AttributesEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.STRING, + ""); + } + private com.google.protobuf.MapField< + java.lang.String, java.lang.String> attributes_; + private com.google.protobuf.MapField + internalGetAttributes() { + if (attributes_ == null) { + return com.google.protobuf.MapField.emptyMapField( + AttributesDefaultEntryHolder.defaultEntry); + } + return attributes_; + } + + public int getAttributesCount() { + return internalGetAttributes().getMap().size(); + } + /** + *
+     * dict[attr.name => json.dumps(attr.value)]
+     * 
+ * + * map<string, string> attributes = 4; + */ + + @java.lang.Override + public boolean containsAttributes( + java.lang.String key) { + if (key == null) { throw new java.lang.NullPointerException(); } + return internalGetAttributes().getMap().containsKey(key); + } + /** + * Use {@link #getAttributesMap()} instead. + */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getAttributes() { + return getAttributesMap(); + } + /** + *
+     * dict[attr.name => json.dumps(attr.value)]
+     * 
+ * + * map<string, string> attributes = 4; + */ + @java.lang.Override + + public java.util.Map getAttributesMap() { + return internalGetAttributes().getMap(); + } + /** + *
+     * dict[attr.name => json.dumps(attr.value)]
+     * 
+ * + * map<string, string> attributes = 4; + */ + @java.lang.Override + + public java.lang.String getAttributesOrDefault( + java.lang.String key, + java.lang.String defaultValue) { + if (key == null) { throw new java.lang.NullPointerException(); } + java.util.Map map = + internalGetAttributes().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + *
+     * dict[attr.name => json.dumps(attr.value)]
+     * 
+ * + * map<string, string> attributes = 4; + */ + @java.lang.Override + + public java.lang.String getAttributesOrThrow( + java.lang.String key) { + if (key == null) { throw new java.lang.NullPointerException(); } + java.util.Map map = + internalGetAttributes().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public static final int PARENT_FIELD_NUMBER = 5; + private volatile java.lang.Object parent_; + /** + * string parent = 5; + * @return The parent. + */ + @java.lang.Override + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } + } + /** + * string parent = 5; + * @return The bytes for parent. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } } private byte memoizedIsInitialized = -1; @@ -18332,8 +18673,23 @@ public final class ContextOuterClass { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - for (int i = 0; i < compString_.size(); i++) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, compString_.getRaw(i)); + if (componentUuid_ != null) { + output.writeMessage(1, getComponentUuid()); + } + if (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, name_); + } + if (!getTypeBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, type_); + } + com.google.protobuf.GeneratedMessageV3 + .serializeStringMapTo( + output, + internalGetAttributes(), + AttributesDefaultEntryHolder.defaultEntry, + 4); + if (!getParentBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, parent_); } unknownFields.writeTo(output); } @@ -18344,13 +18700,28 @@ public final class ContextOuterClass { if (size != -1) return size; size = 0; - { - int dataSize = 0; - for (int i = 0; i < compString_.size(); i++) { - dataSize += computeStringSizeNoTag(compString_.getRaw(i)); - } - size += dataSize; - size += 1 * getCompStringList().size(); + if (componentUuid_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, getComponentUuid()); + } + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, name_); + } + if (!getTypeBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, type_); + } + for (java.util.Map.Entry entry + : internalGetAttributes().getMap().entrySet()) { + com.google.protobuf.MapEntry + attributes__ = AttributesDefaultEntryHolder.defaultEntry.newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(4, attributes__); + } + if (!getParentBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, parent_); } size += unknownFields.getSerializedSize(); memoizedSize = size; @@ -18367,8 +18738,19 @@ public final class ContextOuterClass { } context.ContextOuterClass.Component other = (context.ContextOuterClass.Component) obj; - if (!getCompStringList() - .equals(other.getCompStringList())) return false; + if (hasComponentUuid() != other.hasComponentUuid()) return false; + if (hasComponentUuid()) { + if (!getComponentUuid() + .equals(other.getComponentUuid())) return false; + } + if (!getName() + .equals(other.getName())) return false; + if (!getType() + .equals(other.getType())) return false; + if (!internalGetAttributes().equals( + other.internalGetAttributes())) return false; + if (!getParent() + .equals(other.getParent())) return false; if (!unknownFields.equals(other.unknownFields)) return false; return true; } @@ -18380,10 +18762,20 @@ public final class ContextOuterClass { } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); - if (getCompStringCount() > 0) { - hash = (37 * hash) + COMP_STRING_FIELD_NUMBER; - hash = (53 * hash) + getCompStringList().hashCode(); + if (hasComponentUuid()) { + hash = (37 * hash) + COMPONENT_UUID_FIELD_NUMBER; + hash = (53 * hash) + getComponentUuid().hashCode(); } + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (37 * hash) + TYPE_FIELD_NUMBER; + hash = (53 * hash) + getType().hashCode(); + if (!internalGetAttributes().getMap().isEmpty()) { + hash = (37 * hash) + ATTRIBUTES_FIELD_NUMBER; + hash = (53 * hash) + internalGetAttributes().hashCode(); + } + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; @@ -18480,6 +18872,10 @@ public final class ContextOuterClass { return builder; } /** + *
+     *Defined previously to this section - Tested OK
+     * 
+ * * Protobuf type {@code context.Component} */ public static final class Builder extends @@ -18491,6 +18887,28 @@ public final class ContextOuterClass { return context.ContextOuterClass.internal_static_context_Component_descriptor; } + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField( + int number) { + switch (number) { + case 4: + return internalGetAttributes(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMutableMapField( + int number) { + switch (number) { + case 4: + return internalGetMutableAttributes(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { @@ -18517,8 +18935,19 @@ public final class ContextOuterClass { @java.lang.Override public Builder clear() { super.clear(); - compString_ = com.google.protobuf.LazyStringArrayList.EMPTY; - bitField0_ = (bitField0_ & ~0x00000001); + if (componentUuidBuilder_ == null) { + componentUuid_ = null; + } else { + componentUuid_ = null; + componentUuidBuilder_ = null; + } + name_ = ""; + + type_ = ""; + + internalGetMutableAttributes().clear(); + parent_ = ""; + return this; } @@ -18546,11 +18975,16 @@ public final class ContextOuterClass { public context.ContextOuterClass.Component buildPartial() { context.ContextOuterClass.Component result = new context.ContextOuterClass.Component(this); int from_bitField0_ = bitField0_; - if (((bitField0_ & 0x00000001) != 0)) { - compString_ = compString_.getUnmodifiableView(); - bitField0_ = (bitField0_ & ~0x00000001); + if (componentUuidBuilder_ == null) { + result.componentUuid_ = componentUuid_; + } else { + result.componentUuid_ = componentUuidBuilder_.build(); } - result.compString_ = compString_; + result.name_ = name_; + result.type_ = type_; + result.attributes_ = internalGetAttributes(); + result.attributes_.makeImmutable(); + result.parent_ = parent_; onBuilt(); return result; } @@ -18599,14 +19033,21 @@ public final class ContextOuterClass { public Builder mergeFrom(context.ContextOuterClass.Component other) { if (other == context.ContextOuterClass.Component.getDefaultInstance()) return this; - if (!other.compString_.isEmpty()) { - if (compString_.isEmpty()) { - compString_ = other.compString_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureCompStringIsMutable(); - compString_.addAll(other.compString_); - } + if (other.hasComponentUuid()) { + mergeComponentUuid(other.getComponentUuid()); + } + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (!other.getType().isEmpty()) { + type_ = other.type_; + onChanged(); + } + internalGetMutableAttributes().mergeFrom( + other.internalGetAttributes()); + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; onChanged(); } this.mergeUnknownFields(other.unknownFields); @@ -18639,112 +19080,505 @@ public final class ContextOuterClass { } private int bitField0_; - private com.google.protobuf.LazyStringList compString_ = com.google.protobuf.LazyStringArrayList.EMPTY; - private void ensureCompStringIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - compString_ = new com.google.protobuf.LazyStringArrayList(compString_); - bitField0_ |= 0x00000001; - } + private context.ContextOuterClass.Uuid componentUuid_; + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.Uuid, context.ContextOuterClass.Uuid.Builder, context.ContextOuterClass.UuidOrBuilder> componentUuidBuilder_; + /** + * .context.Uuid component_uuid = 1; + * @return Whether the componentUuid field is set. + */ + public boolean hasComponentUuid() { + return componentUuidBuilder_ != null || componentUuid_ != null; } /** - * repeated string comp_string = 1; - * @return A list containing the compString. + * .context.Uuid component_uuid = 1; + * @return The componentUuid. */ - public com.google.protobuf.ProtocolStringList - getCompStringList() { - return compString_.getUnmodifiableView(); + public context.ContextOuterClass.Uuid getComponentUuid() { + if (componentUuidBuilder_ == null) { + return componentUuid_ == null ? context.ContextOuterClass.Uuid.getDefaultInstance() : componentUuid_; + } else { + return componentUuidBuilder_.getMessage(); + } } /** - * repeated string comp_string = 1; - * @return The count of compString. + * .context.Uuid component_uuid = 1; */ - public int getCompStringCount() { - return compString_.size(); + public Builder setComponentUuid(context.ContextOuterClass.Uuid value) { + if (componentUuidBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + componentUuid_ = value; + onChanged(); + } else { + componentUuidBuilder_.setMessage(value); + } + + return this; } /** - * repeated string comp_string = 1; - * @param index The index of the element to return. - * @return The compString at the given index. + * .context.Uuid component_uuid = 1; + */ + public Builder setComponentUuid( + context.ContextOuterClass.Uuid.Builder builderForValue) { + if (componentUuidBuilder_ == null) { + componentUuid_ = builderForValue.build(); + onChanged(); + } else { + componentUuidBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * .context.Uuid component_uuid = 1; */ - public java.lang.String getCompString(int index) { - return compString_.get(index); + public Builder mergeComponentUuid(context.ContextOuterClass.Uuid value) { + if (componentUuidBuilder_ == null) { + if (componentUuid_ != null) { + componentUuid_ = + context.ContextOuterClass.Uuid.newBuilder(componentUuid_).mergeFrom(value).buildPartial(); + } else { + componentUuid_ = value; + } + onChanged(); + } else { + componentUuidBuilder_.mergeFrom(value); + } + + return this; } /** - * repeated string comp_string = 1; - * @param index The index of the value to return. - * @return The bytes of the compString at the given index. + * .context.Uuid component_uuid = 1; + */ + public Builder clearComponentUuid() { + if (componentUuidBuilder_ == null) { + componentUuid_ = null; + onChanged(); + } else { + componentUuid_ = null; + componentUuidBuilder_ = null; + } + + return this; + } + /** + * .context.Uuid component_uuid = 1; + */ + public context.ContextOuterClass.Uuid.Builder getComponentUuidBuilder() { + + onChanged(); + return getComponentUuidFieldBuilder().getBuilder(); + } + /** + * .context.Uuid component_uuid = 1; + */ + public context.ContextOuterClass.UuidOrBuilder getComponentUuidOrBuilder() { + if (componentUuidBuilder_ != null) { + return componentUuidBuilder_.getMessageOrBuilder(); + } else { + return componentUuid_ == null ? + context.ContextOuterClass.Uuid.getDefaultInstance() : componentUuid_; + } + } + /** + * .context.Uuid component_uuid = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.Uuid, context.ContextOuterClass.Uuid.Builder, context.ContextOuterClass.UuidOrBuilder> + getComponentUuidFieldBuilder() { + if (componentUuidBuilder_ == null) { + componentUuidBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.Uuid, context.ContextOuterClass.Uuid.Builder, context.ContextOuterClass.UuidOrBuilder>( + getComponentUuid(), + getParentForChildren(), + isClean()); + componentUuid_ = null; + } + return componentUuidBuilder_; + } + + private java.lang.Object name_ = ""; + /** + * string name = 2; + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string name = 2; + * @return The bytes for name. */ public com.google.protobuf.ByteString - getCompStringBytes(int index) { - return compString_.getByteString(index); + getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } } /** - * repeated string comp_string = 1; - * @param index The index to set the value at. - * @param value The compString to set. + * string name = 2; + * @param value The name to set. * @return This builder for chaining. */ - public Builder setCompString( - int index, java.lang.String value) { + public Builder setName( + java.lang.String value) { if (value == null) { throw new NullPointerException(); } - ensureCompStringIsMutable(); - compString_.set(index, value); + + name_ = value; + onChanged(); + return this; + } + /** + * string name = 2; + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); onChanged(); return this; } /** - * repeated string comp_string = 1; - * @param value The compString to add. + * string name = 2; + * @param value The bytes for name to set. * @return This builder for chaining. */ - public Builder addCompString( + public Builder setNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + private java.lang.Object type_ = ""; + /** + * string type = 3; + * @return The type. + */ + public java.lang.String getType() { + java.lang.Object ref = type_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + type_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string type = 3; + * @return The bytes for type. + */ + public com.google.protobuf.ByteString + getTypeBytes() { + java.lang.Object ref = type_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + type_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string type = 3; + * @param value The type to set. + * @return This builder for chaining. + */ + public Builder setType( java.lang.String value) { if (value == null) { throw new NullPointerException(); } - ensureCompStringIsMutable(); - compString_.add(value); + + type_ = value; onChanged(); return this; } /** - * repeated string comp_string = 1; - * @param values The compString to add. + * string type = 3; * @return This builder for chaining. */ - public Builder addAllCompString( - java.lang.Iterable values) { - ensureCompStringIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, compString_); + public Builder clearType() { + + type_ = getDefaultInstance().getType(); onChanged(); return this; } /** - * repeated string comp_string = 1; + * string type = 3; + * @param value The bytes for type to set. * @return This builder for chaining. */ - public Builder clearCompString() { - compString_ = com.google.protobuf.LazyStringArrayList.EMPTY; - bitField0_ = (bitField0_ & ~0x00000001); + public Builder setTypeBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + type_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.MapField< + java.lang.String, java.lang.String> attributes_; + private com.google.protobuf.MapField + internalGetAttributes() { + if (attributes_ == null) { + return com.google.protobuf.MapField.emptyMapField( + AttributesDefaultEntryHolder.defaultEntry); + } + return attributes_; + } + private com.google.protobuf.MapField + internalGetMutableAttributes() { + onChanged();; + if (attributes_ == null) { + attributes_ = com.google.protobuf.MapField.newMapField( + AttributesDefaultEntryHolder.defaultEntry); + } + if (!attributes_.isMutable()) { + attributes_ = attributes_.copy(); + } + return attributes_; + } + + public int getAttributesCount() { + return internalGetAttributes().getMap().size(); + } + /** + *
+       * dict[attr.name => json.dumps(attr.value)]
+       * 
+ * + * map<string, string> attributes = 4; + */ + + @java.lang.Override + public boolean containsAttributes( + java.lang.String key) { + if (key == null) { throw new java.lang.NullPointerException(); } + return internalGetAttributes().getMap().containsKey(key); + } + /** + * Use {@link #getAttributesMap()} instead. + */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getAttributes() { + return getAttributesMap(); + } + /** + *
+       * dict[attr.name => json.dumps(attr.value)]
+       * 
+ * + * map<string, string> attributes = 4; + */ + @java.lang.Override + + public java.util.Map getAttributesMap() { + return internalGetAttributes().getMap(); + } + /** + *
+       * dict[attr.name => json.dumps(attr.value)]
+       * 
+ * + * map<string, string> attributes = 4; + */ + @java.lang.Override + + public java.lang.String getAttributesOrDefault( + java.lang.String key, + java.lang.String defaultValue) { + if (key == null) { throw new java.lang.NullPointerException(); } + java.util.Map map = + internalGetAttributes().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + *
+       * dict[attr.name => json.dumps(attr.value)]
+       * 
+ * + * map<string, string> attributes = 4; + */ + @java.lang.Override + + public java.lang.String getAttributesOrThrow( + java.lang.String key) { + if (key == null) { throw new java.lang.NullPointerException(); } + java.util.Map map = + internalGetAttributes().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearAttributes() { + internalGetMutableAttributes().getMutableMap() + .clear(); + return this; + } + /** + *
+       * dict[attr.name => json.dumps(attr.value)]
+       * 
+ * + * map<string, string> attributes = 4; + */ + + public Builder removeAttributes( + java.lang.String key) { + if (key == null) { throw new java.lang.NullPointerException(); } + internalGetMutableAttributes().getMutableMap() + .remove(key); + return this; + } + /** + * Use alternate mutation accessors instead. + */ + @java.lang.Deprecated + public java.util.Map + getMutableAttributes() { + return internalGetMutableAttributes().getMutableMap(); + } + /** + *
+       * dict[attr.name => json.dumps(attr.value)]
+       * 
+ * + * map<string, string> attributes = 4; + */ + public Builder putAttributes( + java.lang.String key, + java.lang.String value) { + if (key == null) { throw new java.lang.NullPointerException(); } + if (value == null) { throw new java.lang.NullPointerException(); } + internalGetMutableAttributes().getMutableMap() + .put(key, value); + return this; + } + /** + *
+       * dict[attr.name => json.dumps(attr.value)]
+       * 
+ * + * map<string, string> attributes = 4; + */ + + public Builder putAllAttributes( + java.util.Map values) { + internalGetMutableAttributes().getMutableMap() + .putAll(values); + return this; + } + + private java.lang.Object parent_ = ""; + /** + * string parent = 5; + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string parent = 5; + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString + getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string parent = 5; + * @param value The parent to set. + * @return This builder for chaining. + */ + public Builder setParent( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + parent_ = value; onChanged(); return this; } /** - * repeated string comp_string = 1; - * @param value The bytes of the compString to add. + * string parent = 5; * @return This builder for chaining. */ - public Builder addCompStringBytes( + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + /** + * string parent = 5; + * @param value The bytes for parent to set. + * @return This builder for chaining. + */ + public Builder setParentBytes( com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - ensureCompStringIsMutable(); - compString_.add(value); + + parent_ = value; onChanged(); return this; } @@ -23670,6 +24504,568 @@ public final class ContextOuterClass { } + public interface LinkAttributesOrBuilder extends + // @@protoc_insertion_point(interface_extends:context.LinkAttributes) + com.google.protobuf.MessageOrBuilder { + + /** + * float total_capacity_gbps = 1; + * @return The totalCapacityGbps. + */ + float getTotalCapacityGbps(); + + /** + * float used_capacity_gbps = 2; + * @return The usedCapacityGbps. + */ + float getUsedCapacityGbps(); + } + /** + * Protobuf type {@code context.LinkAttributes} + */ + public static final class LinkAttributes extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:context.LinkAttributes) + LinkAttributesOrBuilder { + private static final long serialVersionUID = 0L; + // Use LinkAttributes.newBuilder() to construct. + private LinkAttributes(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private LinkAttributes() { + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new LinkAttributes(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private LinkAttributes( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 13: { + + totalCapacityGbps_ = input.readFloat(); + break; + } + case 21: { + + usedCapacityGbps_ = input.readFloat(); + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return context.ContextOuterClass.internal_static_context_LinkAttributes_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return context.ContextOuterClass.internal_static_context_LinkAttributes_fieldAccessorTable + .ensureFieldAccessorsInitialized( + context.ContextOuterClass.LinkAttributes.class, context.ContextOuterClass.LinkAttributes.Builder.class); + } + + public static final int TOTAL_CAPACITY_GBPS_FIELD_NUMBER = 1; + private float totalCapacityGbps_; + /** + * float total_capacity_gbps = 1; + * @return The totalCapacityGbps. + */ + @java.lang.Override + public float getTotalCapacityGbps() { + return totalCapacityGbps_; + } + + public static final int USED_CAPACITY_GBPS_FIELD_NUMBER = 2; + private float usedCapacityGbps_; + /** + * float used_capacity_gbps = 2; + * @return The usedCapacityGbps. + */ + @java.lang.Override + public float getUsedCapacityGbps() { + return usedCapacityGbps_; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (totalCapacityGbps_ != 0F) { + output.writeFloat(1, totalCapacityGbps_); + } + if (usedCapacityGbps_ != 0F) { + output.writeFloat(2, usedCapacityGbps_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (totalCapacityGbps_ != 0F) { + size += com.google.protobuf.CodedOutputStream + .computeFloatSize(1, totalCapacityGbps_); + } + if (usedCapacityGbps_ != 0F) { + size += com.google.protobuf.CodedOutputStream + .computeFloatSize(2, usedCapacityGbps_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof context.ContextOuterClass.LinkAttributes)) { + return super.equals(obj); + } + context.ContextOuterClass.LinkAttributes other = (context.ContextOuterClass.LinkAttributes) obj; + + if (java.lang.Float.floatToIntBits(getTotalCapacityGbps()) + != java.lang.Float.floatToIntBits( + other.getTotalCapacityGbps())) return false; + if (java.lang.Float.floatToIntBits(getUsedCapacityGbps()) + != java.lang.Float.floatToIntBits( + other.getUsedCapacityGbps())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + TOTAL_CAPACITY_GBPS_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits( + getTotalCapacityGbps()); + hash = (37 * hash) + USED_CAPACITY_GBPS_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits( + getUsedCapacityGbps()); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static context.ContextOuterClass.LinkAttributes parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static context.ContextOuterClass.LinkAttributes parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static context.ContextOuterClass.LinkAttributes parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static context.ContextOuterClass.LinkAttributes parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static context.ContextOuterClass.LinkAttributes parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static context.ContextOuterClass.LinkAttributes parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static context.ContextOuterClass.LinkAttributes parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static context.ContextOuterClass.LinkAttributes parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static context.ContextOuterClass.LinkAttributes parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static context.ContextOuterClass.LinkAttributes parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static context.ContextOuterClass.LinkAttributes parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static context.ContextOuterClass.LinkAttributes parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(context.ContextOuterClass.LinkAttributes prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code context.LinkAttributes} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:context.LinkAttributes) + context.ContextOuterClass.LinkAttributesOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return context.ContextOuterClass.internal_static_context_LinkAttributes_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return context.ContextOuterClass.internal_static_context_LinkAttributes_fieldAccessorTable + .ensureFieldAccessorsInitialized( + context.ContextOuterClass.LinkAttributes.class, context.ContextOuterClass.LinkAttributes.Builder.class); + } + + // Construct using context.ContextOuterClass.LinkAttributes.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + totalCapacityGbps_ = 0F; + + usedCapacityGbps_ = 0F; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return context.ContextOuterClass.internal_static_context_LinkAttributes_descriptor; + } + + @java.lang.Override + public context.ContextOuterClass.LinkAttributes getDefaultInstanceForType() { + return context.ContextOuterClass.LinkAttributes.getDefaultInstance(); + } + + @java.lang.Override + public context.ContextOuterClass.LinkAttributes build() { + context.ContextOuterClass.LinkAttributes result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public context.ContextOuterClass.LinkAttributes buildPartial() { + context.ContextOuterClass.LinkAttributes result = new context.ContextOuterClass.LinkAttributes(this); + result.totalCapacityGbps_ = totalCapacityGbps_; + result.usedCapacityGbps_ = usedCapacityGbps_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof context.ContextOuterClass.LinkAttributes) { + return mergeFrom((context.ContextOuterClass.LinkAttributes)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(context.ContextOuterClass.LinkAttributes other) { + if (other == context.ContextOuterClass.LinkAttributes.getDefaultInstance()) return this; + if (other.getTotalCapacityGbps() != 0F) { + setTotalCapacityGbps(other.getTotalCapacityGbps()); + } + if (other.getUsedCapacityGbps() != 0F) { + setUsedCapacityGbps(other.getUsedCapacityGbps()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + context.ContextOuterClass.LinkAttributes parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (context.ContextOuterClass.LinkAttributes) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private float totalCapacityGbps_ ; + /** + * float total_capacity_gbps = 1; + * @return The totalCapacityGbps. + */ + @java.lang.Override + public float getTotalCapacityGbps() { + return totalCapacityGbps_; + } + /** + * float total_capacity_gbps = 1; + * @param value The totalCapacityGbps to set. + * @return This builder for chaining. + */ + public Builder setTotalCapacityGbps(float value) { + + totalCapacityGbps_ = value; + onChanged(); + return this; + } + /** + * float total_capacity_gbps = 1; + * @return This builder for chaining. + */ + public Builder clearTotalCapacityGbps() { + + totalCapacityGbps_ = 0F; + onChanged(); + return this; + } + + private float usedCapacityGbps_ ; + /** + * float used_capacity_gbps = 2; + * @return The usedCapacityGbps. + */ + @java.lang.Override + public float getUsedCapacityGbps() { + return usedCapacityGbps_; + } + /** + * float used_capacity_gbps = 2; + * @param value The usedCapacityGbps to set. + * @return This builder for chaining. + */ + public Builder setUsedCapacityGbps(float value) { + + usedCapacityGbps_ = value; + onChanged(); + return this; + } + /** + * float used_capacity_gbps = 2; + * @return This builder for chaining. + */ + public Builder clearUsedCapacityGbps() { + + usedCapacityGbps_ = 0F; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:context.LinkAttributes) + } + + // @@protoc_insertion_point(class_scope:context.LinkAttributes) + private static final context.ContextOuterClass.LinkAttributes DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new context.ContextOuterClass.LinkAttributes(); + } + + public static context.ContextOuterClass.LinkAttributes getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public LinkAttributes parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new LinkAttributes(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public context.ContextOuterClass.LinkAttributes getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + public interface LinkOrBuilder extends // @@protoc_insertion_point(interface_extends:context.Link) com.google.protobuf.MessageOrBuilder { @@ -23724,6 +25120,21 @@ public final class ContextOuterClass { */ context.ContextOuterClass.EndPointIdOrBuilder getLinkEndpointIdsOrBuilder( int index); + + /** + * .context.LinkAttributes attributes = 4; + * @return Whether the attributes field is set. + */ + boolean hasAttributes(); + /** + * .context.LinkAttributes attributes = 4; + * @return The attributes. + */ + context.ContextOuterClass.LinkAttributes getAttributes(); + /** + * .context.LinkAttributes attributes = 4; + */ + context.ContextOuterClass.LinkAttributesOrBuilder getAttributesOrBuilder(); } /** * Protobuf type {@code context.Link} @@ -23801,6 +25212,19 @@ public final class ContextOuterClass { input.readMessage(context.ContextOuterClass.EndPointId.parser(), extensionRegistry)); break; } + case 34: { + context.ContextOuterClass.LinkAttributes.Builder subBuilder = null; + if (attributes_ != null) { + subBuilder = attributes_.toBuilder(); + } + attributes_ = input.readMessage(context.ContextOuterClass.LinkAttributes.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(attributes_); + attributes_ = subBuilder.buildPartial(); + } + + break; + } default: { if (!parseUnknownField( input, unknownFields, extensionRegistry, tag)) { @@ -23940,6 +25364,32 @@ public final class ContextOuterClass { return linkEndpointIds_.get(index); } + public static final int ATTRIBUTES_FIELD_NUMBER = 4; + private context.ContextOuterClass.LinkAttributes attributes_; + /** + * .context.LinkAttributes attributes = 4; + * @return Whether the attributes field is set. + */ + @java.lang.Override + public boolean hasAttributes() { + return attributes_ != null; + } + /** + * .context.LinkAttributes attributes = 4; + * @return The attributes. + */ + @java.lang.Override + public context.ContextOuterClass.LinkAttributes getAttributes() { + return attributes_ == null ? context.ContextOuterClass.LinkAttributes.getDefaultInstance() : attributes_; + } + /** + * .context.LinkAttributes attributes = 4; + */ + @java.lang.Override + public context.ContextOuterClass.LinkAttributesOrBuilder getAttributesOrBuilder() { + return getAttributes(); + } + private byte memoizedIsInitialized = -1; @java.lang.Override public final boolean isInitialized() { @@ -23963,6 +25413,9 @@ public final class ContextOuterClass { for (int i = 0; i < linkEndpointIds_.size(); i++) { output.writeMessage(3, linkEndpointIds_.get(i)); } + if (attributes_ != null) { + output.writeMessage(4, getAttributes()); + } unknownFields.writeTo(output); } @@ -23983,6 +25436,10 @@ public final class ContextOuterClass { size += com.google.protobuf.CodedOutputStream .computeMessageSize(3, linkEndpointIds_.get(i)); } + if (attributes_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(4, getAttributes()); + } size += unknownFields.getSerializedSize(); memoizedSize = size; return size; @@ -24007,6 +25464,11 @@ public final class ContextOuterClass { .equals(other.getName())) return false; if (!getLinkEndpointIdsList() .equals(other.getLinkEndpointIdsList())) return false; + if (hasAttributes() != other.hasAttributes()) return false; + if (hasAttributes()) { + if (!getAttributes() + .equals(other.getAttributes())) return false; + } if (!unknownFields.equals(other.unknownFields)) return false; return true; } @@ -24028,6 +25490,10 @@ public final class ContextOuterClass { hash = (37 * hash) + LINK_ENDPOINT_IDS_FIELD_NUMBER; hash = (53 * hash) + getLinkEndpointIdsList().hashCode(); } + if (hasAttributes()) { + hash = (37 * hash) + ATTRIBUTES_FIELD_NUMBER; + hash = (53 * hash) + getAttributes().hashCode(); + } hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; @@ -24176,6 +25642,12 @@ public final class ContextOuterClass { } else { linkEndpointIdsBuilder_.clear(); } + if (attributesBuilder_ == null) { + attributes_ = null; + } else { + attributes_ = null; + attributesBuilder_ = null; + } return this; } @@ -24218,6 +25690,11 @@ public final class ContextOuterClass { } else { result.linkEndpointIds_ = linkEndpointIdsBuilder_.build(); } + if (attributesBuilder_ == null) { + result.attributes_ = attributes_; + } else { + result.attributes_ = attributesBuilder_.build(); + } onBuilt(); return result; } @@ -24299,6 +25776,9 @@ public final class ContextOuterClass { } } } + if (other.hasAttributes()) { + mergeAttributes(other.getAttributes()); + } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; @@ -24763,6 +26243,125 @@ public final class ContextOuterClass { } return linkEndpointIdsBuilder_; } + + private context.ContextOuterClass.LinkAttributes attributes_; + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.LinkAttributes, context.ContextOuterClass.LinkAttributes.Builder, context.ContextOuterClass.LinkAttributesOrBuilder> attributesBuilder_; + /** + * .context.LinkAttributes attributes = 4; + * @return Whether the attributes field is set. + */ + public boolean hasAttributes() { + return attributesBuilder_ != null || attributes_ != null; + } + /** + * .context.LinkAttributes attributes = 4; + * @return The attributes. + */ + public context.ContextOuterClass.LinkAttributes getAttributes() { + if (attributesBuilder_ == null) { + return attributes_ == null ? context.ContextOuterClass.LinkAttributes.getDefaultInstance() : attributes_; + } else { + return attributesBuilder_.getMessage(); + } + } + /** + * .context.LinkAttributes attributes = 4; + */ + public Builder setAttributes(context.ContextOuterClass.LinkAttributes value) { + if (attributesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + attributes_ = value; + onChanged(); + } else { + attributesBuilder_.setMessage(value); + } + + return this; + } + /** + * .context.LinkAttributes attributes = 4; + */ + public Builder setAttributes( + context.ContextOuterClass.LinkAttributes.Builder builderForValue) { + if (attributesBuilder_ == null) { + attributes_ = builderForValue.build(); + onChanged(); + } else { + attributesBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * .context.LinkAttributes attributes = 4; + */ + public Builder mergeAttributes(context.ContextOuterClass.LinkAttributes value) { + if (attributesBuilder_ == null) { + if (attributes_ != null) { + attributes_ = + context.ContextOuterClass.LinkAttributes.newBuilder(attributes_).mergeFrom(value).buildPartial(); + } else { + attributes_ = value; + } + onChanged(); + } else { + attributesBuilder_.mergeFrom(value); + } + + return this; + } + /** + * .context.LinkAttributes attributes = 4; + */ + public Builder clearAttributes() { + if (attributesBuilder_ == null) { + attributes_ = null; + onChanged(); + } else { + attributes_ = null; + attributesBuilder_ = null; + } + + return this; + } + /** + * .context.LinkAttributes attributes = 4; + */ + public context.ContextOuterClass.LinkAttributes.Builder getAttributesBuilder() { + + onChanged(); + return getAttributesFieldBuilder().getBuilder(); + } + /** + * .context.LinkAttributes attributes = 4; + */ + public context.ContextOuterClass.LinkAttributesOrBuilder getAttributesOrBuilder() { + if (attributesBuilder_ != null) { + return attributesBuilder_.getMessageOrBuilder(); + } else { + return attributes_ == null ? + context.ContextOuterClass.LinkAttributes.getDefaultInstance() : attributes_; + } + } + /** + * .context.LinkAttributes attributes = 4; + */ + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.LinkAttributes, context.ContextOuterClass.LinkAttributes.Builder, context.ContextOuterClass.LinkAttributesOrBuilder> + getAttributesFieldBuilder() { + if (attributesBuilder_ == null) { + attributesBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.LinkAttributes, context.ContextOuterClass.LinkAttributes.Builder, context.ContextOuterClass.LinkAttributesOrBuilder>( + getAttributes(), + getParentForChildren(), + isClean()); + attributes_ = null; + } + return attributesBuilder_; + } @java.lang.Override public final Builder setUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields) { @@ -73697,6 +75296,11 @@ public final class ContextOuterClass { private static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_context_Component_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_context_Component_AttributesEntry_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_context_Component_AttributesEntry_fieldAccessorTable; private static final com.google.protobuf.Descriptors.Descriptor internal_static_context_DeviceConfig_descriptor; private static final @@ -73727,6 +75331,11 @@ public final class ContextOuterClass { private static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_context_LinkId_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_context_LinkAttributes_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_context_LinkAttributes_fieldAccessorTable; private static final com.google.protobuf.Descriptors.Descriptor internal_static_context_Link_descriptor; private static final @@ -74034,290 +75643,297 @@ public final class ContextOuterClass { "vent\022\035\n\005event\030\001 \001(\0132\016.context.Event\022(\n\013t" + "opology_id\030\002 \001(\0132\023.context.TopologyId\".\n" + "\010DeviceId\022\"\n\013device_uuid\030\001 \001(\0132\r.context" + - ".Uuid\"\371\002\n\006Device\022$\n\tdevice_id\030\001 \001(\0132\021.co" + + ".Uuid\"\372\002\n\006Device\022$\n\tdevice_id\030\001 \001(\0132\021.co" + "ntext.DeviceId\022\014\n\004name\030\002 \001(\t\022\023\n\013device_t" + "ype\030\003 \001(\t\022,\n\rdevice_config\030\004 \001(\0132\025.conte" + "xt.DeviceConfig\022G\n\031device_operational_st" + "atus\030\005 \001(\0162$.context.DeviceOperationalSt" + "atusEnum\0221\n\016device_drivers\030\006 \003(\0162\031.conte" + "xt.DeviceDriverEnum\022+\n\020device_endpoints\030" + - "\007 \003(\0132\021.context.EndPoint\022%\n\tcomponent\030\010 " + - "\003(\0132\022.context.Component\022(\n\rcontroller_id" + - "\030\t \001(\0132\021.context.DeviceId\" \n\tComponent\022\023" + - "\n\013comp_string\030\001 \003(\t\"9\n\014DeviceConfig\022)\n\014c" + - "onfig_rules\030\001 \003(\0132\023.context.ConfigRule\"5" + - "\n\014DeviceIdList\022%\n\ndevice_ids\030\001 \003(\0132\021.con" + - "text.DeviceId\".\n\nDeviceList\022 \n\007devices\030\001" + - " \003(\0132\017.context.Device\"\216\001\n\014DeviceFilter\022)" + - "\n\ndevice_ids\030\001 \001(\0132\025.context.DeviceIdLis" + - "t\022\031\n\021include_endpoints\030\002 \001(\010\022\034\n\024include_" + - "config_rules\030\003 \001(\010\022\032\n\022include_components" + - "\030\004 \001(\010\"\200\001\n\013DeviceEvent\022\035\n\005event\030\001 \001(\0132\016." + - "context.Event\022$\n\tdevice_id\030\002 \001(\0132\021.conte" + - "xt.DeviceId\022,\n\rdevice_config\030\003 \001(\0132\025.con" + - "text.DeviceConfig\"*\n\006LinkId\022 \n\tlink_uuid" + - "\030\001 \001(\0132\r.context.Uuid\"f\n\004Link\022 \n\007link_id" + - "\030\001 \001(\0132\017.context.LinkId\022\014\n\004name\030\002 \001(\t\022.\n" + - "\021link_endpoint_ids\030\003 \003(\0132\023.context.EndPo" + - "intId\"/\n\nLinkIdList\022!\n\010link_ids\030\001 \003(\0132\017." + - "context.LinkId\"(\n\010LinkList\022\034\n\005links\030\001 \003(" + - "\0132\r.context.Link\"L\n\tLinkEvent\022\035\n\005event\030\001" + - " \001(\0132\016.context.Event\022 \n\007link_id\030\002 \001(\0132\017." + - "context.LinkId\"X\n\tServiceId\022&\n\ncontext_i" + - "d\030\001 \001(\0132\022.context.ContextId\022#\n\014service_u" + - "uid\030\002 \001(\0132\r.context.Uuid\"\333\002\n\007Service\022&\n\n" + - "service_id\030\001 \001(\0132\022.context.ServiceId\022\014\n\004" + - "name\030\002 \001(\t\022.\n\014service_type\030\003 \001(\0162\030.conte" + - "xt.ServiceTypeEnum\0221\n\024service_endpoint_i" + - "ds\030\004 \003(\0132\023.context.EndPointId\0220\n\023service" + - "_constraints\030\005 \003(\0132\023.context.Constraint\022" + - ".\n\016service_status\030\006 \001(\0132\026.context.Servic" + - "eStatus\022.\n\016service_config\030\007 \001(\0132\026.contex" + - "t.ServiceConfig\022%\n\ttimestamp\030\010 \001(\0132\022.con" + - "text.Timestamp\"C\n\rServiceStatus\0222\n\016servi" + - "ce_status\030\001 \001(\0162\032.context.ServiceStatusE" + - "num\":\n\rServiceConfig\022)\n\014config_rules\030\001 \003" + - "(\0132\023.context.ConfigRule\"8\n\rServiceIdList" + - "\022\'\n\013service_ids\030\001 \003(\0132\022.context.ServiceI" + - "d\"1\n\013ServiceList\022\"\n\010services\030\001 \003(\0132\020.con" + - "text.Service\"\225\001\n\rServiceFilter\022+\n\013servic" + - "e_ids\030\001 \001(\0132\026.context.ServiceIdList\022\034\n\024i" + - "nclude_endpoint_ids\030\002 \001(\010\022\033\n\023include_con" + - "straints\030\003 \001(\010\022\034\n\024include_config_rules\030\004" + - " \001(\010\"U\n\014ServiceEvent\022\035\n\005event\030\001 \001(\0132\016.co" + - "ntext.Event\022&\n\nservice_id\030\002 \001(\0132\022.contex" + - "t.ServiceId\"T\n\007SliceId\022&\n\ncontext_id\030\001 \001" + - "(\0132\022.context.ContextId\022!\n\nslice_uuid\030\002 \001" + - "(\0132\r.context.Uuid\"\240\003\n\005Slice\022\"\n\010slice_id\030" + - "\001 \001(\0132\020.context.SliceId\022\014\n\004name\030\002 \001(\t\022/\n" + - "\022slice_endpoint_ids\030\003 \003(\0132\023.context.EndP" + - "ointId\022.\n\021slice_constraints\030\004 \003(\0132\023.cont" + - "ext.Constraint\022-\n\021slice_service_ids\030\005 \003(" + - "\0132\022.context.ServiceId\022,\n\022slice_subslice_" + - "ids\030\006 \003(\0132\020.context.SliceId\022*\n\014slice_sta" + - "tus\030\007 \001(\0132\024.context.SliceStatus\022*\n\014slice" + - "_config\030\010 \001(\0132\024.context.SliceConfig\022(\n\013s" + - "lice_owner\030\t \001(\0132\023.context.SliceOwner\022%\n" + - "\ttimestamp\030\n \001(\0132\022.context.Timestamp\"E\n\n" + - "SliceOwner\022!\n\nowner_uuid\030\001 \001(\0132\r.context" + - ".Uuid\022\024\n\014owner_string\030\002 \001(\t\"=\n\013SliceStat" + - "us\022.\n\014slice_status\030\001 \001(\0162\030.context.Slice" + - "StatusEnum\"8\n\013SliceConfig\022)\n\014config_rule" + - "s\030\001 \003(\0132\023.context.ConfigRule\"2\n\013SliceIdL" + - "ist\022#\n\tslice_ids\030\001 \003(\0132\020.context.SliceId" + - "\"+\n\tSliceList\022\036\n\006slices\030\001 \003(\0132\016.context." + - "Slice\"\312\001\n\013SliceFilter\022\'\n\tslice_ids\030\001 \001(\013" + - "2\024.context.SliceIdList\022\034\n\024include_endpoi" + - "nt_ids\030\002 \001(\010\022\033\n\023include_constraints\030\003 \001(" + - "\010\022\033\n\023include_service_ids\030\004 \001(\010\022\034\n\024includ" + - "e_subslice_ids\030\005 \001(\010\022\034\n\024include_config_r" + - "ules\030\006 \001(\010\"O\n\nSliceEvent\022\035\n\005event\030\001 \001(\0132" + - "\016.context.Event\022\"\n\010slice_id\030\002 \001(\0132\020.cont" + - "ext.SliceId\"6\n\014ConnectionId\022&\n\017connectio" + - "n_uuid\030\001 \001(\0132\r.context.Uuid\"2\n\025Connectio" + - "nSettings_L0\022\031\n\021lsp_symbolic_name\030\001 \001(\t\"" + - "\236\001\n\025ConnectionSettings_L2\022\027\n\017src_mac_add" + - "ress\030\001 \001(\t\022\027\n\017dst_mac_address\030\002 \001(\t\022\022\n\ne" + - "ther_type\030\003 \001(\r\022\017\n\007vlan_id\030\004 \001(\r\022\022\n\nmpls" + - "_label\030\005 \001(\r\022\032\n\022mpls_traffic_class\030\006 \001(\r" + - "\"t\n\025ConnectionSettings_L3\022\026\n\016src_ip_addr" + - "ess\030\001 \001(\t\022\026\n\016dst_ip_address\030\002 \001(\t\022\014\n\004dsc" + - "p\030\003 \001(\r\022\020\n\010protocol\030\004 \001(\r\022\013\n\003ttl\030\005 \001(\r\"[" + - "\n\025ConnectionSettings_L4\022\020\n\010src_port\030\001 \001(" + - "\r\022\020\n\010dst_port\030\002 \001(\r\022\021\n\ttcp_flags\030\003 \001(\r\022\013" + - "\n\003ttl\030\004 \001(\r\"\304\001\n\022ConnectionSettings\022*\n\002l0" + - "\030\001 \001(\0132\036.context.ConnectionSettings_L0\022*" + - "\n\002l2\030\002 \001(\0132\036.context.ConnectionSettings_" + - "L2\022*\n\002l3\030\003 \001(\0132\036.context.ConnectionSetti" + - "ngs_L3\022*\n\002l4\030\004 \001(\0132\036.context.ConnectionS" + - "ettings_L4\"\363\001\n\nConnection\022,\n\rconnection_" + - "id\030\001 \001(\0132\025.context.ConnectionId\022&\n\nservi" + - "ce_id\030\002 \001(\0132\022.context.ServiceId\0223\n\026path_" + - "hops_endpoint_ids\030\003 \003(\0132\023.context.EndPoi" + - "ntId\022+\n\017sub_service_ids\030\004 \003(\0132\022.context." + - "ServiceId\022-\n\010settings\030\005 \001(\0132\033.context.Co" + - "nnectionSettings\"A\n\020ConnectionIdList\022-\n\016" + - "connection_ids\030\001 \003(\0132\025.context.Connectio" + - "nId\":\n\016ConnectionList\022(\n\013connections\030\001 \003" + - "(\0132\023.context.Connection\"^\n\017ConnectionEve" + - "nt\022\035\n\005event\030\001 \001(\0132\016.context.Event\022,\n\rcon" + - "nection_id\030\002 \001(\0132\025.context.ConnectionId\"" + - "\202\001\n\nEndPointId\022(\n\013topology_id\030\001 \001(\0132\023.co" + - "ntext.TopologyId\022$\n\tdevice_id\030\002 \001(\0132\021.co" + - "ntext.DeviceId\022$\n\rendpoint_uuid\030\003 \001(\0132\r." + - "context.Uuid\"\302\001\n\010EndPoint\022(\n\013endpoint_id" + - "\030\001 \001(\0132\023.context.EndPointId\022\014\n\004name\030\002 \001(" + - "\t\022\025\n\rendpoint_type\030\003 \001(\t\0229\n\020kpi_sample_t" + - "ypes\030\004 \003(\0162\037.kpi_sample_types.KpiSampleT" + - "ype\022,\n\021endpoint_location\030\005 \001(\0132\021.context" + - ".Location\"{\n\014EndPointName\022(\n\013endpoint_id" + - "\030\001 \001(\0132\023.context.EndPointId\022\023\n\013device_na" + - "me\030\002 \001(\t\022\025\n\rendpoint_name\030\003 \001(\t\022\025\n\rendpo" + - "int_type\030\004 \001(\t\";\n\016EndPointIdList\022)\n\014endp" + - "oint_ids\030\001 \003(\0132\023.context.EndPointId\"A\n\020E" + - "ndPointNameList\022-\n\016endpoint_names\030\001 \003(\0132" + - "\025.context.EndPointName\"A\n\021ConfigRule_Cus" + - "tom\022\024\n\014resource_key\030\001 \001(\t\022\026\n\016resource_va" + - "lue\030\002 \001(\t\"]\n\016ConfigRule_ACL\022(\n\013endpoint_" + - "id\030\001 \001(\0132\023.context.EndPointId\022!\n\010rule_se" + - "t\030\002 \001(\0132\017.acl.AclRuleSet\"\234\001\n\nConfigRule\022" + - ")\n\006action\030\001 \001(\0162\031.context.ConfigActionEn" + - "um\022,\n\006custom\030\002 \001(\0132\032.context.ConfigRule_" + - "CustomH\000\022&\n\003acl\030\003 \001(\0132\027.context.ConfigRu" + - "le_ACLH\000B\r\n\013config_rule\"F\n\021Constraint_Cu" + - "stom\022\027\n\017constraint_type\030\001 \001(\t\022\030\n\020constra" + - "int_value\030\002 \001(\t\"E\n\023Constraint_Schedule\022\027" + - "\n\017start_timestamp\030\001 \001(\002\022\025\n\rduration_days" + - "\030\002 \001(\002\"3\n\014GPS_Position\022\020\n\010latitude\030\001 \001(\002" + - "\022\021\n\tlongitude\030\002 \001(\002\"W\n\010Location\022\020\n\006regio" + - "n\030\001 \001(\tH\000\022-\n\014gps_position\030\002 \001(\0132\025.contex" + - "t.GPS_PositionH\000B\n\n\010location\"l\n\033Constrai" + - "nt_EndPointLocation\022(\n\013endpoint_id\030\001 \001(\013" + - "2\023.context.EndPointId\022#\n\010location\030\002 \001(\0132" + - "\021.context.Location\"Y\n\033Constraint_EndPoin" + - "tPriority\022(\n\013endpoint_id\030\001 \001(\0132\023.context" + - ".EndPointId\022\020\n\010priority\030\002 \001(\r\"0\n\026Constra" + - "int_SLA_Latency\022\026\n\016e2e_latency_ms\030\001 \001(\002\"" + - "0\n\027Constraint_SLA_Capacity\022\025\n\rcapacity_g" + - "bps\030\001 \001(\002\"c\n\033Constraint_SLA_Availability" + - "\022\032\n\022num_disjoint_paths\030\001 \001(\r\022\022\n\nall_acti" + - "ve\030\002 \001(\010\022\024\n\014availability\030\003 \001(\002\"V\n\036Constr" + - "aint_SLA_Isolation_level\0224\n\017isolation_le" + - "vel\030\001 \003(\0162\033.context.IsolationLevelEnum\"\242" + - "\001\n\025Constraint_Exclusions\022\024\n\014is_permanent" + - "\030\001 \001(\010\022%\n\ndevice_ids\030\002 \003(\0132\021.context.Dev" + - "iceId\022)\n\014endpoint_ids\030\003 \003(\0132\023.context.En" + - "dPointId\022!\n\010link_ids\030\004 \003(\0132\017.context.Lin" + - "kId\"\333\004\n\nConstraint\022-\n\006action\030\001 \001(\0162\035.con" + - "text.ConstraintActionEnum\022,\n\006custom\030\002 \001(" + - "\0132\032.context.Constraint_CustomH\000\0220\n\010sched" + - "ule\030\003 \001(\0132\034.context.Constraint_ScheduleH" + - "\000\022A\n\021endpoint_location\030\004 \001(\0132$.context.C" + - "onstraint_EndPointLocationH\000\022A\n\021endpoint" + - "_priority\030\005 \001(\0132$.context.Constraint_End" + - "PointPriorityH\000\0228\n\014sla_capacity\030\006 \001(\0132 ." + - "context.Constraint_SLA_CapacityH\000\0226\n\013sla" + - "_latency\030\007 \001(\0132\037.context.Constraint_SLA_" + - "LatencyH\000\022@\n\020sla_availability\030\010 \001(\0132$.co" + - "ntext.Constraint_SLA_AvailabilityH\000\022@\n\rs" + - "la_isolation\030\t \001(\0132\'.context.Constraint_" + - "SLA_Isolation_levelH\000\0224\n\nexclusions\030\n \001(" + - "\0132\036.context.Constraint_ExclusionsH\000B\014\n\nc" + - "onstraint\"^\n\022TeraFlowController\022&\n\nconte" + - "xt_id\030\001 \001(\0132\022.context.ContextId\022\022\n\nip_ad" + - "dress\030\002 \001(\t\022\014\n\004port\030\003 \001(\r\"U\n\024Authenticat" + - "ionResult\022&\n\ncontext_id\030\001 \001(\0132\022.context." + - "ContextId\022\025\n\rauthenticated\030\002 \001(\010*j\n\rEven" + - "tTypeEnum\022\027\n\023EVENTTYPE_UNDEFINED\020\000\022\024\n\020EV" + - "ENTTYPE_CREATE\020\001\022\024\n\020EVENTTYPE_UPDATE\020\002\022\024" + - "\n\020EVENTTYPE_REMOVE\020\003*\231\002\n\020DeviceDriverEnu" + - "m\022\032\n\026DEVICEDRIVER_UNDEFINED\020\000\022\033\n\027DEVICED" + - "RIVER_OPENCONFIG\020\001\022\036\n\032DEVICEDRIVER_TRANS" + - "PORT_API\020\002\022\023\n\017DEVICEDRIVER_P4\020\003\022&\n\"DEVIC" + - "EDRIVER_IETF_NETWORK_TOPOLOGY\020\004\022\033\n\027DEVIC" + - "EDRIVER_ONF_TR_352\020\005\022\023\n\017DEVICEDRIVER_XR\020" + - "\006\022\033\n\027DEVICEDRIVER_IETF_L2VPN\020\007\022 \n\034DEVICE" + - "DRIVER_GNMI_OPENCONFIG\020\010*\217\001\n\033DeviceOpera" + - "tionalStatusEnum\022%\n!DEVICEOPERATIONALSTA" + - "TUS_UNDEFINED\020\000\022$\n DEVICEOPERATIONALSTAT" + - "US_DISABLED\020\001\022#\n\037DEVICEOPERATIONALSTATUS" + - "_ENABLED\020\002*\201\001\n\017ServiceTypeEnum\022\027\n\023SERVIC" + - "ETYPE_UNKNOWN\020\000\022\024\n\020SERVICETYPE_L3NM\020\001\022\024\n" + - "\020SERVICETYPE_L2NM\020\002\022)\n%SERVICETYPE_TAPI_" + - "CONNECTIVITY_SERVICE\020\003*\304\001\n\021ServiceStatus" + - "Enum\022\033\n\027SERVICESTATUS_UNDEFINED\020\000\022\031\n\025SER" + - "VICESTATUS_PLANNED\020\001\022\030\n\024SERVICESTATUS_AC" + - "TIVE\020\002\022\032\n\026SERVICESTATUS_UPDATING\020\003\022!\n\035SE" + - "RVICESTATUS_PENDING_REMOVAL\020\004\022\036\n\032SERVICE" + - "STATUS_SLA_VIOLATED\020\005*\251\001\n\017SliceStatusEnu" + - "m\022\031\n\025SLICESTATUS_UNDEFINED\020\000\022\027\n\023SLICESTA" + - "TUS_PLANNED\020\001\022\024\n\020SLICESTATUS_INIT\020\002\022\026\n\022S" + - "LICESTATUS_ACTIVE\020\003\022\026\n\022SLICESTATUS_DEINI" + - "T\020\004\022\034\n\030SLICESTATUS_SLA_VIOLATED\020\005*]\n\020Con" + - "figActionEnum\022\032\n\026CONFIGACTION_UNDEFINED\020" + - "\000\022\024\n\020CONFIGACTION_SET\020\001\022\027\n\023CONFIGACTION_" + - "DELETE\020\002*m\n\024ConstraintActionEnum\022\036\n\032CONS" + - "TRAINTACTION_UNDEFINED\020\000\022\030\n\024CONSTRAINTAC" + - "TION_SET\020\001\022\033\n\027CONSTRAINTACTION_DELETE\020\002*" + - "\203\002\n\022IsolationLevelEnum\022\020\n\014NO_ISOLATION\020\000" + - "\022\026\n\022PHYSICAL_ISOLATION\020\001\022\025\n\021LOGICAL_ISOL" + - "ATION\020\002\022\025\n\021PROCESS_ISOLATION\020\003\022\035\n\031PHYSIC" + - "AL_MEMORY_ISOLATION\020\004\022\036\n\032PHYSICAL_NETWOR" + - "K_ISOLATION\020\005\022\036\n\032VIRTUAL_RESOURCE_ISOLAT" + - "ION\020\006\022\037\n\033NETWORK_FUNCTIONS_ISOLATION\020\007\022\025" + - "\n\021SERVICE_ISOLATION\020\0102\245\026\n\016ContextService" + - "\022:\n\016ListContextIds\022\016.context.Empty\032\026.con" + - "text.ContextIdList\"\000\0226\n\014ListContexts\022\016.c" + - "ontext.Empty\032\024.context.ContextList\"\000\0224\n\n" + - "GetContext\022\022.context.ContextId\032\020.context" + - ".Context\"\000\0224\n\nSetContext\022\020.context.Conte" + - "xt\032\022.context.ContextId\"\000\0225\n\rRemoveContex" + - "t\022\022.context.ContextId\032\016.context.Empty\"\000\022" + - "=\n\020GetContextEvents\022\016.context.Empty\032\025.co" + - "ntext.ContextEvent\"\0000\001\022@\n\017ListTopologyId" + - "s\022\022.context.ContextId\032\027.context.Topology" + - "IdList\"\000\022=\n\016ListTopologies\022\022.context.Con" + - "textId\032\025.context.TopologyList\"\000\0227\n\013GetTo" + - "pology\022\023.context.TopologyId\032\021.context.To" + - "pology\"\000\022E\n\022GetTopologyDetails\022\023.context" + - ".TopologyId\032\030.context.TopologyDetails\"\000\022" + - "7\n\013SetTopology\022\021.context.Topology\032\023.cont" + - "ext.TopologyId\"\000\0227\n\016RemoveTopology\022\023.con" + - "text.TopologyId\032\016.context.Empty\"\000\022?\n\021Get" + - "TopologyEvents\022\016.context.Empty\032\026.context" + - ".TopologyEvent\"\0000\001\0228\n\rListDeviceIds\022\016.co" + - "ntext.Empty\032\025.context.DeviceIdList\"\000\0224\n\013" + - "ListDevices\022\016.context.Empty\032\023.context.De" + - "viceList\"\000\0221\n\tGetDevice\022\021.context.Device" + - "Id\032\017.context.Device\"\000\0221\n\tSetDevice\022\017.con" + - "text.Device\032\021.context.DeviceId\"\000\0223\n\014Remo" + - "veDevice\022\021.context.DeviceId\032\016.context.Em" + - "pty\"\000\022;\n\017GetDeviceEvents\022\016.context.Empty" + - "\032\024.context.DeviceEvent\"\0000\001\022<\n\014SelectDevi" + - "ce\022\025.context.DeviceFilter\032\023.context.Devi" + - "ceList\"\000\022I\n\021ListEndPointNames\022\027.context." + - "EndPointIdList\032\031.context.EndPointNameLis" + - "t\"\000\0224\n\013ListLinkIds\022\016.context.Empty\032\023.con" + - "text.LinkIdList\"\000\0220\n\tListLinks\022\016.context" + - ".Empty\032\021.context.LinkList\"\000\022+\n\007GetLink\022\017" + - ".context.LinkId\032\r.context.Link\"\000\022+\n\007SetL" + - "ink\022\r.context.Link\032\017.context.LinkId\"\000\022/\n" + - "\nRemoveLink\022\017.context.LinkId\032\016.context.E" + - "mpty\"\000\0227\n\rGetLinkEvents\022\016.context.Empty\032" + - "\022.context.LinkEvent\"\0000\001\022>\n\016ListServiceId" + - "s\022\022.context.ContextId\032\026.context.ServiceI" + - "dList\"\000\022:\n\014ListServices\022\022.context.Contex" + - "tId\032\024.context.ServiceList\"\000\0224\n\nGetServic" + - "e\022\022.context.ServiceId\032\020.context.Service\"" + - "\000\0224\n\nSetService\022\020.context.Service\032\022.cont" + - "ext.ServiceId\"\000\0226\n\014UnsetService\022\020.contex" + - "t.Service\032\022.context.ServiceId\"\000\0225\n\rRemov" + - "eService\022\022.context.ServiceId\032\016.context.E" + - "mpty\"\000\022=\n\020GetServiceEvents\022\016.context.Emp" + - "ty\032\025.context.ServiceEvent\"\0000\001\022?\n\rSelectS" + - "ervice\022\026.context.ServiceFilter\032\024.context" + - ".ServiceList\"\000\022:\n\014ListSliceIds\022\022.context" + - ".ContextId\032\024.context.SliceIdList\"\000\0226\n\nLi" + - "stSlices\022\022.context.ContextId\032\022.context.S" + - "liceList\"\000\022.\n\010GetSlice\022\020.context.SliceId" + - "\032\016.context.Slice\"\000\022.\n\010SetSlice\022\016.context" + - ".Slice\032\020.context.SliceId\"\000\0220\n\nUnsetSlice" + - "\022\016.context.Slice\032\020.context.SliceId\"\000\0221\n\013" + - "RemoveSlice\022\020.context.SliceId\032\016.context." + - "Empty\"\000\0229\n\016GetSliceEvents\022\016.context.Empt" + - "y\032\023.context.SliceEvent\"\0000\001\0229\n\013SelectSlic" + - "e\022\024.context.SliceFilter\032\022.context.SliceL" + - "ist\"\000\022D\n\021ListConnectionIds\022\022.context.Ser" + - "viceId\032\031.context.ConnectionIdList\"\000\022@\n\017L" + - "istConnections\022\022.context.ServiceId\032\027.con" + - "text.ConnectionList\"\000\022=\n\rGetConnection\022\025" + - ".context.ConnectionId\032\023.context.Connecti" + - "on\"\000\022=\n\rSetConnection\022\023.context.Connecti" + - "on\032\025.context.ConnectionId\"\000\022;\n\020RemoveCon" + - "nection\022\025.context.ConnectionId\032\016.context" + - ".Empty\"\000\022C\n\023GetConnectionEvents\022\016.contex" + - "t.Empty\032\030.context.ConnectionEvent\"\0000\001b\006p" + - "roto3" + "\007 \003(\0132\021.context.EndPoint\022&\n\ncomponents\030\010" + + " \003(\0132\022.context.Component\022(\n\rcontroller_i" + + "d\030\t \001(\0132\021.context.DeviceId\"\311\001\n\tComponent" + + "\022%\n\016component_uuid\030\001 \001(\0132\r.context.Uuid\022" + + "\014\n\004name\030\002 \001(\t\022\014\n\004type\030\003 \001(\t\0226\n\nattribute" + + "s\030\004 \003(\0132\".context.Component.AttributesEn" + + "try\022\016\n\006parent\030\005 \001(\t\0321\n\017AttributesEntry\022\013" + + "\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001\"9\n\014Device" + + "Config\022)\n\014config_rules\030\001 \003(\0132\023.context.C" + + "onfigRule\"5\n\014DeviceIdList\022%\n\ndevice_ids\030" + + "\001 \003(\0132\021.context.DeviceId\".\n\nDeviceList\022 " + + "\n\007devices\030\001 \003(\0132\017.context.Device\"\216\001\n\014Dev" + + "iceFilter\022)\n\ndevice_ids\030\001 \001(\0132\025.context." + + "DeviceIdList\022\031\n\021include_endpoints\030\002 \001(\010\022" + + "\034\n\024include_config_rules\030\003 \001(\010\022\032\n\022include" + + "_components\030\004 \001(\010\"\200\001\n\013DeviceEvent\022\035\n\005eve" + + "nt\030\001 \001(\0132\016.context.Event\022$\n\tdevice_id\030\002 " + + "\001(\0132\021.context.DeviceId\022,\n\rdevice_config\030" + + "\003 \001(\0132\025.context.DeviceConfig\"*\n\006LinkId\022 " + + "\n\tlink_uuid\030\001 \001(\0132\r.context.Uuid\"I\n\016Link" + + "Attributes\022\033\n\023total_capacity_gbps\030\001 \001(\002\022" + + "\032\n\022used_capacity_gbps\030\002 \001(\002\"\223\001\n\004Link\022 \n\007" + + "link_id\030\001 \001(\0132\017.context.LinkId\022\014\n\004name\030\002" + + " \001(\t\022.\n\021link_endpoint_ids\030\003 \003(\0132\023.contex" + + "t.EndPointId\022+\n\nattributes\030\004 \001(\0132\027.conte" + + "xt.LinkAttributes\"/\n\nLinkIdList\022!\n\010link_" + + "ids\030\001 \003(\0132\017.context.LinkId\"(\n\010LinkList\022\034" + + "\n\005links\030\001 \003(\0132\r.context.Link\"L\n\tLinkEven" + + "t\022\035\n\005event\030\001 \001(\0132\016.context.Event\022 \n\007link" + + "_id\030\002 \001(\0132\017.context.LinkId\"X\n\tServiceId\022" + + "&\n\ncontext_id\030\001 \001(\0132\022.context.ContextId\022" + + "#\n\014service_uuid\030\002 \001(\0132\r.context.Uuid\"\333\002\n" + + "\007Service\022&\n\nservice_id\030\001 \001(\0132\022.context.S" + + "erviceId\022\014\n\004name\030\002 \001(\t\022.\n\014service_type\030\003" + + " \001(\0162\030.context.ServiceTypeEnum\0221\n\024servic" + + "e_endpoint_ids\030\004 \003(\0132\023.context.EndPointI" + + "d\0220\n\023service_constraints\030\005 \003(\0132\023.context" + + ".Constraint\022.\n\016service_status\030\006 \001(\0132\026.co" + + "ntext.ServiceStatus\022.\n\016service_config\030\007 " + + "\001(\0132\026.context.ServiceConfig\022%\n\ttimestamp" + + "\030\010 \001(\0132\022.context.Timestamp\"C\n\rServiceSta" + + "tus\0222\n\016service_status\030\001 \001(\0162\032.context.Se" + + "rviceStatusEnum\":\n\rServiceConfig\022)\n\014conf" + + "ig_rules\030\001 \003(\0132\023.context.ConfigRule\"8\n\rS" + + "erviceIdList\022\'\n\013service_ids\030\001 \003(\0132\022.cont" + + "ext.ServiceId\"1\n\013ServiceList\022\"\n\010services" + + "\030\001 \003(\0132\020.context.Service\"\225\001\n\rServiceFilt" + + "er\022+\n\013service_ids\030\001 \001(\0132\026.context.Servic" + + "eIdList\022\034\n\024include_endpoint_ids\030\002 \001(\010\022\033\n" + + "\023include_constraints\030\003 \001(\010\022\034\n\024include_co" + + "nfig_rules\030\004 \001(\010\"U\n\014ServiceEvent\022\035\n\005even" + + "t\030\001 \001(\0132\016.context.Event\022&\n\nservice_id\030\002 " + + "\001(\0132\022.context.ServiceId\"T\n\007SliceId\022&\n\nco" + + "ntext_id\030\001 \001(\0132\022.context.ContextId\022!\n\nsl" + + "ice_uuid\030\002 \001(\0132\r.context.Uuid\"\240\003\n\005Slice\022" + + "\"\n\010slice_id\030\001 \001(\0132\020.context.SliceId\022\014\n\004n" + + "ame\030\002 \001(\t\022/\n\022slice_endpoint_ids\030\003 \003(\0132\023." + + "context.EndPointId\022.\n\021slice_constraints\030" + + "\004 \003(\0132\023.context.Constraint\022-\n\021slice_serv" + + "ice_ids\030\005 \003(\0132\022.context.ServiceId\022,\n\022sli" + + "ce_subslice_ids\030\006 \003(\0132\020.context.SliceId\022" + + "*\n\014slice_status\030\007 \001(\0132\024.context.SliceSta" + + "tus\022*\n\014slice_config\030\010 \001(\0132\024.context.Slic" + + "eConfig\022(\n\013slice_owner\030\t \001(\0132\023.context.S" + + "liceOwner\022%\n\ttimestamp\030\n \001(\0132\022.context.T" + + "imestamp\"E\n\nSliceOwner\022!\n\nowner_uuid\030\001 \001" + + "(\0132\r.context.Uuid\022\024\n\014owner_string\030\002 \001(\t\"" + + "=\n\013SliceStatus\022.\n\014slice_status\030\001 \001(\0162\030.c" + + "ontext.SliceStatusEnum\"8\n\013SliceConfig\022)\n" + + "\014config_rules\030\001 \003(\0132\023.context.ConfigRule" + + "\"2\n\013SliceIdList\022#\n\tslice_ids\030\001 \003(\0132\020.con" + + "text.SliceId\"+\n\tSliceList\022\036\n\006slices\030\001 \003(" + + "\0132\016.context.Slice\"\312\001\n\013SliceFilter\022\'\n\tsli" + + "ce_ids\030\001 \001(\0132\024.context.SliceIdList\022\034\n\024in" + + "clude_endpoint_ids\030\002 \001(\010\022\033\n\023include_cons" + + "traints\030\003 \001(\010\022\033\n\023include_service_ids\030\004 \001" + + "(\010\022\034\n\024include_subslice_ids\030\005 \001(\010\022\034\n\024incl" + + "ude_config_rules\030\006 \001(\010\"O\n\nSliceEvent\022\035\n\005" + + "event\030\001 \001(\0132\016.context.Event\022\"\n\010slice_id\030" + + "\002 \001(\0132\020.context.SliceId\"6\n\014ConnectionId\022" + + "&\n\017connection_uuid\030\001 \001(\0132\r.context.Uuid\"" + + "2\n\025ConnectionSettings_L0\022\031\n\021lsp_symbolic" + + "_name\030\001 \001(\t\"\236\001\n\025ConnectionSettings_L2\022\027\n" + + "\017src_mac_address\030\001 \001(\t\022\027\n\017dst_mac_addres" + + "s\030\002 \001(\t\022\022\n\nether_type\030\003 \001(\r\022\017\n\007vlan_id\030\004" + + " \001(\r\022\022\n\nmpls_label\030\005 \001(\r\022\032\n\022mpls_traffic" + + "_class\030\006 \001(\r\"t\n\025ConnectionSettings_L3\022\026\n" + + "\016src_ip_address\030\001 \001(\t\022\026\n\016dst_ip_address\030" + + "\002 \001(\t\022\014\n\004dscp\030\003 \001(\r\022\020\n\010protocol\030\004 \001(\r\022\013\n" + + "\003ttl\030\005 \001(\r\"[\n\025ConnectionSettings_L4\022\020\n\010s" + + "rc_port\030\001 \001(\r\022\020\n\010dst_port\030\002 \001(\r\022\021\n\ttcp_f" + + "lags\030\003 \001(\r\022\013\n\003ttl\030\004 \001(\r\"\304\001\n\022ConnectionSe" + + "ttings\022*\n\002l0\030\001 \001(\0132\036.context.ConnectionS" + + "ettings_L0\022*\n\002l2\030\002 \001(\0132\036.context.Connect" + + "ionSettings_L2\022*\n\002l3\030\003 \001(\0132\036.context.Con" + + "nectionSettings_L3\022*\n\002l4\030\004 \001(\0132\036.context" + + ".ConnectionSettings_L4\"\363\001\n\nConnection\022,\n" + + "\rconnection_id\030\001 \001(\0132\025.context.Connectio" + + "nId\022&\n\nservice_id\030\002 \001(\0132\022.context.Servic" + + "eId\0223\n\026path_hops_endpoint_ids\030\003 \003(\0132\023.co" + + "ntext.EndPointId\022+\n\017sub_service_ids\030\004 \003(" + + "\0132\022.context.ServiceId\022-\n\010settings\030\005 \001(\0132" + + "\033.context.ConnectionSettings\"A\n\020Connecti" + + "onIdList\022-\n\016connection_ids\030\001 \003(\0132\025.conte" + + "xt.ConnectionId\":\n\016ConnectionList\022(\n\013con" + + "nections\030\001 \003(\0132\023.context.Connection\"^\n\017C" + + "onnectionEvent\022\035\n\005event\030\001 \001(\0132\016.context." + + "Event\022,\n\rconnection_id\030\002 \001(\0132\025.context.C" + + "onnectionId\"\202\001\n\nEndPointId\022(\n\013topology_i" + + "d\030\001 \001(\0132\023.context.TopologyId\022$\n\tdevice_i" + + "d\030\002 \001(\0132\021.context.DeviceId\022$\n\rendpoint_u" + + "uid\030\003 \001(\0132\r.context.Uuid\"\302\001\n\010EndPoint\022(\n" + + "\013endpoint_id\030\001 \001(\0132\023.context.EndPointId\022" + + "\014\n\004name\030\002 \001(\t\022\025\n\rendpoint_type\030\003 \001(\t\0229\n\020" + + "kpi_sample_types\030\004 \003(\0162\037.kpi_sample_type" + + "s.KpiSampleType\022,\n\021endpoint_location\030\005 \001" + + "(\0132\021.context.Location\"{\n\014EndPointName\022(\n" + + "\013endpoint_id\030\001 \001(\0132\023.context.EndPointId\022" + + "\023\n\013device_name\030\002 \001(\t\022\025\n\rendpoint_name\030\003 " + + "\001(\t\022\025\n\rendpoint_type\030\004 \001(\t\";\n\016EndPointId" + + "List\022)\n\014endpoint_ids\030\001 \003(\0132\023.context.End" + + "PointId\"A\n\020EndPointNameList\022-\n\016endpoint_" + + "names\030\001 \003(\0132\025.context.EndPointName\"A\n\021Co" + + "nfigRule_Custom\022\024\n\014resource_key\030\001 \001(\t\022\026\n" + + "\016resource_value\030\002 \001(\t\"]\n\016ConfigRule_ACL\022" + + "(\n\013endpoint_id\030\001 \001(\0132\023.context.EndPointI" + + "d\022!\n\010rule_set\030\002 \001(\0132\017.acl.AclRuleSet\"\234\001\n" + + "\nConfigRule\022)\n\006action\030\001 \001(\0162\031.context.Co" + + "nfigActionEnum\022,\n\006custom\030\002 \001(\0132\032.context" + + ".ConfigRule_CustomH\000\022&\n\003acl\030\003 \001(\0132\027.cont" + + "ext.ConfigRule_ACLH\000B\r\n\013config_rule\"F\n\021C" + + "onstraint_Custom\022\027\n\017constraint_type\030\001 \001(" + + "\t\022\030\n\020constraint_value\030\002 \001(\t\"E\n\023Constrain" + + "t_Schedule\022\027\n\017start_timestamp\030\001 \001(\002\022\025\n\rd" + + "uration_days\030\002 \001(\002\"3\n\014GPS_Position\022\020\n\010la" + + "titude\030\001 \001(\002\022\021\n\tlongitude\030\002 \001(\002\"W\n\010Locat" + + "ion\022\020\n\006region\030\001 \001(\tH\000\022-\n\014gps_position\030\002 " + + "\001(\0132\025.context.GPS_PositionH\000B\n\n\010location" + + "\"l\n\033Constraint_EndPointLocation\022(\n\013endpo" + + "int_id\030\001 \001(\0132\023.context.EndPointId\022#\n\010loc" + + "ation\030\002 \001(\0132\021.context.Location\"Y\n\033Constr" + + "aint_EndPointPriority\022(\n\013endpoint_id\030\001 \001" + + "(\0132\023.context.EndPointId\022\020\n\010priority\030\002 \001(" + + "\r\"0\n\026Constraint_SLA_Latency\022\026\n\016e2e_laten" + + "cy_ms\030\001 \001(\002\"0\n\027Constraint_SLA_Capacity\022\025" + + "\n\rcapacity_gbps\030\001 \001(\002\"c\n\033Constraint_SLA_" + + "Availability\022\032\n\022num_disjoint_paths\030\001 \001(\r" + + "\022\022\n\nall_active\030\002 \001(\010\022\024\n\014availability\030\003 \001" + + "(\002\"V\n\036Constraint_SLA_Isolation_level\0224\n\017" + + "isolation_level\030\001 \003(\0162\033.context.Isolatio" + + "nLevelEnum\"\242\001\n\025Constraint_Exclusions\022\024\n\014" + + "is_permanent\030\001 \001(\010\022%\n\ndevice_ids\030\002 \003(\0132\021" + + ".context.DeviceId\022)\n\014endpoint_ids\030\003 \003(\0132" + + "\023.context.EndPointId\022!\n\010link_ids\030\004 \003(\0132\017" + + ".context.LinkId\"\333\004\n\nConstraint\022-\n\006action" + + "\030\001 \001(\0162\035.context.ConstraintActionEnum\022,\n" + + "\006custom\030\002 \001(\0132\032.context.Constraint_Custo" + + "mH\000\0220\n\010schedule\030\003 \001(\0132\034.context.Constrai" + + "nt_ScheduleH\000\022A\n\021endpoint_location\030\004 \001(\013" + + "2$.context.Constraint_EndPointLocationH\000" + + "\022A\n\021endpoint_priority\030\005 \001(\0132$.context.Co" + + "nstraint_EndPointPriorityH\000\0228\n\014sla_capac" + + "ity\030\006 \001(\0132 .context.Constraint_SLA_Capac" + + "ityH\000\0226\n\013sla_latency\030\007 \001(\0132\037.context.Con" + + "straint_SLA_LatencyH\000\022@\n\020sla_availabilit" + + "y\030\010 \001(\0132$.context.Constraint_SLA_Availab" + + "ilityH\000\022@\n\rsla_isolation\030\t \001(\0132\'.context" + + ".Constraint_SLA_Isolation_levelH\000\0224\n\nexc" + + "lusions\030\n \001(\0132\036.context.Constraint_Exclu" + + "sionsH\000B\014\n\nconstraint\"^\n\022TeraFlowControl" + + "ler\022&\n\ncontext_id\030\001 \001(\0132\022.context.Contex" + + "tId\022\022\n\nip_address\030\002 \001(\t\022\014\n\004port\030\003 \001(\r\"U\n" + + "\024AuthenticationResult\022&\n\ncontext_id\030\001 \001(" + + "\0132\022.context.ContextId\022\025\n\rauthenticated\030\002" + + " \001(\010*j\n\rEventTypeEnum\022\027\n\023EVENTTYPE_UNDEF" + + "INED\020\000\022\024\n\020EVENTTYPE_CREATE\020\001\022\024\n\020EVENTTYP" + + "E_UPDATE\020\002\022\024\n\020EVENTTYPE_REMOVE\020\003*\231\002\n\020Dev" + + "iceDriverEnum\022\032\n\026DEVICEDRIVER_UNDEFINED\020" + + "\000\022\033\n\027DEVICEDRIVER_OPENCONFIG\020\001\022\036\n\032DEVICE" + + "DRIVER_TRANSPORT_API\020\002\022\023\n\017DEVICEDRIVER_P" + + "4\020\003\022&\n\"DEVICEDRIVER_IETF_NETWORK_TOPOLOG" + + "Y\020\004\022\033\n\027DEVICEDRIVER_ONF_TR_532\020\005\022\023\n\017DEVI" + + "CEDRIVER_XR\020\006\022\033\n\027DEVICEDRIVER_IETF_L2VPN" + + "\020\007\022 \n\034DEVICEDRIVER_GNMI_OPENCONFIG\020\010*\217\001\n" + + "\033DeviceOperationalStatusEnum\022%\n!DEVICEOP" + + "ERATIONALSTATUS_UNDEFINED\020\000\022$\n DEVICEOPE" + + "RATIONALSTATUS_DISABLED\020\001\022#\n\037DEVICEOPERA" + + "TIONALSTATUS_ENABLED\020\002*\225\001\n\017ServiceTypeEn" + + "um\022\027\n\023SERVICETYPE_UNKNOWN\020\000\022\024\n\020SERVICETY" + + "PE_L3NM\020\001\022\024\n\020SERVICETYPE_L2NM\020\002\022)\n%SERVI" + + "CETYPE_TAPI_CONNECTIVITY_SERVICE\020\003\022\022\n\016SE" + + "RVICETYPE_TE\020\004*\304\001\n\021ServiceStatusEnum\022\033\n\027" + + "SERVICESTATUS_UNDEFINED\020\000\022\031\n\025SERVICESTAT" + + "US_PLANNED\020\001\022\030\n\024SERVICESTATUS_ACTIVE\020\002\022\032" + + "\n\026SERVICESTATUS_UPDATING\020\003\022!\n\035SERVICESTA" + + "TUS_PENDING_REMOVAL\020\004\022\036\n\032SERVICESTATUS_S" + + "LA_VIOLATED\020\005*\251\001\n\017SliceStatusEnum\022\031\n\025SLI" + + "CESTATUS_UNDEFINED\020\000\022\027\n\023SLICESTATUS_PLAN" + + "NED\020\001\022\024\n\020SLICESTATUS_INIT\020\002\022\026\n\022SLICESTAT" + + "US_ACTIVE\020\003\022\026\n\022SLICESTATUS_DEINIT\020\004\022\034\n\030S" + + "LICESTATUS_SLA_VIOLATED\020\005*]\n\020ConfigActio" + + "nEnum\022\032\n\026CONFIGACTION_UNDEFINED\020\000\022\024\n\020CON" + + "FIGACTION_SET\020\001\022\027\n\023CONFIGACTION_DELETE\020\002" + + "*m\n\024ConstraintActionEnum\022\036\n\032CONSTRAINTAC" + + "TION_UNDEFINED\020\000\022\030\n\024CONSTRAINTACTION_SET" + + "\020\001\022\033\n\027CONSTRAINTACTION_DELETE\020\002*\203\002\n\022Isol" + + "ationLevelEnum\022\020\n\014NO_ISOLATION\020\000\022\026\n\022PHYS" + + "ICAL_ISOLATION\020\001\022\025\n\021LOGICAL_ISOLATION\020\002\022" + + "\025\n\021PROCESS_ISOLATION\020\003\022\035\n\031PHYSICAL_MEMOR" + + "Y_ISOLATION\020\004\022\036\n\032PHYSICAL_NETWORK_ISOLAT" + + "ION\020\005\022\036\n\032VIRTUAL_RESOURCE_ISOLATION\020\006\022\037\n" + + "\033NETWORK_FUNCTIONS_ISOLATION\020\007\022\025\n\021SERVIC" + + "E_ISOLATION\020\0102\245\026\n\016ContextService\022:\n\016List" + + "ContextIds\022\016.context.Empty\032\026.context.Con" + + "textIdList\"\000\0226\n\014ListContexts\022\016.context.E" + + "mpty\032\024.context.ContextList\"\000\0224\n\nGetConte" + + "xt\022\022.context.ContextId\032\020.context.Context" + + "\"\000\0224\n\nSetContext\022\020.context.Context\032\022.con" + + "text.ContextId\"\000\0225\n\rRemoveContext\022\022.cont" + + "ext.ContextId\032\016.context.Empty\"\000\022=\n\020GetCo" + + "ntextEvents\022\016.context.Empty\032\025.context.Co" + + "ntextEvent\"\0000\001\022@\n\017ListTopologyIds\022\022.cont" + + "ext.ContextId\032\027.context.TopologyIdList\"\000" + + "\022=\n\016ListTopologies\022\022.context.ContextId\032\025" + + ".context.TopologyList\"\000\0227\n\013GetTopology\022\023" + + ".context.TopologyId\032\021.context.Topology\"\000" + + "\022E\n\022GetTopologyDetails\022\023.context.Topolog" + + "yId\032\030.context.TopologyDetails\"\000\0227\n\013SetTo" + + "pology\022\021.context.Topology\032\023.context.Topo" + + "logyId\"\000\0227\n\016RemoveTopology\022\023.context.Top" + + "ologyId\032\016.context.Empty\"\000\022?\n\021GetTopology" + + "Events\022\016.context.Empty\032\026.context.Topolog" + + "yEvent\"\0000\001\0228\n\rListDeviceIds\022\016.context.Em" + + "pty\032\025.context.DeviceIdList\"\000\0224\n\013ListDevi" + + "ces\022\016.context.Empty\032\023.context.DeviceList" + + "\"\000\0221\n\tGetDevice\022\021.context.DeviceId\032\017.con" + + "text.Device\"\000\0221\n\tSetDevice\022\017.context.Dev" + + "ice\032\021.context.DeviceId\"\000\0223\n\014RemoveDevice" + + "\022\021.context.DeviceId\032\016.context.Empty\"\000\022;\n" + + "\017GetDeviceEvents\022\016.context.Empty\032\024.conte" + + "xt.DeviceEvent\"\0000\001\022<\n\014SelectDevice\022\025.con" + + "text.DeviceFilter\032\023.context.DeviceList\"\000" + + "\022I\n\021ListEndPointNames\022\027.context.EndPoint" + + "IdList\032\031.context.EndPointNameList\"\000\0224\n\013L" + + "istLinkIds\022\016.context.Empty\032\023.context.Lin" + + "kIdList\"\000\0220\n\tListLinks\022\016.context.Empty\032\021" + + ".context.LinkList\"\000\022+\n\007GetLink\022\017.context" + + ".LinkId\032\r.context.Link\"\000\022+\n\007SetLink\022\r.co" + + "ntext.Link\032\017.context.LinkId\"\000\022/\n\nRemoveL" + + "ink\022\017.context.LinkId\032\016.context.Empty\"\000\0227" + + "\n\rGetLinkEvents\022\016.context.Empty\032\022.contex" + + "t.LinkEvent\"\0000\001\022>\n\016ListServiceIds\022\022.cont" + + "ext.ContextId\032\026.context.ServiceIdList\"\000\022" + + ":\n\014ListServices\022\022.context.ContextId\032\024.co" + + "ntext.ServiceList\"\000\0224\n\nGetService\022\022.cont" + + "ext.ServiceId\032\020.context.Service\"\000\0224\n\nSet" + + "Service\022\020.context.Service\032\022.context.Serv" + + "iceId\"\000\0226\n\014UnsetService\022\020.context.Servic" + + "e\032\022.context.ServiceId\"\000\0225\n\rRemoveService" + + "\022\022.context.ServiceId\032\016.context.Empty\"\000\022=" + + "\n\020GetServiceEvents\022\016.context.Empty\032\025.con" + + "text.ServiceEvent\"\0000\001\022?\n\rSelectService\022\026" + + ".context.ServiceFilter\032\024.context.Service" + + "List\"\000\022:\n\014ListSliceIds\022\022.context.Context" + + "Id\032\024.context.SliceIdList\"\000\0226\n\nListSlices" + + "\022\022.context.ContextId\032\022.context.SliceList" + + "\"\000\022.\n\010GetSlice\022\020.context.SliceId\032\016.conte" + + "xt.Slice\"\000\022.\n\010SetSlice\022\016.context.Slice\032\020" + + ".context.SliceId\"\000\0220\n\nUnsetSlice\022\016.conte" + + "xt.Slice\032\020.context.SliceId\"\000\0221\n\013RemoveSl" + + "ice\022\020.context.SliceId\032\016.context.Empty\"\000\022" + + "9\n\016GetSliceEvents\022\016.context.Empty\032\023.cont" + + "ext.SliceEvent\"\0000\001\0229\n\013SelectSlice\022\024.cont" + + "ext.SliceFilter\032\022.context.SliceList\"\000\022D\n" + + "\021ListConnectionIds\022\022.context.ServiceId\032\031" + + ".context.ConnectionIdList\"\000\022@\n\017ListConne" + + "ctions\022\022.context.ServiceId\032\027.context.Con" + + "nectionList\"\000\022=\n\rGetConnection\022\025.context" + + ".ConnectionId\032\023.context.Connection\"\000\022=\n\r" + + "SetConnection\022\023.context.Connection\032\025.con" + + "text.ConnectionId\"\000\022;\n\020RemoveConnection\022" + + "\025.context.ConnectionId\032\016.context.Empty\"\000" + + "\022C\n\023GetConnectionEvents\022\016.context.Empty\032" + + "\030.context.ConnectionEvent\"\0000\001b\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor .internalBuildGeneratedFileFrom(descriptorData, @@ -74426,13 +76042,19 @@ public final class ContextOuterClass { internal_static_context_Device_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_context_Device_descriptor, - new java.lang.String[] { "DeviceId", "Name", "DeviceType", "DeviceConfig", "DeviceOperationalStatus", "DeviceDrivers", "DeviceEndpoints", "Component", "ControllerId", }); + new java.lang.String[] { "DeviceId", "Name", "DeviceType", "DeviceConfig", "DeviceOperationalStatus", "DeviceDrivers", "DeviceEndpoints", "Components", "ControllerId", }); internal_static_context_Component_descriptor = getDescriptor().getMessageTypes().get(17); internal_static_context_Component_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_context_Component_descriptor, - new java.lang.String[] { "CompString", }); + new java.lang.String[] { "ComponentUuid", "Name", "Type", "Attributes", "Parent", }); + internal_static_context_Component_AttributesEntry_descriptor = + internal_static_context_Component_descriptor.getNestedTypes().get(0); + internal_static_context_Component_AttributesEntry_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_context_Component_AttributesEntry_descriptor, + new java.lang.String[] { "Key", "Value", }); internal_static_context_DeviceConfig_descriptor = getDescriptor().getMessageTypes().get(18); internal_static_context_DeviceConfig_fieldAccessorTable = new @@ -74469,320 +76091,326 @@ public final class ContextOuterClass { com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_context_LinkId_descriptor, new java.lang.String[] { "LinkUuid", }); - internal_static_context_Link_descriptor = + internal_static_context_LinkAttributes_descriptor = getDescriptor().getMessageTypes().get(24); + internal_static_context_LinkAttributes_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_context_LinkAttributes_descriptor, + new java.lang.String[] { "TotalCapacityGbps", "UsedCapacityGbps", }); + internal_static_context_Link_descriptor = + getDescriptor().getMessageTypes().get(25); internal_static_context_Link_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_context_Link_descriptor, - new java.lang.String[] { "LinkId", "Name", "LinkEndpointIds", }); + new java.lang.String[] { "LinkId", "Name", "LinkEndpointIds", "Attributes", }); internal_static_context_LinkIdList_descriptor = - getDescriptor().getMessageTypes().get(25); + getDescriptor().getMessageTypes().get(26); internal_static_context_LinkIdList_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_context_LinkIdList_descriptor, new java.lang.String[] { "LinkIds", }); internal_static_context_LinkList_descriptor = - getDescriptor().getMessageTypes().get(26); + getDescriptor().getMessageTypes().get(27); internal_static_context_LinkList_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_context_LinkList_descriptor, new java.lang.String[] { "Links", }); internal_static_context_LinkEvent_descriptor = - getDescriptor().getMessageTypes().get(27); + getDescriptor().getMessageTypes().get(28); internal_static_context_LinkEvent_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_context_LinkEvent_descriptor, new java.lang.String[] { "Event", "LinkId", }); internal_static_context_ServiceId_descriptor = - getDescriptor().getMessageTypes().get(28); + getDescriptor().getMessageTypes().get(29); internal_static_context_ServiceId_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_context_ServiceId_descriptor, new java.lang.String[] { "ContextId", "ServiceUuid", }); internal_static_context_Service_descriptor = - getDescriptor().getMessageTypes().get(29); + getDescriptor().getMessageTypes().get(30); internal_static_context_Service_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_context_Service_descriptor, new java.lang.String[] { "ServiceId", "Name", "ServiceType", "ServiceEndpointIds", "ServiceConstraints", "ServiceStatus", "ServiceConfig", "Timestamp", }); internal_static_context_ServiceStatus_descriptor = - getDescriptor().getMessageTypes().get(30); + getDescriptor().getMessageTypes().get(31); internal_static_context_ServiceStatus_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_context_ServiceStatus_descriptor, new java.lang.String[] { "ServiceStatus", }); internal_static_context_ServiceConfig_descriptor = - getDescriptor().getMessageTypes().get(31); + getDescriptor().getMessageTypes().get(32); internal_static_context_ServiceConfig_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_context_ServiceConfig_descriptor, new java.lang.String[] { "ConfigRules", }); internal_static_context_ServiceIdList_descriptor = - getDescriptor().getMessageTypes().get(32); + getDescriptor().getMessageTypes().get(33); internal_static_context_ServiceIdList_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_context_ServiceIdList_descriptor, new java.lang.String[] { "ServiceIds", }); internal_static_context_ServiceList_descriptor = - getDescriptor().getMessageTypes().get(33); + getDescriptor().getMessageTypes().get(34); internal_static_context_ServiceList_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_context_ServiceList_descriptor, new java.lang.String[] { "Services", }); internal_static_context_ServiceFilter_descriptor = - getDescriptor().getMessageTypes().get(34); + getDescriptor().getMessageTypes().get(35); internal_static_context_ServiceFilter_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_context_ServiceFilter_descriptor, new java.lang.String[] { "ServiceIds", "IncludeEndpointIds", "IncludeConstraints", "IncludeConfigRules", }); internal_static_context_ServiceEvent_descriptor = - getDescriptor().getMessageTypes().get(35); + getDescriptor().getMessageTypes().get(36); internal_static_context_ServiceEvent_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_context_ServiceEvent_descriptor, new java.lang.String[] { "Event", "ServiceId", }); internal_static_context_SliceId_descriptor = - getDescriptor().getMessageTypes().get(36); + getDescriptor().getMessageTypes().get(37); internal_static_context_SliceId_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_context_SliceId_descriptor, new java.lang.String[] { "ContextId", "SliceUuid", }); internal_static_context_Slice_descriptor = - getDescriptor().getMessageTypes().get(37); + getDescriptor().getMessageTypes().get(38); internal_static_context_Slice_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_context_Slice_descriptor, new java.lang.String[] { "SliceId", "Name", "SliceEndpointIds", "SliceConstraints", "SliceServiceIds", "SliceSubsliceIds", "SliceStatus", "SliceConfig", "SliceOwner", "Timestamp", }); internal_static_context_SliceOwner_descriptor = - getDescriptor().getMessageTypes().get(38); + getDescriptor().getMessageTypes().get(39); internal_static_context_SliceOwner_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_context_SliceOwner_descriptor, new java.lang.String[] { "OwnerUuid", "OwnerString", }); internal_static_context_SliceStatus_descriptor = - getDescriptor().getMessageTypes().get(39); + getDescriptor().getMessageTypes().get(40); internal_static_context_SliceStatus_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_context_SliceStatus_descriptor, new java.lang.String[] { "SliceStatus", }); internal_static_context_SliceConfig_descriptor = - getDescriptor().getMessageTypes().get(40); + getDescriptor().getMessageTypes().get(41); internal_static_context_SliceConfig_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_context_SliceConfig_descriptor, new java.lang.String[] { "ConfigRules", }); internal_static_context_SliceIdList_descriptor = - getDescriptor().getMessageTypes().get(41); + getDescriptor().getMessageTypes().get(42); internal_static_context_SliceIdList_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_context_SliceIdList_descriptor, new java.lang.String[] { "SliceIds", }); internal_static_context_SliceList_descriptor = - getDescriptor().getMessageTypes().get(42); + getDescriptor().getMessageTypes().get(43); internal_static_context_SliceList_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_context_SliceList_descriptor, new java.lang.String[] { "Slices", }); internal_static_context_SliceFilter_descriptor = - getDescriptor().getMessageTypes().get(43); + getDescriptor().getMessageTypes().get(44); internal_static_context_SliceFilter_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_context_SliceFilter_descriptor, new java.lang.String[] { "SliceIds", "IncludeEndpointIds", "IncludeConstraints", "IncludeServiceIds", "IncludeSubsliceIds", "IncludeConfigRules", }); internal_static_context_SliceEvent_descriptor = - getDescriptor().getMessageTypes().get(44); + getDescriptor().getMessageTypes().get(45); internal_static_context_SliceEvent_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_context_SliceEvent_descriptor, new java.lang.String[] { "Event", "SliceId", }); internal_static_context_ConnectionId_descriptor = - getDescriptor().getMessageTypes().get(45); + getDescriptor().getMessageTypes().get(46); internal_static_context_ConnectionId_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_context_ConnectionId_descriptor, new java.lang.String[] { "ConnectionUuid", }); internal_static_context_ConnectionSettings_L0_descriptor = - getDescriptor().getMessageTypes().get(46); + getDescriptor().getMessageTypes().get(47); internal_static_context_ConnectionSettings_L0_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_context_ConnectionSettings_L0_descriptor, new java.lang.String[] { "LspSymbolicName", }); internal_static_context_ConnectionSettings_L2_descriptor = - getDescriptor().getMessageTypes().get(47); + getDescriptor().getMessageTypes().get(48); internal_static_context_ConnectionSettings_L2_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_context_ConnectionSettings_L2_descriptor, new java.lang.String[] { "SrcMacAddress", "DstMacAddress", "EtherType", "VlanId", "MplsLabel", "MplsTrafficClass", }); internal_static_context_ConnectionSettings_L3_descriptor = - getDescriptor().getMessageTypes().get(48); + getDescriptor().getMessageTypes().get(49); internal_static_context_ConnectionSettings_L3_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_context_ConnectionSettings_L3_descriptor, new java.lang.String[] { "SrcIpAddress", "DstIpAddress", "Dscp", "Protocol", "Ttl", }); internal_static_context_ConnectionSettings_L4_descriptor = - getDescriptor().getMessageTypes().get(49); + getDescriptor().getMessageTypes().get(50); internal_static_context_ConnectionSettings_L4_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_context_ConnectionSettings_L4_descriptor, new java.lang.String[] { "SrcPort", "DstPort", "TcpFlags", "Ttl", }); internal_static_context_ConnectionSettings_descriptor = - getDescriptor().getMessageTypes().get(50); + getDescriptor().getMessageTypes().get(51); internal_static_context_ConnectionSettings_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_context_ConnectionSettings_descriptor, new java.lang.String[] { "L0", "L2", "L3", "L4", }); internal_static_context_Connection_descriptor = - getDescriptor().getMessageTypes().get(51); + getDescriptor().getMessageTypes().get(52); internal_static_context_Connection_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_context_Connection_descriptor, new java.lang.String[] { "ConnectionId", "ServiceId", "PathHopsEndpointIds", "SubServiceIds", "Settings", }); internal_static_context_ConnectionIdList_descriptor = - getDescriptor().getMessageTypes().get(52); + getDescriptor().getMessageTypes().get(53); internal_static_context_ConnectionIdList_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_context_ConnectionIdList_descriptor, new java.lang.String[] { "ConnectionIds", }); internal_static_context_ConnectionList_descriptor = - getDescriptor().getMessageTypes().get(53); + getDescriptor().getMessageTypes().get(54); internal_static_context_ConnectionList_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_context_ConnectionList_descriptor, new java.lang.String[] { "Connections", }); internal_static_context_ConnectionEvent_descriptor = - getDescriptor().getMessageTypes().get(54); + getDescriptor().getMessageTypes().get(55); internal_static_context_ConnectionEvent_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_context_ConnectionEvent_descriptor, new java.lang.String[] { "Event", "ConnectionId", }); internal_static_context_EndPointId_descriptor = - getDescriptor().getMessageTypes().get(55); + getDescriptor().getMessageTypes().get(56); internal_static_context_EndPointId_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_context_EndPointId_descriptor, new java.lang.String[] { "TopologyId", "DeviceId", "EndpointUuid", }); internal_static_context_EndPoint_descriptor = - getDescriptor().getMessageTypes().get(56); + getDescriptor().getMessageTypes().get(57); internal_static_context_EndPoint_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_context_EndPoint_descriptor, new java.lang.String[] { "EndpointId", "Name", "EndpointType", "KpiSampleTypes", "EndpointLocation", }); internal_static_context_EndPointName_descriptor = - getDescriptor().getMessageTypes().get(57); + getDescriptor().getMessageTypes().get(58); internal_static_context_EndPointName_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_context_EndPointName_descriptor, new java.lang.String[] { "EndpointId", "DeviceName", "EndpointName", "EndpointType", }); internal_static_context_EndPointIdList_descriptor = - getDescriptor().getMessageTypes().get(58); + getDescriptor().getMessageTypes().get(59); internal_static_context_EndPointIdList_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_context_EndPointIdList_descriptor, new java.lang.String[] { "EndpointIds", }); internal_static_context_EndPointNameList_descriptor = - getDescriptor().getMessageTypes().get(59); + getDescriptor().getMessageTypes().get(60); internal_static_context_EndPointNameList_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_context_EndPointNameList_descriptor, new java.lang.String[] { "EndpointNames", }); internal_static_context_ConfigRule_Custom_descriptor = - getDescriptor().getMessageTypes().get(60); + getDescriptor().getMessageTypes().get(61); internal_static_context_ConfigRule_Custom_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_context_ConfigRule_Custom_descriptor, new java.lang.String[] { "ResourceKey", "ResourceValue", }); internal_static_context_ConfigRule_ACL_descriptor = - getDescriptor().getMessageTypes().get(61); + getDescriptor().getMessageTypes().get(62); internal_static_context_ConfigRule_ACL_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_context_ConfigRule_ACL_descriptor, new java.lang.String[] { "EndpointId", "RuleSet", }); internal_static_context_ConfigRule_descriptor = - getDescriptor().getMessageTypes().get(62); + getDescriptor().getMessageTypes().get(63); internal_static_context_ConfigRule_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_context_ConfigRule_descriptor, new java.lang.String[] { "Action", "Custom", "Acl", "ConfigRule", }); internal_static_context_Constraint_Custom_descriptor = - getDescriptor().getMessageTypes().get(63); + getDescriptor().getMessageTypes().get(64); internal_static_context_Constraint_Custom_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_context_Constraint_Custom_descriptor, new java.lang.String[] { "ConstraintType", "ConstraintValue", }); internal_static_context_Constraint_Schedule_descriptor = - getDescriptor().getMessageTypes().get(64); + getDescriptor().getMessageTypes().get(65); internal_static_context_Constraint_Schedule_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_context_Constraint_Schedule_descriptor, new java.lang.String[] { "StartTimestamp", "DurationDays", }); internal_static_context_GPS_Position_descriptor = - getDescriptor().getMessageTypes().get(65); + getDescriptor().getMessageTypes().get(66); internal_static_context_GPS_Position_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_context_GPS_Position_descriptor, new java.lang.String[] { "Latitude", "Longitude", }); internal_static_context_Location_descriptor = - getDescriptor().getMessageTypes().get(66); + getDescriptor().getMessageTypes().get(67); internal_static_context_Location_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_context_Location_descriptor, new java.lang.String[] { "Region", "GpsPosition", "Location", }); internal_static_context_Constraint_EndPointLocation_descriptor = - getDescriptor().getMessageTypes().get(67); + getDescriptor().getMessageTypes().get(68); internal_static_context_Constraint_EndPointLocation_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_context_Constraint_EndPointLocation_descriptor, new java.lang.String[] { "EndpointId", "Location", }); internal_static_context_Constraint_EndPointPriority_descriptor = - getDescriptor().getMessageTypes().get(68); + getDescriptor().getMessageTypes().get(69); internal_static_context_Constraint_EndPointPriority_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_context_Constraint_EndPointPriority_descriptor, new java.lang.String[] { "EndpointId", "Priority", }); internal_static_context_Constraint_SLA_Latency_descriptor = - getDescriptor().getMessageTypes().get(69); + getDescriptor().getMessageTypes().get(70); internal_static_context_Constraint_SLA_Latency_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_context_Constraint_SLA_Latency_descriptor, new java.lang.String[] { "E2ELatencyMs", }); internal_static_context_Constraint_SLA_Capacity_descriptor = - getDescriptor().getMessageTypes().get(70); + getDescriptor().getMessageTypes().get(71); internal_static_context_Constraint_SLA_Capacity_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_context_Constraint_SLA_Capacity_descriptor, new java.lang.String[] { "CapacityGbps", }); internal_static_context_Constraint_SLA_Availability_descriptor = - getDescriptor().getMessageTypes().get(71); + getDescriptor().getMessageTypes().get(72); internal_static_context_Constraint_SLA_Availability_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_context_Constraint_SLA_Availability_descriptor, new java.lang.String[] { "NumDisjointPaths", "AllActive", "Availability", }); internal_static_context_Constraint_SLA_Isolation_level_descriptor = - getDescriptor().getMessageTypes().get(72); + getDescriptor().getMessageTypes().get(73); internal_static_context_Constraint_SLA_Isolation_level_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_context_Constraint_SLA_Isolation_level_descriptor, new java.lang.String[] { "IsolationLevel", }); internal_static_context_Constraint_Exclusions_descriptor = - getDescriptor().getMessageTypes().get(73); + getDescriptor().getMessageTypes().get(74); internal_static_context_Constraint_Exclusions_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_context_Constraint_Exclusions_descriptor, new java.lang.String[] { "IsPermanent", "DeviceIds", "EndpointIds", "LinkIds", }); internal_static_context_Constraint_descriptor = - getDescriptor().getMessageTypes().get(74); + getDescriptor().getMessageTypes().get(75); internal_static_context_Constraint_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_context_Constraint_descriptor, new java.lang.String[] { "Action", "Custom", "Schedule", "EndpointLocation", "EndpointPriority", "SlaCapacity", "SlaLatency", "SlaAvailability", "SlaIsolation", "Exclusions", "Constraint", }); internal_static_context_TeraFlowController_descriptor = - getDescriptor().getMessageTypes().get(75); + getDescriptor().getMessageTypes().get(76); internal_static_context_TeraFlowController_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_context_TeraFlowController_descriptor, new java.lang.String[] { "ContextId", "IpAddress", "Port", }); internal_static_context_AuthenticationResult_descriptor = - getDescriptor().getMessageTypes().get(76); + getDescriptor().getMessageTypes().get(77); internal_static_context_AuthenticationResult_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_context_AuthenticationResult_descriptor, diff --git a/src/policy/target/generated-sources/grpc/kpi_sample_types/KpiSampleTypes.java b/src/policy/target/generated-sources/grpc/kpi_sample_types/KpiSampleTypes.java index 217672b2e8de2d7c840833a937b0fb04c38a221b..66ce0f8f234c62f17c7e3af82d0f22a0a4c26c58 100644 --- a/src/policy/target/generated-sources/grpc/kpi_sample_types/KpiSampleTypes.java +++ b/src/policy/target/generated-sources/grpc/kpi_sample_types/KpiSampleTypes.java @@ -47,6 +47,14 @@ public final class KpiSampleTypes { * KPISAMPLETYPE_BYTES_DROPPED = 203; */ KPISAMPLETYPE_BYTES_DROPPED(203), + /** + * KPISAMPLETYPE_LINK_TOTAL_CAPACITY_GBPS = 301; + */ + KPISAMPLETYPE_LINK_TOTAL_CAPACITY_GBPS(301), + /** + * KPISAMPLETYPE_LINK_USED_CAPACITY_GBPS = 302; + */ + KPISAMPLETYPE_LINK_USED_CAPACITY_GBPS(302), /** *
      *. can be used by both optical and L3 without any issue
@@ -118,6 +126,14 @@ public final class KpiSampleTypes {
      * KPISAMPLETYPE_BYTES_DROPPED = 203;
      */
     public static final int KPISAMPLETYPE_BYTES_DROPPED_VALUE = 203;
+    /**
+     * KPISAMPLETYPE_LINK_TOTAL_CAPACITY_GBPS = 301;
+     */
+    public static final int KPISAMPLETYPE_LINK_TOTAL_CAPACITY_GBPS_VALUE = 301;
+    /**
+     * KPISAMPLETYPE_LINK_USED_CAPACITY_GBPS = 302;
+     */
+    public static final int KPISAMPLETYPE_LINK_USED_CAPACITY_GBPS_VALUE = 302;
     /**
      * 
      *. can be used by both optical and L3 without any issue
@@ -191,6 +207,8 @@ public final class KpiSampleTypes {
         case 201: return KPISAMPLETYPE_BYTES_TRANSMITTED;
         case 202: return KPISAMPLETYPE_BYTES_RECEIVED;
         case 203: return KPISAMPLETYPE_BYTES_DROPPED;
+        case 301: return KPISAMPLETYPE_LINK_TOTAL_CAPACITY_GBPS;
+        case 302: return KPISAMPLETYPE_LINK_USED_CAPACITY_GBPS;
         case 401: return KPISAMPLETYPE_ML_CONFIDENCE;
         case 501: return KPISAMPLETYPE_OPTICAL_SECURITY_STATUS;
         case 601: return KPISAMPLETYPE_L3_UNIQUE_ATTACK_CONNS;
@@ -265,22 +283,24 @@ public final class KpiSampleTypes {
   static {
     java.lang.String[] descriptorData = {
       "\n\026kpi_sample_types.proto\022\020kpi_sample_typ" +
-      "es*\327\004\n\rKpiSampleType\022\031\n\025KPISAMPLETYPE_UN" +
+      "es*\260\005\n\rKpiSampleType\022\031\n\025KPISAMPLETYPE_UN" +
       "KNOWN\020\000\022%\n!KPISAMPLETYPE_PACKETS_TRANSMI" +
       "TTED\020e\022\"\n\036KPISAMPLETYPE_PACKETS_RECEIVED" +
       "\020f\022!\n\035KPISAMPLETYPE_PACKETS_DROPPED\020g\022$\n" +
       "\037KPISAMPLETYPE_BYTES_TRANSMITTED\020\311\001\022!\n\034K" +
       "PISAMPLETYPE_BYTES_RECEIVED\020\312\001\022 \n\033KPISAM" +
-      "PLETYPE_BYTES_DROPPED\020\313\001\022 \n\033KPISAMPLETYP" +
-      "E_ML_CONFIDENCE\020\221\003\022*\n%KPISAMPLETYPE_OPTI" +
-      "CAL_SECURITY_STATUS\020\365\003\022)\n$KPISAMPLETYPE_" +
-      "L3_UNIQUE_ATTACK_CONNS\020\331\004\022*\n%KPISAMPLETY" +
-      "PE_L3_TOTAL_DROPPED_PACKTS\020\332\004\022&\n!KPISAMP" +
-      "LETYPE_L3_UNIQUE_ATTACKERS\020\333\004\0220\n+KPISAMP" +
-      "LETYPE_L3_UNIQUE_COMPROMISED_CLIENTS\020\334\004\022" +
-      ",\n\'KPISAMPLETYPE_L3_SECURITY_STATUS_CRYP" +
-      "TO\020\335\004\022%\n KPISAMPLETYPE_SERVICE_LATENCY_M" +
-      "S\020\275\005b\006proto3"
+      "PLETYPE_BYTES_DROPPED\020\313\001\022+\n&KPISAMPLETYP" +
+      "E_LINK_TOTAL_CAPACITY_GBPS\020\255\002\022*\n%KPISAMP" +
+      "LETYPE_LINK_USED_CAPACITY_GBPS\020\256\002\022 \n\033KPI" +
+      "SAMPLETYPE_ML_CONFIDENCE\020\221\003\022*\n%KPISAMPLE" +
+      "TYPE_OPTICAL_SECURITY_STATUS\020\365\003\022)\n$KPISA" +
+      "MPLETYPE_L3_UNIQUE_ATTACK_CONNS\020\331\004\022*\n%KP" +
+      "ISAMPLETYPE_L3_TOTAL_DROPPED_PACKTS\020\332\004\022&" +
+      "\n!KPISAMPLETYPE_L3_UNIQUE_ATTACKERS\020\333\004\0220" +
+      "\n+KPISAMPLETYPE_L3_UNIQUE_COMPROMISED_CL" +
+      "IENTS\020\334\004\022,\n\'KPISAMPLETYPE_L3_SECURITY_ST" +
+      "ATUS_CRYPTO\020\335\004\022%\n KPISAMPLETYPE_SERVICE_" +
+      "LATENCY_MS\020\275\005b\006proto3"
     };
     descriptor = com.google.protobuf.Descriptors.FileDescriptor
       .internalBuildGeneratedFileFrom(descriptorData,
diff --git a/src/policy/target/generated-sources/grpc/monitoring/Monitoring.java b/src/policy/target/generated-sources/grpc/monitoring/Monitoring.java
index 38f026eb1ac730e8f825e460916dc57469f0d312..ef9ef6be6341d87943f68503d7ddc535b3920140 100644
--- a/src/policy/target/generated-sources/grpc/monitoring/Monitoring.java
+++ b/src/policy/target/generated-sources/grpc/monitoring/Monitoring.java
@@ -154,6 +154,21 @@ public final class Monitoring {
      * .context.ConnectionId connection_id = 9;
      */
     context.ContextOuterClass.ConnectionIdOrBuilder getConnectionIdOrBuilder();
+
+    /**
+     * .context.LinkId link_id = 10;
+     * @return Whether the linkId field is set.
+     */
+    boolean hasLinkId();
+    /**
+     * .context.LinkId link_id = 10;
+     * @return The linkId.
+     */
+    context.ContextOuterClass.LinkId getLinkId();
+    /**
+     * .context.LinkId link_id = 10;
+     */
+    context.ContextOuterClass.LinkIdOrBuilder getLinkIdOrBuilder();
   }
   /**
    * Protobuf type {@code monitoring.KpiDescriptor}
@@ -303,6 +318,19 @@ public final class Monitoring {
 
               break;
             }
+            case 82: {
+              context.ContextOuterClass.LinkId.Builder subBuilder = null;
+              if (linkId_ != null) {
+                subBuilder = linkId_.toBuilder();
+              }
+              linkId_ = input.readMessage(context.ContextOuterClass.LinkId.parser(), extensionRegistry);
+              if (subBuilder != null) {
+                subBuilder.mergeFrom(linkId_);
+                linkId_ = subBuilder.buildPartial();
+              }
+
+              break;
+            }
             default: {
               if (!parseUnknownField(
                   input, unknownFields, extensionRegistry, tag)) {
@@ -591,6 +619,32 @@ public final class Monitoring {
       return getConnectionId();
     }
 
+    public static final int LINK_ID_FIELD_NUMBER = 10;
+    private context.ContextOuterClass.LinkId linkId_;
+    /**
+     * .context.LinkId link_id = 10;
+     * @return Whether the linkId field is set.
+     */
+    @java.lang.Override
+    public boolean hasLinkId() {
+      return linkId_ != null;
+    }
+    /**
+     * .context.LinkId link_id = 10;
+     * @return The linkId.
+     */
+    @java.lang.Override
+    public context.ContextOuterClass.LinkId getLinkId() {
+      return linkId_ == null ? context.ContextOuterClass.LinkId.getDefaultInstance() : linkId_;
+    }
+    /**
+     * .context.LinkId link_id = 10;
+     */
+    @java.lang.Override
+    public context.ContextOuterClass.LinkIdOrBuilder getLinkIdOrBuilder() {
+      return getLinkId();
+    }
+
     private byte memoizedIsInitialized = -1;
     @java.lang.Override
     public final boolean isInitialized() {
@@ -632,6 +686,9 @@ public final class Monitoring {
       if (connectionId_ != null) {
         output.writeMessage(9, getConnectionId());
       }
+      if (linkId_ != null) {
+        output.writeMessage(10, getLinkId());
+      }
       unknownFields.writeTo(output);
     }
 
@@ -676,6 +733,10 @@ public final class Monitoring {
         size += com.google.protobuf.CodedOutputStream
           .computeMessageSize(9, getConnectionId());
       }
+      if (linkId_ != null) {
+        size += com.google.protobuf.CodedOutputStream
+          .computeMessageSize(10, getLinkId());
+      }
       size += unknownFields.getSerializedSize();
       memoizedSize = size;
       return size;
@@ -726,6 +787,11 @@ public final class Monitoring {
         if (!getConnectionId()
             .equals(other.getConnectionId())) return false;
       }
+      if (hasLinkId() != other.hasLinkId()) return false;
+      if (hasLinkId()) {
+        if (!getLinkId()
+            .equals(other.getLinkId())) return false;
+      }
       if (!unknownFields.equals(other.unknownFields)) return false;
       return true;
     }
@@ -769,6 +835,10 @@ public final class Monitoring {
         hash = (37 * hash) + CONNECTION_ID_FIELD_NUMBER;
         hash = (53 * hash) + getConnectionId().hashCode();
       }
+      if (hasLinkId()) {
+        hash = (37 * hash) + LINK_ID_FIELD_NUMBER;
+        hash = (53 * hash) + getLinkId().hashCode();
+      }
       hash = (29 * hash) + unknownFields.hashCode();
       memoizedHashCode = hash;
       return hash;
@@ -949,6 +1019,12 @@ public final class Monitoring {
           connectionId_ = null;
           connectionIdBuilder_ = null;
         }
+        if (linkIdBuilder_ == null) {
+          linkId_ = null;
+        } else {
+          linkId_ = null;
+          linkIdBuilder_ = null;
+        }
         return this;
       }
 
@@ -1017,6 +1093,11 @@ public final class Monitoring {
         } else {
           result.connectionId_ = connectionIdBuilder_.build();
         }
+        if (linkIdBuilder_ == null) {
+          result.linkId_ = linkId_;
+        } else {
+          result.linkId_ = linkIdBuilder_.build();
+        }
         onBuilt();
         return result;
       }
@@ -1116,6 +1197,9 @@ public final class Monitoring {
         if (other.hasConnectionId()) {
           mergeConnectionId(other.getConnectionId());
         }
+        if (other.hasLinkId()) {
+          mergeLinkId(other.getLinkId());
+        }
         this.mergeUnknownFields(other.unknownFields);
         onChanged();
         return this;
@@ -2229,6 +2313,125 @@ public final class Monitoring {
         }
         return connectionIdBuilder_;
       }
+
+      private context.ContextOuterClass.LinkId linkId_;
+      private com.google.protobuf.SingleFieldBuilderV3<
+          context.ContextOuterClass.LinkId, context.ContextOuterClass.LinkId.Builder, context.ContextOuterClass.LinkIdOrBuilder> linkIdBuilder_;
+      /**
+       * .context.LinkId link_id = 10;
+       * @return Whether the linkId field is set.
+       */
+      public boolean hasLinkId() {
+        return linkIdBuilder_ != null || linkId_ != null;
+      }
+      /**
+       * .context.LinkId link_id = 10;
+       * @return The linkId.
+       */
+      public context.ContextOuterClass.LinkId getLinkId() {
+        if (linkIdBuilder_ == null) {
+          return linkId_ == null ? context.ContextOuterClass.LinkId.getDefaultInstance() : linkId_;
+        } else {
+          return linkIdBuilder_.getMessage();
+        }
+      }
+      /**
+       * .context.LinkId link_id = 10;
+       */
+      public Builder setLinkId(context.ContextOuterClass.LinkId value) {
+        if (linkIdBuilder_ == null) {
+          if (value == null) {
+            throw new NullPointerException();
+          }
+          linkId_ = value;
+          onChanged();
+        } else {
+          linkIdBuilder_.setMessage(value);
+        }
+
+        return this;
+      }
+      /**
+       * .context.LinkId link_id = 10;
+       */
+      public Builder setLinkId(
+          context.ContextOuterClass.LinkId.Builder builderForValue) {
+        if (linkIdBuilder_ == null) {
+          linkId_ = builderForValue.build();
+          onChanged();
+        } else {
+          linkIdBuilder_.setMessage(builderForValue.build());
+        }
+
+        return this;
+      }
+      /**
+       * .context.LinkId link_id = 10;
+       */
+      public Builder mergeLinkId(context.ContextOuterClass.LinkId value) {
+        if (linkIdBuilder_ == null) {
+          if (linkId_ != null) {
+            linkId_ =
+              context.ContextOuterClass.LinkId.newBuilder(linkId_).mergeFrom(value).buildPartial();
+          } else {
+            linkId_ = value;
+          }
+          onChanged();
+        } else {
+          linkIdBuilder_.mergeFrom(value);
+        }
+
+        return this;
+      }
+      /**
+       * .context.LinkId link_id = 10;
+       */
+      public Builder clearLinkId() {
+        if (linkIdBuilder_ == null) {
+          linkId_ = null;
+          onChanged();
+        } else {
+          linkId_ = null;
+          linkIdBuilder_ = null;
+        }
+
+        return this;
+      }
+      /**
+       * .context.LinkId link_id = 10;
+       */
+      public context.ContextOuterClass.LinkId.Builder getLinkIdBuilder() {
+        
+        onChanged();
+        return getLinkIdFieldBuilder().getBuilder();
+      }
+      /**
+       * .context.LinkId link_id = 10;
+       */
+      public context.ContextOuterClass.LinkIdOrBuilder getLinkIdOrBuilder() {
+        if (linkIdBuilder_ != null) {
+          return linkIdBuilder_.getMessageOrBuilder();
+        } else {
+          return linkId_ == null ?
+              context.ContextOuterClass.LinkId.getDefaultInstance() : linkId_;
+        }
+      }
+      /**
+       * .context.LinkId link_id = 10;
+       */
+      private com.google.protobuf.SingleFieldBuilderV3<
+          context.ContextOuterClass.LinkId, context.ContextOuterClass.LinkId.Builder, context.ContextOuterClass.LinkIdOrBuilder> 
+          getLinkIdFieldBuilder() {
+        if (linkIdBuilder_ == null) {
+          linkIdBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
+              context.ContextOuterClass.LinkId, context.ContextOuterClass.LinkId.Builder, context.ContextOuterClass.LinkIdOrBuilder>(
+                  getLinkId(),
+                  getParentForChildren(),
+                  isClean());
+          linkId_ = null;
+        }
+        return linkIdBuilder_;
+      }
       @java.lang.Override
       public final Builder setUnknownFields(
           final com.google.protobuf.UnknownFieldSet unknownFields) {
@@ -21361,7 +21564,7 @@ public final class Monitoring {
   static {
     java.lang.String[] descriptorData = {
       "\n\020monitoring.proto\022\nmonitoring\032\rcontext." +
-      "proto\032\026kpi_sample_types.proto\"\367\002\n\rKpiDes" +
+      "proto\032\026kpi_sample_types.proto\"\231\003\n\rKpiDes" +
       "criptor\022!\n\006kpi_id\030\001 \001(\0132\021.monitoring.Kpi" +
       "Id\022\027\n\017kpi_description\030\002 \001(\t\022&\n\013kpi_id_li" +
       "st\030\003 \003(\0132\021.monitoring.KpiId\0228\n\017kpi_sampl" +
@@ -21371,91 +21574,92 @@ public final class Monitoring {
       "intId\022&\n\nservice_id\030\007 \001(\0132\022.context.Serv" +
       "iceId\022\"\n\010slice_id\030\010 \001(\0132\020.context.SliceI" +
       "d\022,\n\rconnection_id\030\t \001(\0132\025.context.Conne" +
-      "ctionId\"l\n\021MonitorKpiRequest\022!\n\006kpi_id\030\001" +
-      " \001(\0132\021.monitoring.KpiId\022\033\n\023monitoring_wi" +
-      "ndow_s\030\002 \001(\002\022\027\n\017sampling_rate_s\030\003 \001(\002\"\273\001" +
-      "\n\010KpiQuery\022\"\n\007kpi_ids\030\001 \003(\0132\021.monitoring" +
-      ".KpiId\022\033\n\023monitoring_window_s\030\002 \001(\002\022\026\n\016l" +
-      "ast_n_samples\030\003 \001(\r\022+\n\017start_timestamp\030\004" +
-      " \001(\0132\022.context.Timestamp\022)\n\rend_timestam" +
-      "p\030\005 \001(\0132\022.context.Timestamp\"X\n\006RawKpi\022%\n" +
-      "\ttimestamp\030\001 \001(\0132\022.context.Timestamp\022\'\n\t" +
-      "kpi_value\030\002 \001(\0132\024.monitoring.KpiValue\"U\n" +
-      "\nRawKpiList\022!\n\006kpi_id\030\001 \001(\0132\021.monitoring" +
-      ".KpiId\022$\n\010raw_kpis\030\002 \003(\0132\022.monitoring.Ra" +
-      "wKpi\"<\n\013RawKpiTable\022-\n\rraw_kpi_lists\030\001 \003" +
-      "(\0132\026.monitoring.RawKpiList\"&\n\005KpiId\022\035\n\006k" +
-      "pi_id\030\001 \001(\0132\r.context.Uuid\"x\n\003Kpi\022!\n\006kpi" +
-      "_id\030\001 \001(\0132\021.monitoring.KpiId\022%\n\ttimestam" +
-      "p\030\002 \001(\0132\022.context.Timestamp\022\'\n\tkpi_value" +
-      "\030\003 \001(\0132\024.monitoring.KpiValue\"\250\001\n\rKpiValu" +
-      "eRange\022)\n\013kpiMinValue\030\001 \001(\0132\024.monitoring" +
-      ".KpiValue\022)\n\013kpiMaxValue\030\002 \001(\0132\024.monitor" +
-      "ing.KpiValue\022\017\n\007inRange\030\003 \001(\010\022\027\n\017include" +
-      "MinValue\030\004 \001(\010\022\027\n\017includeMaxValue\030\005 \001(\010\"" +
-      "\241\001\n\010KpiValue\022\022\n\010int32Val\030\001 \001(\005H\000\022\023\n\tuint" +
-      "32Val\030\002 \001(\rH\000\022\022\n\010int64Val\030\003 \001(\003H\000\022\023\n\tuin" +
-      "t64Val\030\004 \001(\004H\000\022\022\n\010floatVal\030\005 \001(\002H\000\022\023\n\tst" +
-      "ringVal\030\006 \001(\tH\000\022\021\n\007boolVal\030\007 \001(\010H\000B\007\n\005va" +
-      "lue\"\'\n\007KpiList\022\034\n\003kpi\030\001 \003(\0132\017.monitoring" +
-      ".Kpi\"K\n\021KpiDescriptorList\0226\n\023kpi_descrip" +
-      "tor_list\030\001 \003(\0132\031.monitoring.KpiDescripto" +
-      "r\"\362\001\n\016SubsDescriptor\022+\n\007subs_id\030\001 \001(\0132\032." +
-      "monitoring.SubscriptionID\022!\n\006kpi_id\030\002 \001(" +
-      "\0132\021.monitoring.KpiId\022\033\n\023sampling_duratio" +
-      "n_s\030\003 \001(\002\022\033\n\023sampling_interval_s\030\004 \001(\002\022+" +
-      "\n\017start_timestamp\030\005 \001(\0132\022.context.Timest" +
-      "amp\022)\n\rend_timestamp\030\006 \001(\0132\022.context.Tim" +
-      "estamp\"0\n\016SubscriptionID\022\036\n\007subs_id\030\001 \001(" +
-      "\0132\r.context.Uuid\"b\n\014SubsResponse\022+\n\007subs" +
-      "_id\030\001 \001(\0132\032.monitoring.SubscriptionID\022%\n" +
-      "\010kpi_list\030\002 \001(\0132\023.monitoring.KpiList\"?\n\010" +
-      "SubsList\0223\n\017subs_descriptor\030\001 \003(\0132\032.moni" +
-      "toring.SubsDescriptor\"\337\001\n\017AlarmDescripto" +
-      "r\022%\n\010alarm_id\030\001 \001(\0132\023.monitoring.AlarmID" +
-      "\022\031\n\021alarm_description\030\002 \001(\t\022\014\n\004name\030\003 \001(" +
-      "\t\022!\n\006kpi_id\030\004 \001(\0132\021.monitoring.KpiId\0222\n\017" +
-      "kpi_value_range\030\005 \001(\0132\031.monitoring.KpiVa" +
-      "lueRange\022%\n\ttimestamp\030\006 \001(\0132\022.context.Ti" +
-      "mestamp\"*\n\007AlarmID\022\037\n\010alarm_id\030\001 \001(\0132\r.c" +
-      "ontext.Uuid\"}\n\021AlarmSubscription\022%\n\010alar" +
-      "m_id\030\001 \001(\0132\023.monitoring.AlarmID\022\036\n\026subsc" +
-      "ription_timeout_s\030\002 \001(\002\022!\n\031subscription_" +
-      "frequency_ms\030\003 \001(\002\"k\n\rAlarmResponse\022%\n\010a" +
-      "larm_id\030\001 \001(\0132\023.monitoring.AlarmID\022\014\n\004te" +
-      "xt\030\002 \001(\t\022%\n\010kpi_list\030\003 \001(\0132\023.monitoring." +
-      "KpiList\"B\n\tAlarmList\0225\n\020alarm_descriptor" +
-      "\030\001 \003(\0132\033.monitoring.AlarmDescriptor2\234\t\n\021" +
-      "MonitoringService\0228\n\006SetKpi\022\031.monitoring" +
-      ".KpiDescriptor\032\021.monitoring.KpiId\"\000\0220\n\tD" +
-      "eleteKpi\022\021.monitoring.KpiId\032\016.context.Em" +
-      "pty\"\000\022B\n\020GetKpiDescriptor\022\021.monitoring.K" +
-      "piId\032\031.monitoring.KpiDescriptor\"\000\022G\n\024Get" +
-      "KpiDescriptorList\022\016.context.Empty\032\035.moni" +
-      "toring.KpiDescriptorList\"\000\022/\n\nIncludeKpi" +
-      "\022\017.monitoring.Kpi\032\016.context.Empty\"\000\022=\n\nM" +
-      "onitorKpi\022\035.monitoring.MonitorKpiRequest" +
-      "\032\016.context.Empty\"\000\022?\n\014QueryKpiData\022\024.mon" +
-      "itoring.KpiQuery\032\027.monitoring.RawKpiTabl" +
-      "e\"\000\022N\n\022SetKpiSubscription\022\032.monitoring.S" +
-      "ubsDescriptor\032\030.monitoring.SubsResponse\"" +
-      "\0000\001\022M\n\021GetSubsDescriptor\022\032.monitoring.Su" +
-      "bscriptionID\032\032.monitoring.SubsDescriptor" +
-      "\"\000\022:\n\020GetSubscriptions\022\016.context.Empty\032\024" +
-      ".monitoring.SubsList\"\000\022B\n\022DeleteSubscrip" +
-      "tion\022\032.monitoring.SubscriptionID\032\016.conte" +
-      "xt.Empty\"\000\022A\n\013SetKpiAlarm\022\033.monitoring.A" +
-      "larmDescriptor\032\023.monitoring.AlarmID\"\000\0224\n" +
-      "\tGetAlarms\022\016.context.Empty\032\025.monitoring." +
-      "AlarmList\"\000\022H\n\022GetAlarmDescriptor\022\023.moni" +
-      "toring.AlarmID\032\033.monitoring.AlarmDescrip" +
-      "tor\"\000\022V\n\026GetAlarmResponseStream\022\035.monito" +
-      "ring.AlarmSubscription\032\031.monitoring.Alar" +
-      "mResponse\"\0000\001\0224\n\013DeleteAlarm\022\023.monitorin" +
-      "g.AlarmID\032\016.context.Empty\"\000\0226\n\014GetStream" +
-      "Kpi\022\021.monitoring.KpiId\032\017.monitoring.Kpi\"" +
-      "\0000\001\0225\n\rGetInstantKpi\022\021.monitoring.KpiId\032" +
-      "\017.monitoring.Kpi\"\000b\006proto3"
+      "ctionId\022 \n\007link_id\030\n \001(\0132\017.context.LinkI" +
+      "d\"l\n\021MonitorKpiRequest\022!\n\006kpi_id\030\001 \001(\0132\021" +
+      ".monitoring.KpiId\022\033\n\023monitoring_window_s" +
+      "\030\002 \001(\002\022\027\n\017sampling_rate_s\030\003 \001(\002\"\273\001\n\010KpiQ" +
+      "uery\022\"\n\007kpi_ids\030\001 \003(\0132\021.monitoring.KpiId" +
+      "\022\033\n\023monitoring_window_s\030\002 \001(\002\022\026\n\016last_n_" +
+      "samples\030\003 \001(\r\022+\n\017start_timestamp\030\004 \001(\0132\022" +
+      ".context.Timestamp\022)\n\rend_timestamp\030\005 \001(" +
+      "\0132\022.context.Timestamp\"X\n\006RawKpi\022%\n\ttimes" +
+      "tamp\030\001 \001(\0132\022.context.Timestamp\022\'\n\tkpi_va" +
+      "lue\030\002 \001(\0132\024.monitoring.KpiValue\"U\n\nRawKp" +
+      "iList\022!\n\006kpi_id\030\001 \001(\0132\021.monitoring.KpiId" +
+      "\022$\n\010raw_kpis\030\002 \003(\0132\022.monitoring.RawKpi\"<" +
+      "\n\013RawKpiTable\022-\n\rraw_kpi_lists\030\001 \003(\0132\026.m" +
+      "onitoring.RawKpiList\"&\n\005KpiId\022\035\n\006kpi_id\030" +
+      "\001 \001(\0132\r.context.Uuid\"x\n\003Kpi\022!\n\006kpi_id\030\001 " +
+      "\001(\0132\021.monitoring.KpiId\022%\n\ttimestamp\030\002 \001(" +
+      "\0132\022.context.Timestamp\022\'\n\tkpi_value\030\003 \001(\013" +
+      "2\024.monitoring.KpiValue\"\250\001\n\rKpiValueRange" +
+      "\022)\n\013kpiMinValue\030\001 \001(\0132\024.monitoring.KpiVa" +
+      "lue\022)\n\013kpiMaxValue\030\002 \001(\0132\024.monitoring.Kp" +
+      "iValue\022\017\n\007inRange\030\003 \001(\010\022\027\n\017includeMinVal" +
+      "ue\030\004 \001(\010\022\027\n\017includeMaxValue\030\005 \001(\010\"\241\001\n\010Kp" +
+      "iValue\022\022\n\010int32Val\030\001 \001(\005H\000\022\023\n\tuint32Val\030" +
+      "\002 \001(\rH\000\022\022\n\010int64Val\030\003 \001(\003H\000\022\023\n\tuint64Val" +
+      "\030\004 \001(\004H\000\022\022\n\010floatVal\030\005 \001(\002H\000\022\023\n\tstringVa" +
+      "l\030\006 \001(\tH\000\022\021\n\007boolVal\030\007 \001(\010H\000B\007\n\005value\"\'\n" +
+      "\007KpiList\022\034\n\003kpi\030\001 \003(\0132\017.monitoring.Kpi\"K" +
+      "\n\021KpiDescriptorList\0226\n\023kpi_descriptor_li" +
+      "st\030\001 \003(\0132\031.monitoring.KpiDescriptor\"\362\001\n\016" +
+      "SubsDescriptor\022+\n\007subs_id\030\001 \001(\0132\032.monito" +
+      "ring.SubscriptionID\022!\n\006kpi_id\030\002 \001(\0132\021.mo" +
+      "nitoring.KpiId\022\033\n\023sampling_duration_s\030\003 " +
+      "\001(\002\022\033\n\023sampling_interval_s\030\004 \001(\002\022+\n\017star" +
+      "t_timestamp\030\005 \001(\0132\022.context.Timestamp\022)\n" +
+      "\rend_timestamp\030\006 \001(\0132\022.context.Timestamp" +
+      "\"0\n\016SubscriptionID\022\036\n\007subs_id\030\001 \001(\0132\r.co" +
+      "ntext.Uuid\"b\n\014SubsResponse\022+\n\007subs_id\030\001 " +
+      "\001(\0132\032.monitoring.SubscriptionID\022%\n\010kpi_l" +
+      "ist\030\002 \001(\0132\023.monitoring.KpiList\"?\n\010SubsLi" +
+      "st\0223\n\017subs_descriptor\030\001 \003(\0132\032.monitoring" +
+      ".SubsDescriptor\"\337\001\n\017AlarmDescriptor\022%\n\010a" +
+      "larm_id\030\001 \001(\0132\023.monitoring.AlarmID\022\031\n\021al" +
+      "arm_description\030\002 \001(\t\022\014\n\004name\030\003 \001(\t\022!\n\006k" +
+      "pi_id\030\004 \001(\0132\021.monitoring.KpiId\0222\n\017kpi_va" +
+      "lue_range\030\005 \001(\0132\031.monitoring.KpiValueRan" +
+      "ge\022%\n\ttimestamp\030\006 \001(\0132\022.context.Timestam" +
+      "p\"*\n\007AlarmID\022\037\n\010alarm_id\030\001 \001(\0132\r.context" +
+      ".Uuid\"}\n\021AlarmSubscription\022%\n\010alarm_id\030\001" +
+      " \001(\0132\023.monitoring.AlarmID\022\036\n\026subscriptio" +
+      "n_timeout_s\030\002 \001(\002\022!\n\031subscription_freque" +
+      "ncy_ms\030\003 \001(\002\"k\n\rAlarmResponse\022%\n\010alarm_i" +
+      "d\030\001 \001(\0132\023.monitoring.AlarmID\022\014\n\004text\030\002 \001" +
+      "(\t\022%\n\010kpi_list\030\003 \001(\0132\023.monitoring.KpiLis" +
+      "t\"B\n\tAlarmList\0225\n\020alarm_descriptor\030\001 \003(\013" +
+      "2\033.monitoring.AlarmDescriptor2\234\t\n\021Monito" +
+      "ringService\0228\n\006SetKpi\022\031.monitoring.KpiDe" +
+      "scriptor\032\021.monitoring.KpiId\"\000\0220\n\tDeleteK" +
+      "pi\022\021.monitoring.KpiId\032\016.context.Empty\"\000\022" +
+      "B\n\020GetKpiDescriptor\022\021.monitoring.KpiId\032\031" +
+      ".monitoring.KpiDescriptor\"\000\022G\n\024GetKpiDes" +
+      "criptorList\022\016.context.Empty\032\035.monitoring" +
+      ".KpiDescriptorList\"\000\022/\n\nIncludeKpi\022\017.mon" +
+      "itoring.Kpi\032\016.context.Empty\"\000\022=\n\nMonitor" +
+      "Kpi\022\035.monitoring.MonitorKpiRequest\032\016.con" +
+      "text.Empty\"\000\022?\n\014QueryKpiData\022\024.monitorin" +
+      "g.KpiQuery\032\027.monitoring.RawKpiTable\"\000\022N\n" +
+      "\022SetKpiSubscription\022\032.monitoring.SubsDes" +
+      "criptor\032\030.monitoring.SubsResponse\"\0000\001\022M\n" +
+      "\021GetSubsDescriptor\022\032.monitoring.Subscrip" +
+      "tionID\032\032.monitoring.SubsDescriptor\"\000\022:\n\020" +
+      "GetSubscriptions\022\016.context.Empty\032\024.monit" +
+      "oring.SubsList\"\000\022B\n\022DeleteSubscription\022\032" +
+      ".monitoring.SubscriptionID\032\016.context.Emp" +
+      "ty\"\000\022A\n\013SetKpiAlarm\022\033.monitoring.AlarmDe" +
+      "scriptor\032\023.monitoring.AlarmID\"\000\0224\n\tGetAl" +
+      "arms\022\016.context.Empty\032\025.monitoring.AlarmL" +
+      "ist\"\000\022H\n\022GetAlarmDescriptor\022\023.monitoring" +
+      ".AlarmID\032\033.monitoring.AlarmDescriptor\"\000\022" +
+      "V\n\026GetAlarmResponseStream\022\035.monitoring.A" +
+      "larmSubscription\032\031.monitoring.AlarmRespo" +
+      "nse\"\0000\001\0224\n\013DeleteAlarm\022\023.monitoring.Alar" +
+      "mID\032\016.context.Empty\"\000\0226\n\014GetStreamKpi\022\021." +
+      "monitoring.KpiId\032\017.monitoring.Kpi\"\0000\001\0225\n" +
+      "\rGetInstantKpi\022\021.monitoring.KpiId\032\017.moni" +
+      "toring.Kpi\"\000b\006proto3"
     };
     descriptor = com.google.protobuf.Descriptors.FileDescriptor
       .internalBuildGeneratedFileFrom(descriptorData,
@@ -21468,7 +21672,7 @@ public final class Monitoring {
     internal_static_monitoring_KpiDescriptor_fieldAccessorTable = new
       com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
         internal_static_monitoring_KpiDescriptor_descriptor,
-        new java.lang.String[] { "KpiId", "KpiDescription", "KpiIdList", "KpiSampleType", "DeviceId", "EndpointId", "ServiceId", "SliceId", "ConnectionId", });
+        new java.lang.String[] { "KpiId", "KpiDescription", "KpiIdList", "KpiSampleType", "DeviceId", "EndpointId", "ServiceId", "SliceId", "ConnectionId", "LinkId", });
     internal_static_monitoring_MonitorKpiRequest_descriptor =
       getDescriptor().getMessageTypes().get(1);
     internal_static_monitoring_MonitorKpiRequest_fieldAccessorTable = new
diff --git a/src/policy/target/kubernetes/kubernetes.yml b/src/policy/target/kubernetes/kubernetes.yml
index 0f97b9338962e0d19427443968fb004ba4da9573..5cd1f1c4c1b4ce437c16707018f83ef6ec60215a 100644
--- a/src/policy/target/kubernetes/kubernetes.yml
+++ b/src/policy/target/kubernetes/kubernetes.yml
@@ -1,23 +1,10 @@
-# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/)
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#      http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
 ---
 apiVersion: v1
 kind: Service
 metadata:
   annotations:
-    app.quarkus.io/commit-id: 8d0654b519e90fe0127e7d1419adce25fa3a179d
-    app.quarkus.io/build-timestamp: 2023-07-10 - 09:41:26 +0000
+    app.quarkus.io/commit-id: 46486023929121fc955e9550fc8fd625ded433d2
+    app.quarkus.io/build-timestamp: 2023-12-15 - 11:56:20 +0000
     prometheus.io/scrape: "true"
     prometheus.io/path: /q/metrics
     prometheus.io/port: "8080"
@@ -28,12 +15,12 @@ metadata:
   name: policyservice
 spec:
   ports:
-    - name: http
-      port: 9192
-      targetPort: 8080
     - name: grpc-server
       port: 6060
       targetPort: 6060
+    - name: http
+      port: 9192
+      targetPort: 8080
   selector:
     app.kubernetes.io/name: policyservice
   type: ClusterIP
@@ -42,8 +29,8 @@ apiVersion: apps/v1
 kind: Deployment
 metadata:
   annotations:
-    app.quarkus.io/commit-id: 8d0654b519e90fe0127e7d1419adce25fa3a179d
-    app.quarkus.io/build-timestamp: 2023-07-10 - 09:41:26 +0000
+    app.quarkus.io/commit-id: 46486023929121fc955e9550fc8fd625ded433d2
+    app.quarkus.io/build-timestamp: 2023-12-15 - 11:56:20 +0000
     prometheus.io/scrape: "true"
     prometheus.io/path: /q/metrics
     prometheus.io/port: "8080"
@@ -60,8 +47,8 @@ spec:
   template:
     metadata:
       annotations:
-        app.quarkus.io/commit-id: 8d0654b519e90fe0127e7d1419adce25fa3a179d
-        app.quarkus.io/build-timestamp: 2023-07-10 - 09:41:26 +0000
+        app.quarkus.io/commit-id: 46486023929121fc955e9550fc8fd625ded433d2
+        app.quarkus.io/build-timestamp: 2023-12-15 - 11:56:20 +0000
         prometheus.io/scrape: "true"
         prometheus.io/path: /q/metrics
         prometheus.io/port: "8080"
@@ -78,10 +65,10 @@ spec:
                   fieldPath: metadata.namespace
             - name: CONTEXT_SERVICE_HOST
               value: contextservice
-            - name: SERVICE_SERVICE_HOST
-              value: serviceservice
             - name: MONITORING_SERVICE_HOST
               value: monitoringservice
+            - name: SERVICE_SERVICE_HOST
+              value: serviceservice
           image: labs.etsi.org:5050/tfs/controller/policy:0.1.0
           imagePullPolicy: Always
           livenessProbe:
@@ -96,12 +83,12 @@ spec:
             timeoutSeconds: 10
           name: policyservice
           ports:
-            - containerPort: 8080
-              name: http
-              protocol: TCP
             - containerPort: 6060
               name: grpc-server
               protocol: TCP
+            - containerPort: 8080
+              name: http
+              protocol: TCP
           readinessProbe:
             failureThreshold: 3
             httpGet:
diff --git a/src/service/Dockerfile b/src/service/Dockerfile
index 5988374e07a731c0f99f732a271c767e16281114..85454350f1eb9413af0ef995386868d09222121c 100644
--- a/src/service/Dockerfile
+++ b/src/service/Dockerfile
@@ -16,7 +16,7 @@ FROM python:3.9-slim
 
 # Install dependencies
 RUN apt-get --yes --quiet --quiet update && \
-    apt-get --yes --quiet --quiet install wget g++ && \
+    apt-get --yes --quiet --quiet install wget g++ git && \
     rm -rf /var/lib/apt/lists/*
 
 # Set Python to show logs as they occur
@@ -62,10 +62,15 @@ 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/frontend/. pathcomp/frontend/
 COPY src/service/. service/
+COPY src/context/__init__.py context/__init__.py
+COPY src/context/client/. context/client/
+COPY src/device/__init__.py device/__init__.py
+COPY src/device/client/. device/client/
+COPY src/pathcomp/frontend/__init__.py pathcomp/frontend/__init__.py
+COPY src/pathcomp/frontend/client/. pathcomp/frontend/client/
+COPY src/e2e_orchestrator/__init__.py e2e_orchestrator/__init__.py
+COPY src/e2e_orchestrator/client/. e2e_orchestrator/client/
 
 # Start the service
 ENTRYPOINT ["python", "-m", "service.service"]
diff --git a/src/service/service/ServiceServiceServicerImpl.py b/src/service/service/ServiceServiceServicerImpl.py
index f79e3e5f3aa983aacda3163682737cdf0ff6be03..d7a983dc97cefd9a796ab97629ba2dbe58a71b22 100644
--- a/src/service/service/ServiceServiceServicerImpl.py
+++ b/src/service/service/ServiceServiceServicerImpl.py
@@ -21,10 +21,12 @@ from common.method_wrappers.ServiceExceptions import (
 from common.proto.context_pb2 import (
     Connection, Empty, Service, ServiceId, ServiceStatusEnum, ServiceTypeEnum, ConstraintActionEnum)
 from common.proto.pathcomp_pb2 import PathCompRequest
+from common.proto.e2eorchestrator_pb2 import E2EOrchestratorRequest
 from common.proto.service_pb2_grpc import ServiceServiceServicer
 from common.tools.context_queries.Service import get_service_by_id
 from common.tools.grpc.Tools import grpc_message_to_json, grpc_message_to_json_string
 from context.client.ContextClient import ContextClient
+from e2e_orchestrator.client.E2EOrchestratorClient import E2EOrchestratorClient
 from pathcomp.frontend.client.PathCompClient import PathCompClient
 from service.service.tools.ConnectionToString import connection_to_string
 from service.client.TEServiceClient import TEServiceClient
@@ -153,6 +155,32 @@ class ServiceServiceServicerImpl(ServiceServiceServicer):
                 str_service_status = ServiceStatusEnum.Name(service_status.service_status)
                 raise Exception(MSG.format(service_key, str_service_status))
 
+        if service.service_type == ServiceTypeEnum.SERVICETYPE_E2E:
+            # End-to-End service:
+            service_id_with_uuids = context_client.SetService(request)
+
+            service_with_uuids = get_service_by_id(
+                context_client, service_id_with_uuids, rw_copy=False,
+                include_config_rules=True, include_constraints=True, include_endpoint_ids=True)
+
+            e2e_orch_request = E2EOrchestratorRequest()
+            e2e_orch_request.service.CopyFrom(service_with_uuids)
+
+            e2e_orch_client = E2EOrchestratorClient()
+            e2e_orch_reply = e2e_orch_client.Compute(e2e_orch_request)
+
+            # Feed TaskScheduler with this end-to-end orchestrator reply. TaskScheduler identifies
+            # inter-dependencies among the services and connections retrieved and produces a
+            # schedule of tasks (an ordered list of tasks to be executed) to implement the
+            # requested create/update operation.
+            tasks_scheduler = TasksScheduler(self.service_handler_factory)
+            # e2e_orch_reply should be compatible with pathcomp_reply
+            # TODO: if we extend e2e_orch_reply, implement method TasksScheduler::compose_from_e2eorchreply()
+            tasks_scheduler.compose_from_pathcompreply(e2e_orch_reply, is_delete=False)
+            tasks_scheduler.execute_all()
+            return service_with_uuids.service_id
+
+
         # Normal service
         del service.service_endpoint_ids[:] # pylint: disable=no-member
         for endpoint_id in request.service_endpoint_ids:
diff --git a/src/service/service/service_handler_api/FilterFields.py b/src/service/service/service_handler_api/FilterFields.py
index 1b22c5c42e908e9b9455358edd2abf54442628f5..35c45c99699b5bc640639cde3054ef72bbb6de50 100644
--- a/src/service/service/service_handler_api/FilterFields.py
+++ b/src/service/service/service_handler_api/FilterFields.py
@@ -25,6 +25,7 @@ SERVICE_TYPE_VALUES = {
     ServiceTypeEnum.SERVICETYPE_L2NM,
     ServiceTypeEnum.SERVICETYPE_TAPI_CONNECTIVITY_SERVICE,
     ServiceTypeEnum.SERVICETYPE_TE,
+    ServiceTypeEnum.SERVICETYPE_E2E,
 }
 
 DEVICE_DRIVER_VALUES = {
@@ -33,10 +34,11 @@ DEVICE_DRIVER_VALUES = {
     DeviceDriverEnum.DEVICEDRIVER_TRANSPORT_API,
     DeviceDriverEnum.DEVICEDRIVER_P4,
     DeviceDriverEnum.DEVICEDRIVER_IETF_NETWORK_TOPOLOGY,
-    DeviceDriverEnum.DEVICEDRIVER_ONF_TR_352,
+    DeviceDriverEnum.DEVICEDRIVER_ONF_TR_532,
     DeviceDriverEnum.DEVICEDRIVER_XR,
     DeviceDriverEnum.DEVICEDRIVER_IETF_L2VPN,
     DeviceDriverEnum.DEVICEDRIVER_GNMI_OPENCONFIG,
+    DeviceDriverEnum.DEVICEDRIVER_FLEXSCALE,
 }
 
 # Map allowed filter fields to allowed values per Filter field. If no restriction (free text) None is specified
diff --git a/src/service/service/service_handlers/__init__.py b/src/service/service/service_handlers/__init__.py
index 7ea0d4f627b5d6010f6e40135f6005471efe8d71..551d35c7ba8f5386831871fe70fdc962633e1a18 100644
--- a/src/service/service/service_handlers/__init__.py
+++ b/src/service/service/service_handlers/__init__.py
@@ -24,6 +24,7 @@ from .microwave.MicrowaveServiceHandler import MicrowaveServiceHandler
 from .p4.p4_service_handler import P4ServiceHandler
 from .tapi_tapi.TapiServiceHandler import TapiServiceHandler
 from .tapi_xr.TapiXrServiceHandler import TapiXrServiceHandler
+from .e2e_orch.E2EOrchestratorServiceHandler import E2EOrchestratorServiceHandler
 
 SERVICE_HANDLERS = [
     (L2NMEmulatedServiceHandler, [
@@ -71,7 +72,7 @@ SERVICE_HANDLERS = [
     (MicrowaveServiceHandler, [
         {
             FilterFieldEnum.SERVICE_TYPE  : ServiceTypeEnum.SERVICETYPE_L2NM,
-            FilterFieldEnum.DEVICE_DRIVER : [DeviceDriverEnum.DEVICEDRIVER_IETF_NETWORK_TOPOLOGY, DeviceDriverEnum.DEVICEDRIVER_ONF_TR_352],
+            FilterFieldEnum.DEVICE_DRIVER : [DeviceDriverEnum.DEVICEDRIVER_IETF_NETWORK_TOPOLOGY, DeviceDriverEnum.DEVICEDRIVER_ONF_TR_532],
         }
     ]),
     (P4ServiceHandler, [
@@ -86,4 +87,10 @@ SERVICE_HANDLERS = [
             FilterFieldEnum.DEVICE_DRIVER : [DeviceDriverEnum.DEVICEDRIVER_IETF_L2VPN],
         }
     ]),
+    (E2EOrchestratorServiceHandler, [
+        {
+            FilterFieldEnum.SERVICE_TYPE  : ServiceTypeEnum.SERVICETYPE_E2E,
+            FilterFieldEnum.DEVICE_DRIVER : [DeviceDriverEnum.DEVICEDRIVER_FLEXSCALE],
+        }
+    ]),
 ]
diff --git a/src/service/service/service_handlers/e2e_orch/E2EOrchestratorServiceHandler.py b/src/service/service/service_handlers/e2e_orch/E2EOrchestratorServiceHandler.py
new file mode 100644
index 0000000000000000000000000000000000000000..5a068bb515793179e5f4c9169fb00dc0ce292384
--- /dev/null
+++ b/src/service/service/service_handlers/e2e_orch/E2EOrchestratorServiceHandler.py
@@ -0,0 +1,176 @@
+# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/)
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT 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 Any, Dict, List, Optional, Tuple, Union
+from common.method_wrappers.Decorator import MetricsPool, metered_subclass_method
+from common.proto.context_pb2 import ConfigRule, DeviceId, Service
+from common.tools.object_factory.ConfigRule import json_config_rule_set
+from common.tools.object_factory.Device import json_device_id
+from common.type_checkers.Checkers import chk_type
+from service.service.service_handler_api.Tools import get_device_endpoint_uuids
+from service.service.service_handler_api._ServiceHandler import _ServiceHandler
+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': 'e2e_orch'})
+
+class E2EOrchestratorServiceHandler(_ServiceHandler):
+    def __init__(   # pylint: disable=super-init-not-called
+        self, service : Service, task_executor : TaskExecutor, **settings
+    ) -> None:
+        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.__service.service_id.service_uuid.uuid
+        settings = self.__settings_handler.get('/settings')
+        json_settings : Dict = {} if settings is None else settings.value
+        bitrate = json_settings.get('bitrate', 1000)
+
+        results = []
+        try:
+            src_device_uuid, src_endpoint_uuid = get_device_endpoint_uuids(endpoints[0])
+            src_device = self.__task_executor.get_device(DeviceId(**json_device_id(src_device_uuid)))
+            src_controller = self.__task_executor.get_device_controller(src_device)
+            if src_controller is None: src_controller = src_device
+
+            dst_device_uuid, dst_endpoint_uuid = get_device_endpoint_uuids(endpoints[-1])
+            dst_device = self.__task_executor.get_device(DeviceId(**json_device_id(dst_device_uuid)))
+            dst_controller = self.__task_executor.get_device_controller(dst_device)
+            if dst_controller is None: dst_controller = dst_device
+
+            controller = src_controller
+
+            json_config_rule = json_config_rule_set('/services/service[{:s}]'.format(service_uuid), {
+                'uuid'                    : service_uuid,
+                'src_node'                : src_endpoint_uuid,
+                'dst_node'                : dst_endpoint_uuid,
+                'bitrate'                 : bitrate
+            })
+            del controller.device_config.config_rules[:]
+            controller.device_config.config_rules.append(ConfigRule(**json_config_rule))
+            self.__task_executor.configure_device(controller)
+            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
+        settings = self.__settings_handler.get('/settings')
+        json_settings : Dict = {} if settings is None else settings.value
+        flow_id = json_settings.get('flow_id', 100)
+        bitrate = json_settings.get('bitrate', 1000)
+
+        results = []
+        try:
+            src_device_uuid, src_endpoint_uuid = get_device_endpoint_uuids(endpoints[0])
+            src_device = self.__task_executor.get_device(DeviceId(**json_device_id(src_device_uuid)))
+            src_controller = self.__task_executor.get_device_controller(src_device)
+            if src_controller is None: src_controller = src_device
+
+            dst_device_uuid, dst_endpoint_uuid = get_device_endpoint_uuids(endpoints[1])
+            dst_device = self.__task_executor.get_device(DeviceId(**json_device_id(dst_device_uuid)))
+            dst_controller = self.__task_executor.get_device_controller(dst_device)
+            if dst_controller is None: dst_controller = dst_device
+
+            controller = src_controller
+
+            json_config_rule = json_config_rule_set('/services/service[{:s}]'.format(service_uuid), {
+                'uuid'                    : service_uuid,
+                'flow_id'                 : flow_id,
+                'src_node'                : src_endpoint_uuid,
+                'dst_node'                : dst_endpoint_uuid,
+                'bitrate'                 : bitrate
+            })
+
+            del controller.device_config.config_rules[:]
+            controller.device_config.config_rules.append(ConfigRule(**json_config_rule))
+            self.__task_executor.configure_device(controller)
+            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/e2e_orch/__init__.py b/src/service/service/service_handlers/e2e_orch/__init__.py
new file mode 100644
index 0000000000000000000000000000000000000000..1549d9811aa5d1c193a44ad45d0d7773236c0612
--- /dev/null
+++ b/src/service/service/service_handlers/e2e_orch/__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/Dockerfile b/src/slice/Dockerfile
index 4c434e212da441c5a56e58e9a9509195c202355f..94d5fc040dff083407cae514ed0363b5d2ea9bb1 100644
--- a/src/slice/Dockerfile
+++ b/src/slice/Dockerfile
@@ -16,7 +16,7 @@ FROM python:3.9-slim
 
 # Install dependencies
 RUN apt-get --yes --quiet --quiet update && \
-    apt-get --yes --quiet --quiet install wget g++ && \
+    apt-get --yes --quiet --quiet install wget g++ git && \
     rm -rf /var/lib/apt/lists/*
 
 # Set Python to show logs as they occur
diff --git a/src/te/config/sys.config.src b/src/te/config/sys.config.src
index edcd4384a3236df42b1e530c8b3a92b96c80e09e..22e9e2565f8d7541df47e4df3214d52abf99967a 100644
--- a/src/te/config/sys.config.src
+++ b/src/te/config/sys.config.src
@@ -27,8 +27,8 @@
             {monitoring, [
                 {http, {env, "MONITORINGSERVICE_SERVICE_HOST"}, {env, "MONITORINGSERVICE_SERVICE_PORT_GRPC"}, []}
             ], #{}},
-            {compute, [
-                {http, {env, "COMPUTESERVICE_SERVICE_HOST"}, {env, "COMPUTESERVICE_SERVICE_PORT_GRPC"}, []}
+            {nbi, [
+                {http, {env, "NBISERVICE_SERVICE_HOST"}, {env, "NBISERVICE_SERVICE_PORT_GRPC"}, []}
             ], #{}},
             {device, [
                 {http, {env, "DEVICESERVICE_SERVICE_HOST"}, {env, "DEVICESERVICE_SERVICE_PORT_GRPC"}, []}
@@ -36,8 +36,8 @@
             {context, [
                 {http, {env, "CONTEXTSERVICE_SERVICE_HOST"}, {env, "CONTEXTSERVICE_SERVICE_PORT_GRPC"}, []}
             ], #{}},
-            {automation, [
-                {http, {env, "AUTOMATIONSERVICE_SERVICE_HOST"}, {env, "AUTOMATIONSERVICE_SERVICE_PORT_GRPC"}, []}
+            {ztp, [
+                {http, {env, "ZTPSERVICE_SERVICE_HOST"}, {env, "ZTPSERVICE_SERVICE_PORT_GRPC"}, []}
             ], #{}}
         ]}
     ]},
@@ -98,4 +98,4 @@
             }}
         ]}
     ]}
-].
\ No newline at end of file
+].
diff --git a/src/te/tests/deploy_specs.sh b/src/te/tests/deploy_specs.sh
index 818fb2b0d69ae63b197a83683e68aed96e50d6e2..fbe4af71065aaef00e111b6909f28d80858a64e3 100644
--- a/src/te/tests/deploy_specs.sh
+++ b/src/te/tests/deploy_specs.sh
@@ -19,14 +19,14 @@
 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 pathcomp service slice compute webui load_generator"
+#export TFS_COMPONENTS="context device pathcomp service slice nbi webui load_generator"
 export TFS_COMPONENTS="context device pathcomp service slice webui"
 
 # Uncomment to activate Monitoring
 #export TFS_COMPONENTS="${TFS_COMPONENTS} monitoring"
 
-# Uncomment to activate Automation and Policy Manager
-#export TFS_COMPONENTS="${TFS_COMPONENTS} automation policy"
+# Uncomment to activate ZTP and Policy Manager
+#export TFS_COMPONENTS="${TFS_COMPONENTS} ztp policy"
 
 # Uncomment to activate Optical CyberSecurity
 #export TFS_COMPONENTS="${TFS_COMPONENTS} dbscanserving opticalattackmitigator opticalattackdetector opticalattackmanager"
diff --git a/src/tests/Fixtures.py b/src/tests/Fixtures.py
index ecb44a7588d62e14f4295141adb3acc7bbe89532..62ad13f49f0bc73040c350040fac79e89a2b6070 100644
--- a/src/tests/Fixtures.py
+++ b/src/tests/Fixtures.py
@@ -16,6 +16,15 @@ import pytest
 from context.client.ContextClient import ContextClient
 from device.client.DeviceClient import DeviceClient
 from monitoring.client.MonitoringClient import MonitoringClient
+from e2e_orchestrator.client.E2EOrchestratorClient import E2EOrchestratorClient
+from service.client.ServiceClient import ServiceClient
+
+
+@pytest.fixture(scope='session')
+def service_client():
+    _client = ServiceClient()
+    yield _client
+    _client.close()
 
 @pytest.fixture(scope='session')
 def context_client():
@@ -34,3 +43,9 @@ def monitoring_client():
     _client = MonitoringClient()
     yield _client
     _client.close()
+
+@pytest.fixture(scope='session')
+def e2eorchestrator_client():
+    _client = E2EOrchestratorClient()
+    yield _client
+    _client.close()
diff --git a/src/tests/benchmark/policy/deploy_specs.sh b/src/tests/benchmark/policy/deploy_specs.sh
index 7d408f003ce411566b9bf2435d89c72ff5db1459..78b6fa72554b193c9cc107682bdf031c3a8b35c0 100644
--- a/src/tests/benchmark/policy/deploy_specs.sh
+++ b/src/tests/benchmark/policy/deploy_specs.sh
@@ -19,7 +19,7 @@
 export TFS_REGISTRY_IMAGES="http://localhost:32000/tfs/"
 
 # Set the list of components, separated by spaces, you want to build images for, and deploy.
-export TFS_COMPONENTS="context device automation monitoring pathcomp service slice compute webui"
+export TFS_COMPONENTS="context device ztp monitoring pathcomp service slice nbi webui"
 
 # Set the tag you want to use for your images.
 export TFS_IMAGE_TAG="dev"
diff --git a/src/tests/benchmark/policy/tests/Fixtures.py b/src/tests/benchmark/policy/tests/Fixtures.py
index 89dda54cf945d7078cd61c4b94b282f650429309..7ef60fb194aa7f0fb13fba01be2c16d9ef350ba9 100644
--- a/src/tests/benchmark/policy/tests/Fixtures.py
+++ b/src/tests/benchmark/policy/tests/Fixtures.py
@@ -23,6 +23,6 @@ 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')))
+        get_setting('NBISERVICE_SERVICE_HOST'), str(get_setting('NBISERVICE_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/.gitignore b/src/tests/benchmark/ztp/.gitignore
similarity index 100%
rename from src/tests/benchmark/automation/.gitignore
rename to src/tests/benchmark/ztp/.gitignore
diff --git a/src/tests/benchmark/automation/README.md b/src/tests/benchmark/ztp/README.md
similarity index 100%
rename from src/tests/benchmark/automation/README.md
rename to src/tests/benchmark/ztp/README.md
diff --git a/src/tests/benchmark/automation/ZtpAdd.js b/src/tests/benchmark/ztp/ZtpAdd.js
similarity index 92%
rename from src/tests/benchmark/automation/ZtpAdd.js
rename to src/tests/benchmark/ztp/ZtpAdd.js
index d7740ad32c8b685a31a31c5fc09a7a7cc6ef27a0..3d7a7831a0cd9dfc73eab8133681ecd20d2f81ef 100644
--- a/src/tests/benchmark/automation/ZtpAdd.js
+++ b/src/tests/benchmark/ztp/ZtpAdd.js
@@ -19,7 +19,7 @@ import exec from "k6/execution";
 import { check, sleep } from 'k6';
 
 const client = new grpc.Client();
-client.load(['../../../../proto'], 'automation.proto');
+client.load(['../../../../proto'], 'ztp.proto');
 
 export const data = [];
 for (let i = 1; i < 801; i++) {
@@ -51,7 +51,7 @@ export default () => {
   });
 
   var item = data[exec.scenario.iterationInInstance];
-  const response = client.invoke('automation.AutomationService/ZtpAdd', item);
+  const response = client.invoke('ztp.ZTPService/ZtpAdd', item);
 
   check(response, {
     'status is OK': (r) => r && r.status === grpc.StatusOK,
diff --git a/src/tests/benchmark/automation/ZtpDelete.js b/src/tests/benchmark/ztp/ZtpDelete.js
similarity index 92%
rename from src/tests/benchmark/automation/ZtpDelete.js
rename to src/tests/benchmark/ztp/ZtpDelete.js
index b1b7f3a09734d484ef14868cbf93c87dce79f357..4b5d41340a9ac4d42899a996380a3bc5203bc1fd 100644
--- a/src/tests/benchmark/automation/ZtpDelete.js
+++ b/src/tests/benchmark/ztp/ZtpDelete.js
@@ -19,7 +19,7 @@ import exec from "k6/execution";
 import { check, sleep } from 'k6';
 
 const client = new grpc.Client();
-client.load(['../../../../proto'], 'automation.proto');
+client.load(['../../../../proto'], 'ztp.proto');
 
 export const data = [];
 for (let i = 1; i < 801; i++) {
@@ -51,7 +51,7 @@ export default () => {
   });
 
   var item = data[exec.scenario.iterationInInstance];
-  const response = client.invoke('automation.AutomationService/ZtpDelete', item);
+  const response = client.invoke('ztp.ZTPService/ZtpDelete', item);
 
   check(response, {
     'status is OK': (r) => r && r.status === grpc.StatusOK,
diff --git a/src/tests/benchmark/automation/ZtpUpdate.js b/src/tests/benchmark/ztp/ZtpUpdate.js
similarity index 93%
rename from src/tests/benchmark/automation/ZtpUpdate.js
rename to src/tests/benchmark/ztp/ZtpUpdate.js
index c274d22861ae6df52906d57cfb545eb1dc3c94c2..61d38bc993d7ceeda9c8c7ce29e1b9804e6825f4 100644
--- a/src/tests/benchmark/automation/ZtpUpdate.js
+++ b/src/tests/benchmark/ztp/ZtpUpdate.js
@@ -19,7 +19,7 @@ import exec from "k6/execution";
 import { check, sleep } from 'k6';
 
 const client = new grpc.Client();
-client.load(['../../../../proto'], 'automation.proto');
+client.load(['../../../../proto'], 'ztp.proto');
 
 export const data = [];
 for (let i = 1; i < 801; i++) {
@@ -56,7 +56,7 @@ export default () => {
   });
 
   var item = data[exec.scenario.iterationInInstance];
-  const response = client.invoke('automation.AutomationService/ZtpUpdate', item);
+  const response = client.invoke('ztp.ZTPService/ZtpUpdate', item);
 
   check(response, {
     'status is OK': (r) => r && r.status === grpc.StatusOK,
diff --git a/src/tests/benchmark/ztp/__init__.py b/src/tests/benchmark/ztp/__init__.py
new file mode 100644
index 0000000000000000000000000000000000000000..1549d9811aa5d1c193a44ad45d0d7773236c0612
--- /dev/null
+++ b/src/tests/benchmark/ztp/__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/ztp/run_test_01_bootstrap.sh
similarity index 90%
rename from src/tests/benchmark/automation/run_test_01_bootstrap.sh
rename to src/tests/benchmark/ztp/run_test_01_bootstrap.sh
index 2382521b26cbf6217aacea7c2f9d86fdac1209be..bbd0b5111ab3ddb05513396b253fe4c7e630d3a5 100755
--- a/src/tests/benchmark/automation/run_test_01_bootstrap.sh
+++ b/src/tests/benchmark/ztp/run_test_01_bootstrap.sh
@@ -14,4 +14,4 @@
 # limitations under the License.
 
 source tfs_runtime_env_vars.sh
-pytest --verbose --log-level=INFO -o log_cli=true -o log_cli_level=INFO src/tests/benchmark/automation/tests/test_functional_bootstrap.py
+pytest --verbose --log-level=INFO -o log_cli=true -o log_cli_level=INFO src/tests/benchmark/ztp/tests/test_functional_bootstrap.py
diff --git a/src/tests/benchmark/automation/run_test_02_cleanup.sh b/src/tests/benchmark/ztp/run_test_02_cleanup.sh
similarity index 91%
rename from src/tests/benchmark/automation/run_test_02_cleanup.sh
rename to src/tests/benchmark/ztp/run_test_02_cleanup.sh
index 56965d2007b441ab76ab07777a04c25b38eb8b28..6b98bca0097b17c96793c9168c0976bd1e48fe3a 100755
--- a/src/tests/benchmark/automation/run_test_02_cleanup.sh
+++ b/src/tests/benchmark/ztp/run_test_02_cleanup.sh
@@ -14,4 +14,4 @@
 # limitations under the License.
 
 source tfs_runtime_env_vars.sh
-pytest --verbose --log-level=INFO -o log_cli=true -o log_cli_level=INFO src/tests/benchmark/automation/tests/test_functional_cleanup.py
+pytest --verbose --log-level=INFO -o log_cli=true -o log_cli_level=INFO src/tests/benchmark/ztp/tests/test_functional_cleanup.py
diff --git a/src/tests/benchmark/automation/tests/.gitignore b/src/tests/benchmark/ztp/tests/.gitignore
similarity index 100%
rename from src/tests/benchmark/automation/tests/.gitignore
rename to src/tests/benchmark/ztp/tests/.gitignore
diff --git a/src/tests/benchmark/automation/tests/Fixtures.py b/src/tests/benchmark/ztp/tests/Fixtures.py
similarity index 91%
rename from src/tests/benchmark/automation/tests/Fixtures.py
rename to src/tests/benchmark/ztp/tests/Fixtures.py
index 89dda54cf945d7078cd61c4b94b282f650429309..7ef60fb194aa7f0fb13fba01be2c16d9ef350ba9 100644
--- a/src/tests/benchmark/automation/tests/Fixtures.py
+++ b/src/tests/benchmark/ztp/tests/Fixtures.py
@@ -23,6 +23,6 @@ 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')))
+        get_setting('NBISERVICE_SERVICE_HOST'), str(get_setting('NBISERVICE_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/ztp/tests/Objects.py
similarity index 100%
rename from src/tests/benchmark/automation/tests/Objects.py
rename to src/tests/benchmark/ztp/tests/Objects.py
diff --git a/src/tests/benchmark/ztp/tests/__init__.py b/src/tests/benchmark/ztp/tests/__init__.py
new file mode 100644
index 0000000000000000000000000000000000000000..1549d9811aa5d1c193a44ad45d0d7773236c0612
--- /dev/null
+++ b/src/tests/benchmark/ztp/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/ztp/tests/test_functional_bootstrap.py
similarity index 100%
rename from src/tests/benchmark/automation/tests/test_functional_bootstrap.py
rename to src/tests/benchmark/ztp/tests/test_functional_bootstrap.py
diff --git a/src/tests/benchmark/automation/tests/test_functional_cleanup.py b/src/tests/benchmark/ztp/tests/test_functional_cleanup.py
similarity index 100%
rename from src/tests/benchmark/automation/tests/test_functional_cleanup.py
rename to src/tests/benchmark/ztp/tests/test_functional_cleanup.py
diff --git a/src/tests/ecoc22/deploy_specs.sh b/src/tests/ecoc22/deploy_specs.sh
index b1ee5ef6d6e500078bf0e170af5dfb32f01df088..f2a19f773de041f322bec72796884cfffc5f01c7 100755
--- a/src/tests/ecoc22/deploy_specs.sh
+++ b/src/tests/ecoc22/deploy_specs.sh
@@ -20,14 +20,14 @@
 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 pathcomp service slice compute webui load_generator"
-export TFS_COMPONENTS="context device pathcomp service slice compute webui"
+#export TFS_COMPONENTS="context device pathcomp service slice nbi webui load_generator"
+export TFS_COMPONENTS="context device pathcomp service slice nbi webui"
 
 # Uncomment to activate Monitoring
 #export TFS_COMPONENTS="${TFS_COMPONENTS} monitoring"
 
-# Uncomment to activate Automation and Policy Manager
-#export TFS_COMPONENTS="${TFS_COMPONENTS} automation policy"
+# Uncomment to activate ZTP and Policy Manager
+#export TFS_COMPONENTS="${TFS_COMPONENTS} ztp policy"
 
 # Uncomment to activate Optical CyberSecurity
 #export TFS_COMPONENTS="${TFS_COMPONENTS} dbscanserving opticalattackmitigator opticalattackdetector opticalattackmanager"
diff --git a/src/tests/ecoc22/tests/Fixtures.py b/src/tests/ecoc22/tests/Fixtures.py
index 89dda54cf945d7078cd61c4b94b282f650429309..7ef60fb194aa7f0fb13fba01be2c16d9ef350ba9 100644
--- a/src/tests/ecoc22/tests/Fixtures.py
+++ b/src/tests/ecoc22/tests/Fixtures.py
@@ -23,6 +23,6 @@ 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')))
+        get_setting('NBISERVICE_SERVICE_HOST'), str(get_setting('NBISERVICE_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/hackfest3/README.md b/src/tests/hackfest3/README.md
new file mode 100644
index 0000000000000000000000000000000000000000..b9debfd9b054dc6f9173551909b0035c37aaf3b3
--- /dev/null
+++ b/src/tests/hackfest3/README.md
@@ -0,0 +1,41 @@
+# Tests for P4 functionality of TeraFlowSDN
+
+This directory contains the necessary scripts and configurations to run tests for the P4 functionality of TFS.
+
+## Basic scripts
+
+To run the experiments you should use the five scripts in the following order:
+```
+setup.sh
+run_test_01_bootstrap.sh
+run_test_02_create_service.sh
+run_test_03_delete_service.sh
+run_test_04_cleanup.sh
+```
+
+The setup script copies the necessary artifacts to the SBI service pod. It should be run just once, after a fresh install of TFS.
+The bootstrap script registers the context, topology, links and, devices to TFS.
+The create service scripts establishes a service between two endpoints.
+The delete service script delete the aforementioned service.
+Cleanup script deletes all the objects (context, topology, links, devices) from TFS.
+
+## Objects file
+
+The above bash scripts make use of the corresponding python scripts found under `./tests/` directory.
+More important is the `./tests/Objects.py` file, which contains the definition of the Context, Topology, Devices, Links, Services. **This is the file that need changes in case of a new topology.**
+
+Check the `./tests/Objects.py` file before running the experiment to make sure that the switches details are correct (ip address, port, etc.)
+
+## Mininet topologies
+
+In the `./mininet/` directory there are different mininet topology examples. The current `./tests/Objects.py` file corresponds to the `./mininet/4switch2path.py` topology. For more topologies please refer to `../p4`.
+
+## P4 artifacts
+
+In the `./p4/` directory there are the compiled p4 artifacts that contain the pipeline that will be pushed to the p4 switch, along with the p4-runtime definitions. 
+The `./setup.sh` script copies from this directory. So if you need to change p4 program, make sure to put the compiled artifacts here.
+
+## Latency probe
+
+In the `./probe/` directory there is a little program which calculates latency between two hosts in mininet and sends them to the Monitoring component. For specific instructions, refer to the corresponding `./probe/README.md` file.
+
diff --git a/src/tests/hackfest3/__init__.py b/src/tests/hackfest3/__init__.py
new file mode 100644
index 0000000000000000000000000000000000000000..1549d9811aa5d1c193a44ad45d0d7773236c0612
--- /dev/null
+++ b/src/tests/hackfest3/__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/hackfest3/commands.txt b/src/tests/hackfest3/commands.txt
new file mode 100644
index 0000000000000000000000000000000000000000..0db6497122c4ac3f7de52057cd41e257f4cb37af
--- /dev/null
+++ b/src/tests/hackfest3/commands.txt
@@ -0,0 +1,111 @@
+################## TFS deployment and setup #######################
+
+###### Deployment
+# To deploy TFS:
+cd ~/contoller
+source my_deploy.sh
+./deploy.sh
+
+###### Experiments
+# To onboard the experiment
+cd ~/contoller
+
+# Setup the compiled files
+./src/tests/hackfest3/setup.sh
+
+# Register the devices
+./src/tests/hackfest3/run_test_01_bootstrap.sh
+
+# Create the service
+./src/tests/hackfest3/run_test_02_create_service.sh
+
+# Delete the service
+./src/tests/hackfest3/run_test_03_delete_service.sh
+
+# Cleanup TFS
+./src/tests/hackfest3/run_test_04_cleanup.sh
+
+
+########################## MININET ##################
+# To get the mininet cli 
+cd ~/ngsdn-tutorial
+make mn-cli
+
+#### screen
+# To open a screen in mininet 
+  # For client
+  MN: client screen -S 
+  
+  # For server
+  MN: server screen -S 
+  
+# To get out 
+Press  + d
+ 
+# To reconnect 
+MN: client screen -r 
+
+
+####################### PROBE ######################
+### old probe
+# agent
+source tfs_runtime_env_vars.sh
+
+cd ~/controller/src/tests/hackfest3/probe/probe-tfs
+
+./deploy.sh
+./connect_to_mininet.sh
+./tfsagent
+
+# pinger
+# In mininet
+cd ~/ngsdn-tutorial
+make mn-cli
+MN: client ./tfsping
+
+
+### new probe
+cd ~/controller/src/tests/hackfest3/new-probe
+./copy.sh
+
+# agent:
+# import PYTHONPATH by tfs_enviromental variables
+source tfs_runtime_env_vars.sh
+python agent.py
+
+# pinger
+# In mininet
+cd ~/ngsdn-tutorial
+make mn-cli
+MN: client python ping2.py 10.0.0.2
+
+# To enter delay or packet loss
+cd ~/controller/src/tests/hackfest3/new-probe
+./connect_to_mininet.sh
+tc qdisc add dev  root netem delay ms
+tc qdisc add dev  root netem loss %
+
+################ INT (interactive session 2) ###########
+# build the new code
+cd ~/controller/src/tests/hackfest3/int
+build_p4.sh 
+
+# copy the receiver, sender and helper script to docker container
+cd ~/controller/src/tests/hackfest3/int
+./copy_int_helpers.sh
+./connect_to_mininet.sh
+./install-scapy.sh
+
+# Run the receiver in server screen
+cd ~/ngsdn-tutorial
+make mn-cli
+MN: server screen -S rec
+  MN/Screen: python receive.py
+   + d
+
+# Run the sender in client
+MN: client python send.py 10.0.0.1 "test" 1
+
+# Check the output in receiver
+MN: server screen -r rec
+   + d
diff --git a/src/tests/hackfest3/deploy_specs.sh b/src/tests/hackfest3/deploy_specs.sh
new file mode 100755
index 0000000000000000000000000000000000000000..9d185035a0ab043d60972178a8aec71861fb9b16
--- /dev/null
+++ b/src/tests/hackfest3/deploy_specs.sh
@@ -0,0 +1,150 @@
+#!/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 pathcomp service slice nbi webui load_generator"
+
+# Uncomment to activate Monitoring
+export TFS_COMPONENTS="${TFS_COMPONENTS} monitoring"
+
+# Uncomment to activate Policy Manager
+export TFS_COMPONENTS="${TFS_COMPONENTS} policy"
+
+# Uncomment to activate Automation Manager
+#export TFS_COMPONENTS="${TFS_COMPONENTS} automation"
+
+# Uncomment to activate Optical CyberSecurity
+#export TFS_COMPONENTS="${TFS_COMPONENTS} dbscanserving opticalattackmitigator opticalattackdetector opticalattackmanager"
+
+# Uncomment to activate L3 CyberSecurity
+#export TFS_COMPONENTS="${TFS_COMPONENTS} l3_attackmitigator l3_centralizedattackdetector"
+
+# Uncomment to activate TE
+#export TFS_COMPONENTS="${TFS_COMPONENTS} te"
+
+# 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"
+
+# Uncomment to monitor performance of components
+export TFS_EXTRA_MANIFESTS="${TFS_EXTRA_MANIFESTS} manifests/servicemonitors.yaml"
+
+# Uncomment when deploying Optical CyberSecurity
+#export TFS_EXTRA_MANIFESTS="${TFS_EXTRA_MANIFESTS} manifests/cachingservice.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 external port CockroackDB Postgre SQL interface will be exposed to.
+export CRDB_EXT_PORT_SQL="26257"
+
+# Set the external port CockroackDB HTTP Mgmt GUI interface will be exposed to.
+export CRDB_EXT_PORT_HTTP="8081"
+
+# 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 it exists.
+export CRDB_DROP_DATABASE_IF_EXISTS="YES"
+
+# Disable flag for re-deploying CockroachDB from scratch.
+export CRDB_REDEPLOY="YES"
+
+
+# ----- NATS -------------------------------------------------------------------
+
+# Set the namespace where NATS will be deployed.
+export NATS_NAMESPACE="nats"
+
+# Set the external port NATS Client interface will be exposed to.
+export NATS_EXT_PORT_CLIENT="4222"
+
+# Set the external port NATS HTTP Mgmt GUI interface will be exposed to.
+export NATS_EXT_PORT_HTTP="8222"
+
+# Disable flag for re-deploying NATS from scratch.
+export NATS_REDEPLOY="YES"
+
+
+# ----- QuestDB ----------------------------------------------------------------
+
+# Set the namespace where QuestDB will be deployed.
+export QDB_NAMESPACE="qdb"
+
+# Set the external port QuestDB Postgre SQL interface will be exposed to.
+export QDB_EXT_PORT_SQL="8812"
+
+# Set the external port QuestDB Influx Line Protocol interface will be exposed to.
+export QDB_EXT_PORT_ILP="9009"
+
+# Set the external port QuestDB HTTP Mgmt GUI interface will be exposed to.
+export QDB_EXT_PORT_HTTP="9000"
+
+# Set the database username to be used for QuestDB.
+export QDB_USERNAME="admin"
+
+# Set the database user's password to be used for QuestDB.
+export QDB_PASSWORD="quest"
+
+# Set the table name to be used by Monitoring for KPIs.
+export QDB_TABLE_MONITORING_KPIS="tfs_monitoring_kpis"
+
+# Set the table name to be used by Slice for plotting groups.
+export QDB_TABLE_SLICE_GROUPS="tfs_slice_groups"
+
+# Disable flag for dropping tables if they exist.
+export QDB_DROP_TABLES_IF_EXIST=""
+
+# Disable flag for re-deploying QuestDB from scratch.
+export QDB_REDEPLOY="YES"
+
+
+# ----- K8s Observability ------------------------------------------------------
+
+# Set the external port Prometheus Mgmt HTTP GUI interface will be exposed to.
+export PROM_EXT_PORT_HTTP="9090"
+
+# Set the external port Grafana HTTP Dashboards will be exposed to.
+export GRAF_EXT_PORT_HTTP="3000"
diff --git a/src/tests/hackfest3/grafana/dashboard.json b/src/tests/hackfest3/grafana/dashboard.json
new file mode 100644
index 0000000000000000000000000000000000000000..1c464cecf5304e56c2fd871f99e3e44457fb919a
--- /dev/null
+++ b/src/tests/hackfest3/grafana/dashboard.json
@@ -0,0 +1,276 @@
+{
+  "annotations": {
+    "list": [
+      {
+        "builtIn": 1,
+        "datasource": {
+          "type": "grafana",
+          "uid": "-- Grafana --"
+        },
+        "enable": true,
+        "hide": true,
+        "iconColor": "rgba(0, 211, 255, 1)",
+        "name": "Annotations & Alerts",
+        "target": {
+          "limit": 100,
+          "matchAny": false,
+          "tags": [],
+          "type": "dashboard"
+        },
+        "type": "dashboard"
+      }
+    ]
+  },
+  "editable": true,
+  "fiscalYearStartMonth": 0,
+  "graphTooltip": 0,
+  "id": 11,
+  "links": [],
+  "liveNow": false,
+  "panels": [
+    {
+      "datasource": {
+        "type": "postgres",
+        "uid": "WdiCIPwVk"
+      },
+      "fieldConfig": {
+        "defaults": {
+          "color": {
+            "mode": "thresholds"
+          },
+          "mappings": [],
+          "thresholds": {
+            "mode": "absolute",
+            "steps": [
+              {
+                "color": "green",
+                "value": null
+              }
+            ]
+          }
+        },
+        "overrides": [
+          {
+            "matcher": {
+              "id": "byRegexp",
+              "options": "State"
+            },
+            "properties": [
+              {
+                "id": "mappings",
+                "value": [
+                  {
+                    "options": {
+                      "ACTIVE": {
+                        "color": "green",
+                        "index": 2
+                      },
+                      "ENFORCED": {
+                        "color": "red",
+                        "index": 3
+                      },
+                      "PROVISIONED": {
+                        "color": "yellow",
+                        "index": 1
+                      },
+                      "VALIDATED": {
+                        "color": "blue",
+                        "index": 0
+                      }
+                    },
+                    "type": "value"
+                  }
+                ]
+              }
+            ]
+          }
+        ]
+      },
+      "gridPos": {
+        "h": 4,
+        "w": 24,
+        "x": 0,
+        "y": 0
+      },
+      "id": 4,
+      "options": {
+        "colorMode": "value",
+        "graphMode": "area",
+        "justifyMode": "auto",
+        "orientation": "auto",
+        "reduceOptions": {
+          "calcs": [
+            "lastNotNull"
+          ],
+          "fields": "/^State$/",
+          "values": true
+        },
+        "textMode": "auto"
+      },
+      "pluginVersion": "8.5.22",
+      "targets": [
+        {
+          "datasource": {
+            "type": "postgres",
+            "uid": "WdiCIPwVk"
+          },
+          "format": "time_series",
+          "group": [],
+          "metricColumn": "none",
+          "rawQuery": true,
+          "rawSql": "SELECT\n  updated_at as \"time\",\n  policyrule_state as \"State\"\nFROM policyrule\nORDER BY 1",
+          "refId": "A",
+          "select": [
+            [
+              {
+                "params": [
+                  "policyrule_state"
+                ],
+                "type": "column"
+              }
+            ]
+          ],
+          "table": "policyrule",
+          "timeColumn": "updated_at",
+          "timeColumnType": "timestamp",
+          "where": [
+            {
+              "name": "$__timeFilter",
+              "params": [],
+              "type": "macro"
+            }
+          ]
+        }
+      ],
+      "title": "Policy State",
+      "type": "stat"
+    },
+    {
+      "datasource": {
+        "type": "postgres",
+        "uid": "nSmCIEw4k"
+      },
+      "fieldConfig": {
+        "defaults": {
+          "color": {
+            "mode": "palette-classic"
+          },
+          "custom": {
+            "axisLabel": "latency",
+            "axisPlacement": "right",
+            "axisSoftMin": -1,
+            "barAlignment": 0,
+            "drawStyle": "line",
+            "fillOpacity": 0,
+            "gradientMode": "none",
+            "hideFrom": {
+              "legend": false,
+              "tooltip": false,
+              "viz": false
+            },
+            "lineInterpolation": "smooth",
+            "lineWidth": 1,
+            "pointSize": 5,
+            "scaleDistribution": {
+              "type": "linear"
+            },
+            "showPoints": "auto",
+            "spanNulls": false,
+            "stacking": {
+              "group": "A",
+              "mode": "none"
+            },
+            "thresholdsStyle": {
+              "mode": "line+area"
+            }
+          },
+          "mappings": [],
+          "thresholds": {
+            "mode": "absolute",
+            "steps": [
+              {
+                "color": "green",
+                "value": null
+              },
+              {
+                "color": "orange",
+                "value": 10000
+              }
+            ]
+          },
+          "unit": "µs"
+        },
+        "overrides": []
+      },
+      "gridPos": {
+        "h": 10,
+        "w": 24,
+        "x": 0,
+        "y": 4
+      },
+      "id": 2,
+      "options": {
+        "legend": {
+          "calcs": [],
+          "displayMode": "hidden",
+          "placement": "bottom"
+        },
+        "tooltip": {
+          "mode": "single",
+          "sort": "none"
+        }
+      },
+      "targets": [
+        {
+          "datasource": {
+            "type": "postgres",
+            "uid": "nSmCIEw4k"
+          },
+          "format": "time_series",
+          "group": [],
+          "metricColumn": "none",
+          "rawQuery": true,
+          "rawSql": "SELECT\n  timestamp AS \"time\",\n  kpi_value AS metric\nFROM tfs_monitoring_kpis\nWHERE\n  $__timeFilter(timestamp)\nORDER BY timestamp",
+          "refId": "A",
+          "select": [
+            [
+              {
+                "params": [
+                  "value"
+                ],
+                "type": "column"
+              }
+            ]
+          ],
+          "timeColumn": "time",
+          "where": [
+            {
+              "name": "$__timeFilter",
+              "params": [],
+              "type": "macro"
+            }
+          ]
+        }
+      ],
+      "title": "end-to-end latency",
+      "type": "timeseries"
+    }
+  ],
+  "refresh": "5s",
+  "schemaVersion": 36,
+  "style": "dark",
+  "tags": [],
+  "templating": {
+    "list": []
+  },
+  "time": {
+    "from": "now-5m",
+    "to": "now"
+  },
+  "timepicker": {},
+  "timezone": "",
+  "title": "HPSR23",
+  "uid": "F-t42xU4z",
+  "version": 1,
+  "weekStart": ""
+}
diff --git a/src/tests/hackfest3/grafana/only_metrics.json b/src/tests/hackfest3/grafana/only_metrics.json
new file mode 100644
index 0000000000000000000000000000000000000000..966fb738e8292dc7ce6b873a8b0c206ad8c95382
--- /dev/null
+++ b/src/tests/hackfest3/grafana/only_metrics.json
@@ -0,0 +1,157 @@
+{
+  "annotations": {
+    "list": [
+      {
+        "builtIn": 1,
+        "datasource": {
+          "type": "grafana",
+          "uid": "-- Grafana --"
+        },
+        "enable": true,
+        "hide": true,
+        "iconColor": "rgba(0, 211, 255, 1)",
+        "name": "Annotations & Alerts",
+        "target": {
+          "limit": 100,
+          "matchAny": false,
+          "tags": [],
+          "type": "dashboard"
+        },
+        "type": "dashboard"
+      }
+    ]
+  },
+  "editable": true,
+  "fiscalYearStartMonth": 0,
+  "graphTooltip": 0,
+  "id": 11,
+  "links": [],
+  "liveNow": false,
+  "panels": [
+    {
+      "datasource": {
+        "type": "postgres",
+        "uid": "3xPv3eMIk"
+      },
+      "fieldConfig": {
+        "defaults": {
+          "color": {
+            "mode": "palette-classic"
+          },
+          "custom": {
+            "axisLabel": "",
+            "axisPlacement": "auto",
+            "barAlignment": 0,
+            "drawStyle": "line",
+            "fillOpacity": 0,
+            "gradientMode": "none",
+            "hideFrom": {
+              "legend": false,
+              "tooltip": false,
+              "viz": false
+            },
+            "lineInterpolation": "linear",
+            "lineWidth": 1,
+            "pointSize": 5,
+            "scaleDistribution": {
+              "type": "linear"
+            },
+            "showPoints": "auto",
+            "spanNulls": false,
+            "stacking": {
+              "group": "A",
+              "mode": "none"
+            },
+            "thresholdsStyle": {
+              "mode": "off"
+            }
+          },
+          "mappings": [],
+          "thresholds": {
+            "mode": "absolute",
+            "steps": [
+              {
+                "color": "green",
+                "value": null
+              },
+              {
+                "color": "red",
+                "value": 80
+              }
+            ]
+          }
+        },
+        "overrides": []
+      },
+      "gridPos": {
+        "h": 9,
+        "w": 12,
+        "x": 0,
+        "y": 0
+      },
+      "id": 2,
+      "options": {
+        "legend": {
+          "calcs": [],
+          "displayMode": "list",
+          "placement": "bottom"
+        },
+        "tooltip": {
+          "mode": "single",
+          "sort": "none"
+        }
+      },
+      "targets": [
+        {
+          "datasource": {
+            "type": "postgres",
+            "uid": "3xPv3eMIk"
+          },
+          "format": "time_series",
+          "group": [],
+          "metricColumn": "none",
+          "rawQuery": true,
+          "rawSql": "SELECT\n  timestamp AS \"time\",\n  kpi_value AS metric\nFROM tfs_monitoring_kpis\nWHERE\n  $__timeFilter(timestamp)\nORDER BY timestamp",
+          "refId": "A",
+          "select": [
+            [
+              {
+                "params": [
+                  "value"
+                ],
+                "type": "column"
+              }
+            ]
+          ],
+          "timeColumn": "time",
+          "where": [
+            {
+              "name": "$__timeFilter",
+              "params": [],
+              "type": "macro"
+            }
+          ]
+        }
+      ],
+      "title": "Panel Title",
+      "type": "timeseries"
+    }
+  ],
+  "refresh": "5s",
+  "schemaVersion": 36,
+  "style": "dark",
+  "tags": [],
+  "templating": {
+    "list": []
+  },
+  "time": {
+    "from": "now-5m",
+    "to": "now"
+  },
+  "timepicker": {},
+  "timezone": "",
+  "title": "hackfest3",
+  "uid": "SNg63eGSk",
+  "version": 1,
+  "weekStart": ""
+}
diff --git a/src/tests/hackfest3/grpc/addPolicy.sh b/src/tests/hackfest3/grpc/addPolicy.sh
new file mode 100755
index 0000000000000000000000000000000000000000..71300d3ac00ff99786947cdc56b3776f858fcd3e
--- /dev/null
+++ b/src/tests/hackfest3/grpc/addPolicy.sh
@@ -0,0 +1,16 @@
+#!/bin/bash
+# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/)
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+./grpcurl/grpcurl -plaintext -d @ localhost:30060 policy.PolicyService/PolicyAddService  < policyAddService.json
diff --git a/src/tests/hackfest3/grpc/grpcurl/LICENSE b/src/tests/hackfest3/grpc/grpcurl/LICENSE
new file mode 100644
index 0000000000000000000000000000000000000000..6b678c507101c0682cfcd340bc97522ccabe7e4d
--- /dev/null
+++ b/src/tests/hackfest3/grpc/grpcurl/LICENSE
@@ -0,0 +1,21 @@
+The MIT License (MIT)
+
+Copyright (c) 2017 FullStory, Inc
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
\ No newline at end of file
diff --git a/src/tests/hackfest3/grpc/grpcurl/grpcurl b/src/tests/hackfest3/grpc/grpcurl/grpcurl
new file mode 100755
index 0000000000000000000000000000000000000000..89a7bd8bfea5ba8d3baa8c636e779a97c0e47448
Binary files /dev/null and b/src/tests/hackfest3/grpc/grpcurl/grpcurl differ
diff --git a/src/tests/hackfest3/grpc/policyAddService.json b/src/tests/hackfest3/grpc/policyAddService.json
new file mode 100644
index 0000000000000000000000000000000000000000..5cada37425fce4851303858281032373d558dd68
--- /dev/null
+++ b/src/tests/hackfest3/grpc/policyAddService.json
@@ -0,0 +1,48 @@
+{
+    "serviceId": {
+        "context_id": {
+            "context_uuid": {
+                "uuid": "43813baf-195e-5da6-af20-b3d0922e71a7"
+            }
+        },
+        "service_uuid": {
+            "uuid": "c7d6c3f4-395e-5973-98d3-8d90f8fc9141"
+        }
+    },
+    "policyRuleBasic": {
+        "priority": 0,
+        "policyRuleId": {
+            "uuid": {
+                "uuid": "1"
+            }
+        },
+        "booleanOperator": "POLICYRULE_CONDITION_BOOLEAN_OR",
+        "policyRuleState": {
+            "policyRuleStateMessage": ""
+        },
+        "actionList": [
+            {
+                "action": "POLICY_RULE_ACTION_RECALCULATE_PATH",
+                "action_config": [
+                    {
+                        "action_key": "",
+                        "action_value": ""
+                    }
+                ]
+            }
+        ],
+        "conditionList": [
+            {
+                "numericalOperator": "POLICYRULE_CONDITION_NUMERICAL_GREATER_THAN",
+                "kpiValue": {
+                    "floatVal": 10000
+                },
+                "kpiId": {
+                    "kpi_id": {
+                        "uuid": "1"
+                    }
+                }
+            }
+        ]
+    }
+}
diff --git a/src/tests/hackfest3/grpc/removePolicy.sh b/src/tests/hackfest3/grpc/removePolicy.sh
new file mode 100755
index 0000000000000000000000000000000000000000..fc6103f41224915abdae1c6688b1284d3e5f21ae
--- /dev/null
+++ b/src/tests/hackfest3/grpc/removePolicy.sh
@@ -0,0 +1,17 @@
+#!/bin/bash
+# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/)
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+# Remove policy
+./grpcurl/grpcurl -plaintext -d @ localhost:30060 policy.PolicyService/PolicyDelete  < removePolicyRule.json
diff --git a/src/tests/hackfest3/grpc/removePolicyRule.json b/src/tests/hackfest3/grpc/removePolicyRule.json
new file mode 100644
index 0000000000000000000000000000000000000000..2abe6aeb26a9ce1d278dedec8a8bb0f383bb23f8
--- /dev/null
+++ b/src/tests/hackfest3/grpc/removePolicyRule.json
@@ -0,0 +1,5 @@
+{
+  "uuid": {
+    "uuid": "c4b5e66e-fa99-5075-9b6e-760476791fc1"
+  }
+}
diff --git a/src/tests/hackfest3/int/build_p4.sh b/src/tests/hackfest3/int/build_p4.sh
new file mode 100755
index 0000000000000000000000000000000000000000..184fe17ec6271ef689f2aa2b280c8e9b1b8c6ee2
--- /dev/null
+++ b/src/tests/hackfest3/int/build_p4.sh
@@ -0,0 +1,45 @@
+#!/bin/bash
+# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/)
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+get_next_backup_dir() {
+  local prefix="/home/teraflow/controller/src/tests/hackfest3/p4/backup"
+  local num=1
+
+  while [[ -d "$prefix$num" ]]; do
+    ((num++))
+  done
+
+  echo "$prefix$num"
+}
+
+backup_dir=$(get_next_backup_dir)
+mkdir "$backup_dir"
+
+if [[ -d "$backup_dir" ]]; then
+  mv ~/controller/src/tests/hackfest3/p4/*json "$backup_dir"
+  mv ~/controller/src/tests/hackfest3/p4/*p4 "$backup_dir"
+  mv ~/controller/src/tests/hackfest3/p4/*txt "$backup_dir"
+else
+  echo "Backup directory not created. Files were not moved."
+fi
+
+cp $1 ~/controller/src/tests/hackfest3/p4/
+
+rm -rf ~/ngsdn-tutorial/p4src/*
+cp $1 ~/ngsdn-tutorial/p4src/main.p4
+cd ~/ngsdn-tutorial
+make p4-build
+
+cp ~/ngsdn-tutorial/p4src/build/* ~/controller/src/tests/hackfest3/p4/
diff --git a/src/tests/hackfest3/int/connect_to_mininet.sh b/src/tests/hackfest3/int/connect_to_mininet.sh
new file mode 100755
index 0000000000000000000000000000000000000000..a82d3767fc2669e7627bee0b5ca60e5626c920f2
--- /dev/null
+++ b/src/tests/hackfest3/int/connect_to_mininet.sh
@@ -0,0 +1,17 @@
+#!/bin/bash
+# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/)
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+CONTAINER=`docker ps | grep mininet | cut -f1 -d" "`
+docker exec -it $CONTAINER /bin/bash
diff --git a/src/tests/hackfest3/int/copy_int_helpers.sh b/src/tests/hackfest3/int/copy_int_helpers.sh
new file mode 100755
index 0000000000000000000000000000000000000000..726ff55dfb512a34819063bd0bddddb5ad076ce3
--- /dev/null
+++ b/src/tests/hackfest3/int/copy_int_helpers.sh
@@ -0,0 +1,20 @@
+#!/bin/bash
+# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/)
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+# get container id
+CONTAINER=`docker ps | grep mininet | cut -f1 -d" "`
+docker cp send.py $CONTAINER:/root
+docker cp receive.py $CONTAINER:/root
+docker cp install-scapy.sh $CONTAINER:/root
diff --git a/src/tests/hackfest3/int/install-scapy.sh b/src/tests/hackfest3/int/install-scapy.sh
new file mode 100755
index 0000000000000000000000000000000000000000..9cfa948f682400032af18d1595a3a79009dc3c49
--- /dev/null
+++ b/src/tests/hackfest3/int/install-scapy.sh
@@ -0,0 +1,21 @@
+#!/bin/bash
+# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/)
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+sed -i 's/deb.debian.org/archive.debian.org/g' /etc/apt/sources.list
+sed -i 's|security.debian.org|archive.debian.org/debian-security/|g' /etc/apt/sources.list
+sed -i '/stretch-updates/d' /etc/apt/sources.list
+chmod 1777 /tmp
+apt update
+apt install -y python-scapy
diff --git a/src/tests/hackfest3/int/qdepth_int_basic.p4 b/src/tests/hackfest3/int/qdepth_int_basic.p4
new file mode 100644
index 0000000000000000000000000000000000000000..6bef091b96f4a4b59b50a3d97224e003abe2acf0
--- /dev/null
+++ b/src/tests/hackfest3/int/qdepth_int_basic.p4
@@ -0,0 +1,278 @@
+/*
+ * Copyright 2019-present Open Networking Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+#include 
+#include 
+
+typedef bit<9>   port_num_t;
+typedef bit<48>  mac_addr_t;
+
+//------------------------------------------------------------------------------
+// HEADER DEFINITIONS
+//------------------------------------------------------------------------------
+
+#define MAX_INT_HEADERS 9
+
+const bit<16> TYPE_IPV4 = 0x800;
+const bit<5>  IPV4_OPTION_INT = 31;
+
+typedef bit<9>  egressSpec_t;
+typedef bit<48> macAddr_t;
+typedef bit<32> ip4Addr_t;
+
+typedef bit<13> switch_id_t;
+typedef bit<13> queue_depth_t;
+typedef bit<6>  output_port_t;
+
+header ethernet_t {
+    macAddr_t dstAddr;
+    macAddr_t srcAddr;
+    bit<16>   etherType;
+}
+
+header ipv4_t {
+    bit<4>    version;
+    bit<4>    ihl;
+    bit<6>    dscp;
+    bit<2>    ecn;
+    bit<16>   totalLen;
+    bit<16>   identification;
+    bit<3>    flags;
+    bit<13>   fragOffset;
+    bit<8>    ttl;
+    bit<8>    protocol;
+    bit<16>   hdrChecksum;
+    ip4Addr_t srcAddr;
+    ip4Addr_t dstAddr;
+}
+
+header ipv4_option_t {
+    bit<1> copyFlag;
+    bit<2> optClass;
+    bit<5> option;
+    bit<8> optionLength;
+}
+
+header int_count_t {
+    bit<16>   num_switches;
+}
+
+header int_header_t {
+    switch_id_t switch_id;
+    queue_depth_t queue_depth;
+    output_port_t output_port;
+}
+
+
+struct parser_metadata_t {
+    bit<16> num_headers_remaining;
+}
+
+struct local_metadata_t {
+    parser_metadata_t  parser_metadata;
+}
+
+struct parsed_headers_t {
+    ethernet_t   ethernet;
+    ipv4_t       ipv4;
+    ipv4_option_t ipv4_option;
+    int_count_t   int_count;
+    int_header_t[MAX_INT_HEADERS] int_headers;
+}
+
+error { IPHeaderWithoutOptions }
+
+//------------------------------------------------------------------------------
+// INGRESS PIPELINE
+//------------------------------------------------------------------------------
+
+parser ParserImpl(packet_in packet,
+                out parsed_headers_t hdr,
+                inout local_metadata_t local_metadata,
+                inout standard_metadata_t standard_metadata) {
+
+    state start {
+
+        packet.extract(hdr.ethernet);
+        transition select(hdr.ethernet.etherType){
+            TYPE_IPV4: parse_ipv4;
+            default: accept;
+        }
+    }
+
+    state parse_ipv4 {
+        packet.extract(hdr.ipv4);
+        //Check if ihl is bigger than 5. Packets without ip options set ihl to 5.
+        verify(hdr.ipv4.ihl >= 5, error.IPHeaderWithoutOptions);
+        transition select(hdr.ipv4.ihl) {
+            5             : accept;
+            default       : parse_ipv4_option;
+        }
+    }
+
+    state parse_ipv4_option {
+        packet.extract(hdr.ipv4_option);
+        transition select(hdr.ipv4_option.option){
+
+            IPV4_OPTION_INT:  parse_int;
+            default: accept;
+
+        }
+     }
+
+    state parse_int {
+        packet.extract(hdr.int_count);
+        local_metadata.parser_metadata.num_headers_remaining = hdr.int_count.num_switches;
+        transition select(local_metadata.parser_metadata.num_headers_remaining){
+            0: accept;
+            default: parse_int_headers;
+        }
+    }
+
+    state parse_int_headers {
+        packet.extract(hdr.int_headers.next);
+        local_metadata.parser_metadata.num_headers_remaining = local_metadata.parser_metadata.num_headers_remaining -1 ;
+        transition select(local_metadata.parser_metadata.num_headers_remaining){
+            0: accept;
+            default: parse_int_headers;
+        }
+    }
+}
+
+control VerifyChecksumImpl(inout parsed_headers_t hdr,
+                           inout local_metadata_t meta)
+{
+    apply { /* EMPTY */ }
+}
+
+
+control IngressPipeImpl (inout parsed_headers_t    hdr,
+                         inout local_metadata_t    local_metadata,
+                         inout standard_metadata_t standard_metadata) {
+
+    action drop() {
+        mark_to_drop(standard_metadata);
+    }
+
+    action set_egress_port(port_num_t port) {
+        standard_metadata.egress_spec = port;
+    }
+
+    // --- l2_exact_table ------------------
+
+    table l2_exact_table {
+        key = {
+            standard_metadata.ingress_port: exact;
+        }
+        actions = {
+            set_egress_port;
+            @defaultonly drop;
+        }
+        const default_action = drop;
+    }
+
+    apply {
+        l2_exact_table.apply();
+    }
+}
+
+//------------------------------------------------------------------------------
+// EGRESS PIPELINE
+//------------------------------------------------------------------------------
+
+control EgressPipeImpl (inout parsed_headers_t hdr,
+                        inout local_metadata_t local_metadata,
+                        inout standard_metadata_t standard_metadata) {
+
+    
+    action add_int_header(switch_id_t swid){
+        //increase int stack counter by one
+        hdr.int_count.num_switches = hdr.int_count.num_switches + 1;
+        hdr.int_headers.push_front(1);
+        // This was not needed in older specs. Now by default pushed
+        // invalid elements are
+        hdr.int_headers[0].setValid();
+        hdr.int_headers[0].switch_id = (bit<13>)swid;
+        hdr.int_headers[0].queue_depth = (bit<13>)standard_metadata.deq_qdepth;
+        hdr.int_headers[0].output_port = (bit<6>)standard_metadata.egress_port;
+
+        //update ip header length
+        hdr.ipv4.ihl = hdr.ipv4.ihl + 1;
+        hdr.ipv4.totalLen = hdr.ipv4.totalLen + 4;
+        hdr.ipv4_option.optionLength = hdr.ipv4_option.optionLength + 4;
+    }
+
+    table int_table {
+        actions = {
+            add_int_header;
+            NoAction;
+        }
+        default_action = add_int_header(1);
+    }
+
+    apply {
+        if (hdr.int_count.isValid()){
+            int_table.apply();
+        }
+    }
+}
+
+
+control ComputeChecksumImpl(inout parsed_headers_t hdr,
+                            inout local_metadata_t local_metadata)
+{
+    apply {
+        update_checksum(
+	          hdr.ipv4.isValid(),
+            { hdr.ipv4.version,
+	            hdr.ipv4.ihl,
+              hdr.ipv4.dscp,
+              hdr.ipv4.ecn,
+              hdr.ipv4.totalLen,
+              hdr.ipv4.identification,
+              hdr.ipv4.flags,
+              hdr.ipv4.fragOffset,
+              hdr.ipv4.ttl,
+              hdr.ipv4.protocol,
+              hdr.ipv4.srcAddr,
+              hdr.ipv4.dstAddr },
+            hdr.ipv4.hdrChecksum,
+            HashAlgorithm.csum16);
+    }
+}
+
+control DeparserImpl(packet_out packet, in parsed_headers_t hdr) {
+    apply {
+
+        //parsed headers have to be added again into the packet.
+        packet.emit(hdr.ethernet);
+        packet.emit(hdr.ipv4);
+        packet.emit(hdr.ipv4_option);
+        packet.emit(hdr.int_count);
+        packet.emit(hdr.int_headers);
+
+    }
+}
+
+V1Switch(
+    ParserImpl(),
+    VerifyChecksumImpl(),
+    IngressPipeImpl(),
+    EgressPipeImpl(),
+    ComputeChecksumImpl(),
+    DeparserImpl()
+) main;
diff --git a/src/tests/hackfest3/int/receive.py b/src/tests/hackfest3/int/receive.py
new file mode 100644
index 0000000000000000000000000000000000000000..fb1aac1ca2527e7df5981d2a747f2ebc4a6e8775
--- /dev/null
+++ b/src/tests/hackfest3/int/receive.py
@@ -0,0 +1,76 @@
+#!/usr/bin/env python3
+# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/)
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+import sys
+import struct
+
+from scapy.all import sniff, sendp, hexdump, get_if_list, get_if_hwaddr
+from scapy.all import Packet, IPOption
+from scapy.all import PacketListField, ShortField, IntField, LongField, BitField, FieldListField, FieldLenField
+from scapy.all import IP, UDP, Raw
+from scapy.layers.inet import _IPOption_HDR
+
+
+def get_if():
+    ifs=get_if_list()
+    iface=None
+    for i in get_if_list():
+        if "eth0" in i:
+            iface=i
+            break
+    if not iface:
+        print("Cannot find eth0 interface")
+        exit(1)
+    return iface
+
+
+class SwitchTrace(Packet):
+    fields_desc = [ BitField("swid", 0, 13),
+                    BitField("qdepth", 0,13),
+                    BitField("portid",0,6)]
+    def extract_padding(self, p):
+                return "", p
+
+
+class IPOption_INT(IPOption):
+    name = "INT"
+    option = 31
+    fields_desc = [ _IPOption_HDR,
+                    FieldLenField("length", None, fmt="B",
+                                  length_of="int_headers",
+                                  adjust=lambda pkt,l:l*2+4),
+                    ShortField("count", 0),
+                    PacketListField("int_headers",
+                                   [],
+                                   SwitchTrace,
+                                   count_from=lambda pkt:(pkt.count*1)) ]
+
+
+def handle_pkt(pkt):
+    print("got a packet")
+    pkt.show2()
+    sys.stdout.flush()
+
+
+def main():
+    iface = 'server-eth0'
+    print("sniffing on %s" % iface)
+    sys.stdout.flush()
+    sniff(filter="udp and port 4321", iface = iface,
+          prn = lambda x: handle_pkt(x))
+
+
+if __name__ == '__main__':
+    main()
diff --git a/src/tests/hackfest3/int/send.py b/src/tests/hackfest3/int/send.py
new file mode 100644
index 0000000000000000000000000000000000000000..38b4b4d6274922e5917206681e9502c9d8ac3576
--- /dev/null
+++ b/src/tests/hackfest3/int/send.py
@@ -0,0 +1,90 @@
+#!/usr/bin/env python3
+# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/)
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+import argparse
+import sys
+import socket
+import random
+import struct
+
+from scapy.all import sendp, send, hexdump, get_if_list, get_if_hwaddr
+from scapy.all import Packet, IPOption
+from scapy.all import Ether, IP, UDP
+from scapy.all import IntField, FieldListField, FieldLenField, ShortField, PacketListField, BitField
+from scapy.layers.inet import _IPOption_HDR
+
+from time import sleep
+
+
+def get_if():
+    ifs=get_if_list()
+    iface=None
+    for i in get_if_list():
+        if "eth0" in i:
+            iface=i
+            break
+    if not iface:
+        print("Cannot find eth0 interface")
+        exit(1)
+    return iface
+
+
+class SwitchTrace(Packet):
+    fields_desc = [ BitField("swid", 0, 13),
+                    BitField("qdepth", 0,13),
+                    BitField("portid",0,6)]
+    def extract_padding(self, p):
+                return "", p
+
+class IPOption_INT(IPOption):
+    name = "INT"
+    option = 31
+    fields_desc = [ _IPOption_HDR,
+                    FieldLenField("length", None, fmt="B",
+                                  length_of="int_headers",
+                                  adjust=lambda pkt,l:l*2+4),
+                    ShortField("count", 0),
+                    PacketListField("int_headers",
+                                   [],
+                                   SwitchTrace,
+                                   count_from=lambda pkt:(pkt.count*1)) ]
+
+
+def main():
+
+    if len(sys.argv)<4:
+        print('pass 3 arguments:  "" ')
+        exit(1)
+
+    addr = socket.gethostbyname(sys.argv[1])
+    iface = get_if()
+
+    pkt = Ether(src=get_if_hwaddr(iface), dst="ff:ff:ff:ff:ff:ff") / IP(
+        dst=addr, options = IPOption_INT(count=0,
+            int_headers=[])) / UDP(
+            dport=1234, sport=4321) / sys.argv[2]
+
+    pkt.show2()
+
+    try:
+      for i in range(int(sys.argv[3])):
+        sendp(pkt, iface=iface)
+        sleep(1)
+    except KeyboardInterrupt:
+        raise
+
+
+if __name__ == '__main__':
+    main()
diff --git a/src/tests/hackfest3/int/solution/p4_service_handler.py b/src/tests/hackfest3/int/solution/p4_service_handler.py
new file mode 100644
index 0000000000000000000000000000000000000000..558f6a590620ec96e4dd3db88599acd037041268
--- /dev/null
+++ b/src/tests/hackfest3/int/solution/p4_service_handler.py
@@ -0,0 +1,389 @@
+# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/)
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+"""
+P4 service handler for the TeraFlowSDN controller.
+"""
+
+import logging
+from typing import Any, List, Optional, Tuple, Union
+from common.method_wrappers.Decorator import MetricsPool, metered_subclass_method
+from common.proto.context_pb2 import ConfigRule, DeviceId, Service
+from common.tools.object_factory.ConfigRule import json_config_rule_delete, json_config_rule_set
+from common.tools.object_factory.Device import json_device_id
+from common.type_checkers.Checkers import chk_type
+from service.service.service_handler_api._ServiceHandler import _ServiceHandler
+from service.service.task_scheduler.TaskExecutor import TaskExecutor
+
+LOGGER = logging.getLogger(__name__)
+
+METRICS_POOL = MetricsPool('Service', 'Handler', labels={'handler': 'p4'})
+
+def create_rule_set(endpoint_a, endpoint_b):
+    return json_config_rule_set(
+        'table',
+        {
+            'table-name': 'IngressPipeImpl.l2_exact_table',
+            'match-fields': [
+                {
+                    'match-field': 'standard_metadata.ingress_port',
+                    'match-value': endpoint_a
+                }
+            ],
+            'action-name': 'IngressPipeImpl.set_egress_port',
+            'action-params': [
+                {
+                    'action-param': 'port',
+                    'action-value': endpoint_b
+                }
+            ]
+        }
+    )
+
+def create_rule_del(endpoint_a, endpoint_b):
+    return json_config_rule_delete(
+        'table',
+        {
+            'table-name': 'IngressPipeImpl.l2_exact_table',
+            'match-fields': [
+                {
+                    'match-field': 'standard_metadata.ingress_port',
+                    'match-value': endpoint_a
+                }
+            ],
+            'action-name': 'IngressPipeImpl.set_egress_port',
+            'action-params': [
+                {
+                    'action-param': 'port',
+                    'action-value': endpoint_b
+                }
+            ]
+        }
+    )
+    
+def create_int_set(endpoint_a, id):
+    return json_config_rule_set(
+        'table',
+        {
+            'table-name': 'EgressPipeImpl.int_table',
+       	    'match-fields': [
+                {
+                    'match-field': 'standard_metadata.ingress_port',
+                    'match-value': endpoint_a
+                }
+            ],
+            'action-name': 'EgressPipeImpl.add_int_header',
+            'action-params': [
+                {
+                    'action-param': 'swid',
+                    'action-value': id
+                }
+            ]
+        }
+    )
+    
+def create_int_del(endpoint_a, id):
+    return json_config_rule_delete(
+        'table',
+        {
+            'table-name': 'EgressPipeImpl.int_table',
+       	    'match-fields': [
+                {
+                    'match-field': 'standard_metadata.ingress_port',
+                    'match-value': endpoint_a
+                }
+            ],
+            'action-name': 'EgressPipeImpl.add_int_header',
+            'action-params': [
+                {
+                    'action-param': 'swid',
+                    'action-value': id
+                }
+            ]
+        }
+    )
+
+def find_names(uuid_a, uuid_b, device_endpoints):
+    endpoint_a, endpoint_b = None, None
+    for endpoint in device_endpoints:
+        if endpoint.endpoint_id.endpoint_uuid.uuid == uuid_a:
+            endpoint_a = endpoint.name
+        elif endpoint.endpoint_id.endpoint_uuid.uuid == uuid_b:
+            endpoint_b = endpoint.name
+            
+    return (endpoint_a, endpoint_b)
+
+class P4ServiceHandler(_ServiceHandler):
+    def __init__(self,
+                 service: Service,
+                 task_executor : TaskExecutor,
+                 **settings) -> None:
+        """ Initialize Driver.
+            Parameters:
+                service
+                    The service instance (gRPC message) to be managed.
+                task_executor
+                    An instance of Task Executor providing access to the
+                    service handlers factory, the context and device clients,
+                    and an internal cache of already-loaded gRPC entities.
+                **settings
+                    Extra settings required by the service handler.
+        """
+        self.__service = service
+        self.__task_executor = task_executor # pylint: disable=unused-private-member
+
+    @metered_subclass_method(METRICS_POOL)
+    def SetEndpoint(
+        self, endpoints : List[Tuple[str, str, Optional[str]]],
+        connection_uuid : Optional[str] = None
+    ) -> List[Union[bool, Exception]]:
+        """ Create/Update service endpoints form a list.
+            Parameters:
+                endpoints: List[Tuple[str, str, Optional[str]]]
+                    List of tuples, each containing a device_uuid,
+                    endpoint_uuid and, optionally, the topology_uuid
+                    of the endpoint to be added.
+                connection_uuid : Optional[str]
+                    If specified, is the UUID of the connection this endpoint is associated to.
+            Returns:
+                results: List[Union[bool, Exception]]
+                    List of results for endpoint changes requested.
+                    Return values must be in the same order as the requested
+                    endpoints. If an endpoint is properly added, True must be
+                    returned; otherwise, the Exception that is raised during
+                    the processing must be returned.
+        """
+        chk_type('endpoints', endpoints, list)
+        if len(endpoints) == 0: return []
+
+        service_uuid = self.__service.service_id.service_uuid.uuid
+
+        history = {}
+        
+        results = []
+        index = {}
+        i = 0
+        for endpoint in endpoints:        
+            device_uuid, endpoint_uuid = endpoint[0:2] # ignore topology_uuid by now
+            if device_uuid in history:       
+                try:
+                    matched_endpoint_uuid = history.pop(device_uuid)
+                    device = self.__task_executor.get_device(DeviceId(**json_device_id(device_uuid)))
+
+                    del device.device_config.config_rules[:]
+                    
+                    # Find names from uuids
+                    (endpoint_a, endpoint_b) = find_names(matched_endpoint_uuid, endpoint_uuid, device.device_endpoints)
+                    if endpoint_a is None:
+                        LOGGER.exception('Unable to find name of endpoint({:s})'.format(str(matched_endpoint_uuid)))
+                        raise Exception('Unable to find name of endpoint({:s})'.format(str(matched_endpoint_uuid)))
+                    if endpoint_b is None:
+                        LOGGER.exception('Unable to find name of endpoint({:s})'.format(str(endpoint_uuid)))
+                        raise Exception('Unable to find name of endpoint({:s})'.format(str(endpoint_uuid)))
+
+                    # One way
+                    rule = create_rule_set(endpoint_a, endpoint_b) 
+                    device.device_config.config_rules.append(ConfigRule(**rule))
+                    # The other way
+                    rule = create_rule_set(endpoint_b, endpoint_a) 
+                    device.device_config.config_rules.append(ConfigRule(**rule))
+                    
+                    rule = create_int_set(endpoint_a, device.name[-1])
+                    device.device_config.config_rules.append(ConfigRule(**rule))
+
+                    self.__task_executor.configure_device(device)
+            
+                    results.append(True)
+                    results[index[device_uuid]] = True
+                except Exception as e:
+                    LOGGER.exception('Unable to SetEndpoint({:s})'.format(str(endpoint)))
+                    results.append(e)
+            else:
+                history[device_uuid] = endpoint_uuid
+                index[device_uuid] = i
+                results.append(False)
+            i = i+1
+
+        return results
+
+    @metered_subclass_method(METRICS_POOL)
+    def DeleteEndpoint(
+        self, endpoints : List[Tuple[str, str, Optional[str]]],
+        connection_uuid : Optional[str] = None
+    ) -> List[Union[bool, Exception]]:
+        """ Delete service endpoints form a list.
+            Parameters:
+                endpoints: List[Tuple[str, str, Optional[str]]]
+                    List of tuples, each containing a device_uuid,
+                    endpoint_uuid, and the topology_uuid of the endpoint
+                    to be removed.
+                connection_uuid : Optional[str]
+                    If specified, is the UUID of the connection this endpoint is associated to.
+            Returns:
+                results: List[Union[bool, Exception]]
+                    List of results for endpoint deletions requested.
+                    Return values must be in the same order as the requested
+                    endpoints. If an endpoint is properly deleted, True must be
+                    returned; otherwise, the Exception that is raised during
+                    the processing must be returned.
+        """
+        chk_type('endpoints', endpoints, list)
+        if len(endpoints) == 0: return []
+
+        service_uuid = self.__service.service_id.service_uuid.uuid
+
+        history = {}
+        
+        results = []
+        index = {}
+        i = 0
+        for endpoint in endpoints:        
+            device_uuid, endpoint_uuid = endpoint[0:2] # ignore topology_uuid by now
+            if device_uuid in history:       
+                try:
+                    matched_endpoint_uuid = history.pop(device_uuid)
+                    device = self.__task_executor.get_device(DeviceId(**json_device_id(device_uuid)))
+
+                    del device.device_config.config_rules[:]
+
+                    # Find names from uuids
+                    (endpoint_a, endpoint_b) = find_names(matched_endpoint_uuid, endpoint_uuid, device.device_endpoints)
+                    if endpoint_a is None:
+                        LOGGER.exception('Unable to find name of endpoint({:s})'.format(str(matched_endpoint_uuid)))
+                        raise Exception('Unable to find name of endpoint({:s})'.format(str(matched_endpoint_uuid)))
+                    if endpoint_b is None:
+                        LOGGER.exception('Unable to find name of endpoint({:s})'.format(str(endpoint_uuid)))
+                        raise Exception('Unable to find name of endpoint({:s})'.format(str(endpoint_uuid)))
+
+                    # One way
+                    rule = create_rule_del(endpoint_a, endpoint_b) 
+                    device.device_config.config_rules.append(ConfigRule(**rule))
+                    # The other way
+                    rule = create_rule_del(endpoint_b, endpoint_a) 
+                    device.device_config.config_rules.append(ConfigRule(**rule))
+
+                    rule = create_int_del(endpoint_a, device.name[-1])
+                    device.device_config.config_rules.append(ConfigRule(**rule))
+
+                    self.__task_executor.configure_device(device)
+            
+                    results.append(True)
+                    results[index[device_uuid]] = True
+                except Exception as e:
+                    LOGGER.exception('Unable to SetEndpoint({:s})'.format(str(endpoint)))
+                    results.append(e)
+            else:
+                history[device_uuid] = endpoint_uuid
+                index[device_uuid] = i
+                results.append(False)
+            i = i+1
+
+        return results
+
+    @metered_subclass_method(METRICS_POOL)
+    def SetConstraint(self, constraints: List[Tuple[str, Any]]) \
+            -> List[Union[bool, Exception]]:
+        """ Create/Update service constraints.
+            Parameters:
+                constraints: List[Tuple[str, Any]]
+                    List of tuples, each containing a constraint_type and the
+                    new constraint_value to be set.
+            Returns:
+                results: List[Union[bool, Exception]]
+                    List of results for constraint changes requested.
+                    Return values must be in the same order as the requested
+                    constraints. If a constraint is properly set, True must be
+                    returned; otherwise, the Exception that is raised during
+                    the processing must be returned.
+        """
+        chk_type('constraints', constraints, list)
+        if len(constraints) == 0: return []
+
+        msg = '[SetConstraint] Method not implemented. Constraints({:s}) are being ignored.'
+        LOGGER.warning(msg.format(str(constraints)))
+        return [True for _ in range(len(constraints))]
+
+    @metered_subclass_method(METRICS_POOL)
+    def DeleteConstraint(self, constraints: List[Tuple[str, Any]]) \
+            -> List[Union[bool, Exception]]:
+        """ Delete service constraints.
+            Parameters:
+                constraints: List[Tuple[str, Any]]
+                    List of tuples, each containing a constraint_type pointing
+                    to the constraint to be deleted, and a constraint_value
+                    containing possible additionally required values to locate
+                    the constraint to be removed.
+            Returns:
+                results: List[Union[bool, Exception]]
+                    List of results for constraint deletions requested.
+                    Return values must be in the same order as the requested
+                    constraints. If a constraint is properly deleted, True must
+                    be returned; otherwise, the Exception that is raised during
+                    the processing must be returned.
+        """
+        chk_type('constraints', constraints, list)
+        if len(constraints) == 0: return []
+
+        msg = '[DeleteConstraint] Method not implemented. Constraints({:s}) are being ignored.'
+        LOGGER.warning(msg.format(str(constraints)))
+        return [True for _ in range(len(constraints))]
+
+    @metered_subclass_method(METRICS_POOL)
+    def SetConfig(self, resources: List[Tuple[str, Any]]) \
+            -> List[Union[bool, Exception]]:
+        """ Create/Update configuration for a list of service resources.
+            Parameters:
+                resources: List[Tuple[str, Any]]
+                    List of tuples, each containing a resource_key pointing to
+                    the resource to be modified, and a resource_value
+                    containing the new value to be set.
+            Returns:
+                results: List[Union[bool, Exception]]
+                    List of results for resource key changes requested.
+                    Return values must be in the same order as the requested
+                    resource keys. If a resource is properly set, True must be
+                    returned; otherwise, the Exception that is raised during
+                    the processing must be returned.
+        """
+        chk_type('resources', resources, list)
+        if len(resources) == 0: return []
+
+        msg = '[SetConfig] Method not implemented. Resources({:s}) are being ignored.'
+        LOGGER.warning(msg.format(str(resources)))
+        return [True for _ in range(len(resources))]
+
+    @metered_subclass_method(METRICS_POOL)
+    def DeleteConfig(self, resources: List[Tuple[str, Any]]) \
+            -> List[Union[bool, Exception]]:
+        """ Delete configuration for a list of service resources.
+            Parameters:
+                resources: List[Tuple[str, Any]]
+                    List of tuples, each containing a resource_key pointing to
+                    the resource to be modified, and a resource_value containing
+                    possible additionally required values to locate the value
+                    to be removed.
+            Returns:
+                results: List[Union[bool, Exception]]
+                    List of results for resource key deletions requested.
+                    Return values must be in the same order as the requested
+                    resource keys. If a resource is properly deleted, True must
+                    be returned; otherwise, the Exception that is raised during
+                    the processing must be returned.
+        """
+        chk_type('resources', resources, list)
+        if len(resources) == 0: return []
+
+        msg = '[SetConfig] Method not implemented. Resources({:s}) are being ignored.'
+        LOGGER.warning(msg.format(str(resources)))
+        return [True for _ in range(len(resources))]
\ No newline at end of file
diff --git a/src/tests/hackfest3/int/solution/qdepth_int_basic.p4 b/src/tests/hackfest3/int/solution/qdepth_int_basic.p4
new file mode 100644
index 0000000000000000000000000000000000000000..4a4f56c255c31d11c505afd3cf3bf72211ba0317
--- /dev/null
+++ b/src/tests/hackfest3/int/solution/qdepth_int_basic.p4
@@ -0,0 +1,281 @@
+/*
+ * Copyright 2019-present Open Networking Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+#include 
+#include 
+
+typedef bit<9>   port_num_t;
+typedef bit<48>  mac_addr_t;
+
+//------------------------------------------------------------------------------
+// HEADER DEFINITIONS
+//------------------------------------------------------------------------------
+
+#define MAX_INT_HEADERS 9
+
+const bit<16> TYPE_IPV4 = 0x800;
+const bit<5>  IPV4_OPTION_INT = 31;
+
+typedef bit<9>  egressSpec_t;
+typedef bit<48> macAddr_t;
+typedef bit<32> ip4Addr_t;
+
+typedef bit<13> switch_id_t;
+typedef bit<13> queue_depth_t;
+typedef bit<6>  output_port_t;
+
+header ethernet_t {
+    macAddr_t dstAddr;
+    macAddr_t srcAddr;
+    bit<16>   etherType;
+}
+
+header ipv4_t {
+    bit<4>    version;
+    bit<4>    ihl;
+    bit<6>    dscp;
+    bit<2>    ecn;
+    bit<16>   totalLen;
+    bit<16>   identification;
+    bit<3>    flags;
+    bit<13>   fragOffset;
+    bit<8>    ttl;
+    bit<8>    protocol;
+    bit<16>   hdrChecksum;
+    ip4Addr_t srcAddr;
+    ip4Addr_t dstAddr;
+}
+
+header ipv4_option_t {
+    bit<1> copyFlag;
+    bit<2> optClass;
+    bit<5> option;
+    bit<8> optionLength;
+}
+
+header int_count_t {
+    bit<16>   num_switches;
+}
+
+header int_header_t {
+    switch_id_t switch_id;
+    queue_depth_t queue_depth;
+    output_port_t output_port;
+}
+
+
+struct parser_metadata_t {
+    bit<16> num_headers_remaining;
+}
+
+struct local_metadata_t {
+    parser_metadata_t  parser_metadata;
+}
+
+struct parsed_headers_t {
+    ethernet_t   ethernet;
+    ipv4_t       ipv4;
+    ipv4_option_t ipv4_option;
+    int_count_t   int_count;
+    int_header_t[MAX_INT_HEADERS] int_headers;
+}
+
+error { IPHeaderWithoutOptions }
+
+//------------------------------------------------------------------------------
+// INGRESS PIPELINE
+//------------------------------------------------------------------------------
+
+parser ParserImpl(packet_in packet,
+                out parsed_headers_t hdr,
+                inout local_metadata_t local_metadata,
+                inout standard_metadata_t standard_metadata) {
+
+    state start {
+
+        packet.extract(hdr.ethernet);
+        transition select(hdr.ethernet.etherType){
+            TYPE_IPV4: parse_ipv4;
+            default: accept;
+        }
+    }
+
+    state parse_ipv4 {
+        packet.extract(hdr.ipv4);
+        //Check if ihl is bigger than 5. Packets without ip options set ihl to 5.
+        verify(hdr.ipv4.ihl >= 5, error.IPHeaderWithoutOptions);
+        transition select(hdr.ipv4.ihl) {
+            5             : accept;
+            default       : parse_ipv4_option;
+        }
+    }
+
+    state parse_ipv4_option {
+        packet.extract(hdr.ipv4_option);
+        transition select(hdr.ipv4_option.option){
+
+            IPV4_OPTION_INT:  parse_int;
+            default: accept;
+
+        }
+     }
+
+    state parse_int {
+        packet.extract(hdr.int_count);
+        local_metadata.parser_metadata.num_headers_remaining = hdr.int_count.num_switches;
+        transition select(local_metadata.parser_metadata.num_headers_remaining){
+            0: accept;
+            default: parse_int_headers;
+        }
+    }
+
+    state parse_int_headers {
+        packet.extract(hdr.int_headers.next);
+        local_metadata.parser_metadata.num_headers_remaining = local_metadata.parser_metadata.num_headers_remaining -1 ;
+        transition select(local_metadata.parser_metadata.num_headers_remaining){
+            0: accept;
+            default: parse_int_headers;
+        }
+    }
+}
+
+control VerifyChecksumImpl(inout parsed_headers_t hdr,
+                           inout local_metadata_t meta)
+{
+    apply { /* EMPTY */ }
+}
+
+
+control IngressPipeImpl (inout parsed_headers_t    hdr,
+                         inout local_metadata_t    local_metadata,
+                         inout standard_metadata_t standard_metadata) {
+
+    action drop() {
+        mark_to_drop(standard_metadata);
+    }
+
+    action set_egress_port(port_num_t port) {
+        standard_metadata.egress_spec = port;
+    }
+
+    // --- l2_exact_table ------------------
+
+    table l2_exact_table {
+        key = {
+            standard_metadata.ingress_port: exact;
+        }
+        actions = {
+            set_egress_port;
+            @defaultonly drop;
+        }
+        const default_action = drop;
+    }
+
+    apply {
+        l2_exact_table.apply();
+    }
+}
+
+//------------------------------------------------------------------------------
+// EGRESS PIPELINE
+//------------------------------------------------------------------------------
+
+control EgressPipeImpl (inout parsed_headers_t hdr,
+                        inout local_metadata_t local_metadata,
+                        inout standard_metadata_t standard_metadata) {
+
+    
+    action add_int_header(switch_id_t swid){
+        //increase int stack counter by one
+        hdr.int_count.num_switches = hdr.int_count.num_switches + 1;
+        hdr.int_headers.push_front(1);
+        // This was not needed in older specs. Now by default pushed
+        // invalid elements are
+        hdr.int_headers[0].setValid();
+        hdr.int_headers[0].switch_id = (bit<13>)swid;
+        hdr.int_headers[0].queue_depth = (bit<13>)standard_metadata.deq_qdepth;
+        hdr.int_headers[0].output_port = (bit<6>)standard_metadata.egress_port;
+
+        //update ip header length
+        hdr.ipv4.ihl = hdr.ipv4.ihl + 1;
+        hdr.ipv4.totalLen = hdr.ipv4.totalLen + 4;
+        hdr.ipv4_option.optionLength = hdr.ipv4_option.optionLength + 4;
+    }
+
+    table int_table {
+        key = {
+            standard_metadata.ingress_port: exact;
+        }
+        actions = {
+            add_int_header;
+            NoAction;
+        }
+        default_action = NoAction;
+    }
+
+    apply {
+        if (hdr.int_count.isValid()){
+            int_table.apply();
+        }
+    }
+}
+
+
+control ComputeChecksumImpl(inout parsed_headers_t hdr,
+                            inout local_metadata_t local_metadata)
+{
+    apply {
+        update_checksum(
+	          hdr.ipv4.isValid(),
+            { hdr.ipv4.version,
+	            hdr.ipv4.ihl,
+              hdr.ipv4.dscp,
+              hdr.ipv4.ecn,
+              hdr.ipv4.totalLen,
+              hdr.ipv4.identification,
+              hdr.ipv4.flags,
+              hdr.ipv4.fragOffset,
+              hdr.ipv4.ttl,
+              hdr.ipv4.protocol,
+              hdr.ipv4.srcAddr,
+              hdr.ipv4.dstAddr },
+            hdr.ipv4.hdrChecksum,
+            HashAlgorithm.csum16);
+    }
+}
+
+control DeparserImpl(packet_out packet, in parsed_headers_t hdr) {
+    apply {
+
+        //parsed headers have to be added again into the packet.
+        packet.emit(hdr.ethernet);
+        packet.emit(hdr.ipv4);
+        packet.emit(hdr.ipv4_option);
+        packet.emit(hdr.int_count);
+        packet.emit(hdr.int_headers);
+
+    }
+}
+
+V1Switch(
+    ParserImpl(),
+    VerifyChecksumImpl(),
+    IngressPipeImpl(),
+    EgressPipeImpl(),
+    ComputeChecksumImpl(),
+    DeparserImpl()
+) main;
diff --git a/src/tests/hackfest3/int/solution/timestamp/receive2.py b/src/tests/hackfest3/int/solution/timestamp/receive2.py
new file mode 100644
index 0000000000000000000000000000000000000000..0c749f9a48316e7826df409ff8852d40af0fb89e
--- /dev/null
+++ b/src/tests/hackfest3/int/solution/timestamp/receive2.py
@@ -0,0 +1,74 @@
+#!/usr/bin/env python3
+# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/)
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+import sys
+import struct
+
+from scapy.all import sniff, sendp, hexdump, get_if_list, get_if_hwaddr
+from scapy.all import Packet, IPOption
+from scapy.all import PacketListField, ShortField, IntField, LongField, BitField, FieldListField, FieldLenField
+from scapy.all import IP, UDP, Raw
+from scapy.layers.inet import _IPOption_HDR
+
+
+def get_if():
+    ifs=get_if_list()
+    iface=None
+    for i in get_if_list():
+        if "eth0" in i:
+            iface=i
+            break
+    if not iface:
+        print("Cannot find eth0 interface")
+        exit(1)
+    return iface
+
+
+class SwitchTrace(Packet):
+    fields_desc = [ BitField("timestamp", 0, 32)]
+    def extract_padding(self, p):
+                return "", p
+
+
+class IPOption_INT(IPOption):
+    name = "INT"
+    option = 31
+    fields_desc = [ _IPOption_HDR,
+                    FieldLenField("length", None, fmt="B",
+                                  length_of="int_headers",
+                                  adjust=lambda pkt,l:l*2+4),
+                    ShortField("count", 0),
+                    PacketListField("int_headers",
+                                   [],
+                                   SwitchTrace,
+                                   count_from=lambda pkt:(pkt.count*1)) ]
+
+
+def handle_pkt(pkt):
+    print("got a packet")
+    pkt.show2()
+    sys.stdout.flush()
+
+
+def main():
+    iface = 'server-eth0'
+    print("sniffing on %s" % iface)
+    sys.stdout.flush()
+    sniff(filter="udp and port 4321", iface = iface,
+          prn = lambda x: handle_pkt(x))
+
+
+if __name__ == '__main__':
+    main()
diff --git a/src/tests/hackfest3/int/solution/timestamp/timestamp_int.p4 b/src/tests/hackfest3/int/solution/timestamp/timestamp_int.p4
new file mode 100644
index 0000000000000000000000000000000000000000..5a70ad3401d3e74afddad491e8560f76ae18af0f
--- /dev/null
+++ b/src/tests/hackfest3/int/solution/timestamp/timestamp_int.p4
@@ -0,0 +1,276 @@
+/*
+ * Copyright 2019-present Open Networking Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+#include 
+#include 
+
+typedef bit<9>   port_num_t;
+typedef bit<48>  mac_addr_t;
+
+//------------------------------------------------------------------------------
+// HEADER DEFINITIONS
+//------------------------------------------------------------------------------
+
+#define MAX_INT_HEADERS 9
+
+const bit<16> TYPE_IPV4 = 0x800;
+const bit<5>  IPV4_OPTION_INT = 31;
+
+typedef bit<9>  egressSpec_t;
+typedef bit<48> macAddr_t;
+typedef bit<32> ip4Addr_t;
+
+typedef bit<13> switch_id_t;
+typedef bit<32> queue_depth_t;
+
+header ethernet_t {
+    macAddr_t dstAddr;
+    macAddr_t srcAddr;
+    bit<16>   etherType;
+}
+
+header ipv4_t {
+    bit<4>    version;
+    bit<4>    ihl;
+    bit<6>    dscp;
+    bit<2>    ecn;
+    bit<16>   totalLen;
+    bit<16>   identification;
+    bit<3>    flags;
+    bit<13>   fragOffset;
+    bit<8>    ttl;
+    bit<8>    protocol;
+    bit<16>   hdrChecksum;
+    ip4Addr_t srcAddr;
+    ip4Addr_t dstAddr;
+}
+
+header ipv4_option_t {
+    bit<1> copyFlag;
+    bit<2> optClass;
+    bit<5> option;
+    bit<8> optionLength;
+}
+
+header int_count_t {
+    bit<16>   num_switches;
+}
+
+header int_header_t {
+    queue_depth_t timestamp;
+}
+
+
+struct parser_metadata_t {
+    bit<16> num_headers_remaining;
+}
+
+struct local_metadata_t {
+    parser_metadata_t  parser_metadata;
+}
+
+struct parsed_headers_t {
+    ethernet_t   ethernet;
+    ipv4_t       ipv4;
+    ipv4_option_t ipv4_option;
+    int_count_t   int_count;
+    int_header_t[MAX_INT_HEADERS] int_headers;
+}
+
+error { IPHeaderWithoutOptions }
+
+//------------------------------------------------------------------------------
+// INGRESS PIPELINE
+//------------------------------------------------------------------------------
+
+parser ParserImpl(packet_in packet,
+                out parsed_headers_t hdr,
+                inout local_metadata_t local_metadata,
+                inout standard_metadata_t standard_metadata) {
+
+    state start {
+
+        packet.extract(hdr.ethernet);
+        transition select(hdr.ethernet.etherType){
+            TYPE_IPV4: parse_ipv4;
+            default: accept;
+        }
+    }
+
+    state parse_ipv4 {
+        packet.extract(hdr.ipv4);
+        //Check if ihl is bigger than 5. Packets without ip options set ihl to 5.
+        verify(hdr.ipv4.ihl >= 5, error.IPHeaderWithoutOptions);
+        transition select(hdr.ipv4.ihl) {
+            5             : accept;
+            default       : parse_ipv4_option;
+        }
+    }
+
+    state parse_ipv4_option {
+        packet.extract(hdr.ipv4_option);
+        transition select(hdr.ipv4_option.option){
+
+            IPV4_OPTION_INT:  parse_int;
+            default: accept;
+
+        }
+     }
+
+    state parse_int {
+        packet.extract(hdr.int_count);
+        local_metadata.parser_metadata.num_headers_remaining = hdr.int_count.num_switches;
+        transition select(local_metadata.parser_metadata.num_headers_remaining){
+            0: accept;
+            default: parse_int_headers;
+        }
+    }
+
+    state parse_int_headers {
+        packet.extract(hdr.int_headers.next);
+        local_metadata.parser_metadata.num_headers_remaining = local_metadata.parser_metadata.num_headers_remaining -1 ;
+        transition select(local_metadata.parser_metadata.num_headers_remaining){
+            0: accept;
+            default: parse_int_headers;
+        }
+    }
+}
+
+control VerifyChecksumImpl(inout parsed_headers_t hdr,
+                           inout local_metadata_t meta)
+{
+    apply { /* EMPTY */ }
+}
+
+
+control IngressPipeImpl (inout parsed_headers_t    hdr,
+                         inout local_metadata_t    local_metadata,
+                         inout standard_metadata_t standard_metadata) {
+
+    action drop() {
+        mark_to_drop(standard_metadata);
+    }
+
+    action set_egress_port(port_num_t port) {
+        standard_metadata.egress_spec = port;
+    }
+
+    // --- l2_exact_table ------------------
+
+    table l2_exact_table {
+        key = {
+            standard_metadata.ingress_port: exact;
+        }
+        actions = {
+            set_egress_port;
+            @defaultonly drop;
+        }
+        const default_action = drop;
+    }
+
+    apply {
+        l2_exact_table.apply();
+    }
+}
+
+//------------------------------------------------------------------------------
+// EGRESS PIPELINE
+//------------------------------------------------------------------------------
+
+control EgressPipeImpl (inout parsed_headers_t hdr,
+                        inout local_metadata_t local_metadata,
+                        inout standard_metadata_t standard_metadata) {
+
+    
+    action add_int_header(switch_id_t swid){
+        //increase int stack counter by one
+        hdr.int_count.num_switches = hdr.int_count.num_switches + 1;
+        hdr.int_headers.push_front(1);
+        // This was not needed in older specs. Now by default pushed
+        // invalid elements are
+        hdr.int_headers[0].setValid();
+        hdr.int_headers[0].timestamp = (bit<32>)standard_metadata.ingress_global_timestamp;
+
+        //update ip header length
+        hdr.ipv4.ihl = hdr.ipv4.ihl + 1;
+        hdr.ipv4.totalLen = hdr.ipv4.totalLen + 4;
+        hdr.ipv4_option.optionLength = hdr.ipv4_option.optionLength + 4;
+    }
+
+    table int_table {
+        key = {
+            standard_metadata.ingress_port: exact;
+        }
+        actions = {
+            add_int_header;
+            NoAction;
+        }
+        default_action = NoAction;
+    }
+
+    apply {
+        if (hdr.int_count.isValid()){
+            int_table.apply();
+        }
+    }
+}
+
+
+control ComputeChecksumImpl(inout parsed_headers_t hdr,
+                            inout local_metadata_t local_metadata)
+{
+    apply {
+        update_checksum(
+	          hdr.ipv4.isValid(),
+            { hdr.ipv4.version,
+	            hdr.ipv4.ihl,
+              hdr.ipv4.dscp,
+              hdr.ipv4.ecn,
+              hdr.ipv4.totalLen,
+              hdr.ipv4.identification,
+              hdr.ipv4.flags,
+              hdr.ipv4.fragOffset,
+              hdr.ipv4.ttl,
+              hdr.ipv4.protocol,
+              hdr.ipv4.srcAddr,
+              hdr.ipv4.dstAddr },
+            hdr.ipv4.hdrChecksum,
+            HashAlgorithm.csum16);
+    }
+}
+
+control DeparserImpl(packet_out packet, in parsed_headers_t hdr) {
+    apply {
+
+        //parsed headers have to be added again into the packet.
+        packet.emit(hdr.ethernet);
+        packet.emit(hdr.ipv4);
+        packet.emit(hdr.ipv4_option);
+        packet.emit(hdr.int_count);
+        packet.emit(hdr.int_headers);
+
+    }
+}
+
+V1Switch(
+    ParserImpl(),
+    VerifyChecksumImpl(),
+    IngressPipeImpl(),
+    EgressPipeImpl(),
+    ComputeChecksumImpl(),
+    DeparserImpl()
+) main;
diff --git a/src/tests/hackfest3/mininet/4switch2path.py b/src/tests/hackfest3/mininet/4switch2path.py
new file mode 100755
index 0000000000000000000000000000000000000000..d8ad04b0193a2b9b610a4d5f828891e575d8efe8
--- /dev/null
+++ b/src/tests/hackfest3/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/hackfest3/new-probe/agent.py b/src/tests/hackfest3/new-probe/agent.py
new file mode 100644
index 0000000000000000000000000000000000000000..3a89f0f1eb69168e188bdcc0881cf3fe97442d2c
--- /dev/null
+++ b/src/tests/hackfest3/new-probe/agent.py
@@ -0,0 +1,135 @@
+# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/)
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+#import copy, logging, pytest
+#from common.tests.EventTools import EVENT_CREATE, EVENT_UPDATE, check_events
+#from common.tools.object_factory.Context import json_context_id
+#from common.tools.object_factory.Device import json_device_id
+#from common.tools.object_factory.Service import json_service_id
+#from common.tools.object_factory.Link import json_link_id
+#from common.tools.object_factory.Topology import json_topology_id
+#from context.client.EventsCollector import EventsCollector
+#from common.proto.context_pb2 import Context, ContextId, Device, Empty, Link, Topology, Service, ServiceId
+#from monitoring.client.MonitoringClient import MonitoringClient
+#from common.proto.context_pb2 import ConfigActionEnum, Device, DeviceId, DeviceOperationalStatusEnum
+
+import os, threading, time, socket
+from common.Settings import get_setting
+from common.proto.context_pb2 import Empty, Timestamp
+from common.proto.monitoring_pb2 import KpiDescriptor, Kpi, KpiId, KpiValue
+from common.proto.kpi_sample_types_pb2 import KpiSampleType
+from monitoring.client.MonitoringClient import MonitoringClient
+from context.client.ContextClient import ContextClient
+
+# ----- If you want to use .env file
+#from dotenv import load_dotenv
+#load_dotenv()
+#def get_setting(key):
+#    return os.getenv(key)
+
+
+#### gRPC Clients
+monitoring_client = MonitoringClient(get_setting('MONITORINGSERVICE_SERVICE_HOST'), get_setting('MONITORINGSERVICE_SERVICE_PORT_GRPC'))
+context_client = ContextClient(get_setting('CONTEXTSERVICE_SERVICE_HOST'), get_setting('CONTEXTSERVICE_SERVICE_PORT_GRPC'))
+
+### Locks and common variables
+# Lock for kpi_id
+kpi_id_lock = threading.Lock()
+kpi_id = KpiId()
+# Lock to know if we have registered a KPI or not
+enabled_lock = threading.Lock()
+enabled = False
+
+### Define the path to the Unix socket
+socket_path = "/home/teraflow/ngsdn-tutorial/tmp/sock"
+if os.path.exists(socket_path):
+    os.remove(socket_path)
+
+def thread_context_func():
+    global kpi_id
+    global enabled
+    while True:
+##########################################################
+################## YOUR INPUT HERE #######################
+##########################################################
+        # Listen for Context Service Events
+        # Differentiate based on event type
+        # if event_type == service created:
+            # Create KpiDescriptor
+            # Register Kpi and keep kpi_id
+        # if event_type == service removed:
+            # stop sending values
+##########################################################
+##################### UNTIL HERE #########################
+##########################################################
+
+def thread_kpi_func():
+    global kpi_id
+    global enabled
+    try:
+        # Create socket object
+        server_socket = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
+        # Bind the socket to the socket path
+        server_socket.bind(socket_path)
+        # Listen for incoming connections
+        server_socket.listen(1)
+        while True:
+            print("Awaiting for new connection!")
+            # Accept incoming connection
+            connection, client_address = server_socket.accept()
+            # Read data from the connection
+            data = connection.recv(1024)
+            if data:
+                with enabled_lock:
+                    if enabled: 
+##########################################################
+################## YOUR INPUT HERE #######################
+##########################################################
+                        # if we have registered a KPI
+                        #store value to data
+                        data = data.decode()
+                        print(f"Received: {data}")
+                        with kpi_id_lock:
+                            # create Kpi
+                            # send Kpi to Monitoring
+##########################################################
+##################### UNTIL HERE #########################
+##########################################################
+            # Close the connection 
+            connection.close()
+    except Exception as e:
+        print(f"Error: {str(e)}")
+
+
+def main():
+
+    # Start Thread that listens to context events
+    thread_context = threading.Thread(target=thread_context_func)
+    thread_context.daemon = True
+    thread_context.start()
+
+    # Start Thread that listens to socket
+    thread_kpi = threading.Thread(target=thread_kpi_func)
+    thread_kpi.daemon = True
+    thread_kpi.start()
+
+    try:
+        while True:
+            time.sleep(1)
+    except KeyboardInterrupt:
+        os.remove(socket_path)
+        print("Script terminated.")
+
+if __name__ == "__main__":
+    main()
diff --git a/src/tests/hackfest3/new-probe/connect_to_mininet.sh b/src/tests/hackfest3/new-probe/connect_to_mininet.sh
new file mode 100755
index 0000000000000000000000000000000000000000..a82d3767fc2669e7627bee0b5ca60e5626c920f2
--- /dev/null
+++ b/src/tests/hackfest3/new-probe/connect_to_mininet.sh
@@ -0,0 +1,17 @@
+#!/bin/bash
+# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/)
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+CONTAINER=`docker ps | grep mininet | cut -f1 -d" "`
+docker exec -it $CONTAINER /bin/bash
diff --git a/src/tests/hackfest3/new-probe/copy.sh b/src/tests/hackfest3/new-probe/copy.sh
new file mode 100755
index 0000000000000000000000000000000000000000..a01bc3235ddb62b2daaf8e6f3c1b09e8a28fac9f
--- /dev/null
+++ b/src/tests/hackfest3/new-probe/copy.sh
@@ -0,0 +1,18 @@
+#!/bin/bash
+# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/)
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+# get container id
+CONTAINER=`docker ps | grep mininet | cut -f1 -d" "`
+docker cp ping2.py $CONTAINER:/root
diff --git a/src/tests/hackfest3/new-probe/ping2.py b/src/tests/hackfest3/new-probe/ping2.py
new file mode 100644
index 0000000000000000000000000000000000000000..a58c68c91bf50dfe0bea6fc81b4709d006a21351
--- /dev/null
+++ b/src/tests/hackfest3/new-probe/ping2.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 socket, re, time, subprocess, sys
+
+# Path of the socket inside mininet container
+socket_path = "/tmp/sock"
+
+def main():
+    hostname = sys.argv[1]
+
+    try:
+        while True:
+            start_time = time.time()
+
+            try:
+                # Run the ping command once and capture the output
+                response_time = 0
+            except subprocess.CalledProcessError as e:
+                # If ping fails (even if it does not reach destination)
+                # This part is executed 
+                response_time = -1
+
+            print("Latency: {} ms".format(response_time))
+
+            # Uncomment the following when ready to write to socket
+            #data = str(response_time)
+            #
+            # Write results in socket
+            #try:
+            #    client_socket = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
+            #    client_socket.connect(socket_path)
+            #    client_socket.send(data.encode())
+            #    client_socket.close()
+            #except Exception as e:
+            #    print(e)
+
+            # The following is to make sure that we ping at least
+            # every 6 seconds regardless of how much time ping took.
+            # Calculate the time taken by ping
+            execution_time = time.time() - start_time
+            # Wait the rest of the time
+            wait_time = max(0, 6 - execution_time)
+            time.sleep(wait_time)
+
+    except KeyboardInterrupt:
+        print("Script terminated.")
+
+if __name__ == "__main__":
+    main()
+
diff --git a/src/tests/hackfest3/new-probe/solution/agent.py b/src/tests/hackfest3/new-probe/solution/agent.py
new file mode 100644
index 0000000000000000000000000000000000000000..058caa7fb8b56e13ed8d4d532515c71f1d3934cd
--- /dev/null
+++ b/src/tests/hackfest3/new-probe/solution/agent.py
@@ -0,0 +1,165 @@
+# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/)
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+#import copy, logging, pytest
+#from common.tests.EventTools import EVENT_CREATE, EVENT_UPDATE, check_events
+#from common.tools.object_factory.Context import json_context_id
+#from common.tools.object_factory.Device import json_device_id
+#from common.tools.object_factory.Service import json_service_id
+#from common.tools.object_factory.Link import json_link_id
+#from common.tools.object_factory.Topology import json_topology_id
+#from context.client.EventsCollector import EventsCollector
+#from common.proto.context_pb2 import Context, ContextId, Device, Empty, Link, Topology, Service, ServiceId
+#from monitoring.client.MonitoringClient import MonitoringClient
+#from common.proto.context_pb2 import ConfigActionEnum, Device, DeviceId, DeviceOperationalStatusEnum
+
+import os, threading, time, socket
+from common.Settings import get_setting
+from common.proto.context_pb2 import Empty, Timestamp
+from common.proto.monitoring_pb2 import KpiDescriptor, Kpi, KpiId, KpiValue
+from common.proto.kpi_sample_types_pb2 import KpiSampleType
+from monitoring.client.MonitoringClient import MonitoringClient
+from context.client.ContextClient import ContextClient
+
+# ----- If you want to use .env file
+#from dotenv import load_dotenv
+#load_dotenv()
+#def get_setting(key):
+#    return os.getenv(key)
+
+
+#### gRPC Clients
+monitoring_client = MonitoringClient(get_setting('MONITORINGSERVICE_SERVICE_HOST'), get_setting('MONITORINGSERVICE_SERVICE_PORT_GRPC'))
+context_client = ContextClient(get_setting('CONTEXTSERVICE_SERVICE_HOST'), get_setting('CONTEXTSERVICE_SERVICE_PORT_GRPC'))
+
+### Locks and common variables
+enabled_lock = threading.Lock()
+kpi_id_lock = threading.Lock()
+kpi_id = KpiId()
+enabled = False
+
+### Define the path to the Unix socket
+socket_path = "/home/teraflow/ngsdn-tutorial/tmp/sock"
+#socket_path = "./tmp/sock"
+if os.path.exists(socket_path):
+    os.remove(socket_path)
+
+def thread_context_func():
+    global kpi_id
+    global enabled
+    while True:
+        # Listen to ContextService/GetServiceEvents stream 
+        events = context_client.GetServiceEvents(Empty())
+        for event in events:
+            event_service = event.service_id
+            event_service_uuid = event_service.service_uuid.uuid
+            event_type = event.event.event_type
+            if event_type == 1:
+                print(f"stream: New CREATE event:\n{event_service}")
+                kpi_descriptor = KpiDescriptor(
+                        kpi_id = None,
+                        kpi_id_list = [],
+                        device_id = None,
+                        endpoint_id = None,
+                        kpi_description = f"Loss Ratio for service {event_service_uuid}",
+                        service_id = event_service,
+                        kpi_sample_type = KpiSampleType.KPISAMPLETYPE_UNKNOWN
+                        )
+                response = monitoring_client.SetKpi(kpi_descriptor)
+                print(response)
+                with kpi_id_lock:
+                    kpi_id = response
+                    print(kpi_id)
+                with enabled_lock:
+                    enabled = True
+            elif event_type == 3:
+                print(f"stream: New REMOVE event:\n{event_service}")
+                with enabled_lock:
+                    enabled = False
+
+def thread_kpi_func():
+    global kpi_id
+    global enabled
+    try:
+        # Create socket object
+        server_socket = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
+
+        # Bind the socket to the socket path
+        server_socket.bind(socket_path)
+
+        # Listen for incoming connections
+        server_socket.listen(1)
+        
+        while True:
+            print("Awaiting for new connection!")
+
+            # Accept incoming connection
+            connection, client_address = server_socket.accept()
+
+            # Read data from the connection
+            data = connection.recv(1024)
+
+            if data:
+                with enabled_lock:
+                    if enabled: 
+                        data = data.decode()
+                        print(f"Received: {data}")
+                        with kpi_id_lock:
+                            
+                            now = time.time()
+
+                            new_timestamp = Timestamp()
+                            new_timestamp.timestamp = now
+
+                            new_value = KpiValue()
+                            new_value.floatVal = float(data)
+
+                            kpi = Kpi (
+                                    kpi_id = kpi_id,
+                                    timestamp = new_timestamp,
+                                    kpi_value = new_value
+                                    )
+                            print(kpi)
+                            response = monitoring_client.IncludeKpi(kpi) 
+                            print(f"response: {response}")
+
+            # Close the connection 
+            connection.close()
+
+    
+    except Exception as e:
+        print(f"Error: {str(e)}")
+
+
+def main():
+
+    # Start Thread that listens to context events
+    thread_context = threading.Thread(target=thread_context_func)
+    thread_context.daemon = True
+    thread_context.start()
+
+    # Start Thread that listens to socket
+    thread_kpi = threading.Thread(target=thread_kpi_func)
+    thread_kpi.daemon = True
+    thread_kpi.start()
+
+    try:
+        while True:
+            time.sleep(1)
+    except KeyboardInterrupt:
+        os.remove(socket_path)
+        print("Script terminated.")
+
+if __name__ == "__main__":
+    main()
diff --git a/src/tests/hackfest3/new-probe/solution/connect_to_mininet.sh b/src/tests/hackfest3/new-probe/solution/connect_to_mininet.sh
new file mode 100755
index 0000000000000000000000000000000000000000..a82d3767fc2669e7627bee0b5ca60e5626c920f2
--- /dev/null
+++ b/src/tests/hackfest3/new-probe/solution/connect_to_mininet.sh
@@ -0,0 +1,17 @@
+#!/bin/bash
+# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/)
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+CONTAINER=`docker ps | grep mininet | cut -f1 -d" "`
+docker exec -it $CONTAINER /bin/bash
diff --git a/src/tests/hackfest3/new-probe/solution/copy.sh b/src/tests/hackfest3/new-probe/solution/copy.sh
new file mode 100755
index 0000000000000000000000000000000000000000..a01bc3235ddb62b2daaf8e6f3c1b09e8a28fac9f
--- /dev/null
+++ b/src/tests/hackfest3/new-probe/solution/copy.sh
@@ -0,0 +1,18 @@
+#!/bin/bash
+# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/)
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+# get container id
+CONTAINER=`docker ps | grep mininet | cut -f1 -d" "`
+docker cp ping2.py $CONTAINER:/root
diff --git a/src/tests/hackfest3/new-probe/solution/ping2.py b/src/tests/hackfest3/new-probe/solution/ping2.py
new file mode 100644
index 0000000000000000000000000000000000000000..7f3a97c83bd0734e60874f90873e58bfad4e5ae7
--- /dev/null
+++ b/src/tests/hackfest3/new-probe/solution/ping2.py
@@ -0,0 +1,75 @@
+# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/)
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+import socket, re, time, subprocess, sys
+
+socket_path = "/tmp/sock"
+#socket_path = "./tmp/sock"
+
+def main():
+    hostname = sys.argv[1]
+    count = 1
+    wait = 5
+
+    total_pings = 0
+    successful_pings = 0
+    try:
+        while True:
+            start_time = time.time()
+
+            try:
+                # Run the ping command and capture the output
+                result = subprocess.check_output(["ping", "-W", str(wait), "-c", str(count), hostname], universal_newlines=True)
+
+                response_time = float(re.findall(r"time=([0-9.]+) ms", result)[0])
+
+            except subprocess.CalledProcessError as e:
+                # If ping fails return negative response_time
+                response_time = -1
+
+            # Calculate new loss_ratio
+            if response_time != -1:
+                successful_pings += 1
+            total_pings += 1
+            moving_loss_ratio = round(((total_pings - successful_pings) / float(total_pings) * 100), 2)
+
+            print("Total pings: {}".format(total_pings))
+            print("Successful pings: {}".format(successful_pings))
+
+            print("Packet loss: {}%".format(moving_loss_ratio))
+            print("Latency: {} ms".format(response_time))
+
+            data = str(response_time)
+
+            # Write results in socket
+            try:
+                client_socket = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
+                client_socket.connect(socket_path)
+                client_socket.send(data.encode())
+                client_socket.close()
+            except Exception as e:
+                print(e)
+
+            # Calculate the time taken by ping
+            execution_time = time.time() - start_time
+            # Wait the rest of the time
+            wait_time = max(0, 6 - execution_time)
+            time.sleep(wait_time)
+
+    except KeyboardInterrupt:
+        print("Script terminated.")
+
+if __name__ == "__main__":
+    main()
+
diff --git a/src/tests/hackfest3/p4/bmv2.json b/src/tests/hackfest3/p4/bmv2.json
new file mode 100644
index 0000000000000000000000000000000000000000..f001eb52e90e875c4152f4d7820664402ac856c3
--- /dev/null
+++ b/src/tests/hackfest3/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/hackfest3/p4/main.p4 b/src/tests/hackfest3/p4/main.p4
new file mode 100644
index 0000000000000000000000000000000000000000..843eb0d580e362e74b25c768b1b01e750138637a
--- /dev/null
+++ b/src/tests/hackfest3/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/hackfest3/p4/orig/bmv2.json b/src/tests/hackfest3/p4/orig/bmv2.json
new file mode 100644
index 0000000000000000000000000000000000000000..f001eb52e90e875c4152f4d7820664402ac856c3
--- /dev/null
+++ b/src/tests/hackfest3/p4/orig/bmv2.json
@@ -0,0 +1,381 @@
+{
+  "header_types" : [
+    {
+      "name" : "scalars_0",
+      "id" : 0,
+      "fields" : [
+        ["local_metadata_t.is_multicast", 1, false],
+        ["_padding_0", 7, false]
+      ]
+    },
+    {
+      "name" : "standard_metadata",
+      "id" : 1,
+      "fields" : [
+        ["ingress_port", 9, false],
+        ["egress_spec", 9, false],
+        ["egress_port", 9, false],
+        ["clone_spec", 32, false],
+        ["instance_type", 32, false],
+        ["drop", 1, false],
+        ["recirculate_port", 16, false],
+        ["packet_length", 32, false],
+        ["enq_timestamp", 32, false],
+        ["enq_qdepth", 19, false],
+        ["deq_timedelta", 32, false],
+        ["deq_qdepth", 19, false],
+        ["ingress_global_timestamp", 48, false],
+        ["egress_global_timestamp", 48, false],
+        ["lf_field_list", 32, false],
+        ["mcast_grp", 16, false],
+        ["resubmit_flag", 32, false],
+        ["egress_rid", 16, false],
+        ["recirculate_flag", 32, false],
+        ["checksum_error", 1, false],
+        ["parser_error", 32, false],
+        ["priority", 3, false],
+        ["_padding", 2, false]
+      ]
+    },
+    {
+      "name" : "ethernet_t",
+      "id" : 2,
+      "fields" : [
+        ["dst_addr", 48, false],
+        ["src_addr", 48, false],
+        ["ether_type", 16, false]
+      ]
+    }
+  ],
+  "headers" : [
+    {
+      "name" : "scalars",
+      "id" : 0,
+      "header_type" : "scalars_0",
+      "metadata" : true,
+      "pi_omit" : true
+    },
+    {
+      "name" : "standard_metadata",
+      "id" : 1,
+      "header_type" : "standard_metadata",
+      "metadata" : true,
+      "pi_omit" : true
+    },
+    {
+      "name" : "ethernet",
+      "id" : 2,
+      "header_type" : "ethernet_t",
+      "metadata" : false,
+      "pi_omit" : true
+    }
+  ],
+  "header_stacks" : [],
+  "header_union_types" : [],
+  "header_unions" : [],
+  "header_union_stacks" : [],
+  "field_lists" : [],
+  "errors" : [
+    ["NoError", 1],
+    ["PacketTooShort", 2],
+    ["NoMatch", 3],
+    ["StackOutOfBounds", 4],
+    ["HeaderTooShort", 5],
+    ["ParserTimeout", 6],
+    ["ParserInvalidArgument", 7]
+  ],
+  "enums" : [],
+  "parsers" : [
+    {
+      "name" : "parser",
+      "id" : 0,
+      "init_state" : "start",
+      "parse_states" : [
+        {
+          "name" : "start",
+          "id" : 0,
+          "parser_ops" : [
+            {
+              "parameters" : [
+                {
+                  "type" : "regular",
+                  "value" : "ethernet"
+                }
+              ],
+              "op" : "extract"
+            }
+          ],
+          "transitions" : [
+            {
+              "value" : "default",
+              "mask" : null,
+              "next_state" : null
+            }
+          ],
+          "transition_key" : []
+        }
+      ]
+    }
+  ],
+  "parse_vsets" : [],
+  "deparsers" : [
+    {
+      "name" : "deparser",
+      "id" : 0,
+      "source_info" : {
+        "filename" : "p4src/main.p4",
+        "line" : 130,
+        "column" : 8,
+        "source_fragment" : "DeparserImpl"
+      },
+      "order" : ["ethernet"]
+    }
+  ],
+  "meter_arrays" : [],
+  "counter_arrays" : [],
+  "register_arrays" : [],
+  "calculations" : [],
+  "learn_lists" : [],
+  "actions" : [
+    {
+      "name" : "IngressPipeImpl.drop",
+      "id" : 0,
+      "runtime_data" : [],
+      "primitives" : [
+        {
+          "op" : "mark_to_drop",
+          "parameters" : [
+            {
+              "type" : "header",
+              "value" : "standard_metadata"
+            }
+          ],
+          "source_info" : {
+            "filename" : "p4src/main.p4",
+            "line" : 77,
+            "column" : 8,
+            "source_fragment" : "mark_to_drop(standard_metadata)"
+          }
+        }
+      ]
+    },
+    {
+      "name" : "IngressPipeImpl.set_egress_port",
+      "id" : 1,
+      "runtime_data" : [
+        {
+          "name" : "port",
+          "bitwidth" : 9
+        }
+      ],
+      "primitives" : [
+        {
+          "op" : "assign",
+          "parameters" : [
+            {
+              "type" : "field",
+              "value" : ["standard_metadata", "egress_spec"]
+            },
+            {
+              "type" : "runtime_data",
+              "value" : 0
+            }
+          ],
+          "source_info" : {
+            "filename" : "p4src/main.p4",
+            "line" : 81,
+            "column" : 8,
+            "source_fragment" : "standard_metadata.egress_spec = port"
+          }
+        }
+      ]
+    },
+    {
+      "name" : "IngressPipeImpl.set_multicast_group",
+      "id" : 2,
+      "runtime_data" : [
+        {
+          "name" : "gid",
+          "bitwidth" : 16
+        }
+      ],
+      "primitives" : [
+        {
+          "op" : "assign",
+          "parameters" : [
+            {
+              "type" : "field",
+              "value" : ["standard_metadata", "mcast_grp"]
+            },
+            {
+              "type" : "runtime_data",
+              "value" : 0
+            }
+          ],
+          "source_info" : {
+            "filename" : "p4src/main.p4",
+            "line" : 89,
+            "column" : 8,
+            "source_fragment" : "standard_metadata.mcast_grp = gid"
+          }
+        },
+        {
+          "op" : "assign",
+          "parameters" : [
+            {
+              "type" : "field",
+              "value" : ["scalars", "local_metadata_t.is_multicast"]
+            },
+            {
+              "type" : "expression",
+              "value" : {
+                "type" : "expression",
+                "value" : {
+                  "op" : "b2d",
+                  "left" : null,
+                  "right" : {
+                    "type" : "bool",
+                    "value" : true
+                  }
+                }
+              }
+            }
+          ],
+          "source_info" : {
+            "filename" : "p4src/main.p4",
+            "line" : 90,
+            "column" : 8,
+            "source_fragment" : "local_metadata.is_multicast = true"
+          }
+        }
+      ]
+    }
+  ],
+  "pipelines" : [
+    {
+      "name" : "ingress",
+      "id" : 0,
+      "source_info" : {
+        "filename" : "p4src/main.p4",
+        "line" : 71,
+        "column" : 8,
+        "source_fragment" : "IngressPipeImpl"
+      },
+      "init_table" : "IngressPipeImpl.l2_exact_table",
+      "tables" : [
+        {
+          "name" : "IngressPipeImpl.l2_exact_table",
+          "id" : 0,
+          "source_info" : {
+            "filename" : "p4src/main.p4",
+            "line" : 95,
+            "column" : 10,
+            "source_fragment" : "l2_exact_table"
+          },
+          "key" : [
+            {
+              "match_type" : "exact",
+              "name" : "standard_metadata.ingress_port",
+              "target" : ["standard_metadata", "ingress_port"],
+              "mask" : null
+            }
+          ],
+          "match_type" : "exact",
+          "type" : "simple",
+          "max_size" : 1024,
+          "with_counters" : false,
+          "support_timeout" : false,
+          "direct_meters" : null,
+          "action_ids" : [1, 2, 0],
+          "actions" : ["IngressPipeImpl.set_egress_port", "IngressPipeImpl.set_multicast_group", "IngressPipeImpl.drop"],
+          "base_default_next" : null,
+          "next_tables" : {
+            "IngressPipeImpl.set_egress_port" : null,
+            "IngressPipeImpl.set_multicast_group" : null,
+            "IngressPipeImpl.drop" : null
+          },
+          "default_entry" : {
+            "action_id" : 0,
+            "action_const" : true,
+            "action_data" : [],
+            "action_entry_const" : true
+          }
+        }
+      ],
+      "action_profiles" : [],
+      "conditionals" : []
+    },
+    {
+      "name" : "egress",
+      "id" : 1,
+      "source_info" : {
+        "filename" : "p4src/main.p4",
+        "line" : 116,
+        "column" : 8,
+        "source_fragment" : "EgressPipeImpl"
+      },
+      "init_table" : null,
+      "tables" : [],
+      "action_profiles" : [],
+      "conditionals" : []
+    }
+  ],
+  "checksums" : [],
+  "force_arith" : [],
+  "extern_instances" : [],
+  "field_aliases" : [
+    [
+      "queueing_metadata.enq_timestamp",
+      ["standard_metadata", "enq_timestamp"]
+    ],
+    [
+      "queueing_metadata.enq_qdepth",
+      ["standard_metadata", "enq_qdepth"]
+    ],
+    [
+      "queueing_metadata.deq_timedelta",
+      ["standard_metadata", "deq_timedelta"]
+    ],
+    [
+      "queueing_metadata.deq_qdepth",
+      ["standard_metadata", "deq_qdepth"]
+    ],
+    [
+      "intrinsic_metadata.ingress_global_timestamp",
+      ["standard_metadata", "ingress_global_timestamp"]
+    ],
+    [
+      "intrinsic_metadata.egress_global_timestamp",
+      ["standard_metadata", "egress_global_timestamp"]
+    ],
+    [
+      "intrinsic_metadata.lf_field_list",
+      ["standard_metadata", "lf_field_list"]
+    ],
+    [
+      "intrinsic_metadata.mcast_grp",
+      ["standard_metadata", "mcast_grp"]
+    ],
+    [
+      "intrinsic_metadata.resubmit_flag",
+      ["standard_metadata", "resubmit_flag"]
+    ],
+    [
+      "intrinsic_metadata.egress_rid",
+      ["standard_metadata", "egress_rid"]
+    ],
+    [
+      "intrinsic_metadata.recirculate_flag",
+      ["standard_metadata", "recirculate_flag"]
+    ],
+    [
+      "intrinsic_metadata.priority",
+      ["standard_metadata", "priority"]
+    ]
+  ],
+  "program" : "p4src/main.p4",
+  "__meta__" : {
+    "version" : [2, 18],
+    "compiler" : "https://github.com/p4lang/p4c"
+  }
+}
\ No newline at end of file
diff --git a/src/tests/hackfest3/p4/orig/main.p4 b/src/tests/hackfest3/p4/orig/main.p4
new file mode 100644
index 0000000000000000000000000000000000000000..843eb0d580e362e74b25c768b1b01e750138637a
--- /dev/null
+++ b/src/tests/hackfest3/p4/orig/main.p4
@@ -0,0 +1,144 @@
+/*
+ * Copyright 2019-present Open Networking Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+#include 
+#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/hackfest3/p4/orig/p4info.txt b/src/tests/hackfest3/p4/orig/p4info.txt
new file mode 100644
index 0000000000000000000000000000000000000000..0b58e740864b72e6ca87582431cd7bd57894d0dd
--- /dev/null
+++ b/src/tests/hackfest3/p4/orig/p4info.txt
@@ -0,0 +1,62 @@
+pkg_info {
+  arch: "v1model"
+}
+tables {
+  preamble {
+    id: 33605373
+    name: "IngressPipeImpl.l2_exact_table"
+    alias: "l2_exact_table"
+  }
+  match_fields {
+    id: 1
+    name: "standard_metadata.ingress_port"
+    bitwidth: 9
+    match_type: EXACT
+  }
+  action_refs {
+    id: 16812802
+  }
+  action_refs {
+    id: 16841371
+  }
+  action_refs {
+    id: 16796182
+    annotations: "@defaultonly"
+    scope: DEFAULT_ONLY
+  }
+  const_default_action_id: 16796182
+  size: 1024
+}
+actions {
+  preamble {
+    id: 16796182
+    name: "IngressPipeImpl.drop"
+    alias: "drop"
+  }
+}
+actions {
+  preamble {
+    id: 16812802
+    name: "IngressPipeImpl.set_egress_port"
+    alias: "set_egress_port"
+  }
+  params {
+    id: 1
+    name: "port"
+    bitwidth: 9
+  }
+}
+actions {
+  preamble {
+    id: 16841371
+    name: "IngressPipeImpl.set_multicast_group"
+    alias: "set_multicast_group"
+  }
+  params {
+    id: 1
+    name: "gid"
+    bitwidth: 16
+  }
+}
+type_info {
+}
diff --git a/src/tests/hackfest3/p4/p4info.txt b/src/tests/hackfest3/p4/p4info.txt
new file mode 100644
index 0000000000000000000000000000000000000000..0b58e740864b72e6ca87582431cd7bd57894d0dd
--- /dev/null
+++ b/src/tests/hackfest3/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/hackfest3/probe/README.md b/src/tests/hackfest3/probe/README.md
new file mode 100644
index 0000000000000000000000000000000000000000..bfc1e4731dc44a61b32ad5d75093f4aca1f57dbf
--- /dev/null
+++ b/src/tests/hackfest3/probe/README.md
@@ -0,0 +1,40 @@
+# Probe for P4 mininet devices
+
+Step 1:
+To copy the necessary files, run:
+
+```
+probe-tfs/deploy.sh
+```
+
+Step 2:
+To connect to the mininet docker, run:
+
+```
+probe-tfs/connect-to-mininet.sh
+```
+
+Step 3:
+From inside the mininet docker, run:
+
+```
+./tfsagent
+```
+
+Step 4 (on another terminal):
+Establish the service:
+```
+src/tests/p4/run_test_02_create_service.sh
+```
+
+Step 5:
+From inside mininet (make mn-cli):
+```
+client ./tfsping
+```
+
+Step 6 (on another terminal):
+To check the latest monitoring samples, run
+```
+python src/tests/p4/probe/monitoring_kpis.py
+```
diff --git a/src/tests/hackfest3/probe/monitoring_kpis.ipynb b/src/tests/hackfest3/probe/monitoring_kpis.ipynb
new file mode 100644
index 0000000000000000000000000000000000000000..728b7394eb9cbbf50fd5b4fcad568c0968abc608
--- /dev/null
+++ b/src/tests/hackfest3/probe/monitoring_kpis.ipynb
@@ -0,0 +1,184 @@
+{
+ "cells": [
+  {
+   "attachments": {},
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "# Checking the monitoring component"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 1,
+   "metadata": {},
+   "outputs": [],
+   "source": [
+    "import time\n",
+    "import datetime\n",
+    "import uuid\n",
+    "import random\n",
+    "\n",
+    "from dotenv import load_dotenv\n",
+    "from IPython.display import clear_output, display, HTML\n",
+    "\n",
+    "from common.tools.timestamp.Converters import timestamp_utcnow_to_float, timestamp_float_to_string\n",
+    "from common.tools.grpc.Tools import grpc_message_to_json_string\n",
+    "from common.proto.kpi_sample_types_pb2 import KpiSampleType\n",
+    "from common.proto.monitoring_pb2 import KpiDescriptor, KpiId, KpiQuery, Kpi\n",
+    "from monitoring.client.MonitoringClient import MonitoringClient"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 2,
+   "metadata": {},
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "'0abfb00117d4461b9fa5085bee4be58f'"
+      ]
+     },
+     "execution_count": 2,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "load_dotenv()\n",
+    "\n",
+    "monitoring_client = MonitoringClient()\n",
+    "uuid.uuid4().hex"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 3,
+   "metadata": {},
+   "outputs": [
+    {
+     "name": "stdout",
+     "output_type": "stream",
+     "text": [
+      "Created KPI {\"kpi_id\": {\"uuid\": \"1\"}}: \n"
+     ]
+    }
+   ],
+   "source": [
+    "kpi_description: KpiDescriptor = KpiDescriptor()\n",
+    "kpi_description.kpi_description = \"Security status of service {}\".format(uuid.uuid4().hex)\n",
+    "kpi_description.service_id.service_uuid.uuid = \"608df176-90b8-5950-b50d-1810c6eaaa5d\"\n",
+    "kpi_description.kpi_sample_type = KpiSampleType.KPISAMPLETYPE_UNKNOWN\n",
+    "new_kpi = monitoring_client.SetKpi(kpi_description)\n",
+    "print(\"Created KPI {}: \".format(grpc_message_to_json_string(new_kpi)))"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 4,
+   "metadata": {},
+   "outputs": [
+    {
+     "data": {
+      "text/html": [
+       "\n",
+       "    \n",
+       "        \n",
+       "        \n",
+       "    \n",
+       "    
2023-02-24 16:23:34.373384
KPI IDTimestampValue
0 - 12023-02-23T13:55:09ZfloatVal: 1868.0\n", + "
1 - 12023-02-23T13:55:07ZfloatVal: 1878.0\n", + "
2 - 12023-02-23T13:55:05ZfloatVal: 2065.0\n", + "
3 - 12023-02-23T13:55:03ZfloatVal: 1993.0\n", + "
4 - 12023-02-23T13:55:01ZfloatVal: 2006.0\n", + "
5 - 12023-02-23T13:54:59ZfloatVal: 1938.0\n", + "
6 - 12023-02-23T13:54:57ZfloatVal: 1920.0\n", + "
7 - 12023-02-23T13:54:55ZfloatVal: 1984.0\n", + "
8 - 12023-02-23T13:54:53ZfloatVal: 1883.0\n", + "
9 - 12023-02-23T13:54:51ZfloatVal: 1948.0\n", + "
" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "ename": "KeyboardInterrupt", + "evalue": "", + "output_type": "error", + "traceback": [ + "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", + "\u001b[0;31mKeyboardInterrupt\u001b[0m Traceback (most recent call last)", + "Cell \u001b[0;32mIn [4], line 31\u001b[0m\n\u001b[1;32m 29\u001b[0m table \u001b[39m+\u001b[39m\u001b[39m=\u001b[39m \u001b[39m\"\u001b[39m\u001b[39m\u001b[39m\u001b[39m\"\u001b[39m\n\u001b[1;32m 30\u001b[0m display(HTML(table))\n\u001b[0;32m---> 31\u001b[0m time\u001b[39m.\u001b[39;49msleep(\u001b[39m5\u001b[39;49m)\n\u001b[1;32m 32\u001b[0m clear_output(wait\u001b[39m=\u001b[39m\u001b[39mTrue\u001b[39;00m)\n", + "\u001b[0;31mKeyboardInterrupt\u001b[0m: " + ] + } + ], + "source": [ + "kpi_id = input(\"What is the KPI ID?\")\n", + "query = KpiQuery()\n", + "query.kpi_ids.append(KpiId(**{\"kpi_id\": {\"uuid\": kpi_id}}))\n", + "query.last_n_samples = 10\n", + "\n", + "while True:\n", + "\n", + " kpi = Kpi()\n", + " kpi.kpi_id.kpi_id.uuid = new_kpi.kpi_id.uuid\n", + " kpi.timestamp.timestamp = timestamp_utcnow_to_float()\n", + " kpi.kpi_value.int32Val = random.randint(10, 4000)\n", + " # monitoring_client.IncludeKpi(kpi)\n", + "\n", + " response = monitoring_client.QueryKpiData(query)\n", + " # print(response)\n", + " table = f\"\"\"\n", + " \n", + " \n", + " \n", + " \n", + " \"\"\"\n", + " for kpi in response.raw_kpi_lists:\n", + " cur_kpi_id = kpi.kpi_id.kpi_id.uuid\n", + " for i, raw_kpi in enumerate(kpi.raw_kpis):\n", + " # print(cur_kpi_id, raw_kpi.timestamp.timestamp, raw_kpi.kpi_value)\n", + " table += \"\".format(\n", + " i, cur_kpi_id, timestamp_float_to_string(raw_kpi.timestamp.timestamp), raw_kpi.kpi_value\n", + " )\n", + " table += \"
{datetime.datetime.now()}
KPI IDTimestampValue
{} - {}{}{}
\"\n", + " display(HTML(table))\n", + " time.sleep(5)\n", + " clear_output(wait=True)" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "tfs", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.9.14" + }, + "orig_nbformat": 4, + "vscode": { + "interpreter": { + "hash": "7ea5723b29014fc8d8bf1a065f5287f0787f54201758f2b5d4b4b0b2ddc48863" + } + } + }, + "nbformat": 4, + "nbformat_minor": 2 +} diff --git a/src/tests/hackfest3/probe/monitoring_kpis.py b/src/tests/hackfest3/probe/monitoring_kpis.py new file mode 100644 index 0000000000000000000000000000000000000000..880977a2f62069586efdb398b8b3b5d3ac20dac0 --- /dev/null +++ b/src/tests/hackfest3/probe/monitoring_kpis.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. + +# File to monitor the latest *n* samples from the KPI ID *id* +# and updates it every *i* seconds +# +# Author: Carlos Natalino + +import argparse +import datetime +import time + +from common.proto.kpi_sample_types_pb2 import KpiSampleType +from common.proto.monitoring_pb2 import KpiDescriptor, KpiId, KpiQuery +from common.tools.grpc.Tools import grpc_message_to_json_string +from common.tools.timestamp.Converters import timestamp_float_to_string +from monitoring.client.MonitoringClient import MonitoringClient + +if __name__ == "__main__": + parser = argparse.ArgumentParser() + parser.add_argument( + "-n", + "--last-n-samples", + default=10, + type=int, + help="Number of latest samples of the KPI to show.", + ) + parser.add_argument( + "-s", + "--sleep", + default=5, + type=int, + help="Seconds between consecutive refreshes.", + ) + parser.add_argument("-id", "--kpi-id", help="KPI ID, if known.") + args = parser.parse_args() + + monitoring_client = MonitoringClient() + + if args.kpi_id is None: + service_uuid = "608df176-90b8-5950-b50d-1810c6eaaa5d" + kpi_description: KpiDescriptor = KpiDescriptor() + kpi_description.kpi_description = "Security status of service {}".format( + service_uuid + ) + kpi_description.service_id.service_uuid.uuid = service_uuid + kpi_description.kpi_sample_type = KpiSampleType.KPISAMPLETYPE_UNKNOWN + new_kpi = monitoring_client.SetKpi(kpi_description) + print("Created KPI {}: ".format(grpc_message_to_json_string(new_kpi))) + kpi_id = new_kpi.kpi_id.uuid + else: + kpi_id = args.kpi_id + + query = KpiQuery() + query.kpi_ids.append(KpiId(**{"kpi_id": {"uuid": kpi_id}})) + query.last_n_samples = args.last_n_samples + + while True: + print(chr(27) + "[2J") + response = monitoring_client.QueryKpiData(query) + print("{}\t{}\t{:<20}\t{}".format("Index", "KPI ID", "Timestamp", "Value")) + for kpi in response.raw_kpi_lists: + cur_kpi_id = kpi.kpi_id.kpi_id.uuid + for i, raw_kpi in enumerate(kpi.raw_kpis): + print( + "{}\t{}\t{}\t{}".format( + i, + cur_kpi_id, + timestamp_float_to_string(raw_kpi.timestamp.timestamp), + raw_kpi.kpi_value.floatVal, + ) + ) + print("Last update:", datetime.datetime.now().strftime("%H:%M:%S")) + time.sleep(args.sleep) diff --git a/src/tests/hackfest3/probe/probe-tfs/.gitignore b/src/tests/hackfest3/probe/probe-tfs/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..dc8d7ee54c37fd887f19206592ed03a33118a59a --- /dev/null +++ b/src/tests/hackfest3/probe/probe-tfs/.gitignore @@ -0,0 +1,18 @@ +# Generated by Cargo +# will have compiled files and executables +/target/ + +# Remove Cargo.lock from gitignore if creating an executable, leave it for libraries +# More information here https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html +Cargo.lock + +# These are backup files generated by rustfmt +**/*.rs.bk + + +# Added by cargo + +/target + +.env_bkp +.env diff --git a/src/tests/hackfest3/probe/probe-tfs/Cargo.toml b/src/tests/hackfest3/probe/probe-tfs/Cargo.toml new file mode 100644 index 0000000000000000000000000000000000000000..fb5db98bf5233e905d83b7f9fe06d44a71c3a0fd --- /dev/null +++ b/src/tests/hackfest3/probe/probe-tfs/Cargo.toml @@ -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. + +[package] +name = "rust-tfs" +version = "0.1.0" +edition = "2021" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] +dotenv = "0.15.0" +futures = "0.3.26" +prost = "0.11.6" +surge-ping = "0.7.3" +tokio = { version = "1.25", features = ["macros", "rt-multi-thread"] } +tonic = "0.8.3" + +[[bin]] +name = "tfsping" +path = "src/ping.rs" + +[[bin]] +name = "tfsagent" +path = "src/agent.rs" + +[build-dependencies] +tonic-build = "0.8.3" diff --git a/src/tests/hackfest3/probe/probe-tfs/LICENSE b/src/tests/hackfest3/probe/probe-tfs/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..261eeb9e9f8b2b4b0d119366dda99c6fd7d35c64 --- /dev/null +++ b/src/tests/hackfest3/probe/probe-tfs/LICENSE @@ -0,0 +1,201 @@ + 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. diff --git a/src/tests/hackfest3/probe/probe-tfs/README.md b/src/tests/hackfest3/probe/probe-tfs/README.md new file mode 100644 index 0000000000000000000000000000000000000000..f88d7c542dae22ad623797f43750e0589d2473cf --- /dev/null +++ b/src/tests/hackfest3/probe/probe-tfs/README.md @@ -0,0 +1,2 @@ +# rust-tfs +Client for TFS functionalities written in Rust. diff --git a/src/tests/hackfest3/probe/probe-tfs/build.rs b/src/tests/hackfest3/probe/probe-tfs/build.rs new file mode 100644 index 0000000000000000000000000000000000000000..1dda249d16b3c571676a254f2178f772fb765c81 --- /dev/null +++ b/src/tests/hackfest3/probe/probe-tfs/build.rs @@ -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. + * + * Build script that generates Rust code for the protobuffers. + * + * Author: Carlos Natalino + */ + +fn main() { + tonic_build::configure() + .build_server(false) + .compile( + &[ + "proto/context.proto", + "proto/acl.proto", + "proto/kpi_sample_types.proto", + "proto/monitoring.proto", + ], + &["proto"], + ) + .unwrap_or_else(|e| panic!("Failed to compile protos {:?}", e)); +} diff --git a/src/tests/hackfest3/probe/probe-tfs/connect_to_mininet.sh b/src/tests/hackfest3/probe/probe-tfs/connect_to_mininet.sh new file mode 100755 index 0000000000000000000000000000000000000000..bba3eaa9a985f3e546f9df2681879faef0a9b83e --- /dev/null +++ b/src/tests/hackfest3/probe/probe-tfs/connect_to_mininet.sh @@ -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. + +CONTAINER=`docker ps | grep mininet | cut -f1 -d" "` +docker exec -it $CONTAINER /bin/bash diff --git a/src/tests/hackfest3/probe/probe-tfs/deploy.sh b/src/tests/hackfest3/probe/probe-tfs/deploy.sh new file mode 100755 index 0000000000000000000000000000000000000000..733f02d11ecd4a9de90898b210b2fe9b579447f2 --- /dev/null +++ b/src/tests/hackfest3/probe/probe-tfs/deploy.sh @@ -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. + +# build the software +# uncomment the line below if you want to build it +# cargo build --release --target=x86_64-unknown-linux-musl + +# build a .env file with the info from context and monitoring services + +if [ -z "${CONTEXTSERVICE_SERVICE_HOST}" ] || [ -z "${CONTEXTSERVICE_SERVICE_PORT_GRPC}" ] || \ + [ -z "${MONITORINGSERVICE_SERVICE_HOST}" ] || [ -z "${MONITORINGSERVICE_SERVICE_PORT_GRPC}" ] +then + echo "TFS_ENV_VARS are not loaded." + exit 1 +fi + +echo "CONTEXTSERVICE_SERVICE_HOST=${CONTEXTSERVICE_SERVICE_HOST}" > .env +echo "CONTEXTSERVICE_SERVICE_PORT_GRPC=${CONTEXTSERVICE_SERVICE_PORT_GRPC}" >> .env +echo "MONITORINGSERVICE_SERVICE_HOST=${MONITORINGSERVICE_SERVICE_HOST}" >> .env +echo "MONITORINGSERVICE_SERVICE_PORT_GRPC=${MONITORINGSERVICE_SERVICE_PORT_GRPC}" >> .env + +# get container id +CONTAINER=`docker ps | grep mininet | cut -f1 -d" "` +docker cp target/x86_64-unknown-linux-musl/release/tfsping $CONTAINER:/root +docker cp target/x86_64-unknown-linux-musl/release/tfsagent $CONTAINER:/root +docker cp .env $CONTAINER:/root diff --git a/src/tests/hackfest3/probe/probe-tfs/proto b/src/tests/hackfest3/probe/probe-tfs/proto new file mode 120000 index 0000000000000000000000000000000000000000..ce803d6a96f0064d107428238b9beecb2a0ed2be --- /dev/null +++ b/src/tests/hackfest3/probe/probe-tfs/proto @@ -0,0 +1 @@ +../../../../../proto \ No newline at end of file diff --git a/src/tests/hackfest3/probe/probe-tfs/src/agent.rs b/src/tests/hackfest3/probe/probe-tfs/src/agent.rs new file mode 100644 index 0000000000000000000000000000000000000000..4221cbe28ba75021d2b7c2de6dbef46a043cc2bb --- /dev/null +++ b/src/tests/hackfest3/probe/probe-tfs/src/agent.rs @@ -0,0 +1,254 @@ +/** + * Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Program that starts the ping probe and reports it to the Unix socket. + * + * Author: Carlos Natalino + */ + +/************** Modules needed to communicate with TeraFlowSDN ***************/ +pub mod kpi_sample_types { + tonic::include_proto!("kpi_sample_types"); +} + +pub mod acl { + tonic::include_proto!("acl"); +} + +pub mod context { + // tonic::include_proto!(); + tonic::include_proto!("context"); +} + +pub mod monitoring { + tonic::include_proto!("monitoring"); +} + +/********************************** Imports **********************************/ +// standard library +use std::env; +use std::path::Path; +use std::sync::Arc; +use std::time::SystemTime; +use std::{fs, io}; + +// external libraries +use dotenv::dotenv; +use futures; +use futures::lock::Mutex; +use tokio::net::UnixListener; + +// proto +use context::context_service_client::ContextServiceClient; +use context::{Empty, Timestamp}; +use kpi_sample_types::KpiSampleType; +use monitoring::monitoring_service_client::MonitoringServiceClient; +use monitoring::{Kpi, KpiDescriptor, KpiValue}; + +#[tokio::main] +async fn main() -> Result<(), Box> { + dotenv().ok(); // load the environment variables from the .env file + + let path = Path::new("/tmp/tfsping"); + + if path.exists() { + fs::remove_file(path)?; // removes the socket in case it exists + } + + let listener = UnixListener::bind(path).unwrap(); + println!("Bound to the path {:?}", path); + + // ARC Mutex that tells whether or not to send the results to the monitoring component + let send_ping = Arc::new(Mutex::new(false)); + // copy used by the task that receives data from the probe + let ping_probe = send_ping.clone(); + // copy used by the task that receives stream data from TFS + let ping_trigger = send_ping.clone(); + + // ARC mutex that hosts the KPI ID to be used as the monitoring KPI + let kpi_id: Arc>> = Arc::new(Mutex::new(None)); + let kpi_id_probe = kpi_id.clone(); + let kpi_id_trigger = kpi_id.clone(); + + let t1 = tokio::spawn(async move { + let monitoring_host = env::var("MONITORINGSERVICE_SERVICE_HOST") + .unwrap_or_else(|_| panic!("receiver: Could not find monitoring host!")); + let monitoring_port = env::var("MONITORINGSERVICE_SERVICE_PORT_GRPC") + .unwrap_or_else(|_| panic!("receiver: Could not find monitoring port!")); + + let mut monitoring_client = MonitoringServiceClient::connect(format!( + "http://{}:{}", + monitoring_host, monitoring_port + )) + .await + .unwrap(); + println!("receiver: Connected to the monitoring service!"); + loop { + println!("receiver: Awaiting for new connection!"); + let (stream, _socket) = listener.accept().await.unwrap(); + + stream.readable().await.unwrap(); + + let mut buf = [0; 4]; + + match stream.try_read(&mut buf) { + Ok(n) => { + let num = u32::from_be_bytes(buf); + println!("receiver: read {} bytes -- {:?}", n, num); + + let should_ping = ping_probe.lock().await; + + if *should_ping { + // only send the value to monitoring if needed + // send the value to the monitoring component + println!("receiver: Send value to monitoring"); + + let kpi_id = kpi_id_probe.lock().await; + println!("receiver: kpi id: {:?}", kpi_id); + + let now = SystemTime::now() + .duration_since(SystemTime::UNIX_EPOCH) + .unwrap() + .as_secs(); // See struct std::time::Duration methods + + let kpi = Kpi { + kpi_id: kpi_id.clone(), + timestamp: Some(Timestamp { + timestamp: now as f64, + }), + kpi_value: Some(KpiValue { + value: Some(monitoring::kpi_value::Value::Int32Val(num as i32)), + }), + }; + // println!("Request: {:?}", kpi); + let response = monitoring_client + .include_kpi(tonic::Request::new(kpi)) + .await; + // println!("Response: {:?}", response); + if response.is_err() { + println!("receiver: Issue with the response from monitoring!"); + } + } + } + Err(ref e) if e.kind() == io::ErrorKind::WouldBlock => { + continue; + } + Err(e) => { + println!("receiver: {:?}", e); + } + } + } + }); + + let t2 = tokio::spawn(async move { + // let server_address = "129.16.37.136"; + let context_host = env::var("CONTEXTSERVICE_SERVICE_HOST") + .unwrap_or_else(|_| panic!("stream: Could not find context host!")); + let context_port = env::var("CONTEXTSERVICE_SERVICE_PORT_GRPC") + .unwrap_or_else(|_| panic!("stream: Could not find context port!")); + + let monitoring_host = env::var("MONITORINGSERVICE_SERVICE_HOST") + .unwrap_or_else(|_| panic!("stream: Could not find monitoring host!")); + let monitoring_port = env::var("MONITORINGSERVICE_SERVICE_PORT_GRPC") + .unwrap_or_else(|_| panic!("stream: Could not find monitoring port!")); + + let mut context_client = + ContextServiceClient::connect(format!("http://{}:{}", context_host, context_port)) + .await + .unwrap(); + println!("stream: Connected to the context service!"); + + let mut monitoring_client = MonitoringServiceClient::connect(format!( + "http://{}:{}", + monitoring_host, monitoring_port + )) + .await + .unwrap(); + println!("stream: Connected to the monitoring service!"); + + let mut service_event_stream = context_client + .get_service_events(tonic::Request::new(Empty {})) + .await + .unwrap() + .into_inner(); + while let Some(event) = service_event_stream.message().await.unwrap() { + let event_service = event.clone().service_id.unwrap(); + if event.event.clone().unwrap().event_type == 1 { + println!("stream: New CREATE event:\n{:?}", event_service); + + let kpi_descriptor = KpiDescriptor { + kpi_id: None, + kpi_id_list: vec![], + device_id: None, + endpoint_id: None, + slice_id: None, + connection_id: None, + kpi_description: format!( + "Latency value for service {}", + event_service.service_uuid.unwrap().uuid + ), + service_id: Some(event.clone().service_id.clone().unwrap().clone()), + kpi_sample_type: KpiSampleType::KpisampletypeUnknown.into(), + }; + + let _response = monitoring_client + .set_kpi(tonic::Request::new(kpi_descriptor)) + .await + .unwrap() + .into_inner(); + let mut kpi_id = kpi_id_trigger.lock().await; + println!("stream: KPI ID: {:?}", _response); + *kpi_id = Some(_response.clone()); + let mut should_ping = ping_trigger.lock().await; + *should_ping = true; + } else if event.event.clone().unwrap().event_type == 3 { + println!("stream: New REMOVE event:\n{:?}", event); + let mut should_ping = ping_trigger.lock().await; + *should_ping = false; + } + } + }); + + futures::future::join_all(vec![t1, t2]).await; + + // let addr = "10.0.0.2".parse().unwrap(); + // let timeout = Duration::from_secs(1); + // ping::ping(addr, Some(timeout), Some(166), Some(3), Some(5), Some(&random())).unwrap(); + + // let server_address = env::var("CONTEXTSERVICE_SERVICE_HOST").unwrap(); + + // let contexts = grpc_client.list_context_ids(tonic::Request::new(Empty { })).await?; + + // println!("{:?}", contexts.into_inner()); + // let current_context = contexts.into_inner().context_ids[0].clone(); + + // if let Some(current_context) = contexts.into_inner().context_ids[0] { + + // } + // else { + // panic!("No context available!"); + // } + + // for context in contexts.into_inner().context_ids { + // println!("{:?}", context); + // } + + // let services = grpc_client.list_services(tonic::Request::new(current_context)).await?; + // println!("{:?}", services.into_inner()); + + println!("Hello, world!"); + + Ok(()) +} diff --git a/src/tests/hackfest3/probe/probe-tfs/src/ping.rs b/src/tests/hackfest3/probe/probe-tfs/src/ping.rs new file mode 100644 index 0000000000000000000000000000000000000000..3c118c98782a4cb5def9a654edbe55186bbf3df7 --- /dev/null +++ b/src/tests/hackfest3/probe/probe-tfs/src/ping.rs @@ -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. + * + * Program that starts the ping probe and reports it to the Unix socket. + * + * Author: Carlos Natalino + */ +// standard library +use std::io; +use std::path::Path; + +// external libraries +use tokio::net::UnixStream; +use tokio::time::{sleep, Duration}; + +async fn send_value(path: &Path, value: i32) -> Result<(), Box> { + let stream = UnixStream::connect(path).await?; + stream.writable().await; + // if ready.is_writable() { + match stream.try_write(&i32::to_be_bytes(value)) { + Ok(n) => { + println!("\twrite {} bytes\t{}", n, value); + } + Err(ref e) if e.kind() == io::ErrorKind::WouldBlock => { + println!("Error would block!"); + } + Err(e) => { + println!("error into()"); + return Err(e.into()); + } + } + // } + Ok(()) +} + +#[tokio::main] +async fn main() -> Result<(), Box> { + let path = Path::new("/tmp/tfsping"); + + loop { + let payload = [0; 1024]; + + let result = surge_ping::ping("10.0.0.2".parse()?, &payload).await; + + // let (_packet, duration) = result.unwra + + if let Ok((_packet, duration)) = result { + println!("Ping took {:.3?}\t{:?}", duration, _packet.get_identifier()); + send_value(&path, duration.as_micros() as i32).await?; + } else { + println!("Error!"); + send_value(&path, -1).await?; + } + + sleep(Duration::from_secs(2)).await; + } + + // Ok(()) // unreachable +} diff --git a/src/tests/hackfest3/probe/probe-tfs/target/x86_64-unknown-linux-musl/release/tfsagent b/src/tests/hackfest3/probe/probe-tfs/target/x86_64-unknown-linux-musl/release/tfsagent new file mode 100755 index 0000000000000000000000000000000000000000..b7cef11a433c6bf2eeb94638fa90d93f25acd3c8 Binary files /dev/null and b/src/tests/hackfest3/probe/probe-tfs/target/x86_64-unknown-linux-musl/release/tfsagent differ diff --git a/src/tests/hackfest3/probe/probe-tfs/target/x86_64-unknown-linux-musl/release/tfsping b/src/tests/hackfest3/probe/probe-tfs/target/x86_64-unknown-linux-musl/release/tfsping new file mode 100755 index 0000000000000000000000000000000000000000..6e943d292dd6653e857bf5eea3258d38ad246026 Binary files /dev/null and b/src/tests/hackfest3/probe/probe-tfs/target/x86_64-unknown-linux-musl/release/tfsping differ diff --git a/src/tests/hackfest3/run_test_01_bootstrap.sh b/src/tests/hackfest3/run_test_01_bootstrap.sh new file mode 100755 index 0000000000000000000000000000000000000000..8eb7e75dc8d2d964b447bb4eb78b15c79a7634d7 --- /dev/null +++ b/src/tests/hackfest3/run_test_01_bootstrap.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. + +# 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/hackfest3/tests/test_functional_bootstrap.py + +# To enable debugging use the following options +#python -m pytest --verbose -o log_cli=true -o log_cli_level=DEBUG src/tests/hackfest3/tests/test_functional_bootstrap.py + diff --git a/src/tests/hackfest3/run_test_02_create_service.sh b/src/tests/hackfest3/run_test_02_create_service.sh new file mode 100755 index 0000000000000000000000000000000000000000..50eb0732b364d0f560aafceae79b73662279cf05 --- /dev/null +++ b/src/tests/hackfest3/run_test_02_create_service.sh @@ -0,0 +1,20 @@ +#!/bin/bash +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +source tfs_runtime_env_vars.sh +python -m pytest --verbose src/tests/hackfest3/tests/test_functional_create_service.py + +# To enable debugging use the following options +#python -m pytest --verbose -o log_cli=true -o log_cli_level=DEBUG src/tests/hackfest3/tests/test_functional_create_service.py diff --git a/src/tests/hackfest3/run_test_03_delete_service.sh b/src/tests/hackfest3/run_test_03_delete_service.sh new file mode 100755 index 0000000000000000000000000000000000000000..15f6e02c76ffccb70c01d35433133e36e896905c --- /dev/null +++ b/src/tests/hackfest3/run_test_03_delete_service.sh @@ -0,0 +1,20 @@ +#!/bin/bash +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +source tfs_runtime_env_vars.sh +python -m pytest --verbose src/tests/hackfest3/tests/test_functional_delete_service.py + +# To enable debugging use the following options +#python -m pytest --verbose -o log_cli=true -o log_cli_level=DEBUG src/tests/hackfest3/tests/test_functional_delete_service.py diff --git a/src/tests/hackfest3/run_test_04_cleanup.sh b/src/tests/hackfest3/run_test_04_cleanup.sh new file mode 100755 index 0000000000000000000000000000000000000000..db02155a80b002c01e896b580ee07caa65cb9db6 --- /dev/null +++ b/src/tests/hackfest3/run_test_04_cleanup.sh @@ -0,0 +1,20 @@ +#!/bin/bash +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +source tfs_runtime_env_vars.sh +python -m pytest --verbose src/tests/hackfest3/tests/test_functional_cleanup.py + +# To enable debugging use the following options +#python -m pytest --verbose -o log_cli=true -o log_cli_level=DEBUG src/tests/hackfest3/tests/test_functional_cleanup.py diff --git a/src/tests/hackfest3/setup.sh b/src/tests/hackfest3/setup.sh new file mode 100755 index 0000000000000000000000000000000000000000..0454f4b10286d05eeacc33c73c855906d0ab2c4f --- /dev/null +++ b/src/tests/hackfest3/setup.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. + + +export POD_NAME=$(kubectl get pods -n=tfs | grep device | awk '{print $1}') + +kubectl exec ${POD_NAME} -n=tfs -c=server -- rm -rf /root/p4 +kubectl exec ${POD_NAME} -n=tfs -c=server -- mkdir /root/p4 + +kubectl cp src/tests/hackfest3/p4/p4info.txt tfs/${POD_NAME}:/root/p4 -c=server +kubectl cp src/tests/hackfest3/p4/bmv2.json tfs/${POD_NAME}:/root/p4 -c=server diff --git a/src/tests/hackfest3/tests/.gitignore b/src/tests/hackfest3/tests/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..76cb708d1b532c9b69166e55f36bcb912fd5e370 --- /dev/null +++ b/src/tests/hackfest3/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/hackfest3/tests/BuildDescriptors.py b/src/tests/hackfest3/tests/BuildDescriptors.py new file mode 100644 index 0000000000000000000000000000000000000000..98b78863318a7ad682fc5f970d44d02240b45a26 --- /dev/null +++ b/src/tests/hackfest3/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/hackfest3/tests/LoadDescriptors.py b/src/tests/hackfest3/tests/LoadDescriptors.py new file mode 100644 index 0000000000000000000000000000000000000000..b232935f4675d718d55e67fe3a76012a39398dda --- /dev/null +++ b/src/tests/hackfest3/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/hackfest3/tests/Objects.py b/src/tests/hackfest3/tests/Objects.py new file mode 100644 index 0000000000000000000000000000000000000000..942e1f4b12a9f4163d371ddbe5f87ac9f90055a9 --- /dev/null +++ b/src/tests/hackfest3/tests/Objects.py @@ -0,0 +1,291 @@ +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT 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.EndPoint import json_endpoint_descriptor +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 = '192.168.6.38' +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 = [json_endpoint_descriptor('1', 'port'), + json_endpoint_descriptor('2', 'port'), + json_endpoint_descriptor('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 = '192.168.6.38' +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 = [json_endpoint_descriptor('1', 'port'), + json_endpoint_descriptor('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 = '192.168.6.38' +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 = [json_endpoint_descriptor('1', 'port'), + json_endpoint_descriptor('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 = '192.168.6.38' +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 = [json_endpoint_descriptor('1', 'port'), + json_endpoint_descriptor('2', 'port'), + json_endpoint_descriptor('3', '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'] +ENDPOINT_ID_SW4_3 = DEVICE_SW4_ENDPOINTS[2]['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 + } +) + +# ----- Links ---------------------------------------------------------------------------------------------------------- + +# Leftmost links +# SW1_1 - SW2_1 +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]) + +# SW2_1 - SW1_1 +LINK_SW2_SW1_UUID = get_link_uuid(ENDPOINT_ID_SW2_1, ENDPOINT_ID_SW1_1) +LINK_SW2_SW1_ID = json_link_id(LINK_SW2_SW1_UUID) +LINK_SW2_SW1 = json_link(LINK_SW2_SW1_UUID, [ENDPOINT_ID_SW2_1, ENDPOINT_ID_SW1_1]) + +# SW1_2 - SW3_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]) + +# SW3_1 - SW1_2 +LINK_SW3_SW1_UUID = get_link_uuid(ENDPOINT_ID_SW3_1, ENDPOINT_ID_SW1_2) +LINK_SW3_SW1_ID = json_link_id(LINK_SW3_SW1_UUID) +LINK_SW3_SW1 = json_link(LINK_SW3_SW1_UUID, [ENDPOINT_ID_SW3_1, ENDPOINT_ID_SW1_2]) + + +# Rightmost links +# SW2_2 - SW4_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]) + +# SW4_1 - SW2_2 +LINK_SW4_SW2_UUID = get_link_uuid(ENDPOINT_ID_SW4_1, ENDPOINT_ID_SW2_2) +LINK_SW4_SW2_ID = json_link_id(LINK_SW4_SW2_UUID) +LINK_SW4_SW2 = json_link(LINK_SW4_SW2_UUID, [ENDPOINT_ID_SW4_1, ENDPOINT_ID_SW2_2]) + +# SW3_2 - SW4_2 +LINK_SW3_SW4_UUID = get_link_uuid(ENDPOINT_ID_SW3_2, ENDPOINT_ID_SW4_2) +LINK_SW3_SW4_ID = json_link_id(LINK_SW3_SW4_UUID) +LINK_SW3_SW4 = json_link(LINK_SW3_SW4_UUID, [ENDPOINT_ID_SW3_2, ENDPOINT_ID_SW4_2]) + +# SW4_2 - SW3_2 +LINK_SW4_SW3_UUID = get_link_uuid(ENDPOINT_ID_SW4_2, ENDPOINT_ID_SW3_2) +LINK_SW4_SW3_ID = json_link_id(LINK_SW4_SW3_UUID) +LINK_SW4_SW3 = json_link(LINK_SW4_SW3_UUID, [ENDPOINT_ID_SW4_2, ENDPOINT_ID_SW3_2]) + +# ----- Service ---------------------------------------------------------------------------------------------------------- + +SERVICE_SW1_SW4_UUID = get_service_uuid(ENDPOINT_ID_SW1_3, ENDPOINT_ID_SW4_3) +SERVICE_SW1_SW4 = json_service_p4_planned(SERVICE_SW1_SW4_UUID) +SERVICE_SW1_SW4_ENDPOINT_IDS = [DEVICE_SW1_ENDPOINT_IDS[2], DEVICE_SW4_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), +] + +LINKS = [ + LINK_SW1_SW2, + LINK_SW2_SW1, + + LINK_SW1_SW3, + LINK_SW3_SW1, + + LINK_SW2_SW4, + LINK_SW4_SW2, + + LINK_SW3_SW4, + LINK_SW4_SW3, +] + +SERVICES = [ + (SERVICE_SW1_SW4, SERVICE_SW1_SW4_ENDPOINT_IDS), +] diff --git a/src/tests/hackfest3/tests/__init__.py b/src/tests/hackfest3/tests/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..1549d9811aa5d1c193a44ad45d0d7773236c0612 --- /dev/null +++ b/src/tests/hackfest3/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/hackfest3/tests/test_functional_bootstrap.py b/src/tests/hackfest3/tests/test_functional_bootstrap.py new file mode 100644 index 0000000000000000000000000000000000000000..97269217336986a6a143a4a7ef94bd8b0710e9b0 --- /dev/null +++ b/src/tests/hackfest3/tests/test_functional_bootstrap.py @@ -0,0 +1,119 @@ +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT 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 + +from common.tools.object_factory.ConfigRule import ( + json_config_rule_set, json_config_rule_delete) + + +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)) + context_data = context_client.GetContext(response) + assert context_data.name == 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 + + topology_data = context_client.GetTopology(response) + assert topology_data.name == 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) + device_p4_with_connect_rules['device_operational_status'] = \ + DeviceOperationalStatusEnum.DEVICEOPERATIONALSTATUS_ENABLED + response = device_client.AddDevice(Device(**device_p4_with_connect_rules)) + + LOGGER.info('Adding Device {:s}'.format(device_uuid)) + device_p4_with_endpoints = copy.deepcopy(device) + device_p4_with_endpoints['device_id']['device_uuid']['uuid'] = response.device_uuid.uuid + device_p4_with_endpoints['device_endpoints'].extend(endpoints) + for i in device_p4_with_endpoints['device_endpoints']: + i['endpoint_id']['device_id']['device_uuid']['uuid'] = response.device_uuid.uuid + + LOGGER.info('Adding Endpoints {:s}'.format(device_uuid)) + 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)) + +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/hackfest3/tests/test_functional_cleanup.py b/src/tests/hackfest3/tests/test_functional_cleanup.py new file mode 100644 index 0000000000000000000000000000000000000000..0a87649a0355256bd6b82163a33e84147bfe8438 --- /dev/null +++ b/src/tests/hackfest3/tests/test_functional_cleanup.py @@ -0,0 +1,82 @@ +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT 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)) + LOGGER.info("yes") + #device_client.DeleteDevice(DeviceId(**device_id)) + context_client.RemoveDevice(DeviceId(**device_id)) + + 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) + + # ----- 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)) diff --git a/src/tests/hackfest3/tests/test_functional_create_service.py b/src/tests/hackfest3/tests/test_functional_create_service.py new file mode 100644 index 0000000000000000000000000000000000000000..6c0a5049e0cf76e937512388ea1a9eb36b126e36 --- /dev/null +++ b/src/tests/hackfest3/tests/test_functional_create_service.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 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 .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 + + # ----- 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)) diff --git a/src/tests/hackfest3/tests/test_functional_delete_service.py b/src/tests/hackfest3/tests/test_functional_delete_service.py new file mode 100644 index 0000000000000000000000000000000000000000..c5821df4ccc1caa2a1d72ed98dbfcb82e9db21b1 --- /dev/null +++ b/src/tests/hackfest3/tests/test_functional_delete_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_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))) diff --git a/src/tests/oeccpsc22/deploy_specs_dom1.sh b/src/tests/oeccpsc22/deploy_specs_dom1.sh index 7db9159e00e3044ddeb571b03cf3e05de33a8150..2467907771e11e8fd9fa5428f478398644e082cf 100755 --- a/src/tests/oeccpsc22/deploy_specs_dom1.sh +++ b/src/tests/oeccpsc22/deploy_specs_dom1.sh @@ -20,7 +20,7 @@ export TFS_REGISTRY_IMAGES="http://localhost:32000/tfs/" # Set the list of components, separated by spaces, you want to build images for, and deploy. -#export TFS_COMPONENTS="context device automation monitoring pathcomp service slice compute webui interdomain load_generator" +#export TFS_COMPONENTS="context device ztp monitoring pathcomp service slice nbi webui interdomain load_generator" export TFS_COMPONENTS="context device pathcomp service slice interdomain webui" # Set the tag you want to use for your images. diff --git a/src/tests/oeccpsc22/deploy_specs_dom2.sh b/src/tests/oeccpsc22/deploy_specs_dom2.sh index 3e23c56feb3247a1b1bcef1a82feeac049654cb6..55be0397beea836782ad3ba26a3765111170b9d4 100755 --- a/src/tests/oeccpsc22/deploy_specs_dom2.sh +++ b/src/tests/oeccpsc22/deploy_specs_dom2.sh @@ -20,7 +20,7 @@ export TFS_REGISTRY_IMAGES="http://localhost:32000/tfs/" # Set the list of components, separated by spaces, you want to build images for, and deploy. -#export TFS_COMPONENTS="context device automation monitoring pathcomp service slice compute webui interdomain load_generator" +#export TFS_COMPONENTS="context device ztp monitoring pathcomp service slice nbi webui interdomain load_generator" export TFS_COMPONENTS="context device pathcomp service slice interdomain webui" # Set the tag you want to use for your images. diff --git a/src/tests/oeccpsc22/nginx-ingress-http-dom1.yaml b/src/tests/oeccpsc22/nginx-ingress-http-dom1.yaml index b03699946e6a81e6cb8a91379f0952c2894e6578..28a16b426e76fb412f0085e7f3a52b710ab0c829 100644 --- a/src/tests/oeccpsc22/nginx-ingress-http-dom1.yaml +++ b/src/tests/oeccpsc22/nginx-ingress-http-dom1.yaml @@ -41,6 +41,6 @@ spec: pathType: Prefix backend: service: - name: computeservice + name: nbiservice port: number: 8080 diff --git a/src/tests/oeccpsc22/nginx-ingress-http-dom2.yaml b/src/tests/oeccpsc22/nginx-ingress-http-dom2.yaml index d07b73ee2a94d6ed54b4b5658c595e1ce635bddb..f6a08de12c4720f0bc75a76215b2a3cdc40eddfe 100644 --- a/src/tests/oeccpsc22/nginx-ingress-http-dom2.yaml +++ b/src/tests/oeccpsc22/nginx-ingress-http-dom2.yaml @@ -48,6 +48,6 @@ spec: pathType: Prefix backend: service: - name: computeservice + name: nbiservice port: number: 8080 diff --git a/src/tests/oeccpsc22/old/deploy_in_kubernetes.sh b/src/tests/oeccpsc22/old/deploy_in_kubernetes.sh index 53b6e76a8bb32310945b29c57946435d98a0b8d3..25b78366f0834d4486b0f2d0d0c3c698bf25ffb7 100755 --- a/src/tests/oeccpsc22/old/deploy_in_kubernetes.sh +++ b/src/tests/oeccpsc22/old/deploy_in_kubernetes.sh @@ -16,7 +16,7 @@ # OECC/PSC 22 deployment settings export REGISTRY_IMAGE="" -export COMPONENTS="context device monitoring service slice interdomain compute" # webui +export COMPONENTS="context device monitoring service slice interdomain nbi" # webui export IMAGE_TAG="oeccpsc22" export K8S_HOSTNAME="kubernetes-master" #export GRAFANA_PASSWORD="admin123+" @@ -67,7 +67,7 @@ for COMPONENT in $COMPONENTS; do echo " Building Docker image..." BUILD_LOG="$TMP_LOGS_FOLDER/build_${COMPONENT}.log" - if [ "$COMPONENT" == "automation" ] || [ "$COMPONENT" == "policy" ]; then + if [ "$COMPONENT" == "ztp" ] || [ "$COMPONENT" == "policy" ]; then docker build -t "$IMAGE_NAME" -f ./src/"$COMPONENT"/Dockerfile ./src/"$COMPONENT"/ > "$BUILD_LOG" else docker build -t "$IMAGE_NAME" -f ./src/"$COMPONENT"/Dockerfile ./src/ > "$BUILD_LOG" diff --git a/src/tests/oeccpsc22/old/expose-services-dom1.yaml b/src/tests/oeccpsc22/old/expose-services-dom1.yaml index f7eab1372793290f607422f167e06a85c0026724..f6038c388517787e4b9b661b549ec3f988972bd7 100644 --- a/src/tests/oeccpsc22/old/expose-services-dom1.yaml +++ b/src/tests/oeccpsc22/old/expose-services-dom1.yaml @@ -71,11 +71,11 @@ #apiVersion: v1 #kind: Service #metadata: -# name: computeservice-public +# name: nbiservice-public #spec: # type: NodePort # selector: -# app: computeservice +# app: nbiservice # ports: # - name: http # protocol: TCP diff --git a/src/tests/oeccpsc22/old/expose-services-dom2.yaml b/src/tests/oeccpsc22/old/expose-services-dom2.yaml index 3ef4fd8795e76504be001dab5bc562a4edf92df2..ad7dafaa5277b618d795c2a6eafc67699f8e8d6d 100644 --- a/src/tests/oeccpsc22/old/expose-services-dom2.yaml +++ b/src/tests/oeccpsc22/old/expose-services-dom2.yaml @@ -71,11 +71,11 @@ #apiVersion: v1 #kind: Service #metadata: -# name: computeservice-public +# name: nbiservice-public #spec: # type: NodePort # selector: -# app: computeservice +# app: nbiservice # ports: # - name: http # protocol: TCP diff --git a/src/tests/oeccpsc22/run_test_01_bootstrap.sh b/src/tests/oeccpsc22/run_test_01_bootstrap.sh index 23a569d4de537c8a0279930ba83186b59770050e..86988ad336566196ad5bb62eb99c8d41255c40f9 100755 --- a/src/tests/oeccpsc22/run_test_01_bootstrap.sh +++ b/src/tests/oeccpsc22/run_test_01_bootstrap.sh @@ -41,15 +41,15 @@ export D1_CONTEXTSERVICE_SERVICE_HOST=$(kubectl get node $K8S_HOSTNAME -o 'jsonp 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 D1_NBISERVICE_SERVICE_HOST=$(kubectl get node $K8S_HOSTNAME -o 'jsonpath={.status.addresses[?(@.type=="InternalIP")].address}') +export D1_NBISERVICE_SERVICE_PORT_HTTP=$(kubectl get service nbiservice-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}') +export D2_NBISERVICE_SERVICE_HOST=$(kubectl get node $K8S_HOSTNAME -o 'jsonpath={.status.addresses[?(@.type=="InternalIP")].address}') +export D2_NBISERVICE_SERVICE_PORT_HTTP=$(kubectl get service nbiservice-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 diff --git a/src/tests/oeccpsc22/run_test_02_create_interdomain_slice.sh b/src/tests/oeccpsc22/run_test_02_create_interdomain_slice.sh index e438a2915f4924a41b765f2f449e3704727653b7..5c27e9f647c474d258845b6f1daf2cb72f34a9ec 100755 --- a/src/tests/oeccpsc22/run_test_02_create_interdomain_slice.sh +++ b/src/tests/oeccpsc22/run_test_02_create_interdomain_slice.sh @@ -30,15 +30,15 @@ export D1_CONTEXTSERVICE_SERVICE_HOST=$(kubectl get node $K8S_HOSTNAME -o 'jsonp 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 D1_NBISERVICE_SERVICE_HOST=$(kubectl get node $K8S_HOSTNAME -o 'jsonpath={.status.addresses[?(@.type=="InternalIP")].address}') +export D1_NBISERVICE_SERVICE_PORT_HTTP=$(kubectl get service nbiservice-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}') +export D2_NBISERVICE_SERVICE_HOST=$(kubectl get node $K8S_HOSTNAME -o 'jsonpath={.status.addresses[?(@.type=="InternalIP")].address}') +export D2_NBISERVICE_SERVICE_PORT_HTTP=$(kubectl get service nbiservice-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 diff --git a/src/tests/oeccpsc22/run_test_03_delete_interdomain_slice.sh b/src/tests/oeccpsc22/run_test_03_delete_interdomain_slice.sh index 6816ac815fc65f5863608f7303c3d356d12fb52c..c3dba775fae1f20d20160c1be180b8b86aff1655 100755 --- a/src/tests/oeccpsc22/run_test_03_delete_interdomain_slice.sh +++ b/src/tests/oeccpsc22/run_test_03_delete_interdomain_slice.sh @@ -30,15 +30,15 @@ export D1_CONTEXTSERVICE_SERVICE_HOST=$(kubectl get node $K8S_HOSTNAME -o 'jsonp 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 D1_NBISERVICE_SERVICE_HOST=$(kubectl get node $K8S_HOSTNAME -o 'jsonpath={.status.addresses[?(@.type=="InternalIP")].address}') +export D1_NBISERVICE_SERVICE_PORT_HTTP=$(kubectl get service nbiservice-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}') +export D2_NBISERVICE_SERVICE_HOST=$(kubectl get node $K8S_HOSTNAME -o 'jsonpath={.status.addresses[?(@.type=="InternalIP")].address}') +export D2_NBISERVICE_SERVICE_PORT_HTTP=$(kubectl get service nbiservice-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 diff --git a/src/tests/oeccpsc22/run_test_04_cleanup.sh b/src/tests/oeccpsc22/run_test_04_cleanup.sh index 763c5b67eb00f2c4220b286c37c566b96bf3e386..2b44f00d09c4eb33ba9f9e3bbd2615feeda02bcc 100755 --- a/src/tests/oeccpsc22/run_test_04_cleanup.sh +++ b/src/tests/oeccpsc22/run_test_04_cleanup.sh @@ -30,15 +30,15 @@ export D1_CONTEXTSERVICE_SERVICE_HOST=$(kubectl get node $K8S_HOSTNAME -o 'jsonp 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 D1_NBISERVICE_SERVICE_HOST=$(kubectl get node $K8S_HOSTNAME -o 'jsonpath={.status.addresses[?(@.type=="InternalIP")].address}') +export D1_NBISERVICE_SERVICE_PORT_HTTP=$(kubectl get service nbiservice-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}') +export D2_NBISERVICE_SERVICE_HOST=$(kubectl get node $K8S_HOSTNAME -o 'jsonpath={.status.addresses[?(@.type=="InternalIP")].address}') +export D2_NBISERVICE_SERVICE_PORT_HTTP=$(kubectl get service nbiservice-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 diff --git a/src/tests/oeccpsc22/tests/test_functional_create_interdomain_slice.py b/src/tests/oeccpsc22/tests/test_functional_create_interdomain_slice.py index 8c568cc78480bdae7ffd7b96eab839ae00c29432..760614c400cf408d80d06caa0dfc72a092204876 100644 --- a/src/tests/oeccpsc22/tests/test_functional_create_interdomain_slice.py +++ b/src/tests/oeccpsc22/tests/test_functional_create_interdomain_slice.py @@ -16,7 +16,7 @@ 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 nbi.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 @@ -49,7 +49,7 @@ def d2_context_client(): @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'))) + get_setting('D1_NBISERVICE_SERVICE_HOST'), str(get_setting('D1_NBISERVICE_SERVICE_PORT_HTTP'))) return MockOSM(wim_url, WIM_MAPPING, WIM_USERNAME, WIM_PASSWORD) diff --git a/src/tests/oeccpsc22/tests/test_functional_delete_interdomain_slice.py b/src/tests/oeccpsc22/tests/test_functional_delete_interdomain_slice.py index 929267f78bd6a230cb919ed97fdc4277996b7e61..9bb934d9f61861e17cff9b8da8653a96ced8fb07 100644 --- a/src/tests/oeccpsc22/tests/test_functional_delete_interdomain_slice.py +++ b/src/tests/oeccpsc22/tests/test_functional_delete_interdomain_slice.py @@ -16,7 +16,7 @@ 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 nbi.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 @@ -49,7 +49,7 @@ def d2_context_client(): @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'))) + get_setting('D1_NBISERVICE_SERVICE_HOST'), str(get_setting('D1_NBISERVICE_SERVICE_PORT_HTTP'))) return MockOSM(wim_url, WIM_MAPPING, WIM_USERNAME, WIM_PASSWORD) diff --git a/src/tests/ofc22/deploy_specs.sh b/src/tests/ofc22/deploy_specs.sh index 08a8dfaad5cdb0cb28fafb618f9b932e630bd114..d0696f91dbe61d28e3e91b0d9307c2f7e5172589 100755 --- a/src/tests/ofc22/deploy_specs.sh +++ b/src/tests/ofc22/deploy_specs.sh @@ -20,7 +20,24 @@ export TFS_REGISTRY_IMAGES="http://localhost:32000/tfs/" # Set the list of components, separated by spaces, you want to build images for, and deploy. -export TFS_COMPONENTS="context device automation monitoring pathcomp service slice compute webui" +#export TFS_COMPONENTS="context device pathcomp service slice nbi webui load_generator" +export TFS_COMPONENTS="context device pathcomp service slice nbi webui" + +# Uncomment to activate Monitoring +export TFS_COMPONENTS="${TFS_COMPONENTS} monitoring" + +# Uncomment to activate ZTP and Policy Manager +#export TFS_COMPONENTS="${TFS_COMPONENTS} ztp policy" +export TFS_COMPONENTS="${TFS_COMPONENTS} ztp" + +# Uncomment to activate Optical CyberSecurity +#export TFS_COMPONENTS="${TFS_COMPONENTS} dbscanserving opticalattackmitigator opticalattackdetector opticalattackmanager" + +# Uncomment to activate L3 CyberSecurity +#export TFS_COMPONENTS="${TFS_COMPONENTS} l3_attackmitigator l3_centralizedattackdetector" + +# Uncomment to activate TE +#export TFS_COMPONENTS="${TFS_COMPONENTS} te" # Set the tag you want to use for your images. export TFS_IMAGE_TAG="dev" @@ -31,6 +48,12 @@ export TFS_K8S_NAMESPACE="tfs" # Set additional manifest files to be applied after the deployment export TFS_EXTRA_MANIFESTS="manifests/nginx_ingress_http.yaml" +# Uncomment to monitor performance of components +export TFS_EXTRA_MANIFESTS="${TFS_EXTRA_MANIFESTS} manifests/servicemonitors.yaml" + +# Uncomment when deploying Optical CyberSecurity +#export TFS_EXTRA_MANIFESTS="${TFS_EXTRA_MANIFESTS} manifests/cachingservice.yaml" + # Set the new Grafana admin password export TFS_GRAFANA_PASSWORD="admin123+" @@ -43,6 +66,12 @@ export TFS_SKIP_BUILD="" # Set the namespace where CockroackDB will be deployed. export CRDB_NAMESPACE="crdb" +# Set the external port CockroackDB Postgre SQL interface will be exposed to. +export CRDB_EXT_PORT_SQL="26257" + +# Set the external port CockroackDB HTTP Mgmt GUI interface will be exposed to. +export CRDB_EXT_PORT_HTTP="8081" + # Set the database username to be used by Context. export CRDB_USERNAME="tfs" @@ -68,6 +97,12 @@ export CRDB_REDEPLOY="" # Set the namespace where NATS will be deployed. export NATS_NAMESPACE="nats" +# Set the external port NATS Client interface will be exposed to. +export NATS_EXT_PORT_CLIENT="4222" + +# Set the external port NATS HTTP Mgmt GUI interface will be exposed to. +export NATS_EXT_PORT_HTTP="8222" + # Disable flag for re-deploying NATS from scratch. export NATS_REDEPLOY="" @@ -77,6 +112,15 @@ export NATS_REDEPLOY="" # Set the namespace where QuestDB will be deployed. export QDB_NAMESPACE="qdb" +# Set the external port QuestDB Postgre SQL interface will be exposed to. +export QDB_EXT_PORT_SQL="8812" + +# Set the external port QuestDB Influx Line Protocol interface will be exposed to. +export QDB_EXT_PORT_ILP="9009" + +# Set the external port QuestDB HTTP Mgmt GUI interface will be exposed to. +export QDB_EXT_PORT_HTTP="9000" + # Set the database username to be used for QuestDB. export QDB_USERNAME="admin" @@ -86,8 +130,20 @@ export QDB_PASSWORD="quest" # Set the table name to be used by Monitoring for KPIs. export QDB_TABLE_MONITORING_KPIS="tfs_monitoring_kpis" +# Set the table name to be used by Slice for plotting groups. +export QDB_TABLE_SLICE_GROUPS="tfs_slice_groups" + # Disable flag for dropping tables if they exist. export QDB_DROP_TABLES_IF_EXIST="YES" # Disable flag for re-deploying QuestDB from scratch. export QDB_REDEPLOY="" + + +# ----- K8s Observability ------------------------------------------------------ + +# Set the external port Prometheus Mgmt HTTP GUI interface will be exposed to. +export PROM_EXT_PORT_HTTP="9090" + +# Set the external port Grafana HTTP Dashboards will be exposed to. +export GRAF_EXT_PORT_HTTP="3000" diff --git a/src/tests/ofc22/descriptors_emulated.json b/src/tests/ofc22/descriptors_emulated.json index 1e16b71169d721fe1de0befe212e187861ddf2de..e0ac8b3ecee916fa1c7e57adcd5d32f0b180924b 100644 --- a/src/tests/ofc22/descriptors_emulated.json +++ b/src/tests/ofc22/descriptors_emulated.json @@ -8,7 +8,7 @@ "devices": [ { "device_id": {"device_uuid": {"uuid": "R1-EMU"}}, "device_type": "emu-packet-router", - "device_operational_status": 1, "device_drivers": [0], "device_endpoints": [], + "device_operational_status": 2, "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"}}, @@ -22,7 +22,7 @@ }, { "device_id": {"device_uuid": {"uuid": "R2-EMU"}}, "device_type": "emu-packet-router", - "device_operational_status": 1, "device_drivers": [0], "device_endpoints": [], + "device_operational_status": 2, "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"}}, @@ -36,7 +36,7 @@ }, { "device_id": {"device_uuid": {"uuid": "R3-EMU"}}, "device_type": "emu-packet-router", - "device_operational_status": 1, "device_drivers": [0], "device_endpoints": [], + "device_operational_status": 2, "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"}}, @@ -50,7 +50,7 @@ }, { "device_id": {"device_uuid": {"uuid": "R4-EMU"}}, "device_type": "emu-packet-router", - "device_operational_status": 1, "device_drivers": [0], "device_endpoints": [], + "device_operational_status": 2, "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"}}, @@ -64,7 +64,7 @@ }, { "device_id": {"device_uuid": {"uuid": "O1-OLS"}}, "device_type": "emu-open-line-system", - "device_operational_status": 1, "device_drivers": [0], "device_endpoints": [], + "device_operational_status": 2, "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"}}, diff --git a/src/tests/ofc22/tests/Fixtures.py b/src/tests/ofc22/tests/Fixtures.py index 89dda54cf945d7078cd61c4b94b282f650429309..7ef60fb194aa7f0fb13fba01be2c16d9ef350ba9 100644 --- a/src/tests/ofc22/tests/Fixtures.py +++ b/src/tests/ofc22/tests/Fixtures.py @@ -23,6 +23,6 @@ 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'))) + get_setting('NBISERVICE_SERVICE_HOST'), str(get_setting('NBISERVICE_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/test_functional_bootstrap.py b/src/tests/ofc22/tests/test_functional_bootstrap.py index ca1882aaa22ff1ac20d0b1927199a6594a6c441a..f149604929bfa305377545b2fdab50751dded7a1 100644 --- a/src/tests/ofc22/tests/test_functional_bootstrap.py +++ b/src/tests/ofc22/tests/test_functional_bootstrap.py @@ -14,7 +14,7 @@ import logging, time from common.Constants import DEFAULT_CONTEXT_NAME -from common.proto.context_pb2 import ContextId, Empty +from common.proto.context_pb2 import ContextId, DeviceOperationalStatusEnum, Empty from common.proto.monitoring_pb2 import KpiDescriptorList from common.tools.descriptor.Loader import DescriptorLoader, check_descriptor_load_results, validate_empty_scenario from common.tools.object_factory.Context import json_context_id @@ -46,6 +46,27 @@ def test_scenario_bootstrap( assert len(response.service_ids) == 0 assert len(response.slice_ids) == 0 +def test_scenario_devices_enabled( + context_client : ContextClient, # pylint: disable=redefined-outer-name +) -> None: + """ + This test validates that the devices are enabled. + """ + DEVICE_OP_STATUS_ENABLED = DeviceOperationalStatusEnum.DEVICEOPERATIONALSTATUS_ENABLED + + num_devices = -1 + num_devices_enabled, num_retry = 0, 0 + while (num_devices != num_devices_enabled) and (num_retry < 10): + time.sleep(1.0) + response = context_client.ListDevices(Empty()) + num_devices = len(response.devices) + num_devices_enabled = 0 + for device in response.devices: + if device.device_operational_status != DEVICE_OP_STATUS_ENABLED: continue + num_devices_enabled += 1 + LOGGER.info('Num Devices enabled: {:d}/{:d}'.format(num_devices_enabled, num_devices)) + num_retry += 1 + assert num_devices_enabled == num_devices def test_scenario_kpis_created( context_client : ContextClient, # pylint: disable=redefined-outer-name @@ -67,7 +88,7 @@ def test_scenario_kpis_created( 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): + while (num_kpis_created != num_kpis_expected) and (num_retry < 10): response: KpiDescriptorList = monitoring_client.GetKpiDescriptorList(Empty()) num_kpis_created = len(response.kpi_descriptor_list) LOGGER.info('Num KPIs created: {:d}'.format(num_kpis_created)) diff --git a/src/tests/ofc22/tests/test_functional_create_service_xr.py b/src/tests/ofc22/tests/test_functional_create_service_xr.py index 435098589d0e56dd9d1c6baaec1a0ce23dda3354..edc5a68f303b308d663828be4d755b117544158e 100644 --- a/src/tests/ofc22/tests/test_functional_create_service_xr.py +++ b/src/tests/ofc22/tests/test_functional_create_service_xr.py @@ -45,7 +45,7 @@ def context_client(): @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'))) + get_setting('NBISERVICE_SERVICE_HOST'), str(get_setting('NBISERVICE_SERVICE_PORT_HTTP'))) return MockOSM(wim_url, WIM_MAPPING, WIM_USERNAME, WIM_PASSWORD) diff --git a/src/tests/ofc22/tests/test_functional_delete_service_xr.py b/src/tests/ofc22/tests/test_functional_delete_service_xr.py index 6de788ebd91c25b576b44f95f60fe0340cd64881..e335bd933300e281bf9a7c86626da93fc99c93d4 100644 --- a/src/tests/ofc22/tests/test_functional_delete_service_xr.py +++ b/src/tests/ofc22/tests/test_functional_delete_service_xr.py @@ -45,7 +45,7 @@ def context_client(): @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'))) + get_setting('NBISERVICE_SERVICE_HOST'), str(get_setting('NBISERVICE_SERVICE_PORT_HTTP'))) return MockOSM(wim_url, WIM_MAPPING, WIM_USERNAME, WIM_PASSWORD) diff --git a/src/tests/ofc23/deploy_specs_child.sh b/src/tests/ofc23/deploy_specs_child.sh index 4d2b3502294925d82f675263fd6bddea62ec181a..ac39a3fbc89776ba0cfc24491b6a921bf1b2db80 100755 --- a/src/tests/ofc23/deploy_specs_child.sh +++ b/src/tests/ofc23/deploy_specs_child.sh @@ -20,8 +20,22 @@ export TFS_REGISTRY_IMAGES="http://localhost:32000/tfs/" # Set the list of components, separated by spaces, you want to build images for, and deploy. -#automation monitoring load_generator -export TFS_COMPONENTS="context device pathcomp service slice compute webui" +export TFS_COMPONENTS="context device pathcomp service slice nbi webui load_generator" + +# Uncomment to activate Monitoring +#export TFS_COMPONENTS="${TFS_COMPONENTS} monitoring" + +# Uncomment to activate ZTP and Policy Manager +#export TFS_COMPONENTS="${TFS_COMPONENTS} ztp policy" + +# Uncomment to activate Optical CyberSecurity +#export TFS_COMPONENTS="${TFS_COMPONENTS} dbscanserving opticalattackmitigator opticalattackdetector opticalattackmanager" + +# Uncomment to activate L3 CyberSecurity +#export TFS_COMPONENTS="${TFS_COMPONENTS} l3_attackmitigator l3_centralizedattackdetector" + +# Uncomment to activate TE +#export TFS_COMPONENTS="${TFS_COMPONENTS} te" # Set the tag you want to use for your images. export TFS_IMAGE_TAG="dev" @@ -32,6 +46,12 @@ export TFS_K8S_NAMESPACE="tfs-child" # Set additional manifest files to be applied after the deployment export TFS_EXTRA_MANIFESTS="ofc23/tfs-ingress-child.yaml" +# Uncomment to monitor performance of components +export TFS_EXTRA_MANIFESTS="${TFS_EXTRA_MANIFESTS} manifests/servicemonitors.yaml" + +# Uncomment when deploying Optical CyberSecurity +#export TFS_EXTRA_MANIFESTS="${TFS_EXTRA_MANIFESTS} manifests/cachingservice.yaml" + # Set the new Grafana admin password export TFS_GRAFANA_PASSWORD="admin123+" @@ -116,3 +136,12 @@ export QDB_DROP_TABLES_IF_EXIST="YES" # Disable flag for re-deploying QuestDB from scratch. export QDB_REDEPLOY="" + + +# ----- K8s Observability ------------------------------------------------------ + +# Set the external port Prometheus Mgmt HTTP GUI interface will be exposed to. +export PROM_EXT_PORT_HTTP="9090" + +# Set the external port Grafana HTTP Dashboards will be exposed to. +export GRAF_EXT_PORT_HTTP="3000" diff --git a/src/tests/ofc23/deploy_specs_parent.sh b/src/tests/ofc23/deploy_specs_parent.sh index 808f4e28734be71e6eb7fb2aced39211fd8e7f24..110b02a6b67211aef5bdcd02f5df270f3810f183 100755 --- a/src/tests/ofc23/deploy_specs_parent.sh +++ b/src/tests/ofc23/deploy_specs_parent.sh @@ -20,8 +20,22 @@ export TFS_REGISTRY_IMAGES="http://localhost:32000/tfs/" # Set the list of components, separated by spaces, you want to build images for, and deploy. -#automation monitoring load_generator -export TFS_COMPONENTS="context device pathcomp service slice compute webui" +export TFS_COMPONENTS="context device pathcomp service slice nbi webui load_generator" + +# Uncomment to activate Monitoring +#export TFS_COMPONENTS="${TFS_COMPONENTS} monitoring" + +# Uncomment to activate ZTP and Policy Manager +#export TFS_COMPONENTS="${TFS_COMPONENTS} ztp policy" + +# Uncomment to activate Optical CyberSecurity +#export TFS_COMPONENTS="${TFS_COMPONENTS} dbscanserving opticalattackmitigator opticalattackdetector opticalattackmanager" + +# Uncomment to activate L3 CyberSecurity +#export TFS_COMPONENTS="${TFS_COMPONENTS} l3_attackmitigator l3_centralizedattackdetector" + +# Uncomment to activate TE +#export TFS_COMPONENTS="${TFS_COMPONENTS} te" # Set the tag you want to use for your images. export TFS_IMAGE_TAG="dev" @@ -32,6 +46,12 @@ export TFS_K8S_NAMESPACE="tfs-parent" # Set additional manifest files to be applied after the deployment export TFS_EXTRA_MANIFESTS="ofc23/tfs-ingress-parent.yaml" +# Uncomment to monitor performance of components +export TFS_EXTRA_MANIFESTS="${TFS_EXTRA_MANIFESTS} manifests/servicemonitors.yaml" + +# Uncomment when deploying Optical CyberSecurity +#export TFS_EXTRA_MANIFESTS="${TFS_EXTRA_MANIFESTS} manifests/cachingservice.yaml" + # Set the new Grafana admin password export TFS_GRAFANA_PASSWORD="admin123+" @@ -116,3 +136,12 @@ export QDB_DROP_TABLES_IF_EXIST="YES" # Disable flag for re-deploying QuestDB from scratch. export QDB_REDEPLOY="" + + +# ----- K8s Observability ------------------------------------------------------ + +# Set the external port Prometheus Mgmt HTTP GUI interface will be exposed to. +export PROM_EXT_PORT_HTTP="9090" + +# Set the external port Grafana HTTP Dashboards will be exposed to. +export GRAF_EXT_PORT_HTTP="3000" diff --git a/src/tests/ofc23/deploy_specs_sligrp.sh b/src/tests/ofc23/deploy_specs_sligrp.sh index 90bea4567bd35d845abf943670f8aa33070dff57..a16bc7e56949e480e490e8b84e1e62f4c148a5fd 100755 --- a/src/tests/ofc23/deploy_specs_sligrp.sh +++ b/src/tests/ofc23/deploy_specs_sligrp.sh @@ -20,9 +20,23 @@ export TFS_REGISTRY_IMAGES="http://localhost:32000/tfs/" # Set the list of components, separated by spaces, you want to build images for, and deploy. -#automation monitoring load_generator export TFS_COMPONENTS="context device pathcomp service slice webui load_generator" +# Uncomment to activate Monitoring +export TFS_COMPONENTS="${TFS_COMPONENTS} monitoring" + +# Uncomment to activate ZTP and Policy Manager +#export TFS_COMPONENTS="${TFS_COMPONENTS} ztp policy" + +# Uncomment to activate Optical CyberSecurity +#export TFS_COMPONENTS="${TFS_COMPONENTS} dbscanserving opticalattackmitigator opticalattackdetector opticalattackmanager" + +# Uncomment to activate L3 CyberSecurity +#export TFS_COMPONENTS="${TFS_COMPONENTS} l3_attackmitigator l3_centralizedattackdetector" + +# Uncomment to activate TE +#export TFS_COMPONENTS="${TFS_COMPONENTS} te" + # Set the tag you want to use for your images. export TFS_IMAGE_TAG="dev" @@ -32,6 +46,12 @@ export TFS_K8S_NAMESPACE="tfs-sligrp" # Set additional manifest files to be applied after the deployment export TFS_EXTRA_MANIFESTS="manifests/nginx_ingress_http.yaml" +# Uncomment to monitor performance of components +export TFS_EXTRA_MANIFESTS="${TFS_EXTRA_MANIFESTS} manifests/servicemonitors.yaml" + +# Uncomment when deploying Optical CyberSecurity +#export TFS_EXTRA_MANIFESTS="${TFS_EXTRA_MANIFESTS} manifests/cachingservice.yaml" + # Set the new Grafana admin password export TFS_GRAFANA_PASSWORD="admin123+" @@ -116,3 +136,12 @@ export QDB_DROP_TABLES_IF_EXIST="YES" # Disable flag for re-deploying QuestDB from scratch. export QDB_REDEPLOY="" + + +# ----- K8s Observability ------------------------------------------------------ + +# Set the external port Prometheus Mgmt HTTP GUI interface will be exposed to. +export PROM_EXT_PORT_HTTP="9090" + +# Set the external port Grafana HTTP Dashboards will be exposed to. +export GRAF_EXT_PORT_HTTP="3000" diff --git a/src/tests/ofc23/tfs-ingress-child.yaml b/src/tests/ofc23/tfs-ingress-child.yaml index a93b9321c9f25c78e8423413c4225f78c7aee719..a1184bb543d654303ad1f4bbb24fab7cea842801 100644 --- a/src/tests/ofc23/tfs-ingress-child.yaml +++ b/src/tests/ofc23/tfs-ingress-child.yaml @@ -48,6 +48,6 @@ spec: pathType: Prefix backend: service: - name: computeservice + name: nbiservice port: number: 8080 diff --git a/src/tests/ofc23/tfs-ingress-parent.yaml b/src/tests/ofc23/tfs-ingress-parent.yaml index baf506dd90f320a1913beb8becd39164daa21370..725ff7601748e739d16a86ad22dd528711f54fd8 100644 --- a/src/tests/ofc23/tfs-ingress-parent.yaml +++ b/src/tests/ofc23/tfs-ingress-parent.yaml @@ -48,6 +48,6 @@ spec: pathType: Prefix backend: service: - name: computeservice + name: nbiservice port: number: 8080 diff --git a/src/tests/p4/deploy_specs.sh b/src/tests/p4/deploy_specs.sh index b988123d5564684bd1bfcb776bab7f187fc628ca..fd3ac89efb33d8b719c73c33a89a416ada3398fd 100755 --- a/src/tests/p4/deploy_specs.sh +++ b/src/tests/p4/deploy_specs.sh @@ -16,7 +16,7 @@ export TFS_REGISTRY_IMAGE="http://localhost:32000/tfs/" # Set the list of components, separated by spaces, you want to build images for, and deploy. -export TFS_COMPONENTS="context device automation service compute monitoring webui" +export TFS_COMPONENTS="context device ztp service nbi monitoring webui" # Set the tag you want to use for your images. export TFS_IMAGE_TAG="dev" diff --git a/src/tests/scenario2/Scenario.md b/src/tests/scenario2/Scenario.md index 8dad4691ade669522b5c82a5e4ed07e5d0279492..964c8b2d089cd9316dd5d7f8061712160408bc48 100644 --- a/src/tests/scenario2/Scenario.md +++ b/src/tests/scenario2/Scenario.md @@ -1,47 +1,64 @@ -# 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 +# Scenario Description + +This scenario is composed of 4 TeraFlowSDN instances. +Each instance has its own local network topology detailed below. +Besides, each instance exposes an abstracted view of its local network domain. +Finally, the different domains are interconnected among them by means of the inter-domain links detailed below. + +## Domain D1 (end for the end-to-end interdomain slice) + +Domain D1 is composed of 5 emulated packet routers (Rx@D1) and 1 emulated DataCenter (DCGW@D1). +The DCGW@D1 is a termination endpoint for the end-to-end interdomain slice. +The internal domain connectivity is defined as follows: +- 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 the end-to-end interdomain slice) + +Domain D2 is composed of 6 emulated packet routers (Rx@D2). +This domain behaves as a transit domain for the end-to-end interdomain slice. +The internal domain connectivity is defined as follows: +- 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 the end-to-end interdomain slice) + +Domain D3 is composed of 6 emulated packet routers (Rx@D3). +This domain behaves as a transit domain for the end-to-end interdomain slice. +The internal domain connectivity is defined as follows: +- 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 the end-to-end interdomain slice) + +Domain D4 is composed of 3 emulated packet routers (Rx@D4) and 1 emulated DataCenter (DCGW@D4). +The DCGW@D4 is a termination endpoint for the end-to-end interdomain slice. +The internal domain connectivity is defined as follows: +- R1@D4/2 <--> R2@D4/1 +- R1@D4/3 <--> R3@D4/1 +- R2@D4/3 <--> R3@D4/2 +- R3@D4/100 <--> DCGW@D4/eth1 + +## Inter-domain Connectivity + +The 4 domains are interconnected among them by means of the following inter-domain 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/deploy_all.sh b/src/tests/scenario2/deploy_all.sh index 541612db431fd73e58fd7c1699df97342c11ea70..1eac2e4da701d2f2c60f8690c4784b59522a8b72 100755 --- a/src/tests/scenario2/deploy_all.sh +++ b/src/tests/scenario2/deploy_all.sh @@ -23,8 +23,8 @@ 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 +# Delete MockBlockchain (comment out if using a real blockchain) +kubectl delete namespace tfs-bchain # Create secondary ingress controllers kubectl apply -f nfvsdn22/nginx-ingress-controller-dom1.yaml @@ -32,8 +32,8 @@ 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 +# Create MockBlockchain (comment out if using a real blockchain) +./deploy/mock_blockchain.sh # Deploy TFS for Domain 1 source nfvsdn22/deploy_specs_dom1.sh diff --git a/src/tests/scenario2/deploy_specs_dom1.sh b/src/tests/scenario2/deploy_specs_dom1.sh index cfe8a3bf63d875b4c579e36ff6a904e0f4b62e02..5615339ba9579a511cf9773d4fcb7eed2105c752 100755 --- a/src/tests/scenario2/deploy_specs_dom1.sh +++ b/src/tests/scenario2/deploy_specs_dom1.sh @@ -1,10 +1,11 @@ +#!/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 +# http://www.apache.org/licenses/LICENSE-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,24 +13,142 @@ # 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/" + +# ----- 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 pathcomp service slice dlt interdomain webui" +#export TFS_COMPONENTS="context device pathcomp service slice nbi webui load_generator" +export TFS_COMPONENTS="context device pathcomp service slice webui" + +# Uncomment to activate Monitoring +#export TFS_COMPONENTS="${TFS_COMPONENTS} monitoring" + +# Uncomment to activate ZTP and Policy Manager +#export TFS_COMPONENTS="${TFS_COMPONENTS} ztp policy" + +# Uncomment to activate Optical CyberSecurity +#export TFS_COMPONENTS="${TFS_COMPONENTS} dbscanserving opticalattackmitigator opticalattackdetector opticalattackmanager" + +# Uncomment to activate L3 CyberSecurity +#export TFS_COMPONENTS="${TFS_COMPONENTS} l3_attackmitigator l3_centralizedattackdetector" + +# Uncomment to activate InterDomain +export TFS_COMPONENTS="${TFS_COMPONENTS} interdomain" + +# Uncomment to activate DLT +export TFS_COMPONENTS="${TFS_COMPONENTS} dlt" + +# Uncomment to activate TE +#export TFS_COMPONENTS="${TFS_COMPONENTS} te" # 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. +# Set the name of the Kubernetes namespace to deploy TFS 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 +# Uncomment to monitor performance of components +#export TFS_EXTRA_MANIFESTS="${TFS_EXTRA_MANIFESTS} manifests/servicemonitors.yaml" + +# Uncomment when deploying Optical CyberSecurity +#export TFS_EXTRA_MANIFESTS="${TFS_EXTRA_MANIFESTS} manifests/cachingservice.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" +# 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 external port CockroackDB Postgre SQL interface will be exposed to. +export CRDB_EXT_PORT_SQL="26257" + +# Set the external port CockroackDB HTTP Mgmt GUI interface will be exposed to. +export CRDB_EXT_PORT_HTTP="8081" + +# 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_dom1" + +# 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 it exists. +export CRDB_DROP_DATABASE_IF_EXISTS="YES" + +# Disable flag for re-deploying CockroachDB from scratch. +export CRDB_REDEPLOY="" + + +# ----- NATS ------------------------------------------------------------------- + +# Set the namespace where NATS will be deployed. +export NATS_NAMESPACE="nats-dom1" + +# Set the external port NATS Client interface will be exposed to. +export NATS_EXT_PORT_CLIENT="4223" + +# Set the external port NATS HTTP Mgmt GUI interface will be exposed to. +export NATS_EXT_PORT_HTTP="8223" + +# Disable flag for re-deploying NATS from scratch. +export NATS_REDEPLOY="" + + +# ----- QuestDB ---------------------------------------------------------------- + +# Set the namespace where QuestDB will be deployed. +export QDB_NAMESPACE="qdb-dom1" + +# Set the external port QuestDB Postgre SQL interface will be exposed to. +export QDB_EXT_PORT_SQL="8813" + +# Set the external port QuestDB Influx Line Protocol interface will be exposed to. +export QDB_EXT_PORT_ILP="9011" + +# Set the external port QuestDB HTTP Mgmt GUI interface will be exposed to. +export QDB_EXT_PORT_HTTP="9001" + +# Set the database username to be used for QuestDB. +export QDB_USERNAME="admin" + +# Set the database user's password to be used for QuestDB. +export QDB_PASSWORD="quest" + +# Set the table name to be used by Monitoring for KPIs. +export QDB_TABLE_MONITORING_KPIS="tfs_monitoring_kpis" + +# Set the table name to be used by Slice for plotting groups. +export QDB_TABLE_SLICE_GROUPS="tfs_slice_groups" + +# Disable flag for dropping tables if they exist. +export QDB_DROP_TABLES_IF_EXIST="YES" + +# Disable flag for re-deploying QuestDB from scratch. +export QDB_REDEPLOY="" + + +# ----- K8s Observability ------------------------------------------------------ + +# Set the external port Prometheus Mgmt HTTP GUI interface will be exposed to. +export PROM_EXT_PORT_HTTP="9090" + +# Set the external port Grafana HTTP Dashboards will be exposed to. +export GRAF_EXT_PORT_HTTP="3000" diff --git a/src/tests/scenario2/deploy_specs_dom2.sh b/src/tests/scenario2/deploy_specs_dom2.sh index 7034c22cdcdc93b6c6fc0e5227e0ef38bda95a55..b97e5396646c1877b38626fec65860aeabfa853d 100755 --- a/src/tests/scenario2/deploy_specs_dom2.sh +++ b/src/tests/scenario2/deploy_specs_dom2.sh @@ -1,10 +1,11 @@ +#!/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 +# http://www.apache.org/licenses/LICENSE-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,24 +13,142 @@ # 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/" + +# ----- 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 pathcomp service slice dlt interdomain webui" +#export TFS_COMPONENTS="context device pathcomp service slice nbi webui load_generator" +export TFS_COMPONENTS="context device pathcomp service slice webui" + +# Uncomment to activate Monitoring +#export TFS_COMPONENTS="${TFS_COMPONENTS} monitoring" + +# Uncomment to activate ZTP and Policy Manager +#export TFS_COMPONENTS="${TFS_COMPONENTS} ztp policy" + +# Uncomment to activate Optical CyberSecurity +#export TFS_COMPONENTS="${TFS_COMPONENTS} dbscanserving opticalattackmitigator opticalattackdetector opticalattackmanager" + +# Uncomment to activate L3 CyberSecurity +#export TFS_COMPONENTS="${TFS_COMPONENTS} l3_attackmitigator l3_centralizedattackdetector" + +# Uncomment to activate InterDomain +export TFS_COMPONENTS="${TFS_COMPONENTS} interdomain" + +# Uncomment to activate DLT +export TFS_COMPONENTS="${TFS_COMPONENTS} dlt" + +# Uncomment to activate TE +#export TFS_COMPONENTS="${TFS_COMPONENTS} te" # 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. +# Set the name of the Kubernetes namespace to deploy TFS 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 +# Uncomment to monitor performance of components +#export TFS_EXTRA_MANIFESTS="${TFS_EXTRA_MANIFESTS} manifests/servicemonitors.yaml" + +# Uncomment when deploying Optical CyberSecurity +#export TFS_EXTRA_MANIFESTS="${TFS_EXTRA_MANIFESTS} manifests/cachingservice.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. +# Disable skip-build flag to rebuild the Docker images. export TFS_SKIP_BUILD="YES" + + +# ----- CockroachDB ------------------------------------------------------------ + +# Set the namespace where CockroackDB will be deployed. +export CRDB_NAMESPACE="crdb" + +# Set the external port CockroackDB Postgre SQL interface will be exposed to. +export CRDB_EXT_PORT_SQL="26257" + +# Set the external port CockroackDB HTTP Mgmt GUI interface will be exposed to. +export CRDB_EXT_PORT_HTTP="8081" + +# 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_dom2" + +# 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 it exists. +export CRDB_DROP_DATABASE_IF_EXISTS="YES" + +# Disable flag for re-deploying CockroachDB from scratch. +export CRDB_REDEPLOY="" + + +# ----- NATS ------------------------------------------------------------------- + +# Set the namespace where NATS will be deployed. +export NATS_NAMESPACE="nats-dom2" + +# Set the external port NATS Client interface will be exposed to. +export NATS_EXT_PORT_CLIENT="4224" + +# Set the external port NATS HTTP Mgmt GUI interface will be exposed to. +export NATS_EXT_PORT_HTTP="8224" + +# Disable flag for re-deploying NATS from scratch. +export NATS_REDEPLOY="" + + +# ----- QuestDB ---------------------------------------------------------------- + +# Set the namespace where QuestDB will be deployed. +export QDB_NAMESPACE="qdb-dom2" + +# Set the external port QuestDB Postgre SQL interface will be exposed to. +export QDB_EXT_PORT_SQL="8814" + +# Set the external port QuestDB Influx Line Protocol interface will be exposed to. +export QDB_EXT_PORT_ILP="9012" + +# Set the external port QuestDB HTTP Mgmt GUI interface will be exposed to. +export QDB_EXT_PORT_HTTP="9002" + +# Set the database username to be used for QuestDB. +export QDB_USERNAME="admin" + +# Set the database user's password to be used for QuestDB. +export QDB_PASSWORD="quest" + +# Set the table name to be used by Monitoring for KPIs. +export QDB_TABLE_MONITORING_KPIS="tfs_monitoring_kpis" + +# Set the table name to be used by Slice for plotting groups. +export QDB_TABLE_SLICE_GROUPS="tfs_slice_groups" + +# Disable flag for dropping tables if they exist. +export QDB_DROP_TABLES_IF_EXIST="YES" + +# Disable flag for re-deploying QuestDB from scratch. +export QDB_REDEPLOY="" + + +# ----- K8s Observability ------------------------------------------------------ + +# Set the external port Prometheus Mgmt HTTP GUI interface will be exposed to. +export PROM_EXT_PORT_HTTP="9090" + +# Set the external port Grafana HTTP Dashboards will be exposed to. +export GRAF_EXT_PORT_HTTP="3000" diff --git a/src/tests/scenario2/deploy_specs_dom3.sh b/src/tests/scenario2/deploy_specs_dom3.sh index 044301418405ba20dfaf00cd58f9a1a15e7e62a7..10192da237bec729e04b30e26eb11a8ae6b2980a 100755 --- a/src/tests/scenario2/deploy_specs_dom3.sh +++ b/src/tests/scenario2/deploy_specs_dom3.sh @@ -1,10 +1,11 @@ +#!/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 +# http://www.apache.org/licenses/LICENSE-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,24 +13,142 @@ # 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/" + +# ----- 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 pathcomp service slice dlt interdomain webui" +#export TFS_COMPONENTS="context device pathcomp service slice nbi webui load_generator" +export TFS_COMPONENTS="context device pathcomp service slice webui" + +# Uncomment to activate Monitoring +#export TFS_COMPONENTS="${TFS_COMPONENTS} monitoring" + +# Uncomment to activate ZTP and Policy Manager +#export TFS_COMPONENTS="${TFS_COMPONENTS} ztp policy" + +# Uncomment to activate Optical CyberSecurity +#export TFS_COMPONENTS="${TFS_COMPONENTS} dbscanserving opticalattackmitigator opticalattackdetector opticalattackmanager" + +# Uncomment to activate L3 CyberSecurity +#export TFS_COMPONENTS="${TFS_COMPONENTS} l3_attackmitigator l3_centralizedattackdetector" + +# Uncomment to activate InterDomain +export TFS_COMPONENTS="${TFS_COMPONENTS} interdomain" + +# Uncomment to activate DLT +export TFS_COMPONENTS="${TFS_COMPONENTS} dlt" + +# Uncomment to activate TE +#export TFS_COMPONENTS="${TFS_COMPONENTS} te" # 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. +# Set the name of the Kubernetes namespace to deploy TFS 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 +# Uncomment to monitor performance of components +#export TFS_EXTRA_MANIFESTS="${TFS_EXTRA_MANIFESTS} manifests/servicemonitors.yaml" + +# Uncomment when deploying Optical CyberSecurity +#export TFS_EXTRA_MANIFESTS="${TFS_EXTRA_MANIFESTS} manifests/cachingservice.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. +# Disable skip-build flag to rebuild the Docker images. export TFS_SKIP_BUILD="YES" + + +# ----- CockroachDB ------------------------------------------------------------ + +# Set the namespace where CockroackDB will be deployed. +export CRDB_NAMESPACE="crdb" + +# Set the external port CockroackDB Postgre SQL interface will be exposed to. +export CRDB_EXT_PORT_SQL="26257" + +# Set the external port CockroackDB HTTP Mgmt GUI interface will be exposed to. +export CRDB_EXT_PORT_HTTP="8081" + +# 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_dom3" + +# 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 it exists. +export CRDB_DROP_DATABASE_IF_EXISTS="YES" + +# Disable flag for re-deploying CockroachDB from scratch. +export CRDB_REDEPLOY="" + + +# ----- NATS ------------------------------------------------------------------- + +# Set the namespace where NATS will be deployed. +export NATS_NAMESPACE="nats-dom3" + +# Set the external port NATS Client interface will be exposed to. +export NATS_EXT_PORT_CLIENT="4225" + +# Set the external port NATS HTTP Mgmt GUI interface will be exposed to. +export NATS_EXT_PORT_HTTP="8225" + +# Disable flag for re-deploying NATS from scratch. +export NATS_REDEPLOY="" + + +# ----- QuestDB ---------------------------------------------------------------- + +# Set the namespace where QuestDB will be deployed. +export QDB_NAMESPACE="qdb-dom3" + +# Set the external port QuestDB Postgre SQL interface will be exposed to. +export QDB_EXT_PORT_SQL="8815" + +# Set the external port QuestDB Influx Line Protocol interface will be exposed to. +export QDB_EXT_PORT_ILP="9013" + +# Set the external port QuestDB HTTP Mgmt GUI interface will be exposed to. +export QDB_EXT_PORT_HTTP="9003" + +# Set the database username to be used for QuestDB. +export QDB_USERNAME="admin" + +# Set the database user's password to be used for QuestDB. +export QDB_PASSWORD="quest" + +# Set the table name to be used by Monitoring for KPIs. +export QDB_TABLE_MONITORING_KPIS="tfs_monitoring_kpis" + +# Set the table name to be used by Slice for plotting groups. +export QDB_TABLE_SLICE_GROUPS="tfs_slice_groups" + +# Disable flag for dropping tables if they exist. +export QDB_DROP_TABLES_IF_EXIST="YES" + +# Disable flag for re-deploying QuestDB from scratch. +export QDB_REDEPLOY="" + + +# ----- K8s Observability ------------------------------------------------------ + +# Set the external port Prometheus Mgmt HTTP GUI interface will be exposed to. +export PROM_EXT_PORT_HTTP="9090" + +# Set the external port Grafana HTTP Dashboards will be exposed to. +export GRAF_EXT_PORT_HTTP="3000" diff --git a/src/tests/scenario2/deploy_specs_dom4.sh b/src/tests/scenario2/deploy_specs_dom4.sh index 9e26ace470c81b0bdccfa83bf4eb7369970c981b..d422c22478d7378352ca3426eff436e1c0a6b080 100755 --- a/src/tests/scenario2/deploy_specs_dom4.sh +++ b/src/tests/scenario2/deploy_specs_dom4.sh @@ -1,10 +1,11 @@ +#!/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 +# http://www.apache.org/licenses/LICENSE-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,24 +13,142 @@ # 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/" + +# ----- 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 pathcomp service slice dlt interdomain webui" +#export TFS_COMPONENTS="context device pathcomp service slice nbi webui load_generator" +export TFS_COMPONENTS="context device pathcomp service slice webui" + +# Uncomment to activate Monitoring +#export TFS_COMPONENTS="${TFS_COMPONENTS} monitoring" + +# Uncomment to activate ZTP and Policy Manager +#export TFS_COMPONENTS="${TFS_COMPONENTS} ztp policy" + +# Uncomment to activate Optical CyberSecurity +#export TFS_COMPONENTS="${TFS_COMPONENTS} dbscanserving opticalattackmitigator opticalattackdetector opticalattackmanager" + +# Uncomment to activate L3 CyberSecurity +#export TFS_COMPONENTS="${TFS_COMPONENTS} l3_attackmitigator l3_centralizedattackdetector" + +# Uncomment to activate InterDomain +export TFS_COMPONENTS="${TFS_COMPONENTS} interdomain" + +# Uncomment to activate DLT +export TFS_COMPONENTS="${TFS_COMPONENTS} dlt" + +# Uncomment to activate TE +#export TFS_COMPONENTS="${TFS_COMPONENTS} te" # 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. +# Set the name of the Kubernetes namespace to deploy TFS 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 +# Uncomment to monitor performance of components +#export TFS_EXTRA_MANIFESTS="${TFS_EXTRA_MANIFESTS} manifests/servicemonitors.yaml" + +# Uncomment when deploying Optical CyberSecurity +#export TFS_EXTRA_MANIFESTS="${TFS_EXTRA_MANIFESTS} manifests/cachingservice.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. +# Disable skip-build flag to rebuild the Docker images. export TFS_SKIP_BUILD="YES" + + +# ----- CockroachDB ------------------------------------------------------------ + +# Set the namespace where CockroackDB will be deployed. +export CRDB_NAMESPACE="crdb" + +# Set the external port CockroackDB Postgre SQL interface will be exposed to. +export CRDB_EXT_PORT_SQL="26257" + +# Set the external port CockroackDB HTTP Mgmt GUI interface will be exposed to. +export CRDB_EXT_PORT_HTTP="8081" + +# 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_dom4" + +# 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 it exists. +export CRDB_DROP_DATABASE_IF_EXISTS="YES" + +# Disable flag for re-deploying CockroachDB from scratch. +export CRDB_REDEPLOY="" + + +# ----- NATS ------------------------------------------------------------------- + +# Set the namespace where NATS will be deployed. +export NATS_NAMESPACE="nats-dom4" + +# Set the external port NATS Client interface will be exposed to. +export NATS_EXT_PORT_CLIENT="4226" + +# Set the external port NATS HTTP Mgmt GUI interface will be exposed to. +export NATS_EXT_PORT_HTTP="8226" + +# Disable flag for re-deploying NATS from scratch. +export NATS_REDEPLOY="" + + +# ----- QuestDB ---------------------------------------------------------------- + +# Set the namespace where QuestDB will be deployed. +export QDB_NAMESPACE="qdb-dom4" + +# Set the external port QuestDB Postgre SQL interface will be exposed to. +export QDB_EXT_PORT_SQL="8816" + +# Set the external port QuestDB Influx Line Protocol interface will be exposed to. +export QDB_EXT_PORT_ILP="9014" + +# Set the external port QuestDB HTTP Mgmt GUI interface will be exposed to. +export QDB_EXT_PORT_HTTP="9004" + +# Set the database username to be used for QuestDB. +export QDB_USERNAME="admin" + +# Set the database user's password to be used for QuestDB. +export QDB_PASSWORD="quest" + +# Set the table name to be used by Monitoring for KPIs. +export QDB_TABLE_MONITORING_KPIS="tfs_monitoring_kpis" + +# Set the table name to be used by Slice for plotting groups. +export QDB_TABLE_SLICE_GROUPS="tfs_slice_groups" + +# Disable flag for dropping tables if they exist. +export QDB_DROP_TABLES_IF_EXIST="YES" + +# Disable flag for re-deploying QuestDB from scratch. +export QDB_REDEPLOY="" + + +# ----- K8s Observability ------------------------------------------------------ + +# Set the external port Prometheus Mgmt HTTP GUI interface will be exposed to. +export PROM_EXT_PORT_HTTP="9090" + +# Set the external port Grafana HTTP Dashboards will be exposed to. +export GRAF_EXT_PORT_HTTP="3000" diff --git a/src/tests/scenario2/dump_logs.sh b/src/tests/scenario2/dump_logs.sh index 7b1dc9d17aabcf8866b76ed1acdb367eee0e3b51..c7acedbf613b66f3ec08bd1628e8e1ab76b9bc5e 100755 --- a/src/tests/scenario2/dump_logs.sh +++ b/src/tests/scenario2/dump_logs.sh @@ -13,64 +13,70 @@ # 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 +rm -rf tmp/tfs-bchain/exec +mkdir -p tmp/tfs-bchain/exec +kubectl --namespace tfs-bchain logs deployments/mock-blockchain server > tmp/tfs-bchain/exec/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 +rm -rf tmp/tfs-dom1/exec +mkdir -p tmp/tfs-dom1/exec +kubectl --namespace tfs-dom1 logs deployments/contextservice server > tmp/tfs-dom1/exec/context.log +kubectl --namespace tfs-dom1 logs deployments/deviceservice server > tmp/tfs-dom1/exec/device.log +kubectl --namespace tfs-dom1 logs deployments/serviceservice server > tmp/tfs-dom1/exec/service.log +kubectl --namespace tfs-dom1 logs deployments/pathcompservice frontend > tmp/tfs-dom1/exec/pathcomp-frontend.log +kubectl --namespace tfs-dom1 logs deployments/pathcompservice backend > tmp/tfs-dom1/exec/pathcomp-backend.log +kubectl --namespace tfs-dom1 logs deployments/sliceservice server > tmp/tfs-dom1/exec/slice.log +kubectl --namespace tfs-dom1 logs deployments/interdomainservice server > tmp/tfs-dom1/exec/interdomain.log +kubectl --namespace tfs-dom1 logs deployments/dltservice connector > tmp/tfs-dom1/exec/dlt-connector.log +kubectl --namespace tfs-dom1 logs deployments/dltservice gateway > tmp/tfs-dom1/exec/dlt-gateway.log +kubectl --namespace tfs-dom1 logs deployments/webuiservice server > tmp/tfs-dom1/exec/webui.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 +rm -rf tmp/tfs-dom2/exec +mkdir -p tmp/tfs-dom2/exec +kubectl --namespace tfs-dom2 logs deployments/contextservice server > tmp/tfs-dom2/exec/context.log +kubectl --namespace tfs-dom2 logs deployments/deviceservice server > tmp/tfs-dom2/exec/device.log +kubectl --namespace tfs-dom2 logs deployments/serviceservice server > tmp/tfs-dom2/exec/service.log +kubectl --namespace tfs-dom2 logs deployments/pathcompservice frontend > tmp/tfs-dom2/exec/pathcomp-frontend.log +kubectl --namespace tfs-dom2 logs deployments/pathcompservice backend > tmp/tfs-dom2/exec/pathcomp-backend.log +kubectl --namespace tfs-dom2 logs deployments/sliceservice server > tmp/tfs-dom2/exec/slice.log +kubectl --namespace tfs-dom2 logs deployments/interdomainservice server > tmp/tfs-dom2/exec/interdomain.log +kubectl --namespace tfs-dom2 logs deployments/dltservice connector > tmp/tfs-dom2/exec/dlt-connector.log +kubectl --namespace tfs-dom2 logs deployments/dltservice gateway > tmp/tfs-dom2/exec/dlt-gateway.log +kubectl --namespace tfs-dom2 logs deployments/webuiservice server > tmp/tfs-dom2/exec/webui.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 +rm -rf tmp/tfs-dom3/exec +mkdir -p tmp/tfs-dom3/exec +kubectl --namespace tfs-dom3 logs deployments/contextservice server > tmp/tfs-dom3/exec/context.log +kubectl --namespace tfs-dom3 logs deployments/deviceservice server > tmp/tfs-dom3/exec/device.log +kubectl --namespace tfs-dom3 logs deployments/serviceservice server > tmp/tfs-dom3/exec/service.log +kubectl --namespace tfs-dom3 logs deployments/pathcompservice frontend > tmp/tfs-dom3/exec/pathcomp-frontend.log +kubectl --namespace tfs-dom3 logs deployments/pathcompservice backend > tmp/tfs-dom3/exec/pathcomp-backend.log +kubectl --namespace tfs-dom3 logs deployments/sliceservice server > tmp/tfs-dom3/exec/slice.log +kubectl --namespace tfs-dom3 logs deployments/interdomainservice server > tmp/tfs-dom3/exec/interdomain.log +kubectl --namespace tfs-dom3 logs deployments/dltservice connector > tmp/tfs-dom3/exec/dlt-connector.log +kubectl --namespace tfs-dom3 logs deployments/dltservice gateway > tmp/tfs-dom3/exec/dlt-gateway.log +kubectl --namespace tfs-dom3 logs deployments/webuiservice server > tmp/tfs-dom3/exec/webui.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 +rm -rf tmp/tfs-dom4/exec +mkdir -p tmp/tfs-dom4/exec +kubectl --namespace tfs-dom4 logs deployments/contextservice server > tmp/tfs-dom4/exec/context.log +kubectl --namespace tfs-dom4 logs deployments/deviceservice server > tmp/tfs-dom4/exec/device.log +kubectl --namespace tfs-dom4 logs deployments/serviceservice server > tmp/tfs-dom4/exec/service.log +kubectl --namespace tfs-dom4 logs deployments/pathcompservice frontend > tmp/tfs-dom4/exec/pathcomp-frontend.log +kubectl --namespace tfs-dom4 logs deployments/pathcompservice backend > tmp/tfs-dom4/exec/pathcomp-backend.log +kubectl --namespace tfs-dom4 logs deployments/sliceservice server > tmp/tfs-dom4/exec/slice.log +kubectl --namespace tfs-dom4 logs deployments/interdomainservice server > tmp/tfs-dom4/exec/interdomain.log +kubectl --namespace tfs-dom4 logs deployments/dltservice connector > tmp/tfs-dom4/exec/dlt-connector.log +kubectl --namespace tfs-dom4 logs deployments/dltservice gateway > tmp/tfs-dom4/exec/dlt-gateway.log +kubectl --namespace tfs-dom4 logs deployments/webuiservice server > tmp/tfs-dom4/exec/webui.log printf "\n" echo "Done!" diff --git a/src/tests/scenario2/old_tests/tests/Fixtures.py b/src/tests/scenario2/old_tests/tests/Fixtures.py index 225147fc0cd243060e07163df46403965d7a74ab..b56fd442a2776e51b9c18b18dc52403d8d6e68c5 100644 --- a/src/tests/scenario2/old_tests/tests/Fixtures.py +++ b/src/tests/scenario2/old_tests/tests/Fixtures.py @@ -15,14 +15,14 @@ import pytest from common.Settings import get_setting from common.proto.monitoring_pb2 import AlarmDescriptor, AlarmSubscription -from compute.tests.mock_osm.MockOSM import MockOSM +from nbi.tests.mock_osm.MockOSM import MockOSM from .Objects import WIM_MAPPING, WIM_PASSWORD, WIM_USERNAME @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'))) + get_setting('NBISERVICE_SERVICE_HOST'), str(get_setting('NBISERVICE_SERVICE_PORT_HTTP'))) return MockOSM(wim_url, WIM_MAPPING, WIM_USERNAME, WIM_PASSWORD) @pytest.fixture(scope='session') diff --git a/src/tests/scenario2/old_tests/tests/test_functional_bootstrap.py b/src/tests/scenario2/old_tests/tests/test_functional_bootstrap.py index cfe21603de85862e83d7dd8b9fb4eebefd99b702..cb1d8318da37725b5adf66b5dc06e454c48f4e53 100644 --- a/src/tests/scenario2/old_tests/tests/test_functional_bootstrap.py +++ b/src/tests/scenario2/old_tests/tests/test_functional_bootstrap.py @@ -117,7 +117,7 @@ def test_devices_bootstraping( assert response.device_uuid.uuid == device_uuid #expected_events.extend([ - # # Device creation, update for automation to start the device + # # Device creation, update for ztp to start the device # ('DeviceEvent', EVENT_CREATE, json_device_id(device_uuid)), # #('DeviceEvent', EVENT_UPDATE, json_device_id(device_uuid)), #]) @@ -216,4 +216,4 @@ def test_scenario_alarms_created(monitoring_client: MonitoringClient, alarm_desc monitoring_client.SetKpiAlarm(new_alarm_descriptor) response: AlarmList = monitoring_client.GetAlarms(Empty()) - assert len(response.alarm_descriptor) == 16 \ No newline at end of file + assert len(response.alarm_descriptor) == 16 diff --git a/src/tests/scenario2/old_tests/tests/test_functional_create_service.py b/src/tests/scenario2/old_tests/tests/test_functional_create_service.py index bc91b70d99313101211e3f49074a26d37067f8c0..550994c2c123cc84695240c8fd3fbb3e2c9e6480 100644 --- a/src/tests/scenario2/old_tests/tests/test_functional_create_service.py +++ b/src/tests/scenario2/old_tests/tests/test_functional_create_service.py @@ -21,7 +21,7 @@ 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 compute.tests.mock_osm.MockOSM import MockOSM +from nbi.tests.mock_osm.MockOSM import MockOSM from context.client.ContextClient import ContextClient from monitoring.client.MonitoringClient import MonitoringClient from context.client.EventsCollector import EventsCollector diff --git a/src/tests/scenario2/old_tests/tests/test_functional_delete_service.py b/src/tests/scenario2/old_tests/tests/test_functional_delete_service.py index 58869a2e0d7bd422c75ba165a192043b77c98a7f..12a032e02bb8efbb8a000e498e77300231e4f246 100644 --- a/src/tests/scenario2/old_tests/tests/test_functional_delete_service.py +++ b/src/tests/scenario2/old_tests/tests/test_functional_delete_service.py @@ -20,7 +20,7 @@ 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 compute.tests.mock_osm.MockOSM import MockOSM +from nbi.tests.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 diff --git a/src/tests/scenario2/reset.sh b/src/tests/scenario2/reset.sh index 5f4a3b8e5b8a58d8f2acf7c60cde1e77c2e1873a..f9e7ecab2d4693ef161ae9349e13a3ad0200c97c 100755 --- a/src/tests/scenario2/reset.sh +++ b/src/tests/scenario2/reset.sh @@ -14,10 +14,38 @@ # limitations under the License. +# Destroy all replicas of all microservices + 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-dom2 scale --replicas=0 \ + deployment/contextservice deployment/deviceservice deployment/pathcompservice deployment/serviceservice \ + deployment/sliceservice deployment/dltservice deployment/interdomainservice deployment/webuiservice + +kubectl --namespace tfs-dom3 scale --replicas=0 \ + deployment/contextservice deployment/deviceservice deployment/pathcompservice deployment/serviceservice \ + deployment/sliceservice deployment/dltservice deployment/interdomainservice deployment/webuiservice + +kubectl --namespace tfs-dom4 scale --replicas=0 \ + deployment/contextservice deployment/deviceservice deployment/pathcompservice deployment/serviceservice \ + deployment/sliceservice deployment/dltservice deployment/interdomainservice deployment/webuiservice + +# Create a single replica per microservice + kubectl --namespace tfs-dom1 scale --replicas=1 \ deployment/contextservice deployment/deviceservice deployment/pathcompservice deployment/serviceservice \ deployment/sliceservice deployment/dltservice deployment/interdomainservice deployment/webuiservice + +kubectl --namespace tfs-dom2 scale --replicas=1 \ + deployment/contextservice deployment/deviceservice deployment/pathcompservice deployment/serviceservice \ + deployment/sliceservice deployment/dltservice deployment/interdomainservice deployment/webuiservice + +kubectl --namespace tfs-dom3 scale --replicas=1 \ + deployment/contextservice deployment/deviceservice deployment/pathcompservice deployment/serviceservice \ + deployment/sliceservice deployment/dltservice deployment/interdomainservice deployment/webuiservice + +kubectl --namespace tfs-dom4 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 index 2aa8de873cf22e75be830c713fc379df9df154a4..20bbfaacef39b7b9b9c18facc3e20382e526377a 100755 --- a/src/tests/scenario2/show_deploy.sh +++ b/src/tests/scenario2/show_deploy.sh @@ -24,3 +24,27 @@ printf "\n" echo "Deployment Ingress:" kubectl --namespace tfs-dom1 get ingress printf "\n" + +echo "Deployment Resources:" +kubectl --namespace tfs-dom2 get all +printf "\n" + +echo "Deployment Ingress:" +kubectl --namespace tfs-dom2 get ingress +printf "\n" + +echo "Deployment Resources:" +kubectl --namespace tfs-dom3 get all +printf "\n" + +echo "Deployment Ingress:" +kubectl --namespace tfs-dom3 get ingress +printf "\n" + +echo "Deployment Resources:" +kubectl --namespace tfs-dom4 get all +printf "\n" + +echo "Deployment Ingress:" +kubectl --namespace tfs-dom4 get ingress +printf "\n" diff --git a/src/tests/scenario2/tfs-ingress-dom1.yaml b/src/tests/scenario2/tfs-ingress-dom1.yaml index c638377ee5469d861b22908af0e2b7c1d5d0abf6..7cacee1d1f7f1d6c3f36f71ecb5fea32fdcf89b6 100644 --- a/src/tests/scenario2/tfs-ingress-dom1.yaml +++ b/src/tests/scenario2/tfs-ingress-dom1.yaml @@ -48,6 +48,6 @@ spec: pathType: Prefix backend: service: - name: computeservice + name: nbiservice port: number: 8080 diff --git a/src/tests/scenario2/tfs-ingress-dom2.yaml b/src/tests/scenario2/tfs-ingress-dom2.yaml index d07b73ee2a94d6ed54b4b5658c595e1ce635bddb..f6a08de12c4720f0bc75a76215b2a3cdc40eddfe 100644 --- a/src/tests/scenario2/tfs-ingress-dom2.yaml +++ b/src/tests/scenario2/tfs-ingress-dom2.yaml @@ -48,6 +48,6 @@ spec: pathType: Prefix backend: service: - name: computeservice + name: nbiservice port: number: 8080 diff --git a/src/tests/scenario2/tfs-ingress-dom3.yaml b/src/tests/scenario2/tfs-ingress-dom3.yaml index 1c28c0eba275f3ce605c3824e0f2281081d28d7f..f27a183f023aa2ca505dac74c8ea385b8acd2520 100644 --- a/src/tests/scenario2/tfs-ingress-dom3.yaml +++ b/src/tests/scenario2/tfs-ingress-dom3.yaml @@ -48,6 +48,6 @@ spec: pathType: Prefix backend: service: - name: computeservice + name: nbiservice port: number: 8080 diff --git a/src/tests/scenario2/tfs-ingress-dom4.yaml b/src/tests/scenario2/tfs-ingress-dom4.yaml index 48718d775583e83e55ee3ab3a3b794ce8f0c43ef..dfbe81d06bdc47d482f64c8a09c4916c0d5ad64a 100644 --- a/src/tests/scenario2/tfs-ingress-dom4.yaml +++ b/src/tests/scenario2/tfs-ingress-dom4.yaml @@ -48,6 +48,6 @@ spec: pathType: Prefix backend: service: - name: computeservice + name: nbiservice port: number: 8080 diff --git a/src/tests/scenario3/l3/deploy.sh b/src/tests/scenario3/l3/deploy.sh index e8e02b026d42ea16d5df29da8a15c291f421e52c..4f4f8baed2c29b290142f30960f8432926cef6a8 100755 --- a/src/tests/scenario3/l3/deploy.sh +++ b/src/tests/scenario3/l3/deploy.sh @@ -13,7 +13,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -source deploy_specs.sh +source src/tests/scenario3/l3/deploy_specs.sh ./deploy/all.sh source tfs_runtime_env_vars.sh ofc22/run_test_01_bootstrap.sh diff --git a/src/tests/scenario3/l3/deploy_specs.sh b/src/tests/scenario3/l3/deploy_specs.sh index 8c8264fca75d471c3bbbf0cb523c7a17bcffa5a0..72cc56303585fe0222d020c765e86c68944f2951 100644 --- a/src/tests/scenario3/l3/deploy_specs.sh +++ b/src/tests/scenario3/l3/deploy_specs.sh @@ -20,14 +20,14 @@ 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 pathcomp service slice compute webui load_generator" +#export TFS_COMPONENTS="context device pathcomp service slice nbi webui load_generator" export TFS_COMPONENTS="context device pathcomp service slice webui" # Uncomment to activate Monitoring export TFS_COMPONENTS="${TFS_COMPONENTS} monitoring" -# Uncomment to activate Automation and Policy Manager -#export TFS_COMPONENTS="${TFS_COMPONENTS} automation policy" +# Uncomment to activate ZTP and Policy Manager +#export TFS_COMPONENTS="${TFS_COMPONENTS} ztp policy" # Uncomment to activate Optical CyberSecurity #export TFS_COMPONENTS="${TFS_COMPONENTS} dbscanserving opticalattackmitigator opticalattackdetector opticalattackmanager" diff --git a/src/tests/scenario3/optical/deploy_specs.sh b/src/tests/scenario3/optical/deploy_specs.sh index 73c9112254c3e95eea4155abd7afd26ee358e368..30434341e3fd8f3d4ee62e290521ef04b6f9f25d 100644 --- a/src/tests/scenario3/optical/deploy_specs.sh +++ b/src/tests/scenario3/optical/deploy_specs.sh @@ -17,7 +17,7 @@ # ----- TeraFlowSDN ------------------------------------------------------------ # Set the list of components, separated by spaces, you want to build images for, and deploy. -export TFS_COMPONENTS="context device automation monitoring pathcomp service slice compute webui load_generator" +export TFS_COMPONENTS="context device ztp monitoring pathcomp service slice nbi webui load_generator" # addition for the optical cybersecurity component export TFS_COMPONENTS="${TFS_COMPONENTS} dbscanserving opticalattackmitigator opticalattackdetector opticalattackmanager" diff --git a/src/tests/tools/mock_flexscale_opt_ctrl/MockFlexscaleOptCtrl.py b/src/tests/tools/mock_flexscale_opt_ctrl/MockFlexscaleOptCtrl.py new file mode 100644 index 0000000000000000000000000000000000000000..c4cc2b69911b99600c79b61d3634427268827b66 --- /dev/null +++ b/src/tests/tools/mock_flexscale_opt_ctrl/MockFlexscaleOptCtrl.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 functools, logging, sys, time +from flask import Flask, jsonify, make_response, request +from flask_restful import Api, Resource +from data import ADDLIGHTPATH_REPLY + +BIND_ADDRESS = '0.0.0.0' +BIND_PORT = 8443 +BASE_URL = '/OpticalTFS' +STR_ENDPOINT = 'https://{:s}:{:s}{:s}'.format(str(BIND_ADDRESS), str(BIND_PORT), str(BASE_URL)) +LOG_LEVEL = logging.DEBUG + + +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 AddLightpath(Resource): + def put(self, src_node: str, dst_node: str, bitrate: int): + return make_response(jsonify(ADDLIGHTPATH_REPLY), 200) + +class DelLightpath(Resource): + def delete(self, flow_id: str, src_node: str, dst_node: str, bitrate: int): + return make_response(jsonify({}), 200) + +class GetLightpaths(Resource): + def get(self): + return make_response(jsonify({}), 200) + +class GetLinks(Resource): + def get(self): + return make_response(jsonify({}), 200) + + +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(AddLightpath, '/AddLightpath///') + api.add_resource(DelLightpath, '/DelLightpath////') + api.add_resource(GetLightpaths, '/GetLightpaths') + api.add_resource(GetLinks, '/GetLinks') + + LOGGER.info('Listening on {:s}...'.format(str(STR_ENDPOINT))) + app.run(debug=True, host=BIND_ADDRESS, port=BIND_PORT) + + LOGGER.info('Bye') + return 0 + +if __name__ == '__main__': + sys.exit(main()) diff --git a/src/tests/tools/mock_flexscale_opt_ctrl/data.py b/src/tests/tools/mock_flexscale_opt_ctrl/data.py new file mode 100644 index 0000000000000000000000000000000000000000..20a0340165e56b71d6fdf016246fe59b1a9ddc71 --- /dev/null +++ b/src/tests/tools/mock_flexscale_opt_ctrl/data.py @@ -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. + + +ADDLIGHTPATH_REPLY = { + "flow_id": 1, + "src": "t1", + "dst": "t2", + "bitrate": 100, + "bidir": 1, + "flows": { + "t1": [ + { + "in": 0, + "out": "1" + }, + { + "in": "1", + "out": 0 + } + ], + "r1": [ + { + "in": "101R", + "out": "1T" + }, + { + "in": "1R", + "out": "101T" + } + ], + "r2": [ + { + "in": "1R", + "out": "101T" + }, + { + "in": "101R", + "out": "1T" + } + ], + "t2": [ + { + "in": "1", + "out": 0 + }, + { + "in": 0, + "out": "1" + } + ] + }, + "band_type": "c_slots", + "slots": [ + 1, + 2, + 3, + 4 + ], + "fiber_forward": { + "t1-r1": "M1", + "r1-r2": "d1-1", + "r2-t2": "S1" + }, + "fiber_backward": { + "r1-t1": "S1", + "r2-r1": "d1-1", + "t2-r2": "M1" + }, + "op-mode": 1, + "n_slots": 4, + "links": [ + "t1-r1", + "r1-r2", + "r2-t2" + ], + "path": [ + "t1", + "r1", + "r2", + "t2" + ], + "band": 50, + "freq": 192031.25, + "is_active": True +} + diff --git a/src/tests/tools/mock_flexscale_opt_ctrl/run.sh b/src/tests/tools/mock_flexscale_opt_ctrl/run.sh new file mode 100755 index 0000000000000000000000000000000000000000..183df7a030dca352ee2bb5fdfd0ac081cdcec960 --- /dev/null +++ b/src/tests/tools/mock_flexscale_opt_ctrl/run.sh @@ -0,0 +1,16 @@ +#!/usr/bin/env 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. + +python MockFlexscaleOptCtrl.py diff --git a/src/tests/tools/mock_mw_sdn_ctrl/scenario/microwave_deploy.sh b/src/tests/tools/mock_mw_sdn_ctrl/scenario/microwave_deploy.sh index fb0629dc4ce600f7bea058a7bcfbbd261ac157cb..665d337c94b0d4ec1378b1c3fffaa637fe26cd8a 100755 --- a/src/tests/tools/mock_mw_sdn_ctrl/scenario/microwave_deploy.sh +++ b/src/tests/tools/mock_mw_sdn_ctrl/scenario/microwave_deploy.sh @@ -17,7 +17,7 @@ export TFS_REGISTRY_IMAGE="http://localhost:32000/tfs/" # Set the list of components, separated by spaces, you want to build images for, and deploy. # Supported components are: -# context device automation policy service compute monitoring webui +# context device ztp policy service nbi monitoring webui # interdomain slice pathcomp dlt # dbscanserving opticalattackmitigator opticalattackdetector # l3_attackmitigator l3_centralizedattackdetector l3_distributedattackdetector diff --git a/src/tests/tools/mock_mw_sdn_ctrl/ssl_not_working/Dockerfile b/src/tests/tools/mock_mw_sdn_ctrl/ssl_not_working/Dockerfile index ad214b97c091bf82a8bfe5c0ce4183d0bae2766e..70fc81e5408d49ae332132612d0f86c1d5901e38 100644 --- a/src/tests/tools/mock_mw_sdn_ctrl/ssl_not_working/Dockerfile +++ b/src/tests/tools/mock_mw_sdn_ctrl/ssl_not_working/Dockerfile @@ -22,7 +22,7 @@ RUN python3 -m pip install --upgrade pip RUN python3 -m pip install --upgrade setuptools wheel RUN python3 -m pip install --upgrade pip-tools -# Create component sub-folder, and copy content +# Create component sub-folders, and copy content RUN mkdir -p /var/teraflow/mock_mw_sdn_ctrl WORKDIR /var/teraflow/mock_mw_sdn_ctrl COPY . . diff --git a/src/webui/Dockerfile b/src/webui/Dockerfile index 2a1510954dbd2a9b0817f94145baaa22ac9d3a3f..ab0b2c4418dab4004792d4d8932d635cb42f734b 100644 --- a/src/webui/Dockerfile +++ b/src/webui/Dockerfile @@ -18,7 +18,7 @@ FROM python:3.9-slim # Install dependencies # RUN apt-get --yes --quiet --quiet update && \ -# apt-get --yes --quiet --quiet install wget g++ && \ +# apt-get --yes --quiet --quiet install wget g++ git && \ # rm -rf /var/lib/apt/lists/* # Set Python to show logs as they occur diff --git a/src/webui/requirements.in b/src/webui/requirements.in index d9de647f1225f0f2a58bf4322ae5ca4b19f5329c..2c638a223c6b45eecaf7479bdf249954e6bc8543 100644 --- a/src/webui/requirements.in +++ b/src/webui/requirements.in @@ -17,4 +17,4 @@ Flask-WTF==1.0.0 flask-healthz==0.0.3 flask-unittest==0.1.2 lorem-text==2.1 -APScheduler==3.8.1 +werkzeug==2.3.7 diff --git a/src/webui/service/device/forms.py b/src/webui/service/device/forms.py index e884e96a511ab90625bda257075c80adce4406cd..bcd5804d32927763344d08371320fdde5f2fcab7 100644 --- a/src/webui/service/device/forms.py +++ b/src/webui/service/device/forms.py @@ -27,7 +27,7 @@ class AddDeviceForm(FlaskForm): device_drivers_transport_api = BooleanField('TRANSPORT_API') device_drivers_p4 = BooleanField('P4') device_drivers_ietf_network_topology = BooleanField('IETF_NETWORK_TOPOLOGY') - device_drivers_onf_tr_352 = BooleanField('ONF_TR_352') + device_drivers_onf_tr_532 = BooleanField('ONF_TR_532') device_drivers_xr = BooleanField('XR') device_drivers_ietf_l2vpn = BooleanField('IETF L2VPN') device_drivers_gnmi_openconfig = BooleanField('GNMI OPENCONFIG') diff --git a/src/webui/service/device/routes.py b/src/webui/service/device/routes.py index 4590c7f01a24e801ecc775ad0b22cf0dcdea3452..4459deeebd000642cfe235f4f46ebf65670ae2ee 100644 --- a/src/webui/service/device/routes.py +++ b/src/webui/service/device/routes.py @@ -65,6 +65,7 @@ def add(): (DeviceOperationalStatusEnum.Value(key), key.replace('DEVICEOPERATIONALSTATUS_', ''))) # items for Device Type field + form.device_type.choices = [] for device_type in DeviceTypeEnum: form.device_type.choices.append((device_type.value,device_type.value)) @@ -116,8 +117,8 @@ def add(): device_drivers.append(DeviceDriverEnum.DEVICEDRIVER_P4) if form.device_drivers_ietf_network_topology.data: device_drivers.append(DeviceDriverEnum.DEVICEDRIVER_IETF_NETWORK_TOPOLOGY) - if form.device_drivers_onf_tr_352.data: - device_drivers.append(DeviceDriverEnum.DEVICEDRIVER_ONF_TR_352) + if form.device_drivers_onf_tr_532.data: + device_drivers.append(DeviceDriverEnum.DEVICEDRIVER_ONF_TR_532) if form.device_drivers_xr.data: device_drivers.append(DeviceDriverEnum.DEVICEDRIVER_XR) if form.device_drivers_ietf_l2vpn.data: @@ -149,6 +150,16 @@ def detail(device_uuid: str): return render_template( 'device/detail.html', device=device_obj, dde=DeviceDriverEnum, dose=DeviceOperationalStatusEnum) + +@device.route('inventory/', methods=['GET', 'POST']) +def inventory(device_uuid: str): + context_client.connect() + device_obj = get_device(context_client, device_uuid, rw_copy=False) + if device_obj is None: + flash('Device({:s}) not found'.format(str(device_uuid)), 'danger') + device_obj = Device() + context_client.close() + return render_template('device/inventory.html', device=device_obj) @device.get('/delete') def delete(device_uuid): diff --git a/src/webui/service/static/topology_icons/Acknowledgements.txt b/src/webui/service/static/topology_icons/Acknowledgements.txt index de69c89cee25dc93856761ac2dd08d9988a35095..43ecee79806682317bd5d2a8ebff16bac8767220 100644 --- a/src/webui/service/static/topology_icons/Acknowledgements.txt +++ b/src/webui/service/static/topology_icons/Acknowledgements.txt @@ -28,6 +28,8 @@ https://symbols.getvecta.com/stencil_241/289_wae.216d930c17.png => emu-optical-t https://symbols.getvecta.com/stencil_240/128_localdirector.c1e561769f.png => optical-splitter.png https://symbols.getvecta.com/stencil_241/158_local-director.6b38eab9e4.png => emu-optical-splitter.png - https://symbols.getvecta.com/stencil_240/197_radio-tower.b6138c8c29.png => radio-router.png -https://symbols.getvecta.com/stencil_241/216_radio-tower.5159339bc0.png => emu-radio-router.png \ No newline at end of file +https://symbols.getvecta.com/stencil_241/216_radio-tower.5159339bc0.png => emu-radio-router.png + +https://symbols.getvecta.com/stencil_240/124_laptop.be264ceb77.png => laptop.png +https://symbols.getvecta.com/stencil_241/154_laptop.c01910b6c8.png => emu-laptop.png diff --git a/src/webui/service/static/topology_icons/client.png b/src/webui/service/static/topology_icons/client.png new file mode 100644 index 0000000000000000000000000000000000000000..e017c59aea31de5a9112ec89e5cb4d6cbc009ba6 Binary files /dev/null and b/src/webui/service/static/topology_icons/client.png differ diff --git a/src/webui/service/static/topology_icons/emu-client.png b/src/webui/service/static/topology_icons/emu-client.png new file mode 100644 index 0000000000000000000000000000000000000000..0c75b47e062c9dae0d3dee74c89ac22a97c93077 Binary files /dev/null and b/src/webui/service/static/topology_icons/emu-client.png differ diff --git a/src/webui/service/templates/device/add.html b/src/webui/service/templates/device/add.html index c9165667dd8c089e91400f652177b4ca4ec98010..c115657aa08828849172345ca50caaeb4150fe0f 100644 --- a/src/webui/service/templates/device/add.html +++ b/src/webui/service/templates/device/add.html @@ -87,7 +87,7 @@
{{ form.device_drivers_p4 }} {{ form.device_drivers_p4.label(class="col-sm-3 col-form-label") }} {{ form.device_drivers_ietf_network_topology }} {{form.device_drivers_ietf_network_topology.label(class="col-sm-3 col-form-label") }} - {{ form.device_drivers_onf_tr_352 }} {{ form.device_drivers_onf_tr_352.label(class="col-sm-3 col-form-label") }} + {{ form.device_drivers_onf_tr_532 }} {{ form.device_drivers_onf_tr_532.label(class="col-sm-3 col-form-label") }}
{{ form.device_drivers_xr }} {{ form.device_drivers_xr.label(class="col-sm-3 col-form-label") }} {{ form.device_drivers_ietf_l2vpn }} {{ form.device_drivers_ietf_l2vpn.label(class="col-sm-3 col-form-label") }} diff --git a/src/webui/service/templates/device/detail.html b/src/webui/service/templates/device/detail.html index c35ae163d3f8344f1ebb49241cc15a4afa3401d5..a9c069ac3a526af46392ffd2f23205a7604dbb7d 100644 --- a/src/webui/service/templates/device/detail.html +++ b/src/webui/service/templates/device/detail.html @@ -87,7 +87,6 @@ - Configurations: diff --git a/src/webui/service/templates/device/home.html b/src/webui/service/templates/device/home.html index 53434196f85c3a8c79fe9b861204e9bd8c6a5d8f..e356fd4fbeccc6e735d9723b8b1ca3e5fcf865ec 100644 --- a/src/webui/service/templates/device/home.html +++ b/src/webui/service/templates/device/home.html @@ -50,6 +50,7 @@ Status Config Rules + @@ -74,6 +75,14 @@ + + + + + + + + {% endfor %} {% else %} diff --git a/src/webui/service/templates/device/inventory.html b/src/webui/service/templates/device/inventory.html new file mode 100644 index 0000000000000000000000000000000000000000..96e4b342a28dbfd68cd0d945bfd0123edfeaf2af --- /dev/null +++ b/src/webui/service/templates/device/inventory.html @@ -0,0 +1,133 @@ + + +{% extends 'base.html' %} + +{% block content %} + + +

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

+ +
+
+ +
+
+
+ +{% macro render_item(item, components, depth=0) %} + {% if depth < 10 %} + {%if item.type != 'CHASSIS' %} +
  • {{ item.name }} +
      +
    • Component UUID: {{item.component_uuid.uuid}}
    • +
    • Attributes: {{item.attributes}}
    • + {% for comp in components | sort(reverse = false, attribute='name') %} + {% if item.name == comp.parent %} + {{ render_item(comp, components, depth + 1) }} + {% endif %} + {% endfor %} +
    +
  • + {% endif %} + {% endif %} +{% endmacro %} + +
    +
    +
      +
    • Components +
        + {% for item in device.components | sort(reverse = false, attribute='name') %} + {% if item.parent | length < 1 or item.type == 'CHASSIS' %} +
      • {{ item.name }} +
          +
        • Component UUID: {{item.component_uuid.uuid}}
        • +
        • Attributes: {{item.attributes}}
        • + {% for comp in device.components | sort(reverse = false, attribute='name') %} + {% if item.name == comp.parent %} + {{ render_item(comp, device.components) }} + {% endif %} + {% endfor %} +
        +
      • + {% endif %} + {% endfor %} +
      +
    • +
    + + +
    +
    + +{% endblock %} diff --git a/src/webui/service/templates/link/detail.html b/src/webui/service/templates/link/detail.html index 8ca7faee3e1871d11b819c6ca95668e654041f8c..864d0cdb20b8098a100c9c5f32ca637c20af9aac 100644 --- a/src/webui/service/templates/link/detail.html +++ b/src/webui/service/templates/link/detail.html @@ -79,6 +79,29 @@ +Attributes: + + + + + + + + + {% for field_descriptor, field_value in link.attributes.ListFields() %} + + + + + {% endfor %} + +
    KeyValue
    + {{ field_descriptor.name }} + + {{ field_value }} +
    + +
    * - * repeated .context.Component component = 8; + * repeated .context.Component components = 8; */ java.util.List - getComponentList(); + getComponentsList(); /** *
          * Used for inventory
          * 
    * - * repeated .context.Component component = 8; + * repeated .context.Component components = 8; */ - context.ContextOuterClass.Component getComponent(int index); + context.ContextOuterClass.Component getComponents(int index); /** *
          * Used for inventory
          * 
    * - * repeated .context.Component component = 8; + * repeated .context.Component components = 8; */ - int getComponentCount(); + int getComponentsCount(); /** *
          * Used for inventory
          * 
    * - * repeated .context.Component component = 8; + * repeated .context.Component components = 8; */ java.util.List - getComponentOrBuilderList(); + getComponentsOrBuilderList(); /** *
          * Used for inventory
          * 
    * - * repeated .context.Component component = 8; + * repeated .context.Component components = 8; */ - context.ContextOuterClass.ComponentOrBuilder getComponentOrBuilder( + context.ContextOuterClass.ComponentOrBuilder getComponentsOrBuilder( int index); /** @@ -15725,7 +15734,7 @@ public final class ContextOuterClass { deviceOperationalStatus_ = 0; deviceDrivers_ = java.util.Collections.emptyList(); deviceEndpoints_ = java.util.Collections.emptyList(); - component_ = java.util.Collections.emptyList(); + components_ = java.util.Collections.emptyList(); } @java.lang.Override @@ -15837,10 +15846,10 @@ public final class ContextOuterClass { } case 66: { if (!((mutable_bitField0_ & 0x00000004) != 0)) { - component_ = new java.util.ArrayList(); + components_ = new java.util.ArrayList(); mutable_bitField0_ |= 0x00000004; } - component_.add( + components_.add( input.readMessage(context.ContextOuterClass.Component.parser(), extensionRegistry)); break; } @@ -15879,7 +15888,7 @@ public final class ContextOuterClass { deviceEndpoints_ = java.util.Collections.unmodifiableList(deviceEndpoints_); } if (((mutable_bitField0_ & 0x00000004) != 0)) { - component_ = java.util.Collections.unmodifiableList(component_); + components_ = java.util.Collections.unmodifiableList(components_); } this.unknownFields = unknownFields.build(); makeExtensionsImmutable(); @@ -16143,64 +16152,64 @@ public final class ContextOuterClass { return deviceEndpoints_.get(index); } - public static final int COMPONENT_FIELD_NUMBER = 8; - private java.util.List component_; + public static final int COMPONENTS_FIELD_NUMBER = 8; + private java.util.List components_; /** *
          * Used for inventory
          * 
    * - * repeated .context.Component component = 8; + * repeated .context.Component components = 8; */ @java.lang.Override - public java.util.List getComponentList() { - return component_; + public java.util.List getComponentsList() { + return components_; } /** *
          * Used for inventory
          * 
    * - * repeated .context.Component component = 8; + * repeated .context.Component components = 8; */ @java.lang.Override public java.util.List - getComponentOrBuilderList() { - return component_; + getComponentsOrBuilderList() { + return components_; } /** *
          * Used for inventory
          * 
    * - * repeated .context.Component component = 8; + * repeated .context.Component components = 8; */ @java.lang.Override - public int getComponentCount() { - return component_.size(); + public int getComponentsCount() { + return components_.size(); } /** *
          * Used for inventory
          * 
    * - * repeated .context.Component component = 8; + * repeated .context.Component components = 8; */ @java.lang.Override - public context.ContextOuterClass.Component getComponent(int index) { - return component_.get(index); + public context.ContextOuterClass.Component getComponents(int index) { + return components_.get(index); } /** *
          * Used for inventory
          * 
    * - * repeated .context.Component component = 8; + * repeated .context.Component components = 8; */ @java.lang.Override - public context.ContextOuterClass.ComponentOrBuilder getComponentOrBuilder( + public context.ContextOuterClass.ComponentOrBuilder getComponentsOrBuilder( int index) { - return component_.get(index); + return components_.get(index); } public static final int CONTROLLER_ID_FIELD_NUMBER = 9; @@ -16281,8 +16290,8 @@ public final class ContextOuterClass { for (int i = 0; i < deviceEndpoints_.size(); i++) { output.writeMessage(7, deviceEndpoints_.get(i)); } - for (int i = 0; i < component_.size(); i++) { - output.writeMessage(8, component_.get(i)); + for (int i = 0; i < components_.size(); i++) { + output.writeMessage(8, components_.get(i)); } if (controllerId_ != null) { output.writeMessage(9, getControllerId()); @@ -16330,9 +16339,9 @@ public final class ContextOuterClass { size += com.google.protobuf.CodedOutputStream .computeMessageSize(7, deviceEndpoints_.get(i)); } - for (int i = 0; i < component_.size(); i++) { + for (int i = 0; i < components_.size(); i++) { size += com.google.protobuf.CodedOutputStream - .computeMessageSize(8, component_.get(i)); + .computeMessageSize(8, components_.get(i)); } if (controllerId_ != null) { size += com.google.protobuf.CodedOutputStream @@ -16371,8 +16380,8 @@ public final class ContextOuterClass { if (!deviceDrivers_.equals(other.deviceDrivers_)) return false; if (!getDeviceEndpointsList() .equals(other.getDeviceEndpointsList())) return false; - if (!getComponentList() - .equals(other.getComponentList())) return false; + if (!getComponentsList() + .equals(other.getComponentsList())) return false; if (hasControllerId() != other.hasControllerId()) return false; if (hasControllerId()) { if (!getControllerId() @@ -16411,9 +16420,9 @@ public final class ContextOuterClass { hash = (37 * hash) + DEVICE_ENDPOINTS_FIELD_NUMBER; hash = (53 * hash) + getDeviceEndpointsList().hashCode(); } - if (getComponentCount() > 0) { - hash = (37 * hash) + COMPONENT_FIELD_NUMBER; - hash = (53 * hash) + getComponentList().hashCode(); + if (getComponentsCount() > 0) { + hash = (37 * hash) + COMPONENTS_FIELD_NUMBER; + hash = (53 * hash) + getComponentsList().hashCode(); } if (hasControllerId()) { hash = (37 * hash) + CONTROLLER_ID_FIELD_NUMBER; @@ -16548,7 +16557,7 @@ public final class ContextOuterClass { if (com.google.protobuf.GeneratedMessageV3 .alwaysUseFieldBuilders) { getDeviceEndpointsFieldBuilder(); - getComponentFieldBuilder(); + getComponentsFieldBuilder(); } } @java.lang.Override @@ -16580,11 +16589,11 @@ public final class ContextOuterClass { } else { deviceEndpointsBuilder_.clear(); } - if (componentBuilder_ == null) { - component_ = java.util.Collections.emptyList(); + if (componentsBuilder_ == null) { + components_ = java.util.Collections.emptyList(); bitField0_ = (bitField0_ & ~0x00000004); } else { - componentBuilder_.clear(); + componentsBuilder_.clear(); } if (controllerIdBuilder_ == null) { controllerId_ = null; @@ -16646,14 +16655,14 @@ public final class ContextOuterClass { } else { result.deviceEndpoints_ = deviceEndpointsBuilder_.build(); } - if (componentBuilder_ == null) { + if (componentsBuilder_ == null) { if (((bitField0_ & 0x00000004) != 0)) { - component_ = java.util.Collections.unmodifiableList(component_); + components_ = java.util.Collections.unmodifiableList(components_); bitField0_ = (bitField0_ & ~0x00000004); } - result.component_ = component_; + result.components_ = components_; } else { - result.component_ = componentBuilder_.build(); + result.components_ = componentsBuilder_.build(); } if (controllerIdBuilder_ == null) { result.controllerId_ = controllerId_; @@ -16761,29 +16770,29 @@ public final class ContextOuterClass { } } } - if (componentBuilder_ == null) { - if (!other.component_.isEmpty()) { - if (component_.isEmpty()) { - component_ = other.component_; + if (componentsBuilder_ == null) { + if (!other.components_.isEmpty()) { + if (components_.isEmpty()) { + components_ = other.components_; bitField0_ = (bitField0_ & ~0x00000004); } else { - ensureComponentIsMutable(); - component_.addAll(other.component_); + ensureComponentsIsMutable(); + components_.addAll(other.components_); } onChanged(); } } else { - if (!other.component_.isEmpty()) { - if (componentBuilder_.isEmpty()) { - componentBuilder_.dispose(); - componentBuilder_ = null; - component_ = other.component_; + if (!other.components_.isEmpty()) { + if (componentsBuilder_.isEmpty()) { + componentsBuilder_.dispose(); + componentsBuilder_ = null; + components_ = other.components_; bitField0_ = (bitField0_ & ~0x00000004); - componentBuilder_ = + componentsBuilder_ = com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getComponentFieldBuilder() : null; + getComponentsFieldBuilder() : null; } else { - componentBuilder_.addAllMessages(other.component_); + componentsBuilder_.addAllMessages(other.components_); } } } @@ -17644,30 +17653,30 @@ public final class ContextOuterClass { return deviceEndpointsBuilder_; } - private java.util.List component_ = + private java.util.List components_ = java.util.Collections.emptyList(); - private void ensureComponentIsMutable() { + private void ensureComponentsIsMutable() { if (!((bitField0_ & 0x00000004) != 0)) { - component_ = new java.util.ArrayList(component_); + components_ = new java.util.ArrayList(components_); bitField0_ |= 0x00000004; } } private com.google.protobuf.RepeatedFieldBuilderV3< - context.ContextOuterClass.Component, context.ContextOuterClass.Component.Builder, context.ContextOuterClass.ComponentOrBuilder> componentBuilder_; + context.ContextOuterClass.Component, context.ContextOuterClass.Component.Builder, context.ContextOuterClass.ComponentOrBuilder> componentsBuilder_; /** *
            * Used for inventory
            * 
    * - * repeated .context.Component component = 8; + * repeated .context.Component components = 8; */ - public java.util.List getComponentList() { - if (componentBuilder_ == null) { - return java.util.Collections.unmodifiableList(component_); + public java.util.List getComponentsList() { + if (componentsBuilder_ == null) { + return java.util.Collections.unmodifiableList(components_); } else { - return componentBuilder_.getMessageList(); + return componentsBuilder_.getMessageList(); } } /** @@ -17675,13 +17684,13 @@ public final class ContextOuterClass { * Used for inventory *
    * - * repeated .context.Component component = 8; + * repeated .context.Component components = 8; */ - public int getComponentCount() { - if (componentBuilder_ == null) { - return component_.size(); + public int getComponentsCount() { + if (componentsBuilder_ == null) { + return components_.size(); } else { - return componentBuilder_.getCount(); + return componentsBuilder_.getCount(); } } /** @@ -17689,13 +17698,13 @@ public final class ContextOuterClass { * Used for inventory * * - * repeated .context.Component component = 8; + * repeated .context.Component components = 8; */ - public context.ContextOuterClass.Component getComponent(int index) { - if (componentBuilder_ == null) { - return component_.get(index); + public context.ContextOuterClass.Component getComponents(int index) { + if (componentsBuilder_ == null) { + return components_.get(index); } else { - return componentBuilder_.getMessage(index); + return componentsBuilder_.getMessage(index); } } /** @@ -17703,19 +17712,19 @@ public final class ContextOuterClass { * Used for inventory * * - * repeated .context.Component component = 8; + * repeated .context.Component components = 8; */ - public Builder setComponent( + public Builder setComponents( int index, context.ContextOuterClass.Component value) { - if (componentBuilder_ == null) { + if (componentsBuilder_ == null) { if (value == null) { throw new NullPointerException(); } - ensureComponentIsMutable(); - component_.set(index, value); + ensureComponentsIsMutable(); + components_.set(index, value); onChanged(); } else { - componentBuilder_.setMessage(index, value); + componentsBuilder_.setMessage(index, value); } return this; } @@ -17724,16 +17733,16 @@ public final class ContextOuterClass { * Used for inventory * * - * repeated .context.Component component = 8; + * repeated .context.Component components = 8; */ - public Builder setComponent( + public Builder setComponents( int index, context.ContextOuterClass.Component.Builder builderForValue) { - if (componentBuilder_ == null) { - ensureComponentIsMutable(); - component_.set(index, builderForValue.build()); + if (componentsBuilder_ == null) { + ensureComponentsIsMutable(); + components_.set(index, builderForValue.build()); onChanged(); } else { - componentBuilder_.setMessage(index, builderForValue.build()); + componentsBuilder_.setMessage(index, builderForValue.build()); } return this; } @@ -17742,18 +17751,18 @@ public final class ContextOuterClass { * Used for inventory * * - * repeated .context.Component component = 8; + * repeated .context.Component components = 8; */ - public Builder addComponent(context.ContextOuterClass.Component value) { - if (componentBuilder_ == null) { + public Builder addComponents(context.ContextOuterClass.Component value) { + if (componentsBuilder_ == null) { if (value == null) { throw new NullPointerException(); } - ensureComponentIsMutable(); - component_.add(value); + ensureComponentsIsMutable(); + components_.add(value); onChanged(); } else { - componentBuilder_.addMessage(value); + componentsBuilder_.addMessage(value); } return this; } @@ -17762,19 +17771,19 @@ public final class ContextOuterClass { * Used for inventory * * - * repeated .context.Component component = 8; + * repeated .context.Component components = 8; */ - public Builder addComponent( + public Builder addComponents( int index, context.ContextOuterClass.Component value) { - if (componentBuilder_ == null) { + if (componentsBuilder_ == null) { if (value == null) { throw new NullPointerException(); } - ensureComponentIsMutable(); - component_.add(index, value); + ensureComponentsIsMutable(); + components_.add(index, value); onChanged(); } else { - componentBuilder_.addMessage(index, value); + componentsBuilder_.addMessage(index, value); } return this; } @@ -17783,16 +17792,16 @@ public final class ContextOuterClass { * Used for inventory * * - * repeated .context.Component component = 8; + * repeated .context.Component components = 8; */ - public Builder addComponent( + public Builder addComponents( context.ContextOuterClass.Component.Builder builderForValue) { - if (componentBuilder_ == null) { - ensureComponentIsMutable(); - component_.add(builderForValue.build()); + if (componentsBuilder_ == null) { + ensureComponentsIsMutable(); + components_.add(builderForValue.build()); onChanged(); } else { - componentBuilder_.addMessage(builderForValue.build()); + componentsBuilder_.addMessage(builderForValue.build()); } return this; } @@ -17801,16 +17810,16 @@ public final class ContextOuterClass { * Used for inventory * * - * repeated .context.Component component = 8; + * repeated .context.Component components = 8; */ - public Builder addComponent( + public Builder addComponents( int index, context.ContextOuterClass.Component.Builder builderForValue) { - if (componentBuilder_ == null) { - ensureComponentIsMutable(); - component_.add(index, builderForValue.build()); + if (componentsBuilder_ == null) { + ensureComponentsIsMutable(); + components_.add(index, builderForValue.build()); onChanged(); } else { - componentBuilder_.addMessage(index, builderForValue.build()); + componentsBuilder_.addMessage(index, builderForValue.build()); } return this; } @@ -17819,17 +17828,17 @@ public final class ContextOuterClass { * Used for inventory * * - * repeated .context.Component component = 8; + * repeated .context.Component components = 8; */ - public Builder addAllComponent( + public Builder addAllComponents( java.lang.Iterable values) { - if (componentBuilder_ == null) { - ensureComponentIsMutable(); + if (componentsBuilder_ == null) { + ensureComponentsIsMutable(); com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, component_); + values, components_); onChanged(); } else { - componentBuilder_.addAllMessages(values); + componentsBuilder_.addAllMessages(values); } return this; } @@ -17838,15 +17847,15 @@ public final class ContextOuterClass { * Used for inventory * * - * repeated .context.Component component = 8; + * repeated .context.Component components = 8; */ - public Builder clearComponent() { - if (componentBuilder_ == null) { - component_ = java.util.Collections.emptyList(); + public Builder clearComponents() { + if (componentsBuilder_ == null) { + components_ = java.util.Collections.emptyList(); bitField0_ = (bitField0_ & ~0x00000004); onChanged(); } else { - componentBuilder_.clear(); + componentsBuilder_.clear(); } return this; } @@ -17855,15 +17864,15 @@ public final class ContextOuterClass { * Used for inventory * * - * repeated .context.Component component = 8; + * repeated .context.Component components = 8; */ - public Builder removeComponent(int index) { - if (componentBuilder_ == null) { - ensureComponentIsMutable(); - component_.remove(index); + public Builder removeComponents(int index) { + if (componentsBuilder_ == null) { + ensureComponentsIsMutable(); + components_.remove(index); onChanged(); } else { - componentBuilder_.remove(index); + componentsBuilder_.remove(index); } return this; } @@ -17872,24 +17881,24 @@ public final class ContextOuterClass { * Used for inventory * * - * repeated .context.Component component = 8; + * repeated .context.Component components = 8; */ - public context.ContextOuterClass.Component.Builder getComponentBuilder( + public context.ContextOuterClass.Component.Builder getComponentsBuilder( int index) { - return getComponentFieldBuilder().getBuilder(index); + return getComponentsFieldBuilder().getBuilder(index); } /** *
            * Used for inventory
            * 
    * - * repeated .context.Component component = 8; + * repeated .context.Component components = 8; */ - public context.ContextOuterClass.ComponentOrBuilder getComponentOrBuilder( + public context.ContextOuterClass.ComponentOrBuilder getComponentsOrBuilder( int index) { - if (componentBuilder_ == null) { - return component_.get(index); } else { - return componentBuilder_.getMessageOrBuilder(index); + if (componentsBuilder_ == null) { + return components_.get(index); } else { + return componentsBuilder_.getMessageOrBuilder(index); } } /** @@ -17897,14 +17906,14 @@ public final class ContextOuterClass { * Used for inventory * * - * repeated .context.Component component = 8; + * repeated .context.Component components = 8; */ public java.util.List - getComponentOrBuilderList() { - if (componentBuilder_ != null) { - return componentBuilder_.getMessageOrBuilderList(); + getComponentsOrBuilderList() { + if (componentsBuilder_ != null) { + return componentsBuilder_.getMessageOrBuilderList(); } else { - return java.util.Collections.unmodifiableList(component_); + return java.util.Collections.unmodifiableList(components_); } } /** @@ -17912,10 +17921,10 @@ public final class ContextOuterClass { * Used for inventory * * - * repeated .context.Component component = 8; + * repeated .context.Component components = 8; */ - public context.ContextOuterClass.Component.Builder addComponentBuilder() { - return getComponentFieldBuilder().addBuilder( + public context.ContextOuterClass.Component.Builder addComponentsBuilder() { + return getComponentsFieldBuilder().addBuilder( context.ContextOuterClass.Component.getDefaultInstance()); } /** @@ -17923,11 +17932,11 @@ public final class ContextOuterClass { * Used for inventory * * - * repeated .context.Component component = 8; + * repeated .context.Component components = 8; */ - public context.ContextOuterClass.Component.Builder addComponentBuilder( + public context.ContextOuterClass.Component.Builder addComponentsBuilder( int index) { - return getComponentFieldBuilder().addBuilder( + return getComponentsFieldBuilder().addBuilder( index, context.ContextOuterClass.Component.getDefaultInstance()); } /** @@ -17935,25 +17944,25 @@ public final class ContextOuterClass { * Used for inventory * * - * repeated .context.Component component = 8; + * repeated .context.Component components = 8; */ public java.util.List - getComponentBuilderList() { - return getComponentFieldBuilder().getBuilderList(); + getComponentsBuilderList() { + return getComponentsFieldBuilder().getBuilderList(); } private com.google.protobuf.RepeatedFieldBuilderV3< context.ContextOuterClass.Component, context.ContextOuterClass.Component.Builder, context.ContextOuterClass.ComponentOrBuilder> - getComponentFieldBuilder() { - if (componentBuilder_ == null) { - componentBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + getComponentsFieldBuilder() { + if (componentsBuilder_ == null) { + componentsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< context.ContextOuterClass.Component, context.ContextOuterClass.Component.Builder, context.ContextOuterClass.ComponentOrBuilder>( - component_, + components_, ((bitField0_ & 0x00000004) != 0), getParentForChildren(), isClean()); - component_ = null; + components_ = null; } - return componentBuilder_; + return componentsBuilder_; } private context.ContextOuterClass.DeviceId controllerId_; @@ -18168,31 +18177,115 @@ public final class ContextOuterClass { com.google.protobuf.MessageOrBuilder { /** - * repeated string comp_string = 1; - * @return A list containing the compString. + * .context.Uuid component_uuid = 1; + * @return Whether the componentUuid field is set. */ - java.util.List - getCompStringList(); + boolean hasComponentUuid(); /** - * repeated string comp_string = 1; - * @return The count of compString. + * .context.Uuid component_uuid = 1; + * @return The componentUuid. */ - int getCompStringCount(); + context.ContextOuterClass.Uuid getComponentUuid(); /** - * repeated string comp_string = 1; - * @param index The index of the element to return. - * @return The compString at the given index. + * .context.Uuid component_uuid = 1; */ - java.lang.String getCompString(int index); + context.ContextOuterClass.UuidOrBuilder getComponentUuidOrBuilder(); + /** - * repeated string comp_string = 1; - * @param index The index of the value to return. - * @return The bytes of the compString at the given index. + * string name = 2; + * @return The name. + */ + java.lang.String getName(); + /** + * string name = 2; + * @return The bytes for name. + */ + com.google.protobuf.ByteString + getNameBytes(); + + /** + * string type = 3; + * @return The type. + */ + java.lang.String getType(); + /** + * string type = 3; + * @return The bytes for type. + */ + com.google.protobuf.ByteString + getTypeBytes(); + + /** + *
    +     * dict[attr.name => json.dumps(attr.value)]
    +     * 
    + * + * map<string, string> attributes = 4; + */ + int getAttributesCount(); + /** + *
    +     * dict[attr.name => json.dumps(attr.value)]
    +     * 
    + * + * map<string, string> attributes = 4; + */ + boolean containsAttributes( + java.lang.String key); + /** + * Use {@link #getAttributesMap()} instead. + */ + @java.lang.Deprecated + java.util.Map + getAttributes(); + /** + *
    +     * dict[attr.name => json.dumps(attr.value)]
    +     * 
    + * + * map<string, string> attributes = 4; + */ + java.util.Map + getAttributesMap(); + /** + *
    +     * dict[attr.name => json.dumps(attr.value)]
    +     * 
    + * + * map<string, string> attributes = 4; + */ + + java.lang.String getAttributesOrDefault( + java.lang.String key, + java.lang.String defaultValue); + /** + *
    +     * dict[attr.name => json.dumps(attr.value)]
    +     * 
    + * + * map<string, string> attributes = 4; + */ + + java.lang.String getAttributesOrThrow( + java.lang.String key); + + /** + * string parent = 5; + * @return The parent. + */ + java.lang.String getParent(); + /** + * string parent = 5; + * @return The bytes for parent. */ com.google.protobuf.ByteString - getCompStringBytes(int index); + getParentBytes(); } /** + *
    +   *Defined previously to this section - Tested OK
    +   * 
    + * * Protobuf type {@code context.Component} */ public static final class Component extends @@ -18205,7 +18298,9 @@ public final class ContextOuterClass { super(builder); } private Component() { - compString_ = com.google.protobuf.LazyStringArrayList.EMPTY; + name_ = ""; + type_ = ""; + parent_ = ""; } @java.lang.Override @@ -18240,12 +18335,47 @@ public final class ContextOuterClass { done = true; break; case 10: { + context.ContextOuterClass.Uuid.Builder subBuilder = null; + if (componentUuid_ != null) { + subBuilder = componentUuid_.toBuilder(); + } + componentUuid_ = input.readMessage(context.ContextOuterClass.Uuid.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(componentUuid_); + componentUuid_ = subBuilder.buildPartial(); + } + + break; + } + case 18: { java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + case 26: { + java.lang.String s = input.readStringRequireUtf8(); + + type_ = s; + break; + } + case 34: { if (!((mutable_bitField0_ & 0x00000001) != 0)) { - compString_ = new com.google.protobuf.LazyStringArrayList(); + attributes_ = com.google.protobuf.MapField.newMapField( + AttributesDefaultEntryHolder.defaultEntry); mutable_bitField0_ |= 0x00000001; } - compString_.add(s); + com.google.protobuf.MapEntry + attributes__ = input.readMessage( + AttributesDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); + attributes_.getMutableMap().put( + attributes__.getKey(), attributes__.getValue()); + break; + } + case 42: { + java.lang.String s = input.readStringRequireUtf8(); + + parent_ = s; break; } default: { @@ -18263,9 +18393,6 @@ public final class ContextOuterClass { throw new com.google.protobuf.InvalidProtocolBufferException( e).setUnfinishedMessage(this); } finally { - if (((mutable_bitField0_ & 0x00000001) != 0)) { - compString_ = compString_.getUnmodifiableView(); - } this.unknownFields = unknownFields.build(); makeExtensionsImmutable(); } @@ -18275,6 +18402,18 @@ public final class ContextOuterClass { return context.ContextOuterClass.internal_static_context_Component_descriptor; } + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapField internalGetMapField( + int number) { + switch (number) { + case 4: + return internalGetAttributes(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { @@ -18283,39 +18422,241 @@ public final class ContextOuterClass { context.ContextOuterClass.Component.class, context.ContextOuterClass.Component.Builder.class); } - public static final int COMP_STRING_FIELD_NUMBER = 1; - private com.google.protobuf.LazyStringList compString_; + public static final int COMPONENT_UUID_FIELD_NUMBER = 1; + private context.ContextOuterClass.Uuid componentUuid_; /** - * repeated string comp_string = 1; - * @return A list containing the compString. + * .context.Uuid component_uuid = 1; + * @return Whether the componentUuid field is set. */ - public com.google.protobuf.ProtocolStringList - getCompStringList() { - return compString_; + @java.lang.Override + public boolean hasComponentUuid() { + return componentUuid_ != null; } /** - * repeated string comp_string = 1; - * @return The count of compString. + * .context.Uuid component_uuid = 1; + * @return The componentUuid. */ - public int getCompStringCount() { - return compString_.size(); + @java.lang.Override + public context.ContextOuterClass.Uuid getComponentUuid() { + return componentUuid_ == null ? context.ContextOuterClass.Uuid.getDefaultInstance() : componentUuid_; } /** - * repeated string comp_string = 1; - * @param index The index of the element to return. - * @return The compString at the given index. + * .context.Uuid component_uuid = 1; + */ + @java.lang.Override + public context.ContextOuterClass.UuidOrBuilder getComponentUuidOrBuilder() { + return getComponentUuid(); + } + + public static final int NAME_FIELD_NUMBER = 2; + private volatile java.lang.Object name_; + /** + * string name = 2; + * @return The name. */ - public java.lang.String getCompString(int index) { - return compString_.get(index); + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } } /** - * repeated string comp_string = 1; - * @param index The index of the value to return. - * @return The bytes of the compString at the given index. + * string name = 2; + * @return The bytes for name. */ + @java.lang.Override public com.google.protobuf.ByteString - getCompStringBytes(int index) { - return compString_.getByteString(index); + getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int TYPE_FIELD_NUMBER = 3; + private volatile java.lang.Object type_; + /** + * string type = 3; + * @return The type. + */ + @java.lang.Override + public java.lang.String getType() { + java.lang.Object ref = type_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + type_ = s; + return s; + } + } + /** + * string type = 3; + * @return The bytes for type. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getTypeBytes() { + java.lang.Object ref = type_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + type_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ATTRIBUTES_FIELD_NUMBER = 4; + private static final class AttributesDefaultEntryHolder { + static final com.google.protobuf.MapEntry< + java.lang.String, java.lang.String> defaultEntry = + com.google.protobuf.MapEntry + .newDefaultInstance( + context.ContextOuterClass.internal_static_context_Component_AttributesEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.STRING, + ""); + } + private com.google.protobuf.MapField< + java.lang.String, java.lang.String> attributes_; + private com.google.protobuf.MapField + internalGetAttributes() { + if (attributes_ == null) { + return com.google.protobuf.MapField.emptyMapField( + AttributesDefaultEntryHolder.defaultEntry); + } + return attributes_; + } + + public int getAttributesCount() { + return internalGetAttributes().getMap().size(); + } + /** + *
    +     * dict[attr.name => json.dumps(attr.value)]
    +     * 
    + * + * map<string, string> attributes = 4; + */ + + @java.lang.Override + public boolean containsAttributes( + java.lang.String key) { + if (key == null) { throw new java.lang.NullPointerException(); } + return internalGetAttributes().getMap().containsKey(key); + } + /** + * Use {@link #getAttributesMap()} instead. + */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getAttributes() { + return getAttributesMap(); + } + /** + *
    +     * dict[attr.name => json.dumps(attr.value)]
    +     * 
    + * + * map<string, string> attributes = 4; + */ + @java.lang.Override + + public java.util.Map getAttributesMap() { + return internalGetAttributes().getMap(); + } + /** + *
    +     * dict[attr.name => json.dumps(attr.value)]
    +     * 
    + * + * map<string, string> attributes = 4; + */ + @java.lang.Override + + public java.lang.String getAttributesOrDefault( + java.lang.String key, + java.lang.String defaultValue) { + if (key == null) { throw new java.lang.NullPointerException(); } + java.util.Map map = + internalGetAttributes().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + *
    +     * dict[attr.name => json.dumps(attr.value)]
    +     * 
    + * + * map<string, string> attributes = 4; + */ + @java.lang.Override + + public java.lang.String getAttributesOrThrow( + java.lang.String key) { + if (key == null) { throw new java.lang.NullPointerException(); } + java.util.Map map = + internalGetAttributes().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public static final int PARENT_FIELD_NUMBER = 5; + private volatile java.lang.Object parent_; + /** + * string parent = 5; + * @return The parent. + */ + @java.lang.Override + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } + } + /** + * string parent = 5; + * @return The bytes for parent. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } } private byte memoizedIsInitialized = -1; @@ -18332,8 +18673,23 @@ public final class ContextOuterClass { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - for (int i = 0; i < compString_.size(); i++) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, compString_.getRaw(i)); + if (componentUuid_ != null) { + output.writeMessage(1, getComponentUuid()); + } + if (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, name_); + } + if (!getTypeBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, type_); + } + com.google.protobuf.GeneratedMessageV3 + .serializeStringMapTo( + output, + internalGetAttributes(), + AttributesDefaultEntryHolder.defaultEntry, + 4); + if (!getParentBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, parent_); } unknownFields.writeTo(output); } @@ -18344,13 +18700,28 @@ public final class ContextOuterClass { if (size != -1) return size; size = 0; - { - int dataSize = 0; - for (int i = 0; i < compString_.size(); i++) { - dataSize += computeStringSizeNoTag(compString_.getRaw(i)); - } - size += dataSize; - size += 1 * getCompStringList().size(); + if (componentUuid_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, getComponentUuid()); + } + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, name_); + } + if (!getTypeBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, type_); + } + for (java.util.Map.Entry entry + : internalGetAttributes().getMap().entrySet()) { + com.google.protobuf.MapEntry + attributes__ = AttributesDefaultEntryHolder.defaultEntry.newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(4, attributes__); + } + if (!getParentBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, parent_); } size += unknownFields.getSerializedSize(); memoizedSize = size; @@ -18367,8 +18738,19 @@ public final class ContextOuterClass { } context.ContextOuterClass.Component other = (context.ContextOuterClass.Component) obj; - if (!getCompStringList() - .equals(other.getCompStringList())) return false; + if (hasComponentUuid() != other.hasComponentUuid()) return false; + if (hasComponentUuid()) { + if (!getComponentUuid() + .equals(other.getComponentUuid())) return false; + } + if (!getName() + .equals(other.getName())) return false; + if (!getType() + .equals(other.getType())) return false; + if (!internalGetAttributes().equals( + other.internalGetAttributes())) return false; + if (!getParent() + .equals(other.getParent())) return false; if (!unknownFields.equals(other.unknownFields)) return false; return true; } @@ -18380,10 +18762,20 @@ public final class ContextOuterClass { } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); - if (getCompStringCount() > 0) { - hash = (37 * hash) + COMP_STRING_FIELD_NUMBER; - hash = (53 * hash) + getCompStringList().hashCode(); + if (hasComponentUuid()) { + hash = (37 * hash) + COMPONENT_UUID_FIELD_NUMBER; + hash = (53 * hash) + getComponentUuid().hashCode(); } + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (37 * hash) + TYPE_FIELD_NUMBER; + hash = (53 * hash) + getType().hashCode(); + if (!internalGetAttributes().getMap().isEmpty()) { + hash = (37 * hash) + ATTRIBUTES_FIELD_NUMBER; + hash = (53 * hash) + internalGetAttributes().hashCode(); + } + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; @@ -18480,6 +18872,10 @@ public final class ContextOuterClass { return builder; } /** + *
    +     *Defined previously to this section - Tested OK
    +     * 
    + * * Protobuf type {@code context.Component} */ public static final class Builder extends @@ -18491,6 +18887,28 @@ public final class ContextOuterClass { return context.ContextOuterClass.internal_static_context_Component_descriptor; } + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField( + int number) { + switch (number) { + case 4: + return internalGetAttributes(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMutableMapField( + int number) { + switch (number) { + case 4: + return internalGetMutableAttributes(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { @@ -18517,8 +18935,19 @@ public final class ContextOuterClass { @java.lang.Override public Builder clear() { super.clear(); - compString_ = com.google.protobuf.LazyStringArrayList.EMPTY; - bitField0_ = (bitField0_ & ~0x00000001); + if (componentUuidBuilder_ == null) { + componentUuid_ = null; + } else { + componentUuid_ = null; + componentUuidBuilder_ = null; + } + name_ = ""; + + type_ = ""; + + internalGetMutableAttributes().clear(); + parent_ = ""; + return this; } @@ -18546,11 +18975,16 @@ public final class ContextOuterClass { public context.ContextOuterClass.Component buildPartial() { context.ContextOuterClass.Component result = new context.ContextOuterClass.Component(this); int from_bitField0_ = bitField0_; - if (((bitField0_ & 0x00000001) != 0)) { - compString_ = compString_.getUnmodifiableView(); - bitField0_ = (bitField0_ & ~0x00000001); + if (componentUuidBuilder_ == null) { + result.componentUuid_ = componentUuid_; + } else { + result.componentUuid_ = componentUuidBuilder_.build(); } - result.compString_ = compString_; + result.name_ = name_; + result.type_ = type_; + result.attributes_ = internalGetAttributes(); + result.attributes_.makeImmutable(); + result.parent_ = parent_; onBuilt(); return result; } @@ -18599,14 +19033,21 @@ public final class ContextOuterClass { public Builder mergeFrom(context.ContextOuterClass.Component other) { if (other == context.ContextOuterClass.Component.getDefaultInstance()) return this; - if (!other.compString_.isEmpty()) { - if (compString_.isEmpty()) { - compString_ = other.compString_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureCompStringIsMutable(); - compString_.addAll(other.compString_); - } + if (other.hasComponentUuid()) { + mergeComponentUuid(other.getComponentUuid()); + } + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (!other.getType().isEmpty()) { + type_ = other.type_; + onChanged(); + } + internalGetMutableAttributes().mergeFrom( + other.internalGetAttributes()); + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; onChanged(); } this.mergeUnknownFields(other.unknownFields); @@ -18639,112 +19080,505 @@ public final class ContextOuterClass { } private int bitField0_; - private com.google.protobuf.LazyStringList compString_ = com.google.protobuf.LazyStringArrayList.EMPTY; - private void ensureCompStringIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - compString_ = new com.google.protobuf.LazyStringArrayList(compString_); - bitField0_ |= 0x00000001; - } + private context.ContextOuterClass.Uuid componentUuid_; + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.Uuid, context.ContextOuterClass.Uuid.Builder, context.ContextOuterClass.UuidOrBuilder> componentUuidBuilder_; + /** + * .context.Uuid component_uuid = 1; + * @return Whether the componentUuid field is set. + */ + public boolean hasComponentUuid() { + return componentUuidBuilder_ != null || componentUuid_ != null; } /** - * repeated string comp_string = 1; - * @return A list containing the compString. + * .context.Uuid component_uuid = 1; + * @return The componentUuid. */ - public com.google.protobuf.ProtocolStringList - getCompStringList() { - return compString_.getUnmodifiableView(); + public context.ContextOuterClass.Uuid getComponentUuid() { + if (componentUuidBuilder_ == null) { + return componentUuid_ == null ? context.ContextOuterClass.Uuid.getDefaultInstance() : componentUuid_; + } else { + return componentUuidBuilder_.getMessage(); + } } /** - * repeated string comp_string = 1; - * @return The count of compString. + * .context.Uuid component_uuid = 1; */ - public int getCompStringCount() { - return compString_.size(); + public Builder setComponentUuid(context.ContextOuterClass.Uuid value) { + if (componentUuidBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + componentUuid_ = value; + onChanged(); + } else { + componentUuidBuilder_.setMessage(value); + } + + return this; } /** - * repeated string comp_string = 1; - * @param index The index of the element to return. - * @return The compString at the given index. + * .context.Uuid component_uuid = 1; + */ + public Builder setComponentUuid( + context.ContextOuterClass.Uuid.Builder builderForValue) { + if (componentUuidBuilder_ == null) { + componentUuid_ = builderForValue.build(); + onChanged(); + } else { + componentUuidBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * .context.Uuid component_uuid = 1; */ - public java.lang.String getCompString(int index) { - return compString_.get(index); + public Builder mergeComponentUuid(context.ContextOuterClass.Uuid value) { + if (componentUuidBuilder_ == null) { + if (componentUuid_ != null) { + componentUuid_ = + context.ContextOuterClass.Uuid.newBuilder(componentUuid_).mergeFrom(value).buildPartial(); + } else { + componentUuid_ = value; + } + onChanged(); + } else { + componentUuidBuilder_.mergeFrom(value); + } + + return this; } /** - * repeated string comp_string = 1; - * @param index The index of the value to return. - * @return The bytes of the compString at the given index. + * .context.Uuid component_uuid = 1; + */ + public Builder clearComponentUuid() { + if (componentUuidBuilder_ == null) { + componentUuid_ = null; + onChanged(); + } else { + componentUuid_ = null; + componentUuidBuilder_ = null; + } + + return this; + } + /** + * .context.Uuid component_uuid = 1; + */ + public context.ContextOuterClass.Uuid.Builder getComponentUuidBuilder() { + + onChanged(); + return getComponentUuidFieldBuilder().getBuilder(); + } + /** + * .context.Uuid component_uuid = 1; + */ + public context.ContextOuterClass.UuidOrBuilder getComponentUuidOrBuilder() { + if (componentUuidBuilder_ != null) { + return componentUuidBuilder_.getMessageOrBuilder(); + } else { + return componentUuid_ == null ? + context.ContextOuterClass.Uuid.getDefaultInstance() : componentUuid_; + } + } + /** + * .context.Uuid component_uuid = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.Uuid, context.ContextOuterClass.Uuid.Builder, context.ContextOuterClass.UuidOrBuilder> + getComponentUuidFieldBuilder() { + if (componentUuidBuilder_ == null) { + componentUuidBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.Uuid, context.ContextOuterClass.Uuid.Builder, context.ContextOuterClass.UuidOrBuilder>( + getComponentUuid(), + getParentForChildren(), + isClean()); + componentUuid_ = null; + } + return componentUuidBuilder_; + } + + private java.lang.Object name_ = ""; + /** + * string name = 2; + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string name = 2; + * @return The bytes for name. */ public com.google.protobuf.ByteString - getCompStringBytes(int index) { - return compString_.getByteString(index); + getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } } /** - * repeated string comp_string = 1; - * @param index The index to set the value at. - * @param value The compString to set. + * string name = 2; + * @param value The name to set. * @return This builder for chaining. */ - public Builder setCompString( - int index, java.lang.String value) { + public Builder setName( + java.lang.String value) { if (value == null) { throw new NullPointerException(); } - ensureCompStringIsMutable(); - compString_.set(index, value); + + name_ = value; + onChanged(); + return this; + } + /** + * string name = 2; + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); onChanged(); return this; } /** - * repeated string comp_string = 1; - * @param value The compString to add. + * string name = 2; + * @param value The bytes for name to set. * @return This builder for chaining. */ - public Builder addCompString( + public Builder setNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + private java.lang.Object type_ = ""; + /** + * string type = 3; + * @return The type. + */ + public java.lang.String getType() { + java.lang.Object ref = type_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + type_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string type = 3; + * @return The bytes for type. + */ + public com.google.protobuf.ByteString + getTypeBytes() { + java.lang.Object ref = type_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + type_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string type = 3; + * @param value The type to set. + * @return This builder for chaining. + */ + public Builder setType( java.lang.String value) { if (value == null) { throw new NullPointerException(); } - ensureCompStringIsMutable(); - compString_.add(value); + + type_ = value; onChanged(); return this; } /** - * repeated string comp_string = 1; - * @param values The compString to add. + * string type = 3; * @return This builder for chaining. */ - public Builder addAllCompString( - java.lang.Iterable values) { - ensureCompStringIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, compString_); + public Builder clearType() { + + type_ = getDefaultInstance().getType(); onChanged(); return this; } /** - * repeated string comp_string = 1; + * string type = 3; + * @param value The bytes for type to set. * @return This builder for chaining. */ - public Builder clearCompString() { - compString_ = com.google.protobuf.LazyStringArrayList.EMPTY; - bitField0_ = (bitField0_ & ~0x00000001); + public Builder setTypeBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + type_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.MapField< + java.lang.String, java.lang.String> attributes_; + private com.google.protobuf.MapField + internalGetAttributes() { + if (attributes_ == null) { + return com.google.protobuf.MapField.emptyMapField( + AttributesDefaultEntryHolder.defaultEntry); + } + return attributes_; + } + private com.google.protobuf.MapField + internalGetMutableAttributes() { + onChanged();; + if (attributes_ == null) { + attributes_ = com.google.protobuf.MapField.newMapField( + AttributesDefaultEntryHolder.defaultEntry); + } + if (!attributes_.isMutable()) { + attributes_ = attributes_.copy(); + } + return attributes_; + } + + public int getAttributesCount() { + return internalGetAttributes().getMap().size(); + } + /** + *
    +       * dict[attr.name => json.dumps(attr.value)]
    +       * 
    + * + * map<string, string> attributes = 4; + */ + + @java.lang.Override + public boolean containsAttributes( + java.lang.String key) { + if (key == null) { throw new java.lang.NullPointerException(); } + return internalGetAttributes().getMap().containsKey(key); + } + /** + * Use {@link #getAttributesMap()} instead. + */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getAttributes() { + return getAttributesMap(); + } + /** + *
    +       * dict[attr.name => json.dumps(attr.value)]
    +       * 
    + * + * map<string, string> attributes = 4; + */ + @java.lang.Override + + public java.util.Map getAttributesMap() { + return internalGetAttributes().getMap(); + } + /** + *
    +       * dict[attr.name => json.dumps(attr.value)]
    +       * 
    + * + * map<string, string> attributes = 4; + */ + @java.lang.Override + + public java.lang.String getAttributesOrDefault( + java.lang.String key, + java.lang.String defaultValue) { + if (key == null) { throw new java.lang.NullPointerException(); } + java.util.Map map = + internalGetAttributes().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + *
    +       * dict[attr.name => json.dumps(attr.value)]
    +       * 
    + * + * map<string, string> attributes = 4; + */ + @java.lang.Override + + public java.lang.String getAttributesOrThrow( + java.lang.String key) { + if (key == null) { throw new java.lang.NullPointerException(); } + java.util.Map map = + internalGetAttributes().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearAttributes() { + internalGetMutableAttributes().getMutableMap() + .clear(); + return this; + } + /** + *
    +       * dict[attr.name => json.dumps(attr.value)]
    +       * 
    + * + * map<string, string> attributes = 4; + */ + + public Builder removeAttributes( + java.lang.String key) { + if (key == null) { throw new java.lang.NullPointerException(); } + internalGetMutableAttributes().getMutableMap() + .remove(key); + return this; + } + /** + * Use alternate mutation accessors instead. + */ + @java.lang.Deprecated + public java.util.Map + getMutableAttributes() { + return internalGetMutableAttributes().getMutableMap(); + } + /** + *
    +       * dict[attr.name => json.dumps(attr.value)]
    +       * 
    + * + * map<string, string> attributes = 4; + */ + public Builder putAttributes( + java.lang.String key, + java.lang.String value) { + if (key == null) { throw new java.lang.NullPointerException(); } + if (value == null) { throw new java.lang.NullPointerException(); } + internalGetMutableAttributes().getMutableMap() + .put(key, value); + return this; + } + /** + *
    +       * dict[attr.name => json.dumps(attr.value)]
    +       * 
    + * + * map<string, string> attributes = 4; + */ + + public Builder putAllAttributes( + java.util.Map values) { + internalGetMutableAttributes().getMutableMap() + .putAll(values); + return this; + } + + private java.lang.Object parent_ = ""; + /** + * string parent = 5; + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string parent = 5; + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString + getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string parent = 5; + * @param value The parent to set. + * @return This builder for chaining. + */ + public Builder setParent( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + parent_ = value; onChanged(); return this; } /** - * repeated string comp_string = 1; - * @param value The bytes of the compString to add. + * string parent = 5; * @return This builder for chaining. */ - public Builder addCompStringBytes( + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + /** + * string parent = 5; + * @param value The bytes for parent to set. + * @return This builder for chaining. + */ + public Builder setParentBytes( com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - ensureCompStringIsMutable(); - compString_.add(value); + + parent_ = value; onChanged(); return this; } @@ -23670,6 +24504,568 @@ public final class ContextOuterClass { } + public interface LinkAttributesOrBuilder extends + // @@protoc_insertion_point(interface_extends:context.LinkAttributes) + com.google.protobuf.MessageOrBuilder { + + /** + * float total_capacity_gbps = 1; + * @return The totalCapacityGbps. + */ + float getTotalCapacityGbps(); + + /** + * float used_capacity_gbps = 2; + * @return The usedCapacityGbps. + */ + float getUsedCapacityGbps(); + } + /** + * Protobuf type {@code context.LinkAttributes} + */ + public static final class LinkAttributes extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:context.LinkAttributes) + LinkAttributesOrBuilder { + private static final long serialVersionUID = 0L; + // Use LinkAttributes.newBuilder() to construct. + private LinkAttributes(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private LinkAttributes() { + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new LinkAttributes(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private LinkAttributes( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 13: { + + totalCapacityGbps_ = input.readFloat(); + break; + } + case 21: { + + usedCapacityGbps_ = input.readFloat(); + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return context.ContextOuterClass.internal_static_context_LinkAttributes_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return context.ContextOuterClass.internal_static_context_LinkAttributes_fieldAccessorTable + .ensureFieldAccessorsInitialized( + context.ContextOuterClass.LinkAttributes.class, context.ContextOuterClass.LinkAttributes.Builder.class); + } + + public static final int TOTAL_CAPACITY_GBPS_FIELD_NUMBER = 1; + private float totalCapacityGbps_; + /** + * float total_capacity_gbps = 1; + * @return The totalCapacityGbps. + */ + @java.lang.Override + public float getTotalCapacityGbps() { + return totalCapacityGbps_; + } + + public static final int USED_CAPACITY_GBPS_FIELD_NUMBER = 2; + private float usedCapacityGbps_; + /** + * float used_capacity_gbps = 2; + * @return The usedCapacityGbps. + */ + @java.lang.Override + public float getUsedCapacityGbps() { + return usedCapacityGbps_; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (totalCapacityGbps_ != 0F) { + output.writeFloat(1, totalCapacityGbps_); + } + if (usedCapacityGbps_ != 0F) { + output.writeFloat(2, usedCapacityGbps_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (totalCapacityGbps_ != 0F) { + size += com.google.protobuf.CodedOutputStream + .computeFloatSize(1, totalCapacityGbps_); + } + if (usedCapacityGbps_ != 0F) { + size += com.google.protobuf.CodedOutputStream + .computeFloatSize(2, usedCapacityGbps_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof context.ContextOuterClass.LinkAttributes)) { + return super.equals(obj); + } + context.ContextOuterClass.LinkAttributes other = (context.ContextOuterClass.LinkAttributes) obj; + + if (java.lang.Float.floatToIntBits(getTotalCapacityGbps()) + != java.lang.Float.floatToIntBits( + other.getTotalCapacityGbps())) return false; + if (java.lang.Float.floatToIntBits(getUsedCapacityGbps()) + != java.lang.Float.floatToIntBits( + other.getUsedCapacityGbps())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + TOTAL_CAPACITY_GBPS_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits( + getTotalCapacityGbps()); + hash = (37 * hash) + USED_CAPACITY_GBPS_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits( + getUsedCapacityGbps()); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static context.ContextOuterClass.LinkAttributes parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static context.ContextOuterClass.LinkAttributes parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static context.ContextOuterClass.LinkAttributes parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static context.ContextOuterClass.LinkAttributes parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static context.ContextOuterClass.LinkAttributes parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static context.ContextOuterClass.LinkAttributes parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static context.ContextOuterClass.LinkAttributes parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static context.ContextOuterClass.LinkAttributes parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static context.ContextOuterClass.LinkAttributes parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static context.ContextOuterClass.LinkAttributes parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static context.ContextOuterClass.LinkAttributes parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static context.ContextOuterClass.LinkAttributes parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(context.ContextOuterClass.LinkAttributes prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code context.LinkAttributes} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:context.LinkAttributes) + context.ContextOuterClass.LinkAttributesOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return context.ContextOuterClass.internal_static_context_LinkAttributes_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return context.ContextOuterClass.internal_static_context_LinkAttributes_fieldAccessorTable + .ensureFieldAccessorsInitialized( + context.ContextOuterClass.LinkAttributes.class, context.ContextOuterClass.LinkAttributes.Builder.class); + } + + // Construct using context.ContextOuterClass.LinkAttributes.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + totalCapacityGbps_ = 0F; + + usedCapacityGbps_ = 0F; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return context.ContextOuterClass.internal_static_context_LinkAttributes_descriptor; + } + + @java.lang.Override + public context.ContextOuterClass.LinkAttributes getDefaultInstanceForType() { + return context.ContextOuterClass.LinkAttributes.getDefaultInstance(); + } + + @java.lang.Override + public context.ContextOuterClass.LinkAttributes build() { + context.ContextOuterClass.LinkAttributes result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public context.ContextOuterClass.LinkAttributes buildPartial() { + context.ContextOuterClass.LinkAttributes result = new context.ContextOuterClass.LinkAttributes(this); + result.totalCapacityGbps_ = totalCapacityGbps_; + result.usedCapacityGbps_ = usedCapacityGbps_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof context.ContextOuterClass.LinkAttributes) { + return mergeFrom((context.ContextOuterClass.LinkAttributes)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(context.ContextOuterClass.LinkAttributes other) { + if (other == context.ContextOuterClass.LinkAttributes.getDefaultInstance()) return this; + if (other.getTotalCapacityGbps() != 0F) { + setTotalCapacityGbps(other.getTotalCapacityGbps()); + } + if (other.getUsedCapacityGbps() != 0F) { + setUsedCapacityGbps(other.getUsedCapacityGbps()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + context.ContextOuterClass.LinkAttributes parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (context.ContextOuterClass.LinkAttributes) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private float totalCapacityGbps_ ; + /** + * float total_capacity_gbps = 1; + * @return The totalCapacityGbps. + */ + @java.lang.Override + public float getTotalCapacityGbps() { + return totalCapacityGbps_; + } + /** + * float total_capacity_gbps = 1; + * @param value The totalCapacityGbps to set. + * @return This builder for chaining. + */ + public Builder setTotalCapacityGbps(float value) { + + totalCapacityGbps_ = value; + onChanged(); + return this; + } + /** + * float total_capacity_gbps = 1; + * @return This builder for chaining. + */ + public Builder clearTotalCapacityGbps() { + + totalCapacityGbps_ = 0F; + onChanged(); + return this; + } + + private float usedCapacityGbps_ ; + /** + * float used_capacity_gbps = 2; + * @return The usedCapacityGbps. + */ + @java.lang.Override + public float getUsedCapacityGbps() { + return usedCapacityGbps_; + } + /** + * float used_capacity_gbps = 2; + * @param value The usedCapacityGbps to set. + * @return This builder for chaining. + */ + public Builder setUsedCapacityGbps(float value) { + + usedCapacityGbps_ = value; + onChanged(); + return this; + } + /** + * float used_capacity_gbps = 2; + * @return This builder for chaining. + */ + public Builder clearUsedCapacityGbps() { + + usedCapacityGbps_ = 0F; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:context.LinkAttributes) + } + + // @@protoc_insertion_point(class_scope:context.LinkAttributes) + private static final context.ContextOuterClass.LinkAttributes DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new context.ContextOuterClass.LinkAttributes(); + } + + public static context.ContextOuterClass.LinkAttributes getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public LinkAttributes parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new LinkAttributes(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public context.ContextOuterClass.LinkAttributes getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + public interface LinkOrBuilder extends // @@protoc_insertion_point(interface_extends:context.Link) com.google.protobuf.MessageOrBuilder { @@ -23724,6 +25120,21 @@ public final class ContextOuterClass { */ context.ContextOuterClass.EndPointIdOrBuilder getLinkEndpointIdsOrBuilder( int index); + + /** + * .context.LinkAttributes attributes = 4; + * @return Whether the attributes field is set. + */ + boolean hasAttributes(); + /** + * .context.LinkAttributes attributes = 4; + * @return The attributes. + */ + context.ContextOuterClass.LinkAttributes getAttributes(); + /** + * .context.LinkAttributes attributes = 4; + */ + context.ContextOuterClass.LinkAttributesOrBuilder getAttributesOrBuilder(); } /** * Protobuf type {@code context.Link} @@ -23801,6 +25212,19 @@ public final class ContextOuterClass { input.readMessage(context.ContextOuterClass.EndPointId.parser(), extensionRegistry)); break; } + case 34: { + context.ContextOuterClass.LinkAttributes.Builder subBuilder = null; + if (attributes_ != null) { + subBuilder = attributes_.toBuilder(); + } + attributes_ = input.readMessage(context.ContextOuterClass.LinkAttributes.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(attributes_); + attributes_ = subBuilder.buildPartial(); + } + + break; + } default: { if (!parseUnknownField( input, unknownFields, extensionRegistry, tag)) { @@ -23940,6 +25364,32 @@ public final class ContextOuterClass { return linkEndpointIds_.get(index); } + public static final int ATTRIBUTES_FIELD_NUMBER = 4; + private context.ContextOuterClass.LinkAttributes attributes_; + /** + * .context.LinkAttributes attributes = 4; + * @return Whether the attributes field is set. + */ + @java.lang.Override + public boolean hasAttributes() { + return attributes_ != null; + } + /** + * .context.LinkAttributes attributes = 4; + * @return The attributes. + */ + @java.lang.Override + public context.ContextOuterClass.LinkAttributes getAttributes() { + return attributes_ == null ? context.ContextOuterClass.LinkAttributes.getDefaultInstance() : attributes_; + } + /** + * .context.LinkAttributes attributes = 4; + */ + @java.lang.Override + public context.ContextOuterClass.LinkAttributesOrBuilder getAttributesOrBuilder() { + return getAttributes(); + } + private byte memoizedIsInitialized = -1; @java.lang.Override public final boolean isInitialized() { @@ -23963,6 +25413,9 @@ public final class ContextOuterClass { for (int i = 0; i < linkEndpointIds_.size(); i++) { output.writeMessage(3, linkEndpointIds_.get(i)); } + if (attributes_ != null) { + output.writeMessage(4, getAttributes()); + } unknownFields.writeTo(output); } @@ -23983,6 +25436,10 @@ public final class ContextOuterClass { size += com.google.protobuf.CodedOutputStream .computeMessageSize(3, linkEndpointIds_.get(i)); } + if (attributes_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(4, getAttributes()); + } size += unknownFields.getSerializedSize(); memoizedSize = size; return size; @@ -24007,6 +25464,11 @@ public final class ContextOuterClass { .equals(other.getName())) return false; if (!getLinkEndpointIdsList() .equals(other.getLinkEndpointIdsList())) return false; + if (hasAttributes() != other.hasAttributes()) return false; + if (hasAttributes()) { + if (!getAttributes() + .equals(other.getAttributes())) return false; + } if (!unknownFields.equals(other.unknownFields)) return false; return true; } @@ -24028,6 +25490,10 @@ public final class ContextOuterClass { hash = (37 * hash) + LINK_ENDPOINT_IDS_FIELD_NUMBER; hash = (53 * hash) + getLinkEndpointIdsList().hashCode(); } + if (hasAttributes()) { + hash = (37 * hash) + ATTRIBUTES_FIELD_NUMBER; + hash = (53 * hash) + getAttributes().hashCode(); + } hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; @@ -24176,6 +25642,12 @@ public final class ContextOuterClass { } else { linkEndpointIdsBuilder_.clear(); } + if (attributesBuilder_ == null) { + attributes_ = null; + } else { + attributes_ = null; + attributesBuilder_ = null; + } return this; } @@ -24218,6 +25690,11 @@ public final class ContextOuterClass { } else { result.linkEndpointIds_ = linkEndpointIdsBuilder_.build(); } + if (attributesBuilder_ == null) { + result.attributes_ = attributes_; + } else { + result.attributes_ = attributesBuilder_.build(); + } onBuilt(); return result; } @@ -24299,6 +25776,9 @@ public final class ContextOuterClass { } } } + if (other.hasAttributes()) { + mergeAttributes(other.getAttributes()); + } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; @@ -24763,6 +26243,125 @@ public final class ContextOuterClass { } return linkEndpointIdsBuilder_; } + + private context.ContextOuterClass.LinkAttributes attributes_; + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.LinkAttributes, context.ContextOuterClass.LinkAttributes.Builder, context.ContextOuterClass.LinkAttributesOrBuilder> attributesBuilder_; + /** + * .context.LinkAttributes attributes = 4; + * @return Whether the attributes field is set. + */ + public boolean hasAttributes() { + return attributesBuilder_ != null || attributes_ != null; + } + /** + * .context.LinkAttributes attributes = 4; + * @return The attributes. + */ + public context.ContextOuterClass.LinkAttributes getAttributes() { + if (attributesBuilder_ == null) { + return attributes_ == null ? context.ContextOuterClass.LinkAttributes.getDefaultInstance() : attributes_; + } else { + return attributesBuilder_.getMessage(); + } + } + /** + * .context.LinkAttributes attributes = 4; + */ + public Builder setAttributes(context.ContextOuterClass.LinkAttributes value) { + if (attributesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + attributes_ = value; + onChanged(); + } else { + attributesBuilder_.setMessage(value); + } + + return this; + } + /** + * .context.LinkAttributes attributes = 4; + */ + public Builder setAttributes( + context.ContextOuterClass.LinkAttributes.Builder builderForValue) { + if (attributesBuilder_ == null) { + attributes_ = builderForValue.build(); + onChanged(); + } else { + attributesBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * .context.LinkAttributes attributes = 4; + */ + public Builder mergeAttributes(context.ContextOuterClass.LinkAttributes value) { + if (attributesBuilder_ == null) { + if (attributes_ != null) { + attributes_ = + context.ContextOuterClass.LinkAttributes.newBuilder(attributes_).mergeFrom(value).buildPartial(); + } else { + attributes_ = value; + } + onChanged(); + } else { + attributesBuilder_.mergeFrom(value); + } + + return this; + } + /** + * .context.LinkAttributes attributes = 4; + */ + public Builder clearAttributes() { + if (attributesBuilder_ == null) { + attributes_ = null; + onChanged(); + } else { + attributes_ = null; + attributesBuilder_ = null; + } + + return this; + } + /** + * .context.LinkAttributes attributes = 4; + */ + public context.ContextOuterClass.LinkAttributes.Builder getAttributesBuilder() { + + onChanged(); + return getAttributesFieldBuilder().getBuilder(); + } + /** + * .context.LinkAttributes attributes = 4; + */ + public context.ContextOuterClass.LinkAttributesOrBuilder getAttributesOrBuilder() { + if (attributesBuilder_ != null) { + return attributesBuilder_.getMessageOrBuilder(); + } else { + return attributes_ == null ? + context.ContextOuterClass.LinkAttributes.getDefaultInstance() : attributes_; + } + } + /** + * .context.LinkAttributes attributes = 4; + */ + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.LinkAttributes, context.ContextOuterClass.LinkAttributes.Builder, context.ContextOuterClass.LinkAttributesOrBuilder> + getAttributesFieldBuilder() { + if (attributesBuilder_ == null) { + attributesBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.LinkAttributes, context.ContextOuterClass.LinkAttributes.Builder, context.ContextOuterClass.LinkAttributesOrBuilder>( + getAttributes(), + getParentForChildren(), + isClean()); + attributes_ = null; + } + return attributesBuilder_; + } @java.lang.Override public final Builder setUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields) { @@ -73697,6 +75296,11 @@ public final class ContextOuterClass { private static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_context_Component_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_context_Component_AttributesEntry_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_context_Component_AttributesEntry_fieldAccessorTable; private static final com.google.protobuf.Descriptors.Descriptor internal_static_context_DeviceConfig_descriptor; private static final @@ -73727,6 +75331,11 @@ public final class ContextOuterClass { private static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_context_LinkId_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_context_LinkAttributes_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_context_LinkAttributes_fieldAccessorTable; private static final com.google.protobuf.Descriptors.Descriptor internal_static_context_Link_descriptor; private static final @@ -74034,290 +75643,297 @@ public final class ContextOuterClass { "vent\022\035\n\005event\030\001 \001(\0132\016.context.Event\022(\n\013t" + "opology_id\030\002 \001(\0132\023.context.TopologyId\".\n" + "\010DeviceId\022\"\n\013device_uuid\030\001 \001(\0132\r.context" + - ".Uuid\"\371\002\n\006Device\022$\n\tdevice_id\030\001 \001(\0132\021.co" + + ".Uuid\"\372\002\n\006Device\022$\n\tdevice_id\030\001 \001(\0132\021.co" + "ntext.DeviceId\022\014\n\004name\030\002 \001(\t\022\023\n\013device_t" + "ype\030\003 \001(\t\022,\n\rdevice_config\030\004 \001(\0132\025.conte" + "xt.DeviceConfig\022G\n\031device_operational_st" + "atus\030\005 \001(\0162$.context.DeviceOperationalSt" + "atusEnum\0221\n\016device_drivers\030\006 \003(\0162\031.conte" + "xt.DeviceDriverEnum\022+\n\020device_endpoints\030" + - "\007 \003(\0132\021.context.EndPoint\022%\n\tcomponent\030\010 " + - "\003(\0132\022.context.Component\022(\n\rcontroller_id" + - "\030\t \001(\0132\021.context.DeviceId\" \n\tComponent\022\023" + - "\n\013comp_string\030\001 \003(\t\"9\n\014DeviceConfig\022)\n\014c" + - "onfig_rules\030\001 \003(\0132\023.context.ConfigRule\"5" + - "\n\014DeviceIdList\022%\n\ndevice_ids\030\001 \003(\0132\021.con" + - "text.DeviceId\".\n\nDeviceList\022 \n\007devices\030\001" + - " \003(\0132\017.context.Device\"\216\001\n\014DeviceFilter\022)" + - "\n\ndevice_ids\030\001 \001(\0132\025.context.DeviceIdLis" + - "t\022\031\n\021include_endpoints\030\002 \001(\010\022\034\n\024include_" + - "config_rules\030\003 \001(\010\022\032\n\022include_components" + - "\030\004 \001(\010\"\200\001\n\013DeviceEvent\022\035\n\005event\030\001 \001(\0132\016." + - "context.Event\022$\n\tdevice_id\030\002 \001(\0132\021.conte" + - "xt.DeviceId\022,\n\rdevice_config\030\003 \001(\0132\025.con" + - "text.DeviceConfig\"*\n\006LinkId\022 \n\tlink_uuid" + - "\030\001 \001(\0132\r.context.Uuid\"f\n\004Link\022 \n\007link_id" + - "\030\001 \001(\0132\017.context.LinkId\022\014\n\004name\030\002 \001(\t\022.\n" + - "\021link_endpoint_ids\030\003 \003(\0132\023.context.EndPo" + - "intId\"/\n\nLinkIdList\022!\n\010link_ids\030\001 \003(\0132\017." + - "context.LinkId\"(\n\010LinkList\022\034\n\005links\030\001 \003(" + - "\0132\r.context.Link\"L\n\tLinkEvent\022\035\n\005event\030\001" + - " \001(\0132\016.context.Event\022 \n\007link_id\030\002 \001(\0132\017." + - "context.LinkId\"X\n\tServiceId\022&\n\ncontext_i" + - "d\030\001 \001(\0132\022.context.ContextId\022#\n\014service_u" + - "uid\030\002 \001(\0132\r.context.Uuid\"\333\002\n\007Service\022&\n\n" + - "service_id\030\001 \001(\0132\022.context.ServiceId\022\014\n\004" + - "name\030\002 \001(\t\022.\n\014service_type\030\003 \001(\0162\030.conte" + - "xt.ServiceTypeEnum\0221\n\024service_endpoint_i" + - "ds\030\004 \003(\0132\023.context.EndPointId\0220\n\023service" + - "_constraints\030\005 \003(\0132\023.context.Constraint\022" + - ".\n\016service_status\030\006 \001(\0132\026.context.Servic" + - "eStatus\022.\n\016service_config\030\007 \001(\0132\026.contex" + - "t.ServiceConfig\022%\n\ttimestamp\030\010 \001(\0132\022.con" + - "text.Timestamp\"C\n\rServiceStatus\0222\n\016servi" + - "ce_status\030\001 \001(\0162\032.context.ServiceStatusE" + - "num\":\n\rServiceConfig\022)\n\014config_rules\030\001 \003" + - "(\0132\023.context.ConfigRule\"8\n\rServiceIdList" + - "\022\'\n\013service_ids\030\001 \003(\0132\022.context.ServiceI" + - "d\"1\n\013ServiceList\022\"\n\010services\030\001 \003(\0132\020.con" + - "text.Service\"\225\001\n\rServiceFilter\022+\n\013servic" + - "e_ids\030\001 \001(\0132\026.context.ServiceIdList\022\034\n\024i" + - "nclude_endpoint_ids\030\002 \001(\010\022\033\n\023include_con" + - "straints\030\003 \001(\010\022\034\n\024include_config_rules\030\004" + - " \001(\010\"U\n\014ServiceEvent\022\035\n\005event\030\001 \001(\0132\016.co" + - "ntext.Event\022&\n\nservice_id\030\002 \001(\0132\022.contex" + - "t.ServiceId\"T\n\007SliceId\022&\n\ncontext_id\030\001 \001" + - "(\0132\022.context.ContextId\022!\n\nslice_uuid\030\002 \001" + - "(\0132\r.context.Uuid\"\240\003\n\005Slice\022\"\n\010slice_id\030" + - "\001 \001(\0132\020.context.SliceId\022\014\n\004name\030\002 \001(\t\022/\n" + - "\022slice_endpoint_ids\030\003 \003(\0132\023.context.EndP" + - "ointId\022.\n\021slice_constraints\030\004 \003(\0132\023.cont" + - "ext.Constraint\022-\n\021slice_service_ids\030\005 \003(" + - "\0132\022.context.ServiceId\022,\n\022slice_subslice_" + - "ids\030\006 \003(\0132\020.context.SliceId\022*\n\014slice_sta" + - "tus\030\007 \001(\0132\024.context.SliceStatus\022*\n\014slice" + - "_config\030\010 \001(\0132\024.context.SliceConfig\022(\n\013s" + - "lice_owner\030\t \001(\0132\023.context.SliceOwner\022%\n" + - "\ttimestamp\030\n \001(\0132\022.context.Timestamp\"E\n\n" + - "SliceOwner\022!\n\nowner_uuid\030\001 \001(\0132\r.context" + - ".Uuid\022\024\n\014owner_string\030\002 \001(\t\"=\n\013SliceStat" + - "us\022.\n\014slice_status\030\001 \001(\0162\030.context.Slice" + - "StatusEnum\"8\n\013SliceConfig\022)\n\014config_rule" + - "s\030\001 \003(\0132\023.context.ConfigRule\"2\n\013SliceIdL" + - "ist\022#\n\tslice_ids\030\001 \003(\0132\020.context.SliceId" + - "\"+\n\tSliceList\022\036\n\006slices\030\001 \003(\0132\016.context." + - "Slice\"\312\001\n\013SliceFilter\022\'\n\tslice_ids\030\001 \001(\013" + - "2\024.context.SliceIdList\022\034\n\024include_endpoi" + - "nt_ids\030\002 \001(\010\022\033\n\023include_constraints\030\003 \001(" + - "\010\022\033\n\023include_service_ids\030\004 \001(\010\022\034\n\024includ" + - "e_subslice_ids\030\005 \001(\010\022\034\n\024include_config_r" + - "ules\030\006 \001(\010\"O\n\nSliceEvent\022\035\n\005event\030\001 \001(\0132" + - "\016.context.Event\022\"\n\010slice_id\030\002 \001(\0132\020.cont" + - "ext.SliceId\"6\n\014ConnectionId\022&\n\017connectio" + - "n_uuid\030\001 \001(\0132\r.context.Uuid\"2\n\025Connectio" + - "nSettings_L0\022\031\n\021lsp_symbolic_name\030\001 \001(\t\"" + - "\236\001\n\025ConnectionSettings_L2\022\027\n\017src_mac_add" + - "ress\030\001 \001(\t\022\027\n\017dst_mac_address\030\002 \001(\t\022\022\n\ne" + - "ther_type\030\003 \001(\r\022\017\n\007vlan_id\030\004 \001(\r\022\022\n\nmpls" + - "_label\030\005 \001(\r\022\032\n\022mpls_traffic_class\030\006 \001(\r" + - "\"t\n\025ConnectionSettings_L3\022\026\n\016src_ip_addr" + - "ess\030\001 \001(\t\022\026\n\016dst_ip_address\030\002 \001(\t\022\014\n\004dsc" + - "p\030\003 \001(\r\022\020\n\010protocol\030\004 \001(\r\022\013\n\003ttl\030\005 \001(\r\"[" + - "\n\025ConnectionSettings_L4\022\020\n\010src_port\030\001 \001(" + - "\r\022\020\n\010dst_port\030\002 \001(\r\022\021\n\ttcp_flags\030\003 \001(\r\022\013" + - "\n\003ttl\030\004 \001(\r\"\304\001\n\022ConnectionSettings\022*\n\002l0" + - "\030\001 \001(\0132\036.context.ConnectionSettings_L0\022*" + - "\n\002l2\030\002 \001(\0132\036.context.ConnectionSettings_" + - "L2\022*\n\002l3\030\003 \001(\0132\036.context.ConnectionSetti" + - "ngs_L3\022*\n\002l4\030\004 \001(\0132\036.context.ConnectionS" + - "ettings_L4\"\363\001\n\nConnection\022,\n\rconnection_" + - "id\030\001 \001(\0132\025.context.ConnectionId\022&\n\nservi" + - "ce_id\030\002 \001(\0132\022.context.ServiceId\0223\n\026path_" + - "hops_endpoint_ids\030\003 \003(\0132\023.context.EndPoi" + - "ntId\022+\n\017sub_service_ids\030\004 \003(\0132\022.context." + - "ServiceId\022-\n\010settings\030\005 \001(\0132\033.context.Co" + - "nnectionSettings\"A\n\020ConnectionIdList\022-\n\016" + - "connection_ids\030\001 \003(\0132\025.context.Connectio" + - "nId\":\n\016ConnectionList\022(\n\013connections\030\001 \003" + - "(\0132\023.context.Connection\"^\n\017ConnectionEve" + - "nt\022\035\n\005event\030\001 \001(\0132\016.context.Event\022,\n\rcon" + - "nection_id\030\002 \001(\0132\025.context.ConnectionId\"" + - "\202\001\n\nEndPointId\022(\n\013topology_id\030\001 \001(\0132\023.co" + - "ntext.TopologyId\022$\n\tdevice_id\030\002 \001(\0132\021.co" + - "ntext.DeviceId\022$\n\rendpoint_uuid\030\003 \001(\0132\r." + - "context.Uuid\"\302\001\n\010EndPoint\022(\n\013endpoint_id" + - "\030\001 \001(\0132\023.context.EndPointId\022\014\n\004name\030\002 \001(" + - "\t\022\025\n\rendpoint_type\030\003 \001(\t\0229\n\020kpi_sample_t" + - "ypes\030\004 \003(\0162\037.kpi_sample_types.KpiSampleT" + - "ype\022,\n\021endpoint_location\030\005 \001(\0132\021.context" + - ".Location\"{\n\014EndPointName\022(\n\013endpoint_id" + - "\030\001 \001(\0132\023.context.EndPointId\022\023\n\013device_na" + - "me\030\002 \001(\t\022\025\n\rendpoint_name\030\003 \001(\t\022\025\n\rendpo" + - "int_type\030\004 \001(\t\";\n\016EndPointIdList\022)\n\014endp" + - "oint_ids\030\001 \003(\0132\023.context.EndPointId\"A\n\020E" + - "ndPointNameList\022-\n\016endpoint_names\030\001 \003(\0132" + - "\025.context.EndPointName\"A\n\021ConfigRule_Cus" + - "tom\022\024\n\014resource_key\030\001 \001(\t\022\026\n\016resource_va" + - "lue\030\002 \001(\t\"]\n\016ConfigRule_ACL\022(\n\013endpoint_" + - "id\030\001 \001(\0132\023.context.EndPointId\022!\n\010rule_se" + - "t\030\002 \001(\0132\017.acl.AclRuleSet\"\234\001\n\nConfigRule\022" + - ")\n\006action\030\001 \001(\0162\031.context.ConfigActionEn" + - "um\022,\n\006custom\030\002 \001(\0132\032.context.ConfigRule_" + - "CustomH\000\022&\n\003acl\030\003 \001(\0132\027.context.ConfigRu" + - "le_ACLH\000B\r\n\013config_rule\"F\n\021Constraint_Cu" + - "stom\022\027\n\017constraint_type\030\001 \001(\t\022\030\n\020constra" + - "int_value\030\002 \001(\t\"E\n\023Constraint_Schedule\022\027" + - "\n\017start_timestamp\030\001 \001(\002\022\025\n\rduration_days" + - "\030\002 \001(\002\"3\n\014GPS_Position\022\020\n\010latitude\030\001 \001(\002" + - "\022\021\n\tlongitude\030\002 \001(\002\"W\n\010Location\022\020\n\006regio" + - "n\030\001 \001(\tH\000\022-\n\014gps_position\030\002 \001(\0132\025.contex" + - "t.GPS_PositionH\000B\n\n\010location\"l\n\033Constrai" + - "nt_EndPointLocation\022(\n\013endpoint_id\030\001 \001(\013" + - "2\023.context.EndPointId\022#\n\010location\030\002 \001(\0132" + - "\021.context.Location\"Y\n\033Constraint_EndPoin" + - "tPriority\022(\n\013endpoint_id\030\001 \001(\0132\023.context" + - ".EndPointId\022\020\n\010priority\030\002 \001(\r\"0\n\026Constra" + - "int_SLA_Latency\022\026\n\016e2e_latency_ms\030\001 \001(\002\"" + - "0\n\027Constraint_SLA_Capacity\022\025\n\rcapacity_g" + - "bps\030\001 \001(\002\"c\n\033Constraint_SLA_Availability" + - "\022\032\n\022num_disjoint_paths\030\001 \001(\r\022\022\n\nall_acti" + - "ve\030\002 \001(\010\022\024\n\014availability\030\003 \001(\002\"V\n\036Constr" + - "aint_SLA_Isolation_level\0224\n\017isolation_le" + - "vel\030\001 \003(\0162\033.context.IsolationLevelEnum\"\242" + - "\001\n\025Constraint_Exclusions\022\024\n\014is_permanent" + - "\030\001 \001(\010\022%\n\ndevice_ids\030\002 \003(\0132\021.context.Dev" + - "iceId\022)\n\014endpoint_ids\030\003 \003(\0132\023.context.En" + - "dPointId\022!\n\010link_ids\030\004 \003(\0132\017.context.Lin" + - "kId\"\333\004\n\nConstraint\022-\n\006action\030\001 \001(\0162\035.con" + - "text.ConstraintActionEnum\022,\n\006custom\030\002 \001(" + - "\0132\032.context.Constraint_CustomH\000\0220\n\010sched" + - "ule\030\003 \001(\0132\034.context.Constraint_ScheduleH" + - "\000\022A\n\021endpoint_location\030\004 \001(\0132$.context.C" + - "onstraint_EndPointLocationH\000\022A\n\021endpoint" + - "_priority\030\005 \001(\0132$.context.Constraint_End" + - "PointPriorityH\000\0228\n\014sla_capacity\030\006 \001(\0132 ." + - "context.Constraint_SLA_CapacityH\000\0226\n\013sla" + - "_latency\030\007 \001(\0132\037.context.Constraint_SLA_" + - "LatencyH\000\022@\n\020sla_availability\030\010 \001(\0132$.co" + - "ntext.Constraint_SLA_AvailabilityH\000\022@\n\rs" + - "la_isolation\030\t \001(\0132\'.context.Constraint_" + - "SLA_Isolation_levelH\000\0224\n\nexclusions\030\n \001(" + - "\0132\036.context.Constraint_ExclusionsH\000B\014\n\nc" + - "onstraint\"^\n\022TeraFlowController\022&\n\nconte" + - "xt_id\030\001 \001(\0132\022.context.ContextId\022\022\n\nip_ad" + - "dress\030\002 \001(\t\022\014\n\004port\030\003 \001(\r\"U\n\024Authenticat" + - "ionResult\022&\n\ncontext_id\030\001 \001(\0132\022.context." + - "ContextId\022\025\n\rauthenticated\030\002 \001(\010*j\n\rEven" + - "tTypeEnum\022\027\n\023EVENTTYPE_UNDEFINED\020\000\022\024\n\020EV" + - "ENTTYPE_CREATE\020\001\022\024\n\020EVENTTYPE_UPDATE\020\002\022\024" + - "\n\020EVENTTYPE_REMOVE\020\003*\231\002\n\020DeviceDriverEnu" + - "m\022\032\n\026DEVICEDRIVER_UNDEFINED\020\000\022\033\n\027DEVICED" + - "RIVER_OPENCONFIG\020\001\022\036\n\032DEVICEDRIVER_TRANS" + - "PORT_API\020\002\022\023\n\017DEVICEDRIVER_P4\020\003\022&\n\"DEVIC" + - "EDRIVER_IETF_NETWORK_TOPOLOGY\020\004\022\033\n\027DEVIC" + - "EDRIVER_ONF_TR_352\020\005\022\023\n\017DEVICEDRIVER_XR\020" + - "\006\022\033\n\027DEVICEDRIVER_IETF_L2VPN\020\007\022 \n\034DEVICE" + - "DRIVER_GNMI_OPENCONFIG\020\010*\217\001\n\033DeviceOpera" + - "tionalStatusEnum\022%\n!DEVICEOPERATIONALSTA" + - "TUS_UNDEFINED\020\000\022$\n DEVICEOPERATIONALSTAT" + - "US_DISABLED\020\001\022#\n\037DEVICEOPERATIONALSTATUS" + - "_ENABLED\020\002*\201\001\n\017ServiceTypeEnum\022\027\n\023SERVIC" + - "ETYPE_UNKNOWN\020\000\022\024\n\020SERVICETYPE_L3NM\020\001\022\024\n" + - "\020SERVICETYPE_L2NM\020\002\022)\n%SERVICETYPE_TAPI_" + - "CONNECTIVITY_SERVICE\020\003*\304\001\n\021ServiceStatus" + - "Enum\022\033\n\027SERVICESTATUS_UNDEFINED\020\000\022\031\n\025SER" + - "VICESTATUS_PLANNED\020\001\022\030\n\024SERVICESTATUS_AC" + - "TIVE\020\002\022\032\n\026SERVICESTATUS_UPDATING\020\003\022!\n\035SE" + - "RVICESTATUS_PENDING_REMOVAL\020\004\022\036\n\032SERVICE" + - "STATUS_SLA_VIOLATED\020\005*\251\001\n\017SliceStatusEnu" + - "m\022\031\n\025SLICESTATUS_UNDEFINED\020\000\022\027\n\023SLICESTA" + - "TUS_PLANNED\020\001\022\024\n\020SLICESTATUS_INIT\020\002\022\026\n\022S" + - "LICESTATUS_ACTIVE\020\003\022\026\n\022SLICESTATUS_DEINI" + - "T\020\004\022\034\n\030SLICESTATUS_SLA_VIOLATED\020\005*]\n\020Con" + - "figActionEnum\022\032\n\026CONFIGACTION_UNDEFINED\020" + - "\000\022\024\n\020CONFIGACTION_SET\020\001\022\027\n\023CONFIGACTION_" + - "DELETE\020\002*m\n\024ConstraintActionEnum\022\036\n\032CONS" + - "TRAINTACTION_UNDEFINED\020\000\022\030\n\024CONSTRAINTAC" + - "TION_SET\020\001\022\033\n\027CONSTRAINTACTION_DELETE\020\002*" + - "\203\002\n\022IsolationLevelEnum\022\020\n\014NO_ISOLATION\020\000" + - "\022\026\n\022PHYSICAL_ISOLATION\020\001\022\025\n\021LOGICAL_ISOL" + - "ATION\020\002\022\025\n\021PROCESS_ISOLATION\020\003\022\035\n\031PHYSIC" + - "AL_MEMORY_ISOLATION\020\004\022\036\n\032PHYSICAL_NETWOR" + - "K_ISOLATION\020\005\022\036\n\032VIRTUAL_RESOURCE_ISOLAT" + - "ION\020\006\022\037\n\033NETWORK_FUNCTIONS_ISOLATION\020\007\022\025" + - "\n\021SERVICE_ISOLATION\020\0102\245\026\n\016ContextService" + - "\022:\n\016ListContextIds\022\016.context.Empty\032\026.con" + - "text.ContextIdList\"\000\0226\n\014ListContexts\022\016.c" + - "ontext.Empty\032\024.context.ContextList\"\000\0224\n\n" + - "GetContext\022\022.context.ContextId\032\020.context" + - ".Context\"\000\0224\n\nSetContext\022\020.context.Conte" + - "xt\032\022.context.ContextId\"\000\0225\n\rRemoveContex" + - "t\022\022.context.ContextId\032\016.context.Empty\"\000\022" + - "=\n\020GetContextEvents\022\016.context.Empty\032\025.co" + - "ntext.ContextEvent\"\0000\001\022@\n\017ListTopologyId" + - "s\022\022.context.ContextId\032\027.context.Topology" + - "IdList\"\000\022=\n\016ListTopologies\022\022.context.Con" + - "textId\032\025.context.TopologyList\"\000\0227\n\013GetTo" + - "pology\022\023.context.TopologyId\032\021.context.To" + - "pology\"\000\022E\n\022GetTopologyDetails\022\023.context" + - ".TopologyId\032\030.context.TopologyDetails\"\000\022" + - "7\n\013SetTopology\022\021.context.Topology\032\023.cont" + - "ext.TopologyId\"\000\0227\n\016RemoveTopology\022\023.con" + - "text.TopologyId\032\016.context.Empty\"\000\022?\n\021Get" + - "TopologyEvents\022\016.context.Empty\032\026.context" + - ".TopologyEvent\"\0000\001\0228\n\rListDeviceIds\022\016.co" + - "ntext.Empty\032\025.context.DeviceIdList\"\000\0224\n\013" + - "ListDevices\022\016.context.Empty\032\023.context.De" + - "viceList\"\000\0221\n\tGetDevice\022\021.context.Device" + - "Id\032\017.context.Device\"\000\0221\n\tSetDevice\022\017.con" + - "text.Device\032\021.context.DeviceId\"\000\0223\n\014Remo" + - "veDevice\022\021.context.DeviceId\032\016.context.Em" + - "pty\"\000\022;\n\017GetDeviceEvents\022\016.context.Empty" + - "\032\024.context.DeviceEvent\"\0000\001\022<\n\014SelectDevi" + - "ce\022\025.context.DeviceFilter\032\023.context.Devi" + - "ceList\"\000\022I\n\021ListEndPointNames\022\027.context." + - "EndPointIdList\032\031.context.EndPointNameLis" + - "t\"\000\0224\n\013ListLinkIds\022\016.context.Empty\032\023.con" + - "text.LinkIdList\"\000\0220\n\tListLinks\022\016.context" + - ".Empty\032\021.context.LinkList\"\000\022+\n\007GetLink\022\017" + - ".context.LinkId\032\r.context.Link\"\000\022+\n\007SetL" + - "ink\022\r.context.Link\032\017.context.LinkId\"\000\022/\n" + - "\nRemoveLink\022\017.context.LinkId\032\016.context.E" + - "mpty\"\000\0227\n\rGetLinkEvents\022\016.context.Empty\032" + - "\022.context.LinkEvent\"\0000\001\022>\n\016ListServiceId" + - "s\022\022.context.ContextId\032\026.context.ServiceI" + - "dList\"\000\022:\n\014ListServices\022\022.context.Contex" + - "tId\032\024.context.ServiceList\"\000\0224\n\nGetServic" + - "e\022\022.context.ServiceId\032\020.context.Service\"" + - "\000\0224\n\nSetService\022\020.context.Service\032\022.cont" + - "ext.ServiceId\"\000\0226\n\014UnsetService\022\020.contex" + - "t.Service\032\022.context.ServiceId\"\000\0225\n\rRemov" + - "eService\022\022.context.ServiceId\032\016.context.E" + - "mpty\"\000\022=\n\020GetServiceEvents\022\016.context.Emp" + - "ty\032\025.context.ServiceEvent\"\0000\001\022?\n\rSelectS" + - "ervice\022\026.context.ServiceFilter\032\024.context" + - ".ServiceList\"\000\022:\n\014ListSliceIds\022\022.context" + - ".ContextId\032\024.context.SliceIdList\"\000\0226\n\nLi" + - "stSlices\022\022.context.ContextId\032\022.context.S" + - "liceList\"\000\022.\n\010GetSlice\022\020.context.SliceId" + - "\032\016.context.Slice\"\000\022.\n\010SetSlice\022\016.context" + - ".Slice\032\020.context.SliceId\"\000\0220\n\nUnsetSlice" + - "\022\016.context.Slice\032\020.context.SliceId\"\000\0221\n\013" + - "RemoveSlice\022\020.context.SliceId\032\016.context." + - "Empty\"\000\0229\n\016GetSliceEvents\022\016.context.Empt" + - "y\032\023.context.SliceEvent\"\0000\001\0229\n\013SelectSlic" + - "e\022\024.context.SliceFilter\032\022.context.SliceL" + - "ist\"\000\022D\n\021ListConnectionIds\022\022.context.Ser" + - "viceId\032\031.context.ConnectionIdList\"\000\022@\n\017L" + - "istConnections\022\022.context.ServiceId\032\027.con" + - "text.ConnectionList\"\000\022=\n\rGetConnection\022\025" + - ".context.ConnectionId\032\023.context.Connecti" + - "on\"\000\022=\n\rSetConnection\022\023.context.Connecti" + - "on\032\025.context.ConnectionId\"\000\022;\n\020RemoveCon" + - "nection\022\025.context.ConnectionId\032\016.context" + - ".Empty\"\000\022C\n\023GetConnectionEvents\022\016.contex" + - "t.Empty\032\030.context.ConnectionEvent\"\0000\001b\006p" + - "roto3" + "\007 \003(\0132\021.context.EndPoint\022&\n\ncomponents\030\010" + + " \003(\0132\022.context.Component\022(\n\rcontroller_i" + + "d\030\t \001(\0132\021.context.DeviceId\"\311\001\n\tComponent" + + "\022%\n\016component_uuid\030\001 \001(\0132\r.context.Uuid\022" + + "\014\n\004name\030\002 \001(\t\022\014\n\004type\030\003 \001(\t\0226\n\nattribute" + + "s\030\004 \003(\0132\".context.Component.AttributesEn" + + "try\022\016\n\006parent\030\005 \001(\t\0321\n\017AttributesEntry\022\013" + + "\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001\"9\n\014Device" + + "Config\022)\n\014config_rules\030\001 \003(\0132\023.context.C" + + "onfigRule\"5\n\014DeviceIdList\022%\n\ndevice_ids\030" + + "\001 \003(\0132\021.context.DeviceId\".\n\nDeviceList\022 " + + "\n\007devices\030\001 \003(\0132\017.context.Device\"\216\001\n\014Dev" + + "iceFilter\022)\n\ndevice_ids\030\001 \001(\0132\025.context." + + "DeviceIdList\022\031\n\021include_endpoints\030\002 \001(\010\022" + + "\034\n\024include_config_rules\030\003 \001(\010\022\032\n\022include" + + "_components\030\004 \001(\010\"\200\001\n\013DeviceEvent\022\035\n\005eve" + + "nt\030\001 \001(\0132\016.context.Event\022$\n\tdevice_id\030\002 " + + "\001(\0132\021.context.DeviceId\022,\n\rdevice_config\030" + + "\003 \001(\0132\025.context.DeviceConfig\"*\n\006LinkId\022 " + + "\n\tlink_uuid\030\001 \001(\0132\r.context.Uuid\"I\n\016Link" + + "Attributes\022\033\n\023total_capacity_gbps\030\001 \001(\002\022" + + "\032\n\022used_capacity_gbps\030\002 \001(\002\"\223\001\n\004Link\022 \n\007" + + "link_id\030\001 \001(\0132\017.context.LinkId\022\014\n\004name\030\002" + + " \001(\t\022.\n\021link_endpoint_ids\030\003 \003(\0132\023.contex" + + "t.EndPointId\022+\n\nattributes\030\004 \001(\0132\027.conte" + + "xt.LinkAttributes\"/\n\nLinkIdList\022!\n\010link_" + + "ids\030\001 \003(\0132\017.context.LinkId\"(\n\010LinkList\022\034" + + "\n\005links\030\001 \003(\0132\r.context.Link\"L\n\tLinkEven" + + "t\022\035\n\005event\030\001 \001(\0132\016.context.Event\022 \n\007link" + + "_id\030\002 \001(\0132\017.context.LinkId\"X\n\tServiceId\022" + + "&\n\ncontext_id\030\001 \001(\0132\022.context.ContextId\022" + + "#\n\014service_uuid\030\002 \001(\0132\r.context.Uuid\"\333\002\n" + + "\007Service\022&\n\nservice_id\030\001 \001(\0132\022.context.S" + + "erviceId\022\014\n\004name\030\002 \001(\t\022.\n\014service_type\030\003" + + " \001(\0162\030.context.ServiceTypeEnum\0221\n\024servic" + + "e_endpoint_ids\030\004 \003(\0132\023.context.EndPointI" + + "d\0220\n\023service_constraints\030\005 \003(\0132\023.context" + + ".Constraint\022.\n\016service_status\030\006 \001(\0132\026.co" + + "ntext.ServiceStatus\022.\n\016service_config\030\007 " + + "\001(\0132\026.context.ServiceConfig\022%\n\ttimestamp" + + "\030\010 \001(\0132\022.context.Timestamp\"C\n\rServiceSta" + + "tus\0222\n\016service_status\030\001 \001(\0162\032.context.Se" + + "rviceStatusEnum\":\n\rServiceConfig\022)\n\014conf" + + "ig_rules\030\001 \003(\0132\023.context.ConfigRule\"8\n\rS" + + "erviceIdList\022\'\n\013service_ids\030\001 \003(\0132\022.cont" + + "ext.ServiceId\"1\n\013ServiceList\022\"\n\010services" + + "\030\001 \003(\0132\020.context.Service\"\225\001\n\rServiceFilt" + + "er\022+\n\013service_ids\030\001 \001(\0132\026.context.Servic" + + "eIdList\022\034\n\024include_endpoint_ids\030\002 \001(\010\022\033\n" + + "\023include_constraints\030\003 \001(\010\022\034\n\024include_co" + + "nfig_rules\030\004 \001(\010\"U\n\014ServiceEvent\022\035\n\005even" + + "t\030\001 \001(\0132\016.context.Event\022&\n\nservice_id\030\002 " + + "\001(\0132\022.context.ServiceId\"T\n\007SliceId\022&\n\nco" + + "ntext_id\030\001 \001(\0132\022.context.ContextId\022!\n\nsl" + + "ice_uuid\030\002 \001(\0132\r.context.Uuid\"\240\003\n\005Slice\022" + + "\"\n\010slice_id\030\001 \001(\0132\020.context.SliceId\022\014\n\004n" + + "ame\030\002 \001(\t\022/\n\022slice_endpoint_ids\030\003 \003(\0132\023." + + "context.EndPointId\022.\n\021slice_constraints\030" + + "\004 \003(\0132\023.context.Constraint\022-\n\021slice_serv" + + "ice_ids\030\005 \003(\0132\022.context.ServiceId\022,\n\022sli" + + "ce_subslice_ids\030\006 \003(\0132\020.context.SliceId\022" + + "*\n\014slice_status\030\007 \001(\0132\024.context.SliceSta" + + "tus\022*\n\014slice_config\030\010 \001(\0132\024.context.Slic" + + "eConfig\022(\n\013slice_owner\030\t \001(\0132\023.context.S" + + "liceOwner\022%\n\ttimestamp\030\n \001(\0132\022.context.T" + + "imestamp\"E\n\nSliceOwner\022!\n\nowner_uuid\030\001 \001" + + "(\0132\r.context.Uuid\022\024\n\014owner_string\030\002 \001(\t\"" + + "=\n\013SliceStatus\022.\n\014slice_status\030\001 \001(\0162\030.c" + + "ontext.SliceStatusEnum\"8\n\013SliceConfig\022)\n" + + "\014config_rules\030\001 \003(\0132\023.context.ConfigRule" + + "\"2\n\013SliceIdList\022#\n\tslice_ids\030\001 \003(\0132\020.con" + + "text.SliceId\"+\n\tSliceList\022\036\n\006slices\030\001 \003(" + + "\0132\016.context.Slice\"\312\001\n\013SliceFilter\022\'\n\tsli" + + "ce_ids\030\001 \001(\0132\024.context.SliceIdList\022\034\n\024in" + + "clude_endpoint_ids\030\002 \001(\010\022\033\n\023include_cons" + + "traints\030\003 \001(\010\022\033\n\023include_service_ids\030\004 \001" + + "(\010\022\034\n\024include_subslice_ids\030\005 \001(\010\022\034\n\024incl" + + "ude_config_rules\030\006 \001(\010\"O\n\nSliceEvent\022\035\n\005" + + "event\030\001 \001(\0132\016.context.Event\022\"\n\010slice_id\030" + + "\002 \001(\0132\020.context.SliceId\"6\n\014ConnectionId\022" + + "&\n\017connection_uuid\030\001 \001(\0132\r.context.Uuid\"" + + "2\n\025ConnectionSettings_L0\022\031\n\021lsp_symbolic" + + "_name\030\001 \001(\t\"\236\001\n\025ConnectionSettings_L2\022\027\n" + + "\017src_mac_address\030\001 \001(\t\022\027\n\017dst_mac_addres" + + "s\030\002 \001(\t\022\022\n\nether_type\030\003 \001(\r\022\017\n\007vlan_id\030\004" + + " \001(\r\022\022\n\nmpls_label\030\005 \001(\r\022\032\n\022mpls_traffic" + + "_class\030\006 \001(\r\"t\n\025ConnectionSettings_L3\022\026\n" + + "\016src_ip_address\030\001 \001(\t\022\026\n\016dst_ip_address\030" + + "\002 \001(\t\022\014\n\004dscp\030\003 \001(\r\022\020\n\010protocol\030\004 \001(\r\022\013\n" + + "\003ttl\030\005 \001(\r\"[\n\025ConnectionSettings_L4\022\020\n\010s" + + "rc_port\030\001 \001(\r\022\020\n\010dst_port\030\002 \001(\r\022\021\n\ttcp_f" + + "lags\030\003 \001(\r\022\013\n\003ttl\030\004 \001(\r\"\304\001\n\022ConnectionSe" + + "ttings\022*\n\002l0\030\001 \001(\0132\036.context.ConnectionS" + + "ettings_L0\022*\n\002l2\030\002 \001(\0132\036.context.Connect" + + "ionSettings_L2\022*\n\002l3\030\003 \001(\0132\036.context.Con" + + "nectionSettings_L3\022*\n\002l4\030\004 \001(\0132\036.context" + + ".ConnectionSettings_L4\"\363\001\n\nConnection\022,\n" + + "\rconnection_id\030\001 \001(\0132\025.context.Connectio" + + "nId\022&\n\nservice_id\030\002 \001(\0132\022.context.Servic" + + "eId\0223\n\026path_hops_endpoint_ids\030\003 \003(\0132\023.co" + + "ntext.EndPointId\022+\n\017sub_service_ids\030\004 \003(" + + "\0132\022.context.ServiceId\022-\n\010settings\030\005 \001(\0132" + + "\033.context.ConnectionSettings\"A\n\020Connecti" + + "onIdList\022-\n\016connection_ids\030\001 \003(\0132\025.conte" + + "xt.ConnectionId\":\n\016ConnectionList\022(\n\013con" + + "nections\030\001 \003(\0132\023.context.Connection\"^\n\017C" + + "onnectionEvent\022\035\n\005event\030\001 \001(\0132\016.context." + + "Event\022,\n\rconnection_id\030\002 \001(\0132\025.context.C" + + "onnectionId\"\202\001\n\nEndPointId\022(\n\013topology_i" + + "d\030\001 \001(\0132\023.context.TopologyId\022$\n\tdevice_i" + + "d\030\002 \001(\0132\021.context.DeviceId\022$\n\rendpoint_u" + + "uid\030\003 \001(\0132\r.context.Uuid\"\302\001\n\010EndPoint\022(\n" + + "\013endpoint_id\030\001 \001(\0132\023.context.EndPointId\022" + + "\014\n\004name\030\002 \001(\t\022\025\n\rendpoint_type\030\003 \001(\t\0229\n\020" + + "kpi_sample_types\030\004 \003(\0162\037.kpi_sample_type" + + "s.KpiSampleType\022,\n\021endpoint_location\030\005 \001" + + "(\0132\021.context.Location\"{\n\014EndPointName\022(\n" + + "\013endpoint_id\030\001 \001(\0132\023.context.EndPointId\022" + + "\023\n\013device_name\030\002 \001(\t\022\025\n\rendpoint_name\030\003 " + + "\001(\t\022\025\n\rendpoint_type\030\004 \001(\t\";\n\016EndPointId" + + "List\022)\n\014endpoint_ids\030\001 \003(\0132\023.context.End" + + "PointId\"A\n\020EndPointNameList\022-\n\016endpoint_" + + "names\030\001 \003(\0132\025.context.EndPointName\"A\n\021Co" + + "nfigRule_Custom\022\024\n\014resource_key\030\001 \001(\t\022\026\n" + + "\016resource_value\030\002 \001(\t\"]\n\016ConfigRule_ACL\022" + + "(\n\013endpoint_id\030\001 \001(\0132\023.context.EndPointI" + + "d\022!\n\010rule_set\030\002 \001(\0132\017.acl.AclRuleSet\"\234\001\n" + + "\nConfigRule\022)\n\006action\030\001 \001(\0162\031.context.Co" + + "nfigActionEnum\022,\n\006custom\030\002 \001(\0132\032.context" + + ".ConfigRule_CustomH\000\022&\n\003acl\030\003 \001(\0132\027.cont" + + "ext.ConfigRule_ACLH\000B\r\n\013config_rule\"F\n\021C" + + "onstraint_Custom\022\027\n\017constraint_type\030\001 \001(" + + "\t\022\030\n\020constraint_value\030\002 \001(\t\"E\n\023Constrain" + + "t_Schedule\022\027\n\017start_timestamp\030\001 \001(\002\022\025\n\rd" + + "uration_days\030\002 \001(\002\"3\n\014GPS_Position\022\020\n\010la" + + "titude\030\001 \001(\002\022\021\n\tlongitude\030\002 \001(\002\"W\n\010Locat" + + "ion\022\020\n\006region\030\001 \001(\tH\000\022-\n\014gps_position\030\002 " + + "\001(\0132\025.context.GPS_PositionH\000B\n\n\010location" + + "\"l\n\033Constraint_EndPointLocation\022(\n\013endpo" + + "int_id\030\001 \001(\0132\023.context.EndPointId\022#\n\010loc" + + "ation\030\002 \001(\0132\021.context.Location\"Y\n\033Constr" + + "aint_EndPointPriority\022(\n\013endpoint_id\030\001 \001" + + "(\0132\023.context.EndPointId\022\020\n\010priority\030\002 \001(" + + "\r\"0\n\026Constraint_SLA_Latency\022\026\n\016e2e_laten" + + "cy_ms\030\001 \001(\002\"0\n\027Constraint_SLA_Capacity\022\025" + + "\n\rcapacity_gbps\030\001 \001(\002\"c\n\033Constraint_SLA_" + + "Availability\022\032\n\022num_disjoint_paths\030\001 \001(\r" + + "\022\022\n\nall_active\030\002 \001(\010\022\024\n\014availability\030\003 \001" + + "(\002\"V\n\036Constraint_SLA_Isolation_level\0224\n\017" + + "isolation_level\030\001 \003(\0162\033.context.Isolatio" + + "nLevelEnum\"\242\001\n\025Constraint_Exclusions\022\024\n\014" + + "is_permanent\030\001 \001(\010\022%\n\ndevice_ids\030\002 \003(\0132\021" + + ".context.DeviceId\022)\n\014endpoint_ids\030\003 \003(\0132" + + "\023.context.EndPointId\022!\n\010link_ids\030\004 \003(\0132\017" + + ".context.LinkId\"\333\004\n\nConstraint\022-\n\006action" + + "\030\001 \001(\0162\035.context.ConstraintActionEnum\022,\n" + + "\006custom\030\002 \001(\0132\032.context.Constraint_Custo" + + "mH\000\0220\n\010schedule\030\003 \001(\0132\034.context.Constrai" + + "nt_ScheduleH\000\022A\n\021endpoint_location\030\004 \001(\013" + + "2$.context.Constraint_EndPointLocationH\000" + + "\022A\n\021endpoint_priority\030\005 \001(\0132$.context.Co" + + "nstraint_EndPointPriorityH\000\0228\n\014sla_capac" + + "ity\030\006 \001(\0132 .context.Constraint_SLA_Capac" + + "ityH\000\0226\n\013sla_latency\030\007 \001(\0132\037.context.Con" + + "straint_SLA_LatencyH\000\022@\n\020sla_availabilit" + + "y\030\010 \001(\0132$.context.Constraint_SLA_Availab" + + "ilityH\000\022@\n\rsla_isolation\030\t \001(\0132\'.context" + + ".Constraint_SLA_Isolation_levelH\000\0224\n\nexc" + + "lusions\030\n \001(\0132\036.context.Constraint_Exclu" + + "sionsH\000B\014\n\nconstraint\"^\n\022TeraFlowControl" + + "ler\022&\n\ncontext_id\030\001 \001(\0132\022.context.Contex" + + "tId\022\022\n\nip_address\030\002 \001(\t\022\014\n\004port\030\003 \001(\r\"U\n" + + "\024AuthenticationResult\022&\n\ncontext_id\030\001 \001(" + + "\0132\022.context.ContextId\022\025\n\rauthenticated\030\002" + + " \001(\010*j\n\rEventTypeEnum\022\027\n\023EVENTTYPE_UNDEF" + + "INED\020\000\022\024\n\020EVENTTYPE_CREATE\020\001\022\024\n\020EVENTTYP" + + "E_UPDATE\020\002\022\024\n\020EVENTTYPE_REMOVE\020\003*\231\002\n\020Dev" + + "iceDriverEnum\022\032\n\026DEVICEDRIVER_UNDEFINED\020" + + "\000\022\033\n\027DEVICEDRIVER_OPENCONFIG\020\001\022\036\n\032DEVICE" + + "DRIVER_TRANSPORT_API\020\002\022\023\n\017DEVICEDRIVER_P" + + "4\020\003\022&\n\"DEVICEDRIVER_IETF_NETWORK_TOPOLOG" + + "Y\020\004\022\033\n\027DEVICEDRIVER_ONF_TR_532\020\005\022\023\n\017DEVI" + + "CEDRIVER_XR\020\006\022\033\n\027DEVICEDRIVER_IETF_L2VPN" + + "\020\007\022 \n\034DEVICEDRIVER_GNMI_OPENCONFIG\020\010*\217\001\n" + + "\033DeviceOperationalStatusEnum\022%\n!DEVICEOP" + + "ERATIONALSTATUS_UNDEFINED\020\000\022$\n DEVICEOPE" + + "RATIONALSTATUS_DISABLED\020\001\022#\n\037DEVICEOPERA" + + "TIONALSTATUS_ENABLED\020\002*\225\001\n\017ServiceTypeEn" + + "um\022\027\n\023SERVICETYPE_UNKNOWN\020\000\022\024\n\020SERVICETY" + + "PE_L3NM\020\001\022\024\n\020SERVICETYPE_L2NM\020\002\022)\n%SERVI" + + "CETYPE_TAPI_CONNECTIVITY_SERVICE\020\003\022\022\n\016SE" + + "RVICETYPE_TE\020\004*\304\001\n\021ServiceStatusEnum\022\033\n\027" + + "SERVICESTATUS_UNDEFINED\020\000\022\031\n\025SERVICESTAT" + + "US_PLANNED\020\001\022\030\n\024SERVICESTATUS_ACTIVE\020\002\022\032" + + "\n\026SERVICESTATUS_UPDATING\020\003\022!\n\035SERVICESTA" + + "TUS_PENDING_REMOVAL\020\004\022\036\n\032SERVICESTATUS_S" + + "LA_VIOLATED\020\005*\251\001\n\017SliceStatusEnum\022\031\n\025SLI" + + "CESTATUS_UNDEFINED\020\000\022\027\n\023SLICESTATUS_PLAN" + + "NED\020\001\022\024\n\020SLICESTATUS_INIT\020\002\022\026\n\022SLICESTAT" + + "US_ACTIVE\020\003\022\026\n\022SLICESTATUS_DEINIT\020\004\022\034\n\030S" + + "LICESTATUS_SLA_VIOLATED\020\005*]\n\020ConfigActio" + + "nEnum\022\032\n\026CONFIGACTION_UNDEFINED\020\000\022\024\n\020CON" + + "FIGACTION_SET\020\001\022\027\n\023CONFIGACTION_DELETE\020\002" + + "*m\n\024ConstraintActionEnum\022\036\n\032CONSTRAINTAC" + + "TION_UNDEFINED\020\000\022\030\n\024CONSTRAINTACTION_SET" + + "\020\001\022\033\n\027CONSTRAINTACTION_DELETE\020\002*\203\002\n\022Isol" + + "ationLevelEnum\022\020\n\014NO_ISOLATION\020\000\022\026\n\022PHYS" + + "ICAL_ISOLATION\020\001\022\025\n\021LOGICAL_ISOLATION\020\002\022" + + "\025\n\021PROCESS_ISOLATION\020\003\022\035\n\031PHYSICAL_MEMOR" + + "Y_ISOLATION\020\004\022\036\n\032PHYSICAL_NETWORK_ISOLAT" + + "ION\020\005\022\036\n\032VIRTUAL_RESOURCE_ISOLATION\020\006\022\037\n" + + "\033NETWORK_FUNCTIONS_ISOLATION\020\007\022\025\n\021SERVIC" + + "E_ISOLATION\020\0102\245\026\n\016ContextService\022:\n\016List" + + "ContextIds\022\016.context.Empty\032\026.context.Con" + + "textIdList\"\000\0226\n\014ListContexts\022\016.context.E" + + "mpty\032\024.context.ContextList\"\000\0224\n\nGetConte" + + "xt\022\022.context.ContextId\032\020.context.Context" + + "\"\000\0224\n\nSetContext\022\020.context.Context\032\022.con" + + "text.ContextId\"\000\0225\n\rRemoveContext\022\022.cont" + + "ext.ContextId\032\016.context.Empty\"\000\022=\n\020GetCo" + + "ntextEvents\022\016.context.Empty\032\025.context.Co" + + "ntextEvent\"\0000\001\022@\n\017ListTopologyIds\022\022.cont" + + "ext.ContextId\032\027.context.TopologyIdList\"\000" + + "\022=\n\016ListTopologies\022\022.context.ContextId\032\025" + + ".context.TopologyList\"\000\0227\n\013GetTopology\022\023" + + ".context.TopologyId\032\021.context.Topology\"\000" + + "\022E\n\022GetTopologyDetails\022\023.context.Topolog" + + "yId\032\030.context.TopologyDetails\"\000\0227\n\013SetTo" + + "pology\022\021.context.Topology\032\023.context.Topo" + + "logyId\"\000\0227\n\016RemoveTopology\022\023.context.Top" + + "ologyId\032\016.context.Empty\"\000\022?\n\021GetTopology" + + "Events\022\016.context.Empty\032\026.context.Topolog" + + "yEvent\"\0000\001\0228\n\rListDeviceIds\022\016.context.Em" + + "pty\032\025.context.DeviceIdList\"\000\0224\n\013ListDevi" + + "ces\022\016.context.Empty\032\023.context.DeviceList" + + "\"\000\0221\n\tGetDevice\022\021.context.DeviceId\032\017.con" + + "text.Device\"\000\0221\n\tSetDevice\022\017.context.Dev" + + "ice\032\021.context.DeviceId\"\000\0223\n\014RemoveDevice" + + "\022\021.context.DeviceId\032\016.context.Empty\"\000\022;\n" + + "\017GetDeviceEvents\022\016.context.Empty\032\024.conte" + + "xt.DeviceEvent\"\0000\001\022<\n\014SelectDevice\022\025.con" + + "text.DeviceFilter\032\023.context.DeviceList\"\000" + + "\022I\n\021ListEndPointNames\022\027.context.EndPoint" + + "IdList\032\031.context.EndPointNameList\"\000\0224\n\013L" + + "istLinkIds\022\016.context.Empty\032\023.context.Lin" + + "kIdList\"\000\0220\n\tListLinks\022\016.context.Empty\032\021" + + ".context.LinkList\"\000\022+\n\007GetLink\022\017.context" + + ".LinkId\032\r.context.Link\"\000\022+\n\007SetLink\022\r.co" + + "ntext.Link\032\017.context.LinkId\"\000\022/\n\nRemoveL" + + "ink\022\017.context.LinkId\032\016.context.Empty\"\000\0227" + + "\n\rGetLinkEvents\022\016.context.Empty\032\022.contex" + + "t.LinkEvent\"\0000\001\022>\n\016ListServiceIds\022\022.cont" + + "ext.ContextId\032\026.context.ServiceIdList\"\000\022" + + ":\n\014ListServices\022\022.context.ContextId\032\024.co" + + "ntext.ServiceList\"\000\0224\n\nGetService\022\022.cont" + + "ext.ServiceId\032\020.context.Service\"\000\0224\n\nSet" + + "Service\022\020.context.Service\032\022.context.Serv" + + "iceId\"\000\0226\n\014UnsetService\022\020.context.Servic" + + "e\032\022.context.ServiceId\"\000\0225\n\rRemoveService" + + "\022\022.context.ServiceId\032\016.context.Empty\"\000\022=" + + "\n\020GetServiceEvents\022\016.context.Empty\032\025.con" + + "text.ServiceEvent\"\0000\001\022?\n\rSelectService\022\026" + + ".context.ServiceFilter\032\024.context.Service" + + "List\"\000\022:\n\014ListSliceIds\022\022.context.Context" + + "Id\032\024.context.SliceIdList\"\000\0226\n\nListSlices" + + "\022\022.context.ContextId\032\022.context.SliceList" + + "\"\000\022.\n\010GetSlice\022\020.context.SliceId\032\016.conte" + + "xt.Slice\"\000\022.\n\010SetSlice\022\016.context.Slice\032\020" + + ".context.SliceId\"\000\0220\n\nUnsetSlice\022\016.conte" + + "xt.Slice\032\020.context.SliceId\"\000\0221\n\013RemoveSl" + + "ice\022\020.context.SliceId\032\016.context.Empty\"\000\022" + + "9\n\016GetSliceEvents\022\016.context.Empty\032\023.cont" + + "ext.SliceEvent\"\0000\001\0229\n\013SelectSlice\022\024.cont" + + "ext.SliceFilter\032\022.context.SliceList\"\000\022D\n" + + "\021ListConnectionIds\022\022.context.ServiceId\032\031" + + ".context.ConnectionIdList\"\000\022@\n\017ListConne" + + "ctions\022\022.context.ServiceId\032\027.context.Con" + + "nectionList\"\000\022=\n\rGetConnection\022\025.context" + + ".ConnectionId\032\023.context.Connection\"\000\022=\n\r" + + "SetConnection\022\023.context.Connection\032\025.con" + + "text.ConnectionId\"\000\022;\n\020RemoveConnection\022" + + "\025.context.ConnectionId\032\016.context.Empty\"\000" + + "\022C\n\023GetConnectionEvents\022\016.context.Empty\032" + + "\030.context.ConnectionEvent\"\0000\001b\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor .internalBuildGeneratedFileFrom(descriptorData, @@ -74426,13 +76042,19 @@ public final class ContextOuterClass { internal_static_context_Device_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_context_Device_descriptor, - new java.lang.String[] { "DeviceId", "Name", "DeviceType", "DeviceConfig", "DeviceOperationalStatus", "DeviceDrivers", "DeviceEndpoints", "Component", "ControllerId", }); + new java.lang.String[] { "DeviceId", "Name", "DeviceType", "DeviceConfig", "DeviceOperationalStatus", "DeviceDrivers", "DeviceEndpoints", "Components", "ControllerId", }); internal_static_context_Component_descriptor = getDescriptor().getMessageTypes().get(17); internal_static_context_Component_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_context_Component_descriptor, - new java.lang.String[] { "CompString", }); + new java.lang.String[] { "ComponentUuid", "Name", "Type", "Attributes", "Parent", }); + internal_static_context_Component_AttributesEntry_descriptor = + internal_static_context_Component_descriptor.getNestedTypes().get(0); + internal_static_context_Component_AttributesEntry_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_context_Component_AttributesEntry_descriptor, + new java.lang.String[] { "Key", "Value", }); internal_static_context_DeviceConfig_descriptor = getDescriptor().getMessageTypes().get(18); internal_static_context_DeviceConfig_fieldAccessorTable = new @@ -74469,320 +76091,326 @@ public final class ContextOuterClass { com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_context_LinkId_descriptor, new java.lang.String[] { "LinkUuid", }); - internal_static_context_Link_descriptor = + internal_static_context_LinkAttributes_descriptor = getDescriptor().getMessageTypes().get(24); + internal_static_context_LinkAttributes_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_context_LinkAttributes_descriptor, + new java.lang.String[] { "TotalCapacityGbps", "UsedCapacityGbps", }); + internal_static_context_Link_descriptor = + getDescriptor().getMessageTypes().get(25); internal_static_context_Link_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_context_Link_descriptor, - new java.lang.String[] { "LinkId", "Name", "LinkEndpointIds", }); + new java.lang.String[] { "LinkId", "Name", "LinkEndpointIds", "Attributes", }); internal_static_context_LinkIdList_descriptor = - getDescriptor().getMessageTypes().get(25); + getDescriptor().getMessageTypes().get(26); internal_static_context_LinkIdList_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_context_LinkIdList_descriptor, new java.lang.String[] { "LinkIds", }); internal_static_context_LinkList_descriptor = - getDescriptor().getMessageTypes().get(26); + getDescriptor().getMessageTypes().get(27); internal_static_context_LinkList_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_context_LinkList_descriptor, new java.lang.String[] { "Links", }); internal_static_context_LinkEvent_descriptor = - getDescriptor().getMessageTypes().get(27); + getDescriptor().getMessageTypes().get(28); internal_static_context_LinkEvent_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_context_LinkEvent_descriptor, new java.lang.String[] { "Event", "LinkId", }); internal_static_context_ServiceId_descriptor = - getDescriptor().getMessageTypes().get(28); + getDescriptor().getMessageTypes().get(29); internal_static_context_ServiceId_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_context_ServiceId_descriptor, new java.lang.String[] { "ContextId", "ServiceUuid", }); internal_static_context_Service_descriptor = - getDescriptor().getMessageTypes().get(29); + getDescriptor().getMessageTypes().get(30); internal_static_context_Service_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_context_Service_descriptor, new java.lang.String[] { "ServiceId", "Name", "ServiceType", "ServiceEndpointIds", "ServiceConstraints", "ServiceStatus", "ServiceConfig", "Timestamp", }); internal_static_context_ServiceStatus_descriptor = - getDescriptor().getMessageTypes().get(30); + getDescriptor().getMessageTypes().get(31); internal_static_context_ServiceStatus_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_context_ServiceStatus_descriptor, new java.lang.String[] { "ServiceStatus", }); internal_static_context_ServiceConfig_descriptor = - getDescriptor().getMessageTypes().get(31); + getDescriptor().getMessageTypes().get(32); internal_static_context_ServiceConfig_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_context_ServiceConfig_descriptor, new java.lang.String[] { "ConfigRules", }); internal_static_context_ServiceIdList_descriptor = - getDescriptor().getMessageTypes().get(32); + getDescriptor().getMessageTypes().get(33); internal_static_context_ServiceIdList_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_context_ServiceIdList_descriptor, new java.lang.String[] { "ServiceIds", }); internal_static_context_ServiceList_descriptor = - getDescriptor().getMessageTypes().get(33); + getDescriptor().getMessageTypes().get(34); internal_static_context_ServiceList_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_context_ServiceList_descriptor, new java.lang.String[] { "Services", }); internal_static_context_ServiceFilter_descriptor = - getDescriptor().getMessageTypes().get(34); + getDescriptor().getMessageTypes().get(35); internal_static_context_ServiceFilter_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_context_ServiceFilter_descriptor, new java.lang.String[] { "ServiceIds", "IncludeEndpointIds", "IncludeConstraints", "IncludeConfigRules", }); internal_static_context_ServiceEvent_descriptor = - getDescriptor().getMessageTypes().get(35); + getDescriptor().getMessageTypes().get(36); internal_static_context_ServiceEvent_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_context_ServiceEvent_descriptor, new java.lang.String[] { "Event", "ServiceId", }); internal_static_context_SliceId_descriptor = - getDescriptor().getMessageTypes().get(36); + getDescriptor().getMessageTypes().get(37); internal_static_context_SliceId_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_context_SliceId_descriptor, new java.lang.String[] { "ContextId", "SliceUuid", }); internal_static_context_Slice_descriptor = - getDescriptor().getMessageTypes().get(37); + getDescriptor().getMessageTypes().get(38); internal_static_context_Slice_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_context_Slice_descriptor, new java.lang.String[] { "SliceId", "Name", "SliceEndpointIds", "SliceConstraints", "SliceServiceIds", "SliceSubsliceIds", "SliceStatus", "SliceConfig", "SliceOwner", "Timestamp", }); internal_static_context_SliceOwner_descriptor = - getDescriptor().getMessageTypes().get(38); + getDescriptor().getMessageTypes().get(39); internal_static_context_SliceOwner_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_context_SliceOwner_descriptor, new java.lang.String[] { "OwnerUuid", "OwnerString", }); internal_static_context_SliceStatus_descriptor = - getDescriptor().getMessageTypes().get(39); + getDescriptor().getMessageTypes().get(40); internal_static_context_SliceStatus_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_context_SliceStatus_descriptor, new java.lang.String[] { "SliceStatus", }); internal_static_context_SliceConfig_descriptor = - getDescriptor().getMessageTypes().get(40); + getDescriptor().getMessageTypes().get(41); internal_static_context_SliceConfig_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_context_SliceConfig_descriptor, new java.lang.String[] { "ConfigRules", }); internal_static_context_SliceIdList_descriptor = - getDescriptor().getMessageTypes().get(41); + getDescriptor().getMessageTypes().get(42); internal_static_context_SliceIdList_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_context_SliceIdList_descriptor, new java.lang.String[] { "SliceIds", }); internal_static_context_SliceList_descriptor = - getDescriptor().getMessageTypes().get(42); + getDescriptor().getMessageTypes().get(43); internal_static_context_SliceList_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_context_SliceList_descriptor, new java.lang.String[] { "Slices", }); internal_static_context_SliceFilter_descriptor = - getDescriptor().getMessageTypes().get(43); + getDescriptor().getMessageTypes().get(44); internal_static_context_SliceFilter_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_context_SliceFilter_descriptor, new java.lang.String[] { "SliceIds", "IncludeEndpointIds", "IncludeConstraints", "IncludeServiceIds", "IncludeSubsliceIds", "IncludeConfigRules", }); internal_static_context_SliceEvent_descriptor = - getDescriptor().getMessageTypes().get(44); + getDescriptor().getMessageTypes().get(45); internal_static_context_SliceEvent_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_context_SliceEvent_descriptor, new java.lang.String[] { "Event", "SliceId", }); internal_static_context_ConnectionId_descriptor = - getDescriptor().getMessageTypes().get(45); + getDescriptor().getMessageTypes().get(46); internal_static_context_ConnectionId_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_context_ConnectionId_descriptor, new java.lang.String[] { "ConnectionUuid", }); internal_static_context_ConnectionSettings_L0_descriptor = - getDescriptor().getMessageTypes().get(46); + getDescriptor().getMessageTypes().get(47); internal_static_context_ConnectionSettings_L0_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_context_ConnectionSettings_L0_descriptor, new java.lang.String[] { "LspSymbolicName", }); internal_static_context_ConnectionSettings_L2_descriptor = - getDescriptor().getMessageTypes().get(47); + getDescriptor().getMessageTypes().get(48); internal_static_context_ConnectionSettings_L2_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_context_ConnectionSettings_L2_descriptor, new java.lang.String[] { "SrcMacAddress", "DstMacAddress", "EtherType", "VlanId", "MplsLabel", "MplsTrafficClass", }); internal_static_context_ConnectionSettings_L3_descriptor = - getDescriptor().getMessageTypes().get(48); + getDescriptor().getMessageTypes().get(49); internal_static_context_ConnectionSettings_L3_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_context_ConnectionSettings_L3_descriptor, new java.lang.String[] { "SrcIpAddress", "DstIpAddress", "Dscp", "Protocol", "Ttl", }); internal_static_context_ConnectionSettings_L4_descriptor = - getDescriptor().getMessageTypes().get(49); + getDescriptor().getMessageTypes().get(50); internal_static_context_ConnectionSettings_L4_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_context_ConnectionSettings_L4_descriptor, new java.lang.String[] { "SrcPort", "DstPort", "TcpFlags", "Ttl", }); internal_static_context_ConnectionSettings_descriptor = - getDescriptor().getMessageTypes().get(50); + getDescriptor().getMessageTypes().get(51); internal_static_context_ConnectionSettings_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_context_ConnectionSettings_descriptor, new java.lang.String[] { "L0", "L2", "L3", "L4", }); internal_static_context_Connection_descriptor = - getDescriptor().getMessageTypes().get(51); + getDescriptor().getMessageTypes().get(52); internal_static_context_Connection_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_context_Connection_descriptor, new java.lang.String[] { "ConnectionId", "ServiceId", "PathHopsEndpointIds", "SubServiceIds", "Settings", }); internal_static_context_ConnectionIdList_descriptor = - getDescriptor().getMessageTypes().get(52); + getDescriptor().getMessageTypes().get(53); internal_static_context_ConnectionIdList_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_context_ConnectionIdList_descriptor, new java.lang.String[] { "ConnectionIds", }); internal_static_context_ConnectionList_descriptor = - getDescriptor().getMessageTypes().get(53); + getDescriptor().getMessageTypes().get(54); internal_static_context_ConnectionList_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_context_ConnectionList_descriptor, new java.lang.String[] { "Connections", }); internal_static_context_ConnectionEvent_descriptor = - getDescriptor().getMessageTypes().get(54); + getDescriptor().getMessageTypes().get(55); internal_static_context_ConnectionEvent_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_context_ConnectionEvent_descriptor, new java.lang.String[] { "Event", "ConnectionId", }); internal_static_context_EndPointId_descriptor = - getDescriptor().getMessageTypes().get(55); + getDescriptor().getMessageTypes().get(56); internal_static_context_EndPointId_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_context_EndPointId_descriptor, new java.lang.String[] { "TopologyId", "DeviceId", "EndpointUuid", }); internal_static_context_EndPoint_descriptor = - getDescriptor().getMessageTypes().get(56); + getDescriptor().getMessageTypes().get(57); internal_static_context_EndPoint_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_context_EndPoint_descriptor, new java.lang.String[] { "EndpointId", "Name", "EndpointType", "KpiSampleTypes", "EndpointLocation", }); internal_static_context_EndPointName_descriptor = - getDescriptor().getMessageTypes().get(57); + getDescriptor().getMessageTypes().get(58); internal_static_context_EndPointName_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_context_EndPointName_descriptor, new java.lang.String[] { "EndpointId", "DeviceName", "EndpointName", "EndpointType", }); internal_static_context_EndPointIdList_descriptor = - getDescriptor().getMessageTypes().get(58); + getDescriptor().getMessageTypes().get(59); internal_static_context_EndPointIdList_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_context_EndPointIdList_descriptor, new java.lang.String[] { "EndpointIds", }); internal_static_context_EndPointNameList_descriptor = - getDescriptor().getMessageTypes().get(59); + getDescriptor().getMessageTypes().get(60); internal_static_context_EndPointNameList_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_context_EndPointNameList_descriptor, new java.lang.String[] { "EndpointNames", }); internal_static_context_ConfigRule_Custom_descriptor = - getDescriptor().getMessageTypes().get(60); + getDescriptor().getMessageTypes().get(61); internal_static_context_ConfigRule_Custom_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_context_ConfigRule_Custom_descriptor, new java.lang.String[] { "ResourceKey", "ResourceValue", }); internal_static_context_ConfigRule_ACL_descriptor = - getDescriptor().getMessageTypes().get(61); + getDescriptor().getMessageTypes().get(62); internal_static_context_ConfigRule_ACL_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_context_ConfigRule_ACL_descriptor, new java.lang.String[] { "EndpointId", "RuleSet", }); internal_static_context_ConfigRule_descriptor = - getDescriptor().getMessageTypes().get(62); + getDescriptor().getMessageTypes().get(63); internal_static_context_ConfigRule_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_context_ConfigRule_descriptor, new java.lang.String[] { "Action", "Custom", "Acl", "ConfigRule", }); internal_static_context_Constraint_Custom_descriptor = - getDescriptor().getMessageTypes().get(63); + getDescriptor().getMessageTypes().get(64); internal_static_context_Constraint_Custom_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_context_Constraint_Custom_descriptor, new java.lang.String[] { "ConstraintType", "ConstraintValue", }); internal_static_context_Constraint_Schedule_descriptor = - getDescriptor().getMessageTypes().get(64); + getDescriptor().getMessageTypes().get(65); internal_static_context_Constraint_Schedule_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_context_Constraint_Schedule_descriptor, new java.lang.String[] { "StartTimestamp", "DurationDays", }); internal_static_context_GPS_Position_descriptor = - getDescriptor().getMessageTypes().get(65); + getDescriptor().getMessageTypes().get(66); internal_static_context_GPS_Position_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_context_GPS_Position_descriptor, new java.lang.String[] { "Latitude", "Longitude", }); internal_static_context_Location_descriptor = - getDescriptor().getMessageTypes().get(66); + getDescriptor().getMessageTypes().get(67); internal_static_context_Location_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_context_Location_descriptor, new java.lang.String[] { "Region", "GpsPosition", "Location", }); internal_static_context_Constraint_EndPointLocation_descriptor = - getDescriptor().getMessageTypes().get(67); + getDescriptor().getMessageTypes().get(68); internal_static_context_Constraint_EndPointLocation_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_context_Constraint_EndPointLocation_descriptor, new java.lang.String[] { "EndpointId", "Location", }); internal_static_context_Constraint_EndPointPriority_descriptor = - getDescriptor().getMessageTypes().get(68); + getDescriptor().getMessageTypes().get(69); internal_static_context_Constraint_EndPointPriority_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_context_Constraint_EndPointPriority_descriptor, new java.lang.String[] { "EndpointId", "Priority", }); internal_static_context_Constraint_SLA_Latency_descriptor = - getDescriptor().getMessageTypes().get(69); + getDescriptor().getMessageTypes().get(70); internal_static_context_Constraint_SLA_Latency_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_context_Constraint_SLA_Latency_descriptor, new java.lang.String[] { "E2ELatencyMs", }); internal_static_context_Constraint_SLA_Capacity_descriptor = - getDescriptor().getMessageTypes().get(70); + getDescriptor().getMessageTypes().get(71); internal_static_context_Constraint_SLA_Capacity_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_context_Constraint_SLA_Capacity_descriptor, new java.lang.String[] { "CapacityGbps", }); internal_static_context_Constraint_SLA_Availability_descriptor = - getDescriptor().getMessageTypes().get(71); + getDescriptor().getMessageTypes().get(72); internal_static_context_Constraint_SLA_Availability_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_context_Constraint_SLA_Availability_descriptor, new java.lang.String[] { "NumDisjointPaths", "AllActive", "Availability", }); internal_static_context_Constraint_SLA_Isolation_level_descriptor = - getDescriptor().getMessageTypes().get(72); + getDescriptor().getMessageTypes().get(73); internal_static_context_Constraint_SLA_Isolation_level_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_context_Constraint_SLA_Isolation_level_descriptor, new java.lang.String[] { "IsolationLevel", }); internal_static_context_Constraint_Exclusions_descriptor = - getDescriptor().getMessageTypes().get(73); + getDescriptor().getMessageTypes().get(74); internal_static_context_Constraint_Exclusions_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_context_Constraint_Exclusions_descriptor, new java.lang.String[] { "IsPermanent", "DeviceIds", "EndpointIds", "LinkIds", }); internal_static_context_Constraint_descriptor = - getDescriptor().getMessageTypes().get(74); + getDescriptor().getMessageTypes().get(75); internal_static_context_Constraint_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_context_Constraint_descriptor, new java.lang.String[] { "Action", "Custom", "Schedule", "EndpointLocation", "EndpointPriority", "SlaCapacity", "SlaLatency", "SlaAvailability", "SlaIsolation", "Exclusions", "Constraint", }); internal_static_context_TeraFlowController_descriptor = - getDescriptor().getMessageTypes().get(75); + getDescriptor().getMessageTypes().get(76); internal_static_context_TeraFlowController_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_context_TeraFlowController_descriptor, new java.lang.String[] { "ContextId", "IpAddress", "Port", }); internal_static_context_AuthenticationResult_descriptor = - getDescriptor().getMessageTypes().get(76); + getDescriptor().getMessageTypes().get(77); internal_static_context_AuthenticationResult_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_context_AuthenticationResult_descriptor, diff --git a/src/automation/target/generated-sources/grpc/context/ContextService.java b/src/ztp/target/generated-sources/grpc/context/ContextService.java similarity index 100% rename from src/automation/target/generated-sources/grpc/context/ContextService.java rename to src/ztp/target/generated-sources/grpc/context/ContextService.java diff --git a/src/automation/target/generated-sources/grpc/context/ContextServiceBean.java b/src/ztp/target/generated-sources/grpc/context/ContextServiceBean.java similarity index 100% rename from src/automation/target/generated-sources/grpc/context/ContextServiceBean.java rename to src/ztp/target/generated-sources/grpc/context/ContextServiceBean.java diff --git a/src/automation/target/generated-sources/grpc/context/ContextServiceClient.java b/src/ztp/target/generated-sources/grpc/context/ContextServiceClient.java similarity index 100% rename from src/automation/target/generated-sources/grpc/context/ContextServiceClient.java rename to src/ztp/target/generated-sources/grpc/context/ContextServiceClient.java diff --git a/src/automation/target/generated-sources/grpc/context/ContextServiceGrpc.java b/src/ztp/target/generated-sources/grpc/context/ContextServiceGrpc.java similarity index 100% rename from src/automation/target/generated-sources/grpc/context/ContextServiceGrpc.java rename to src/ztp/target/generated-sources/grpc/context/ContextServiceGrpc.java diff --git a/src/automation/target/generated-sources/grpc/context/MutinyContextServiceGrpc.java b/src/ztp/target/generated-sources/grpc/context/MutinyContextServiceGrpc.java similarity index 100% rename from src/automation/target/generated-sources/grpc/context/MutinyContextServiceGrpc.java rename to src/ztp/target/generated-sources/grpc/context/MutinyContextServiceGrpc.java diff --git a/src/automation/target/generated-sources/grpc/device/Device.java b/src/ztp/target/generated-sources/grpc/device/Device.java similarity index 100% rename from src/automation/target/generated-sources/grpc/device/Device.java rename to src/ztp/target/generated-sources/grpc/device/Device.java diff --git a/src/automation/target/generated-sources/grpc/device/DeviceService.java b/src/ztp/target/generated-sources/grpc/device/DeviceService.java similarity index 100% rename from src/automation/target/generated-sources/grpc/device/DeviceService.java rename to src/ztp/target/generated-sources/grpc/device/DeviceService.java diff --git a/src/automation/target/generated-sources/grpc/device/DeviceServiceBean.java b/src/ztp/target/generated-sources/grpc/device/DeviceServiceBean.java similarity index 100% rename from src/automation/target/generated-sources/grpc/device/DeviceServiceBean.java rename to src/ztp/target/generated-sources/grpc/device/DeviceServiceBean.java diff --git a/src/automation/target/generated-sources/grpc/device/DeviceServiceClient.java b/src/ztp/target/generated-sources/grpc/device/DeviceServiceClient.java similarity index 100% rename from src/automation/target/generated-sources/grpc/device/DeviceServiceClient.java rename to src/ztp/target/generated-sources/grpc/device/DeviceServiceClient.java diff --git a/src/automation/target/generated-sources/grpc/device/DeviceServiceGrpc.java b/src/ztp/target/generated-sources/grpc/device/DeviceServiceGrpc.java similarity index 100% rename from src/automation/target/generated-sources/grpc/device/DeviceServiceGrpc.java rename to src/ztp/target/generated-sources/grpc/device/DeviceServiceGrpc.java diff --git a/src/automation/target/generated-sources/grpc/device/MutinyDeviceServiceGrpc.java b/src/ztp/target/generated-sources/grpc/device/MutinyDeviceServiceGrpc.java similarity index 100% rename from src/automation/target/generated-sources/grpc/device/MutinyDeviceServiceGrpc.java rename to src/ztp/target/generated-sources/grpc/device/MutinyDeviceServiceGrpc.java diff --git a/src/automation/target/generated-sources/grpc/kpi_sample_types/KpiSampleTypes.java b/src/ztp/target/generated-sources/grpc/kpi_sample_types/KpiSampleTypes.java similarity index 86% rename from src/automation/target/generated-sources/grpc/kpi_sample_types/KpiSampleTypes.java rename to src/ztp/target/generated-sources/grpc/kpi_sample_types/KpiSampleTypes.java index 217672b2e8de2d7c840833a937b0fb04c38a221b..66ce0f8f234c62f17c7e3af82d0f22a0a4c26c58 100644 --- a/src/automation/target/generated-sources/grpc/kpi_sample_types/KpiSampleTypes.java +++ b/src/ztp/target/generated-sources/grpc/kpi_sample_types/KpiSampleTypes.java @@ -47,6 +47,14 @@ public final class KpiSampleTypes { * KPISAMPLETYPE_BYTES_DROPPED = 203; */ KPISAMPLETYPE_BYTES_DROPPED(203), + /** + * KPISAMPLETYPE_LINK_TOTAL_CAPACITY_GBPS = 301; + */ + KPISAMPLETYPE_LINK_TOTAL_CAPACITY_GBPS(301), + /** + * KPISAMPLETYPE_LINK_USED_CAPACITY_GBPS = 302; + */ + KPISAMPLETYPE_LINK_USED_CAPACITY_GBPS(302), /** *
          *. can be used by both optical and L3 without any issue
    @@ -118,6 +126,14 @@ public final class KpiSampleTypes {
          * KPISAMPLETYPE_BYTES_DROPPED = 203;
          */
         public static final int KPISAMPLETYPE_BYTES_DROPPED_VALUE = 203;
    +    /**
    +     * KPISAMPLETYPE_LINK_TOTAL_CAPACITY_GBPS = 301;
    +     */
    +    public static final int KPISAMPLETYPE_LINK_TOTAL_CAPACITY_GBPS_VALUE = 301;
    +    /**
    +     * KPISAMPLETYPE_LINK_USED_CAPACITY_GBPS = 302;
    +     */
    +    public static final int KPISAMPLETYPE_LINK_USED_CAPACITY_GBPS_VALUE = 302;
         /**
          * 
          *. can be used by both optical and L3 without any issue
    @@ -191,6 +207,8 @@ public final class KpiSampleTypes {
             case 201: return KPISAMPLETYPE_BYTES_TRANSMITTED;
             case 202: return KPISAMPLETYPE_BYTES_RECEIVED;
             case 203: return KPISAMPLETYPE_BYTES_DROPPED;
    +        case 301: return KPISAMPLETYPE_LINK_TOTAL_CAPACITY_GBPS;
    +        case 302: return KPISAMPLETYPE_LINK_USED_CAPACITY_GBPS;
             case 401: return KPISAMPLETYPE_ML_CONFIDENCE;
             case 501: return KPISAMPLETYPE_OPTICAL_SECURITY_STATUS;
             case 601: return KPISAMPLETYPE_L3_UNIQUE_ATTACK_CONNS;
    @@ -265,22 +283,24 @@ public final class KpiSampleTypes {
       static {
         java.lang.String[] descriptorData = {
           "\n\026kpi_sample_types.proto\022\020kpi_sample_typ" +
    -      "es*\327\004\n\rKpiSampleType\022\031\n\025KPISAMPLETYPE_UN" +
    +      "es*\260\005\n\rKpiSampleType\022\031\n\025KPISAMPLETYPE_UN" +
           "KNOWN\020\000\022%\n!KPISAMPLETYPE_PACKETS_TRANSMI" +
           "TTED\020e\022\"\n\036KPISAMPLETYPE_PACKETS_RECEIVED" +
           "\020f\022!\n\035KPISAMPLETYPE_PACKETS_DROPPED\020g\022$\n" +
           "\037KPISAMPLETYPE_BYTES_TRANSMITTED\020\311\001\022!\n\034K" +
           "PISAMPLETYPE_BYTES_RECEIVED\020\312\001\022 \n\033KPISAM" +
    -      "PLETYPE_BYTES_DROPPED\020\313\001\022 \n\033KPISAMPLETYP" +
    -      "E_ML_CONFIDENCE\020\221\003\022*\n%KPISAMPLETYPE_OPTI" +
    -      "CAL_SECURITY_STATUS\020\365\003\022)\n$KPISAMPLETYPE_" +
    -      "L3_UNIQUE_ATTACK_CONNS\020\331\004\022*\n%KPISAMPLETY" +
    -      "PE_L3_TOTAL_DROPPED_PACKTS\020\332\004\022&\n!KPISAMP" +
    -      "LETYPE_L3_UNIQUE_ATTACKERS\020\333\004\0220\n+KPISAMP" +
    -      "LETYPE_L3_UNIQUE_COMPROMISED_CLIENTS\020\334\004\022" +
    -      ",\n\'KPISAMPLETYPE_L3_SECURITY_STATUS_CRYP" +
    -      "TO\020\335\004\022%\n KPISAMPLETYPE_SERVICE_LATENCY_M" +
    -      "S\020\275\005b\006proto3"
    +      "PLETYPE_BYTES_DROPPED\020\313\001\022+\n&KPISAMPLETYP" +
    +      "E_LINK_TOTAL_CAPACITY_GBPS\020\255\002\022*\n%KPISAMP" +
    +      "LETYPE_LINK_USED_CAPACITY_GBPS\020\256\002\022 \n\033KPI" +
    +      "SAMPLETYPE_ML_CONFIDENCE\020\221\003\022*\n%KPISAMPLE" +
    +      "TYPE_OPTICAL_SECURITY_STATUS\020\365\003\022)\n$KPISA" +
    +      "MPLETYPE_L3_UNIQUE_ATTACK_CONNS\020\331\004\022*\n%KP" +
    +      "ISAMPLETYPE_L3_TOTAL_DROPPED_PACKTS\020\332\004\022&" +
    +      "\n!KPISAMPLETYPE_L3_UNIQUE_ATTACKERS\020\333\004\0220" +
    +      "\n+KPISAMPLETYPE_L3_UNIQUE_COMPROMISED_CL" +
    +      "IENTS\020\334\004\022,\n\'KPISAMPLETYPE_L3_SECURITY_ST" +
    +      "ATUS_CRYPTO\020\335\004\022%\n KPISAMPLETYPE_SERVICE_" +
    +      "LATENCY_MS\020\275\005b\006proto3"
         };
         descriptor = com.google.protobuf.Descriptors.FileDescriptor
           .internalBuildGeneratedFileFrom(descriptorData,
    diff --git a/src/automation/target/generated-sources/grpc/monitoring/Monitoring.java b/src/ztp/target/generated-sources/grpc/monitoring/Monitoring.java
    similarity index 98%
    rename from src/automation/target/generated-sources/grpc/monitoring/Monitoring.java
    rename to src/ztp/target/generated-sources/grpc/monitoring/Monitoring.java
    index 38f026eb1ac730e8f825e460916dc57469f0d312..ef9ef6be6341d87943f68503d7ddc535b3920140 100644
    --- a/src/automation/target/generated-sources/grpc/monitoring/Monitoring.java
    +++ b/src/ztp/target/generated-sources/grpc/monitoring/Monitoring.java
    @@ -154,6 +154,21 @@ public final class Monitoring {
          * .context.ConnectionId connection_id = 9;
          */
         context.ContextOuterClass.ConnectionIdOrBuilder getConnectionIdOrBuilder();
    +
    +    /**
    +     * .context.LinkId link_id = 10;
    +     * @return Whether the linkId field is set.
    +     */
    +    boolean hasLinkId();
    +    /**
    +     * .context.LinkId link_id = 10;
    +     * @return The linkId.
    +     */
    +    context.ContextOuterClass.LinkId getLinkId();
    +    /**
    +     * .context.LinkId link_id = 10;
    +     */
    +    context.ContextOuterClass.LinkIdOrBuilder getLinkIdOrBuilder();
       }
       /**
        * Protobuf type {@code monitoring.KpiDescriptor}
    @@ -303,6 +318,19 @@ public final class Monitoring {
     
                   break;
                 }
    +            case 82: {
    +              context.ContextOuterClass.LinkId.Builder subBuilder = null;
    +              if (linkId_ != null) {
    +                subBuilder = linkId_.toBuilder();
    +              }
    +              linkId_ = input.readMessage(context.ContextOuterClass.LinkId.parser(), extensionRegistry);
    +              if (subBuilder != null) {
    +                subBuilder.mergeFrom(linkId_);
    +                linkId_ = subBuilder.buildPartial();
    +              }
    +
    +              break;
    +            }
                 default: {
                   if (!parseUnknownField(
                       input, unknownFields, extensionRegistry, tag)) {
    @@ -591,6 +619,32 @@ public final class Monitoring {
           return getConnectionId();
         }
     
    +    public static final int LINK_ID_FIELD_NUMBER = 10;
    +    private context.ContextOuterClass.LinkId linkId_;
    +    /**
    +     * .context.LinkId link_id = 10;
    +     * @return Whether the linkId field is set.
    +     */
    +    @java.lang.Override
    +    public boolean hasLinkId() {
    +      return linkId_ != null;
    +    }
    +    /**
    +     * .context.LinkId link_id = 10;
    +     * @return The linkId.
    +     */
    +    @java.lang.Override
    +    public context.ContextOuterClass.LinkId getLinkId() {
    +      return linkId_ == null ? context.ContextOuterClass.LinkId.getDefaultInstance() : linkId_;
    +    }
    +    /**
    +     * .context.LinkId link_id = 10;
    +     */
    +    @java.lang.Override
    +    public context.ContextOuterClass.LinkIdOrBuilder getLinkIdOrBuilder() {
    +      return getLinkId();
    +    }
    +
         private byte memoizedIsInitialized = -1;
         @java.lang.Override
         public final boolean isInitialized() {
    @@ -632,6 +686,9 @@ public final class Monitoring {
           if (connectionId_ != null) {
             output.writeMessage(9, getConnectionId());
           }
    +      if (linkId_ != null) {
    +        output.writeMessage(10, getLinkId());
    +      }
           unknownFields.writeTo(output);
         }
     
    @@ -676,6 +733,10 @@ public final class Monitoring {
             size += com.google.protobuf.CodedOutputStream
               .computeMessageSize(9, getConnectionId());
           }
    +      if (linkId_ != null) {
    +        size += com.google.protobuf.CodedOutputStream
    +          .computeMessageSize(10, getLinkId());
    +      }
           size += unknownFields.getSerializedSize();
           memoizedSize = size;
           return size;
    @@ -726,6 +787,11 @@ public final class Monitoring {
             if (!getConnectionId()
                 .equals(other.getConnectionId())) return false;
           }
    +      if (hasLinkId() != other.hasLinkId()) return false;
    +      if (hasLinkId()) {
    +        if (!getLinkId()
    +            .equals(other.getLinkId())) return false;
    +      }
           if (!unknownFields.equals(other.unknownFields)) return false;
           return true;
         }
    @@ -769,6 +835,10 @@ public final class Monitoring {
             hash = (37 * hash) + CONNECTION_ID_FIELD_NUMBER;
             hash = (53 * hash) + getConnectionId().hashCode();
           }
    +      if (hasLinkId()) {
    +        hash = (37 * hash) + LINK_ID_FIELD_NUMBER;
    +        hash = (53 * hash) + getLinkId().hashCode();
    +      }
           hash = (29 * hash) + unknownFields.hashCode();
           memoizedHashCode = hash;
           return hash;
    @@ -949,6 +1019,12 @@ public final class Monitoring {
               connectionId_ = null;
               connectionIdBuilder_ = null;
             }
    +        if (linkIdBuilder_ == null) {
    +          linkId_ = null;
    +        } else {
    +          linkId_ = null;
    +          linkIdBuilder_ = null;
    +        }
             return this;
           }
     
    @@ -1017,6 +1093,11 @@ public final class Monitoring {
             } else {
               result.connectionId_ = connectionIdBuilder_.build();
             }
    +        if (linkIdBuilder_ == null) {
    +          result.linkId_ = linkId_;
    +        } else {
    +          result.linkId_ = linkIdBuilder_.build();
    +        }
             onBuilt();
             return result;
           }
    @@ -1116,6 +1197,9 @@ public final class Monitoring {
             if (other.hasConnectionId()) {
               mergeConnectionId(other.getConnectionId());
             }
    +        if (other.hasLinkId()) {
    +          mergeLinkId(other.getLinkId());
    +        }
             this.mergeUnknownFields(other.unknownFields);
             onChanged();
             return this;
    @@ -2229,6 +2313,125 @@ public final class Monitoring {
             }
             return connectionIdBuilder_;
           }
    +
    +      private context.ContextOuterClass.LinkId linkId_;
    +      private com.google.protobuf.SingleFieldBuilderV3<
    +          context.ContextOuterClass.LinkId, context.ContextOuterClass.LinkId.Builder, context.ContextOuterClass.LinkIdOrBuilder> linkIdBuilder_;
    +      /**
    +       * .context.LinkId link_id = 10;
    +       * @return Whether the linkId field is set.
    +       */
    +      public boolean hasLinkId() {
    +        return linkIdBuilder_ != null || linkId_ != null;
    +      }
    +      /**
    +       * .context.LinkId link_id = 10;
    +       * @return The linkId.
    +       */
    +      public context.ContextOuterClass.LinkId getLinkId() {
    +        if (linkIdBuilder_ == null) {
    +          return linkId_ == null ? context.ContextOuterClass.LinkId.getDefaultInstance() : linkId_;
    +        } else {
    +          return linkIdBuilder_.getMessage();
    +        }
    +      }
    +      /**
    +       * .context.LinkId link_id = 10;
    +       */
    +      public Builder setLinkId(context.ContextOuterClass.LinkId value) {
    +        if (linkIdBuilder_ == null) {
    +          if (value == null) {
    +            throw new NullPointerException();
    +          }
    +          linkId_ = value;
    +          onChanged();
    +        } else {
    +          linkIdBuilder_.setMessage(value);
    +        }
    +
    +        return this;
    +      }
    +      /**
    +       * .context.LinkId link_id = 10;
    +       */
    +      public Builder setLinkId(
    +          context.ContextOuterClass.LinkId.Builder builderForValue) {
    +        if (linkIdBuilder_ == null) {
    +          linkId_ = builderForValue.build();
    +          onChanged();
    +        } else {
    +          linkIdBuilder_.setMessage(builderForValue.build());
    +        }
    +
    +        return this;
    +      }
    +      /**
    +       * .context.LinkId link_id = 10;
    +       */
    +      public Builder mergeLinkId(context.ContextOuterClass.LinkId value) {
    +        if (linkIdBuilder_ == null) {
    +          if (linkId_ != null) {
    +            linkId_ =
    +              context.ContextOuterClass.LinkId.newBuilder(linkId_).mergeFrom(value).buildPartial();
    +          } else {
    +            linkId_ = value;
    +          }
    +          onChanged();
    +        } else {
    +          linkIdBuilder_.mergeFrom(value);
    +        }
    +
    +        return this;
    +      }
    +      /**
    +       * .context.LinkId link_id = 10;
    +       */
    +      public Builder clearLinkId() {
    +        if (linkIdBuilder_ == null) {
    +          linkId_ = null;
    +          onChanged();
    +        } else {
    +          linkId_ = null;
    +          linkIdBuilder_ = null;
    +        }
    +
    +        return this;
    +      }
    +      /**
    +       * .context.LinkId link_id = 10;
    +       */
    +      public context.ContextOuterClass.LinkId.Builder getLinkIdBuilder() {
    +        
    +        onChanged();
    +        return getLinkIdFieldBuilder().getBuilder();
    +      }
    +      /**
    +       * .context.LinkId link_id = 10;
    +       */
    +      public context.ContextOuterClass.LinkIdOrBuilder getLinkIdOrBuilder() {
    +        if (linkIdBuilder_ != null) {
    +          return linkIdBuilder_.getMessageOrBuilder();
    +        } else {
    +          return linkId_ == null ?
    +              context.ContextOuterClass.LinkId.getDefaultInstance() : linkId_;
    +        }
    +      }
    +      /**
    +       * .context.LinkId link_id = 10;
    +       */
    +      private com.google.protobuf.SingleFieldBuilderV3<
    +          context.ContextOuterClass.LinkId, context.ContextOuterClass.LinkId.Builder, context.ContextOuterClass.LinkIdOrBuilder> 
    +          getLinkIdFieldBuilder() {
    +        if (linkIdBuilder_ == null) {
    +          linkIdBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
    +              context.ContextOuterClass.LinkId, context.ContextOuterClass.LinkId.Builder, context.ContextOuterClass.LinkIdOrBuilder>(
    +                  getLinkId(),
    +                  getParentForChildren(),
    +                  isClean());
    +          linkId_ = null;
    +        }
    +        return linkIdBuilder_;
    +      }
           @java.lang.Override
           public final Builder setUnknownFields(
               final com.google.protobuf.UnknownFieldSet unknownFields) {
    @@ -21361,7 +21564,7 @@ public final class Monitoring {
       static {
         java.lang.String[] descriptorData = {
           "\n\020monitoring.proto\022\nmonitoring\032\rcontext." +
    -      "proto\032\026kpi_sample_types.proto\"\367\002\n\rKpiDes" +
    +      "proto\032\026kpi_sample_types.proto\"\231\003\n\rKpiDes" +
           "criptor\022!\n\006kpi_id\030\001 \001(\0132\021.monitoring.Kpi" +
           "Id\022\027\n\017kpi_description\030\002 \001(\t\022&\n\013kpi_id_li" +
           "st\030\003 \003(\0132\021.monitoring.KpiId\0228\n\017kpi_sampl" +
    @@ -21371,91 +21574,92 @@ public final class Monitoring {
           "intId\022&\n\nservice_id\030\007 \001(\0132\022.context.Serv" +
           "iceId\022\"\n\010slice_id\030\010 \001(\0132\020.context.SliceI" +
           "d\022,\n\rconnection_id\030\t \001(\0132\025.context.Conne" +
    -      "ctionId\"l\n\021MonitorKpiRequest\022!\n\006kpi_id\030\001" +
    -      " \001(\0132\021.monitoring.KpiId\022\033\n\023monitoring_wi" +
    -      "ndow_s\030\002 \001(\002\022\027\n\017sampling_rate_s\030\003 \001(\002\"\273\001" +
    -      "\n\010KpiQuery\022\"\n\007kpi_ids\030\001 \003(\0132\021.monitoring" +
    -      ".KpiId\022\033\n\023monitoring_window_s\030\002 \001(\002\022\026\n\016l" +
    -      "ast_n_samples\030\003 \001(\r\022+\n\017start_timestamp\030\004" +
    -      " \001(\0132\022.context.Timestamp\022)\n\rend_timestam" +
    -      "p\030\005 \001(\0132\022.context.Timestamp\"X\n\006RawKpi\022%\n" +
    -      "\ttimestamp\030\001 \001(\0132\022.context.Timestamp\022\'\n\t" +
    -      "kpi_value\030\002 \001(\0132\024.monitoring.KpiValue\"U\n" +
    -      "\nRawKpiList\022!\n\006kpi_id\030\001 \001(\0132\021.monitoring" +
    -      ".KpiId\022$\n\010raw_kpis\030\002 \003(\0132\022.monitoring.Ra" +
    -      "wKpi\"<\n\013RawKpiTable\022-\n\rraw_kpi_lists\030\001 \003" +
    -      "(\0132\026.monitoring.RawKpiList\"&\n\005KpiId\022\035\n\006k" +
    -      "pi_id\030\001 \001(\0132\r.context.Uuid\"x\n\003Kpi\022!\n\006kpi" +
    -      "_id\030\001 \001(\0132\021.monitoring.KpiId\022%\n\ttimestam" +
    -      "p\030\002 \001(\0132\022.context.Timestamp\022\'\n\tkpi_value" +
    -      "\030\003 \001(\0132\024.monitoring.KpiValue\"\250\001\n\rKpiValu" +
    -      "eRange\022)\n\013kpiMinValue\030\001 \001(\0132\024.monitoring" +
    -      ".KpiValue\022)\n\013kpiMaxValue\030\002 \001(\0132\024.monitor" +
    -      "ing.KpiValue\022\017\n\007inRange\030\003 \001(\010\022\027\n\017include" +
    -      "MinValue\030\004 \001(\010\022\027\n\017includeMaxValue\030\005 \001(\010\"" +
    -      "\241\001\n\010KpiValue\022\022\n\010int32Val\030\001 \001(\005H\000\022\023\n\tuint" +
    -      "32Val\030\002 \001(\rH\000\022\022\n\010int64Val\030\003 \001(\003H\000\022\023\n\tuin" +
    -      "t64Val\030\004 \001(\004H\000\022\022\n\010floatVal\030\005 \001(\002H\000\022\023\n\tst" +
    -      "ringVal\030\006 \001(\tH\000\022\021\n\007boolVal\030\007 \001(\010H\000B\007\n\005va" +
    -      "lue\"\'\n\007KpiList\022\034\n\003kpi\030\001 \003(\0132\017.monitoring" +
    -      ".Kpi\"K\n\021KpiDescriptorList\0226\n\023kpi_descrip" +
    -      "tor_list\030\001 \003(\0132\031.monitoring.KpiDescripto" +
    -      "r\"\362\001\n\016SubsDescriptor\022+\n\007subs_id\030\001 \001(\0132\032." +
    -      "monitoring.SubscriptionID\022!\n\006kpi_id\030\002 \001(" +
    -      "\0132\021.monitoring.KpiId\022\033\n\023sampling_duratio" +
    -      "n_s\030\003 \001(\002\022\033\n\023sampling_interval_s\030\004 \001(\002\022+" +
    -      "\n\017start_timestamp\030\005 \001(\0132\022.context.Timest" +
    -      "amp\022)\n\rend_timestamp\030\006 \001(\0132\022.context.Tim" +
    -      "estamp\"0\n\016SubscriptionID\022\036\n\007subs_id\030\001 \001(" +
    -      "\0132\r.context.Uuid\"b\n\014SubsResponse\022+\n\007subs" +
    -      "_id\030\001 \001(\0132\032.monitoring.SubscriptionID\022%\n" +
    -      "\010kpi_list\030\002 \001(\0132\023.monitoring.KpiList\"?\n\010" +
    -      "SubsList\0223\n\017subs_descriptor\030\001 \003(\0132\032.moni" +
    -      "toring.SubsDescriptor\"\337\001\n\017AlarmDescripto" +
    -      "r\022%\n\010alarm_id\030\001 \001(\0132\023.monitoring.AlarmID" +
    -      "\022\031\n\021alarm_description\030\002 \001(\t\022\014\n\004name\030\003 \001(" +
    -      "\t\022!\n\006kpi_id\030\004 \001(\0132\021.monitoring.KpiId\0222\n\017" +
    -      "kpi_value_range\030\005 \001(\0132\031.monitoring.KpiVa" +
    -      "lueRange\022%\n\ttimestamp\030\006 \001(\0132\022.context.Ti" +
    -      "mestamp\"*\n\007AlarmID\022\037\n\010alarm_id\030\001 \001(\0132\r.c" +
    -      "ontext.Uuid\"}\n\021AlarmSubscription\022%\n\010alar" +
    -      "m_id\030\001 \001(\0132\023.monitoring.AlarmID\022\036\n\026subsc" +
    -      "ription_timeout_s\030\002 \001(\002\022!\n\031subscription_" +
    -      "frequency_ms\030\003 \001(\002\"k\n\rAlarmResponse\022%\n\010a" +
    -      "larm_id\030\001 \001(\0132\023.monitoring.AlarmID\022\014\n\004te" +
    -      "xt\030\002 \001(\t\022%\n\010kpi_list\030\003 \001(\0132\023.monitoring." +
    -      "KpiList\"B\n\tAlarmList\0225\n\020alarm_descriptor" +
    -      "\030\001 \003(\0132\033.monitoring.AlarmDescriptor2\234\t\n\021" +
    -      "MonitoringService\0228\n\006SetKpi\022\031.monitoring" +
    -      ".KpiDescriptor\032\021.monitoring.KpiId\"\000\0220\n\tD" +
    -      "eleteKpi\022\021.monitoring.KpiId\032\016.context.Em" +
    -      "pty\"\000\022B\n\020GetKpiDescriptor\022\021.monitoring.K" +
    -      "piId\032\031.monitoring.KpiDescriptor\"\000\022G\n\024Get" +
    -      "KpiDescriptorList\022\016.context.Empty\032\035.moni" +
    -      "toring.KpiDescriptorList\"\000\022/\n\nIncludeKpi" +
    -      "\022\017.monitoring.Kpi\032\016.context.Empty\"\000\022=\n\nM" +
    -      "onitorKpi\022\035.monitoring.MonitorKpiRequest" +
    -      "\032\016.context.Empty\"\000\022?\n\014QueryKpiData\022\024.mon" +
    -      "itoring.KpiQuery\032\027.monitoring.RawKpiTabl" +
    -      "e\"\000\022N\n\022SetKpiSubscription\022\032.monitoring.S" +
    -      "ubsDescriptor\032\030.monitoring.SubsResponse\"" +
    -      "\0000\001\022M\n\021GetSubsDescriptor\022\032.monitoring.Su" +
    -      "bscriptionID\032\032.monitoring.SubsDescriptor" +
    -      "\"\000\022:\n\020GetSubscriptions\022\016.context.Empty\032\024" +
    -      ".monitoring.SubsList\"\000\022B\n\022DeleteSubscrip" +
    -      "tion\022\032.monitoring.SubscriptionID\032\016.conte" +
    -      "xt.Empty\"\000\022A\n\013SetKpiAlarm\022\033.monitoring.A" +
    -      "larmDescriptor\032\023.monitoring.AlarmID\"\000\0224\n" +
    -      "\tGetAlarms\022\016.context.Empty\032\025.monitoring." +
    -      "AlarmList\"\000\022H\n\022GetAlarmDescriptor\022\023.moni" +
    -      "toring.AlarmID\032\033.monitoring.AlarmDescrip" +
    -      "tor\"\000\022V\n\026GetAlarmResponseStream\022\035.monito" +
    -      "ring.AlarmSubscription\032\031.monitoring.Alar" +
    -      "mResponse\"\0000\001\0224\n\013DeleteAlarm\022\023.monitorin" +
    -      "g.AlarmID\032\016.context.Empty\"\000\0226\n\014GetStream" +
    -      "Kpi\022\021.monitoring.KpiId\032\017.monitoring.Kpi\"" +
    -      "\0000\001\0225\n\rGetInstantKpi\022\021.monitoring.KpiId\032" +
    -      "\017.monitoring.Kpi\"\000b\006proto3"
    +      "ctionId\022 \n\007link_id\030\n \001(\0132\017.context.LinkI" +
    +      "d\"l\n\021MonitorKpiRequest\022!\n\006kpi_id\030\001 \001(\0132\021" +
    +      ".monitoring.KpiId\022\033\n\023monitoring_window_s" +
    +      "\030\002 \001(\002\022\027\n\017sampling_rate_s\030\003 \001(\002\"\273\001\n\010KpiQ" +
    +      "uery\022\"\n\007kpi_ids\030\001 \003(\0132\021.monitoring.KpiId" +
    +      "\022\033\n\023monitoring_window_s\030\002 \001(\002\022\026\n\016last_n_" +
    +      "samples\030\003 \001(\r\022+\n\017start_timestamp\030\004 \001(\0132\022" +
    +      ".context.Timestamp\022)\n\rend_timestamp\030\005 \001(" +
    +      "\0132\022.context.Timestamp\"X\n\006RawKpi\022%\n\ttimes" +
    +      "tamp\030\001 \001(\0132\022.context.Timestamp\022\'\n\tkpi_va" +
    +      "lue\030\002 \001(\0132\024.monitoring.KpiValue\"U\n\nRawKp" +
    +      "iList\022!\n\006kpi_id\030\001 \001(\0132\021.monitoring.KpiId" +
    +      "\022$\n\010raw_kpis\030\002 \003(\0132\022.monitoring.RawKpi\"<" +
    +      "\n\013RawKpiTable\022-\n\rraw_kpi_lists\030\001 \003(\0132\026.m" +
    +      "onitoring.RawKpiList\"&\n\005KpiId\022\035\n\006kpi_id\030" +
    +      "\001 \001(\0132\r.context.Uuid\"x\n\003Kpi\022!\n\006kpi_id\030\001 " +
    +      "\001(\0132\021.monitoring.KpiId\022%\n\ttimestamp\030\002 \001(" +
    +      "\0132\022.context.Timestamp\022\'\n\tkpi_value\030\003 \001(\013" +
    +      "2\024.monitoring.KpiValue\"\250\001\n\rKpiValueRange" +
    +      "\022)\n\013kpiMinValue\030\001 \001(\0132\024.monitoring.KpiVa" +
    +      "lue\022)\n\013kpiMaxValue\030\002 \001(\0132\024.monitoring.Kp" +
    +      "iValue\022\017\n\007inRange\030\003 \001(\010\022\027\n\017includeMinVal" +
    +      "ue\030\004 \001(\010\022\027\n\017includeMaxValue\030\005 \001(\010\"\241\001\n\010Kp" +
    +      "iValue\022\022\n\010int32Val\030\001 \001(\005H\000\022\023\n\tuint32Val\030" +
    +      "\002 \001(\rH\000\022\022\n\010int64Val\030\003 \001(\003H\000\022\023\n\tuint64Val" +
    +      "\030\004 \001(\004H\000\022\022\n\010floatVal\030\005 \001(\002H\000\022\023\n\tstringVa" +
    +      "l\030\006 \001(\tH\000\022\021\n\007boolVal\030\007 \001(\010H\000B\007\n\005value\"\'\n" +
    +      "\007KpiList\022\034\n\003kpi\030\001 \003(\0132\017.monitoring.Kpi\"K" +
    +      "\n\021KpiDescriptorList\0226\n\023kpi_descriptor_li" +
    +      "st\030\001 \003(\0132\031.monitoring.KpiDescriptor\"\362\001\n\016" +
    +      "SubsDescriptor\022+\n\007subs_id\030\001 \001(\0132\032.monito" +
    +      "ring.SubscriptionID\022!\n\006kpi_id\030\002 \001(\0132\021.mo" +
    +      "nitoring.KpiId\022\033\n\023sampling_duration_s\030\003 " +
    +      "\001(\002\022\033\n\023sampling_interval_s\030\004 \001(\002\022+\n\017star" +
    +      "t_timestamp\030\005 \001(\0132\022.context.Timestamp\022)\n" +
    +      "\rend_timestamp\030\006 \001(\0132\022.context.Timestamp" +
    +      "\"0\n\016SubscriptionID\022\036\n\007subs_id\030\001 \001(\0132\r.co" +
    +      "ntext.Uuid\"b\n\014SubsResponse\022+\n\007subs_id\030\001 " +
    +      "\001(\0132\032.monitoring.SubscriptionID\022%\n\010kpi_l" +
    +      "ist\030\002 \001(\0132\023.monitoring.KpiList\"?\n\010SubsLi" +
    +      "st\0223\n\017subs_descriptor\030\001 \003(\0132\032.monitoring" +
    +      ".SubsDescriptor\"\337\001\n\017AlarmDescriptor\022%\n\010a" +
    +      "larm_id\030\001 \001(\0132\023.monitoring.AlarmID\022\031\n\021al" +
    +      "arm_description\030\002 \001(\t\022\014\n\004name\030\003 \001(\t\022!\n\006k" +
    +      "pi_id\030\004 \001(\0132\021.monitoring.KpiId\0222\n\017kpi_va" +
    +      "lue_range\030\005 \001(\0132\031.monitoring.KpiValueRan" +
    +      "ge\022%\n\ttimestamp\030\006 \001(\0132\022.context.Timestam" +
    +      "p\"*\n\007AlarmID\022\037\n\010alarm_id\030\001 \001(\0132\r.context" +
    +      ".Uuid\"}\n\021AlarmSubscription\022%\n\010alarm_id\030\001" +
    +      " \001(\0132\023.monitoring.AlarmID\022\036\n\026subscriptio" +
    +      "n_timeout_s\030\002 \001(\002\022!\n\031subscription_freque" +
    +      "ncy_ms\030\003 \001(\002\"k\n\rAlarmResponse\022%\n\010alarm_i" +
    +      "d\030\001 \001(\0132\023.monitoring.AlarmID\022\014\n\004text\030\002 \001" +
    +      "(\t\022%\n\010kpi_list\030\003 \001(\0132\023.monitoring.KpiLis" +
    +      "t\"B\n\tAlarmList\0225\n\020alarm_descriptor\030\001 \003(\013" +
    +      "2\033.monitoring.AlarmDescriptor2\234\t\n\021Monito" +
    +      "ringService\0228\n\006SetKpi\022\031.monitoring.KpiDe" +
    +      "scriptor\032\021.monitoring.KpiId\"\000\0220\n\tDeleteK" +
    +      "pi\022\021.monitoring.KpiId\032\016.context.Empty\"\000\022" +
    +      "B\n\020GetKpiDescriptor\022\021.monitoring.KpiId\032\031" +
    +      ".monitoring.KpiDescriptor\"\000\022G\n\024GetKpiDes" +
    +      "criptorList\022\016.context.Empty\032\035.monitoring" +
    +      ".KpiDescriptorList\"\000\022/\n\nIncludeKpi\022\017.mon" +
    +      "itoring.Kpi\032\016.context.Empty\"\000\022=\n\nMonitor" +
    +      "Kpi\022\035.monitoring.MonitorKpiRequest\032\016.con" +
    +      "text.Empty\"\000\022?\n\014QueryKpiData\022\024.monitorin" +
    +      "g.KpiQuery\032\027.monitoring.RawKpiTable\"\000\022N\n" +
    +      "\022SetKpiSubscription\022\032.monitoring.SubsDes" +
    +      "criptor\032\030.monitoring.SubsResponse\"\0000\001\022M\n" +
    +      "\021GetSubsDescriptor\022\032.monitoring.Subscrip" +
    +      "tionID\032\032.monitoring.SubsDescriptor\"\000\022:\n\020" +
    +      "GetSubscriptions\022\016.context.Empty\032\024.monit" +
    +      "oring.SubsList\"\000\022B\n\022DeleteSubscription\022\032" +
    +      ".monitoring.SubscriptionID\032\016.context.Emp" +
    +      "ty\"\000\022A\n\013SetKpiAlarm\022\033.monitoring.AlarmDe" +
    +      "scriptor\032\023.monitoring.AlarmID\"\000\0224\n\tGetAl" +
    +      "arms\022\016.context.Empty\032\025.monitoring.AlarmL" +
    +      "ist\"\000\022H\n\022GetAlarmDescriptor\022\023.monitoring" +
    +      ".AlarmID\032\033.monitoring.AlarmDescriptor\"\000\022" +
    +      "V\n\026GetAlarmResponseStream\022\035.monitoring.A" +
    +      "larmSubscription\032\031.monitoring.AlarmRespo" +
    +      "nse\"\0000\001\0224\n\013DeleteAlarm\022\023.monitoring.Alar" +
    +      "mID\032\016.context.Empty\"\000\0226\n\014GetStreamKpi\022\021." +
    +      "monitoring.KpiId\032\017.monitoring.Kpi\"\0000\001\0225\n" +
    +      "\rGetInstantKpi\022\021.monitoring.KpiId\032\017.moni" +
    +      "toring.Kpi\"\000b\006proto3"
         };
         descriptor = com.google.protobuf.Descriptors.FileDescriptor
           .internalBuildGeneratedFileFrom(descriptorData,
    @@ -21468,7 +21672,7 @@ public final class Monitoring {
         internal_static_monitoring_KpiDescriptor_fieldAccessorTable = new
           com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
             internal_static_monitoring_KpiDescriptor_descriptor,
    -        new java.lang.String[] { "KpiId", "KpiDescription", "KpiIdList", "KpiSampleType", "DeviceId", "EndpointId", "ServiceId", "SliceId", "ConnectionId", });
    +        new java.lang.String[] { "KpiId", "KpiDescription", "KpiIdList", "KpiSampleType", "DeviceId", "EndpointId", "ServiceId", "SliceId", "ConnectionId", "LinkId", });
         internal_static_monitoring_MonitorKpiRequest_descriptor =
           getDescriptor().getMessageTypes().get(1);
         internal_static_monitoring_MonitorKpiRequest_fieldAccessorTable = new
    diff --git a/src/automation/target/generated-sources/grpc/monitoring/MonitoringService.java b/src/ztp/target/generated-sources/grpc/monitoring/MonitoringService.java
    similarity index 100%
    rename from src/automation/target/generated-sources/grpc/monitoring/MonitoringService.java
    rename to src/ztp/target/generated-sources/grpc/monitoring/MonitoringService.java
    diff --git a/src/automation/target/generated-sources/grpc/monitoring/MonitoringServiceBean.java b/src/ztp/target/generated-sources/grpc/monitoring/MonitoringServiceBean.java
    similarity index 100%
    rename from src/automation/target/generated-sources/grpc/monitoring/MonitoringServiceBean.java
    rename to src/ztp/target/generated-sources/grpc/monitoring/MonitoringServiceBean.java
    diff --git a/src/automation/target/generated-sources/grpc/monitoring/MonitoringServiceClient.java b/src/ztp/target/generated-sources/grpc/monitoring/MonitoringServiceClient.java
    similarity index 100%
    rename from src/automation/target/generated-sources/grpc/monitoring/MonitoringServiceClient.java
    rename to src/ztp/target/generated-sources/grpc/monitoring/MonitoringServiceClient.java
    diff --git a/src/automation/target/generated-sources/grpc/monitoring/MonitoringServiceGrpc.java b/src/ztp/target/generated-sources/grpc/monitoring/MonitoringServiceGrpc.java
    similarity index 100%
    rename from src/automation/target/generated-sources/grpc/monitoring/MonitoringServiceGrpc.java
    rename to src/ztp/target/generated-sources/grpc/monitoring/MonitoringServiceGrpc.java
    diff --git a/src/automation/target/generated-sources/grpc/monitoring/MutinyMonitoringServiceGrpc.java b/src/ztp/target/generated-sources/grpc/monitoring/MutinyMonitoringServiceGrpc.java
    similarity index 100%
    rename from src/automation/target/generated-sources/grpc/monitoring/MutinyMonitoringServiceGrpc.java
    rename to src/ztp/target/generated-sources/grpc/monitoring/MutinyMonitoringServiceGrpc.java
    diff --git a/src/automation/target/generated-sources/grpc/automation/MutinyAutomationServiceGrpc.java b/src/ztp/target/generated-sources/grpc/ztp/MutinyZtpServiceGrpc.java
    similarity index 56%
    rename from src/automation/target/generated-sources/grpc/automation/MutinyAutomationServiceGrpc.java
    rename to src/ztp/target/generated-sources/grpc/ztp/MutinyZtpServiceGrpc.java
    index 64565286ca36fd0b820c000e466954144207ab0b..d46fdffb7b88f34ad648053139920d23dc2ab9d1 100644
    --- a/src/automation/target/generated-sources/grpc/automation/MutinyAutomationServiceGrpc.java
    +++ b/src/ztp/target/generated-sources/grpc/ztp/MutinyZtpServiceGrpc.java
    @@ -1,6 +1,6 @@
    -package automation;
    +package ztp;
     
    -import static automation.AutomationServiceGrpc.getServiceDescriptor;
    +import static ztp.ZtpServiceGrpc.getServiceDescriptor;
     import static io.grpc.stub.ServerCalls.asyncUnaryCall;
     import static io.grpc.stub.ServerCalls.asyncServerStreamingCall;
     import static io.grpc.stub.ServerCalls.asyncClientStreamingCall;
    @@ -8,67 +8,67 @@ import static io.grpc.stub.ServerCalls.asyncBidiStreamingCall;
     
     @javax.annotation.Generated(
     value = "by Mutiny Grpc generator",
    -comments = "Source: automation.proto")
    -public final class MutinyAutomationServiceGrpc implements io.quarkus.grpc.runtime.MutinyGrpc {
    -    private MutinyAutomationServiceGrpc() {}
    +comments = "Source: ztp.proto")
    +public final class MutinyZtpServiceGrpc implements io.quarkus.grpc.runtime.MutinyGrpc {
    +    private MutinyZtpServiceGrpc() {}
     
    -    public static MutinyAutomationServiceStub newMutinyStub(io.grpc.Channel channel) {
    -        return new MutinyAutomationServiceStub(channel);
    +    public static MutinyZtpServiceStub newMutinyStub(io.grpc.Channel channel) {
    +        return new MutinyZtpServiceStub(channel);
         }
     
         
    -    public static final class MutinyAutomationServiceStub extends io.grpc.stub.AbstractStub implements io.quarkus.grpc.runtime.MutinyStub {
    -        private AutomationServiceGrpc.AutomationServiceStub delegateStub;
    +    public static final class MutinyZtpServiceStub extends io.grpc.stub.AbstractStub implements io.quarkus.grpc.runtime.MutinyStub {
    +        private ZtpServiceGrpc.ZtpServiceStub delegateStub;
     
    -        private MutinyAutomationServiceStub(io.grpc.Channel channel) {
    +        private MutinyZtpServiceStub(io.grpc.Channel channel) {
                 super(channel);
    -            delegateStub = AutomationServiceGrpc.newStub(channel);
    +            delegateStub = ZtpServiceGrpc.newStub(channel);
             }
     
    -        private MutinyAutomationServiceStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
    +        private MutinyZtpServiceStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
                 super(channel, callOptions);
    -            delegateStub = AutomationServiceGrpc.newStub(channel).build(channel, callOptions);
    +            delegateStub = ZtpServiceGrpc.newStub(channel).build(channel, callOptions);
             }
     
             @Override
    -        protected MutinyAutomationServiceStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
    -            return new MutinyAutomationServiceStub(channel, callOptions);
    +        protected MutinyZtpServiceStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
    +            return new MutinyZtpServiceStub(channel, callOptions);
             }
     
             
    -        public io.smallrye.mutiny.Uni ztpGetDeviceRole(automation.Automation.DeviceRoleId request) {
    +        public io.smallrye.mutiny.Uni ztpGetDeviceRole(ztp.Ztp.DeviceRoleId request) {
                 return io.quarkus.grpc.runtime.ClientCalls.oneToOne(request, delegateStub::ztpGetDeviceRole);
             }
     
             
    -        public io.smallrye.mutiny.Uni ztpGetDeviceRolesByDeviceId(context.ContextOuterClass.DeviceId request) {
    +        public io.smallrye.mutiny.Uni ztpGetDeviceRolesByDeviceId(context.ContextOuterClass.DeviceId request) {
                 return io.quarkus.grpc.runtime.ClientCalls.oneToOne(request, delegateStub::ztpGetDeviceRolesByDeviceId);
             }
     
             
    -        public io.smallrye.mutiny.Uni ztpAdd(automation.Automation.DeviceRole request) {
    +        public io.smallrye.mutiny.Uni ztpAdd(ztp.Ztp.DeviceRole request) {
                 return io.quarkus.grpc.runtime.ClientCalls.oneToOne(request, delegateStub::ztpAdd);
             }
     
             
    -        public io.smallrye.mutiny.Uni ztpUpdate(automation.Automation.DeviceRoleConfig request) {
    +        public io.smallrye.mutiny.Uni ztpUpdate(ztp.Ztp.DeviceRoleConfig request) {
                 return io.quarkus.grpc.runtime.ClientCalls.oneToOne(request, delegateStub::ztpUpdate);
             }
     
             
    -        public io.smallrye.mutiny.Uni ztpDelete(automation.Automation.DeviceRole request) {
    +        public io.smallrye.mutiny.Uni ztpDelete(ztp.Ztp.DeviceRole request) {
                 return io.quarkus.grpc.runtime.ClientCalls.oneToOne(request, delegateStub::ztpDelete);
             }
     
             
    -        public io.smallrye.mutiny.Uni ztpDeleteAll(context.ContextOuterClass.Empty request) {
    +        public io.smallrye.mutiny.Uni ztpDeleteAll(context.ContextOuterClass.Empty request) {
                 return io.quarkus.grpc.runtime.ClientCalls.oneToOne(request, delegateStub::ztpDeleteAll);
             }
     
         }
     
         
    -    public static abstract class AutomationServiceImplBase implements io.grpc.BindableService {
    +    public static abstract class ZtpServiceImplBase implements io.grpc.BindableService {
     
             private String compression;
             /**
    @@ -76,85 +76,85 @@ public final class MutinyAutomationServiceGrpc implements io.quarkus.grpc.runtim
             *
             * @param compression the compression, e.g {@code gzip}
             */
    -        public AutomationServiceImplBase withCompression(String compression) {
    +        public ZtpServiceImplBase withCompression(String compression) {
             this.compression = compression;
             return this;
             }
     
     
             
    -        public io.smallrye.mutiny.Uni ztpGetDeviceRole(automation.Automation.DeviceRoleId request) {
    +        public io.smallrye.mutiny.Uni ztpGetDeviceRole(ztp.Ztp.DeviceRoleId request) {
                 throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED);
             }
     
             
    -        public io.smallrye.mutiny.Uni ztpGetDeviceRolesByDeviceId(context.ContextOuterClass.DeviceId request) {
    +        public io.smallrye.mutiny.Uni ztpGetDeviceRolesByDeviceId(context.ContextOuterClass.DeviceId request) {
                 throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED);
             }
     
             
    -        public io.smallrye.mutiny.Uni ztpAdd(automation.Automation.DeviceRole request) {
    +        public io.smallrye.mutiny.Uni ztpAdd(ztp.Ztp.DeviceRole request) {
                 throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED);
             }
     
             
    -        public io.smallrye.mutiny.Uni ztpUpdate(automation.Automation.DeviceRoleConfig request) {
    +        public io.smallrye.mutiny.Uni ztpUpdate(ztp.Ztp.DeviceRoleConfig request) {
                 throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED);
             }
     
             
    -        public io.smallrye.mutiny.Uni ztpDelete(automation.Automation.DeviceRole request) {
    +        public io.smallrye.mutiny.Uni ztpDelete(ztp.Ztp.DeviceRole request) {
                 throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED);
             }
     
             
    -        public io.smallrye.mutiny.Uni ztpDeleteAll(context.ContextOuterClass.Empty request) {
    +        public io.smallrye.mutiny.Uni ztpDeleteAll(context.ContextOuterClass.Empty request) {
                 throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED);
             }
     
             @java.lang.Override public final io.grpc.ServerServiceDefinition bindService() {
                 return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor())
                         .addMethod(
    -                            automation.AutomationServiceGrpc.getZtpGetDeviceRoleMethod(),
    +                            ztp.ZtpServiceGrpc.getZtpGetDeviceRoleMethod(),
                                 asyncUnaryCall(
                                         new MethodHandlers<
    -                                            automation.Automation.DeviceRoleId,
    -                                            automation.Automation.DeviceRole>(
    +                                            ztp.Ztp.DeviceRoleId,
    +                                            ztp.Ztp.DeviceRole>(
                                                 this, METHODID_ZTP_GET_DEVICE_ROLE, compression)))
                         .addMethod(
    -                            automation.AutomationServiceGrpc.getZtpGetDeviceRolesByDeviceIdMethod(),
    +                            ztp.ZtpServiceGrpc.getZtpGetDeviceRolesByDeviceIdMethod(),
                                 asyncUnaryCall(
                                         new MethodHandlers<
                                                 context.ContextOuterClass.DeviceId,
    -                                            automation.Automation.DeviceRoleList>(
    +                                            ztp.Ztp.DeviceRoleList>(
                                                 this, METHODID_ZTP_GET_DEVICE_ROLES_BY_DEVICE_ID, compression)))
                         .addMethod(
    -                            automation.AutomationServiceGrpc.getZtpAddMethod(),
    +                            ztp.ZtpServiceGrpc.getZtpAddMethod(),
                                 asyncUnaryCall(
                                         new MethodHandlers<
    -                                            automation.Automation.DeviceRole,
    -                                            automation.Automation.DeviceRoleState>(
    +                                            ztp.Ztp.DeviceRole,
    +                                            ztp.Ztp.DeviceRoleState>(
                                                 this, METHODID_ZTP_ADD, compression)))
                         .addMethod(
    -                            automation.AutomationServiceGrpc.getZtpUpdateMethod(),
    +                            ztp.ZtpServiceGrpc.getZtpUpdateMethod(),
                                 asyncUnaryCall(
                                         new MethodHandlers<
    -                                            automation.Automation.DeviceRoleConfig,
    -                                            automation.Automation.DeviceRoleState>(
    +                                            ztp.Ztp.DeviceRoleConfig,
    +                                            ztp.Ztp.DeviceRoleState>(
                                                 this, METHODID_ZTP_UPDATE, compression)))
                         .addMethod(
    -                            automation.AutomationServiceGrpc.getZtpDeleteMethod(),
    +                            ztp.ZtpServiceGrpc.getZtpDeleteMethod(),
                                 asyncUnaryCall(
                                         new MethodHandlers<
    -                                            automation.Automation.DeviceRole,
    -                                            automation.Automation.DeviceRoleState>(
    +                                            ztp.Ztp.DeviceRole,
    +                                            ztp.Ztp.DeviceRoleState>(
                                                 this, METHODID_ZTP_DELETE, compression)))
                         .addMethod(
    -                            automation.AutomationServiceGrpc.getZtpDeleteAllMethod(),
    +                            ztp.ZtpServiceGrpc.getZtpDeleteAllMethod(),
                                 asyncUnaryCall(
                                         new MethodHandlers<
                                                 context.ContextOuterClass.Empty,
    -                                            automation.Automation.DeviceDeletionResult>(
    +                                            ztp.Ztp.DeviceDeletionResult>(
                                                 this, METHODID_ZTP_DELETE_ALL, compression)))
                         .build();
             }
    @@ -172,11 +172,11 @@ public final class MutinyAutomationServiceGrpc implements io.quarkus.grpc.runtim
                 io.grpc.stub.ServerCalls.ServerStreamingMethod,
                 io.grpc.stub.ServerCalls.ClientStreamingMethod,
                 io.grpc.stub.ServerCalls.BidiStreamingMethod {
    -        private final AutomationServiceImplBase serviceImpl;
    +        private final ZtpServiceImplBase serviceImpl;
             private final int methodId;
             private final String compression;
     
    -        MethodHandlers(AutomationServiceImplBase serviceImpl, int methodId, String compression) {
    +        MethodHandlers(ZtpServiceImplBase serviceImpl, int methodId, String compression) {
                 this.serviceImpl = serviceImpl;
                 this.methodId = methodId;
                 this.compression = compression;
    @@ -187,38 +187,38 @@ public final class MutinyAutomationServiceGrpc implements io.quarkus.grpc.runtim
             public void invoke(Req request, io.grpc.stub.StreamObserver responseObserver) {
                 switch (methodId) {
                     case METHODID_ZTP_GET_DEVICE_ROLE:
    -                    io.quarkus.grpc.runtime.ServerCalls.oneToOne((automation.Automation.DeviceRoleId) request,
    -                            (io.grpc.stub.StreamObserver) responseObserver,
    +                    io.quarkus.grpc.runtime.ServerCalls.oneToOne((ztp.Ztp.DeviceRoleId) request,
    +                            (io.grpc.stub.StreamObserver) responseObserver,
                                 compression,
                                 serviceImpl::ztpGetDeviceRole);
                         break;
                     case METHODID_ZTP_GET_DEVICE_ROLES_BY_DEVICE_ID:
                         io.quarkus.grpc.runtime.ServerCalls.oneToOne((context.ContextOuterClass.DeviceId) request,
    -                            (io.grpc.stub.StreamObserver) responseObserver,
    +                            (io.grpc.stub.StreamObserver) responseObserver,
                                 compression,
                                 serviceImpl::ztpGetDeviceRolesByDeviceId);
                         break;
                     case METHODID_ZTP_ADD:
    -                    io.quarkus.grpc.runtime.ServerCalls.oneToOne((automation.Automation.DeviceRole) request,
    -                            (io.grpc.stub.StreamObserver) responseObserver,
    +                    io.quarkus.grpc.runtime.ServerCalls.oneToOne((ztp.Ztp.DeviceRole) request,
    +                            (io.grpc.stub.StreamObserver) responseObserver,
                                 compression,
                                 serviceImpl::ztpAdd);
                         break;
                     case METHODID_ZTP_UPDATE:
    -                    io.quarkus.grpc.runtime.ServerCalls.oneToOne((automation.Automation.DeviceRoleConfig) request,
    -                            (io.grpc.stub.StreamObserver) responseObserver,
    +                    io.quarkus.grpc.runtime.ServerCalls.oneToOne((ztp.Ztp.DeviceRoleConfig) request,
    +                            (io.grpc.stub.StreamObserver) responseObserver,
                                 compression,
                                 serviceImpl::ztpUpdate);
                         break;
                     case METHODID_ZTP_DELETE:
    -                    io.quarkus.grpc.runtime.ServerCalls.oneToOne((automation.Automation.DeviceRole) request,
    -                            (io.grpc.stub.StreamObserver) responseObserver,
    +                    io.quarkus.grpc.runtime.ServerCalls.oneToOne((ztp.Ztp.DeviceRole) request,
    +                            (io.grpc.stub.StreamObserver) responseObserver,
                                 compression,
                                 serviceImpl::ztpDelete);
                         break;
                     case METHODID_ZTP_DELETE_ALL:
                         io.quarkus.grpc.runtime.ServerCalls.oneToOne((context.ContextOuterClass.Empty) request,
    -                            (io.grpc.stub.StreamObserver) responseObserver,
    +                            (io.grpc.stub.StreamObserver) responseObserver,
                                 compression,
                                 serviceImpl::ztpDeleteAll);
                         break;
    diff --git a/src/automation/target/generated-sources/grpc/automation/Automation.java b/src/ztp/target/generated-sources/grpc/ztp/Ztp.java
    similarity index 75%
    rename from src/automation/target/generated-sources/grpc/automation/Automation.java
    rename to src/ztp/target/generated-sources/grpc/ztp/Ztp.java
    index cd82f7423092c72c6c2fa02836db645db52f7041..c9ff87a276b87ab9448b93a9f3c2e0bb8b1f2586 100644
    --- a/src/automation/target/generated-sources/grpc/automation/Automation.java
    +++ b/src/ztp/target/generated-sources/grpc/ztp/Ztp.java
    @@ -1,10 +1,10 @@
     // Generated by the protocol buffer compiler.  DO NOT EDIT!
    -// source: automation.proto
    +// source: ztp.proto
     
    -package automation;
    +package ztp;
     
    -public final class Automation {
    -  private Automation() {}
    +public final class Ztp {
    +  private Ztp() {}
       public static void registerAllExtensions(
           com.google.protobuf.ExtensionRegistryLite registry) {
       }
    @@ -15,7 +15,7 @@ public final class Automation {
             (com.google.protobuf.ExtensionRegistryLite) registry);
       }
       /**
    -   * Protobuf enum {@code automation.DeviceRoleType}
    +   * Protobuf enum {@code ztp.DeviceRoleType}
        */
       public enum DeviceRoleType
           implements com.google.protobuf.ProtocolMessageEnum {
    @@ -114,7 +114,7 @@ public final class Automation {
         }
         public static final com.google.protobuf.Descriptors.EnumDescriptor
             getDescriptor() {
    -      return automation.Automation.getDescriptor().getEnumTypes().get(0);
    +      return ztp.Ztp.getDescriptor().getEnumTypes().get(0);
         }
     
         private static final DeviceRoleType[] VALUES = values();
    @@ -137,11 +137,11 @@ public final class Automation {
           this.value = value;
         }
     
    -    // @@protoc_insertion_point(enum_scope:automation.DeviceRoleType)
    +    // @@protoc_insertion_point(enum_scope:ztp.DeviceRoleType)
       }
     
       /**
    -   * Protobuf enum {@code automation.ZtpDeviceState}
    +   * Protobuf enum {@code ztp.ZtpDeviceState}
        */
       public enum ZtpDeviceState
           implements com.google.protobuf.ProtocolMessageEnum {
    @@ -240,7 +240,7 @@ public final class Automation {
         }
         public static final com.google.protobuf.Descriptors.EnumDescriptor
             getDescriptor() {
    -      return automation.Automation.getDescriptor().getEnumTypes().get(1);
    +      return ztp.Ztp.getDescriptor().getEnumTypes().get(1);
         }
     
         private static final ZtpDeviceState[] VALUES = values();
    @@ -263,11 +263,11 @@ public final class Automation {
           this.value = value;
         }
     
    -    // @@protoc_insertion_point(enum_scope:automation.ZtpDeviceState)
    +    // @@protoc_insertion_point(enum_scope:ztp.ZtpDeviceState)
       }
     
       public interface DeviceRoleIdOrBuilder extends
    -      // @@protoc_insertion_point(interface_extends:automation.DeviceRoleId)
    +      // @@protoc_insertion_point(interface_extends:ztp.DeviceRoleId)
           com.google.protobuf.MessageOrBuilder {
     
         /**
    @@ -301,11 +301,11 @@ public final class Automation {
         context.ContextOuterClass.DeviceIdOrBuilder getDevIdOrBuilder();
       }
       /**
    -   * Protobuf type {@code automation.DeviceRoleId}
    +   * Protobuf type {@code ztp.DeviceRoleId}
        */
       public static final class DeviceRoleId extends
           com.google.protobuf.GeneratedMessageV3 implements
    -      // @@protoc_insertion_point(message_implements:automation.DeviceRoleId)
    +      // @@protoc_insertion_point(message_implements:ztp.DeviceRoleId)
           DeviceRoleIdOrBuilder {
       private static final long serialVersionUID = 0L;
         // Use DeviceRoleId.newBuilder() to construct.
    @@ -392,15 +392,15 @@ public final class Automation {
         }
         public static final com.google.protobuf.Descriptors.Descriptor
             getDescriptor() {
    -      return automation.Automation.internal_static_automation_DeviceRoleId_descriptor;
    +      return ztp.Ztp.internal_static_ztp_DeviceRoleId_descriptor;
         }
     
         @java.lang.Override
         protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
             internalGetFieldAccessorTable() {
    -      return automation.Automation.internal_static_automation_DeviceRoleId_fieldAccessorTable
    +      return ztp.Ztp.internal_static_ztp_DeviceRoleId_fieldAccessorTable
               .ensureFieldAccessorsInitialized(
    -              automation.Automation.DeviceRoleId.class, automation.Automation.DeviceRoleId.Builder.class);
    +              ztp.Ztp.DeviceRoleId.class, ztp.Ztp.DeviceRoleId.Builder.class);
         }
     
         public static final int DEVROLEID_FIELD_NUMBER = 1;
    @@ -502,10 +502,10 @@ public final class Automation {
           if (obj == this) {
            return true;
           }
    -      if (!(obj instanceof automation.Automation.DeviceRoleId)) {
    +      if (!(obj instanceof ztp.Ztp.DeviceRoleId)) {
             return super.equals(obj);
           }
    -      automation.Automation.DeviceRoleId other = (automation.Automation.DeviceRoleId) obj;
    +      ztp.Ztp.DeviceRoleId other = (ztp.Ztp.DeviceRoleId) obj;
     
           if (hasDevRoleId() != other.hasDevRoleId()) return false;
           if (hasDevRoleId()) {
    @@ -541,69 +541,69 @@ public final class Automation {
           return hash;
         }
     
    -    public static automation.Automation.DeviceRoleId parseFrom(
    +    public static ztp.Ztp.DeviceRoleId parseFrom(
             java.nio.ByteBuffer data)
             throws com.google.protobuf.InvalidProtocolBufferException {
           return PARSER.parseFrom(data);
         }
    -    public static automation.Automation.DeviceRoleId parseFrom(
    +    public static ztp.Ztp.DeviceRoleId parseFrom(
             java.nio.ByteBuffer data,
             com.google.protobuf.ExtensionRegistryLite extensionRegistry)
             throws com.google.protobuf.InvalidProtocolBufferException {
           return PARSER.parseFrom(data, extensionRegistry);
         }
    -    public static automation.Automation.DeviceRoleId parseFrom(
    +    public static ztp.Ztp.DeviceRoleId parseFrom(
             com.google.protobuf.ByteString data)
             throws com.google.protobuf.InvalidProtocolBufferException {
           return PARSER.parseFrom(data);
         }
    -    public static automation.Automation.DeviceRoleId parseFrom(
    +    public static ztp.Ztp.DeviceRoleId parseFrom(
             com.google.protobuf.ByteString data,
             com.google.protobuf.ExtensionRegistryLite extensionRegistry)
             throws com.google.protobuf.InvalidProtocolBufferException {
           return PARSER.parseFrom(data, extensionRegistry);
         }
    -    public static automation.Automation.DeviceRoleId parseFrom(byte[] data)
    +    public static ztp.Ztp.DeviceRoleId parseFrom(byte[] data)
             throws com.google.protobuf.InvalidProtocolBufferException {
           return PARSER.parseFrom(data);
         }
    -    public static automation.Automation.DeviceRoleId parseFrom(
    +    public static ztp.Ztp.DeviceRoleId parseFrom(
             byte[] data,
             com.google.protobuf.ExtensionRegistryLite extensionRegistry)
             throws com.google.protobuf.InvalidProtocolBufferException {
           return PARSER.parseFrom(data, extensionRegistry);
         }
    -    public static automation.Automation.DeviceRoleId parseFrom(java.io.InputStream input)
    +    public static ztp.Ztp.DeviceRoleId parseFrom(java.io.InputStream input)
             throws java.io.IOException {
           return com.google.protobuf.GeneratedMessageV3
               .parseWithIOException(PARSER, input);
         }
    -    public static automation.Automation.DeviceRoleId parseFrom(
    +    public static ztp.Ztp.DeviceRoleId parseFrom(
             java.io.InputStream input,
             com.google.protobuf.ExtensionRegistryLite extensionRegistry)
             throws java.io.IOException {
           return com.google.protobuf.GeneratedMessageV3
               .parseWithIOException(PARSER, input, extensionRegistry);
         }
    -    public static automation.Automation.DeviceRoleId parseDelimitedFrom(java.io.InputStream input)
    +    public static ztp.Ztp.DeviceRoleId parseDelimitedFrom(java.io.InputStream input)
             throws java.io.IOException {
           return com.google.protobuf.GeneratedMessageV3
               .parseDelimitedWithIOException(PARSER, input);
         }
    -    public static automation.Automation.DeviceRoleId parseDelimitedFrom(
    +    public static ztp.Ztp.DeviceRoleId parseDelimitedFrom(
             java.io.InputStream input,
             com.google.protobuf.ExtensionRegistryLite extensionRegistry)
             throws java.io.IOException {
           return com.google.protobuf.GeneratedMessageV3
               .parseDelimitedWithIOException(PARSER, input, extensionRegistry);
         }
    -    public static automation.Automation.DeviceRoleId parseFrom(
    +    public static ztp.Ztp.DeviceRoleId parseFrom(
             com.google.protobuf.CodedInputStream input)
             throws java.io.IOException {
           return com.google.protobuf.GeneratedMessageV3
               .parseWithIOException(PARSER, input);
         }
    -    public static automation.Automation.DeviceRoleId parseFrom(
    +    public static ztp.Ztp.DeviceRoleId parseFrom(
             com.google.protobuf.CodedInputStream input,
             com.google.protobuf.ExtensionRegistryLite extensionRegistry)
             throws java.io.IOException {
    @@ -616,7 +616,7 @@ public final class Automation {
         public static Builder newBuilder() {
           return DEFAULT_INSTANCE.toBuilder();
         }
    -    public static Builder newBuilder(automation.Automation.DeviceRoleId prototype) {
    +    public static Builder newBuilder(ztp.Ztp.DeviceRoleId prototype) {
           return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
         }
         @java.lang.Override
    @@ -632,26 +632,26 @@ public final class Automation {
           return builder;
         }
         /**
    -     * Protobuf type {@code automation.DeviceRoleId}
    +     * Protobuf type {@code ztp.DeviceRoleId}
          */
         public static final class Builder extends
             com.google.protobuf.GeneratedMessageV3.Builder implements
    -        // @@protoc_insertion_point(builder_implements:automation.DeviceRoleId)
    -        automation.Automation.DeviceRoleIdOrBuilder {
    +        // @@protoc_insertion_point(builder_implements:ztp.DeviceRoleId)
    +        ztp.Ztp.DeviceRoleIdOrBuilder {
           public static final com.google.protobuf.Descriptors.Descriptor
               getDescriptor() {
    -        return automation.Automation.internal_static_automation_DeviceRoleId_descriptor;
    +        return ztp.Ztp.internal_static_ztp_DeviceRoleId_descriptor;
           }
     
           @java.lang.Override
           protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
               internalGetFieldAccessorTable() {
    -        return automation.Automation.internal_static_automation_DeviceRoleId_fieldAccessorTable
    +        return ztp.Ztp.internal_static_ztp_DeviceRoleId_fieldAccessorTable
                 .ensureFieldAccessorsInitialized(
    -                automation.Automation.DeviceRoleId.class, automation.Automation.DeviceRoleId.Builder.class);
    +                ztp.Ztp.DeviceRoleId.class, ztp.Ztp.DeviceRoleId.Builder.class);
           }
     
    -      // Construct using automation.Automation.DeviceRoleId.newBuilder()
    +      // Construct using ztp.Ztp.DeviceRoleId.newBuilder()
           private Builder() {
             maybeForceBuilderInitialization();
           }
    @@ -687,17 +687,17 @@ public final class Automation {
           @java.lang.Override
           public com.google.protobuf.Descriptors.Descriptor
               getDescriptorForType() {
    -        return automation.Automation.internal_static_automation_DeviceRoleId_descriptor;
    +        return ztp.Ztp.internal_static_ztp_DeviceRoleId_descriptor;
           }
     
           @java.lang.Override
    -      public automation.Automation.DeviceRoleId getDefaultInstanceForType() {
    -        return automation.Automation.DeviceRoleId.getDefaultInstance();
    +      public ztp.Ztp.DeviceRoleId getDefaultInstanceForType() {
    +        return ztp.Ztp.DeviceRoleId.getDefaultInstance();
           }
     
           @java.lang.Override
    -      public automation.Automation.DeviceRoleId build() {
    -        automation.Automation.DeviceRoleId result = buildPartial();
    +      public ztp.Ztp.DeviceRoleId build() {
    +        ztp.Ztp.DeviceRoleId result = buildPartial();
             if (!result.isInitialized()) {
               throw newUninitializedMessageException(result);
             }
    @@ -705,8 +705,8 @@ public final class Automation {
           }
     
           @java.lang.Override
    -      public automation.Automation.DeviceRoleId buildPartial() {
    -        automation.Automation.DeviceRoleId result = new automation.Automation.DeviceRoleId(this);
    +      public ztp.Ztp.DeviceRoleId buildPartial() {
    +        ztp.Ztp.DeviceRoleId result = new ztp.Ztp.DeviceRoleId(this);
             if (devRoleIdBuilder_ == null) {
               result.devRoleId_ = devRoleId_;
             } else {
    @@ -755,16 +755,16 @@ public final class Automation {
           }
           @java.lang.Override
           public Builder mergeFrom(com.google.protobuf.Message other) {
    -        if (other instanceof automation.Automation.DeviceRoleId) {
    -          return mergeFrom((automation.Automation.DeviceRoleId)other);
    +        if (other instanceof ztp.Ztp.DeviceRoleId) {
    +          return mergeFrom((ztp.Ztp.DeviceRoleId)other);
             } else {
               super.mergeFrom(other);
               return this;
             }
           }
     
    -      public Builder mergeFrom(automation.Automation.DeviceRoleId other) {
    -        if (other == automation.Automation.DeviceRoleId.getDefaultInstance()) return this;
    +      public Builder mergeFrom(ztp.Ztp.DeviceRoleId other) {
    +        if (other == ztp.Ztp.DeviceRoleId.getDefaultInstance()) return this;
             if (other.hasDevRoleId()) {
               mergeDevRoleId(other.getDevRoleId());
             }
    @@ -786,11 +786,11 @@ public final class Automation {
               com.google.protobuf.CodedInputStream input,
               com.google.protobuf.ExtensionRegistryLite extensionRegistry)
               throws java.io.IOException {
    -        automation.Automation.DeviceRoleId parsedMessage = null;
    +        ztp.Ztp.DeviceRoleId parsedMessage = null;
             try {
               parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
             } catch (com.google.protobuf.InvalidProtocolBufferException e) {
    -          parsedMessage = (automation.Automation.DeviceRoleId) e.getUnfinishedMessage();
    +          parsedMessage = (ztp.Ztp.DeviceRoleId) e.getUnfinishedMessage();
               throw e.unwrapIOException();
             } finally {
               if (parsedMessage != null) {
    @@ -1050,16 +1050,16 @@ public final class Automation {
           }
     
     
    -      // @@protoc_insertion_point(builder_scope:automation.DeviceRoleId)
    +      // @@protoc_insertion_point(builder_scope:ztp.DeviceRoleId)
         }
     
    -    // @@protoc_insertion_point(class_scope:automation.DeviceRoleId)
    -    private static final automation.Automation.DeviceRoleId DEFAULT_INSTANCE;
    +    // @@protoc_insertion_point(class_scope:ztp.DeviceRoleId)
    +    private static final ztp.Ztp.DeviceRoleId DEFAULT_INSTANCE;
         static {
    -      DEFAULT_INSTANCE = new automation.Automation.DeviceRoleId();
    +      DEFAULT_INSTANCE = new ztp.Ztp.DeviceRoleId();
         }
     
    -    public static automation.Automation.DeviceRoleId getDefaultInstance() {
    +    public static ztp.Ztp.DeviceRoleId getDefaultInstance() {
           return DEFAULT_INSTANCE;
         }
     
    @@ -1084,48 +1084,48 @@ public final class Automation {
         }
     
         @java.lang.Override
    -    public automation.Automation.DeviceRoleId getDefaultInstanceForType() {
    +    public ztp.Ztp.DeviceRoleId getDefaultInstanceForType() {
           return DEFAULT_INSTANCE;
         }
     
       }
     
       public interface DeviceRoleOrBuilder extends
    -      // @@protoc_insertion_point(interface_extends:automation.DeviceRole)
    +      // @@protoc_insertion_point(interface_extends:ztp.DeviceRole)
           com.google.protobuf.MessageOrBuilder {
     
         /**
    -     * .automation.DeviceRoleId devRoleId = 1;
    +     * .ztp.DeviceRoleId devRoleId = 1;
          * @return Whether the devRoleId field is set.
          */
         boolean hasDevRoleId();
         /**
    -     * .automation.DeviceRoleId devRoleId = 1;
    +     * .ztp.DeviceRoleId devRoleId = 1;
          * @return The devRoleId.
          */
    -    automation.Automation.DeviceRoleId getDevRoleId();
    +    ztp.Ztp.DeviceRoleId getDevRoleId();
         /**
    -     * .automation.DeviceRoleId devRoleId = 1;
    +     * .ztp.DeviceRoleId devRoleId = 1;
          */
    -    automation.Automation.DeviceRoleIdOrBuilder getDevRoleIdOrBuilder();
    +    ztp.Ztp.DeviceRoleIdOrBuilder getDevRoleIdOrBuilder();
     
         /**
    -     * .automation.DeviceRoleType devRoleType = 2;
    +     * .ztp.DeviceRoleType devRoleType = 2;
          * @return The enum numeric value on the wire for devRoleType.
          */
         int getDevRoleTypeValue();
         /**
    -     * .automation.DeviceRoleType devRoleType = 2;
    +     * .ztp.DeviceRoleType devRoleType = 2;
          * @return The devRoleType.
          */
    -    automation.Automation.DeviceRoleType getDevRoleType();
    +    ztp.Ztp.DeviceRoleType getDevRoleType();
       }
       /**
    -   * Protobuf type {@code automation.DeviceRole}
    +   * Protobuf type {@code ztp.DeviceRole}
        */
       public static final class DeviceRole extends
           com.google.protobuf.GeneratedMessageV3 implements
    -      // @@protoc_insertion_point(message_implements:automation.DeviceRole)
    +      // @@protoc_insertion_point(message_implements:ztp.DeviceRole)
           DeviceRoleOrBuilder {
       private static final long serialVersionUID = 0L;
         // Use DeviceRole.newBuilder() to construct.
    @@ -1167,11 +1167,11 @@ public final class Automation {
                   done = true;
                   break;
                 case 10: {
    -              automation.Automation.DeviceRoleId.Builder subBuilder = null;
    +              ztp.Ztp.DeviceRoleId.Builder subBuilder = null;
                   if (devRoleId_ != null) {
                     subBuilder = devRoleId_.toBuilder();
                   }
    -              devRoleId_ = input.readMessage(automation.Automation.DeviceRoleId.parser(), extensionRegistry);
    +              devRoleId_ = input.readMessage(ztp.Ztp.DeviceRoleId.parser(), extensionRegistry);
                   if (subBuilder != null) {
                     subBuilder.mergeFrom(devRoleId_);
                     devRoleId_ = subBuilder.buildPartial();
    @@ -1206,21 +1206,21 @@ public final class Automation {
         }
         public static final com.google.protobuf.Descriptors.Descriptor
             getDescriptor() {
    -      return automation.Automation.internal_static_automation_DeviceRole_descriptor;
    +      return ztp.Ztp.internal_static_ztp_DeviceRole_descriptor;
         }
     
         @java.lang.Override
         protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
             internalGetFieldAccessorTable() {
    -      return automation.Automation.internal_static_automation_DeviceRole_fieldAccessorTable
    +      return ztp.Ztp.internal_static_ztp_DeviceRole_fieldAccessorTable
               .ensureFieldAccessorsInitialized(
    -              automation.Automation.DeviceRole.class, automation.Automation.DeviceRole.Builder.class);
    +              ztp.Ztp.DeviceRole.class, ztp.Ztp.DeviceRole.Builder.class);
         }
     
         public static final int DEVROLEID_FIELD_NUMBER = 1;
    -    private automation.Automation.DeviceRoleId devRoleId_;
    +    private ztp.Ztp.DeviceRoleId devRoleId_;
         /**
    -     * .automation.DeviceRoleId devRoleId = 1;
    +     * .ztp.DeviceRoleId devRoleId = 1;
          * @return Whether the devRoleId field is set.
          */
         @java.lang.Override
    @@ -1228,38 +1228,38 @@ public final class Automation {
           return devRoleId_ != null;
         }
         /**
    -     * .automation.DeviceRoleId devRoleId = 1;
    +     * .ztp.DeviceRoleId devRoleId = 1;
          * @return The devRoleId.
          */
         @java.lang.Override
    -    public automation.Automation.DeviceRoleId getDevRoleId() {
    -      return devRoleId_ == null ? automation.Automation.DeviceRoleId.getDefaultInstance() : devRoleId_;
    +    public ztp.Ztp.DeviceRoleId getDevRoleId() {
    +      return devRoleId_ == null ? ztp.Ztp.DeviceRoleId.getDefaultInstance() : devRoleId_;
         }
         /**
    -     * .automation.DeviceRoleId devRoleId = 1;
    +     * .ztp.DeviceRoleId devRoleId = 1;
          */
         @java.lang.Override
    -    public automation.Automation.DeviceRoleIdOrBuilder getDevRoleIdOrBuilder() {
    +    public ztp.Ztp.DeviceRoleIdOrBuilder getDevRoleIdOrBuilder() {
           return getDevRoleId();
         }
     
         public static final int DEVROLETYPE_FIELD_NUMBER = 2;
         private int devRoleType_;
         /**
    -     * .automation.DeviceRoleType devRoleType = 2;
    +     * .ztp.DeviceRoleType devRoleType = 2;
          * @return The enum numeric value on the wire for devRoleType.
          */
         @java.lang.Override public int getDevRoleTypeValue() {
           return devRoleType_;
         }
         /**
    -     * .automation.DeviceRoleType devRoleType = 2;
    +     * .ztp.DeviceRoleType devRoleType = 2;
          * @return The devRoleType.
          */
    -    @java.lang.Override public automation.Automation.DeviceRoleType getDevRoleType() {
    +    @java.lang.Override public ztp.Ztp.DeviceRoleType getDevRoleType() {
           @SuppressWarnings("deprecation")
    -      automation.Automation.DeviceRoleType result = automation.Automation.DeviceRoleType.valueOf(devRoleType_);
    -      return result == null ? automation.Automation.DeviceRoleType.UNRECOGNIZED : result;
    +      ztp.Ztp.DeviceRoleType result = ztp.Ztp.DeviceRoleType.valueOf(devRoleType_);
    +      return result == null ? ztp.Ztp.DeviceRoleType.UNRECOGNIZED : result;
         }
     
         private byte memoizedIsInitialized = -1;
    @@ -1279,7 +1279,7 @@ public final class Automation {
           if (devRoleId_ != null) {
             output.writeMessage(1, getDevRoleId());
           }
    -      if (devRoleType_ != automation.Automation.DeviceRoleType.NONE.getNumber()) {
    +      if (devRoleType_ != ztp.Ztp.DeviceRoleType.NONE.getNumber()) {
             output.writeEnum(2, devRoleType_);
           }
           unknownFields.writeTo(output);
    @@ -1295,7 +1295,7 @@ public final class Automation {
             size += com.google.protobuf.CodedOutputStream
               .computeMessageSize(1, getDevRoleId());
           }
    -      if (devRoleType_ != automation.Automation.DeviceRoleType.NONE.getNumber()) {
    +      if (devRoleType_ != ztp.Ztp.DeviceRoleType.NONE.getNumber()) {
             size += com.google.protobuf.CodedOutputStream
               .computeEnumSize(2, devRoleType_);
           }
    @@ -1309,10 +1309,10 @@ public final class Automation {
           if (obj == this) {
            return true;
           }
    -      if (!(obj instanceof automation.Automation.DeviceRole)) {
    +      if (!(obj instanceof ztp.Ztp.DeviceRole)) {
             return super.equals(obj);
           }
    -      automation.Automation.DeviceRole other = (automation.Automation.DeviceRole) obj;
    +      ztp.Ztp.DeviceRole other = (ztp.Ztp.DeviceRole) obj;
     
           if (hasDevRoleId() != other.hasDevRoleId()) return false;
           if (hasDevRoleId()) {
    @@ -1342,69 +1342,69 @@ public final class Automation {
           return hash;
         }
     
    -    public static automation.Automation.DeviceRole parseFrom(
    +    public static ztp.Ztp.DeviceRole parseFrom(
             java.nio.ByteBuffer data)
             throws com.google.protobuf.InvalidProtocolBufferException {
           return PARSER.parseFrom(data);
         }
    -    public static automation.Automation.DeviceRole parseFrom(
    +    public static ztp.Ztp.DeviceRole parseFrom(
             java.nio.ByteBuffer data,
             com.google.protobuf.ExtensionRegistryLite extensionRegistry)
             throws com.google.protobuf.InvalidProtocolBufferException {
           return PARSER.parseFrom(data, extensionRegistry);
         }
    -    public static automation.Automation.DeviceRole parseFrom(
    +    public static ztp.Ztp.DeviceRole parseFrom(
             com.google.protobuf.ByteString data)
             throws com.google.protobuf.InvalidProtocolBufferException {
           return PARSER.parseFrom(data);
         }
    -    public static automation.Automation.DeviceRole parseFrom(
    +    public static ztp.Ztp.DeviceRole parseFrom(
             com.google.protobuf.ByteString data,
             com.google.protobuf.ExtensionRegistryLite extensionRegistry)
             throws com.google.protobuf.InvalidProtocolBufferException {
           return PARSER.parseFrom(data, extensionRegistry);
         }
    -    public static automation.Automation.DeviceRole parseFrom(byte[] data)
    +    public static ztp.Ztp.DeviceRole parseFrom(byte[] data)
             throws com.google.protobuf.InvalidProtocolBufferException {
           return PARSER.parseFrom(data);
         }
    -    public static automation.Automation.DeviceRole parseFrom(
    +    public static ztp.Ztp.DeviceRole parseFrom(
             byte[] data,
             com.google.protobuf.ExtensionRegistryLite extensionRegistry)
             throws com.google.protobuf.InvalidProtocolBufferException {
           return PARSER.parseFrom(data, extensionRegistry);
         }
    -    public static automation.Automation.DeviceRole parseFrom(java.io.InputStream input)
    +    public static ztp.Ztp.DeviceRole parseFrom(java.io.InputStream input)
             throws java.io.IOException {
           return com.google.protobuf.GeneratedMessageV3
               .parseWithIOException(PARSER, input);
         }
    -    public static automation.Automation.DeviceRole parseFrom(
    +    public static ztp.Ztp.DeviceRole parseFrom(
             java.io.InputStream input,
             com.google.protobuf.ExtensionRegistryLite extensionRegistry)
             throws java.io.IOException {
           return com.google.protobuf.GeneratedMessageV3
               .parseWithIOException(PARSER, input, extensionRegistry);
         }
    -    public static automation.Automation.DeviceRole parseDelimitedFrom(java.io.InputStream input)
    +    public static ztp.Ztp.DeviceRole parseDelimitedFrom(java.io.InputStream input)
             throws java.io.IOException {
           return com.google.protobuf.GeneratedMessageV3
               .parseDelimitedWithIOException(PARSER, input);
         }
    -    public static automation.Automation.DeviceRole parseDelimitedFrom(
    +    public static ztp.Ztp.DeviceRole parseDelimitedFrom(
             java.io.InputStream input,
             com.google.protobuf.ExtensionRegistryLite extensionRegistry)
             throws java.io.IOException {
           return com.google.protobuf.GeneratedMessageV3
               .parseDelimitedWithIOException(PARSER, input, extensionRegistry);
         }
    -    public static automation.Automation.DeviceRole parseFrom(
    +    public static ztp.Ztp.DeviceRole parseFrom(
             com.google.protobuf.CodedInputStream input)
             throws java.io.IOException {
           return com.google.protobuf.GeneratedMessageV3
               .parseWithIOException(PARSER, input);
         }
    -    public static automation.Automation.DeviceRole parseFrom(
    +    public static ztp.Ztp.DeviceRole parseFrom(
             com.google.protobuf.CodedInputStream input,
             com.google.protobuf.ExtensionRegistryLite extensionRegistry)
             throws java.io.IOException {
    @@ -1417,7 +1417,7 @@ public final class Automation {
         public static Builder newBuilder() {
           return DEFAULT_INSTANCE.toBuilder();
         }
    -    public static Builder newBuilder(automation.Automation.DeviceRole prototype) {
    +    public static Builder newBuilder(ztp.Ztp.DeviceRole prototype) {
           return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
         }
         @java.lang.Override
    @@ -1433,26 +1433,26 @@ public final class Automation {
           return builder;
         }
         /**
    -     * Protobuf type {@code automation.DeviceRole}
    +     * Protobuf type {@code ztp.DeviceRole}
          */
         public static final class Builder extends
             com.google.protobuf.GeneratedMessageV3.Builder implements
    -        // @@protoc_insertion_point(builder_implements:automation.DeviceRole)
    -        automation.Automation.DeviceRoleOrBuilder {
    +        // @@protoc_insertion_point(builder_implements:ztp.DeviceRole)
    +        ztp.Ztp.DeviceRoleOrBuilder {
           public static final com.google.protobuf.Descriptors.Descriptor
               getDescriptor() {
    -        return automation.Automation.internal_static_automation_DeviceRole_descriptor;
    +        return ztp.Ztp.internal_static_ztp_DeviceRole_descriptor;
           }
     
           @java.lang.Override
           protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
               internalGetFieldAccessorTable() {
    -        return automation.Automation.internal_static_automation_DeviceRole_fieldAccessorTable
    +        return ztp.Ztp.internal_static_ztp_DeviceRole_fieldAccessorTable
                 .ensureFieldAccessorsInitialized(
    -                automation.Automation.DeviceRole.class, automation.Automation.DeviceRole.Builder.class);
    +                ztp.Ztp.DeviceRole.class, ztp.Ztp.DeviceRole.Builder.class);
           }
     
    -      // Construct using automation.Automation.DeviceRole.newBuilder()
    +      // Construct using ztp.Ztp.DeviceRole.newBuilder()
           private Builder() {
             maybeForceBuilderInitialization();
           }
    @@ -1484,17 +1484,17 @@ public final class Automation {
           @java.lang.Override
           public com.google.protobuf.Descriptors.Descriptor
               getDescriptorForType() {
    -        return automation.Automation.internal_static_automation_DeviceRole_descriptor;
    +        return ztp.Ztp.internal_static_ztp_DeviceRole_descriptor;
           }
     
           @java.lang.Override
    -      public automation.Automation.DeviceRole getDefaultInstanceForType() {
    -        return automation.Automation.DeviceRole.getDefaultInstance();
    +      public ztp.Ztp.DeviceRole getDefaultInstanceForType() {
    +        return ztp.Ztp.DeviceRole.getDefaultInstance();
           }
     
           @java.lang.Override
    -      public automation.Automation.DeviceRole build() {
    -        automation.Automation.DeviceRole result = buildPartial();
    +      public ztp.Ztp.DeviceRole build() {
    +        ztp.Ztp.DeviceRole result = buildPartial();
             if (!result.isInitialized()) {
               throw newUninitializedMessageException(result);
             }
    @@ -1502,8 +1502,8 @@ public final class Automation {
           }
     
           @java.lang.Override
    -      public automation.Automation.DeviceRole buildPartial() {
    -        automation.Automation.DeviceRole result = new automation.Automation.DeviceRole(this);
    +      public ztp.Ztp.DeviceRole buildPartial() {
    +        ztp.Ztp.DeviceRole result = new ztp.Ztp.DeviceRole(this);
             if (devRoleIdBuilder_ == null) {
               result.devRoleId_ = devRoleId_;
             } else {
    @@ -1548,16 +1548,16 @@ public final class Automation {
           }
           @java.lang.Override
           public Builder mergeFrom(com.google.protobuf.Message other) {
    -        if (other instanceof automation.Automation.DeviceRole) {
    -          return mergeFrom((automation.Automation.DeviceRole)other);
    +        if (other instanceof ztp.Ztp.DeviceRole) {
    +          return mergeFrom((ztp.Ztp.DeviceRole)other);
             } else {
               super.mergeFrom(other);
               return this;
             }
           }
     
    -      public Builder mergeFrom(automation.Automation.DeviceRole other) {
    -        if (other == automation.Automation.DeviceRole.getDefaultInstance()) return this;
    +      public Builder mergeFrom(ztp.Ztp.DeviceRole other) {
    +        if (other == ztp.Ztp.DeviceRole.getDefaultInstance()) return this;
             if (other.hasDevRoleId()) {
               mergeDevRoleId(other.getDevRoleId());
             }
    @@ -1579,11 +1579,11 @@ public final class Automation {
               com.google.protobuf.CodedInputStream input,
               com.google.protobuf.ExtensionRegistryLite extensionRegistry)
               throws java.io.IOException {
    -        automation.Automation.DeviceRole parsedMessage = null;
    +        ztp.Ztp.DeviceRole parsedMessage = null;
             try {
               parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
             } catch (com.google.protobuf.InvalidProtocolBufferException e) {
    -          parsedMessage = (automation.Automation.DeviceRole) e.getUnfinishedMessage();
    +          parsedMessage = (ztp.Ztp.DeviceRole) e.getUnfinishedMessage();
               throw e.unwrapIOException();
             } finally {
               if (parsedMessage != null) {
    @@ -1593,31 +1593,31 @@ public final class Automation {
             return this;
           }
     
    -      private automation.Automation.DeviceRoleId devRoleId_;
    +      private ztp.Ztp.DeviceRoleId devRoleId_;
           private com.google.protobuf.SingleFieldBuilderV3<
    -          automation.Automation.DeviceRoleId, automation.Automation.DeviceRoleId.Builder, automation.Automation.DeviceRoleIdOrBuilder> devRoleIdBuilder_;
    +          ztp.Ztp.DeviceRoleId, ztp.Ztp.DeviceRoleId.Builder, ztp.Ztp.DeviceRoleIdOrBuilder> devRoleIdBuilder_;
           /**
    -       * .automation.DeviceRoleId devRoleId = 1;
    +       * .ztp.DeviceRoleId devRoleId = 1;
            * @return Whether the devRoleId field is set.
            */
           public boolean hasDevRoleId() {
             return devRoleIdBuilder_ != null || devRoleId_ != null;
           }
           /**
    -       * .automation.DeviceRoleId devRoleId = 1;
    +       * .ztp.DeviceRoleId devRoleId = 1;
            * @return The devRoleId.
            */
    -      public automation.Automation.DeviceRoleId getDevRoleId() {
    +      public ztp.Ztp.DeviceRoleId getDevRoleId() {
             if (devRoleIdBuilder_ == null) {
    -          return devRoleId_ == null ? automation.Automation.DeviceRoleId.getDefaultInstance() : devRoleId_;
    +          return devRoleId_ == null ? ztp.Ztp.DeviceRoleId.getDefaultInstance() : devRoleId_;
             } else {
               return devRoleIdBuilder_.getMessage();
             }
           }
           /**
    -       * .automation.DeviceRoleId devRoleId = 1;
    +       * .ztp.DeviceRoleId devRoleId = 1;
            */
    -      public Builder setDevRoleId(automation.Automation.DeviceRoleId value) {
    +      public Builder setDevRoleId(ztp.Ztp.DeviceRoleId value) {
             if (devRoleIdBuilder_ == null) {
               if (value == null) {
                 throw new NullPointerException();
    @@ -1631,10 +1631,10 @@ public final class Automation {
             return this;
           }
           /**
    -       * .automation.DeviceRoleId devRoleId = 1;
    +       * .ztp.DeviceRoleId devRoleId = 1;
            */
           public Builder setDevRoleId(
    -          automation.Automation.DeviceRoleId.Builder builderForValue) {
    +          ztp.Ztp.DeviceRoleId.Builder builderForValue) {
             if (devRoleIdBuilder_ == null) {
               devRoleId_ = builderForValue.build();
               onChanged();
    @@ -1645,13 +1645,13 @@ public final class Automation {
             return this;
           }
           /**
    -       * .automation.DeviceRoleId devRoleId = 1;
    +       * .ztp.DeviceRoleId devRoleId = 1;
            */
    -      public Builder mergeDevRoleId(automation.Automation.DeviceRoleId value) {
    +      public Builder mergeDevRoleId(ztp.Ztp.DeviceRoleId value) {
             if (devRoleIdBuilder_ == null) {
               if (devRoleId_ != null) {
                 devRoleId_ =
    -              automation.Automation.DeviceRoleId.newBuilder(devRoleId_).mergeFrom(value).buildPartial();
    +              ztp.Ztp.DeviceRoleId.newBuilder(devRoleId_).mergeFrom(value).buildPartial();
               } else {
                 devRoleId_ = value;
               }
    @@ -1663,7 +1663,7 @@ public final class Automation {
             return this;
           }
           /**
    -       * .automation.DeviceRoleId devRoleId = 1;
    +       * .ztp.DeviceRoleId devRoleId = 1;
            */
           public Builder clearDevRoleId() {
             if (devRoleIdBuilder_ == null) {
    @@ -1677,33 +1677,33 @@ public final class Automation {
             return this;
           }
           /**
    -       * .automation.DeviceRoleId devRoleId = 1;
    +       * .ztp.DeviceRoleId devRoleId = 1;
            */
    -      public automation.Automation.DeviceRoleId.Builder getDevRoleIdBuilder() {
    +      public ztp.Ztp.DeviceRoleId.Builder getDevRoleIdBuilder() {
             
             onChanged();
             return getDevRoleIdFieldBuilder().getBuilder();
           }
           /**
    -       * .automation.DeviceRoleId devRoleId = 1;
    +       * .ztp.DeviceRoleId devRoleId = 1;
            */
    -      public automation.Automation.DeviceRoleIdOrBuilder getDevRoleIdOrBuilder() {
    +      public ztp.Ztp.DeviceRoleIdOrBuilder getDevRoleIdOrBuilder() {
             if (devRoleIdBuilder_ != null) {
               return devRoleIdBuilder_.getMessageOrBuilder();
             } else {
               return devRoleId_ == null ?
    -              automation.Automation.DeviceRoleId.getDefaultInstance() : devRoleId_;
    +              ztp.Ztp.DeviceRoleId.getDefaultInstance() : devRoleId_;
             }
           }
           /**
    -       * .automation.DeviceRoleId devRoleId = 1;
    +       * .ztp.DeviceRoleId devRoleId = 1;
            */
           private com.google.protobuf.SingleFieldBuilderV3<
    -          automation.Automation.DeviceRoleId, automation.Automation.DeviceRoleId.Builder, automation.Automation.DeviceRoleIdOrBuilder> 
    +          ztp.Ztp.DeviceRoleId, ztp.Ztp.DeviceRoleId.Builder, ztp.Ztp.DeviceRoleIdOrBuilder> 
               getDevRoleIdFieldBuilder() {
             if (devRoleIdBuilder_ == null) {
               devRoleIdBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
    -              automation.Automation.DeviceRoleId, automation.Automation.DeviceRoleId.Builder, automation.Automation.DeviceRoleIdOrBuilder>(
    +              ztp.Ztp.DeviceRoleId, ztp.Ztp.DeviceRoleId.Builder, ztp.Ztp.DeviceRoleIdOrBuilder>(
                       getDevRoleId(),
                       getParentForChildren(),
                       isClean());
    @@ -1714,14 +1714,14 @@ public final class Automation {
     
           private int devRoleType_ = 0;
           /**
    -       * .automation.DeviceRoleType devRoleType = 2;
    +       * .ztp.DeviceRoleType devRoleType = 2;
            * @return The enum numeric value on the wire for devRoleType.
            */
           @java.lang.Override public int getDevRoleTypeValue() {
             return devRoleType_;
           }
           /**
    -       * .automation.DeviceRoleType devRoleType = 2;
    +       * .ztp.DeviceRoleType devRoleType = 2;
            * @param value The enum numeric value on the wire for devRoleType to set.
            * @return This builder for chaining.
            */
    @@ -1732,21 +1732,21 @@ public final class Automation {
             return this;
           }
           /**
    -       * .automation.DeviceRoleType devRoleType = 2;
    +       * .ztp.DeviceRoleType devRoleType = 2;
            * @return The devRoleType.
            */
           @java.lang.Override
    -      public automation.Automation.DeviceRoleType getDevRoleType() {
    +      public ztp.Ztp.DeviceRoleType getDevRoleType() {
             @SuppressWarnings("deprecation")
    -        automation.Automation.DeviceRoleType result = automation.Automation.DeviceRoleType.valueOf(devRoleType_);
    -        return result == null ? automation.Automation.DeviceRoleType.UNRECOGNIZED : result;
    +        ztp.Ztp.DeviceRoleType result = ztp.Ztp.DeviceRoleType.valueOf(devRoleType_);
    +        return result == null ? ztp.Ztp.DeviceRoleType.UNRECOGNIZED : result;
           }
           /**
    -       * .automation.DeviceRoleType devRoleType = 2;
    +       * .ztp.DeviceRoleType devRoleType = 2;
            * @param value The devRoleType to set.
            * @return This builder for chaining.
            */
    -      public Builder setDevRoleType(automation.Automation.DeviceRoleType value) {
    +      public Builder setDevRoleType(ztp.Ztp.DeviceRoleType value) {
             if (value == null) {
               throw new NullPointerException();
             }
    @@ -1756,7 +1756,7 @@ public final class Automation {
             return this;
           }
           /**
    -       * .automation.DeviceRoleType devRoleType = 2;
    +       * .ztp.DeviceRoleType devRoleType = 2;
            * @return This builder for chaining.
            */
           public Builder clearDevRoleType() {
    @@ -1778,16 +1778,16 @@ public final class Automation {
           }
     
     
    -      // @@protoc_insertion_point(builder_scope:automation.DeviceRole)
    +      // @@protoc_insertion_point(builder_scope:ztp.DeviceRole)
         }
     
    -    // @@protoc_insertion_point(class_scope:automation.DeviceRole)
    -    private static final automation.Automation.DeviceRole DEFAULT_INSTANCE;
    +    // @@protoc_insertion_point(class_scope:ztp.DeviceRole)
    +    private static final ztp.Ztp.DeviceRole DEFAULT_INSTANCE;
         static {
    -      DEFAULT_INSTANCE = new automation.Automation.DeviceRole();
    +      DEFAULT_INSTANCE = new ztp.Ztp.DeviceRole();
         }
     
    -    public static automation.Automation.DeviceRole getDefaultInstance() {
    +    public static ztp.Ztp.DeviceRole getDefaultInstance() {
           return DEFAULT_INSTANCE;
         }
     
    @@ -1812,30 +1812,30 @@ public final class Automation {
         }
     
         @java.lang.Override
    -    public automation.Automation.DeviceRole getDefaultInstanceForType() {
    +    public ztp.Ztp.DeviceRole getDefaultInstanceForType() {
           return DEFAULT_INSTANCE;
         }
     
       }
     
       public interface DeviceRoleConfigOrBuilder extends
    -      // @@protoc_insertion_point(interface_extends:automation.DeviceRoleConfig)
    +      // @@protoc_insertion_point(interface_extends:ztp.DeviceRoleConfig)
           com.google.protobuf.MessageOrBuilder {
     
         /**
    -     * .automation.DeviceRole devRole = 1;
    +     * .ztp.DeviceRole devRole = 1;
          * @return Whether the devRole field is set.
          */
         boolean hasDevRole();
         /**
    -     * .automation.DeviceRole devRole = 1;
    +     * .ztp.DeviceRole devRole = 1;
          * @return The devRole.
          */
    -    automation.Automation.DeviceRole getDevRole();
    +    ztp.Ztp.DeviceRole getDevRole();
         /**
    -     * .automation.DeviceRole devRole = 1;
    +     * .ztp.DeviceRole devRole = 1;
          */
    -    automation.Automation.DeviceRoleOrBuilder getDevRoleOrBuilder();
    +    ztp.Ztp.DeviceRoleOrBuilder getDevRoleOrBuilder();
     
         /**
          * .context.DeviceConfig devConfig = 2;
    @@ -1853,11 +1853,11 @@ public final class Automation {
         context.ContextOuterClass.DeviceConfigOrBuilder getDevConfigOrBuilder();
       }
       /**
    -   * Protobuf type {@code automation.DeviceRoleConfig}
    +   * Protobuf type {@code ztp.DeviceRoleConfig}
        */
       public static final class DeviceRoleConfig extends
           com.google.protobuf.GeneratedMessageV3 implements
    -      // @@protoc_insertion_point(message_implements:automation.DeviceRoleConfig)
    +      // @@protoc_insertion_point(message_implements:ztp.DeviceRoleConfig)
           DeviceRoleConfigOrBuilder {
       private static final long serialVersionUID = 0L;
         // Use DeviceRoleConfig.newBuilder() to construct.
    @@ -1898,11 +1898,11 @@ public final class Automation {
                   done = true;
                   break;
                 case 10: {
    -              automation.Automation.DeviceRole.Builder subBuilder = null;
    +              ztp.Ztp.DeviceRole.Builder subBuilder = null;
                   if (devRole_ != null) {
                     subBuilder = devRole_.toBuilder();
                   }
    -              devRole_ = input.readMessage(automation.Automation.DeviceRole.parser(), extensionRegistry);
    +              devRole_ = input.readMessage(ztp.Ztp.DeviceRole.parser(), extensionRegistry);
                   if (subBuilder != null) {
                     subBuilder.mergeFrom(devRole_);
                     devRole_ = subBuilder.buildPartial();
    @@ -1944,21 +1944,21 @@ public final class Automation {
         }
         public static final com.google.protobuf.Descriptors.Descriptor
             getDescriptor() {
    -      return automation.Automation.internal_static_automation_DeviceRoleConfig_descriptor;
    +      return ztp.Ztp.internal_static_ztp_DeviceRoleConfig_descriptor;
         }
     
         @java.lang.Override
         protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
             internalGetFieldAccessorTable() {
    -      return automation.Automation.internal_static_automation_DeviceRoleConfig_fieldAccessorTable
    +      return ztp.Ztp.internal_static_ztp_DeviceRoleConfig_fieldAccessorTable
               .ensureFieldAccessorsInitialized(
    -              automation.Automation.DeviceRoleConfig.class, automation.Automation.DeviceRoleConfig.Builder.class);
    +              ztp.Ztp.DeviceRoleConfig.class, ztp.Ztp.DeviceRoleConfig.Builder.class);
         }
     
         public static final int DEVROLE_FIELD_NUMBER = 1;
    -    private automation.Automation.DeviceRole devRole_;
    +    private ztp.Ztp.DeviceRole devRole_;
         /**
    -     * .automation.DeviceRole devRole = 1;
    +     * .ztp.DeviceRole devRole = 1;
          * @return Whether the devRole field is set.
          */
         @java.lang.Override
    @@ -1966,18 +1966,18 @@ public final class Automation {
           return devRole_ != null;
         }
         /**
    -     * .automation.DeviceRole devRole = 1;
    +     * .ztp.DeviceRole devRole = 1;
          * @return The devRole.
          */
         @java.lang.Override
    -    public automation.Automation.DeviceRole getDevRole() {
    -      return devRole_ == null ? automation.Automation.DeviceRole.getDefaultInstance() : devRole_;
    +    public ztp.Ztp.DeviceRole getDevRole() {
    +      return devRole_ == null ? ztp.Ztp.DeviceRole.getDefaultInstance() : devRole_;
         }
         /**
    -     * .automation.DeviceRole devRole = 1;
    +     * .ztp.DeviceRole devRole = 1;
          */
         @java.lang.Override
    -    public automation.Automation.DeviceRoleOrBuilder getDevRoleOrBuilder() {
    +    public ztp.Ztp.DeviceRoleOrBuilder getDevRoleOrBuilder() {
           return getDevRole();
         }
     
    @@ -2054,10 +2054,10 @@ public final class Automation {
           if (obj == this) {
            return true;
           }
    -      if (!(obj instanceof automation.Automation.DeviceRoleConfig)) {
    +      if (!(obj instanceof ztp.Ztp.DeviceRoleConfig)) {
             return super.equals(obj);
           }
    -      automation.Automation.DeviceRoleConfig other = (automation.Automation.DeviceRoleConfig) obj;
    +      ztp.Ztp.DeviceRoleConfig other = (ztp.Ztp.DeviceRoleConfig) obj;
     
           if (hasDevRole() != other.hasDevRole()) return false;
           if (hasDevRole()) {
    @@ -2093,69 +2093,69 @@ public final class Automation {
           return hash;
         }
     
    -    public static automation.Automation.DeviceRoleConfig parseFrom(
    +    public static ztp.Ztp.DeviceRoleConfig parseFrom(
             java.nio.ByteBuffer data)
             throws com.google.protobuf.InvalidProtocolBufferException {
           return PARSER.parseFrom(data);
         }
    -    public static automation.Automation.DeviceRoleConfig parseFrom(
    +    public static ztp.Ztp.DeviceRoleConfig parseFrom(
             java.nio.ByteBuffer data,
             com.google.protobuf.ExtensionRegistryLite extensionRegistry)
             throws com.google.protobuf.InvalidProtocolBufferException {
           return PARSER.parseFrom(data, extensionRegistry);
         }
    -    public static automation.Automation.DeviceRoleConfig parseFrom(
    +    public static ztp.Ztp.DeviceRoleConfig parseFrom(
             com.google.protobuf.ByteString data)
             throws com.google.protobuf.InvalidProtocolBufferException {
           return PARSER.parseFrom(data);
         }
    -    public static automation.Automation.DeviceRoleConfig parseFrom(
    +    public static ztp.Ztp.DeviceRoleConfig parseFrom(
             com.google.protobuf.ByteString data,
             com.google.protobuf.ExtensionRegistryLite extensionRegistry)
             throws com.google.protobuf.InvalidProtocolBufferException {
           return PARSER.parseFrom(data, extensionRegistry);
         }
    -    public static automation.Automation.DeviceRoleConfig parseFrom(byte[] data)
    +    public static ztp.Ztp.DeviceRoleConfig parseFrom(byte[] data)
             throws com.google.protobuf.InvalidProtocolBufferException {
           return PARSER.parseFrom(data);
         }
    -    public static automation.Automation.DeviceRoleConfig parseFrom(
    +    public static ztp.Ztp.DeviceRoleConfig parseFrom(
             byte[] data,
             com.google.protobuf.ExtensionRegistryLite extensionRegistry)
             throws com.google.protobuf.InvalidProtocolBufferException {
           return PARSER.parseFrom(data, extensionRegistry);
         }
    -    public static automation.Automation.DeviceRoleConfig parseFrom(java.io.InputStream input)
    +    public static ztp.Ztp.DeviceRoleConfig parseFrom(java.io.InputStream input)
             throws java.io.IOException {
           return com.google.protobuf.GeneratedMessageV3
               .parseWithIOException(PARSER, input);
         }
    -    public static automation.Automation.DeviceRoleConfig parseFrom(
    +    public static ztp.Ztp.DeviceRoleConfig parseFrom(
             java.io.InputStream input,
             com.google.protobuf.ExtensionRegistryLite extensionRegistry)
             throws java.io.IOException {
           return com.google.protobuf.GeneratedMessageV3
               .parseWithIOException(PARSER, input, extensionRegistry);
         }
    -    public static automation.Automation.DeviceRoleConfig parseDelimitedFrom(java.io.InputStream input)
    +    public static ztp.Ztp.DeviceRoleConfig parseDelimitedFrom(java.io.InputStream input)
             throws java.io.IOException {
           return com.google.protobuf.GeneratedMessageV3
               .parseDelimitedWithIOException(PARSER, input);
         }
    -    public static automation.Automation.DeviceRoleConfig parseDelimitedFrom(
    +    public static ztp.Ztp.DeviceRoleConfig parseDelimitedFrom(
             java.io.InputStream input,
             com.google.protobuf.ExtensionRegistryLite extensionRegistry)
             throws java.io.IOException {
           return com.google.protobuf.GeneratedMessageV3
               .parseDelimitedWithIOException(PARSER, input, extensionRegistry);
         }
    -    public static automation.Automation.DeviceRoleConfig parseFrom(
    +    public static ztp.Ztp.DeviceRoleConfig parseFrom(
             com.google.protobuf.CodedInputStream input)
             throws java.io.IOException {
           return com.google.protobuf.GeneratedMessageV3
               .parseWithIOException(PARSER, input);
         }
    -    public static automation.Automation.DeviceRoleConfig parseFrom(
    +    public static ztp.Ztp.DeviceRoleConfig parseFrom(
             com.google.protobuf.CodedInputStream input,
             com.google.protobuf.ExtensionRegistryLite extensionRegistry)
             throws java.io.IOException {
    @@ -2168,7 +2168,7 @@ public final class Automation {
         public static Builder newBuilder() {
           return DEFAULT_INSTANCE.toBuilder();
         }
    -    public static Builder newBuilder(automation.Automation.DeviceRoleConfig prototype) {
    +    public static Builder newBuilder(ztp.Ztp.DeviceRoleConfig prototype) {
           return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
         }
         @java.lang.Override
    @@ -2184,26 +2184,26 @@ public final class Automation {
           return builder;
         }
         /**
    -     * Protobuf type {@code automation.DeviceRoleConfig}
    +     * Protobuf type {@code ztp.DeviceRoleConfig}
          */
         public static final class Builder extends
             com.google.protobuf.GeneratedMessageV3.Builder implements
    -        // @@protoc_insertion_point(builder_implements:automation.DeviceRoleConfig)
    -        automation.Automation.DeviceRoleConfigOrBuilder {
    +        // @@protoc_insertion_point(builder_implements:ztp.DeviceRoleConfig)
    +        ztp.Ztp.DeviceRoleConfigOrBuilder {
           public static final com.google.protobuf.Descriptors.Descriptor
               getDescriptor() {
    -        return automation.Automation.internal_static_automation_DeviceRoleConfig_descriptor;
    +        return ztp.Ztp.internal_static_ztp_DeviceRoleConfig_descriptor;
           }
     
           @java.lang.Override
           protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
               internalGetFieldAccessorTable() {
    -        return automation.Automation.internal_static_automation_DeviceRoleConfig_fieldAccessorTable
    +        return ztp.Ztp.internal_static_ztp_DeviceRoleConfig_fieldAccessorTable
                 .ensureFieldAccessorsInitialized(
    -                automation.Automation.DeviceRoleConfig.class, automation.Automation.DeviceRoleConfig.Builder.class);
    +                ztp.Ztp.DeviceRoleConfig.class, ztp.Ztp.DeviceRoleConfig.Builder.class);
           }
     
    -      // Construct using automation.Automation.DeviceRoleConfig.newBuilder()
    +      // Construct using ztp.Ztp.DeviceRoleConfig.newBuilder()
           private Builder() {
             maybeForceBuilderInitialization();
           }
    @@ -2239,17 +2239,17 @@ public final class Automation {
           @java.lang.Override
           public com.google.protobuf.Descriptors.Descriptor
               getDescriptorForType() {
    -        return automation.Automation.internal_static_automation_DeviceRoleConfig_descriptor;
    +        return ztp.Ztp.internal_static_ztp_DeviceRoleConfig_descriptor;
           }
     
           @java.lang.Override
    -      public automation.Automation.DeviceRoleConfig getDefaultInstanceForType() {
    -        return automation.Automation.DeviceRoleConfig.getDefaultInstance();
    +      public ztp.Ztp.DeviceRoleConfig getDefaultInstanceForType() {
    +        return ztp.Ztp.DeviceRoleConfig.getDefaultInstance();
           }
     
           @java.lang.Override
    -      public automation.Automation.DeviceRoleConfig build() {
    -        automation.Automation.DeviceRoleConfig result = buildPartial();
    +      public ztp.Ztp.DeviceRoleConfig build() {
    +        ztp.Ztp.DeviceRoleConfig result = buildPartial();
             if (!result.isInitialized()) {
               throw newUninitializedMessageException(result);
             }
    @@ -2257,8 +2257,8 @@ public final class Automation {
           }
     
           @java.lang.Override
    -      public automation.Automation.DeviceRoleConfig buildPartial() {
    -        automation.Automation.DeviceRoleConfig result = new automation.Automation.DeviceRoleConfig(this);
    +      public ztp.Ztp.DeviceRoleConfig buildPartial() {
    +        ztp.Ztp.DeviceRoleConfig result = new ztp.Ztp.DeviceRoleConfig(this);
             if (devRoleBuilder_ == null) {
               result.devRole_ = devRole_;
             } else {
    @@ -2307,16 +2307,16 @@ public final class Automation {
           }
           @java.lang.Override
           public Builder mergeFrom(com.google.protobuf.Message other) {
    -        if (other instanceof automation.Automation.DeviceRoleConfig) {
    -          return mergeFrom((automation.Automation.DeviceRoleConfig)other);
    +        if (other instanceof ztp.Ztp.DeviceRoleConfig) {
    +          return mergeFrom((ztp.Ztp.DeviceRoleConfig)other);
             } else {
               super.mergeFrom(other);
               return this;
             }
           }
     
    -      public Builder mergeFrom(automation.Automation.DeviceRoleConfig other) {
    -        if (other == automation.Automation.DeviceRoleConfig.getDefaultInstance()) return this;
    +      public Builder mergeFrom(ztp.Ztp.DeviceRoleConfig other) {
    +        if (other == ztp.Ztp.DeviceRoleConfig.getDefaultInstance()) return this;
             if (other.hasDevRole()) {
               mergeDevRole(other.getDevRole());
             }
    @@ -2338,11 +2338,11 @@ public final class Automation {
               com.google.protobuf.CodedInputStream input,
               com.google.protobuf.ExtensionRegistryLite extensionRegistry)
               throws java.io.IOException {
    -        automation.Automation.DeviceRoleConfig parsedMessage = null;
    +        ztp.Ztp.DeviceRoleConfig parsedMessage = null;
             try {
               parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
             } catch (com.google.protobuf.InvalidProtocolBufferException e) {
    -          parsedMessage = (automation.Automation.DeviceRoleConfig) e.getUnfinishedMessage();
    +          parsedMessage = (ztp.Ztp.DeviceRoleConfig) e.getUnfinishedMessage();
               throw e.unwrapIOException();
             } finally {
               if (parsedMessage != null) {
    @@ -2352,31 +2352,31 @@ public final class Automation {
             return this;
           }
     
    -      private automation.Automation.DeviceRole devRole_;
    +      private ztp.Ztp.DeviceRole devRole_;
           private com.google.protobuf.SingleFieldBuilderV3<
    -          automation.Automation.DeviceRole, automation.Automation.DeviceRole.Builder, automation.Automation.DeviceRoleOrBuilder> devRoleBuilder_;
    +          ztp.Ztp.DeviceRole, ztp.Ztp.DeviceRole.Builder, ztp.Ztp.DeviceRoleOrBuilder> devRoleBuilder_;
           /**
    -       * .automation.DeviceRole devRole = 1;
    +       * .ztp.DeviceRole devRole = 1;
            * @return Whether the devRole field is set.
            */
           public boolean hasDevRole() {
             return devRoleBuilder_ != null || devRole_ != null;
           }
           /**
    -       * .automation.DeviceRole devRole = 1;
    +       * .ztp.DeviceRole devRole = 1;
            * @return The devRole.
            */
    -      public automation.Automation.DeviceRole getDevRole() {
    +      public ztp.Ztp.DeviceRole getDevRole() {
             if (devRoleBuilder_ == null) {
    -          return devRole_ == null ? automation.Automation.DeviceRole.getDefaultInstance() : devRole_;
    +          return devRole_ == null ? ztp.Ztp.DeviceRole.getDefaultInstance() : devRole_;
             } else {
               return devRoleBuilder_.getMessage();
             }
           }
           /**
    -       * .automation.DeviceRole devRole = 1;
    +       * .ztp.DeviceRole devRole = 1;
            */
    -      public Builder setDevRole(automation.Automation.DeviceRole value) {
    +      public Builder setDevRole(ztp.Ztp.DeviceRole value) {
             if (devRoleBuilder_ == null) {
               if (value == null) {
                 throw new NullPointerException();
    @@ -2390,10 +2390,10 @@ public final class Automation {
             return this;
           }
           /**
    -       * .automation.DeviceRole devRole = 1;
    +       * .ztp.DeviceRole devRole = 1;
            */
           public Builder setDevRole(
    -          automation.Automation.DeviceRole.Builder builderForValue) {
    +          ztp.Ztp.DeviceRole.Builder builderForValue) {
             if (devRoleBuilder_ == null) {
               devRole_ = builderForValue.build();
               onChanged();
    @@ -2404,13 +2404,13 @@ public final class Automation {
             return this;
           }
           /**
    -       * .automation.DeviceRole devRole = 1;
    +       * .ztp.DeviceRole devRole = 1;
            */
    -      public Builder mergeDevRole(automation.Automation.DeviceRole value) {
    +      public Builder mergeDevRole(ztp.Ztp.DeviceRole value) {
             if (devRoleBuilder_ == null) {
               if (devRole_ != null) {
                 devRole_ =
    -              automation.Automation.DeviceRole.newBuilder(devRole_).mergeFrom(value).buildPartial();
    +              ztp.Ztp.DeviceRole.newBuilder(devRole_).mergeFrom(value).buildPartial();
               } else {
                 devRole_ = value;
               }
    @@ -2422,7 +2422,7 @@ public final class Automation {
             return this;
           }
           /**
    -       * .automation.DeviceRole devRole = 1;
    +       * .ztp.DeviceRole devRole = 1;
            */
           public Builder clearDevRole() {
             if (devRoleBuilder_ == null) {
    @@ -2436,33 +2436,33 @@ public final class Automation {
             return this;
           }
           /**
    -       * .automation.DeviceRole devRole = 1;
    +       * .ztp.DeviceRole devRole = 1;
            */
    -      public automation.Automation.DeviceRole.Builder getDevRoleBuilder() {
    +      public ztp.Ztp.DeviceRole.Builder getDevRoleBuilder() {
             
             onChanged();
             return getDevRoleFieldBuilder().getBuilder();
           }
           /**
    -       * .automation.DeviceRole devRole = 1;
    +       * .ztp.DeviceRole devRole = 1;
            */
    -      public automation.Automation.DeviceRoleOrBuilder getDevRoleOrBuilder() {
    +      public ztp.Ztp.DeviceRoleOrBuilder getDevRoleOrBuilder() {
             if (devRoleBuilder_ != null) {
               return devRoleBuilder_.getMessageOrBuilder();
             } else {
               return devRole_ == null ?
    -              automation.Automation.DeviceRole.getDefaultInstance() : devRole_;
    +              ztp.Ztp.DeviceRole.getDefaultInstance() : devRole_;
             }
           }
           /**
    -       * .automation.DeviceRole devRole = 1;
    +       * .ztp.DeviceRole devRole = 1;
            */
           private com.google.protobuf.SingleFieldBuilderV3<
    -          automation.Automation.DeviceRole, automation.Automation.DeviceRole.Builder, automation.Automation.DeviceRoleOrBuilder> 
    +          ztp.Ztp.DeviceRole, ztp.Ztp.DeviceRole.Builder, ztp.Ztp.DeviceRoleOrBuilder> 
               getDevRoleFieldBuilder() {
             if (devRoleBuilder_ == null) {
               devRoleBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
    -              automation.Automation.DeviceRole, automation.Automation.DeviceRole.Builder, automation.Automation.DeviceRoleOrBuilder>(
    +              ztp.Ztp.DeviceRole, ztp.Ztp.DeviceRole.Builder, ztp.Ztp.DeviceRoleOrBuilder>(
                       getDevRole(),
                       getParentForChildren(),
                       isClean());
    @@ -2602,16 +2602,16 @@ public final class Automation {
           }
     
     
    -      // @@protoc_insertion_point(builder_scope:automation.DeviceRoleConfig)
    +      // @@protoc_insertion_point(builder_scope:ztp.DeviceRoleConfig)
         }
     
    -    // @@protoc_insertion_point(class_scope:automation.DeviceRoleConfig)
    -    private static final automation.Automation.DeviceRoleConfig DEFAULT_INSTANCE;
    +    // @@protoc_insertion_point(class_scope:ztp.DeviceRoleConfig)
    +    private static final ztp.Ztp.DeviceRoleConfig DEFAULT_INSTANCE;
         static {
    -      DEFAULT_INSTANCE = new automation.Automation.DeviceRoleConfig();
    +      DEFAULT_INSTANCE = new ztp.Ztp.DeviceRoleConfig();
         }
     
    -    public static automation.Automation.DeviceRoleConfig getDefaultInstance() {
    +    public static ztp.Ztp.DeviceRoleConfig getDefaultInstance() {
           return DEFAULT_INSTANCE;
         }
     
    @@ -2636,46 +2636,46 @@ public final class Automation {
         }
     
         @java.lang.Override
    -    public automation.Automation.DeviceRoleConfig getDefaultInstanceForType() {
    +    public ztp.Ztp.DeviceRoleConfig getDefaultInstanceForType() {
           return DEFAULT_INSTANCE;
         }
     
       }
     
       public interface DeviceRoleListOrBuilder extends
    -      // @@protoc_insertion_point(interface_extends:automation.DeviceRoleList)
    +      // @@protoc_insertion_point(interface_extends:ztp.DeviceRoleList)
           com.google.protobuf.MessageOrBuilder {
     
         /**
    -     * repeated .automation.DeviceRole devRole = 1;
    +     * repeated .ztp.DeviceRole devRole = 1;
          */
    -    java.util.List 
    +    java.util.List 
             getDevRoleList();
         /**
    -     * repeated .automation.DeviceRole devRole = 1;
    +     * repeated .ztp.DeviceRole devRole = 1;
          */
    -    automation.Automation.DeviceRole getDevRole(int index);
    +    ztp.Ztp.DeviceRole getDevRole(int index);
         /**
    -     * repeated .automation.DeviceRole devRole = 1;
    +     * repeated .ztp.DeviceRole devRole = 1;
          */
         int getDevRoleCount();
         /**
    -     * repeated .automation.DeviceRole devRole = 1;
    +     * repeated .ztp.DeviceRole devRole = 1;
          */
    -    java.util.List 
    +    java.util.List 
             getDevRoleOrBuilderList();
         /**
    -     * repeated .automation.DeviceRole devRole = 1;
    +     * repeated .ztp.DeviceRole devRole = 1;
          */
    -    automation.Automation.DeviceRoleOrBuilder getDevRoleOrBuilder(
    +    ztp.Ztp.DeviceRoleOrBuilder getDevRoleOrBuilder(
             int index);
       }
       /**
    -   * Protobuf type {@code automation.DeviceRoleList}
    +   * Protobuf type {@code ztp.DeviceRoleList}
        */
       public static final class DeviceRoleList extends
           com.google.protobuf.GeneratedMessageV3 implements
    -      // @@protoc_insertion_point(message_implements:automation.DeviceRoleList)
    +      // @@protoc_insertion_point(message_implements:ztp.DeviceRoleList)
           DeviceRoleListOrBuilder {
       private static final long serialVersionUID = 0L;
         // Use DeviceRoleList.newBuilder() to construct.
    @@ -2719,11 +2719,11 @@ public final class Automation {
                   break;
                 case 10: {
                   if (!((mutable_bitField0_ & 0x00000001) != 0)) {
    -                devRole_ = new java.util.ArrayList();
    +                devRole_ = new java.util.ArrayList();
                     mutable_bitField0_ |= 0x00000001;
                   }
                   devRole_.add(
    -                  input.readMessage(automation.Automation.DeviceRole.parser(), extensionRegistry));
    +                  input.readMessage(ztp.Ztp.DeviceRole.parser(), extensionRegistry));
                   break;
                 }
                 default: {
    @@ -2750,53 +2750,53 @@ public final class Automation {
         }
         public static final com.google.protobuf.Descriptors.Descriptor
             getDescriptor() {
    -      return automation.Automation.internal_static_automation_DeviceRoleList_descriptor;
    +      return ztp.Ztp.internal_static_ztp_DeviceRoleList_descriptor;
         }
     
         @java.lang.Override
         protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
             internalGetFieldAccessorTable() {
    -      return automation.Automation.internal_static_automation_DeviceRoleList_fieldAccessorTable
    +      return ztp.Ztp.internal_static_ztp_DeviceRoleList_fieldAccessorTable
               .ensureFieldAccessorsInitialized(
    -              automation.Automation.DeviceRoleList.class, automation.Automation.DeviceRoleList.Builder.class);
    +              ztp.Ztp.DeviceRoleList.class, ztp.Ztp.DeviceRoleList.Builder.class);
         }
     
         public static final int DEVROLE_FIELD_NUMBER = 1;
    -    private java.util.List devRole_;
    +    private java.util.List devRole_;
         /**
    -     * repeated .automation.DeviceRole devRole = 1;
    +     * repeated .ztp.DeviceRole devRole = 1;
          */
         @java.lang.Override
    -    public java.util.List getDevRoleList() {
    +    public java.util.List getDevRoleList() {
           return devRole_;
         }
         /**
    -     * repeated .automation.DeviceRole devRole = 1;
    +     * repeated .ztp.DeviceRole devRole = 1;
          */
         @java.lang.Override
    -    public java.util.List 
    +    public java.util.List 
             getDevRoleOrBuilderList() {
           return devRole_;
         }
         /**
    -     * repeated .automation.DeviceRole devRole = 1;
    +     * repeated .ztp.DeviceRole devRole = 1;
          */
         @java.lang.Override
         public int getDevRoleCount() {
           return devRole_.size();
         }
         /**
    -     * repeated .automation.DeviceRole devRole = 1;
    +     * repeated .ztp.DeviceRole devRole = 1;
          */
         @java.lang.Override
    -    public automation.Automation.DeviceRole getDevRole(int index) {
    +    public ztp.Ztp.DeviceRole getDevRole(int index) {
           return devRole_.get(index);
         }
         /**
    -     * repeated .automation.DeviceRole devRole = 1;
    +     * repeated .ztp.DeviceRole devRole = 1;
          */
         @java.lang.Override
    -    public automation.Automation.DeviceRoleOrBuilder getDevRoleOrBuilder(
    +    public ztp.Ztp.DeviceRoleOrBuilder getDevRoleOrBuilder(
             int index) {
           return devRole_.get(index);
         }
    @@ -2841,10 +2841,10 @@ public final class Automation {
           if (obj == this) {
            return true;
           }
    -      if (!(obj instanceof automation.Automation.DeviceRoleList)) {
    +      if (!(obj instanceof ztp.Ztp.DeviceRoleList)) {
             return super.equals(obj);
           }
    -      automation.Automation.DeviceRoleList other = (automation.Automation.DeviceRoleList) obj;
    +      ztp.Ztp.DeviceRoleList other = (ztp.Ztp.DeviceRoleList) obj;
     
           if (!getDevRoleList()
               .equals(other.getDevRoleList())) return false;
    @@ -2868,69 +2868,69 @@ public final class Automation {
           return hash;
         }
     
    -    public static automation.Automation.DeviceRoleList parseFrom(
    +    public static ztp.Ztp.DeviceRoleList parseFrom(
             java.nio.ByteBuffer data)
             throws com.google.protobuf.InvalidProtocolBufferException {
           return PARSER.parseFrom(data);
         }
    -    public static automation.Automation.DeviceRoleList parseFrom(
    +    public static ztp.Ztp.DeviceRoleList parseFrom(
             java.nio.ByteBuffer data,
             com.google.protobuf.ExtensionRegistryLite extensionRegistry)
             throws com.google.protobuf.InvalidProtocolBufferException {
           return PARSER.parseFrom(data, extensionRegistry);
         }
    -    public static automation.Automation.DeviceRoleList parseFrom(
    +    public static ztp.Ztp.DeviceRoleList parseFrom(
             com.google.protobuf.ByteString data)
             throws com.google.protobuf.InvalidProtocolBufferException {
           return PARSER.parseFrom(data);
         }
    -    public static automation.Automation.DeviceRoleList parseFrom(
    +    public static ztp.Ztp.DeviceRoleList parseFrom(
             com.google.protobuf.ByteString data,
             com.google.protobuf.ExtensionRegistryLite extensionRegistry)
             throws com.google.protobuf.InvalidProtocolBufferException {
           return PARSER.parseFrom(data, extensionRegistry);
         }
    -    public static automation.Automation.DeviceRoleList parseFrom(byte[] data)
    +    public static ztp.Ztp.DeviceRoleList parseFrom(byte[] data)
             throws com.google.protobuf.InvalidProtocolBufferException {
           return PARSER.parseFrom(data);
         }
    -    public static automation.Automation.DeviceRoleList parseFrom(
    +    public static ztp.Ztp.DeviceRoleList parseFrom(
             byte[] data,
             com.google.protobuf.ExtensionRegistryLite extensionRegistry)
             throws com.google.protobuf.InvalidProtocolBufferException {
           return PARSER.parseFrom(data, extensionRegistry);
         }
    -    public static automation.Automation.DeviceRoleList parseFrom(java.io.InputStream input)
    +    public static ztp.Ztp.DeviceRoleList parseFrom(java.io.InputStream input)
             throws java.io.IOException {
           return com.google.protobuf.GeneratedMessageV3
               .parseWithIOException(PARSER, input);
         }
    -    public static automation.Automation.DeviceRoleList parseFrom(
    +    public static ztp.Ztp.DeviceRoleList parseFrom(
             java.io.InputStream input,
             com.google.protobuf.ExtensionRegistryLite extensionRegistry)
             throws java.io.IOException {
           return com.google.protobuf.GeneratedMessageV3
               .parseWithIOException(PARSER, input, extensionRegistry);
         }
    -    public static automation.Automation.DeviceRoleList parseDelimitedFrom(java.io.InputStream input)
    +    public static ztp.Ztp.DeviceRoleList parseDelimitedFrom(java.io.InputStream input)
             throws java.io.IOException {
           return com.google.protobuf.GeneratedMessageV3
               .parseDelimitedWithIOException(PARSER, input);
         }
    -    public static automation.Automation.DeviceRoleList parseDelimitedFrom(
    +    public static ztp.Ztp.DeviceRoleList parseDelimitedFrom(
             java.io.InputStream input,
             com.google.protobuf.ExtensionRegistryLite extensionRegistry)
             throws java.io.IOException {
           return com.google.protobuf.GeneratedMessageV3
               .parseDelimitedWithIOException(PARSER, input, extensionRegistry);
         }
    -    public static automation.Automation.DeviceRoleList parseFrom(
    +    public static ztp.Ztp.DeviceRoleList parseFrom(
             com.google.protobuf.CodedInputStream input)
             throws java.io.IOException {
           return com.google.protobuf.GeneratedMessageV3
               .parseWithIOException(PARSER, input);
         }
    -    public static automation.Automation.DeviceRoleList parseFrom(
    +    public static ztp.Ztp.DeviceRoleList parseFrom(
             com.google.protobuf.CodedInputStream input,
             com.google.protobuf.ExtensionRegistryLite extensionRegistry)
             throws java.io.IOException {
    @@ -2943,7 +2943,7 @@ public final class Automation {
         public static Builder newBuilder() {
           return DEFAULT_INSTANCE.toBuilder();
         }
    -    public static Builder newBuilder(automation.Automation.DeviceRoleList prototype) {
    +    public static Builder newBuilder(ztp.Ztp.DeviceRoleList prototype) {
           return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
         }
         @java.lang.Override
    @@ -2959,26 +2959,26 @@ public final class Automation {
           return builder;
         }
         /**
    -     * Protobuf type {@code automation.DeviceRoleList}
    +     * Protobuf type {@code ztp.DeviceRoleList}
          */
         public static final class Builder extends
             com.google.protobuf.GeneratedMessageV3.Builder implements
    -        // @@protoc_insertion_point(builder_implements:automation.DeviceRoleList)
    -        automation.Automation.DeviceRoleListOrBuilder {
    +        // @@protoc_insertion_point(builder_implements:ztp.DeviceRoleList)
    +        ztp.Ztp.DeviceRoleListOrBuilder {
           public static final com.google.protobuf.Descriptors.Descriptor
               getDescriptor() {
    -        return automation.Automation.internal_static_automation_DeviceRoleList_descriptor;
    +        return ztp.Ztp.internal_static_ztp_DeviceRoleList_descriptor;
           }
     
           @java.lang.Override
           protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
               internalGetFieldAccessorTable() {
    -        return automation.Automation.internal_static_automation_DeviceRoleList_fieldAccessorTable
    +        return ztp.Ztp.internal_static_ztp_DeviceRoleList_fieldAccessorTable
                 .ensureFieldAccessorsInitialized(
    -                automation.Automation.DeviceRoleList.class, automation.Automation.DeviceRoleList.Builder.class);
    +                ztp.Ztp.DeviceRoleList.class, ztp.Ztp.DeviceRoleList.Builder.class);
           }
     
    -      // Construct using automation.Automation.DeviceRoleList.newBuilder()
    +      // Construct using ztp.Ztp.DeviceRoleList.newBuilder()
           private Builder() {
             maybeForceBuilderInitialization();
           }
    @@ -3009,17 +3009,17 @@ public final class Automation {
           @java.lang.Override
           public com.google.protobuf.Descriptors.Descriptor
               getDescriptorForType() {
    -        return automation.Automation.internal_static_automation_DeviceRoleList_descriptor;
    +        return ztp.Ztp.internal_static_ztp_DeviceRoleList_descriptor;
           }
     
           @java.lang.Override
    -      public automation.Automation.DeviceRoleList getDefaultInstanceForType() {
    -        return automation.Automation.DeviceRoleList.getDefaultInstance();
    +      public ztp.Ztp.DeviceRoleList getDefaultInstanceForType() {
    +        return ztp.Ztp.DeviceRoleList.getDefaultInstance();
           }
     
           @java.lang.Override
    -      public automation.Automation.DeviceRoleList build() {
    -        automation.Automation.DeviceRoleList result = buildPartial();
    +      public ztp.Ztp.DeviceRoleList build() {
    +        ztp.Ztp.DeviceRoleList result = buildPartial();
             if (!result.isInitialized()) {
               throw newUninitializedMessageException(result);
             }
    @@ -3027,8 +3027,8 @@ public final class Automation {
           }
     
           @java.lang.Override
    -      public automation.Automation.DeviceRoleList buildPartial() {
    -        automation.Automation.DeviceRoleList result = new automation.Automation.DeviceRoleList(this);
    +      public ztp.Ztp.DeviceRoleList buildPartial() {
    +        ztp.Ztp.DeviceRoleList result = new ztp.Ztp.DeviceRoleList(this);
             int from_bitField0_ = bitField0_;
             if (devRoleBuilder_ == null) {
               if (((bitField0_ & 0x00000001) != 0)) {
    @@ -3077,16 +3077,16 @@ public final class Automation {
           }
           @java.lang.Override
           public Builder mergeFrom(com.google.protobuf.Message other) {
    -        if (other instanceof automation.Automation.DeviceRoleList) {
    -          return mergeFrom((automation.Automation.DeviceRoleList)other);
    +        if (other instanceof ztp.Ztp.DeviceRoleList) {
    +          return mergeFrom((ztp.Ztp.DeviceRoleList)other);
             } else {
               super.mergeFrom(other);
               return this;
             }
           }
     
    -      public Builder mergeFrom(automation.Automation.DeviceRoleList other) {
    -        if (other == automation.Automation.DeviceRoleList.getDefaultInstance()) return this;
    +      public Builder mergeFrom(ztp.Ztp.DeviceRoleList other) {
    +        if (other == ztp.Ztp.DeviceRoleList.getDefaultInstance()) return this;
             if (devRoleBuilder_ == null) {
               if (!other.devRole_.isEmpty()) {
                 if (devRole_.isEmpty()) {
    @@ -3128,11 +3128,11 @@ public final class Automation {
               com.google.protobuf.CodedInputStream input,
               com.google.protobuf.ExtensionRegistryLite extensionRegistry)
               throws java.io.IOException {
    -        automation.Automation.DeviceRoleList parsedMessage = null;
    +        ztp.Ztp.DeviceRoleList parsedMessage = null;
             try {
               parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
             } catch (com.google.protobuf.InvalidProtocolBufferException e) {
    -          parsedMessage = (automation.Automation.DeviceRoleList) e.getUnfinishedMessage();
    +          parsedMessage = (ztp.Ztp.DeviceRoleList) e.getUnfinishedMessage();
               throw e.unwrapIOException();
             } finally {
               if (parsedMessage != null) {
    @@ -3143,22 +3143,22 @@ public final class Automation {
           }
           private int bitField0_;
     
    -      private java.util.List devRole_ =
    +      private java.util.List devRole_ =
             java.util.Collections.emptyList();
           private void ensureDevRoleIsMutable() {
             if (!((bitField0_ & 0x00000001) != 0)) {
    -          devRole_ = new java.util.ArrayList(devRole_);
    +          devRole_ = new java.util.ArrayList(devRole_);
               bitField0_ |= 0x00000001;
              }
           }
     
           private com.google.protobuf.RepeatedFieldBuilderV3<
    -          automation.Automation.DeviceRole, automation.Automation.DeviceRole.Builder, automation.Automation.DeviceRoleOrBuilder> devRoleBuilder_;
    +          ztp.Ztp.DeviceRole, ztp.Ztp.DeviceRole.Builder, ztp.Ztp.DeviceRoleOrBuilder> devRoleBuilder_;
     
           /**
    -       * repeated .automation.DeviceRole devRole = 1;
    +       * repeated .ztp.DeviceRole devRole = 1;
            */
    -      public java.util.List getDevRoleList() {
    +      public java.util.List getDevRoleList() {
             if (devRoleBuilder_ == null) {
               return java.util.Collections.unmodifiableList(devRole_);
             } else {
    @@ -3166,7 +3166,7 @@ public final class Automation {
             }
           }
           /**
    -       * repeated .automation.DeviceRole devRole = 1;
    +       * repeated .ztp.DeviceRole devRole = 1;
            */
           public int getDevRoleCount() {
             if (devRoleBuilder_ == null) {
    @@ -3176,9 +3176,9 @@ public final class Automation {
             }
           }
           /**
    -       * repeated .automation.DeviceRole devRole = 1;
    +       * repeated .ztp.DeviceRole devRole = 1;
            */
    -      public automation.Automation.DeviceRole getDevRole(int index) {
    +      public ztp.Ztp.DeviceRole getDevRole(int index) {
             if (devRoleBuilder_ == null) {
               return devRole_.get(index);
             } else {
    @@ -3186,10 +3186,10 @@ public final class Automation {
             }
           }
           /**
    -       * repeated .automation.DeviceRole devRole = 1;
    +       * repeated .ztp.DeviceRole devRole = 1;
            */
           public Builder setDevRole(
    -          int index, automation.Automation.DeviceRole value) {
    +          int index, ztp.Ztp.DeviceRole value) {
             if (devRoleBuilder_ == null) {
               if (value == null) {
                 throw new NullPointerException();
    @@ -3203,10 +3203,10 @@ public final class Automation {
             return this;
           }
           /**
    -       * repeated .automation.DeviceRole devRole = 1;
    +       * repeated .ztp.DeviceRole devRole = 1;
            */
           public Builder setDevRole(
    -          int index, automation.Automation.DeviceRole.Builder builderForValue) {
    +          int index, ztp.Ztp.DeviceRole.Builder builderForValue) {
             if (devRoleBuilder_ == null) {
               ensureDevRoleIsMutable();
               devRole_.set(index, builderForValue.build());
    @@ -3217,9 +3217,9 @@ public final class Automation {
             return this;
           }
           /**
    -       * repeated .automation.DeviceRole devRole = 1;
    +       * repeated .ztp.DeviceRole devRole = 1;
            */
    -      public Builder addDevRole(automation.Automation.DeviceRole value) {
    +      public Builder addDevRole(ztp.Ztp.DeviceRole value) {
             if (devRoleBuilder_ == null) {
               if (value == null) {
                 throw new NullPointerException();
    @@ -3233,10 +3233,10 @@ public final class Automation {
             return this;
           }
           /**
    -       * repeated .automation.DeviceRole devRole = 1;
    +       * repeated .ztp.DeviceRole devRole = 1;
            */
           public Builder addDevRole(
    -          int index, automation.Automation.DeviceRole value) {
    +          int index, ztp.Ztp.DeviceRole value) {
             if (devRoleBuilder_ == null) {
               if (value == null) {
                 throw new NullPointerException();
    @@ -3250,10 +3250,10 @@ public final class Automation {
             return this;
           }
           /**
    -       * repeated .automation.DeviceRole devRole = 1;
    +       * repeated .ztp.DeviceRole devRole = 1;
            */
           public Builder addDevRole(
    -          automation.Automation.DeviceRole.Builder builderForValue) {
    +          ztp.Ztp.DeviceRole.Builder builderForValue) {
             if (devRoleBuilder_ == null) {
               ensureDevRoleIsMutable();
               devRole_.add(builderForValue.build());
    @@ -3264,10 +3264,10 @@ public final class Automation {
             return this;
           }
           /**
    -       * repeated .automation.DeviceRole devRole = 1;
    +       * repeated .ztp.DeviceRole devRole = 1;
            */
           public Builder addDevRole(
    -          int index, automation.Automation.DeviceRole.Builder builderForValue) {
    +          int index, ztp.Ztp.DeviceRole.Builder builderForValue) {
             if (devRoleBuilder_ == null) {
               ensureDevRoleIsMutable();
               devRole_.add(index, builderForValue.build());
    @@ -3278,10 +3278,10 @@ public final class Automation {
             return this;
           }
           /**
    -       * repeated .automation.DeviceRole devRole = 1;
    +       * repeated .ztp.DeviceRole devRole = 1;
            */
           public Builder addAllDevRole(
    -          java.lang.Iterable values) {
    +          java.lang.Iterable values) {
             if (devRoleBuilder_ == null) {
               ensureDevRoleIsMutable();
               com.google.protobuf.AbstractMessageLite.Builder.addAll(
    @@ -3293,7 +3293,7 @@ public final class Automation {
             return this;
           }
           /**
    -       * repeated .automation.DeviceRole devRole = 1;
    +       * repeated .ztp.DeviceRole devRole = 1;
            */
           public Builder clearDevRole() {
             if (devRoleBuilder_ == null) {
    @@ -3306,7 +3306,7 @@ public final class Automation {
             return this;
           }
           /**
    -       * repeated .automation.DeviceRole devRole = 1;
    +       * repeated .ztp.DeviceRole devRole = 1;
            */
           public Builder removeDevRole(int index) {
             if (devRoleBuilder_ == null) {
    @@ -3319,16 +3319,16 @@ public final class Automation {
             return this;
           }
           /**
    -       * repeated .automation.DeviceRole devRole = 1;
    +       * repeated .ztp.DeviceRole devRole = 1;
            */
    -      public automation.Automation.DeviceRole.Builder getDevRoleBuilder(
    +      public ztp.Ztp.DeviceRole.Builder getDevRoleBuilder(
               int index) {
             return getDevRoleFieldBuilder().getBuilder(index);
           }
           /**
    -       * repeated .automation.DeviceRole devRole = 1;
    +       * repeated .ztp.DeviceRole devRole = 1;
            */
    -      public automation.Automation.DeviceRoleOrBuilder getDevRoleOrBuilder(
    +      public ztp.Ztp.DeviceRoleOrBuilder getDevRoleOrBuilder(
               int index) {
             if (devRoleBuilder_ == null) {
               return devRole_.get(index);  } else {
    @@ -3336,9 +3336,9 @@ public final class Automation {
             }
           }
           /**
    -       * repeated .automation.DeviceRole devRole = 1;
    +       * repeated .ztp.DeviceRole devRole = 1;
            */
    -      public java.util.List 
    +      public java.util.List 
                getDevRoleOrBuilderList() {
             if (devRoleBuilder_ != null) {
               return devRoleBuilder_.getMessageOrBuilderList();
    @@ -3347,33 +3347,33 @@ public final class Automation {
             }
           }
           /**
    -       * repeated .automation.DeviceRole devRole = 1;
    +       * repeated .ztp.DeviceRole devRole = 1;
            */
    -      public automation.Automation.DeviceRole.Builder addDevRoleBuilder() {
    +      public ztp.Ztp.DeviceRole.Builder addDevRoleBuilder() {
             return getDevRoleFieldBuilder().addBuilder(
    -            automation.Automation.DeviceRole.getDefaultInstance());
    +            ztp.Ztp.DeviceRole.getDefaultInstance());
           }
           /**
    -       * repeated .automation.DeviceRole devRole = 1;
    +       * repeated .ztp.DeviceRole devRole = 1;
            */
    -      public automation.Automation.DeviceRole.Builder addDevRoleBuilder(
    +      public ztp.Ztp.DeviceRole.Builder addDevRoleBuilder(
               int index) {
             return getDevRoleFieldBuilder().addBuilder(
    -            index, automation.Automation.DeviceRole.getDefaultInstance());
    +            index, ztp.Ztp.DeviceRole.getDefaultInstance());
           }
           /**
    -       * repeated .automation.DeviceRole devRole = 1;
    +       * repeated .ztp.DeviceRole devRole = 1;
            */
    -      public java.util.List 
    +      public java.util.List 
                getDevRoleBuilderList() {
             return getDevRoleFieldBuilder().getBuilderList();
           }
           private com.google.protobuf.RepeatedFieldBuilderV3<
    -          automation.Automation.DeviceRole, automation.Automation.DeviceRole.Builder, automation.Automation.DeviceRoleOrBuilder> 
    +          ztp.Ztp.DeviceRole, ztp.Ztp.DeviceRole.Builder, ztp.Ztp.DeviceRoleOrBuilder> 
               getDevRoleFieldBuilder() {
             if (devRoleBuilder_ == null) {
               devRoleBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3<
    -              automation.Automation.DeviceRole, automation.Automation.DeviceRole.Builder, automation.Automation.DeviceRoleOrBuilder>(
    +              ztp.Ztp.DeviceRole, ztp.Ztp.DeviceRole.Builder, ztp.Ztp.DeviceRoleOrBuilder>(
                       devRole_,
                       ((bitField0_ & 0x00000001) != 0),
                       getParentForChildren(),
    @@ -3395,16 +3395,16 @@ public final class Automation {
           }
     
     
    -      // @@protoc_insertion_point(builder_scope:automation.DeviceRoleList)
    +      // @@protoc_insertion_point(builder_scope:ztp.DeviceRoleList)
         }
     
    -    // @@protoc_insertion_point(class_scope:automation.DeviceRoleList)
    -    private static final automation.Automation.DeviceRoleList DEFAULT_INSTANCE;
    +    // @@protoc_insertion_point(class_scope:ztp.DeviceRoleList)
    +    private static final ztp.Ztp.DeviceRoleList DEFAULT_INSTANCE;
         static {
    -      DEFAULT_INSTANCE = new automation.Automation.DeviceRoleList();
    +      DEFAULT_INSTANCE = new ztp.Ztp.DeviceRoleList();
         }
     
    -    public static automation.Automation.DeviceRoleList getDefaultInstance() {
    +    public static ztp.Ztp.DeviceRoleList getDefaultInstance() {
           return DEFAULT_INSTANCE;
         }
     
    @@ -3429,48 +3429,48 @@ public final class Automation {
         }
     
         @java.lang.Override
    -    public automation.Automation.DeviceRoleList getDefaultInstanceForType() {
    +    public ztp.Ztp.DeviceRoleList getDefaultInstanceForType() {
           return DEFAULT_INSTANCE;
         }
     
       }
     
       public interface DeviceRoleStateOrBuilder extends
    -      // @@protoc_insertion_point(interface_extends:automation.DeviceRoleState)
    +      // @@protoc_insertion_point(interface_extends:ztp.DeviceRoleState)
           com.google.protobuf.MessageOrBuilder {
     
         /**
    -     * .automation.DeviceRoleId devRoleId = 1;
    +     * .ztp.DeviceRoleId devRoleId = 1;
          * @return Whether the devRoleId field is set.
          */
         boolean hasDevRoleId();
         /**
    -     * .automation.DeviceRoleId devRoleId = 1;
    +     * .ztp.DeviceRoleId devRoleId = 1;
          * @return The devRoleId.
          */
    -    automation.Automation.DeviceRoleId getDevRoleId();
    +    ztp.Ztp.DeviceRoleId getDevRoleId();
         /**
    -     * .automation.DeviceRoleId devRoleId = 1;
    +     * .ztp.DeviceRoleId devRoleId = 1;
          */
    -    automation.Automation.DeviceRoleIdOrBuilder getDevRoleIdOrBuilder();
    +    ztp.Ztp.DeviceRoleIdOrBuilder getDevRoleIdOrBuilder();
     
         /**
    -     * .automation.ZtpDeviceState devRoleState = 2;
    +     * .ztp.ZtpDeviceState devRoleState = 2;
          * @return The enum numeric value on the wire for devRoleState.
          */
         int getDevRoleStateValue();
         /**
    -     * .automation.ZtpDeviceState devRoleState = 2;
    +     * .ztp.ZtpDeviceState devRoleState = 2;
          * @return The devRoleState.
          */
    -    automation.Automation.ZtpDeviceState getDevRoleState();
    +    ztp.Ztp.ZtpDeviceState getDevRoleState();
       }
       /**
    -   * Protobuf type {@code automation.DeviceRoleState}
    +   * Protobuf type {@code ztp.DeviceRoleState}
        */
       public static final class DeviceRoleState extends
           com.google.protobuf.GeneratedMessageV3 implements
    -      // @@protoc_insertion_point(message_implements:automation.DeviceRoleState)
    +      // @@protoc_insertion_point(message_implements:ztp.DeviceRoleState)
           DeviceRoleStateOrBuilder {
       private static final long serialVersionUID = 0L;
         // Use DeviceRoleState.newBuilder() to construct.
    @@ -3512,11 +3512,11 @@ public final class Automation {
                   done = true;
                   break;
                 case 10: {
    -              automation.Automation.DeviceRoleId.Builder subBuilder = null;
    +              ztp.Ztp.DeviceRoleId.Builder subBuilder = null;
                   if (devRoleId_ != null) {
                     subBuilder = devRoleId_.toBuilder();
                   }
    -              devRoleId_ = input.readMessage(automation.Automation.DeviceRoleId.parser(), extensionRegistry);
    +              devRoleId_ = input.readMessage(ztp.Ztp.DeviceRoleId.parser(), extensionRegistry);
                   if (subBuilder != null) {
                     subBuilder.mergeFrom(devRoleId_);
                     devRoleId_ = subBuilder.buildPartial();
    @@ -3551,21 +3551,21 @@ public final class Automation {
         }
         public static final com.google.protobuf.Descriptors.Descriptor
             getDescriptor() {
    -      return automation.Automation.internal_static_automation_DeviceRoleState_descriptor;
    +      return ztp.Ztp.internal_static_ztp_DeviceRoleState_descriptor;
         }
     
         @java.lang.Override
         protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
             internalGetFieldAccessorTable() {
    -      return automation.Automation.internal_static_automation_DeviceRoleState_fieldAccessorTable
    +      return ztp.Ztp.internal_static_ztp_DeviceRoleState_fieldAccessorTable
               .ensureFieldAccessorsInitialized(
    -              automation.Automation.DeviceRoleState.class, automation.Automation.DeviceRoleState.Builder.class);
    +              ztp.Ztp.DeviceRoleState.class, ztp.Ztp.DeviceRoleState.Builder.class);
         }
     
         public static final int DEVROLEID_FIELD_NUMBER = 1;
    -    private automation.Automation.DeviceRoleId devRoleId_;
    +    private ztp.Ztp.DeviceRoleId devRoleId_;
         /**
    -     * .automation.DeviceRoleId devRoleId = 1;
    +     * .ztp.DeviceRoleId devRoleId = 1;
          * @return Whether the devRoleId field is set.
          */
         @java.lang.Override
    @@ -3573,38 +3573,38 @@ public final class Automation {
           return devRoleId_ != null;
         }
         /**
    -     * .automation.DeviceRoleId devRoleId = 1;
    +     * .ztp.DeviceRoleId devRoleId = 1;
          * @return The devRoleId.
          */
         @java.lang.Override
    -    public automation.Automation.DeviceRoleId getDevRoleId() {
    -      return devRoleId_ == null ? automation.Automation.DeviceRoleId.getDefaultInstance() : devRoleId_;
    +    public ztp.Ztp.DeviceRoleId getDevRoleId() {
    +      return devRoleId_ == null ? ztp.Ztp.DeviceRoleId.getDefaultInstance() : devRoleId_;
         }
         /**
    -     * .automation.DeviceRoleId devRoleId = 1;
    +     * .ztp.DeviceRoleId devRoleId = 1;
          */
         @java.lang.Override
    -    public automation.Automation.DeviceRoleIdOrBuilder getDevRoleIdOrBuilder() {
    +    public ztp.Ztp.DeviceRoleIdOrBuilder getDevRoleIdOrBuilder() {
           return getDevRoleId();
         }
     
         public static final int DEVROLESTATE_FIELD_NUMBER = 2;
         private int devRoleState_;
         /**
    -     * .automation.ZtpDeviceState devRoleState = 2;
    +     * .ztp.ZtpDeviceState devRoleState = 2;
          * @return The enum numeric value on the wire for devRoleState.
          */
         @java.lang.Override public int getDevRoleStateValue() {
           return devRoleState_;
         }
         /**
    -     * .automation.ZtpDeviceState devRoleState = 2;
    +     * .ztp.ZtpDeviceState devRoleState = 2;
          * @return The devRoleState.
          */
    -    @java.lang.Override public automation.Automation.ZtpDeviceState getDevRoleState() {
    +    @java.lang.Override public ztp.Ztp.ZtpDeviceState getDevRoleState() {
           @SuppressWarnings("deprecation")
    -      automation.Automation.ZtpDeviceState result = automation.Automation.ZtpDeviceState.valueOf(devRoleState_);
    -      return result == null ? automation.Automation.ZtpDeviceState.UNRECOGNIZED : result;
    +      ztp.Ztp.ZtpDeviceState result = ztp.Ztp.ZtpDeviceState.valueOf(devRoleState_);
    +      return result == null ? ztp.Ztp.ZtpDeviceState.UNRECOGNIZED : result;
         }
     
         private byte memoizedIsInitialized = -1;
    @@ -3624,7 +3624,7 @@ public final class Automation {
           if (devRoleId_ != null) {
             output.writeMessage(1, getDevRoleId());
           }
    -      if (devRoleState_ != automation.Automation.ZtpDeviceState.ZTP_DEV_STATE_UNDEFINED.getNumber()) {
    +      if (devRoleState_ != ztp.Ztp.ZtpDeviceState.ZTP_DEV_STATE_UNDEFINED.getNumber()) {
             output.writeEnum(2, devRoleState_);
           }
           unknownFields.writeTo(output);
    @@ -3640,7 +3640,7 @@ public final class Automation {
             size += com.google.protobuf.CodedOutputStream
               .computeMessageSize(1, getDevRoleId());
           }
    -      if (devRoleState_ != automation.Automation.ZtpDeviceState.ZTP_DEV_STATE_UNDEFINED.getNumber()) {
    +      if (devRoleState_ != ztp.Ztp.ZtpDeviceState.ZTP_DEV_STATE_UNDEFINED.getNumber()) {
             size += com.google.protobuf.CodedOutputStream
               .computeEnumSize(2, devRoleState_);
           }
    @@ -3654,10 +3654,10 @@ public final class Automation {
           if (obj == this) {
            return true;
           }
    -      if (!(obj instanceof automation.Automation.DeviceRoleState)) {
    +      if (!(obj instanceof ztp.Ztp.DeviceRoleState)) {
             return super.equals(obj);
           }
    -      automation.Automation.DeviceRoleState other = (automation.Automation.DeviceRoleState) obj;
    +      ztp.Ztp.DeviceRoleState other = (ztp.Ztp.DeviceRoleState) obj;
     
           if (hasDevRoleId() != other.hasDevRoleId()) return false;
           if (hasDevRoleId()) {
    @@ -3687,69 +3687,69 @@ public final class Automation {
           return hash;
         }
     
    -    public static automation.Automation.DeviceRoleState parseFrom(
    +    public static ztp.Ztp.DeviceRoleState parseFrom(
             java.nio.ByteBuffer data)
             throws com.google.protobuf.InvalidProtocolBufferException {
           return PARSER.parseFrom(data);
         }
    -    public static automation.Automation.DeviceRoleState parseFrom(
    +    public static ztp.Ztp.DeviceRoleState parseFrom(
             java.nio.ByteBuffer data,
             com.google.protobuf.ExtensionRegistryLite extensionRegistry)
             throws com.google.protobuf.InvalidProtocolBufferException {
           return PARSER.parseFrom(data, extensionRegistry);
         }
    -    public static automation.Automation.DeviceRoleState parseFrom(
    +    public static ztp.Ztp.DeviceRoleState parseFrom(
             com.google.protobuf.ByteString data)
             throws com.google.protobuf.InvalidProtocolBufferException {
           return PARSER.parseFrom(data);
         }
    -    public static automation.Automation.DeviceRoleState parseFrom(
    +    public static ztp.Ztp.DeviceRoleState parseFrom(
             com.google.protobuf.ByteString data,
             com.google.protobuf.ExtensionRegistryLite extensionRegistry)
             throws com.google.protobuf.InvalidProtocolBufferException {
           return PARSER.parseFrom(data, extensionRegistry);
         }
    -    public static automation.Automation.DeviceRoleState parseFrom(byte[] data)
    +    public static ztp.Ztp.DeviceRoleState parseFrom(byte[] data)
             throws com.google.protobuf.InvalidProtocolBufferException {
           return PARSER.parseFrom(data);
         }
    -    public static automation.Automation.DeviceRoleState parseFrom(
    +    public static ztp.Ztp.DeviceRoleState parseFrom(
             byte[] data,
             com.google.protobuf.ExtensionRegistryLite extensionRegistry)
             throws com.google.protobuf.InvalidProtocolBufferException {
           return PARSER.parseFrom(data, extensionRegistry);
         }
    -    public static automation.Automation.DeviceRoleState parseFrom(java.io.InputStream input)
    +    public static ztp.Ztp.DeviceRoleState parseFrom(java.io.InputStream input)
             throws java.io.IOException {
           return com.google.protobuf.GeneratedMessageV3
               .parseWithIOException(PARSER, input);
         }
    -    public static automation.Automation.DeviceRoleState parseFrom(
    +    public static ztp.Ztp.DeviceRoleState parseFrom(
             java.io.InputStream input,
             com.google.protobuf.ExtensionRegistryLite extensionRegistry)
             throws java.io.IOException {
           return com.google.protobuf.GeneratedMessageV3
               .parseWithIOException(PARSER, input, extensionRegistry);
         }
    -    public static automation.Automation.DeviceRoleState parseDelimitedFrom(java.io.InputStream input)
    +    public static ztp.Ztp.DeviceRoleState parseDelimitedFrom(java.io.InputStream input)
             throws java.io.IOException {
           return com.google.protobuf.GeneratedMessageV3
               .parseDelimitedWithIOException(PARSER, input);
         }
    -    public static automation.Automation.DeviceRoleState parseDelimitedFrom(
    +    public static ztp.Ztp.DeviceRoleState parseDelimitedFrom(
             java.io.InputStream input,
             com.google.protobuf.ExtensionRegistryLite extensionRegistry)
             throws java.io.IOException {
           return com.google.protobuf.GeneratedMessageV3
               .parseDelimitedWithIOException(PARSER, input, extensionRegistry);
         }
    -    public static automation.Automation.DeviceRoleState parseFrom(
    +    public static ztp.Ztp.DeviceRoleState parseFrom(
             com.google.protobuf.CodedInputStream input)
             throws java.io.IOException {
           return com.google.protobuf.GeneratedMessageV3
               .parseWithIOException(PARSER, input);
         }
    -    public static automation.Automation.DeviceRoleState parseFrom(
    +    public static ztp.Ztp.DeviceRoleState parseFrom(
             com.google.protobuf.CodedInputStream input,
             com.google.protobuf.ExtensionRegistryLite extensionRegistry)
             throws java.io.IOException {
    @@ -3762,7 +3762,7 @@ public final class Automation {
         public static Builder newBuilder() {
           return DEFAULT_INSTANCE.toBuilder();
         }
    -    public static Builder newBuilder(automation.Automation.DeviceRoleState prototype) {
    +    public static Builder newBuilder(ztp.Ztp.DeviceRoleState prototype) {
           return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
         }
         @java.lang.Override
    @@ -3778,26 +3778,26 @@ public final class Automation {
           return builder;
         }
         /**
    -     * Protobuf type {@code automation.DeviceRoleState}
    +     * Protobuf type {@code ztp.DeviceRoleState}
          */
         public static final class Builder extends
             com.google.protobuf.GeneratedMessageV3.Builder implements
    -        // @@protoc_insertion_point(builder_implements:automation.DeviceRoleState)
    -        automation.Automation.DeviceRoleStateOrBuilder {
    +        // @@protoc_insertion_point(builder_implements:ztp.DeviceRoleState)
    +        ztp.Ztp.DeviceRoleStateOrBuilder {
           public static final com.google.protobuf.Descriptors.Descriptor
               getDescriptor() {
    -        return automation.Automation.internal_static_automation_DeviceRoleState_descriptor;
    +        return ztp.Ztp.internal_static_ztp_DeviceRoleState_descriptor;
           }
     
           @java.lang.Override
           protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
               internalGetFieldAccessorTable() {
    -        return automation.Automation.internal_static_automation_DeviceRoleState_fieldAccessorTable
    +        return ztp.Ztp.internal_static_ztp_DeviceRoleState_fieldAccessorTable
                 .ensureFieldAccessorsInitialized(
    -                automation.Automation.DeviceRoleState.class, automation.Automation.DeviceRoleState.Builder.class);
    +                ztp.Ztp.DeviceRoleState.class, ztp.Ztp.DeviceRoleState.Builder.class);
           }
     
    -      // Construct using automation.Automation.DeviceRoleState.newBuilder()
    +      // Construct using ztp.Ztp.DeviceRoleState.newBuilder()
           private Builder() {
             maybeForceBuilderInitialization();
           }
    @@ -3829,17 +3829,17 @@ public final class Automation {
           @java.lang.Override
           public com.google.protobuf.Descriptors.Descriptor
               getDescriptorForType() {
    -        return automation.Automation.internal_static_automation_DeviceRoleState_descriptor;
    +        return ztp.Ztp.internal_static_ztp_DeviceRoleState_descriptor;
           }
     
           @java.lang.Override
    -      public automation.Automation.DeviceRoleState getDefaultInstanceForType() {
    -        return automation.Automation.DeviceRoleState.getDefaultInstance();
    +      public ztp.Ztp.DeviceRoleState getDefaultInstanceForType() {
    +        return ztp.Ztp.DeviceRoleState.getDefaultInstance();
           }
     
           @java.lang.Override
    -      public automation.Automation.DeviceRoleState build() {
    -        automation.Automation.DeviceRoleState result = buildPartial();
    +      public ztp.Ztp.DeviceRoleState build() {
    +        ztp.Ztp.DeviceRoleState result = buildPartial();
             if (!result.isInitialized()) {
               throw newUninitializedMessageException(result);
             }
    @@ -3847,8 +3847,8 @@ public final class Automation {
           }
     
           @java.lang.Override
    -      public automation.Automation.DeviceRoleState buildPartial() {
    -        automation.Automation.DeviceRoleState result = new automation.Automation.DeviceRoleState(this);
    +      public ztp.Ztp.DeviceRoleState buildPartial() {
    +        ztp.Ztp.DeviceRoleState result = new ztp.Ztp.DeviceRoleState(this);
             if (devRoleIdBuilder_ == null) {
               result.devRoleId_ = devRoleId_;
             } else {
    @@ -3893,16 +3893,16 @@ public final class Automation {
           }
           @java.lang.Override
           public Builder mergeFrom(com.google.protobuf.Message other) {
    -        if (other instanceof automation.Automation.DeviceRoleState) {
    -          return mergeFrom((automation.Automation.DeviceRoleState)other);
    +        if (other instanceof ztp.Ztp.DeviceRoleState) {
    +          return mergeFrom((ztp.Ztp.DeviceRoleState)other);
             } else {
               super.mergeFrom(other);
               return this;
             }
           }
     
    -      public Builder mergeFrom(automation.Automation.DeviceRoleState other) {
    -        if (other == automation.Automation.DeviceRoleState.getDefaultInstance()) return this;
    +      public Builder mergeFrom(ztp.Ztp.DeviceRoleState other) {
    +        if (other == ztp.Ztp.DeviceRoleState.getDefaultInstance()) return this;
             if (other.hasDevRoleId()) {
               mergeDevRoleId(other.getDevRoleId());
             }
    @@ -3924,11 +3924,11 @@ public final class Automation {
               com.google.protobuf.CodedInputStream input,
               com.google.protobuf.ExtensionRegistryLite extensionRegistry)
               throws java.io.IOException {
    -        automation.Automation.DeviceRoleState parsedMessage = null;
    +        ztp.Ztp.DeviceRoleState parsedMessage = null;
             try {
               parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
             } catch (com.google.protobuf.InvalidProtocolBufferException e) {
    -          parsedMessage = (automation.Automation.DeviceRoleState) e.getUnfinishedMessage();
    +          parsedMessage = (ztp.Ztp.DeviceRoleState) e.getUnfinishedMessage();
               throw e.unwrapIOException();
             } finally {
               if (parsedMessage != null) {
    @@ -3938,31 +3938,31 @@ public final class Automation {
             return this;
           }
     
    -      private automation.Automation.DeviceRoleId devRoleId_;
    +      private ztp.Ztp.DeviceRoleId devRoleId_;
           private com.google.protobuf.SingleFieldBuilderV3<
    -          automation.Automation.DeviceRoleId, automation.Automation.DeviceRoleId.Builder, automation.Automation.DeviceRoleIdOrBuilder> devRoleIdBuilder_;
    +          ztp.Ztp.DeviceRoleId, ztp.Ztp.DeviceRoleId.Builder, ztp.Ztp.DeviceRoleIdOrBuilder> devRoleIdBuilder_;
           /**
    -       * .automation.DeviceRoleId devRoleId = 1;
    +       * .ztp.DeviceRoleId devRoleId = 1;
            * @return Whether the devRoleId field is set.
            */
           public boolean hasDevRoleId() {
             return devRoleIdBuilder_ != null || devRoleId_ != null;
           }
           /**
    -       * .automation.DeviceRoleId devRoleId = 1;
    +       * .ztp.DeviceRoleId devRoleId = 1;
            * @return The devRoleId.
            */
    -      public automation.Automation.DeviceRoleId getDevRoleId() {
    +      public ztp.Ztp.DeviceRoleId getDevRoleId() {
             if (devRoleIdBuilder_ == null) {
    -          return devRoleId_ == null ? automation.Automation.DeviceRoleId.getDefaultInstance() : devRoleId_;
    +          return devRoleId_ == null ? ztp.Ztp.DeviceRoleId.getDefaultInstance() : devRoleId_;
             } else {
               return devRoleIdBuilder_.getMessage();
             }
           }
           /**
    -       * .automation.DeviceRoleId devRoleId = 1;
    +       * .ztp.DeviceRoleId devRoleId = 1;
            */
    -      public Builder setDevRoleId(automation.Automation.DeviceRoleId value) {
    +      public Builder setDevRoleId(ztp.Ztp.DeviceRoleId value) {
             if (devRoleIdBuilder_ == null) {
               if (value == null) {
                 throw new NullPointerException();
    @@ -3976,10 +3976,10 @@ public final class Automation {
             return this;
           }
           /**
    -       * .automation.DeviceRoleId devRoleId = 1;
    +       * .ztp.DeviceRoleId devRoleId = 1;
            */
           public Builder setDevRoleId(
    -          automation.Automation.DeviceRoleId.Builder builderForValue) {
    +          ztp.Ztp.DeviceRoleId.Builder builderForValue) {
             if (devRoleIdBuilder_ == null) {
               devRoleId_ = builderForValue.build();
               onChanged();
    @@ -3990,13 +3990,13 @@ public final class Automation {
             return this;
           }
           /**
    -       * .automation.DeviceRoleId devRoleId = 1;
    +       * .ztp.DeviceRoleId devRoleId = 1;
            */
    -      public Builder mergeDevRoleId(automation.Automation.DeviceRoleId value) {
    +      public Builder mergeDevRoleId(ztp.Ztp.DeviceRoleId value) {
             if (devRoleIdBuilder_ == null) {
               if (devRoleId_ != null) {
                 devRoleId_ =
    -              automation.Automation.DeviceRoleId.newBuilder(devRoleId_).mergeFrom(value).buildPartial();
    +              ztp.Ztp.DeviceRoleId.newBuilder(devRoleId_).mergeFrom(value).buildPartial();
               } else {
                 devRoleId_ = value;
               }
    @@ -4008,7 +4008,7 @@ public final class Automation {
             return this;
           }
           /**
    -       * .automation.DeviceRoleId devRoleId = 1;
    +       * .ztp.DeviceRoleId devRoleId = 1;
            */
           public Builder clearDevRoleId() {
             if (devRoleIdBuilder_ == null) {
    @@ -4022,33 +4022,33 @@ public final class Automation {
             return this;
           }
           /**
    -       * .automation.DeviceRoleId devRoleId = 1;
    +       * .ztp.DeviceRoleId devRoleId = 1;
            */
    -      public automation.Automation.DeviceRoleId.Builder getDevRoleIdBuilder() {
    +      public ztp.Ztp.DeviceRoleId.Builder getDevRoleIdBuilder() {
             
             onChanged();
             return getDevRoleIdFieldBuilder().getBuilder();
           }
           /**
    -       * .automation.DeviceRoleId devRoleId = 1;
    +       * .ztp.DeviceRoleId devRoleId = 1;
            */
    -      public automation.Automation.DeviceRoleIdOrBuilder getDevRoleIdOrBuilder() {
    +      public ztp.Ztp.DeviceRoleIdOrBuilder getDevRoleIdOrBuilder() {
             if (devRoleIdBuilder_ != null) {
               return devRoleIdBuilder_.getMessageOrBuilder();
             } else {
               return devRoleId_ == null ?
    -              automation.Automation.DeviceRoleId.getDefaultInstance() : devRoleId_;
    +              ztp.Ztp.DeviceRoleId.getDefaultInstance() : devRoleId_;
             }
           }
           /**
    -       * .automation.DeviceRoleId devRoleId = 1;
    +       * .ztp.DeviceRoleId devRoleId = 1;
            */
           private com.google.protobuf.SingleFieldBuilderV3<
    -          automation.Automation.DeviceRoleId, automation.Automation.DeviceRoleId.Builder, automation.Automation.DeviceRoleIdOrBuilder> 
    +          ztp.Ztp.DeviceRoleId, ztp.Ztp.DeviceRoleId.Builder, ztp.Ztp.DeviceRoleIdOrBuilder> 
               getDevRoleIdFieldBuilder() {
             if (devRoleIdBuilder_ == null) {
               devRoleIdBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
    -              automation.Automation.DeviceRoleId, automation.Automation.DeviceRoleId.Builder, automation.Automation.DeviceRoleIdOrBuilder>(
    +              ztp.Ztp.DeviceRoleId, ztp.Ztp.DeviceRoleId.Builder, ztp.Ztp.DeviceRoleIdOrBuilder>(
                       getDevRoleId(),
                       getParentForChildren(),
                       isClean());
    @@ -4059,14 +4059,14 @@ public final class Automation {
     
           private int devRoleState_ = 0;
           /**
    -       * .automation.ZtpDeviceState devRoleState = 2;
    +       * .ztp.ZtpDeviceState devRoleState = 2;
            * @return The enum numeric value on the wire for devRoleState.
            */
           @java.lang.Override public int getDevRoleStateValue() {
             return devRoleState_;
           }
           /**
    -       * .automation.ZtpDeviceState devRoleState = 2;
    +       * .ztp.ZtpDeviceState devRoleState = 2;
            * @param value The enum numeric value on the wire for devRoleState to set.
            * @return This builder for chaining.
            */
    @@ -4077,21 +4077,21 @@ public final class Automation {
             return this;
           }
           /**
    -       * .automation.ZtpDeviceState devRoleState = 2;
    +       * .ztp.ZtpDeviceState devRoleState = 2;
            * @return The devRoleState.
            */
           @java.lang.Override
    -      public automation.Automation.ZtpDeviceState getDevRoleState() {
    +      public ztp.Ztp.ZtpDeviceState getDevRoleState() {
             @SuppressWarnings("deprecation")
    -        automation.Automation.ZtpDeviceState result = automation.Automation.ZtpDeviceState.valueOf(devRoleState_);
    -        return result == null ? automation.Automation.ZtpDeviceState.UNRECOGNIZED : result;
    +        ztp.Ztp.ZtpDeviceState result = ztp.Ztp.ZtpDeviceState.valueOf(devRoleState_);
    +        return result == null ? ztp.Ztp.ZtpDeviceState.UNRECOGNIZED : result;
           }
           /**
    -       * .automation.ZtpDeviceState devRoleState = 2;
    +       * .ztp.ZtpDeviceState devRoleState = 2;
            * @param value The devRoleState to set.
            * @return This builder for chaining.
            */
    -      public Builder setDevRoleState(automation.Automation.ZtpDeviceState value) {
    +      public Builder setDevRoleState(ztp.Ztp.ZtpDeviceState value) {
             if (value == null) {
               throw new NullPointerException();
             }
    @@ -4101,7 +4101,7 @@ public final class Automation {
             return this;
           }
           /**
    -       * .automation.ZtpDeviceState devRoleState = 2;
    +       * .ztp.ZtpDeviceState devRoleState = 2;
            * @return This builder for chaining.
            */
           public Builder clearDevRoleState() {
    @@ -4123,16 +4123,16 @@ public final class Automation {
           }
     
     
    -      // @@protoc_insertion_point(builder_scope:automation.DeviceRoleState)
    +      // @@protoc_insertion_point(builder_scope:ztp.DeviceRoleState)
         }
     
    -    // @@protoc_insertion_point(class_scope:automation.DeviceRoleState)
    -    private static final automation.Automation.DeviceRoleState DEFAULT_INSTANCE;
    +    // @@protoc_insertion_point(class_scope:ztp.DeviceRoleState)
    +    private static final ztp.Ztp.DeviceRoleState DEFAULT_INSTANCE;
         static {
    -      DEFAULT_INSTANCE = new automation.Automation.DeviceRoleState();
    +      DEFAULT_INSTANCE = new ztp.Ztp.DeviceRoleState();
         }
     
    -    public static automation.Automation.DeviceRoleState getDefaultInstance() {
    +    public static ztp.Ztp.DeviceRoleState getDefaultInstance() {
           return DEFAULT_INSTANCE;
         }
     
    @@ -4157,14 +4157,14 @@ public final class Automation {
         }
     
         @java.lang.Override
    -    public automation.Automation.DeviceRoleState getDefaultInstanceForType() {
    +    public ztp.Ztp.DeviceRoleState getDefaultInstanceForType() {
           return DEFAULT_INSTANCE;
         }
     
       }
     
       public interface DeviceDeletionResultOrBuilder extends
    -      // @@protoc_insertion_point(interface_extends:automation.DeviceDeletionResult)
    +      // @@protoc_insertion_point(interface_extends:ztp.DeviceDeletionResult)
           com.google.protobuf.MessageOrBuilder {
     
         /**
    @@ -4193,11 +4193,11 @@ public final class Automation {
             getDeletedBytes(int index);
       }
       /**
    -   * Protobuf type {@code automation.DeviceDeletionResult}
    +   * Protobuf type {@code ztp.DeviceDeletionResult}
        */
       public static final class DeviceDeletionResult extends
           com.google.protobuf.GeneratedMessageV3 implements
    -      // @@protoc_insertion_point(message_implements:automation.DeviceDeletionResult)
    +      // @@protoc_insertion_point(message_implements:ztp.DeviceDeletionResult)
           DeviceDeletionResultOrBuilder {
       private static final long serialVersionUID = 0L;
         // Use DeviceDeletionResult.newBuilder() to construct.
    @@ -4272,15 +4272,15 @@ public final class Automation {
         }
         public static final com.google.protobuf.Descriptors.Descriptor
             getDescriptor() {
    -      return automation.Automation.internal_static_automation_DeviceDeletionResult_descriptor;
    +      return ztp.Ztp.internal_static_ztp_DeviceDeletionResult_descriptor;
         }
     
         @java.lang.Override
         protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
             internalGetFieldAccessorTable() {
    -      return automation.Automation.internal_static_automation_DeviceDeletionResult_fieldAccessorTable
    +      return ztp.Ztp.internal_static_ztp_DeviceDeletionResult_fieldAccessorTable
               .ensureFieldAccessorsInitialized(
    -              automation.Automation.DeviceDeletionResult.class, automation.Automation.DeviceDeletionResult.Builder.class);
    +              ztp.Ztp.DeviceDeletionResult.class, ztp.Ztp.DeviceDeletionResult.Builder.class);
         }
     
         public static final int DELETED_FIELD_NUMBER = 1;
    @@ -4362,10 +4362,10 @@ public final class Automation {
           if (obj == this) {
            return true;
           }
    -      if (!(obj instanceof automation.Automation.DeviceDeletionResult)) {
    +      if (!(obj instanceof ztp.Ztp.DeviceDeletionResult)) {
             return super.equals(obj);
           }
    -      automation.Automation.DeviceDeletionResult other = (automation.Automation.DeviceDeletionResult) obj;
    +      ztp.Ztp.DeviceDeletionResult other = (ztp.Ztp.DeviceDeletionResult) obj;
     
           if (!getDeletedList()
               .equals(other.getDeletedList())) return false;
    @@ -4389,69 +4389,69 @@ public final class Automation {
           return hash;
         }
     
    -    public static automation.Automation.DeviceDeletionResult parseFrom(
    +    public static ztp.Ztp.DeviceDeletionResult parseFrom(
             java.nio.ByteBuffer data)
             throws com.google.protobuf.InvalidProtocolBufferException {
           return PARSER.parseFrom(data);
         }
    -    public static automation.Automation.DeviceDeletionResult parseFrom(
    +    public static ztp.Ztp.DeviceDeletionResult parseFrom(
             java.nio.ByteBuffer data,
             com.google.protobuf.ExtensionRegistryLite extensionRegistry)
             throws com.google.protobuf.InvalidProtocolBufferException {
           return PARSER.parseFrom(data, extensionRegistry);
         }
    -    public static automation.Automation.DeviceDeletionResult parseFrom(
    +    public static ztp.Ztp.DeviceDeletionResult parseFrom(
             com.google.protobuf.ByteString data)
             throws com.google.protobuf.InvalidProtocolBufferException {
           return PARSER.parseFrom(data);
         }
    -    public static automation.Automation.DeviceDeletionResult parseFrom(
    +    public static ztp.Ztp.DeviceDeletionResult parseFrom(
             com.google.protobuf.ByteString data,
             com.google.protobuf.ExtensionRegistryLite extensionRegistry)
             throws com.google.protobuf.InvalidProtocolBufferException {
           return PARSER.parseFrom(data, extensionRegistry);
         }
    -    public static automation.Automation.DeviceDeletionResult parseFrom(byte[] data)
    +    public static ztp.Ztp.DeviceDeletionResult parseFrom(byte[] data)
             throws com.google.protobuf.InvalidProtocolBufferException {
           return PARSER.parseFrom(data);
         }
    -    public static automation.Automation.DeviceDeletionResult parseFrom(
    +    public static ztp.Ztp.DeviceDeletionResult parseFrom(
             byte[] data,
             com.google.protobuf.ExtensionRegistryLite extensionRegistry)
             throws com.google.protobuf.InvalidProtocolBufferException {
           return PARSER.parseFrom(data, extensionRegistry);
         }
    -    public static automation.Automation.DeviceDeletionResult parseFrom(java.io.InputStream input)
    +    public static ztp.Ztp.DeviceDeletionResult parseFrom(java.io.InputStream input)
             throws java.io.IOException {
           return com.google.protobuf.GeneratedMessageV3
               .parseWithIOException(PARSER, input);
         }
    -    public static automation.Automation.DeviceDeletionResult parseFrom(
    +    public static ztp.Ztp.DeviceDeletionResult parseFrom(
             java.io.InputStream input,
             com.google.protobuf.ExtensionRegistryLite extensionRegistry)
             throws java.io.IOException {
           return com.google.protobuf.GeneratedMessageV3
               .parseWithIOException(PARSER, input, extensionRegistry);
         }
    -    public static automation.Automation.DeviceDeletionResult parseDelimitedFrom(java.io.InputStream input)
    +    public static ztp.Ztp.DeviceDeletionResult parseDelimitedFrom(java.io.InputStream input)
             throws java.io.IOException {
           return com.google.protobuf.GeneratedMessageV3
               .parseDelimitedWithIOException(PARSER, input);
         }
    -    public static automation.Automation.DeviceDeletionResult parseDelimitedFrom(
    +    public static ztp.Ztp.DeviceDeletionResult parseDelimitedFrom(
             java.io.InputStream input,
             com.google.protobuf.ExtensionRegistryLite extensionRegistry)
             throws java.io.IOException {
           return com.google.protobuf.GeneratedMessageV3
               .parseDelimitedWithIOException(PARSER, input, extensionRegistry);
         }
    -    public static automation.Automation.DeviceDeletionResult parseFrom(
    +    public static ztp.Ztp.DeviceDeletionResult parseFrom(
             com.google.protobuf.CodedInputStream input)
             throws java.io.IOException {
           return com.google.protobuf.GeneratedMessageV3
               .parseWithIOException(PARSER, input);
         }
    -    public static automation.Automation.DeviceDeletionResult parseFrom(
    +    public static ztp.Ztp.DeviceDeletionResult parseFrom(
             com.google.protobuf.CodedInputStream input,
             com.google.protobuf.ExtensionRegistryLite extensionRegistry)
             throws java.io.IOException {
    @@ -4464,7 +4464,7 @@ public final class Automation {
         public static Builder newBuilder() {
           return DEFAULT_INSTANCE.toBuilder();
         }
    -    public static Builder newBuilder(automation.Automation.DeviceDeletionResult prototype) {
    +    public static Builder newBuilder(ztp.Ztp.DeviceDeletionResult prototype) {
           return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
         }
         @java.lang.Override
    @@ -4480,26 +4480,26 @@ public final class Automation {
           return builder;
         }
         /**
    -     * Protobuf type {@code automation.DeviceDeletionResult}
    +     * Protobuf type {@code ztp.DeviceDeletionResult}
          */
         public static final class Builder extends
             com.google.protobuf.GeneratedMessageV3.Builder implements
    -        // @@protoc_insertion_point(builder_implements:automation.DeviceDeletionResult)
    -        automation.Automation.DeviceDeletionResultOrBuilder {
    +        // @@protoc_insertion_point(builder_implements:ztp.DeviceDeletionResult)
    +        ztp.Ztp.DeviceDeletionResultOrBuilder {
           public static final com.google.protobuf.Descriptors.Descriptor
               getDescriptor() {
    -        return automation.Automation.internal_static_automation_DeviceDeletionResult_descriptor;
    +        return ztp.Ztp.internal_static_ztp_DeviceDeletionResult_descriptor;
           }
     
           @java.lang.Override
           protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
               internalGetFieldAccessorTable() {
    -        return automation.Automation.internal_static_automation_DeviceDeletionResult_fieldAccessorTable
    +        return ztp.Ztp.internal_static_ztp_DeviceDeletionResult_fieldAccessorTable
                 .ensureFieldAccessorsInitialized(
    -                automation.Automation.DeviceDeletionResult.class, automation.Automation.DeviceDeletionResult.Builder.class);
    +                ztp.Ztp.DeviceDeletionResult.class, ztp.Ztp.DeviceDeletionResult.Builder.class);
           }
     
    -      // Construct using automation.Automation.DeviceDeletionResult.newBuilder()
    +      // Construct using ztp.Ztp.DeviceDeletionResult.newBuilder()
           private Builder() {
             maybeForceBuilderInitialization();
           }
    @@ -4525,17 +4525,17 @@ public final class Automation {
           @java.lang.Override
           public com.google.protobuf.Descriptors.Descriptor
               getDescriptorForType() {
    -        return automation.Automation.internal_static_automation_DeviceDeletionResult_descriptor;
    +        return ztp.Ztp.internal_static_ztp_DeviceDeletionResult_descriptor;
           }
     
           @java.lang.Override
    -      public automation.Automation.DeviceDeletionResult getDefaultInstanceForType() {
    -        return automation.Automation.DeviceDeletionResult.getDefaultInstance();
    +      public ztp.Ztp.DeviceDeletionResult getDefaultInstanceForType() {
    +        return ztp.Ztp.DeviceDeletionResult.getDefaultInstance();
           }
     
           @java.lang.Override
    -      public automation.Automation.DeviceDeletionResult build() {
    -        automation.Automation.DeviceDeletionResult result = buildPartial();
    +      public ztp.Ztp.DeviceDeletionResult build() {
    +        ztp.Ztp.DeviceDeletionResult result = buildPartial();
             if (!result.isInitialized()) {
               throw newUninitializedMessageException(result);
             }
    @@ -4543,8 +4543,8 @@ public final class Automation {
           }
     
           @java.lang.Override
    -      public automation.Automation.DeviceDeletionResult buildPartial() {
    -        automation.Automation.DeviceDeletionResult result = new automation.Automation.DeviceDeletionResult(this);
    +      public ztp.Ztp.DeviceDeletionResult buildPartial() {
    +        ztp.Ztp.DeviceDeletionResult result = new ztp.Ztp.DeviceDeletionResult(this);
             int from_bitField0_ = bitField0_;
             if (((bitField0_ & 0x00000001) != 0)) {
               deleted_ = deleted_.getUnmodifiableView();
    @@ -4589,16 +4589,16 @@ public final class Automation {
           }
           @java.lang.Override
           public Builder mergeFrom(com.google.protobuf.Message other) {
    -        if (other instanceof automation.Automation.DeviceDeletionResult) {
    -          return mergeFrom((automation.Automation.DeviceDeletionResult)other);
    +        if (other instanceof ztp.Ztp.DeviceDeletionResult) {
    +          return mergeFrom((ztp.Ztp.DeviceDeletionResult)other);
             } else {
               super.mergeFrom(other);
               return this;
             }
           }
     
    -      public Builder mergeFrom(automation.Automation.DeviceDeletionResult other) {
    -        if (other == automation.Automation.DeviceDeletionResult.getDefaultInstance()) return this;
    +      public Builder mergeFrom(ztp.Ztp.DeviceDeletionResult other) {
    +        if (other == ztp.Ztp.DeviceDeletionResult.getDefaultInstance()) return this;
             if (!other.deleted_.isEmpty()) {
               if (deleted_.isEmpty()) {
                 deleted_ = other.deleted_;
    @@ -4624,11 +4624,11 @@ public final class Automation {
               com.google.protobuf.CodedInputStream input,
               com.google.protobuf.ExtensionRegistryLite extensionRegistry)
               throws java.io.IOException {
    -        automation.Automation.DeviceDeletionResult parsedMessage = null;
    +        ztp.Ztp.DeviceDeletionResult parsedMessage = null;
             try {
               parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
             } catch (com.google.protobuf.InvalidProtocolBufferException e) {
    -          parsedMessage = (automation.Automation.DeviceDeletionResult) e.getUnfinishedMessage();
    +          parsedMessage = (ztp.Ztp.DeviceDeletionResult) e.getUnfinishedMessage();
               throw e.unwrapIOException();
             } finally {
               if (parsedMessage != null) {
    @@ -4761,16 +4761,16 @@ public final class Automation {
           }
     
     
    -      // @@protoc_insertion_point(builder_scope:automation.DeviceDeletionResult)
    +      // @@protoc_insertion_point(builder_scope:ztp.DeviceDeletionResult)
         }
     
    -    // @@protoc_insertion_point(class_scope:automation.DeviceDeletionResult)
    -    private static final automation.Automation.DeviceDeletionResult DEFAULT_INSTANCE;
    +    // @@protoc_insertion_point(class_scope:ztp.DeviceDeletionResult)
    +    private static final ztp.Ztp.DeviceDeletionResult DEFAULT_INSTANCE;
         static {
    -      DEFAULT_INSTANCE = new automation.Automation.DeviceDeletionResult();
    +      DEFAULT_INSTANCE = new ztp.Ztp.DeviceDeletionResult();
         }
     
    -    public static automation.Automation.DeviceDeletionResult getDefaultInstance() {
    +    public static ztp.Ztp.DeviceDeletionResult getDefaultInstance() {
           return DEFAULT_INSTANCE;
         }
     
    @@ -4795,42 +4795,42 @@ public final class Automation {
         }
     
         @java.lang.Override
    -    public automation.Automation.DeviceDeletionResult getDefaultInstanceForType() {
    +    public ztp.Ztp.DeviceDeletionResult getDefaultInstanceForType() {
           return DEFAULT_INSTANCE;
         }
     
       }
     
       private static final com.google.protobuf.Descriptors.Descriptor
    -    internal_static_automation_DeviceRoleId_descriptor;
    +    internal_static_ztp_DeviceRoleId_descriptor;
       private static final 
         com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
    -      internal_static_automation_DeviceRoleId_fieldAccessorTable;
    +      internal_static_ztp_DeviceRoleId_fieldAccessorTable;
       private static final com.google.protobuf.Descriptors.Descriptor
    -    internal_static_automation_DeviceRole_descriptor;
    +    internal_static_ztp_DeviceRole_descriptor;
       private static final 
         com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
    -      internal_static_automation_DeviceRole_fieldAccessorTable;
    +      internal_static_ztp_DeviceRole_fieldAccessorTable;
       private static final com.google.protobuf.Descriptors.Descriptor
    -    internal_static_automation_DeviceRoleConfig_descriptor;
    +    internal_static_ztp_DeviceRoleConfig_descriptor;
       private static final 
         com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
    -      internal_static_automation_DeviceRoleConfig_fieldAccessorTable;
    +      internal_static_ztp_DeviceRoleConfig_fieldAccessorTable;
       private static final com.google.protobuf.Descriptors.Descriptor
    -    internal_static_automation_DeviceRoleList_descriptor;
    +    internal_static_ztp_DeviceRoleList_descriptor;
       private static final 
         com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
    -      internal_static_automation_DeviceRoleList_fieldAccessorTable;
    +      internal_static_ztp_DeviceRoleList_fieldAccessorTable;
       private static final com.google.protobuf.Descriptors.Descriptor
    -    internal_static_automation_DeviceRoleState_descriptor;
    +    internal_static_ztp_DeviceRoleState_descriptor;
       private static final 
         com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
    -      internal_static_automation_DeviceRoleState_fieldAccessorTable;
    +      internal_static_ztp_DeviceRoleState_fieldAccessorTable;
       private static final com.google.protobuf.Descriptors.Descriptor
    -    internal_static_automation_DeviceDeletionResult_descriptor;
    +    internal_static_ztp_DeviceDeletionResult_descriptor;
       private static final 
         com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
    -      internal_static_automation_DeviceDeletionResult_fieldAccessorTable;
    +      internal_static_ztp_DeviceDeletionResult_fieldAccessorTable;
     
       public static com.google.protobuf.Descriptors.FileDescriptor
           getDescriptor() {
    @@ -4840,78 +4840,74 @@ public final class Automation {
           descriptor;
       static {
         java.lang.String[] descriptorData = {
    -      "\n\020automation.proto\022\nautomation\032\rcontext." +
    -      "proto\"R\n\014DeviceRoleId\022 \n\tdevRoleId\030\001 \001(\013" +
    -      "2\r.context.Uuid\022 \n\005devId\030\002 \001(\0132\021.context" +
    -      ".DeviceId\"j\n\nDeviceRole\022+\n\tdevRoleId\030\001 \001" +
    -      "(\0132\030.automation.DeviceRoleId\022/\n\013devRoleT" +
    -      "ype\030\002 \001(\0162\032.automation.DeviceRoleType\"e\n" +
    -      "\020DeviceRoleConfig\022\'\n\007devRole\030\001 \001(\0132\026.aut" +
    -      "omation.DeviceRole\022(\n\tdevConfig\030\002 \001(\0132\025." +
    -      "context.DeviceConfig\"9\n\016DeviceRoleList\022\'" +
    -      "\n\007devRole\030\001 \003(\0132\026.automation.DeviceRole\"" +
    -      "p\n\017DeviceRoleState\022+\n\tdevRoleId\030\001 \001(\0132\030." +
    -      "automation.DeviceRoleId\0220\n\014devRoleState\030" +
    -      "\002 \001(\0162\032.automation.ZtpDeviceState\"\'\n\024Dev" +
    -      "iceDeletionResult\022\017\n\007deleted\030\001 \003(\t*H\n\016De" +
    -      "viceRoleType\022\010\n\004NONE\020\000\022\013\n\007DEV_OPS\020\001\022\014\n\010D" +
    -      "EV_CONF\020\002\022\021\n\rPIPELINE_CONF\020\003*~\n\016ZtpDevic" +
    -      "eState\022\033\n\027ZTP_DEV_STATE_UNDEFINED\020\000\022\031\n\025Z" +
    -      "TP_DEV_STATE_CREATED\020\001\022\031\n\025ZTP_DEV_STATE_" +
    -      "UPDATED\020\002\022\031\n\025ZTP_DEV_STATE_DELETED\020\0032\276\003\n" +
    -      "\021AutomationService\022F\n\020ZtpGetDeviceRole\022\030" +
    -      ".automation.DeviceRoleId\032\026.automation.De" +
    -      "viceRole\"\000\022N\n\033ZtpGetDeviceRolesByDeviceI" +
    -      "d\022\021.context.DeviceId\032\032.automation.Device" +
    -      "RoleList\"\000\022?\n\006ZtpAdd\022\026.automation.Device" +
    -      "Role\032\033.automation.DeviceRoleState\"\000\022H\n\tZ" +
    -      "tpUpdate\022\034.automation.DeviceRoleConfig\032\033" +
    -      ".automation.DeviceRoleState\"\000\022B\n\tZtpDele" +
    -      "te\022\026.automation.DeviceRole\032\033.automation." +
    -      "DeviceRoleState\"\000\022B\n\014ZtpDeleteAll\022\016.cont" +
    -      "ext.Empty\032 .automation.DeviceDeletionRes" +
    -      "ult\"\000b\006proto3"
    +      "\n\tztp.proto\022\003ztp\032\rcontext.proto\"R\n\014Devic" +
    +      "eRoleId\022 \n\tdevRoleId\030\001 \001(\0132\r.context.Uui" +
    +      "d\022 \n\005devId\030\002 \001(\0132\021.context.DeviceId\"\\\n\nD" +
    +      "eviceRole\022$\n\tdevRoleId\030\001 \001(\0132\021.ztp.Devic" +
    +      "eRoleId\022(\n\013devRoleType\030\002 \001(\0162\023.ztp.Devic" +
    +      "eRoleType\"^\n\020DeviceRoleConfig\022 \n\007devRole" +
    +      "\030\001 \001(\0132\017.ztp.DeviceRole\022(\n\tdevConfig\030\002 \001" +
    +      "(\0132\025.context.DeviceConfig\"2\n\016DeviceRoleL" +
    +      "ist\022 \n\007devRole\030\001 \003(\0132\017.ztp.DeviceRole\"b\n" +
    +      "\017DeviceRoleState\022$\n\tdevRoleId\030\001 \001(\0132\021.zt" +
    +      "p.DeviceRoleId\022)\n\014devRoleState\030\002 \001(\0162\023.z" +
    +      "tp.ZtpDeviceState\"\'\n\024DeviceDeletionResul" +
    +      "t\022\017\n\007deleted\030\001 \003(\t*H\n\016DeviceRoleType\022\010\n\004" +
    +      "NONE\020\000\022\013\n\007DEV_OPS\020\001\022\014\n\010DEV_CONF\020\002\022\021\n\rPIP" +
    +      "ELINE_CONF\020\003*~\n\016ZtpDeviceState\022\033\n\027ZTP_DE" +
    +      "V_STATE_UNDEFINED\020\000\022\031\n\025ZTP_DEV_STATE_CRE" +
    +      "ATED\020\001\022\031\n\025ZTP_DEV_STATE_UPDATED\020\002\022\031\n\025ZTP" +
    +      "_DEV_STATE_DELETED\020\0032\361\002\n\nZtpService\0228\n\020Z" +
    +      "tpGetDeviceRole\022\021.ztp.DeviceRoleId\032\017.ztp" +
    +      ".DeviceRole\"\000\022G\n\033ZtpGetDeviceRolesByDevi" +
    +      "ceId\022\021.context.DeviceId\032\023.ztp.DeviceRole" +
    +      "List\"\000\0221\n\006ZtpAdd\022\017.ztp.DeviceRole\032\024.ztp." +
    +      "DeviceRoleState\"\000\022:\n\tZtpUpdate\022\025.ztp.Dev" +
    +      "iceRoleConfig\032\024.ztp.DeviceRoleState\"\000\0224\n" +
    +      "\tZtpDelete\022\017.ztp.DeviceRole\032\024.ztp.Device" +
    +      "RoleState\"\000\022;\n\014ZtpDeleteAll\022\016.context.Em" +
    +      "pty\032\031.ztp.DeviceDeletionResult\"\000b\006proto3"
         };
         descriptor = com.google.protobuf.Descriptors.FileDescriptor
           .internalBuildGeneratedFileFrom(descriptorData,
             new com.google.protobuf.Descriptors.FileDescriptor[] {
               context.ContextOuterClass.getDescriptor(),
             });
    -    internal_static_automation_DeviceRoleId_descriptor =
    +    internal_static_ztp_DeviceRoleId_descriptor =
           getDescriptor().getMessageTypes().get(0);
    -    internal_static_automation_DeviceRoleId_fieldAccessorTable = new
    +    internal_static_ztp_DeviceRoleId_fieldAccessorTable = new
           com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
    -        internal_static_automation_DeviceRoleId_descriptor,
    +        internal_static_ztp_DeviceRoleId_descriptor,
             new java.lang.String[] { "DevRoleId", "DevId", });
    -    internal_static_automation_DeviceRole_descriptor =
    +    internal_static_ztp_DeviceRole_descriptor =
           getDescriptor().getMessageTypes().get(1);
    -    internal_static_automation_DeviceRole_fieldAccessorTable = new
    +    internal_static_ztp_DeviceRole_fieldAccessorTable = new
           com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
    -        internal_static_automation_DeviceRole_descriptor,
    +        internal_static_ztp_DeviceRole_descriptor,
             new java.lang.String[] { "DevRoleId", "DevRoleType", });
    -    internal_static_automation_DeviceRoleConfig_descriptor =
    +    internal_static_ztp_DeviceRoleConfig_descriptor =
           getDescriptor().getMessageTypes().get(2);
    -    internal_static_automation_DeviceRoleConfig_fieldAccessorTable = new
    +    internal_static_ztp_DeviceRoleConfig_fieldAccessorTable = new
           com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
    -        internal_static_automation_DeviceRoleConfig_descriptor,
    +        internal_static_ztp_DeviceRoleConfig_descriptor,
             new java.lang.String[] { "DevRole", "DevConfig", });
    -    internal_static_automation_DeviceRoleList_descriptor =
    +    internal_static_ztp_DeviceRoleList_descriptor =
           getDescriptor().getMessageTypes().get(3);
    -    internal_static_automation_DeviceRoleList_fieldAccessorTable = new
    +    internal_static_ztp_DeviceRoleList_fieldAccessorTable = new
           com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
    -        internal_static_automation_DeviceRoleList_descriptor,
    +        internal_static_ztp_DeviceRoleList_descriptor,
             new java.lang.String[] { "DevRole", });
    -    internal_static_automation_DeviceRoleState_descriptor =
    +    internal_static_ztp_DeviceRoleState_descriptor =
           getDescriptor().getMessageTypes().get(4);
    -    internal_static_automation_DeviceRoleState_fieldAccessorTable = new
    +    internal_static_ztp_DeviceRoleState_fieldAccessorTable = new
           com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
    -        internal_static_automation_DeviceRoleState_descriptor,
    +        internal_static_ztp_DeviceRoleState_descriptor,
             new java.lang.String[] { "DevRoleId", "DevRoleState", });
    -    internal_static_automation_DeviceDeletionResult_descriptor =
    +    internal_static_ztp_DeviceDeletionResult_descriptor =
           getDescriptor().getMessageTypes().get(5);
    -    internal_static_automation_DeviceDeletionResult_fieldAccessorTable = new
    +    internal_static_ztp_DeviceDeletionResult_fieldAccessorTable = new
           com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
    -        internal_static_automation_DeviceDeletionResult_descriptor,
    +        internal_static_ztp_DeviceDeletionResult_descriptor,
             new java.lang.String[] { "Deleted", });
         context.ContextOuterClass.getDescriptor();
       }
    diff --git a/src/ztp/target/generated-sources/grpc/ztp/ZtpService.java b/src/ztp/target/generated-sources/grpc/ztp/ZtpService.java
    new file mode 100644
    index 0000000000000000000000000000000000000000..6afcf457f919db71fa465a903a7afc52900c2ad0
    --- /dev/null
    +++ b/src/ztp/target/generated-sources/grpc/ztp/ZtpService.java
    @@ -0,0 +1,26 @@
    +package ztp;
    +
    +import io.quarkus.grpc.runtime.MutinyService;
    +
    +@javax.annotation.Generated(
    +value = "by Mutiny Grpc generator",
    +comments = "Source: ztp.proto")
    +public interface ZtpService extends MutinyService {
    +
    +    
    +    io.smallrye.mutiny.Uni ztpGetDeviceRole(ztp.Ztp.DeviceRoleId request);
    +    
    +    io.smallrye.mutiny.Uni ztpGetDeviceRolesByDeviceId(context.ContextOuterClass.DeviceId request);
    +    
    +    io.smallrye.mutiny.Uni ztpAdd(ztp.Ztp.DeviceRole request);
    +    
    +    io.smallrye.mutiny.Uni ztpUpdate(ztp.Ztp.DeviceRoleConfig request);
    +    
    +    io.smallrye.mutiny.Uni ztpDelete(ztp.Ztp.DeviceRole request);
    +    
    +    io.smallrye.mutiny.Uni ztpDeleteAll(context.ContextOuterClass.Empty request);
    +    
    +    
    +    
    +
    +}
    \ No newline at end of file
    diff --git a/src/automation/target/generated-sources/grpc/automation/AutomationServiceBean.java b/src/ztp/target/generated-sources/grpc/ztp/ZtpServiceBean.java
    similarity index 58%
    rename from src/automation/target/generated-sources/grpc/automation/AutomationServiceBean.java
    rename to src/ztp/target/generated-sources/grpc/ztp/ZtpServiceBean.java
    index 3c7923a0ce8a1501689d1bb567c915590376cf5f..bc15903127c9ee837e991f9b75a389b684ec568c 100644
    --- a/src/automation/target/generated-sources/grpc/automation/AutomationServiceBean.java
    +++ b/src/ztp/target/generated-sources/grpc/ztp/ZtpServiceBean.java
    @@ -1,4 +1,4 @@
    -package automation;
    +package ztp;
     
     import io.grpc.BindableService;
     import io.quarkus.grpc.GrpcService;
    @@ -6,17 +6,17 @@ import io.quarkus.grpc.runtime.MutinyBean;
     
     @javax.annotation.Generated(
     value = "by Mutiny Grpc generator",
    -comments = "Source: automation.proto")
    -public class AutomationServiceBean extends MutinyAutomationServiceGrpc.AutomationServiceImplBase implements BindableService, MutinyBean {
    +comments = "Source: ztp.proto")
    +public class ZtpServiceBean extends MutinyZtpServiceGrpc.ZtpServiceImplBase implements BindableService, MutinyBean {
     
    -    private final AutomationService delegate;
    +    private final ZtpService delegate;
     
    -    AutomationServiceBean(@GrpcService AutomationService delegate) {
    +    ZtpServiceBean(@GrpcService ZtpService delegate) {
            this.delegate = delegate;
         }
     
         @Override
    -    public io.smallrye.mutiny.Uni ztpGetDeviceRole(automation.Automation.DeviceRoleId request) {
    +    public io.smallrye.mutiny.Uni ztpGetDeviceRole(ztp.Ztp.DeviceRoleId request) {
            try {
              return delegate.ztpGetDeviceRole(request);
            } catch (UnsupportedOperationException e) {
    @@ -24,7 +24,7 @@ public class AutomationServiceBean extends MutinyAutomationServiceGrpc.Automatio
            }
         }
         @Override
    -    public io.smallrye.mutiny.Uni ztpGetDeviceRolesByDeviceId(context.ContextOuterClass.DeviceId request) {
    +    public io.smallrye.mutiny.Uni ztpGetDeviceRolesByDeviceId(context.ContextOuterClass.DeviceId request) {
            try {
              return delegate.ztpGetDeviceRolesByDeviceId(request);
            } catch (UnsupportedOperationException e) {
    @@ -32,7 +32,7 @@ public class AutomationServiceBean extends MutinyAutomationServiceGrpc.Automatio
            }
         }
         @Override
    -    public io.smallrye.mutiny.Uni ztpAdd(automation.Automation.DeviceRole request) {
    +    public io.smallrye.mutiny.Uni ztpAdd(ztp.Ztp.DeviceRole request) {
            try {
              return delegate.ztpAdd(request);
            } catch (UnsupportedOperationException e) {
    @@ -40,7 +40,7 @@ public class AutomationServiceBean extends MutinyAutomationServiceGrpc.Automatio
            }
         }
         @Override
    -    public io.smallrye.mutiny.Uni ztpUpdate(automation.Automation.DeviceRoleConfig request) {
    +    public io.smallrye.mutiny.Uni ztpUpdate(ztp.Ztp.DeviceRoleConfig request) {
            try {
              return delegate.ztpUpdate(request);
            } catch (UnsupportedOperationException e) {
    @@ -48,7 +48,7 @@ public class AutomationServiceBean extends MutinyAutomationServiceGrpc.Automatio
            }
         }
         @Override
    -    public io.smallrye.mutiny.Uni ztpDelete(automation.Automation.DeviceRole request) {
    +    public io.smallrye.mutiny.Uni ztpDelete(ztp.Ztp.DeviceRole request) {
            try {
              return delegate.ztpDelete(request);
            } catch (UnsupportedOperationException e) {
    @@ -56,7 +56,7 @@ public class AutomationServiceBean extends MutinyAutomationServiceGrpc.Automatio
            }
         }
         @Override
    -    public io.smallrye.mutiny.Uni ztpDeleteAll(context.ContextOuterClass.Empty request) {
    +    public io.smallrye.mutiny.Uni ztpDeleteAll(context.ContextOuterClass.Empty request) {
            try {
              return delegate.ztpDeleteAll(request);
            } catch (UnsupportedOperationException e) {
    diff --git a/src/ztp/target/generated-sources/grpc/ztp/ZtpServiceClient.java b/src/ztp/target/generated-sources/grpc/ztp/ZtpServiceClient.java
    new file mode 100644
    index 0000000000000000000000000000000000000000..00abbc181d46f0df5588023c8da29786a73ae965
    --- /dev/null
    +++ b/src/ztp/target/generated-sources/grpc/ztp/ZtpServiceClient.java
    @@ -0,0 +1,48 @@
    +package ztp;
    +
    +import java.util.function.BiFunction;
    +
    +import io.quarkus.grpc.runtime.MutinyClient;
    +
    +@javax.annotation.Generated(
    +value = "by Mutiny Grpc generator",
    +comments = "Source: ztp.proto")
    +public class ZtpServiceClient implements ZtpService, MutinyClient {
    +
    +    private final MutinyZtpServiceGrpc.MutinyZtpServiceStub stub;
    +
    +    public ZtpServiceClient(String name, io.grpc.Channel channel, BiFunction stubConfigurator) {
    +       this.stub = stubConfigurator.apply(name,MutinyZtpServiceGrpc.newMutinyStub(channel));
    +    }
    +
    +    @Override
    +    public MutinyZtpServiceGrpc.MutinyZtpServiceStub getStub() {
    +       return stub;
    +    }
    +
    +    @Override
    +    public io.smallrye.mutiny.Uni ztpGetDeviceRole(ztp.Ztp.DeviceRoleId request) {
    +       return stub.ztpGetDeviceRole(request);
    +    }
    +    @Override
    +    public io.smallrye.mutiny.Uni ztpGetDeviceRolesByDeviceId(context.ContextOuterClass.DeviceId request) {
    +       return stub.ztpGetDeviceRolesByDeviceId(request);
    +    }
    +    @Override
    +    public io.smallrye.mutiny.Uni ztpAdd(ztp.Ztp.DeviceRole request) {
    +       return stub.ztpAdd(request);
    +    }
    +    @Override
    +    public io.smallrye.mutiny.Uni ztpUpdate(ztp.Ztp.DeviceRoleConfig request) {
    +       return stub.ztpUpdate(request);
    +    }
    +    @Override
    +    public io.smallrye.mutiny.Uni ztpDelete(ztp.Ztp.DeviceRole request) {
    +       return stub.ztpDelete(request);
    +    }
    +    @Override
    +    public io.smallrye.mutiny.Uni ztpDeleteAll(context.ContextOuterClass.Empty request) {
    +       return stub.ztpDeleteAll(request);
    +    }
    +
    +}
    \ No newline at end of file
    diff --git a/src/ztp/target/generated-sources/grpc/ztp/ZtpServiceGrpc.java b/src/ztp/target/generated-sources/grpc/ztp/ZtpServiceGrpc.java
    new file mode 100644
    index 0000000000000000000000000000000000000000..ece33078b8058c2d63ddca4060b1b095d21dd8be
    --- /dev/null
    +++ b/src/ztp/target/generated-sources/grpc/ztp/ZtpServiceGrpc.java
    @@ -0,0 +1,645 @@
    +package ztp;
    +
    +import static io.grpc.MethodDescriptor.generateFullMethodName;
    +
    +/**
    + */
    +@javax.annotation.Generated(
    +    value = "by gRPC proto compiler (version 1.38.1)",
    +    comments = "Source: ztp.proto")
    +public final class ZtpServiceGrpc {
    +
    +  private ZtpServiceGrpc() {}
    +
    +  public static final String SERVICE_NAME = "ztp.ZtpService";
    +
    +  // Static method descriptors that strictly reflect the proto.
    +  private static volatile io.grpc.MethodDescriptor getZtpGetDeviceRoleMethod;
    +
    +  @io.grpc.stub.annotations.RpcMethod(
    +      fullMethodName = SERVICE_NAME + '/' + "ZtpGetDeviceRole",
    +      requestType = ztp.Ztp.DeviceRoleId.class,
    +      responseType = ztp.Ztp.DeviceRole.class,
    +      methodType = io.grpc.MethodDescriptor.MethodType.UNARY)
    +  public static io.grpc.MethodDescriptor getZtpGetDeviceRoleMethod() {
    +    io.grpc.MethodDescriptor getZtpGetDeviceRoleMethod;
    +    if ((getZtpGetDeviceRoleMethod = ZtpServiceGrpc.getZtpGetDeviceRoleMethod) == null) {
    +      synchronized (ZtpServiceGrpc.class) {
    +        if ((getZtpGetDeviceRoleMethod = ZtpServiceGrpc.getZtpGetDeviceRoleMethod) == null) {
    +          ZtpServiceGrpc.getZtpGetDeviceRoleMethod = getZtpGetDeviceRoleMethod =
    +              io.grpc.MethodDescriptor.newBuilder()
    +              .setType(io.grpc.MethodDescriptor.MethodType.UNARY)
    +              .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ZtpGetDeviceRole"))
    +              .setSampledToLocalTracing(true)
    +              .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
    +                  ztp.Ztp.DeviceRoleId.getDefaultInstance()))
    +              .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
    +                  ztp.Ztp.DeviceRole.getDefaultInstance()))
    +              .setSchemaDescriptor(new ZtpServiceMethodDescriptorSupplier("ZtpGetDeviceRole"))
    +              .build();
    +        }
    +      }
    +    }
    +    return getZtpGetDeviceRoleMethod;
    +  }
    +
    +  private static volatile io.grpc.MethodDescriptor getZtpGetDeviceRolesByDeviceIdMethod;
    +
    +  @io.grpc.stub.annotations.RpcMethod(
    +      fullMethodName = SERVICE_NAME + '/' + "ZtpGetDeviceRolesByDeviceId",
    +      requestType = context.ContextOuterClass.DeviceId.class,
    +      responseType = ztp.Ztp.DeviceRoleList.class,
    +      methodType = io.grpc.MethodDescriptor.MethodType.UNARY)
    +  public static io.grpc.MethodDescriptor getZtpGetDeviceRolesByDeviceIdMethod() {
    +    io.grpc.MethodDescriptor getZtpGetDeviceRolesByDeviceIdMethod;
    +    if ((getZtpGetDeviceRolesByDeviceIdMethod = ZtpServiceGrpc.getZtpGetDeviceRolesByDeviceIdMethod) == null) {
    +      synchronized (ZtpServiceGrpc.class) {
    +        if ((getZtpGetDeviceRolesByDeviceIdMethod = ZtpServiceGrpc.getZtpGetDeviceRolesByDeviceIdMethod) == null) {
    +          ZtpServiceGrpc.getZtpGetDeviceRolesByDeviceIdMethod = getZtpGetDeviceRolesByDeviceIdMethod =
    +              io.grpc.MethodDescriptor.newBuilder()
    +              .setType(io.grpc.MethodDescriptor.MethodType.UNARY)
    +              .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ZtpGetDeviceRolesByDeviceId"))
    +              .setSampledToLocalTracing(true)
    +              .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
    +                  context.ContextOuterClass.DeviceId.getDefaultInstance()))
    +              .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
    +                  ztp.Ztp.DeviceRoleList.getDefaultInstance()))
    +              .setSchemaDescriptor(new ZtpServiceMethodDescriptorSupplier("ZtpGetDeviceRolesByDeviceId"))
    +              .build();
    +        }
    +      }
    +    }
    +    return getZtpGetDeviceRolesByDeviceIdMethod;
    +  }
    +
    +  private static volatile io.grpc.MethodDescriptor getZtpAddMethod;
    +
    +  @io.grpc.stub.annotations.RpcMethod(
    +      fullMethodName = SERVICE_NAME + '/' + "ZtpAdd",
    +      requestType = ztp.Ztp.DeviceRole.class,
    +      responseType = ztp.Ztp.DeviceRoleState.class,
    +      methodType = io.grpc.MethodDescriptor.MethodType.UNARY)
    +  public static io.grpc.MethodDescriptor getZtpAddMethod() {
    +    io.grpc.MethodDescriptor getZtpAddMethod;
    +    if ((getZtpAddMethod = ZtpServiceGrpc.getZtpAddMethod) == null) {
    +      synchronized (ZtpServiceGrpc.class) {
    +        if ((getZtpAddMethod = ZtpServiceGrpc.getZtpAddMethod) == null) {
    +          ZtpServiceGrpc.getZtpAddMethod = getZtpAddMethod =
    +              io.grpc.MethodDescriptor.newBuilder()
    +              .setType(io.grpc.MethodDescriptor.MethodType.UNARY)
    +              .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ZtpAdd"))
    +              .setSampledToLocalTracing(true)
    +              .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
    +                  ztp.Ztp.DeviceRole.getDefaultInstance()))
    +              .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
    +                  ztp.Ztp.DeviceRoleState.getDefaultInstance()))
    +              .setSchemaDescriptor(new ZtpServiceMethodDescriptorSupplier("ZtpAdd"))
    +              .build();
    +        }
    +      }
    +    }
    +    return getZtpAddMethod;
    +  }
    +
    +  private static volatile io.grpc.MethodDescriptor getZtpUpdateMethod;
    +
    +  @io.grpc.stub.annotations.RpcMethod(
    +      fullMethodName = SERVICE_NAME + '/' + "ZtpUpdate",
    +      requestType = ztp.Ztp.DeviceRoleConfig.class,
    +      responseType = ztp.Ztp.DeviceRoleState.class,
    +      methodType = io.grpc.MethodDescriptor.MethodType.UNARY)
    +  public static io.grpc.MethodDescriptor getZtpUpdateMethod() {
    +    io.grpc.MethodDescriptor getZtpUpdateMethod;
    +    if ((getZtpUpdateMethod = ZtpServiceGrpc.getZtpUpdateMethod) == null) {
    +      synchronized (ZtpServiceGrpc.class) {
    +        if ((getZtpUpdateMethod = ZtpServiceGrpc.getZtpUpdateMethod) == null) {
    +          ZtpServiceGrpc.getZtpUpdateMethod = getZtpUpdateMethod =
    +              io.grpc.MethodDescriptor.newBuilder()
    +              .setType(io.grpc.MethodDescriptor.MethodType.UNARY)
    +              .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ZtpUpdate"))
    +              .setSampledToLocalTracing(true)
    +              .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
    +                  ztp.Ztp.DeviceRoleConfig.getDefaultInstance()))
    +              .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
    +                  ztp.Ztp.DeviceRoleState.getDefaultInstance()))
    +              .setSchemaDescriptor(new ZtpServiceMethodDescriptorSupplier("ZtpUpdate"))
    +              .build();
    +        }
    +      }
    +    }
    +    return getZtpUpdateMethod;
    +  }
    +
    +  private static volatile io.grpc.MethodDescriptor getZtpDeleteMethod;
    +
    +  @io.grpc.stub.annotations.RpcMethod(
    +      fullMethodName = SERVICE_NAME + '/' + "ZtpDelete",
    +      requestType = ztp.Ztp.DeviceRole.class,
    +      responseType = ztp.Ztp.DeviceRoleState.class,
    +      methodType = io.grpc.MethodDescriptor.MethodType.UNARY)
    +  public static io.grpc.MethodDescriptor getZtpDeleteMethod() {
    +    io.grpc.MethodDescriptor getZtpDeleteMethod;
    +    if ((getZtpDeleteMethod = ZtpServiceGrpc.getZtpDeleteMethod) == null) {
    +      synchronized (ZtpServiceGrpc.class) {
    +        if ((getZtpDeleteMethod = ZtpServiceGrpc.getZtpDeleteMethod) == null) {
    +          ZtpServiceGrpc.getZtpDeleteMethod = getZtpDeleteMethod =
    +              io.grpc.MethodDescriptor.newBuilder()
    +              .setType(io.grpc.MethodDescriptor.MethodType.UNARY)
    +              .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ZtpDelete"))
    +              .setSampledToLocalTracing(true)
    +              .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
    +                  ztp.Ztp.DeviceRole.getDefaultInstance()))
    +              .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
    +                  ztp.Ztp.DeviceRoleState.getDefaultInstance()))
    +              .setSchemaDescriptor(new ZtpServiceMethodDescriptorSupplier("ZtpDelete"))
    +              .build();
    +        }
    +      }
    +    }
    +    return getZtpDeleteMethod;
    +  }
    +
    +  private static volatile io.grpc.MethodDescriptor getZtpDeleteAllMethod;
    +
    +  @io.grpc.stub.annotations.RpcMethod(
    +      fullMethodName = SERVICE_NAME + '/' + "ZtpDeleteAll",
    +      requestType = context.ContextOuterClass.Empty.class,
    +      responseType = ztp.Ztp.DeviceDeletionResult.class,
    +      methodType = io.grpc.MethodDescriptor.MethodType.UNARY)
    +  public static io.grpc.MethodDescriptor getZtpDeleteAllMethod() {
    +    io.grpc.MethodDescriptor getZtpDeleteAllMethod;
    +    if ((getZtpDeleteAllMethod = ZtpServiceGrpc.getZtpDeleteAllMethod) == null) {
    +      synchronized (ZtpServiceGrpc.class) {
    +        if ((getZtpDeleteAllMethod = ZtpServiceGrpc.getZtpDeleteAllMethod) == null) {
    +          ZtpServiceGrpc.getZtpDeleteAllMethod = getZtpDeleteAllMethod =
    +              io.grpc.MethodDescriptor.newBuilder()
    +              .setType(io.grpc.MethodDescriptor.MethodType.UNARY)
    +              .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ZtpDeleteAll"))
    +              .setSampledToLocalTracing(true)
    +              .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
    +                  context.ContextOuterClass.Empty.getDefaultInstance()))
    +              .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
    +                  ztp.Ztp.DeviceDeletionResult.getDefaultInstance()))
    +              .setSchemaDescriptor(new ZtpServiceMethodDescriptorSupplier("ZtpDeleteAll"))
    +              .build();
    +        }
    +      }
    +    }
    +    return getZtpDeleteAllMethod;
    +  }
    +
    +  /**
    +   * Creates a new async stub that supports all call types for the service
    +   */
    +  public static ZtpServiceStub newStub(io.grpc.Channel channel) {
    +    io.grpc.stub.AbstractStub.StubFactory factory =
    +      new io.grpc.stub.AbstractStub.StubFactory() {
    +        @java.lang.Override
    +        public ZtpServiceStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
    +          return new ZtpServiceStub(channel, callOptions);
    +        }
    +      };
    +    return ZtpServiceStub.newStub(factory, channel);
    +  }
    +
    +  /**
    +   * Creates a new blocking-style stub that supports unary and streaming output calls on the service
    +   */
    +  public static ZtpServiceBlockingStub newBlockingStub(
    +      io.grpc.Channel channel) {
    +    io.grpc.stub.AbstractStub.StubFactory factory =
    +      new io.grpc.stub.AbstractStub.StubFactory() {
    +        @java.lang.Override
    +        public ZtpServiceBlockingStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
    +          return new ZtpServiceBlockingStub(channel, callOptions);
    +        }
    +      };
    +    return ZtpServiceBlockingStub.newStub(factory, channel);
    +  }
    +
    +  /**
    +   * Creates a new ListenableFuture-style stub that supports unary calls on the service
    +   */
    +  public static ZtpServiceFutureStub newFutureStub(
    +      io.grpc.Channel channel) {
    +    io.grpc.stub.AbstractStub.StubFactory factory =
    +      new io.grpc.stub.AbstractStub.StubFactory() {
    +        @java.lang.Override
    +        public ZtpServiceFutureStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
    +          return new ZtpServiceFutureStub(channel, callOptions);
    +        }
    +      };
    +    return ZtpServiceFutureStub.newStub(factory, channel);
    +  }
    +
    +  /**
    +   */
    +  public static abstract class ZtpServiceImplBase implements io.grpc.BindableService {
    +
    +    /**
    +     */
    +    public void ztpGetDeviceRole(ztp.Ztp.DeviceRoleId request,
    +        io.grpc.stub.StreamObserver responseObserver) {
    +      io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getZtpGetDeviceRoleMethod(), responseObserver);
    +    }
    +
    +    /**
    +     */
    +    public void ztpGetDeviceRolesByDeviceId(context.ContextOuterClass.DeviceId request,
    +        io.grpc.stub.StreamObserver responseObserver) {
    +      io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getZtpGetDeviceRolesByDeviceIdMethod(), responseObserver);
    +    }
    +
    +    /**
    +     */
    +    public void ztpAdd(ztp.Ztp.DeviceRole request,
    +        io.grpc.stub.StreamObserver responseObserver) {
    +      io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getZtpAddMethod(), responseObserver);
    +    }
    +
    +    /**
    +     */
    +    public void ztpUpdate(ztp.Ztp.DeviceRoleConfig request,
    +        io.grpc.stub.StreamObserver responseObserver) {
    +      io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getZtpUpdateMethod(), responseObserver);
    +    }
    +
    +    /**
    +     */
    +    public void ztpDelete(ztp.Ztp.DeviceRole request,
    +        io.grpc.stub.StreamObserver responseObserver) {
    +      io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getZtpDeleteMethod(), responseObserver);
    +    }
    +
    +    /**
    +     */
    +    public void ztpDeleteAll(context.ContextOuterClass.Empty request,
    +        io.grpc.stub.StreamObserver responseObserver) {
    +      io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getZtpDeleteAllMethod(), responseObserver);
    +    }
    +
    +    @java.lang.Override public final io.grpc.ServerServiceDefinition bindService() {
    +      return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor())
    +          .addMethod(
    +            getZtpGetDeviceRoleMethod(),
    +            io.grpc.stub.ServerCalls.asyncUnaryCall(
    +              new MethodHandlers<
    +                ztp.Ztp.DeviceRoleId,
    +                ztp.Ztp.DeviceRole>(
    +                  this, METHODID_ZTP_GET_DEVICE_ROLE)))
    +          .addMethod(
    +            getZtpGetDeviceRolesByDeviceIdMethod(),
    +            io.grpc.stub.ServerCalls.asyncUnaryCall(
    +              new MethodHandlers<
    +                context.ContextOuterClass.DeviceId,
    +                ztp.Ztp.DeviceRoleList>(
    +                  this, METHODID_ZTP_GET_DEVICE_ROLES_BY_DEVICE_ID)))
    +          .addMethod(
    +            getZtpAddMethod(),
    +            io.grpc.stub.ServerCalls.asyncUnaryCall(
    +              new MethodHandlers<
    +                ztp.Ztp.DeviceRole,
    +                ztp.Ztp.DeviceRoleState>(
    +                  this, METHODID_ZTP_ADD)))
    +          .addMethod(
    +            getZtpUpdateMethod(),
    +            io.grpc.stub.ServerCalls.asyncUnaryCall(
    +              new MethodHandlers<
    +                ztp.Ztp.DeviceRoleConfig,
    +                ztp.Ztp.DeviceRoleState>(
    +                  this, METHODID_ZTP_UPDATE)))
    +          .addMethod(
    +            getZtpDeleteMethod(),
    +            io.grpc.stub.ServerCalls.asyncUnaryCall(
    +              new MethodHandlers<
    +                ztp.Ztp.DeviceRole,
    +                ztp.Ztp.DeviceRoleState>(
    +                  this, METHODID_ZTP_DELETE)))
    +          .addMethod(
    +            getZtpDeleteAllMethod(),
    +            io.grpc.stub.ServerCalls.asyncUnaryCall(
    +              new MethodHandlers<
    +                context.ContextOuterClass.Empty,
    +                ztp.Ztp.DeviceDeletionResult>(
    +                  this, METHODID_ZTP_DELETE_ALL)))
    +          .build();
    +    }
    +  }
    +
    +  /**
    +   */
    +  public static final class ZtpServiceStub extends io.grpc.stub.AbstractAsyncStub {
    +    private ZtpServiceStub(
    +        io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
    +      super(channel, callOptions);
    +    }
    +
    +    @java.lang.Override
    +    protected ZtpServiceStub build(
    +        io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
    +      return new ZtpServiceStub(channel, callOptions);
    +    }
    +
    +    /**
    +     */
    +    public void ztpGetDeviceRole(ztp.Ztp.DeviceRoleId request,
    +        io.grpc.stub.StreamObserver responseObserver) {
    +      io.grpc.stub.ClientCalls.asyncUnaryCall(
    +          getChannel().newCall(getZtpGetDeviceRoleMethod(), getCallOptions()), request, responseObserver);
    +    }
    +
    +    /**
    +     */
    +    public void ztpGetDeviceRolesByDeviceId(context.ContextOuterClass.DeviceId request,
    +        io.grpc.stub.StreamObserver responseObserver) {
    +      io.grpc.stub.ClientCalls.asyncUnaryCall(
    +          getChannel().newCall(getZtpGetDeviceRolesByDeviceIdMethod(), getCallOptions()), request, responseObserver);
    +    }
    +
    +    /**
    +     */
    +    public void ztpAdd(ztp.Ztp.DeviceRole request,
    +        io.grpc.stub.StreamObserver responseObserver) {
    +      io.grpc.stub.ClientCalls.asyncUnaryCall(
    +          getChannel().newCall(getZtpAddMethod(), getCallOptions()), request, responseObserver);
    +    }
    +
    +    /**
    +     */
    +    public void ztpUpdate(ztp.Ztp.DeviceRoleConfig request,
    +        io.grpc.stub.StreamObserver responseObserver) {
    +      io.grpc.stub.ClientCalls.asyncUnaryCall(
    +          getChannel().newCall(getZtpUpdateMethod(), getCallOptions()), request, responseObserver);
    +    }
    +
    +    /**
    +     */
    +    public void ztpDelete(ztp.Ztp.DeviceRole request,
    +        io.grpc.stub.StreamObserver responseObserver) {
    +      io.grpc.stub.ClientCalls.asyncUnaryCall(
    +          getChannel().newCall(getZtpDeleteMethod(), getCallOptions()), request, responseObserver);
    +    }
    +
    +    /**
    +     */
    +    public void ztpDeleteAll(context.ContextOuterClass.Empty request,
    +        io.grpc.stub.StreamObserver responseObserver) {
    +      io.grpc.stub.ClientCalls.asyncUnaryCall(
    +          getChannel().newCall(getZtpDeleteAllMethod(), getCallOptions()), request, responseObserver);
    +    }
    +  }
    +
    +  /**
    +   */
    +  public static final class ZtpServiceBlockingStub extends io.grpc.stub.AbstractBlockingStub {
    +    private ZtpServiceBlockingStub(
    +        io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
    +      super(channel, callOptions);
    +    }
    +
    +    @java.lang.Override
    +    protected ZtpServiceBlockingStub build(
    +        io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
    +      return new ZtpServiceBlockingStub(channel, callOptions);
    +    }
    +
    +    /**
    +     */
    +    public ztp.Ztp.DeviceRole ztpGetDeviceRole(ztp.Ztp.DeviceRoleId request) {
    +      return io.grpc.stub.ClientCalls.blockingUnaryCall(
    +          getChannel(), getZtpGetDeviceRoleMethod(), getCallOptions(), request);
    +    }
    +
    +    /**
    +     */
    +    public ztp.Ztp.DeviceRoleList ztpGetDeviceRolesByDeviceId(context.ContextOuterClass.DeviceId request) {
    +      return io.grpc.stub.ClientCalls.blockingUnaryCall(
    +          getChannel(), getZtpGetDeviceRolesByDeviceIdMethod(), getCallOptions(), request);
    +    }
    +
    +    /**
    +     */
    +    public ztp.Ztp.DeviceRoleState ztpAdd(ztp.Ztp.DeviceRole request) {
    +      return io.grpc.stub.ClientCalls.blockingUnaryCall(
    +          getChannel(), getZtpAddMethod(), getCallOptions(), request);
    +    }
    +
    +    /**
    +     */
    +    public ztp.Ztp.DeviceRoleState ztpUpdate(ztp.Ztp.DeviceRoleConfig request) {
    +      return io.grpc.stub.ClientCalls.blockingUnaryCall(
    +          getChannel(), getZtpUpdateMethod(), getCallOptions(), request);
    +    }
    +
    +    /**
    +     */
    +    public ztp.Ztp.DeviceRoleState ztpDelete(ztp.Ztp.DeviceRole request) {
    +      return io.grpc.stub.ClientCalls.blockingUnaryCall(
    +          getChannel(), getZtpDeleteMethod(), getCallOptions(), request);
    +    }
    +
    +    /**
    +     */
    +    public ztp.Ztp.DeviceDeletionResult ztpDeleteAll(context.ContextOuterClass.Empty request) {
    +      return io.grpc.stub.ClientCalls.blockingUnaryCall(
    +          getChannel(), getZtpDeleteAllMethod(), getCallOptions(), request);
    +    }
    +  }
    +
    +  /**
    +   */
    +  public static final class ZtpServiceFutureStub extends io.grpc.stub.AbstractFutureStub {
    +    private ZtpServiceFutureStub(
    +        io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
    +      super(channel, callOptions);
    +    }
    +
    +    @java.lang.Override
    +    protected ZtpServiceFutureStub build(
    +        io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
    +      return new ZtpServiceFutureStub(channel, callOptions);
    +    }
    +
    +    /**
    +     */
    +    public com.google.common.util.concurrent.ListenableFuture ztpGetDeviceRole(
    +        ztp.Ztp.DeviceRoleId request) {
    +      return io.grpc.stub.ClientCalls.futureUnaryCall(
    +          getChannel().newCall(getZtpGetDeviceRoleMethod(), getCallOptions()), request);
    +    }
    +
    +    /**
    +     */
    +    public com.google.common.util.concurrent.ListenableFuture ztpGetDeviceRolesByDeviceId(
    +        context.ContextOuterClass.DeviceId request) {
    +      return io.grpc.stub.ClientCalls.futureUnaryCall(
    +          getChannel().newCall(getZtpGetDeviceRolesByDeviceIdMethod(), getCallOptions()), request);
    +    }
    +
    +    /**
    +     */
    +    public com.google.common.util.concurrent.ListenableFuture ztpAdd(
    +        ztp.Ztp.DeviceRole request) {
    +      return io.grpc.stub.ClientCalls.futureUnaryCall(
    +          getChannel().newCall(getZtpAddMethod(), getCallOptions()), request);
    +    }
    +
    +    /**
    +     */
    +    public com.google.common.util.concurrent.ListenableFuture ztpUpdate(
    +        ztp.Ztp.DeviceRoleConfig request) {
    +      return io.grpc.stub.ClientCalls.futureUnaryCall(
    +          getChannel().newCall(getZtpUpdateMethod(), getCallOptions()), request);
    +    }
    +
    +    /**
    +     */
    +    public com.google.common.util.concurrent.ListenableFuture ztpDelete(
    +        ztp.Ztp.DeviceRole request) {
    +      return io.grpc.stub.ClientCalls.futureUnaryCall(
    +          getChannel().newCall(getZtpDeleteMethod(), getCallOptions()), request);
    +    }
    +
    +    /**
    +     */
    +    public com.google.common.util.concurrent.ListenableFuture ztpDeleteAll(
    +        context.ContextOuterClass.Empty request) {
    +      return io.grpc.stub.ClientCalls.futureUnaryCall(
    +          getChannel().newCall(getZtpDeleteAllMethod(), getCallOptions()), request);
    +    }
    +  }
    +
    +  private static final int METHODID_ZTP_GET_DEVICE_ROLE = 0;
    +  private static final int METHODID_ZTP_GET_DEVICE_ROLES_BY_DEVICE_ID = 1;
    +  private static final int METHODID_ZTP_ADD = 2;
    +  private static final int METHODID_ZTP_UPDATE = 3;
    +  private static final int METHODID_ZTP_DELETE = 4;
    +  private static final int METHODID_ZTP_DELETE_ALL = 5;
    +
    +  private static final class MethodHandlers implements
    +      io.grpc.stub.ServerCalls.UnaryMethod,
    +      io.grpc.stub.ServerCalls.ServerStreamingMethod,
    +      io.grpc.stub.ServerCalls.ClientStreamingMethod,
    +      io.grpc.stub.ServerCalls.BidiStreamingMethod {
    +    private final ZtpServiceImplBase serviceImpl;
    +    private final int methodId;
    +
    +    MethodHandlers(ZtpServiceImplBase serviceImpl, int methodId) {
    +      this.serviceImpl = serviceImpl;
    +      this.methodId = methodId;
    +    }
    +
    +    @java.lang.Override
    +    @java.lang.SuppressWarnings("unchecked")
    +    public void invoke(Req request, io.grpc.stub.StreamObserver responseObserver) {
    +      switch (methodId) {
    +        case METHODID_ZTP_GET_DEVICE_ROLE:
    +          serviceImpl.ztpGetDeviceRole((ztp.Ztp.DeviceRoleId) request,
    +              (io.grpc.stub.StreamObserver) responseObserver);
    +          break;
    +        case METHODID_ZTP_GET_DEVICE_ROLES_BY_DEVICE_ID:
    +          serviceImpl.ztpGetDeviceRolesByDeviceId((context.ContextOuterClass.DeviceId) request,
    +              (io.grpc.stub.StreamObserver) responseObserver);
    +          break;
    +        case METHODID_ZTP_ADD:
    +          serviceImpl.ztpAdd((ztp.Ztp.DeviceRole) request,
    +              (io.grpc.stub.StreamObserver) responseObserver);
    +          break;
    +        case METHODID_ZTP_UPDATE:
    +          serviceImpl.ztpUpdate((ztp.Ztp.DeviceRoleConfig) request,
    +              (io.grpc.stub.StreamObserver) responseObserver);
    +          break;
    +        case METHODID_ZTP_DELETE:
    +          serviceImpl.ztpDelete((ztp.Ztp.DeviceRole) request,
    +              (io.grpc.stub.StreamObserver) responseObserver);
    +          break;
    +        case METHODID_ZTP_DELETE_ALL:
    +          serviceImpl.ztpDeleteAll((context.ContextOuterClass.Empty) request,
    +              (io.grpc.stub.StreamObserver) responseObserver);
    +          break;
    +        default:
    +          throw new AssertionError();
    +      }
    +    }
    +
    +    @java.lang.Override
    +    @java.lang.SuppressWarnings("unchecked")
    +    public io.grpc.stub.StreamObserver invoke(
    +        io.grpc.stub.StreamObserver responseObserver) {
    +      switch (methodId) {
    +        default:
    +          throw new AssertionError();
    +      }
    +    }
    +  }
    +
    +  private static abstract class ZtpServiceBaseDescriptorSupplier
    +      implements io.grpc.protobuf.ProtoFileDescriptorSupplier, io.grpc.protobuf.ProtoServiceDescriptorSupplier {
    +    ZtpServiceBaseDescriptorSupplier() {}
    +
    +    @java.lang.Override
    +    public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() {
    +      return ztp.Ztp.getDescriptor();
    +    }
    +
    +    @java.lang.Override
    +    public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() {
    +      return getFileDescriptor().findServiceByName("ZtpService");
    +    }
    +  }
    +
    +  private static final class ZtpServiceFileDescriptorSupplier
    +      extends ZtpServiceBaseDescriptorSupplier {
    +    ZtpServiceFileDescriptorSupplier() {}
    +  }
    +
    +  private static final class ZtpServiceMethodDescriptorSupplier
    +      extends ZtpServiceBaseDescriptorSupplier
    +      implements io.grpc.protobuf.ProtoMethodDescriptorSupplier {
    +    private final String methodName;
    +
    +    ZtpServiceMethodDescriptorSupplier(String methodName) {
    +      this.methodName = methodName;
    +    }
    +
    +    @java.lang.Override
    +    public com.google.protobuf.Descriptors.MethodDescriptor getMethodDescriptor() {
    +      return getServiceDescriptor().findMethodByName(methodName);
    +    }
    +  }
    +
    +  private static volatile io.grpc.ServiceDescriptor serviceDescriptor;
    +
    +  public static io.grpc.ServiceDescriptor getServiceDescriptor() {
    +    io.grpc.ServiceDescriptor result = serviceDescriptor;
    +    if (result == null) {
    +      synchronized (ZtpServiceGrpc.class) {
    +        result = serviceDescriptor;
    +        if (result == null) {
    +          serviceDescriptor = result = io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME)
    +              .setSchemaDescriptor(new ZtpServiceFileDescriptorSupplier())
    +              .addMethod(getZtpGetDeviceRoleMethod())
    +              .addMethod(getZtpGetDeviceRolesByDeviceIdMethod())
    +              .addMethod(getZtpAddMethod())
    +              .addMethod(getZtpUpdateMethod())
    +              .addMethod(getZtpDeleteMethod())
    +              .addMethod(getZtpDeleteAllMethod())
    +              .build();
    +        }
    +      }
    +    }
    +    return result;
    +  }
    +}
    diff --git a/src/automation/target/kubernetes/kubernetes.yml b/src/ztp/target/kubernetes/kubernetes.yml
    similarity index 58%
    rename from src/automation/target/kubernetes/kubernetes.yml
    rename to src/ztp/target/kubernetes/kubernetes.yml
    index e0dc96c13046e09ae84f2afb4a4bb839c4166a1b..f3e4a6d6dda261c4eac983552b01bb6a4f901e9f 100644
    --- a/src/automation/target/kubernetes/kubernetes.yml
    +++ b/src/ztp/target/kubernetes/kubernetes.yml
    @@ -1,74 +1,61 @@
    -# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/)
    -#
    -# Licensed under the Apache License, Version 2.0 (the "License");
    -# you may not use this file except in compliance with the License.
    -# You may obtain a copy of the License at
    -#
    -#      http://www.apache.org/licenses/LICENSE-2.0
    -#
    -# Unless required by applicable law or agreed to in writing, software
    -# distributed under the License is distributed on an "AS IS" BASIS,
    -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    -# See the License for the specific language governing permissions and
    -# limitations under the License.
     ---
     apiVersion: v1
     kind: Service
     metadata:
       annotations:
    -    app.quarkus.io/commit-id: 8d0654b519e90fe0127e7d1419adce25fa3a179d
    -    app.quarkus.io/build-timestamp: 2023-07-10 - 09:42:53 +0000
    +    app.quarkus.io/commit-id: 46486023929121fc955e9550fc8fd625ded433d2
    +    app.quarkus.io/build-timestamp: 2023-12-15 - 12:04:12 +0000
         prometheus.io/scrape: "true"
         prometheus.io/path: /q/metrics
         prometheus.io/port: "8080"
         prometheus.io/scheme: http
       labels:
    -    app.kubernetes.io/name: automationservice
    -    app: automationservice
    -  name: automationservice
    +    app.kubernetes.io/name: ztpservice
    +    app: ztpservice
    +  name: ztpservice
     spec:
       ports:
    -    - name: http
    -      port: 9192
    -      targetPort: 8080
         - name: grpc-server
           port: 5050
           targetPort: 5050
    +    - name: http
    +      port: 9192
    +      targetPort: 8080
       selector:
    -    app.kubernetes.io/name: automationservice
    +    app.kubernetes.io/name: ztpservice
       type: ClusterIP
     ---
     apiVersion: apps/v1
     kind: Deployment
     metadata:
       annotations:
    -    app.quarkus.io/commit-id: 8d0654b519e90fe0127e7d1419adce25fa3a179d
    -    app.quarkus.io/build-timestamp: 2023-07-10 - 09:42:53 +0000
    +    app.quarkus.io/commit-id: 46486023929121fc955e9550fc8fd625ded433d2
    +    app.quarkus.io/build-timestamp: 2023-12-15 - 12:04:12 +0000
         prometheus.io/scrape: "true"
         prometheus.io/path: /q/metrics
         prometheus.io/port: "8080"
         prometheus.io/scheme: http
       labels:
    -    app: automationservice
    -    app.kubernetes.io/name: automationservice
    -  name: automationservice
    +    app: ztpservice
    +    app.kubernetes.io/name: ztpservice
    +  name: ztpservice
     spec:
       replicas: 1
       selector:
         matchLabels:
    -      app.kubernetes.io/name: automationservice
    +      app.kubernetes.io/name: ztpservice
       template:
         metadata:
           annotations:
    -        app.quarkus.io/commit-id: 8d0654b519e90fe0127e7d1419adce25fa3a179d
    -        app.quarkus.io/build-timestamp: 2023-07-10 - 09:42:53 +0000
    +        app.quarkus.io/commit-id: 46486023929121fc955e9550fc8fd625ded433d2
    +        app.quarkus.io/build-timestamp: 2023-12-15 - 12:04:12 +0000
             prometheus.io/scrape: "true"
             prometheus.io/path: /q/metrics
             prometheus.io/port: "8080"
             prometheus.io/scheme: http
           labels:
    -        app: automationservice
    -        app.kubernetes.io/name: automationservice
    +        app: ztpservice
    +        app.kubernetes.io/name: ztpservice
         spec:
           containers:
             - env:
    @@ -76,11 +63,11 @@ spec:
                   valueFrom:
                     fieldRef:
                       fieldPath: metadata.namespace
    -            - name: DEVICE_SERVICE_HOST
    -              value: deviceservice
                 - name: CONTEXT_SERVICE_HOST
                   value: contextservice
    -          image: labs.etsi.org:5050/tfs/controller/automation:0.2.0
    +            - name: DEVICE_SERVICE_HOST
    +              value: deviceservice
    +          image: labs.etsi.org:5050/tfs/controller/ztp:0.2.0
               imagePullPolicy: Always
               livenessProbe:
                 failureThreshold: 3
    @@ -92,14 +79,14 @@ spec:
                 periodSeconds: 10
                 successThreshold: 1
                 timeoutSeconds: 10
    -          name: automationservice
    +          name: ztpservice
               ports:
    -            - containerPort: 8080
    -              name: http
    -              protocol: TCP
                 - containerPort: 5050
                   name: grpc-server
                   protocol: TCP
    +            - containerPort: 8080
    +              name: http
    +              protocol: TCP
               readinessProbe:
                 failureThreshold: 3
                 httpGet:
    diff --git a/src/automation/util/set_version.sh b/src/ztp/util/set_version.sh
    similarity index 95%
    rename from src/automation/util/set_version.sh
    rename to src/ztp/util/set_version.sh
    index 578d2cd25beddad2a04096c585af5e0a356fbf3c..f4b6b09ade8643c9e407588d057b847078c320cd 100755
    --- a/src/automation/util/set_version.sh
    +++ b/src/ztp/util/set_version.sh
    @@ -28,4 +28,4 @@ if [ "$(git status --untracked-files=no --porcelain)" ]; then
     fi
     
     ./mvnw versions:set versions:commit -DnewVersion="${version}"
    -git commit -am "release(automation): ${version}"
    +git commit -am "release(ztp): ${version}"
    diff --git a/update_tfs_runtime_env_vars.sh b/update_tfs_runtime_env_vars.sh
    index 320b2ce0adc79cd8bde8c49ccd8a38f1d998faf3..d1e1b0ca5a28212cbd25478bdee73e782e7f27ec 100755
    --- a/update_tfs_runtime_env_vars.sh
    +++ b/update_tfs_runtime_env_vars.sh
    @@ -20,7 +20,7 @@
     
     # 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"}
    +export TFS_COMPONENTS=${TFS_COMPONENTS:-"context device monitoring service nbi webui"}
     
     # If not already set, set the name of the Kubernetes namespace to deploy to.
     export TFS_K8S_NAMESPACE=${TFS_K8S_NAMESPACE:-"tfs"}